33 #ifndef __H__UG__LIB_ALGEBRA__MATRIX_IO_H
34 #define __H__UG__LIB_ALGEBRA__MATRIX_IO_H
92 UG_ASSERT( type >= 0 && type <= 2,
"Unknown MatrixFileType code: " << type );
202 void open_file( std::ios_base::openmode mode=std::ios_base::in );
Representation of a matrix exchange file format.
Definition: matrix_io.h:66
bool is_hb() const
Tells whether this is a Harwell-Boing type.
Definition: matrix_io.h:106
bool is_mm() const
Tells whether this is a MatrixMarket type.
Definition: matrix_io.h:99
int m_type
Holds the file type value (which is one of MatrixFileType::Type)
Definition: matrix_io.h:112
MatrixFileType(int type)
Constructor specifying file type.
Definition: matrix_io.h:91
Type
Supported matrix exchange file formats.
Definition: matrix_io.h:69
@ MATRIX_MARKET
MatrixMarket format (by NIS)
Definition: matrix_io.h:73
@ HARWELL_BOING
Harwell-Boing format (by NIS)
Definition: matrix_io.h:75
@ UNDEFINED
undefined format
Definition: matrix_io.h:71
MatrixFileType()
Default Constructor.
Definition: matrix_io.h:83
Generic matrix I/O functionality.
Definition: matrix_io.h:126
void set_mat_file_name(std::string mFile, int openMode=EXISTING)
Sets associated file to another one.
Definition: matrix_io.cpp:60
std::fstream m_matFileStream
Internal file stream for reading from and writing into the matrix exchange file.
Definition: matrix_io.h:140
void open_file(std::ios_base::openmode mode=std::ios_base::in)
Opens the associated file in m_matFileStream.
Definition: matrix_io.cpp:85
std::string * m_pMatFileName
Full path name of the matrix exchange file.
Definition: matrix_io.h:138
void close_file()
Closes file stream.
Definition: matrix_io.cpp:95
OpenMode
Specifies how file names pointing to non-existing files should be handeld.
Definition: matrix_io.h:129
@ EXISTING
Only existing files are valid files (i.e. non-existing file result in error)
Definition: matrix_io.h:131
@ NEW
Non-existing files are created with the specified file name.
Definition: matrix_io.h:133
std::string get_mat_file_name() const
Retreive associated exchange file path and name.
Definition: matrix_io.cpp:78
MatrixIO()
Number of rows as specified in the matrix exchange file.
Definition: matrix_io.cpp:40
MatrixFileType m_matFileType
Matrix exchange file type.
Definition: matrix_io.h:142
~MatrixIO()
Destructor.
Definition: matrix_io.cpp:52
#define UG_ASSERT(expr, msg)
Definition: assert.h:70