SG++
Using the DataVector object

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

from pysgpp import *

Create a vector with 3 elements

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

Store the vector to file

v.toFile("dataVectorTest.mat")

Load the created DataVector from file and then save it again (for no particular reason)

v2 = DataMatrix.fromFile("dataVectorTest.mat")
v2.toFile("dataVectorTest2.mat")