LDA++
|
#include <NumpyFormat.hpp>
Public Member Functions | |
NumpyOutput (const Scalar *data, std::vector< size_t > shape, bool fortran) | |
template<int Rows, int Cols, int Options> | |
NumpyOutput (const Eigen::Matrix< Scalar, Rows, Cols, Options > &matrix) | |
std::string | dtype () const |
const char * | data () const |
const std::vector< size_t > & | shape () const |
bool | fortran_contiguous () const |
Friends | |
std::ostream & | operator<< (std::ostream &os, const NumpyOutput &data) |
NumpyOutput provides an easy way to serialize a contiguous array using the numpy format.
Examples:
MatrixXf x = MatrixXf::Random(10, 20); std::cout << numpy_format::NumpyOutput<float>(x);
|
inline |
Construct a NumpyOutput object from raw data.
data | The contiguous in memory data |
shape | The logical array shape of the data |
fortran | Wether the data is row major (false) or column major (true) order |
|
inline |
Construct a NumpyOutput object from any Eigen Matrix.
matrix | The matrix containing the data |
|
inline |
Return the data as a constant character array.
|
inline |
Return the numpy dtype for the data including the endianess.
|
inline |
Wether the data is fortran contiguous (column major) or C contiguous (row major).
|
inline |
Return a vector containing the shape of the numpy array (rows, columns, etc).
|
friend |
This operator implements the npy format for a block of NumpyOutput of type Scalar.