// This file is generated by WOK (CPPExt). // Please do not edit this file; modify original file instead. // The copyright and license terms as defined for the original file apply to // this header file considered to be the "object code" form of the original source. #ifndef _math_Vector_HeaderFile #define _math_Vector_HeaderFile #ifndef _Standard_HeaderFile #include #endif #ifndef _Standard_Macro_HeaderFile #include #endif #ifndef _Standard_Integer_HeaderFile #include #endif #ifndef _math_SingleTabOfReal_HeaderFile #include #endif #ifndef _Standard_Real_HeaderFile #include #endif #ifndef _Standard_Address_HeaderFile #include #endif #ifndef _Standard_OStream_HeaderFile #include #endif class Standard_DimensionError; class Standard_DivideByZero; class Standard_RangeError; class Standard_NullValue; class math_Matrix; //! 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]
class math_Vector { public: void* operator new(size_t,void* anAddress) { return anAddress; } void* operator new(size_t size) { return Standard::Allocate(size); } void operator delete(void *anAddress) { if (anAddress) Standard::Free((Standard_Address&)anAddress); } //! Contructs a non-initialized vector in the range [Lower..Upper]
//! Lower and Upper are the indexes of the lower and upper
//! bounds of the constructed vector.
Standard_EXPORT math_Vector(const Standard_Integer Lower,const Standard_Integer Upper); //! Contructs a vector in the range [Lower..Upper]
//! whose values are all initialized with the value InitialValue..
Standard_EXPORT math_Vector(const Standard_Integer Lower,const Standard_Integer Upper,const Standard_Real InitialValue); //! Constructs a vector in the range [Lower..Upper]
//! with the "c array" Tab.
Standard_EXPORT math_Vector(const Standard_Address Tab,const Standard_Integer Lower,const Standard_Integer Upper); //! Initialize all the elements of a vector with InitialValue.
Standard_EXPORT void Init(const Standard_Real InitialValue) ; //! Constructs a copy for initialization.
//! An exception is raised if the lengths of the vectors are
//! different.
Standard_EXPORT math_Vector(const math_Vector& Other); //! Returns the length of a vector
Standard_Integer Length() const; //! Returns the value of the Lower index of a vector.
Standard_Integer Lower() const; //! Returns the value of the Upper index of a vector.
Standard_Integer Upper() const; //! Returns the value or the square of the norm of this vector.
Standard_EXPORT Standard_Real Norm() const; //! Returns the value of the square of the norm of a vector.
Standard_EXPORT Standard_Real Norm2() const; //! Returns the value of the Index of the maximum element of a vector.
Standard_EXPORT Standard_Integer Max() const; //! Returns the value of the Index of the minimum element of a vector.
Standard_EXPORT Standard_Integer Min() const; //! 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().
Standard_EXPORT void Normalize() ; //! 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().
Standard_EXPORT math_Vector Normalized() const; //! Inverts this vector and assigns the result to this vector.
Standard_EXPORT void Invert() ; //! Inverts this vector and creates a new vector.
Standard_EXPORT math_Vector Inverse() const; //! sets a vector from to to the vector ;
//! An exception is raised if I1UpperIndex or I1>I2.
//! An exception is raised if I2-I1+1 is different from the Length of V.
Standard_EXPORT void Set(const Standard_Integer I1,const Standard_Integer I2,const math_Vector& V) ; //!Creates a new vector by inverting the values of this vector
//! between indexes I1 and I2.
//! 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.)
Standard_EXPORT math_Vector Slice(const Standard_Integer I1,const Standard_Integer I2) const; //! returns the product of a vector and a real value.
Standard_EXPORT void Multiply(const Standard_Real Right) ; void operator *=(const Standard_Real Right) { Multiply(Right); } //! returns the product of a vector and a real value.
Standard_EXPORT math_Vector Multiplied(const Standard_Real Right) const; math_Vector operator*(const Standard_Real Right) const { return Multiplied(Right); } //! returns the product of a vector and a real value.
Standard_EXPORT math_Vector TMultiplied(const Standard_Real Right) const; friend math_Vector operator *(const Standard_Real Left,const math_Vector& Right); //! divides a vector by the value .
//! An exception is raised if = 0.
Standard_EXPORT void Divide(const Standard_Real Right) ; void operator /=(const Standard_Real Right) { Divide(Right); } //! divides a vector by the value .
//! An exception is raised if = 0.
Standard_EXPORT math_Vector Divided(const Standard_Real Right) const; math_Vector operator/(const Standard_Real Right) const { return Divided(Right); } //! adds the vector 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.
Standard_EXPORT void Add(const math_Vector& Right) ; void operator +=(const math_Vector& Right) { Add(Right); } //! adds the vector to a vector.
//! An exception is raised if the vectors have not the same length.
//! An exception is raised if the lengths are not equal.
Standard_EXPORT math_Vector Added(const math_Vector& Right) const; math_Vector operator+(const math_Vector& Right) const { return Added(Right); } //! sets a vector to the product of the vector
//! with the matrix .
Standard_EXPORT void Multiply(const math_Vector& Left,const math_Matrix& Right) ; //!sets a vector to the product of the matrix
//! with the vector .
Standard_EXPORT void Multiply(const math_Matrix& Left,const math_Vector& Right) ; //! sets a vector to the product of the transpose
//! of the matrix by the vector .
Standard_EXPORT void TMultiply(const math_Matrix& TLeft,const math_Vector& Right) ; //! sets a vector to the product of the vector
//! by the transpose of the matrix .
Standard_EXPORT void TMultiply(const math_Vector& Left,const math_Matrix& TRight) ; //! sets a vector to the sum of the vector
//! and the vector .
//! An exception is raised if the lengths are different.
Standard_EXPORT void Add(const math_Vector& Left,const math_Vector& Right) ; //! sets a vector to the Subtraction of the
//! vector from the 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
//! Subtract whenever possible.
Standard_EXPORT void Subtract(const math_Vector& Left,const math_Vector& Right) ; //! accesses (in read or write mode) the value of index Num of
//! a vector.
Standard_Real& Value(const Standard_Integer Num) const; Standard_Real& operator()(const Standard_Integer Num) const { return Value(Num); } //! Initialises a vector by copying .
//! An exception is raised if the Lengths are differents.
Standard_EXPORT math_Vector& Initialized(const math_Vector& Other) ; math_Vector& operator=(const math_Vector& Other) { return Initialized(Other); } //! returns the inner product of 2 vectors.
//! An exception is raised if the lengths are not equal.
Standard_EXPORT Standard_Real Multiplied(const math_Vector& Right) const; Standard_Real operator*(const math_Vector& Right) const { return Multiplied(Right); } //! returns the product of a vector by a matrix.
Standard_EXPORT math_Vector Multiplied(const math_Matrix& Right) const; math_Vector operator*(const math_Matrix& Right) const { return Multiplied(Right); } //! returns the opposite of a vector.
Standard_EXPORT math_Vector Opposite() ; math_Vector operator-() { return Opposite(); } //! returns the subtraction of from .
//! An exception is raised if the vectors have not the same length.
Standard_EXPORT void Subtract(const math_Vector& Right) ; void operator-=(const math_Vector& Right) { Subtract(Right); } //! returns the subtraction of from .
//! An exception is raised if the vectors have not the same length.
Standard_EXPORT math_Vector Subtracted(const math_Vector& Right) const; math_Vector operator-(const math_Vector& Right) const { return Subtracted(Right); } //! returns the multiplication of a real by a vector.
//! = *
Standard_EXPORT void Multiply(const Standard_Real Left,const math_Vector& Right) ; //! Prints information on the current state of the object.
//! Is used to redefine the operator <<.
Standard_EXPORT void Dump(Standard_OStream& o) const; friend class math_Matrix; protected: //! Is used internally to set the Lower value of the vector.
Standard_EXPORT void SetLower(const Standard_Integer Lower) ; private: Standard_Integer LowerIndex; Standard_Integer UpperIndex; math_SingleTabOfReal Array; }; #include // other Inline functions and methods (like "C++: function call" methods) #endif