Open CASCADE Technology 7.8.2.dev
math_Vector.hxx File Reference

Typedefs

using math_Vector = math_VectorBase<double>
 This class implements the real vector abstract data type. Vectors can have an arbitrary range which must be defined at the declaration and cannot be changed after this declaration.
 

Typedef Documentation

◆ math_Vector

using math_Vector = math_VectorBase<double>

This class implements the real vector abstract data type. Vectors can have an arbitrary range which must be defined at the declaration and cannot be changed after this declaration.

math_Vector V1(-3, 5); // a vector with range [-3..5]

Vector are copied through assignment:

math_Vector V2( 1, 9);
....
V2 = V1;
V1(1) = 2.0; // the vector V2 will not be modified.

The Exception RangeError is raised when trying to access outside the range of a vector :

V1(11) = 0.0 // --> will raise RangeError;

The Exception DimensionError is raised when the dimensions of two vectors are not compatible :

math_Vector V3(1, 2);
V3 = V1; // --> will raise DimensionError;
V1.Add(V3) // --> will raise DimensionError;