6 #ifndef MYRAMATH_DENSE_CSVREAD_H 7 #define MYRAMATH_DENSE_CSVREAD_H 15 #include <myramath/MYRAMATH_EXPORT.h> 18 #include <myramath/expression/vector.h> 29 template<
class Number>
class Matrix;
30 template<
class Number>
class Vector;
35 std::ifstream in(filename);
39 std::vector<Number> v;
42 while (std::getline(in,rowstr))
44 std::stringstream row(rowstr);
48 while(std::getline(row,cellstr,
','))
50 std::stringstream cell(cellstr);
60 for (
int i = 1; i < I; ++i)
62 throw eprintf(
"csvread_Matrix(), size mismatch between rows J[%d] != J[0] [%d != %d]",i,J[i],J[0]);
70 std::ifstream in(filename);
71 std::vector<Number> v;
82 std::ifstream in(filename);
Vector< Number > csvread_Vector(const char *filename)
Loads a Vector from a .csv file.
Definition: csvread.h:68
Reshapes an Expression (for instance, reinterpret an arity-1 Expression of size 25 into an arity-2 Ex...
Returns a std::runtime_error() whose message has been populated using printf()-style formatting...
Tabulates an IxJ matrix. Allows random access, has column major layout to be compatible with BLAS/LAP...
Definition: bdsqr.h:20
Matrix< Number > csvread_Matrix(const char *filename)
Loads a Matrix from a .csv file.
Definition: csvread.h:33
Returns the transpose of an arity-2 Expression.
Various utility functions/classes related to scalar Number types.
Tabulates a vector of length N, allows random access.
Definition: conjugate.h:21
static Matrix< Number > evaluate(const Expression< 2, Number > &e)
Generates a Matrix by evaluating an arity-2 Expression of Number.
Definition: Matrix.cpp:378
std::vector< T > csvread_vector(const char *filename)
Loads a std::vector from a .csv file.
Definition: csvread.h:80
static Vector< Number > evaluate(const Expression< 1, Number > &e)
Generates a Vector by evaluating an arity-1 Expression of Number.
Definition: Vector.cpp:313