|
| NumberArray () |
|
| Alloc (n, x) |
|
| Nres_ (size()) |
|
| name_ () |
|
| NumberArray (size_t n, T const *x) |
|
| NumberArray (ArrayView< T > const &a) |
|
| NumberArray (NumberArray< T > const &a) |
|
| NumberArray (std::vector< T > const &a) |
|
| NumberArray (std::initializer_list< T > a) |
|
template<typename ForwardIterator > |
| NumberArray (ForwardIterator i, ForwardIterator j) |
|
| NumberArray (NumberArray< T > &&a) |
|
| ~NumberArray () |
|
size_t | size () const |
| Item count. More...
|
|
virtual size_t | resize (size_t n) |
| Resize array. More...
|
|
size_t | reserve (size_t n) |
| Reserve memory. More...
|
|
T & | operator[] (size_t i) |
| Element-wise access (non-const). More...
|
|
T const & | operator[] (size_t i) const |
| Element-wise access (const). More...
|
|
iterator | begin () |
|
const_iterator | begin () const |
|
const_iterator | cbegin () const |
|
iterator | end () |
|
const_iterator | end () const |
|
const_iterator | cend () const |
|
T & | front (int i=0) |
|
T const & | front (int i=0) const |
|
T & | back (int i=0) |
|
T const & | back (int i=0) const |
|
virtual void | push_front (T const &a) |
| Add element to beginning. More...
|
|
virtual void | push_back (T const &a) |
| Add element to end. More...
|
|
T | pop_back () |
| Remove the last element. More...
|
|
template<class InputIterator > |
void | append (InputIterator first, InputIterator last) |
| Append a range of values at end. More...
|
|
bool | empty () const |
| Check that size equals to zero. More...
|
|
void | clear () |
| Fill array with zeros. More...
|
|
void | drop () |
| Reset array: deallocate everything, resize to zero. More...
|
|
NumberArray< T > & | operator= (NumberArray< T > const &b) |
|
NumberArray< T > & | operator= (NumberArray< T > &&b) |
|
NumberArray< T > | conj () const |
| Return complex conjugated array. More...
|
|
double | norm () const |
| Compute usual 2-norm. More...
|
|
template<class Functor > |
auto | transform (Functor f) const -> NumberArray< decltype(f(T(0)))> |
| Apply a user transformation. More...
|
|
ArrayView< T > | slice (size_t left, size_t right) const |
| Return a subarray using ArrayView. More...
|
|
std::string | toBlob () const |
| Convert to SQL BLOB. More...
|
|
void | fromBlob (std::string const &s) |
| Convert from SQL BLOB. More...
|
|
void | link (std::string name) |
| Link to HDF file. More...
|
|
std::tuple< NumberArray< int >
, NumberArray< T > > | compress (int consec) const |
| Get compressed array. More...
|
|
NumberArray< T > | decompress (NumberArray< int > const &zero_blocks) const |
| Decompress array. More...
|
|
|
virtual T * | data () |
| Data pointer. More...
|
|
virtual T const * | data () const |
|
|
bool | hdfsave (std::string name, bool docompress=false, int consec=10) const |
| Save array to HDF file. More...
|
|
bool | hdfsave () const |
|
|
bool | hdfload (std::string name) |
| Load array from HDF file. More...
|
|
bool | hdfload () |
|
| Array () |
|
| Alloc::alloc (n)) |
|
| Array (size_t n, T const *const x) |
|
| Array (Array< T > const &a) |
|
| Array (const ArrayView< T > a) |
|
| Array (Array< T > &&a) |
|
| Array (std::vector< T > const &a) |
|
| Array (std::initializer_list< T > a) |
|
template<typename ForwardIterator > |
| Array (ForwardIterator i, ForwardIterator j) |
|
| ~Array () |
|
size_t | size () const |
| Return number of elements. More...
|
|
T & | operator[] (size_t i) |
| Element-wise access (non-const). More...
|
|
T const & | operator[] (size_t i) const |
| Element-wise access (const). More...
|
|
iterator | begin () |
|
const_iterator | begin () const |
|
iterator | end () |
|
const_iterator | end () const |
|
T & | front (int i=0) |
|
T const & | front (int i=0) const |
|
T & | back (int i=0) |
|
T const & | back (int i=0) const |
|
template<class InputIterator > |
void | append (InputIterator first, InputIterator last) |
| Append more items. More...
|
|
void | insert (iterator it, T x) |
| Insert item. More...
|
|
bool | empty () const |
| Check that size equals to zero. More...
|
|
Array< T > & | operator= (Array< T > const &b) |
|
Array< T > & | operator= (Array< T > &&b) |
|
| ArrayView () |
|
| ArrayView (size_t n, T *ptr) |
|
| ArrayView (ArrayView< T > const &a, size_t i=0, size_t n=0) |
|
| ArrayView (Array< T > const &a, size_t i=0, size_t n=0) |
|
| ArrayView (NumberArray< T > const &a, size_t i=0, size_t n=0) |
|
| ArrayView (const_iterator i, const_iterator j) |
|
| ArrayView (ArrayView< T > &&r) |
|
virtual | ~ArrayView () |
|
ArrayView< T > & | operator= (const ArrayView< T > v) |
| Assignment operator. More...
|
|
T & | operator[] (size_t i) |
| Element-wise access (non-const). More...
|
|
T const & | operator[] (size_t i) const |
| Element-wise access (const). More...
|
|
size_t | size () const |
| Length of the array (number of elements). More...
|
|
iterator | begin () |
|
const_iterator | begin () const |
|
iterator | end () |
|
const_iterator | end () const |
|
T & | front (int i=0) |
|
T const & | front (int i=0) const |
|
T & | back (int i=0) |
|
T const & | back (int i=0) const |
|
void | fill (T x) |
| Fill the array with a value. More...
|
|
bool | empty () const |
| Check whether the size is equal to zero. More...
|
|
template<class = typename std::enable_if<is_scalar<T>::value>> |
double | norm () const |
| Two-norm (defined only for scalar data type). More...
|
|
template<class T, class Alloc = PlainAllocator<T>>
class NumberArray< T, Alloc >
Class NumberArray is intended as a Hex's replacement for std::vector<T> for number type T. Properties:
- correct memory alignment of the storage
- even number of allocated elements (zero padded) for the use in SSE accelerators
- reserved storage reducing necessary reallocations
- basic iterator interface (members Array::begin(), Array::end()).
- HDF5 interface (ability to save and load to/from HDF5 data files)
- a collection of overloaded arithmetic operators (sum of two arrays, difference, multiplication by a number etc.)