PLearn 0.1
Namespaces | Functions
MatIO.h File Reference
#include <plearn/math/TMat.h>
#include "fileutils.h"
#include <plearn/base/stringutils.h>
#include <plearn/base/lexical_cast.h>
#include <plearn/base/tostring.h>
#include <plearn/io/openFile.h>
Include dependency graph for MatIO.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  PLearn
 

< for swap


Functions

Mat PLearn::makeMat (int length, int width, const string &values)
 convenience construction from string allows to write things such as Mat m = newMat(2,2, "1 2 3 4")
Vec PLearn::makeVec (int length, const string &values)
void PLearn::loadMat (const string &filename, TMat< float > &mat)
 Tries to guess the format...
void PLearn::loadMat (const string &file_name, TMat< double > &mat)
void PLearn::loadVec (const string &file_name, TVec< float > &vec)
void PLearn::loadVec (const string &file_name, TVec< double > &vec)
void PLearn::savePVec (const string &filename, const TVec< float > &vec)
 Native PLearn binary format (.pmat)
void PLearn::savePVec (const string &filename, const TVec< double > &vec)
void PLearn::loadPVec (const string &filename, TVec< float > &vec)
void PLearn::loadPVec (const string &filename, TVec< double > &vec)
void PLearn::savePMat (const string &filename, const TMat< float > &mat)
void PLearn::savePMat (const string &filename, const TMat< double > &mat)
void PLearn::savePMatFieldnames (const string &pmatfilename, const TVec< string > &fieldnames)
 Will save the fieldnames in corresponding pmatfilename.metadata/fieldnames (creating the metadata directory if necessary)
void PLearn::loadPMat (const string &filename, TMat< float > &mat)
void PLearn::loadPMat (const string &filename, TMat< double > &mat)
template<class T >
void PLearn::loadAscii (const PPath &filename, TMat< T > &mat, TVec< string > &fieldnames, int &inputsize, int &targetsize, int &weightsize, TVec< map< string, real > > *map_sr=0)
 WARNING: use only for float, double, and int types. Other type are not guaranteed to work.
template<class T >
void PLearn::loadAscii (const PPath &filename, TMat< T > &mat, TVec< string > &fieldnames, TVec< map< string, real > > *map_sr=0)
template<class T >
void PLearn::loadAscii (const PPath &filename, TMat< T > &mat)
void PLearn::parseSizeFromRemainingLines (const PPath &filename, PStream &in, bool &could_be_old_amat, int &length, int &width)
template<class T >
void PLearn::saveAscii (const string &filename, const TMat< T > &mat, const TVec< string > &fieldnames, int inputsize=-1, int targetsize=-1, int weightsize=-1, int extrasize=0)
template<class T >
void PLearn::saveAscii (const string &filename, const TMat< T > &mat)
template<class T >
void PLearn::saveAscii (const string &filename, const TVec< T > &vec)
 first number in file is length
template<class T >
void PLearn::loadAscii (const PPath &filename, TVec< T > &vec)
void PLearn::loadGnuplot (const string &filename, Mat &mat)
 Format readable by gnuplot.
void PLearn::saveGnuplot (const string &filename, const Vec &vec)
void PLearn::saveGnuplot (const string &filename, const Mat &mat)
void PLearn::matlabSave (const PPath &dir, const string &plot_title, const Vec &data, const Vec &add_col, const Vec &bounds, string legend, bool save_plot)
void PLearn::matlabSave (const PPath &dir, const string &plot_title, const Vec &xValues, const Vec &yValues, const Vec &add_col, const Vec &bounds, string legend, bool save_plot)
void PLearn::matlabSave (const PPath &dir, const string &plot_title, const Mat &data, const Vec &add_col, const Vec &bounds, TVec< string > legend=TVec< string >(), bool save_plot=true)
 Simply calls the coming matlabSave function with an empty xValues Vec. See below.
void PLearn::matlabSave (const PPath &dir, const string &plot_title, const Vec &xValues, const Mat &yValues, const Vec &add_col, const Vec &bounds, TVec< string > legend, bool save_plot)
void PLearn::loadAsciiWithoutSize (const string &filename, const Vec &vec)
 Reads and writes an ascii file without the size header (assuming that the size(length() and width()) is set)
void PLearn::saveAsciiWithoutSize (const string &filename, const Vec &vec)
void PLearn::loadAsciiWithoutSize (const string &filename, const Mat &mat)
void PLearn::saveAsciiWithoutSize (const string &filename, const Mat &mat)
Mat PLearn::loadSNMat (const string &filename)
 SN Format.
Vec PLearn::loadSNVec (const string &filename)
void PLearn::saveSNMat (const string &filename, const Mat &mat)
void PLearn::saveSNVec (const string &filename, const Vec &vec)
Mat PLearn::loadADMat (const string &filename)
 Native AD format.
Vec PLearn::loadADVec (const string &filename)
Mat PLearn::loadUCIMLDB (const string &filename, char ****to_symbols, int **to_n_symbols, TVec< int > *the_max_in_col, TVec< string > *header_columns)
Mat PLearn::loadSTATLOG (const string &filename, char ****to_symbols, int **to_n_symbols)
void PLearn::loadJPEGrgb (const string &jpeg_filename, Mat &rgbmat, int &row_size, int scale)
template<class T >
void PLearn::loadAscii (const PPath &filename, TMat< T > &mat, TVec< string > &fieldnames, int &inputsize, int &targetsize, int &weightsize, int &extrasize, TVec< map< string, real > > *map_sr)
template<class T >
void PLearn::loadAsciiSingleBinaryDescriptor (const PPath &filename, TMat< T > &mat)
 Load an ASCII matrix whose format is: (entry_name, long_binary_dscriptor) with 'long_binary_dscriptor' being of the form '001100101011', each character being an entry of the matrix.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines