135 matrix.
resize (nrows, ncols);
137 for (
Index r = 0; r < nrows; r++)
139 for (
Index c = 0; c < ncols; c++)
143 *pbifs >> matrix (r, c);
149 <<
"\n Column: " << c;
155 is_xml >> matrix (r, c);
161 <<
"\n Column: " << c;
204 *pbofs << matrix (r, 0);
206 os_xml << matrix (r, 0);
208 for (
Index c = 1; c < matrix.ncols (); ++c)
211 *pbofs << matrix (r, c);
213 os_xml <<
" " << matrix (r, c);
316 Index nrows, ncols, nnz;
323 sparse.
resize(nrows, ncols);
332 for(
Index i=0; i<nnz; i++) {
335 if (pbifs->fail ()) {
338 <<
"\n Row index: " << i;
343 if (is_xml.fail ()) {
346 <<
"\n Row index: " << i;
357 for(
Index i=0; i<nnz; i++) {
360 if (pbifs->fail ()) {
363 <<
"\n Column index: " << i;
368 if (is_xml.fail ()) {
371 <<
"\n Column index: " << i;
382 for(
Index i=0; i<nnz; i++) {
385 if (pbifs->fail ()) {
388 <<
"\n Data element: " << i;
393 if (is_xml.fail ()) {
396 <<
"\n Data element: " << i;
407 for(
Index i=0; i<nnz; i++)
408 sparse.
rw(rowind[i], colind[i]) = data[i];
448 for(
Index i=0; i<sparse.
nnz(); i++) {
451 *pbofs << (*sparse.
rowind())[i];
453 os_xml << (*sparse.
rowind())[i] <<
'\n';
461 for(
size_t i=0; i<sparse.
colptr()->size()-1; i++) {
466 os_xml << (
Index)i <<
'\n';
476 for(
Index i=0; i<sparse.
nnz(); i++) {
478 *pbofs << (*sparse.
data())[i];
480 os_xml << (*sparse.
data())[i] <<
' ';
515 bool string_starts_with_quotes =
true;
528 string_starts_with_quotes =
false;
530 }
while (is_xml.good () && dummy !=
'"' && string_starts_with_quotes);
533 if (!string_starts_with_quotes)
539 dummy=(char)is_xml.peek();
548 is_xml.get (strbuf,
'"');
587 os_xml <<
'\"' << str <<
'\"';
609 Index npages, nrows, ncols;
617 tensor.
resize (npages, nrows, ncols);
619 for (
Index p = 0; p < npages; p++)
621 for (
Index r = 0; r < nrows; r++)
623 for (
Index c = 0; c < ncols; c++)
627 *pbifs >> tensor (p, r, c);
634 <<
"\n Column: " << c;
640 is_xml >> tensor (p, r, c);
647 <<
"\n Column: " << c;
694 *pbofs << tensor (p, r, 0);
696 os_xml << tensor (p, r, 0);
697 for (
Index c = 1; c < tensor.ncols (); ++c)
700 *pbofs << tensor (p, r, c);
702 os_xml <<
" " << tensor (p, r, c);
730 Index nbooks, npages, nrows, ncols;
739 tensor.
resize (nbooks,npages, nrows, ncols);
741 for (
Index b = 0; b < nbooks; b++)
743 for (
Index p = 0; p < npages; p++)
745 for (
Index r = 0; r < nrows; r++)
747 for (
Index c = 0; c < ncols; c++)
751 *pbifs >> tensor (b, p, r, c);
759 <<
"\n Column: " << c;
765 is_xml >> tensor (b, p, r, c);
773 <<
"\n Column: " << c;
824 *pbofs << tensor (b, p, r, 0);
826 os_xml << tensor (b, p, r, 0);
827 for (
Index c = 1; c < tensor.ncols (); ++c)
830 *pbofs << tensor (b, p, r, c);
832 os_xml <<
" " << tensor (b, p, r, c);
861 Index nshelves, nbooks, npages, nrows, ncols;
871 tensor.
resize (nshelves, nbooks,npages, nrows, ncols);
873 for (
Index s = 0; s < nshelves; s++)
875 for (
Index b = 0; b < nbooks; b++)
877 for (
Index p = 0; p < npages; p++)
879 for (
Index r = 0; r < nrows; r++)
881 for (
Index c = 0; c < ncols; c++)
885 *pbifs >> tensor (s, b, p, r, c);
890 <<
"\n Shelf : " << s
894 <<
"\n Column: " << c;
900 is_xml >> tensor (s, b, p, r, c);
905 <<
"\n Shelf : " << s
909 <<
"\n Column: " << c;
964 *pbofs << tensor (s, b, p, r, 0);
966 os_xml << tensor (s, b, p, r, 0);
967 for (
Index c = 1; c < tensor.ncols (); ++c)
970 *pbofs << tensor (s, b, p, r, c);
972 os_xml <<
" " << tensor (s, b, p, r, c);
1002 Index nvitrines, nshelves, nbooks, npages, nrows, ncols;
1013 tensor.
resize (nvitrines, nshelves, nbooks,npages, nrows, ncols);
1015 for (
Index v = 0; v < nvitrines; v++)
1017 for (
Index s = 0; s < nshelves; s++)
1019 for (
Index b = 0; b < nbooks; b++)
1021 for (
Index p = 0; p < npages; p++)
1023 for (
Index r = 0; r < nrows; r++)
1025 for (
Index c = 0; c < ncols; c++)
1029 *pbifs >> tensor (v, s, b, p, r, c);
1034 <<
"\n Vitrine: " << v
1035 <<
"\n Shelf : " << s
1036 <<
"\n Book : " << b
1037 <<
"\n Page : " << p
1039 <<
"\n Column : " << c;
1045 is_xml >> tensor (v, s, b, p, r, c);
1050 <<
"\n Vitrine: " << v
1051 <<
"\n Shelf : " << s
1052 <<
"\n Book : " << b
1053 <<
"\n Page : " << p
1055 <<
"\n Column : " << c;
1114 *pbofs << tensor (v, s, b, p, r, 0);
1116 os_xml << tensor (v, s, b, p, r, 0);
1117 for (
Index c = 1; c < tensor.ncols (); ++c)
1120 *pbofs << tensor (v, s, b, p, r, c);
1122 os_xml <<
" " << tensor (v, s, b, p, r, c);
1153 Index nlibraries, nvitrines, nshelves, nbooks, npages, nrows, ncols;
1165 tensor.
resize (nlibraries, nvitrines, nshelves, nbooks,npages, nrows, ncols);
1167 for (
Index l = 0; l < nlibraries; l++)
1169 for (
Index v = 0; v < nvitrines; v++)
1171 for (
Index s = 0; s < nshelves; s++)
1173 for (
Index b = 0; b < nbooks; b++)
1175 for (
Index p = 0; p < npages; p++)
1177 for (
Index r = 0; r < nrows; r++)
1179 for (
Index c = 0; c < ncols; c++)
1183 *pbifs >> tensor (l, v, s, b, p, r, c);
1188 <<
"\n Library: " << l
1189 <<
"\n Vitrine: " << v
1190 <<
"\n Shelf : " << s
1191 <<
"\n Book : " << b
1192 <<
"\n Page : " << p
1194 <<
"\n Column : " << c;
1200 is_xml >> tensor (l, v, s, b, p, r, c);
1205 <<
"\n Library: " << l
1206 <<
"\n Vitrine: " << v
1207 <<
"\n Shelf : " << s
1208 <<
"\n Book : " << b
1209 <<
"\n Page : " << p
1211 <<
"\n Column : " << c;
1274 *pbofs << tensor (l, v, s, b, p, r, 0);
1276 os_xml << tensor (l, v, s, b, p, r, 0);
1277 for (
Index c = 1; c < tensor.ncols (); ++c)
1280 *pbofs << tensor (l, v, s, b, p, r, c);
1282 os_xml <<
" " << tensor (l, v, s, b, p, r, c);
1321 for (
Index n = 0; n < nelem; n++)
1325 *pbifs >> vector[n];
1330 <<
"\n Element: " << n;
1336 is_xml >> vector[n];
1341 <<
"\n Element: " << n;
1403 for (
Index i=0; i<n; ++i)
1405 *pbofs << vector[i];
1407 os_xml << vector[i] <<
'\n';
1428 throw runtime_error(
"Method not implemented!");
1438 throw runtime_error(
"Method not implemented!");