23# include "rheolef/mm_io.h"
34 if (!ips.do_load())
return mm;
35 istream& is = ips.is();
36 bool already_have_a_spec_line =
false;
43 check_macro (isdigit(c),
"matrix_market read: not in matrix market format");
48 bool have_a_spec_line = (c ==
'%');
51 if (have_a_spec_line && ! already_have_a_spec_line) {
52 std::stringstream spec (line);
53 std::string head, matrix, type, valued;
56 spec >> head >> matrix >> type >> valued >> symmetry;
57 check_macro (head ==
"MatrixMarket",
"matrix_market read: expect `%%MatrixMarket', get `"<<head<<
"'");
58 check_macro (matrix ==
"matrix",
"matrix_market read: unsupported `"<<matrix <<
"' extension: only \"matrix\" format yet supported");
59 check_macro (type ==
"coordinate",
"matrix_market read: unsupported `"<<type <<
"': only \"coordinate\" format yet supported");
60 check_macro (valued ==
"real",
"matrix_market read: unsupported `"<<valued <<
"': only \"real\" values yet supported");
61 already_have_a_spec_line =
true;
65 if (symmetry ==
"") symmetry =
"general";
70 else error_macro (
"matrix_market read: unexpected `"<<symmetry <<
"' symmetry");
idiststream: see the diststream page for the full documentation
#define error_macro(message)
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
verbose clean transpose logscale grid shrink ball stereo iso volume skipvtk deformation fastfieldload lattice reader_on_stdin color format format format format format format format format format format format format format matrix_market
This file is part of Rheolef.
struct matrix_market read_matrix_market_header(idiststream &ips)
static const format_type general
static const format_type symmetric
static const format_type skew_symmetric
static const format_type hermitian
static const format_type max_format