MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
mtl::io::detail::mm_reader Class Reference

Line source for Matrix Market input: reads from a plain file, or transparently from a gzip-compressed ".gz" file when built with zlib. More...

#include <matrix_market.hpp>

Public Member Functions

 mm_reader (const std::string &filename)
bool size_known () const noexcept
 Whether the input's size is known: a plain file whose size the filesystem reports (not gzip, not a pipe).
std::size_t max_entries () const noexcept
 The most coordinate entry lines the file can hold: one takes at least 6 bytes ("1 1 1\n").
std::size_t max_values () const noexcept
 The most array values the file can hold: one takes at least 2 bytes ("1\n"), the last 1.
bool next_line (std::string &out)
 Read one logical line (newline stripped, CRLF-safe). Returns false at EOF.

Detailed Description

Line source for Matrix Market input: reads from a plain file, or transparently from a gzip-compressed ".gz" file when built with zlib.

One small abstraction so the parsers are agnostic to compression.

Constructor & Destructor Documentation

◆ mm_reader()

mtl::io::detail::mm_reader::mm_reader ( const std::string & filename)
inlineexplicit

Member Function Documentation

◆ max_entries()

std::size_t mtl::io::detail::mm_reader::max_entries ( ) const
inlinenoexcept

The most coordinate entry lines the file can hold: one takes at least 6 bytes ("1 1 1\n").

Unbounded when the size is unknown.

◆ max_values()

std::size_t mtl::io::detail::mm_reader::max_values ( ) const
inlinenoexcept

The most array values the file can hold: one takes at least 2 bytes ("1\n"), the last 1.

Unbounded when the size is unknown.

◆ next_line()

bool mtl::io::detail::mm_reader::next_line ( std::string & out)
inline

Read one logical line (newline stripped, CRLF-safe). Returns false at EOF.

◆ size_known()

bool mtl::io::detail::mm_reader::size_known ( ) const
inlinenoexcept

Whether the input's size is known: a plain file whose size the filesystem reports (not gzip, not a pipe).


The documentation for this class was generated from the following file: