template<bool parallel_ = false, class Pointer_ = byteme::Reader*>
class eminem::Parser< parallel_, Pointer_ >
Parse a matrix from a Matrix Market file.
- Template Parameters
-
parallel_ | Whether to parallelize the byte reading and parsing. If true , a separate thread is used to read the bytes from the input source. |
Pointer_ | A (possibly smart) pointer to a byteme::Reader instance. |
template<bool parallel_ = false, class Pointer_ = byteme::Reader*>
template<typename Type_ = int, class Store_ >
bool eminem::Parser< parallel_, Pointer_ >::scan_integer |
( |
Store_ && |
store | ) |
|
|
inline |
Scan the file for integer lines, assuming that the field in the banner is Field::INTEGER
.
- Template Parameters
-
Type_ | Type to represent the integer. |
Store_ | Function to process each line. |
- Parameters
-
store | Function with the signature void(size_t row, size_t column, Type_ value) , which is passed the corresponding values at each line. Both row and column will be 1-based indices; for Object::VECTOR , column will be set to 1. Alternatively, this may return bool , where a false indicates that the scanning should terminate early and a true indicates that the scanning should continue. |
- Returns
- Whether the scanning terminated early, based on
store
returning false
.
template<bool parallel_ = false, class Pointer_ = byteme::Reader*>
template<typename Type_ = double, class Store_ >
bool eminem::Parser< parallel_, Pointer_ >::scan_real |
( |
Store_ && |
store | ) |
|
|
inline |
Scan the file for real lines, assuming that the field in the banner is Field::REAL
.
- Template Parameters
-
Type_ | Type to represent the real value. |
Store_ | Function to process each line. |
- Parameters
-
store | Function with the signature void(size_t row, size_t column, Type_ value) , which is passed the corresponding values at each line. Both row and column will be 1-based indices; for Object::VECTOR , column will be set to 1. Alternatively, this may return bool , where a false indicates that the scanning should terminate early and a true indicates that the scanning should continue. |
- Returns
- Whether the scanning terminated early, based on
store
returning false
.
template<bool parallel_ = false, class Pointer_ = byteme::Reader*>
template<typename Type_ = double, class Store_ >
bool eminem::Parser< parallel_, Pointer_ >::scan_double |
( |
Store_ && |
store | ) |
|
|
inline |
Scan the file for double-precision lines, assuming that the field in the banner is Field::DOUBLE
. This is just an alias for scan_real()
.
- Template Parameters
-
Type_ | Type to represent the double-precision value. |
Store_ | Function to process each line. |
- Parameters
-
store | Function with the signature void(size_t row, size_t column, Type_ value) , which is passed the corresponding values at each line. Both row and column will be 1-based indices; for Object::VECTOR , column will be set to 1. Alternatively, this may return bool , where a false indicates that the scanning should terminate early and a true indicates that the scanning should continue. |
- Returns
- Whether the scanning terminated early, based on
store
returning false
.
template<bool parallel_ = false, class Pointer_ = byteme::Reader*>
template<typename Type_ = double, class Store_ >
bool eminem::Parser< parallel_, Pointer_ >::scan_complex |
( |
Store_ && |
store | ) |
|
|
inline |
Scan the file for complex lines, assuming that the field in the banner is Field::COMPLEX
.
- Template Parameters
-
Type_ | Type to represent the real and imaginary parts of the complex value. |
Store_ | Function to process each line. |
- Parameters
-
store | Function with the signature void(size_t row, size_t column, std::complex<Type_> value) , which is passed the corresponding values at each line. Both row and column will be 1-based indices; for Object::VECTOR , column will be set to 1. Alternatively, this may return bool , where a false indicates that the scanning should terminate early and a true indicates that the scanning should continue. |
- Returns
- Whether the scanning terminated early, based on
store
returning false
.
template<bool parallel_ = false, class Pointer_ = byteme::Reader*>
template<typename Type_ = bool, class Store_ >
bool eminem::Parser< parallel_, Pointer_ >::scan_pattern |
( |
Store_ && |
store | ) |
|
|
inline |
Scan the file for pattern lines, assuming that the field in the banner is Field::PATTERN
. This function only works when the format field is set to Format::COORDINATE
.
- Template Parameters
-
Type_ | Type to represent the presence of a non-zero entry. |
Store_ | Function to process each line. |
- Parameters
-
store | Function with the signature void(size_t row, size_t column, Type_ value) , which is passed the corresponding values at each line. Both row and column will be 1-based indices; for Object::VECTOR , column will be set to 1. value will always be true and can be ignored; it is only required here for consistency with the other methods. Alternatively, this may return bool , where a false indicates that the scanning should terminate early and a true indicates that the scanning should continue. |
- Returns
- Whether the scanning terminated early, based on
store
returning false
.