MOOSE - Multiscale Object Oriented Simulation Environment
|
Functions | |
char | BigEndianTest () |
void | change_shape_in_header (const string &filename, const size_t data_len, const size_t numcols) |
Change shape in numpy header. More... | |
bool | is_valid_numpy_file (FILE *fp) |
Check if a numpy file is sane or not. More... | |
char | map_type (const std::type_info &t) |
void | parse_header (FILE *fp, string &header) |
Parser header from a numpy file. Store it in vector. More... | |
template<typename T > | |
void | save_numpy (const string &outfile, const vector< double > &vec, vector< string > colnames, const string openmode, const char version= '1') |
void | split (vector< string > &strs, string &input, const string &pat) |
template<typename T > | |
void | write_header (FILE *fp, const vector< string > &colnames, vector< unsigned int >shape, char version) |
Variables | |
static char | __pre__ [__pre__size__] |
static const unsigned int | __pre__size__ = 8 |
char cnpy2::BigEndianTest | ( | ) |
Definition at line 29 of file cnpy.cpp.
Referenced by write_header().
void cnpy2::change_shape_in_header | ( | const string & | filename, |
const size_t | data_len, | ||
const size_t | numcols | ||
) |
Change shape in numpy header.
@param | data_len |
Definition at line 130 of file cnpy.cpp.
References parse_header(), moose::showWarn(), split(), and moose::toString().
Referenced by save_numpy().
bool cnpy2::is_valid_numpy_file | ( | FILE * | fp | ) |
Check if a numpy file is sane or not.
Read first 8 bytes and compare with standard header.
npy_file | Path to file. |
Definition at line 84 of file cnpy.cpp.
References __pre__, and __pre__size__.
Referenced by save_numpy().
char cnpy2::map_type | ( | const std::type_info & | t | ) |
Definition at line 36 of file cnpy.cpp.
Referenced by write_header().
void cnpy2::parse_header | ( | FILE * | fp, |
string & | header | ||
) |
Parser header from a numpy file. Store it in vector.
header |
Definition at line 109 of file cnpy.cpp.
References __pre__size__.
Referenced by change_shape_in_header().
void cnpy2::save_numpy | ( | const string & | outfile, |
const vector< double > & | vec, | ||
vector< string > | colnames, | ||
const string | openmode, | ||
const char | version = '1' |
||
) |
Definition at line 159 of file cnpy.hpp.
References change_shape_in_header(), is_valid_numpy_file(), moose::showError(), and moose::showWarn().
void cnpy2::split | ( | vector< string > & | strs, |
string & | input, | ||
const string & | pat | ||
) |
Definition at line 63 of file cnpy.cpp.
Referenced by change_shape_in_header().
void cnpy2::write_header | ( | FILE * | fp, |
const vector< string > & | colnames, | ||
vector< unsigned int > | shape, | ||
char | version | ||
) |
Definition at line 95 of file cnpy.hpp.
References __pre__, __pre__size__, BigEndianTest(), map_type(), and moose::toString().
|
static |
Definition at line 89 of file cnpy.hpp.
Referenced by is_valid_numpy_file(), and write_header().
|
static |
Definition at line 88 of file cnpy.hpp.
Referenced by is_valid_numpy_file(), parse_header(), and write_header().