Loading...
Searching...
No Matches
cnpy.H File Reference
#include <Eigen/Eigen>
#include <unsupported/Eigen/CXX11/Tensor>
#include <string>
#include <stdexcept>
#include <sstream>
#include <vector>
#include <cstdio>
#include <typeinfo>
#include <iostream>
#include <cassert>
#include <zlib.h>
#include <map>
#include <memory>
#include <stdint.h>
#include <numeric>
#include <regex>

Go to the source code of this file.

Classes

struct  cnpy::NpyArray
 

Namespaces

namespace  cnpy
 

Typedefs

using cnpy::npz_t = std::map<std::string, NpyArray>
 

Functions

char cnpy::BigEndianTest ()
 
char cnpy::map_type (const std::type_info &t)
 
template<typename T >
std::vector< char > cnpy::create_npy_header (const std::vector< size_t > &shape)
 
void cnpy::parse_npy_header (FILE *fp, size_t &word_size, std::vector< size_t > &shape, bool &fortran_order, std::string &number_type)
 
void cnpy::parse_npy_header (unsigned char *buffer, size_t &word_size, std::vector< size_t > &shape, bool &fortran_order, std::string &number_type)
 
void cnpy::parse_zip_footer (FILE *fp, uint16_t &nrecs, size_t &global_header_size, size_t &global_header_offset)
 
npz_t cnpy::npz_load (std::string fname)
 
NpyArray cnpy::npz_load (std::string fname, std::string varname)
 
NpyArray cnpy::npy_load (std::string fname)
 
template<typename T >
std::vector< char > & cnpy::operator+= (std::vector< char > &lhs, const T rhs)
 
template<>
std::vector< char > & cnpy::operator+= (std::vector< char > &lhs, const std::string rhs)
 
template<>
std::vector< char > & cnpy::operator+= (std::vector< char > &lhs, const char *rhs)
 
template<typename T >
void cnpy::npy_save (std::string fname, const T *data, const std::vector< size_t > shape, std::string mode="w")
 
template<typename T >
void cnpy::npz_save (std::string zipname, std::string fname, const T *data, const std::vector< size_t > &shape, std::string mode="w")
 
template<typename T >
void cnpy::npy_save (std::string fname, const std::vector< T > data, std::string mode="w")
 
template<typename T >
void cnpy::npz_save (std::string zipname, std::string fname, const std::vector< T > data, std::string mode="w")
 
template<typename T , int dim>
Eigen::Matrix< T, -1, dim > cnpy::load (Eigen::Matrix< T, -1, dim > &mat, const std::string fname, std::string order="rowMajor")
 
template<typename T >
Eigen::SparseMatrix< Tcnpy::load (Eigen::SparseMatrix< T > &mat, const std::string fname)
 
template<typename T >
Eigen::Tensor< T, 3 > cnpy::load (Eigen::Tensor< T, 3 > &tens, const std::string fname, std::string order="rowMajor")
 
template<typename T , int dim>
void cnpy::save (const Eigen::Matrix< T, -1, dim > &mat, const std::string fname)
 
template<typename T >
void cnpy::save (const Eigen::Tensor< T, 3 > &tensor, const std::string fname)
 
template<typename T >
void cnpy::save (const Eigen::SparseMatrix< T > &mat, const std::string fname)
 
cnpy::NpyArray cnpy::load_the_npy_file (FILE *fp)
 
cnpy::NpyArray cnpy::load_the_npy_file (std::string fname)