The template ROOT::Math::SVector class has 2 template parameters which define, at compile time, its properties. These are:
The following constructors are available to create a vector:
Here are some examples on how to create a vector. In the following we assume that we are using the namespace ROOT::Math.
The single vector elements can be set or retrieved using the operator[i] , operator(i) or the iterator interface. Notice that the index starts from zero and not from one as in FORTRAN. Also no check is performed on the passed index. Furthermore, all the matrix elements can be set also by using the ROOT::SVector::SetElements function passing a generic iterator. The elements can be accessed also by using the ROOT::Math::SVector::apply(i) function.
In addition there are methods to place a sub-vector in a vector. If the size of the the sub-vector is larger than the vector size a static assert ( a compilation error) is produced.
For additional Vector functionality see the Matrix and Vector Operators and Functions page