136 matrix.
resize(nrows, ncols);
138 for (
Index r = 0; r < nrows; r++)
140 for (
Index c = 0; c < ncols; c++)
144 *pbifs >> matrix(r, c);
150 <<
"\n Column: " << c;
162 <<
"\n Column: " << c;
205 *pbofs << matrix(r, 0);
207 os_xml << matrix(r, 0);
209 for (
Index c = 1; c < matrix.ncols(); ++c)
212 *pbofs << matrix(r, c);
214 os_xml <<
" " << matrix(r, c);
317 Index nrows, ncols, nnz;
324 sparse.
resize(nrows, ncols);
333 for (
Index i = 0; i < nnz; i++)
340 <<
"\n Row index: " << i;
349 <<
"\n Row index: " << i;
360 for (
Index i = 0; i < nnz; i++)
367 <<
"\n Column index: " << i;
376 <<
"\n Column index: " << i;
387 for (
Index i = 0; i < nnz; i++)
394 <<
"\n Data element: " << i;
403 <<
"\n Data element: " << i;
414 for (
Index i = 0; i < nnz; i++)
415 sparse.
rw(rowind[i], colind[i]) = data[i];
455 for (
Index i = 0; i < sparse.
nnz(); i++)
459 *pbofs << sparse.
rowind()[i];
461 os_xml << sparse.
rowind()[i] <<
'\n';
469 for (
size_t i = 0; i < sparse.
colptr().size()-1; i++)
476 os_xml << (
Index)i <<
'\n';
486 for (
Index i = 0; i < sparse.
nnz(); i++)
489 *pbofs << sparse.
data()[i];
491 os_xml << sparse.
data()[i] <<
' ';
526 bool string_starts_with_quotes =
true;
538 string_starts_with_quotes =
false;
540 }
while (is_xml.good() && dummy !=
'"' && string_starts_with_quotes);
543 if (!string_starts_with_quotes)
549 dummy = (char)is_xml.peek();
558 is_xml.get(strbuf,
'"');
597 os_xml <<
'\"' << str <<
'\"';
619 Index npages, nrows, ncols;
627 tensor.
resize(npages, nrows, ncols);
629 for (
Index p = 0; p < npages; p++)
631 for (
Index r = 0; r < nrows; r++)
633 for (
Index c = 0; c < ncols; c++)
637 *pbifs >> tensor(p, r, c);
644 <<
"\n Column: " << c;
657 <<
"\n Column: " << c;
704 *pbofs << tensor(p, r, 0);
706 os_xml << tensor(p, r, 0);
707 for (
Index c = 1; c < tensor.ncols(); ++c)
710 *pbofs << tensor(p, r, c);
712 os_xml <<
" " << tensor(p, r, c);
740 Index nbooks, npages, nrows, ncols;
749 tensor.
resize(nbooks, npages, nrows, ncols);
751 for (
Index b = 0; b < nbooks; b++)
753 for (
Index p = 0; p < npages; p++)
755 for (
Index r = 0; r < nrows; r++)
757 for (
Index c = 0; c < ncols; c++)
761 *pbifs >> tensor(b, p, r, c);
769 <<
"\n Column: " << c;
783 <<
"\n Column: " << c;
834 *pbofs << tensor(b, p, r, 0);
836 os_xml << tensor(b, p, r, 0);
837 for (
Index c = 1; c < tensor.ncols(); ++c)
840 *pbofs << tensor(b, p, r, c);
842 os_xml <<
" " << tensor(b, p, r, c);
871 Index nshelves, nbooks, npages, nrows, ncols;
881 tensor.
resize(nshelves, nbooks, npages, nrows, ncols);
883 for (
Index s = 0; s < nshelves; s++)
885 for (
Index b = 0; b < nbooks; b++)
887 for (
Index p = 0; p < npages; p++)
889 for (
Index r = 0; r < nrows; r++)
891 for (
Index c = 0; c < ncols; c++)
895 *pbifs >> tensor(s, b, p, r, c);
900 <<
"\n Shelf : " << s
904 <<
"\n Column: " << c;
915 <<
"\n Shelf : " << s
919 <<
"\n Column: " << c;
974 *pbofs << tensor(s, b, p, r, 0);
976 os_xml << tensor(s, b, p, r, 0);
977 for (
Index c = 1; c < tensor.ncols(); ++c)
980 *pbofs << tensor(s, b, p, r, c);
982 os_xml <<
" " << tensor(s, b, p, r, c);
1012 Index nvitrines, nshelves, nbooks, npages, nrows, ncols;
1023 tensor.
resize(nvitrines, nshelves, nbooks, npages, nrows, ncols);
1025 for (
Index v = 0; v < nvitrines; v++)
1027 for (
Index s = 0; s < nshelves; s++)
1029 for (
Index b = 0; b < nbooks; b++)
1031 for (
Index p = 0; p < npages; p++)
1033 for (
Index r = 0; r < nrows; r++)
1035 for (
Index c = 0; c < ncols; c++)
1039 *pbifs >> tensor(v, s, b, p, r, c);
1044 <<
"\n Vitrine: " << v
1045 <<
"\n Shelf : " << s
1046 <<
"\n Book : " << b
1047 <<
"\n Page : " << p
1049 <<
"\n Column : " << c;
1060 <<
"\n Vitrine: " << v
1061 <<
"\n Shelf : " << s
1062 <<
"\n Book : " << b
1063 <<
"\n Page : " << p
1065 <<
"\n Column : " << c;
1124 *pbofs << tensor(v, s, b, p, r, 0);
1126 os_xml << tensor(v, s, b, p, r, 0);
1127 for (
Index c = 1; c < tensor.ncols(); ++c)
1130 *pbofs << tensor(v, s, b, p, r, c);
1132 os_xml <<
" " << tensor(v, s, b, p, r, c);
1163 Index nlibraries, nvitrines, nshelves, nbooks, npages, nrows, ncols;
1175 tensor.
resize(nlibraries, nvitrines, nshelves, nbooks, npages, nrows, ncols);
1177 for (
Index l = 0; l < nlibraries; l++)
1179 for (
Index v = 0; v < nvitrines; v++)
1181 for (
Index s = 0; s < nshelves; s++)
1183 for (
Index b = 0; b < nbooks; b++)
1185 for (
Index p = 0; p < npages; p++)
1187 for (
Index r = 0; r < nrows; r++)
1189 for (
Index c = 0; c < ncols; c++)
1193 *pbifs >> tensor(l, v, s, b, p, r, c);
1198 <<
"\n Library: " << l
1199 <<
"\n Vitrine: " << v
1200 <<
"\n Shelf : " << s
1201 <<
"\n Book : " << b
1202 <<
"\n Page : " << p
1204 <<
"\n Column : " << c;
1215 <<
"\n Library: " << l
1216 <<
"\n Vitrine: " << v
1217 <<
"\n Shelf : " << s
1218 <<
"\n Book : " << b
1219 <<
"\n Page : " << p
1221 <<
"\n Column : " << c;
1284 *pbofs << tensor(l, v, s, b, p, r, 0);
1286 os_xml << tensor(l, v, s, b, p, r, 0);
1287 for (
Index c = 1; c < tensor.ncols(); ++c)
1290 *pbofs << tensor(l, v, s, b, p, r, c);
1292 os_xml <<
" " << tensor(l, v, s, b, p, r, c);
1330 for (
Index n = 0; n < nelem; n++)
1334 *pbifs >> vector[n];
1339 <<
"\n Element: " << n;
1350 <<
"\n Element: " << n;
1412 for (
Index i = 0; i < n; ++i)
1414 *pbofs << vector[i];
1416 os_xml << vector[i] <<
'\n';
1436 throw runtime_error(
"Method not implemented!");
1446 throw runtime_error(
"Method not implemented!");
Index npages() const
Returns the number of pages.
INDEX Index
The type to use for all integer numbers and indices.
void add_attribute(const String &aname, const String &value)
Adds a String attribute to tag.
Index nnz() const
Returns the number of nonzero elements.
Index nrows() const
Returns the number of rows.
void resize(Index s, Index b, Index p, Index r, Index c)
Resize function.
void read_from_stream(istream &is)
Reads next XML tag.
void xml_parse_from_stream(istream &is_xml, Vector &vector, bifstream *pbifs, ArtsXMLTag &tag, const Verbosity &)
Parses Vector from XML input stream.
Index nvitrines() const
Returns the number of vitrines.
const std::vector< Index > & rowind() const
Index nrows() const
Returns the number of rows.
const std::vector< Numeric > & data() const
Index npages() const
Returns the number of pages.
Index ncols() const
Returns the number of columns.
Numeric & rw(Index r, Index c)
Read and write index operator.
This file contains private function declarations and template instantiation to handle XML data files...
This file contains basic functions to handle XML data files.
This file contains basic functions to handle ASCII files.
Index nbooks() const
Returns the number of books.
Index nrows() const
Returns the number of rows.
Index nrows() const
Returns the number of rows.
Index nelem() const
Returns the number of elements.
void xml_parse_error(const String &str_error)
Throws XML parser runtime error.
The implementation for String, the ARTS string class.
Index ncols() const
Returns the number of columns.
The global header file for ARTS.
Index nshelves() const
Returns the number of shelves.
void xml_set_stream_precision(ostream &os)
void set_name(const String &new_name)
Index ncols() const
Returns the number of columns.
Binary output file stream class.
void xml_read_from_stream(istream &is_xml, Index &index, bifstream *pbifs, const Verbosity &verbosity)
Reads Index from XML input stream.
Index nrows() const
Returns the number of rows.
Index nrows() const
Returns the number of rows.
NUMERIC Numeric
The type to use for all floating point numbers.
Index nlibraries() const
Returns the number of libraries.
void get_attribute_value(const String &aname, String &value)
Returns value of attribute as String.
void resize(Index p, Index r, Index c)
Resize function.
void check_name(const String &expected_name)
Check tag name.
Index npages() const
Returns the number of pages.
This can be used to make arrays out of anything.
Index nshelves() const
Returns the number of shelves.
Index ncols() const
Returns the number of columns.
const std::vector< Index > & colptr() const
void resize(Index n)
Assignment operator from VectorView.
Index npages() const
Returns the number of pages.
Index nshelves() const
Returns the number of shelves.
Binary output file stream class.
void xml_write_to_stream(ostream &os_xml, const Index &index, bofstream *pbofs, const String &name, const Verbosity &verbosity)
Writes Index to XML output stream.
Index npages() const
Returns the number of pages.
Index nbooks() const
Returns the number of books.
void resize(Index v, Index s, Index b, Index p, Index r, Index c)
Resize function.
void resize(Index r, Index c)
Resize function.
Index ncols() const
Returns the number of columns.
Index nvitrines() const
Returns the number of vitrines.
Index ncols() const
Returns the number of columns.
Index ncols() const
Returns the number of columns.
void resize(Index l, Index v, Index s, Index b, Index p, Index r, Index c)
Resize function.
This file contains private function declarations and template instantiation to handle XML data files...
Index nrows() const
Returns the number of rows.
Index nbooks() const
Returns the number of books.
void xml_data_parse_error(ArtsXMLTag &tag, String str_error)
Throws XML parser runtime error.
Input manipulator class for doubles to enable nan and inf parsing.
void resize(Index b, Index p, Index r, Index c)
Resize function.
void write_to_stream(ostream &os)
Write XML tag.
void resize(Index r, Index c)
Resize function.
Index nbooks() const
Returns the number of books.