Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

FlexibleTable< T > Class Template Reference
[Functions internal to LinAlg]

FlexibleTable<T> is intended for reading a table of columnar data from a file. More...

#include <flexibletable.h>

List of all members.

Public Member Functions

 FlexibleTable ()
 Default constructor; initializes size to zero.
itype Rows () const
 Returns the number of rows in the table.
itype Columns () const
 Returns the length of the longest row.
itype ReadLine (const std::string line)
 Parses a string, and adds it to the table as a new row.
itype ReadTable (std::istream &input, bool TerminateAtDoubleEOL=true)
 Parses a stream, adding one line at a time until EOF or double EOL.
void TruncateLength (itype maxrows)
 Removes all rows beyond maxrows.
void TruncateWidth (itype maxcols)
 Truncates each row to maxcols elements, if necessary.
void Clear ()
 Return the FlexibleTable to its virgin state.
void CopyToData (matrixview< T > &storage, T NullValue=0)
 Initialize storage with this table's data.
std::ostream & print (std::ostream &output, T NullValue=0)
 Print the table to output.


Detailed Description

template<class T>
class FlexibleTable< T >

FlexibleTable<T> is intended for reading a table of columnar data from a file.

FlexibleTable<T> is optimized for fault-tolerance and flexibility -- not for performance. Data is stored internally using STL structures, specifically a std::list of std::vector<T>. Thus, the FlexibleTable should not be used for data access. In fact, it provides no access to individual data elements. Instead, once the data is read in from a file using the ReadTable() method, it should be copied into a matrixview<T> object using CopyToData(). Alternatively, it can be output to a stream using the print() method. Before output, the FlexibleTable can be truncated using TruncateLength() and TruncateWidth(), or re-initialized using Clear().

Notes:


The documentation for this class was generated from the following file:
Generated on Wed Jun 14 22:25:28 2006 for linalg by  doxygen 1.4.4