Procházet zdrojové kódy

MatrixXr serialisation now compatible with PyYaml and more consistent with Vectors.

submodule
T-bone před 6 roky
rodič
revize
eaadc7aba0
1 změnil soubory, kde provedl 3 přidání a 3 odebrání
  1. 3
    3
      Modules/LemmaCore/include/helper.h

+ 3
- 3
Modules/LemmaCore/include/helper.h Zobrazit soubor

293
     node["cols"] = rhs.cols();
293
     node["cols"] = rhs.cols();
294
     for (int ir=0; ir<rhs.rows(); ++ir) {
294
     for (int ir=0; ir<rhs.rows(); ++ir) {
295
         for (int ic=0; ic<rhs.cols(); ++ic) {
295
         for (int ic=0; ic<rhs.cols(); ++ic) {
296
-            node[ir][ic] = rhs(ir,ic);
296
+            node["data"][ir][ic] = rhs(ir,ic);
297
         }
297
         }
298
-        node[ir].SetStyle(YAML::EmitterStyle::Flow);
298
+        node["data"][ir].SetStyle(YAML::EmitterStyle::Flow);
299
     }
299
     }
300
     //node.SetStyle(YAML::EmitterStyle::Block);
300
     //node.SetStyle(YAML::EmitterStyle::Block);
301
     node.SetTag( "MatrixXr" );
301
     node.SetTag( "MatrixXr" );
311
     rhs.resize(nr, nc);
311
     rhs.resize(nr, nc);
312
     for (int ir=0; ir<nr; ++ir) {
312
     for (int ir=0; ir<nr; ++ir) {
313
         int ic=0;
313
         int ic=0;
314
-        for(YAML::const_iterator it=node[ir].begin(); it!=node[ir].end(); ++it) {
314
+        for(YAML::const_iterator it=node["data"][ir].begin(); it!=node["data"][ir].end(); ++it) {
315
             rhs(ir,ic) = it->as<Lemma::Real>();
315
             rhs(ir,ic) = it->as<Lemma::Real>();
316
             ++ic;
316
             ++ic;
317
         }
317
         }

Načítá se…
Zrušit
Uložit