SG++-Doxygen-Documentation
Loading...
Searching...
No Matches
Using the DataVector object

This example shows how to initialize a DataVector object, store it to a file and then to restore it back.

#include <iostream>
int main() {
A class to store one-dimensional data.
Definition DataVector.hpp:25
int main()
Definition densityMultiplication.cpp:22

We create a DataVector and fill it with 3 values

DataVector v;
v.append(1.0);
v.append(2.0);
v.append(3.0);

We save the DataVector to file

v.toFile("dataVectorTest.vec");

We load the saved DataVector and then save it again (for no particular reason)

DataVector w = DataVector::fromFile("dataVectorTest.vec");
w.toFile("dataVectorTest2.vec");
}