LDA++
Public Member Functions | Friends | List of all members
ldaplusplus::numpy_format::NumpyInput< Scalar > Class Template Reference

#include <NumpyFormat.hpp>

Public Member Functions

const bool fortran_contiguous () const
 
const Scalar * data () const
 
const std::vector< size_t > & shape () const
 
template<int Rows, int Cols, int Options>
 operator Eigen::Matrix< Scalar, Rows, Cols, Options > () const
 

Friends

std::istream & operator>> (std::istream &is, NumpyInput &data)
 

Detailed Description

template<typename Scalar>
class ldaplusplus::numpy_format::NumpyInput< Scalar >

NumpyInput allows the unserialization of a contiguous numpy array from a stream.

Example:

numpy_format::NumpyInput<float> ni;
std::cin >> ni;
MatrixXf x = ni;

Member Function Documentation

template<typename Scalar>
template<int Rows, int Cols, int Options>
ldaplusplus::numpy_format::NumpyInput< Scalar >::operator Eigen::Matrix< Scalar, Rows, Cols, Options > ( ) const
inline

This operator allows the implicit cast of a NumpyInput to a compatible Eigen matrix.

numpy_format::NumpyInput<float> ni;
std::cin >> ni;
MatrixXf x = ni; // this conversion is done with this operator

Friends And Related Function Documentation

template<typename Scalar>
std::istream& operator>> ( std::istream &  is,
NumpyInput< Scalar > &  data 
)
friend

Parse the serialized numpy array into a NumpyInput from an input strem.

numpy_format::NumpyInput<float> ni;
std::cin >> ni; // this operator here

Only version 1 of the numpy format is supported but that should not present any problems.


The documentation for this class was generated from the following file: