Template Class MTXReader

Nested Relationships

Nested Types

Inheritance Relationships

Base Types

Class Documentation

template<typename IDType, typename NNZType, typename ValueType>
class sparsebase::io::MTXReader : public sparsebase::io::Reader, public sparsebase::io::ReadsCSR<IDType, NNZType, ValueType>, public sparsebase::io::ReadsCOO<IDType, NNZType, ValueType>, public sparsebase::io::ReadsArray<ValueType>

Reader for the Matrix Market File Format.

Detailed explanations of the MTX format can be found in these links:

Public Functions

explicit MTXReader(std::string filename, bool convert_to_zero_index = true)

Constructor for the MTXReader class

Parameters
  • filename – path to the file to be read

  • convert_to_zero_index – if set to true the indices will be converted such that they start from 0 instead of 1

virtual format::COO<IDType, NNZType, ValueType> *ReadCOO() const override

Reads the file to a COO instance and returns a pointer to it.

virtual format::CSR<IDType, NNZType, ValueType> *ReadCSR() const override

Reads the file to a CSR instance and returns a pointer to it.

virtual format::Array<ValueType> *ReadArray() const override

Reads the file to an Array instance and returns a pointer to it.

~MTXReader() override