ug4
|
Type representation for MatrixMarket matrix exchange files. More...
#include <mm_type_code.h>
Public Types | |
enum | AlgebraicType { GENERAL = 1 , SYMMETRIC = 2 , SKEW = 3 , HERMITIAN = 4 } |
Algebraic type of the described matrix. More... | |
enum | ClassType { COORDINATE = 1 , ARRAY = 2 } |
Class type of the described matrix. More... | |
enum | NumericType { REAL = 1 , COMPLEX = 2 , INTEGER = 3 , PATTERN = 4 } |
Numeric type of the described matrix. More... | |
Public Member Functions | |
bool | is_general () const |
Tells whether MMTypeCode is general. More... | |
bool | is_real () const |
Tells whether MMTypeCode is real. More... | |
bool | is_skew_symmetric () const |
Tells whether MMTypeCode is skew-symmetric. More... | |
bool | is_sparse () const |
Tells whether MMTypeCode is sparse. More... | |
bool | is_symmetric () const |
Tells whether MMTypeCode is symmetric. More... | |
MMTypeCode () | |
Default constructor. More... | |
void | set_algebraic_type (int type) |
Sets a new algebraic type from an enum value. More... | |
void | set_algebraic_type (std::string type) |
Sets a new algebraic type from a string. More... | |
void | set_class_type (int type) |
Sets a new class type from an enum value. More... | |
void | set_class_type (std::string type) |
Sets a new class type from a string. More... | |
void | set_numeric_type (int type) |
Sets a new numeric type from an enum value. More... | |
void | set_numeric_type (std::string type) |
Sets a new numeric type from a string. More... | |
std::string | to_string () |
Pretty prints the three classes and their current value. More... | |
Static Public Attributes | |
static const int | MM_LINE_LENGTH = 1025 |
Maximum line length in characters as defined by the MatrixMarket specifications. More... | |
Private Attributes | |
int | m_algebraic_type |
Holds a value of MMTypeCode::AlgebraicType (initialized with 0) More... | |
int | m_class_type |
Holds a value of MMTypeCode::ClassType (initialized with 0) More... | |
int | m_numeric_type |
Holds a value of MMTypeCode::NumericType (initialized with 0) More... | |
Type representation for MatrixMarket matrix exchange files.
|
inline |
Default constructor.
Initializes all three types to 0
, thus undefined.
|
inline |
Tells whether MMTypeCode is general.
true
if AlgebraicType
is general (i.e. 1), false
otherwise. References GENERAL, and m_algebraic_type.
Referenced by ug::MatrixIOMtx::write_banner().
|
inline |
Tells whether MMTypeCode is real.
true
if NumericType
is real (i.e. 1), false
otherwise. References m_numeric_type, and REAL.
|
inline |
Tells whether MMTypeCode is skew-symmetric.
true
if AlgebraicType
is skew-symmetric (i.e. 3), false
otherwise. References m_algebraic_type, and SKEW.
Referenced by ug::MatrixIOMtx::read_into(), and ug::MatrixIOMtx::write_banner().
|
inline |
Tells whether MMTypeCode is sparse.
true
if ClassType
is sparse (i.e. 1), false
otherwise. References COORDINATE, and m_class_type.
Referenced by ug::MatrixIOMtx::is_sparse(), ug::MatrixIOMtx::query_matrix_characteristics(), and ug::MatrixIOMtx::read_into().
|
inline |
Tells whether MMTypeCode is symmetric.
true
if AlgebraicType
is symmetric (i.e. 2), false
otherwise. References m_algebraic_type, and SYMMETRIC.
Referenced by ug::MatrixIOMtx::read_into(), and ug::MatrixIOMtx::write_banner().
|
inline |
Sets a new algebraic type from an enum value.
[in] | type | One value of MMTypeCode::AlgebraicType |
UGError | if type is not a valid value |
References GENERAL, HERMITIAN, m_algebraic_type, SKEW, SYMMETRIC, and UG_THROW.
Referenced by ug::MatrixIOMtx::determine_matrix_characteristics(), ug::MatrixIOMtx::query_matrix_type(), and set_algebraic_type().
|
inline |
Sets a new algebraic type from a string.
[in] | type | a string either general , symmetric , skew-symmetric or hermitian |
UGError | if type is another string |
References GENERAL, HERMITIAN, MM_GENERAL_STR, MM_HERMITIAN_STR, MM_SKEW_STR, MM_SYMMETRIC_STR, set_algebraic_type(), SKEW, SYMMETRIC, and UG_THROW.
|
inline |
Sets a new class type from an enum value.
[in] | type | One value of MMTypeCode::ClassType |
UGError | if type is not a valid value |
References ARRAY, COORDINATE, m_class_type, and UG_THROW.
Referenced by ug::MatrixIOMtx::determine_matrix_characteristics(), ug::MatrixIOMtx::query_matrix_type(), and set_class_type().
|
inline |
Sets a new class type from a string.
[in] | type | a string either coordinate or array |
UGError | if type is another string |
References ARRAY, COORDINATE, MM_ARRAY_STR, MM_COORDINATE_STR, MM_DENSE_STR, MM_SPARSE_STR, set_class_type(), and UG_THROW.
|
inline |
Sets a new numeric type from an enum value.
[in] | type | One value of MMTypeCode::NumericType |
UGError | if type is not a valid value |
References COMPLEX, INTEGER, m_numeric_type, PATTERN, REAL, and UG_THROW.
Referenced by ug::MatrixIOMtx::determine_matrix_characteristics(), ug::MatrixIOMtx::query_matrix_type(), and set_numeric_type().
|
inline |
Sets a new numeric type from a string.
[in] | type | a string either real , complex , integer or pattern |
UGError | if type is another string |
References COMPLEX, INTEGER, MM_COMPLEX_STR, MM_INTEGER_STR, MM_PATTERN_STR, MM_REAL_STR, PATTERN, REAL, set_numeric_type(), and UG_THROW.
|
inline |
Pretty prints the three classes and their current value.
MatrixMarket Type Codes: ClassType: {0,1,2} NumericType: {0,1,2,3,4} AlgebraicType: {0,1,2,3,4}
References m_algebraic_type, m_class_type, and m_numeric_type.
|
private |
Holds a value of MMTypeCode::AlgebraicType (initialized with 0)
Referenced by is_general(), is_skew_symmetric(), is_symmetric(), set_algebraic_type(), and to_string().
|
private |
Holds a value of MMTypeCode::ClassType (initialized with 0)
Referenced by is_sparse(), set_class_type(), and to_string().
|
private |
Holds a value of MMTypeCode::NumericType (initialized with 0)
Referenced by is_real(), set_numeric_type(), and to_string().
|
static |
Maximum line length in characters as defined by the MatrixMarket specifications.