Reader Class Reference

Inheritance diagram for Reader:

Inheritance graph
[legend]

List of all members.


Detailed Description

Abstract reader for data files.

Author:
Lawrence Murray <lawrence@indii.org>
Version:
Rev
Date:
Date

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.

Constructor & Destructor Documentation

Reader ( std::istream *  in  ) 

Construct new reader from an input stream, where all columns are of interest.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.


Member Function Documentation

virtual unsigned int read ( double *  into  )  [pure virtual]

Read next value.

Parameters:
into Double into which to read the value.
Returns:
Number of values actually read. Will be 1 if a value is successfully read, and 0 if the end of the stream is reached during reading.
One value is 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::vector into  )  [pure virtual]

Read next values into vector.

Parameters:
into Vector into which to read the values.
Returns:
Number of values actually read. Will be less than the size of the given vector if the end of the stream is reached during reading.
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.

Parameters:
into Matrix into which to read the values.
Returns:
Number of values actually read. Will be less than the size of the given matrix if the end of the stream is reached during reading.
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.

Parameters:
into Matrix into which to read the values.
Returns:
Number of values actually read. Will be less than the size of the lower triangular portion of the given matrix if the end of the stream is reached during reading.
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.


Member Data Documentation

std::istream* in [protected]

The input stream.

Definition at line 150 of file Reader.hpp.

std::vector<unsigned int> cols [protected]

Columns of interest.

Empty if all columns are of interest.

Definition at line 155 of file Reader.hpp.


Generated on Wed Dec 17 15:11:58 2008 for dysii Dynamical Systems Library by  doxygen 1.5.3