LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::loadLnc Class Reference

class to load lnc-files (ascii format to store feature vectors) More...

#include <ltiLncFeatureFile.h>

Inheritance diagram for lti::loadLnc:
Inheritance graph
[legend]
Collaboration diagram for lti::loadLnc:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 loadLnc ()
 loadLnc (const parameters &par)
bool apply (dvector &vct, patternId &id)
bool apply (dmatrix &vcts, ivector &ids)
bool apply (dmatrix &vcts, ivector &ids, std::map< int, std::string > &names)
bool apply (dmatrix &vcts, ivector &ids, std::vector< std::string > &attribs, std::map< int, std::string > &names)
bool apply (dmatrix &vcts, ivector &ids, std::vector< std::string > &attribs)
bool load (const std::string &filename, dmatrix &vcts, ivector &ids, const bool useCnc=false)
bool load (const std::string &filename, dmatrix &vcts, ivector &ids, std::vector< std::string > &attribs, const bool useCnc=false)
bool load (const std::string &filename, dmatrix &vcts, ivector &ids, std::map< int, std::string > &names, const bool useCnc=false)
bool load (const std::string &filename, dmatrix &vcts, ivector &ids, std::vector< std::string > &attribs, std::map< int, std::string > &names, const bool useCnc=false)
void getClassNames (std::map< int, std::string > &names) const
void reset ()
virtual functorclone () const

Detailed Description

class to load lnc-files (ascii format to store feature vectors)

See also:
saveLnc

Constructor & Destructor Documentation

lti::loadLnc::loadLnc (  ) 

Default constructor.

Referenced by clone().

lti::loadLnc::loadLnc ( const parameters par  ) 

Constructor with parameters.


Member Function Documentation

bool lti::loadLnc::apply ( dmatrix vcts,
ivector ids,
std::vector< std::string > &  attribs 
)

load all the vectors in the file and leave the results in the given matrix.

The i-th row of the matrix will be the i-th vector on the file.

Parameters:
vcts the matrix where the vectors will be written
ids a vector, the class ids for each vector in the matrix. The i-th element of the vector contains the id of the i-th row of the matrix.
attribs a vector of std::string with the attributes for each pattern in the file
Returns:
true if everything is ok or false if the file is corrupted or not found.
bool lti::loadLnc::apply ( dmatrix vcts,
ivector ids,
std::vector< std::string > &  attribs,
std::map< int, std::string > &  names 
)

load all the vectors in the file and leave the results in the given matrix.

The i-th row of the matrix will be the i-th vector on the file.

Parameters:
vcts the matrix where the vectors will be written
ids a vector the class ids for each vector in the matrix. The i-th element of the vector contains the id of the i-th row of the matrix.
attribs a vector of std::string with the attributes for each pattern in the file
names a table with the corresponding names for each object id
Returns:
true if everything is ok or false if the file is corrupted or not found.
bool lti::loadLnc::apply ( dmatrix vcts,
ivector ids,
std::map< int, std::string > &  names 
)

load all the vectors in the file and leave the results in the given matrix.

The i-th row of the matrix will be the i-th vector on the file.

Parameters:
vcts the matrix where the vectors will be written
ids a vector the class ids for each vector in the matrix. The i-th element of the vector contains the id of the i-th row of the matrix.
names a table with the corresponding names for each object id
Returns:
true if everything is ok or false if the file is corrupted or not found.
bool lti::loadLnc::apply ( dmatrix vcts,
ivector ids 
)

load all the vectors in the file and leave the results in the given matrix.

The i-th row of the matrix will be the i-th vector on the file.

Parameters:
vcts the matrix where the vectors will be written
ids a vector the class ids for each vector in the matrix. The i-th element of the vector contains the id of the i-th row of the matrix.
Returns:
true if everything is ok or false if the file is corrupted or not found.
bool lti::loadLnc::apply ( dvector vct,
patternId id 
)

load the next vector in the file.

Parameters:
vct the vector object, where the readed data will be written
id the id of the class the vector belongs to.
Returns:
true if everything is ok, false if there is no more data left on the file. If the file is corrupted, a lti::exception will be thrown.
virtual functor* lti::loadLnc::clone (  )  const [inline, virtual]

clone member

Implements lti::functor.

References loadLnc().

void lti::loadLnc::getClassNames ( std::map< int, std::string > &  names  )  const

returns a map with the names of the classes for each object id.

bool lti::loadLnc::load ( const std::string &  filename,
dmatrix vcts,
ivector ids,
std::vector< std::string > &  attribs,
std::map< int, std::string > &  names,
const bool  useCnc = false 
)

shortcut to read the given lnc file, ignoring the filenames

Parameters:
filename name of the file to be loaded
vcts the matrix where the vectors will be written
ids a vector the class ids for each vector in the matrix. The i-th element of the vector contains the id of the i-th row of the matrix.
attribs a vector of std::string with the attributes for each pattern in the file
names a table with the corresponding names for each object id
useCnc use a class name file (extension cnc) to get the object names and corresponding ids.
Returns:
true if everything is ok or false if the file is corrupted or not found.
bool lti::loadLnc::load ( const std::string &  filename,
dmatrix vcts,
ivector ids,
std::map< int, std::string > &  names,
const bool  useCnc = false 
)

shortcut to read the given lnc file, ignoring the filenames

Parameters:
filename name of the file to be loaded
vcts the matrix where the vectors will be written
ids a vector the class ids for each vector in the matrix. The i-th element of the vector contains the id of the i-th row of the matrix.
names a table with the corresponding names for each object id
useCnc use a class name file (extension cnc) to get the object names and corresponding ids.
Returns:
true if everything is ok or false if the file is corrupted or not found.
bool lti::loadLnc::load ( const std::string &  filename,
dmatrix vcts,
ivector ids,
std::vector< std::string > &  attribs,
const bool  useCnc = false 
)

shortcut to read the given lnc file, ignoring the filenames

Parameters:
filename name of the file to be loaded
vcts the matrix where the vectors will be written
ids a vector the class ids for each vector in the matrix. The i-th element of the vector contains the id of the i-th row of the matrix.
attribs a vector of std::string with the attributes for each pattern in the file
useCnc use a class name file (extension cnc) to get the object names and corresponding ids.
Returns:
true if everything is ok or false if the file is corrupted or not found.
bool lti::loadLnc::load ( const std::string &  filename,
dmatrix vcts,
ivector ids,
const bool  useCnc = false 
)

shortcut to read the given lnc file, ignoring the filenames

Parameters:
filename name of the file to be loaded
vcts the matrix where the vectors will be written
ids a vector the class ids for each vector in the matrix. The i-th element of the vector contains the id of the i-th row of the matrix.
useCnc use a class name file (extension cnc) to get the object names and corresponding ids.
Returns:
true if everything is ok or false if the file is corrupted or not found.
void lti::loadLnc::reset (  ) 

restart reading the file (use only when a file need to be readed again)


The documentation for this class was generated from the following file:

Generated on Sat Apr 10 15:28:04 2010 for LTI-Lib by Doxygen 1.6.1