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.
More...
|
| math_VectorBase (const Standard_Integer theLower, const Standard_Integer theUpper) |
| Memory allocation.
|
|
| math_VectorBase (const Standard_Integer theLower, const Standard_Integer theUpper, const TheItemType theInitialValue) |
| Constructs a vector in the range [theLower..theUpper] whose values are all initialized with the value "theInitialValue".
|
|
| math_VectorBase (const TheItemType *theTab, const Standard_Integer theLower, const Standard_Integer theUpper) |
| Constructs a vector in the range [theLower..theUpper] whose values are all initialized with the value "theInitialValue".
|
|
| math_VectorBase (const gp_XY &Other) |
| Constructor for converting gp_XY to math_VectorBase.
|
|
| math_VectorBase (const gp_XYZ &Other) |
| Constructor for converting gp_XYZ to math_VectorBase.
|
|
void | Init (const TheItemType theInitialValue) |
| Initialize all the elements of a vector with "theInitialValue".
|
|
| math_VectorBase (const math_VectorBase &theOther) |
| Constructs a copy for initialization. An exception is raised if the lengths of the vectors are different.
|
|
Standard_Integer | Length () const |
| Returns the length of a vector.
|
|
Standard_Integer | Lower () const |
| Returns the lower index of the vector.
|
|
Standard_Integer | Upper () const |
| Returns the upper index of the vector.
|
|
Standard_Real | Norm () const |
| Returns the value or the square of the norm of this vector.
|
|
Standard_Real | Norm2 () const |
| Returns the value of the square of the norm of a vector.
|
|
Standard_Integer | Max () const |
| Returns the index of the maximum element of a vector. (first found)
|
|
Standard_Integer | Min () const |
| Returns the index of the minimum element of a vector. (first found)
|
|
void | Normalize () |
| Normalizes this vector (the norm of the result is equal to 1.0) and assigns the result to this vector Exceptions Standard_NullValue if this vector is null (i.e. if its norm is less than or equal to Standard_Real::RealEpsilon().
|
|
math_VectorBase | Normalized () const |
| Normalizes this vector (the norm of the result is equal to 1.0) and creates a new vector Exceptions Standard_NullValue if this vector is null (i.e. if its norm is less than or equal to Standard_Real::RealEpsilon().
|
|
void | Invert () |
| Inverts this vector and assigns the result to this vector.
|
|
math_VectorBase | Inverse () const |
| Inverts this vector and creates a new vector.
|
|
void | Set (const Standard_Integer theI1, const Standard_Integer theI2, const math_VectorBase &theV) |
| sets a vector from "theI1" to "theI2" to the vector "theV"; An exception is raised if "theI1" is less than "LowerIndex" or "theI2" is greater than "UpperIndex" or "theI1" is greater than "theI2". An exception is raised if "theI2-theI1+1" is different from the "Length" of "theV".
|
|
math_VectorBase | Slice (const Standard_Integer theI1, const Standard_Integer theI2) const |
| Creates a new vector by inverting the values of this vector between indexes "theI1" and "theI2". If the values of this vector were (1., 2., 3., 4.,5., 6.), by slicing it between indexes 2 and 5 the values of the resulting vector are (1., 5., 4., 3., 2., 6.)
|
|
void | Multiply (const TheItemType theRight) |
| Updates current vector by multiplying each element on current value.
|
|
void | operator*= (const TheItemType theRight) |
|
math_VectorBase | Multiplied (const TheItemType theRight) const |
| returns the product of a vector and a real value.
|
|
math_VectorBase | operator* (const TheItemType theRight) const |
|
math_VectorBase | TMultiplied (const TheItemType theRight) const |
| returns the product of a vector and a real value.
|
|
void | Divide (const TheItemType theRight) |
| divides a vector by the value "theRight". An exception is raised if "theRight" = 0.
|
|
void | operator/= (const TheItemType theRight) |
|
math_VectorBase | Divided (const TheItemType theRight) const |
| Returns new vector as dividing current vector with the value "theRight". An exception is raised if "theRight" = 0.
|
|
math_VectorBase | operator/ (const TheItemType theRight) const |
|
void | Add (const math_VectorBase &theRight) |
| adds the vector "theRight" to a vector. An exception is raised if the vectors have not the same length. Warning In order to avoid time-consuming copying of vectors, it is preferable to use operator += or the function Add whenever possible.
|
|
void | operator+= (const math_VectorBase &theRight) |
|
math_VectorBase | Added (const math_VectorBase &theRight) const |
| Returns new vector as adding curent vector with the value "theRight". An exception is raised if the vectors have not the same length. An exception is raised if the lengths are not equal.
|
|
math_VectorBase | operator+ (const math_VectorBase &theRight) const |
|
void | Multiply (const math_VectorBase &theLeft, const math_Matrix &theRight) |
| sets a vector to the product of the vector "theLeft" with the matrix "theRight".
|
|
void | Multiply (const math_Matrix &theLeft, const math_VectorBase &theRight) |
| sets a vector to the product of the matrix "theLeft" with the vector "theRight".
|
|
void | TMultiply (const math_Matrix &theTLeft, const math_VectorBase &theRight) |
| sets a vector to the product of the transpose of the matrix "theTLeft" by the vector "theRight".
|
|
void | TMultiply (const math_VectorBase &theLeft, const math_Matrix &theTRight) |
| sets a vector to the product of the vector "theLeft" by the transpose of the matrix "theTRight".
|
|
void | Add (const math_VectorBase &theLeft, const math_VectorBase &theRight) |
| sets a vector to the sum of the vector "theLeft" and the vector "theRight". An exception is raised if the lengths are different.
|
|
void | Subtract (const math_VectorBase &theLeft, const math_VectorBase &theRight) |
| sets a vector to the Subtraction of the vector theRight from the vector theLeft. An exception is raised if the vectors have not the same length. Warning In order to avoid time-consuming copying of vectors, it is preferable to use operator -= or the function Subtract whenever possible.
|
|
const TheItemType & | Value (const Standard_Integer theNum) const |
| accesses the value of index "theNum" of a vector.
|
|
TheItemType & | Value (const Standard_Integer theNum) |
| accesses (in read or write mode) the value of index "theNum" of a vector.
|
|
const TheItemType & | operator() (const Standard_Integer theNum) const |
|
TheItemType & | operator() (const Standard_Integer theNum) |
|
math_VectorBase & | Initialized (const math_VectorBase &theOther) |
| Initialises a vector by copying "theOther". An exception is raised if the Lengths are different.
|
|
math_VectorBase & | operator= (const math_VectorBase &theOther) |
|
TheItemType | Multiplied (const math_VectorBase &theRight) const |
| returns the inner product of 2 vectors. An exception is raised if the lengths are not equal.
|
|
TheItemType | operator* (const math_VectorBase &theRight) const |
|
math_VectorBase | Multiplied (const math_Matrix &theRight) const |
| returns the product of a vector by a matrix.
|
|
math_VectorBase | operator* (const math_Matrix &theRight) const |
|
math_VectorBase | Opposite () |
| returns the opposite of a vector.
|
|
math_VectorBase | operator- () |
|
void | Subtract (const math_VectorBase &theRight) |
| returns the subtraction of "theRight" from "me". An exception is raised if the vectors have not the same length.
|
|
void | operator-= (const math_VectorBase &theRight) |
|
math_VectorBase | Subtracted (const math_VectorBase &theRight) const |
| returns the subtraction of "theRight" from "me". An exception is raised if the vectors have not the same length.
|
|
math_VectorBase | operator- (const math_VectorBase &theRight) const |
|
void | Multiply (const TheItemType theLeft, const math_VectorBase &theRight) |
| returns the multiplication of a real by a vector. "me" = "theLeft" * "theRight"
|
|
void | Dump (Standard_OStream &theO) const |
| Prints information on the current state of the object. Is used to redefine the operator <<.
|
|
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.
Definition NCollection_UBTree.hxx:64
Vector are copied through assignment:
....
V2 = V1;
V1(1) = 2.0;
The Exception RangeError is raised when trying to access outside the range of a vector :
The Exception DimensionError is raised when the dimensions of two vectors are not compatible :