SG++-Doxygen-Documentation
FileIO.hpp File Reference
#include <sgpp/globaldef.hpp>
#include <sgpp/base/datatypes/DataMatrix.hpp>
#include <sgpp/base/datatypes/DataVector.hpp>
#include <sgpp/optimization/gridgen/IterativeGridGenerator.hpp>
#include <fstream>
#include <stdexcept>
#include <string>
#include <vector>

Namespaces

 sgpp
 This header contains some utility functions.
 
 sgpp::optimization
 
 sgpp::optimization::file_io
 Namespace with functions to write data (vectors, matrices, grids, ...) to a file.
 

Functions

template<>
const char * sgpp::optimization::file_io::getTypeString (const std::vector< uint8_t > &A)
 
template<>
const char * sgpp::optimization::file_io::getTypeString (const std::vector< uint16_t > &A)
 
template<>
const char * sgpp::optimization::file_io::getTypeString (const std::vector< uint32_t > &A)
 
template<>
const char * sgpp::optimization::file_io::getTypeString (const std::vector< uint64_t > &A)
 
template<>
const char * sgpp::optimization::file_io::getTypeString (const std::vector< float > &A)
 
template<>
const char * sgpp::optimization::file_io::getTypeString (const std::vector< double > &A)
 
template<class T >
const char * sgpp::optimization::file_io::getTypeString (const std::vector< T > &A)
 
template<>
const char * sgpp::optimization::file_io::getTypeString (const std::vector< std::string > &A)
 
template<>
void sgpp::optimization::file_io::readEntry (std::ifstream &f, std::string &entry)
 Read string from input stream (called by readMatrix()). More...
 
template<class T >
void sgpp::optimization::file_io::readEntry (std::ifstream &f, T &entry)
 Read bytes of entry representation from input stream (called by readMatrix()). More...
 
void sgpp::optimization::file_io::readGrid (const std::string &filename, base::GridStorage &gridStorage)
 Read a grid (only grid points) from a file. More...
 
void sgpp::optimization::file_io::readGrid (const std::string &filename, base::GridStorage &gridStorage, base::DataVector &functionValues)
 Read a grid (grid points and function values) from a file. More...
 
void sgpp::optimization::file_io::readMatrix (const std::string &filename, base::DataMatrix &A)
 Read a matrix from a file. More...
 
template<class T >
void sgpp::optimization::file_io::readMatrix (const std::string &filename, std::vector< T > &A, size_t &m, size_t &n)
 Read a matrix (stored row-wise in a std::vector) from a file. More...
 
void sgpp::optimization::file_io::readVector (const std::string &filename, base::DataVector &x)
 Read a base::DataVector from a file. More...
 
template<class T >
void sgpp::optimization::file_io::readVector (const std::string &filename, std::vector< T > &x)
 Read a std::vector from a file. More...
 
template<>
void sgpp::optimization::file_io::writeEntry (std::ofstream &f, const std::string &entry)
 Write string to output stream (called by writeMatrix()). More...
 
template<class T >
void sgpp::optimization::file_io::writeEntry (std::ofstream &f, const T &entry)
 Write bytes of entry representation to output stream (called by writeMatrix()). More...
 
void sgpp::optimization::file_io::writeGrid (const std::string &filename, const base::GridStorage &gridStorage)
 Write a grid (only grid points) to a file. More...
 
void sgpp::optimization::file_io::writeGrid (const std::string &filename, const base::GridStorage &gridStorage, const base::DataVector &functionValues)
 Write a grid (grid points and function values) to a file. More...
 
void sgpp::optimization::file_io::writeMatrix (const std::string &filename, base::DataMatrix &A)
 Write a base::DataMatrix to a file. More...
 
template<class T >
void sgpp::optimization::file_io::writeMatrix (const std::string &filename, const std::vector< T > &A, size_t m, size_t n)
 Write a matrix (stored row-wise in a std::vector) to a file. More...
 
void sgpp::optimization::file_io::writeVector (const std::string &filename, base::DataVector &x)
 Write a base::DataVector to a file. More...
 
template<class T >
void sgpp::optimization::file_io::writeVector (const std::string &filename, const std::vector< T > &x)
 Write a std::vector to a file. More...