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!");