83 XMLTag open_tag(verbosity);
84 XMLTag close_tag(verbosity);
121 matrix.
resize(nrows, ncols);
126 for (
Index r = 0; r < nrows; r++) {
132 <<
"\n Row : " << r <<
"\n Column: " <<
c;
155 XMLTag open_tag(verbosity);
156 XMLTag close_tag(verbosity);
171 *pbofs << matrix(r, 0);
173 os_xml << matrix(r, 0);
177 *pbofs << matrix(r,
c);
179 os_xml <<
" " << matrix(r,
c);
182 if (!pbofs) os_xml <<
'\n';
236 XMLTag open_tag(verbosity);
237 XMLTag close_tag(verbosity);
269 Index nrows, ncols, nnz;
276 sparse.
resize(nrows, ncols);
285 for (
Index i = 0; i < nnz; i++) {
291 <<
"\n Row index: " << i;
299 <<
"\n Row index: " << i;
310 for (
Index i = 0; i < nnz; i++) {
316 <<
"\n Column index: " << i;
324 <<
"\n Column index: " << i;
338 for (
Index i = 0; i < nnz; i++) {
343 <<
"\n Data element: " << i;
369 XMLTag sparse_tag(verbosity);
370 XMLTag row_tag(verbosity);
371 XMLTag col_tag(verbosity);
372 XMLTag data_tag(verbosity);
373 XMLTag close_tag(verbosity);
399 for (
Index i = 0; i < sparse.
nnz(); i++) {
404 os_xml << rowind[i] <<
'\n';
416 for (
Index i = 0; i < sparse.
nnz(); i++) {
421 os_xml << colind[i] <<
'\n';
434 for (
Index i = 0; i < sparse.
nnz(); i++) {
438 os_xml << data[i] <<
' ';
471 bool string_starts_with_quotes =
true;
482 string_starts_with_quotes =
false;
484 }
while (is_xml.good() && dummy !=
'"' && string_starts_with_quotes);
487 if (!string_starts_with_quotes) {
492 dummy = (char)is_xml.peek();
498 is_xml.get(strbuf,
'"');
525 XMLTag open_tag(verbosity);
526 XMLTag close_tag(verbosity);
533 os_xml <<
'\"' << str <<
'\"';
553 Index npages, nrows, ncols;
561 tensor.
resize(npages, nrows, ncols);
566 for (
Index p = 0; p < npages; p++) {
567 for (
Index r = 0; r < nrows; r++) {
573 <<
"\n Page : " << p <<
"\n Row : " << r
574 <<
"\n Column: " <<
c;
598 XMLTag open_tag(verbosity);
599 XMLTag close_tag(verbosity);
616 *pbofs << tensor(p, r, 0);
618 os_xml << tensor(p, r, 0);
619 for (
Index c = 1;
c < tensor.ncols(); ++
c) {
621 *pbofs << tensor(p, r,
c);
623 os_xml <<
" " << tensor(p, r,
c);
625 if (!pbofs) os_xml <<
'\n';
648 Index nbooks, npages, nrows, ncols;
657 tensor =
Tensor4(nbooks, npages, nrows, ncols);
661 nbooks * npages * nrows * ncols);
663 for (
Index b = 0;
b < nbooks;
b++) {
664 for (
Index p = 0; p < npages; p++) {
665 for (
Index r = 0; r < nrows; r++) {
671 <<
"\n Book : " <<
b <<
"\n Page : " << p
672 <<
"\n Row : " << r <<
"\n Column: " <<
c;
697 XMLTag open_tag(verbosity);
698 XMLTag close_tag(verbosity);
717 *pbofs << tensor(
b, p, r, 0);
719 os_xml << tensor(
b, p, r, 0);
720 for (
Index c = 1;
c < tensor.ncols(); ++
c) {
722 *pbofs << tensor(
b, p, r,
c);
724 os_xml <<
" " << tensor(
b, p, r,
c);
726 if (!pbofs) os_xml <<
'\n';
750 Index nshelves, nbooks, npages, nrows, ncols;
760 tensor.
resize(nshelves, nbooks, npages, nrows, ncols);
764 nshelves * nbooks * npages * nrows * ncols);
766 for (
Index s = 0; s < nshelves; s++) {
767 for (
Index b = 0;
b < nbooks;
b++) {
768 for (
Index p = 0; p < npages; p++) {
769 for (
Index r = 0; r < nrows; r++) {
775 <<
"\n Shelf : " << s <<
"\n Book : " <<
b
776 <<
"\n Page : " << p <<
"\n Row : " << r
777 <<
"\n Column: " <<
c;
803 XMLTag open_tag(verbosity);
804 XMLTag close_tag(verbosity);
825 *pbofs << tensor(s,
b, p, r, 0);
827 os_xml << tensor(s,
b, p, r, 0);
828 for (
Index c = 1;
c < tensor.ncols(); ++
c) {
830 *pbofs << tensor(s,
b, p, r,
c);
832 os_xml <<
" " << tensor(s,
b, p, r,
c);
834 if (!pbofs) os_xml <<
'\n';
859 Index nvitrines, nshelves, nbooks, npages, nrows, ncols;
870 tensor.
resize(nvitrines, nshelves, nbooks, npages, nrows, ncols);
875 nvitrines * nshelves * nbooks * npages * nrows * ncols);
877 for (
Index v = 0;
v < nvitrines;
v++) {
878 for (
Index s = 0; s < nshelves; s++) {
879 for (
Index b = 0;
b < nbooks;
b++) {
880 for (
Index p = 0; p < npages; p++) {
881 for (
Index r = 0; r < nrows; r++) {
887 <<
"\n Vitrine: " <<
v <<
"\n Shelf : " << s
888 <<
"\n Book : " <<
b <<
"\n Page : " << p
889 <<
"\n Row : " << r <<
"\n Column : " <<
c;
916 XMLTag open_tag(verbosity);
917 XMLTag close_tag(verbosity);
940 *pbofs << tensor(
v, s,
b, p, r, 0);
942 os_xml << tensor(
v, s,
b, p, r, 0);
943 for (
Index c = 1;
c < tensor.ncols(); ++
c) {
945 *pbofs << tensor(
v, s,
b, p, r,
c);
947 os_xml <<
" " << tensor(
v, s,
b, p, r,
c);
949 if (!pbofs) os_xml <<
'\n';
975 Index nlibraries, nvitrines, nshelves, nbooks, npages, nrows, ncols;
987 tensor.
resize(nlibraries, nvitrines, nshelves, nbooks, npages, nrows, ncols);
992 nlibraries * nvitrines * nshelves * nbooks * npages * nrows * ncols);
994 for (
Index l = 0; l < nlibraries; l++) {
995 for (
Index v = 0;
v < nvitrines;
v++) {
996 for (
Index s = 0; s < nshelves; s++) {
997 for (
Index b = 0;
b < nbooks;
b++) {
998 for (
Index p = 0; p < npages; p++) {
999 for (
Index r = 0; r < nrows; r++) {
1000 for (
Index c = 0;
c < ncols;
c++) {
1002 if (is_xml.fail()) {
1005 <<
"\n Library: " << l <<
"\n Vitrine: " <<
v
1006 <<
"\n Shelf : " << s <<
"\n Book : " <<
b
1007 <<
"\n Page : " << p <<
"\n Row : " << r
1008 <<
"\n Column : " <<
c;
1036 XMLTag open_tag(verbosity);
1037 XMLTag close_tag(verbosity);
1062 *pbofs << tensor(l,
v, s,
b, p, r, 0);
1064 os_xml << tensor(l,
v, s,
b, p, r, 0);
1065 for (
Index c = 1;
c < tensor.ncols(); ++
c) {
1067 *pbofs << tensor(l,
v, s,
b, p, r,
c);
1069 os_xml <<
" " << tensor(l,
v, s,
b, p, r,
c);
1071 if (!pbofs) os_xml <<
'\n';
1107 for (
Index n = 0; n < nelem; n++) {
1109 if (is_xml.fail()) {
1112 <<
"\n Element: " << n;
1152 XMLTag open_tag(verbosity);
1153 XMLTag close_tag(verbosity);
1169 for (
Index i = 0; i < n; ++i)
1171 *pbofs << vector[i];
1173 os_xml << vector[i] <<
'\n';
The global header file for ARTS.
Numeric * get_c_array() const noexcept
Index nrows() const noexcept
Index ncols() const noexcept
Index npages() const
Returns the number of pages.
Index nrows() const
Returns the number of rows.
Index ncols() const
Returns the number of columns.
Index ncols() const noexcept
Index nrows() const noexcept
Index nbooks() const noexcept
Index npages() const noexcept
Index nrows() const noexcept
Index ncols() const noexcept
Index npages() const noexcept
Index nbooks() const noexcept
Index nshelves() const noexcept
Index nbooks() const noexcept
Index nvitrines() const noexcept
Index ncols() const noexcept
Index npages() const noexcept
Index nshelves() const noexcept
Index nrows() const noexcept
Index ncols() const noexcept
Index npages() const noexcept
Index nrows() const noexcept
Index nlibraries() const noexcept
Index nvitrines() const noexcept
Index nshelves() const noexcept
Index nbooks() const noexcept
Numeric * get_c_array() const noexcept
Conversion to plain C-array, const-version.
Index nelem() const noexcept
Returns the number of elements.
void resize(Index r, Index c)
Resize function.
const Numeric * get_c_array() const ARTS_NOEXCEPT
Conversion to plain C-array.
void resize(Index p, Index r, Index c)
Resize function.
const Numeric * get_c_array() const ARTS_NOEXCEPT
Conversion to plain C-array.
const Numeric * get_c_array() const ARTS_NOEXCEPT
Conversion to plain C-array.
void resize(Index s, Index b, Index p, Index r, Index c)
Resize function.
const Numeric * get_c_array() const ARTS_NOEXCEPT
Conversion to plain C-array.
void resize(Index v, Index s, Index b, Index p, Index r, Index c)
Resize function.
const Numeric * get_c_array() const ARTS_NOEXCEPT
Conversion to plain C-array.
void resize(Index l, Index v, Index s, Index b, Index p, Index r, Index c)
Resize function.
void resize(Index n)
Resize function.
void add_attribute(const String &aname, String value)
void write_to_stream(ostream &os)
Write XML tag.
void check_name(const String &expected_name)
Check tag name.
void read_from_stream(istream &is)
Reads next XML tag.
void get_attribute_value(const String &aname, String &value)
void set_name(const String &new_name)
Binary output file stream class.
void readDoubleArray(double *d, unsigned long size)
Binary output file stream class.
Input manipulator class for doubles to enable nan and inf parsing.
Fast double input stream with support for parsing nan and inf.
NUMERIC Numeric
The type to use for all floating point numbers.
INDEX Index
The type to use for all integer numbers and indices.
Index nnz() const
Returns the number of nonzero elements.
void resize(Index r, Index c)
Resize function.
void list_elements(Vector &values, ArrayOfIndex &row_indices, ArrayOfIndex &column_indices) const
List elements in matrix.
Index nrows() const
Returns the number of rows.
Index ncols() const
Returns the number of columns.
void insert_elements(Index nnz, const ArrayOfIndex &rowind, const ArrayOfIndex &colind, ConstVectorView data)
Insert vector of elements with given row and column indices.
void xml_data_parse_error(ArtsXMLTag &tag, String str_error)
Throws XML parser runtime error.
void xml_set_stream_precision(ostream &os)
void xml_parse_error(const String &str_error)
Throws XML parser runtime error.
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.
void xml_read_from_stream(istream &is_xml, Index &index, bifstream *pbifs, const Verbosity &verbosity)
Reads Index from XML input stream.
void xml_parse_from_stream(istream &is_xml, Vector &vector, bifstream *pbifs, XMLTag &tag, const Verbosity &)
Parses Vector from XML input stream.