
Definition at line 22 of file Reader.hpp.
Public Member Functions | |
| Reader (std::istream *in) | |
| Construct new reader from an input stream, where all columns are of interest. | |
| Reader (const std::string &file) | |
| Construct new reader from a file, where all columns are of interest. | |
| Reader (std::istream *in, unsigned int col) | |
| Construct new reader from an input stream, where only a single column is of interest. | |
| Reader (const std::string &file, unsigned int col) | |
| Construct new reader from a file, where only a single column is of interest. | |
| Reader (std::istream *in, const std::vector< unsigned int > &cols) | |
| Construct new reader from an input stream, where only a subset of columns are of interest. | |
| Reader (const std::string &file, const std::vector< unsigned int > &cols) | |
| Construct new reader from a file, where only a subset of columns are of interest. | |
| virtual | ~Reader () |
| Destructor. | |
| virtual unsigned int | read (double *into)=0 |
| Read next value. | |
| virtual unsigned int | read (indii::ml::aux::vector *into)=0 |
| Read next values into vector. | |
| virtual unsigned int | read (indii::ml::aux::matrix *into)=0 |
| Read next values into matrix. | |
| virtual unsigned int | read (indii::ml::aux::symmetric_matrix *into)=0 |
| Read next values into symmetric matrix. | |
Protected Attributes | |
| std::istream * | in |
| The input stream. | |
| std::vector < unsigned int > | cols |
| Columns of interest. | |
| Reader | ( | std::istream * | in | ) |
Construct new reader from an input stream, where all columns are of interest.
| in | Stream from which to read. |
Definition at line 7 of file Reader.cpp.
| Reader | ( | const std::string & | file | ) |
Construct new reader from a file, where all columns are of interest.
| file | Name of file from which to read. |
Definition at line 11 of file Reader.cpp.
| Reader | ( | std::istream * | in, | |
| unsigned int | col | |||
| ) |
Construct new reader from an input stream, where only a single column is of interest.
| in | Stream from which to read. | |
| col | Index of the column of interest. |
Definition at line 15 of file Reader.cpp.
| Reader | ( | const std::string & | file, | |
| unsigned int | col | |||
| ) |
Construct new reader from a file, where only a single column is of interest.
| file | Name of file from which to read. | |
| col | Index of the column of interest . |
Definition at line 20 of file Reader.cpp.
| Reader | ( | std::istream * | in, | |
| const std::vector< unsigned int > & | cols | |||
| ) |
Construct new reader from an input stream, where only a subset of columns are of interest.
| in | Stream from which to read. | |
| cols | Indices of the columns of interest from the input stream, in the order of interest. |
Definition at line 25 of file Reader.cpp.
| Reader | ( | const std::string & | file, | |
| const std::vector< unsigned int > & | cols | |||
| ) |
Construct new reader from a file, where only a subset of columns are of interest.
| file | Name of file from which to read. | |
| cols | Indices of the columns of interest from the input stream, in the order of interest. |
Definition at line 30 of file Reader.cpp.
| ~Reader | ( | ) | [virtual] |
Destructor.
The input stream is closed if the object was created using a file name, but left open otherwise.
Definition at line 35 of file Reader.cpp.
| virtual unsigned int read | ( | double * | into | ) | [pure virtual] |
Read next value.
| into | Double into which to read the value. |
into. If a particular column or subset of columns of interest have been specified, all others are skipped during the reading.
Implemented in TextFileReader.
| virtual unsigned int read | ( | indii::ml::aux::vector * | into | ) | [pure virtual] |
Read next values into vector.
| into | Vector into which to read the values. |
into.size() values are read from the input stream into into. If a particular column or subset of columns of interest have been specified, all others are skipped during the reading.
Implemented in TextFileReader.
| virtual unsigned int read | ( | indii::ml::aux::matrix * | into | ) | [pure virtual] |
Read next values into matrix.
| into | Matrix into which to read the values. |
into.size1() * into.size2() values are read from the input stream into into in column-wise fashion. If a particular column or subset of columns of interest have been specified, all others are skipped during the reading.
Implemented in TextFileReader.
| virtual unsigned int read | ( | indii::ml::aux::symmetric_matrix * | into | ) | [pure virtual] |
Read next values into symmetric matrix.
| into | Matrix into which to read the values. |
0.5 * (into.size1() * into.size1() + into.size1()) values are read from the input stream into the lower triangle of into in column-wise fashion. If a particular column or subset of columns of interest have been specified, all others are skipped during the reading.
Implemented in TextFileReader.
std::istream* in [protected] |
std::vector<unsigned int> cols [protected] |
Columns of interest.
Empty if all columns are of interest.
Definition at line 155 of file Reader.hpp.
1.5.3