Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

MatrixStream Class Template Reference

#include <matrix-stream.h>

List of all members.

template<class Field>
class LinBox::MatrixStream< Field >


Public Types

typedef Field::Element Element

Public Methods

 MatrixStream (const Field &fld, istream &i, char delim= '\n')
 ~MatrixStream ()
bool nextTriple (int &, int &, Element &)
bool getRows (int &)
bool getColumns (int &)
bool getDimensions (int &, int &)
MatrixStreamError getError () const
int getLineNumber () const
const FieldgetField () const
bool addChars (istream **eofReached=NULL)
const char * getFormat () const
bool isSparse () const
bool isDense () const

Member Typedef Documentation

typedef Field::Element Element
 


Constructor & Destructor Documentation

MatrixStream const Field   fld,
istream &    i,
char    delim = '\n'
 

Constructor from an input stream.

Parameters:
fld  The Field used to read Elements from the matrix.
in  The input stream from which to read
delim  The chunk delimited used by addChars. This should be the last character in the matrix data. If only one matrix is stored in a given file, this can be anything. Otherwise, if delim is not the last character in the matrix, there could be extra data read from in and not put back. Default is newline.

~MatrixStream  
 

Destructor


Member Function Documentation

bool addChars istream **    eofReached = NULL
 

Get characters from in and give them to the MatrixStreamReaders. Called by the moreData() function of MatrixStreamReader.

Parameters:
eofReached  A pointer to a pointer of the istream that reached an EOF and initiated this function call.
Returns:
true iff more characters were actually added to the stream

bool getColumns int &   
 

Get the number of columns in the matrix and store it in the given int.

Returns:
true iff the operation succeeded.

bool getDimensions int &   ,
int &   
 

Get the number of rows and columns in the matrix and store them in the given ints.

Returns:
true iff the operation succeeded.

MatrixStreamError getError   const [inline]
 

Get the current state of the stream. Especially useful if called after one of the four above operations on failure to get some information on what caused the failure.

const Field& getField   const [inline]
 

Get the Field that was passed to the constructor.

const char * getFormat  
 

Get a brief description of the format of the matrix being read.

int getLineNumber  
 

If there is a reader in the GOOD state, get the line number it is on. Otherwise, get the line number on which the last error occurred.

bool getRows int &   
 

Get the number of rows in the matrix and store it in the given int.

Returns:
true iff the operation succeeded.

bool isDense  
 

Tell if the matrix being read is dense.

Returns:
true iff the matrix is dense. NOTE: a return of false does NOT mean the matrix is sparse. Use isSparse()

bool isSparse  
 

Tell if the matrix being read is sparse.

Returns:
true iff the matrix is sparse. NOTE: a return of false does NOT mean the matrix is dense. Use isDense()

bool nextTriple int &   ,
int &   ,
Element  
 

Read the next triple of row index, column index, value and store it in the three referenced elements.

Returns:
true iff the read succeeded.


Generated on Mon Jun 20 09:16:52 2005 for linbox by doxygen1.2.18