|
| DataVector () |
| Create empty.
|
|
| DataVector (std::size_t size) |
| Create vector of given size with uninitialized data values.
|
|
| DataVector (std::size_t size, const T &value) |
| Create data vector with given size and fill all its' cells with given value .
|
|
| DataVector (const DataVector< CT > &src) |
| Copy constructor.
|
|
| DataVector (const DataVector< VT > &src) |
| Copy constructor.
|
|
template<typename TS > |
| DataVector (const DataVector< TS > &src) |
| Copy constructor.
|
|
DataVector< T > & | operator= (const DataVector< CT > &M) |
| Assign operator.
|
|
DataVector< T > & | operator= (const DataVector< VT > &M) |
| Assign operator.
|
|
| DataVector (DataVector< CT > &&src) noexcept |
| Move constructor.
|
|
| DataVector (DataVector< VT > &&src) noexcept |
| Move constructor.
|
|
DataVector< T > & | operator= (DataVector< T > &&src) noexcept |
| Move operator.
|
|
template<typename TS > |
| DataVector (TS *existing_data, std::size_t size) |
| Create vector out of existing data.
|
|
template<typename TS > |
| DataVector (TS *existing_data, std::size_t size, const std::function< void(void *)> &deleter) |
| Create vector out of existing data with guardian.
|
|
template<typename TS > |
| DataVector (TS *existing_data, std::size_t size, std::function< void(void *)> &&deleter) |
| Create vector out of existing data with guardian.
|
|
| DataVector (std::initializer_list< T > init) |
| Create data vector and fill it with data from initializer list.
|
|
template<typename TS > |
| DataVector (std::initializer_list< TS > init) |
| Create data vector and fill it with data from initializer list.
|
|
| ~DataVector () |
| Delete data if this was last reference to it.
|
|
void | reset () |
| Make this data vector points to nullptr data with 0-size.
|
|
template<typename TS > |
void | reset (TS *existing_data, std::size_t size) |
| Change data of this data vector.
|
|
template<typename TS > |
void | reset (TS *existing_data, std::size_t size, const std::function< void(void *)> &deleter) |
| Change data of this data vector.
|
|
template<typename TS > |
void | reset (TS *existing_data, std::size_t size, std::function< void(void *)> &&deleter) |
| Change data of this data vector.
|
|
void | reset (std::size_t size) |
| Change data of this data vector to uninitialized data with given size .
|
|
void | reset (std::size_t size, const T &value) |
| Change data of this to array of given size and fill all its' cells with given value .
|
|
template<typename InIterT > |
void | reset (InIterT begin, InIterT end) |
| Change data of this to copy of range [begin, end).
|
|
const_iterator | begin () const |
| Get iterator referring to the first object in data vector.
|
|
iterator | begin () |
| Get iterator referring to the first object in data vector.
|
|
const_iterator | end () const |
| Get iterator referring to the past-the-end object in data vector.
|
|
iterator | end () |
| Get iterator referring to the past-the-end object in data vector.
|
|
std::size_t | size () const |
|
const T * | data () const |
|
T * | data () |
|
const T & | operator[] (std::size_t n) const |
| Return reference to the (constant) n-th object of the data.
|
|
T & | operator[] (std::size_t n) |
| Return reference to the n-th object of the data.
|
|
| operator bool () const |
|
DataVector< VT > | copy () const |
| Make a deep copy of the data.
|
|
bool | unique () const |
| Check if this is the only one owner of data.
|
|
DataVector< VT > | remove_const () const |
| Allow to remove const qualifier from data, must be.
|
|
DataVector< VT > | claim () const |
| Make copy of data only if this is not the only one owner of it.
|
|
void | swap (DataVector< T > &other) noexcept |
| Swap all internals of this and other .
|
|
template<typename O > |
void | fill (const O &value) |
| Fill all data using given value.
|
|
DataVector< T > | getSubarrayRef (std::size_t begin_index, std::size_t subarray_size) |
| Get sub-array of this which refers to data of this.
|
|
DataVector< const T > | getSubarrayRef (std::size_t begin_index, std::size_t subarray_size) const |
| Get sub-array of this which refers to data of this.
|
|
DataVector< T > | getSubarrayCopy (std::size_t begin_index, std::size_t subarray_size) const |
| Get sub-array of this which copies the data (fragment) of this.
|
|
DataVector< T > | getSubrangeRef (iterator begin, iterator end) |
| Get sub-array of this which refers to data of this.
|
|
DataVector< const T > | getSubrangeRef (const_iterator begin, const_iterator end) const |
| Get sub-array of this which refers to data of this.
|
|
DataVector< T > | getSubrangeCopy (const_iterator begin, const_iterator end) |
| Get sub-array of this which copies the data (fragment) of this.
|
|
|
(Note that these are not member symbols.)
|
template<class T1 , class T2 > |
bool | operator== (DataVector< T1 > const &a, DataVector< T2 > const &b) |
| Check if two data vectors are equal.
|
|
template<class T1 , class T2 > |
bool | operator!= (DataVector< T1 > const &a, DataVector< T2 > const &b) |
| Check if two data vectors are not equal.
|
|
template<class T1 , class T2 > |
bool | operator< (DataVector< T1 > const &a, DataVector< T2 > const &b) |
| A lexical comparison of two data vectors.
|
|
template<class T1 , class T2 > |
bool | operator> (DataVector< T1 > const &a, DataVector< T2 > const &b) |
| A lexical comparison of two data vectors.
|
|
template<class T1 , class T2 > |
bool | operator<= (DataVector< T1 > const &a, DataVector< T2 > const &b) |
| A lexical comparison of two data vectors.
|
|
template<class T1 , class T2 > |
bool | operator>= (DataVector< T1 > const &a, DataVector< T2 > const &b) |
| A lexical comparison of two data vectors.
|
|
template<class T > |
std::ostream & | operator<< (std::ostream &out, DataVector< T > const &to_print) |
| Print data vector to stream.
|
|
template<class T , class S > |
DataVector< T > & | operator+= (DataVector< T > &to_inc, DataVector< S > const &inc_val) |
| Calculate: to_inc[i] += inc_val[i] for all vector elements.
|
|
template<class T , class S > |
DataVector< T > & | operator-= (DataVector< T > &to_dec, DataVector< S > const &dec_val) |
| Calculate: to_dec[i] -= dec_val[i] for all vector elements.
|
|
template<typename T , typename S > |
DataVector< T > & | operator*= (DataVector< T > &vec, S a) |
| Multiply each element of vec by a .
|
|
template<typename T , typename S > |
DataVector< T > & | operator/= (DataVector< T > &vec, S a) |
| Divide each element of vec by a .
|
|
template<typename T1 , typename T2 > |
DataVector< typename std::remove_cv< decltype(T1()+T2())>::type > | operator+ (DataVector< T1 > const &vec1, DataVector< T2 > const &vec2) |
| Calculate sum of two data vectors.
|
|
template<typename T1 , typename T2 > |
DataVector< typename std::remove_cv< decltype(T1() -T2())>::type > | operator- (DataVector< T1 > const &vec1, DataVector< T2 > const &vec2) |
| Calculate difference of two data vectors.
|
|
template<class T > |
DataVector< typename std::remove_cv< T >::type > | operator- (DataVector< T > const &vec) |
| Negate the data vector.
|
|
template<typename T , typename S > |
DataVector< typename std::remove_cv< decltype(T() *S())>::type > | operator* (DataVector< T > const &vec, S a) |
| Compute factor of vec and .
|
|
template<typename T , typename S > |
DataVector< typename std::remove_cv< decltype(S() *T())>::type > | operator* (S a, DataVector< T > const &vec) |
| Compute factor of a and vec .
|
|
template<typename T , typename S > |
DataVector< typename std::remove_cv< decltype(T() *(1./S()))>::type > | operator/ (DataVector< T > const &vec, S a) |
| Divide vec by a .
|
|
template<class T > |
std::remove_cv< T >::type | accumulate (const DataVector< T > &to_accum, typename std::remove_cv< T >::type initial=typename std::remove_cv< T >::type()) |
| Sum all elements in the vector.
|
|
template<typename RT , typename T > |
DataVector< RT > | const_data_cast (const DataVector< T > &src) |
| Cast DataVector<const T> into DataVector<T>
|
|
template<
typename T>
struct plask::DataVector< T >
Store pointer and size.
Is like intelligent pointer for plain data arrays.
Can work in two modes:
- managed — data will be deleted (by aligned_free) by destructor of last DataVector instance which referee to this data (reference counting is using);
- non-managed — data will be not deleted by DataVector (so DataVector just refers to external data).
In both cases, assign operation and copy constructor of DataVector do not copy the data, but just create DataVectors which refers to the same data. So both these operations are very fast.
Definition at line 126 of file data.hpp.