ndarray
NumPy-friendly multidimensional arrays in C++
|
Classes | |
struct | ndarray::ArrayTraits< T, N, C > |
Dimension-specialized traits shared by Array and ArrayRef. More... | |
struct | ndarray::ExpressionTraits< Expression_ > |
Traits for expressions. More... | |
class | ndarray::NumericTraits< T, U, is_complex, is_arithmetic > |
Numeric type traits. More... | |
class | ndarray::Promote< T1, T2, winner, is_complex > |
Metafunction to compute numeric promotions. More... | |
struct | ndarray::ApproximatelyEqual< T1, T2 > |
Binary predicate for floating point equality comparison with tolerance. More... | |
struct | ndarray::ApproximatelyEqual< std::complex< U1 >, std::complex< U2 > > |
Binary predicate for complex floating point equality comparison with tolerance. More... | |
class | ndarray::ArrayBase< Derived > |
CRTP implementation for Array and ArrayRef. More... | |
class | ndarray::ExpressionBase< Derived > |
CRTP base class for all multidimensional expressions. More... | |
class | ndarray::FormatOptions |
Options for controlling stream output of ExpressionBase. More... | |
Functions | |
template<typename T_ , typename T , int N, int C> | |
Array< T_, N, C > | ndarray::const_array_cast (Array< T, N, C > const &array) |
template<int C_, typename T , int N, int C> | |
Array< T, N, C_ > | ndarray::static_dimension_cast (Array< T, N, C > const &array) |
template<int C_, typename T , int N, int C> | |
Array< T, N, C_ > | ndarray::dynamic_dimension_cast (Array< T, N, C > const &array) |
template<typename Array_ > | |
detail::ComplexExtractor< Array_ >::Result | ndarray::getReal (Array_ const &array) |
Return an ArrayRef view into the real part of a complex array. | |
template<typename Array_ > | |
detail::ComplexExtractor< Array_ >::Result | ndarray::getImag (Array_ const &array) |
Return an ArrayRef view into the imaginary part of a complex array. | |
template<int Nf, typename T , int N, int C> | |
boost::enable_if_c<((C+Nf-N)>=1), ArrayRef< T, Nf,(C+Nf-N)> >::type | ndarray::flatten (Array< T, N, C > const &input) |
Create a view into an array with trailing contiguous dimensions merged. | |
template<int Nf, typename T , int N, int C> | |
boost::enable_if_c<((C+Nf-N)>=1), ArrayRef< T, Nf,(C+Nf-N)> >::type | ndarray::flatten (ArrayRef< T, N, C > const &input) |
Create a view into an array with trailing contiguous dimensions merged. | |
template<int N, typename U > | |
detail::SimpleInitializer< N > | ndarray::allocate (Vector< U, N > const &shape) |
Create an expression that allocates uninitialized memory for an array. | |
detail::SimpleInitializer< 1 > | ndarray::allocate (Size n) |
Create an expression that allocates uninitialized memory for a 1-d array. | |
detail::SimpleInitializer< 2 > | ndarray::allocate (Size n1, Size n2) |
Create an expression that allocates uninitialized memory for a 2-d array. | |
detail::SimpleInitializer< 3 > | ndarray::allocate (Size n1, Size n2, Size n3) |
Create an expression that allocates uninitialized memory for a 3-d array. | |
template<typename Derived > | |
ArrayRef< typename boost::remove_const< typename Derived::Element >::type, Derived::ND::value, Derived::ND::value > | ndarray::copy (ExpressionBase< Derived > const &expr) |
Create a new Array by copying an Expression. | |
template<int N> | |
Vector< Offset, N > | ndarray::computeStrides (Vector< Size, N > const &shape, DataOrderEnum order=ROW_MAJOR) |
Compute row- or column-major strides for the given shape. | |
template<typename T , int N, typename U , typename V , typename Owner > | |
detail::ExternalInitializer< T, N, Owner > | ndarray::external (T *data, Vector< U, N > const &shape, Vector< V, N > const &strides, Owner const &owner) |
Create an expression that initializes an Array with externally allocated memory. | |
template<typename T , int N, typename U , typename V > | |
detail::ExternalInitializer< T, N, detail::NullOwner > | ndarray::external (T *data, Vector< U, N > const &shape, Vector< V, N > const &strides) |
Create an expression that initializes an Array with externally allocated memory. | |
template<typename T , int N, typename U , typename Owner > | |
detail::ExternalInitializer< T, N, Owner > | ndarray::external (T *data, Vector< U, N > const &shape, DataOrderEnum order, Owner const &owner) |
Create an expression that initializes an Array with externally allocated memory. | |
template<typename T , int N, typename U > | |
detail::ExternalInitializer< T, N, detail::NullOwner > | ndarray::external (T *data, Vector< U, N > const &shape, DataOrderEnum order=ROW_MAJOR) |
Create an expression that initializes an Array with externally allocated memory. | |
template<typename Derived > | |
bool | ndarray::any (ExpressionBase< Derived > const &expr) |
Return true if any of the elements of the given expression are true. | |
template<typename Derived > | |
bool | ndarray::all (ExpressionBase< Derived > const &expr) |
Return true if all of the elements of the given expression are true. | |
template<typename Derived > | |
Derived::Element | ndarray::sum (ExpressionBase< Derived > const &expr) |
Return the sum of all elements of the given expression. | |
|
inline |
Return true if all of the elements of the given expression are true.
|
inline |
Create an expression that allocates uninitialized memory for a 1-d array.
|
inline |
Create an expression that allocates uninitialized memory for a 2-d array.
|
inline |
Create an expression that allocates uninitialized memory for a 3-d array.
|
inline |
Create an expression that allocates uninitialized memory for an array.
|
inline |
Return true if any of the elements of the given expression are true.
Array< T_, N, C > ndarray::const_array_cast | ( | Array< T, N, C > const & | array | ) |
Convert an Array with a const data type to an array with a non-const data type.
|
inline |
Create an expression that initializes an Array with externally allocated memory.
No checking is done to ensure the shape and data pointers are sensible.
[in] | data | A raw pointer to the first element of the Array. |
[in] | shape | A Vector of dimensions for the new Array. |
[in] | order | Whether the strides are row- or column-major. |
[in] | owner | A copy-constructable object with an internal reference count that owns the memory pointed at by 'data'. |
|
inline |
Create an expression that initializes an Array with externally allocated memory.
No checking is done to ensure the shape and data pointers are sensible. Memory will not be managed at all; the user must ensure the data pointer remains valid for the lifetime of the array.
[in] | data | A raw pointer to the first element of the Array. |
[in] | shape | A Vector of dimensions for the new Array. |
[in] | order | Whether the strides are row- or column-major. |
|
inline |
Create an expression that initializes an Array with externally allocated memory.
No checking is done to ensure the shape, strides, and data pointers are sensible. Memory will not be managed at all; the user must ensure the data pointer remains valid for the lifetime of the array.
[in] | data | A raw pointer to the first element of the Array. |
[in] | shape | A Vector of dimensions for the new Array. |
[in] | strides | A Vector of strides for the new Array. |
|
inline |
Create an expression that initializes an Array with externally allocated memory.
No checking is done to ensure the shape, strides, and data pointers are sensible.
[in] | data | A raw pointer to the first element of the Array. |
[in] | shape | A Vector of dimensions for the new Array. |
[in] | strides | A Vector of strides for the new Array. |
[in] | owner | A copy-constructable object with an internal reference count that owns the memory pointed at by 'data'. |
|
inline |
Create a view into an array with trailing contiguous dimensions merged.
The first template parameter sets the dimension of the output array and must be specified directly. Only row-major contiguous dimensions can be flattened.
|
inline |
Create a view into an array with trailing contiguous dimensions merged.
The first template parameter sets the dimension of the output array and must be specified directly. Only row-major contiguous dimensions can be flattened.
Array< T, N, C_ > ndarray::static_dimension_cast | ( | Array< T, N, C > const & | array | ) |
Convert an Array to a type with more guaranteed row-major-contiguous dimensions with no checking.
|
inline |
Return the sum of all elements of the given expression.