OCC Main Page | FoundationClasses | Toolkits | Packages | Class Hierarchy | Data Structures | File List | Data Fields | Globals

FoundationClasses
TKMath
math


math_Vector Class Reference

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]
.

#include <math_Vector.hxx>


Public Member Functions

void * operator new (size_t, void *anAddress)
void * operator new (size_t size)
void operator delete (void *anAddress)
Standard_EXPORT math_Vector (const Standard_Integer Lower, const Standard_Integer Upper)
 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, const Standard_Real InitialValue)
 Contructs a vector in the range [Lower..Upper]
whose values are all initialized with the value InitialValue..
.
Standard_EXPORT math_Vector (const Standard_Address Tab, const Standard_Integer Lower, const Standard_Integer Upper)
 Constructs a vector in the range [Lower..Upper]
with the "c array" Tab.
.
Standard_EXPORT void Init (const Standard_Real InitialValue)
 Initialize all the elements of a vector with InitialValue.
.
Standard_EXPORT math_Vector (const math_Vector &Other)
 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 value of the Lower index of a vector.
.
Standard_Integer Upper () const
 Returns the value of the Upper index of a vector.
.
Standard_EXPORT Standard_Real Norm () const
 Returns the value or the square of the norm of this vector.
.
Standard_EXPORT Standard_Real Norm2 () const
 Returns the value of the square of the norm of a vector.
.
Standard_EXPORT Standard_Integer Max () const
 Returns the value of the Index of the maximum element of a vector.
.
Standard_EXPORT Standard_Integer Min () const
 Returns the value of the Index of the minimum element of a vector.
.
Standard_EXPORT 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().
.
Standard_EXPORT math_Vector 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().
.
Standard_EXPORT void Invert ()
 Inverts this vector and assigns the result to this vector.
.
Standard_EXPORT math_Vector Inverse () const
 Inverts this vector and creates a new vector.
.
Standard_EXPORT void Set (const Standard_Integer I1, const Standard_Integer I2, const math_Vector &V)
 sets a vector from <i1> to <i2> to the vector <v>;
An exception is raised if I1<LowerIndex or I2>UpperIndex or I1>I2.
An exception is raised if I2-I1+1 is different from the Length of V.

Standard_EXPORT math_Vector Slice (const Standard_Integer I1, const Standard_Integer I2) const
 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 void Multiply (const Standard_Real Right)
 returns the product of a vector and a real value.

void operator *= (const Standard_Real Right)
Standard_EXPORT math_Vector Multiplied (const Standard_Real Right) const
 returns the product of a vector and a real value.

math_Vector operator * (const Standard_Real Right) const
Standard_EXPORT math_Vector TMultiplied (const Standard_Real Right) const
 returns the product of a vector and a real value.

Standard_EXPORT void Divide (const Standard_Real Right)
 divides a vector by the value <right>.
An exception is raised if <right> = 0.

void operator/= (const Standard_Real Right)
Standard_EXPORT math_Vector Divided (const Standard_Real Right) const
 divides a vector by the value <right>.
An exception is raised if <right> = 0.

math_Vector operator/ (const Standard_Real Right) const
Standard_EXPORT void Add (const math_Vector &Right)
 adds the vector <right> 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_Vector &Right)
Standard_EXPORT math_Vector Added (const math_Vector &Right) const
 adds the vector <right> 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.

math_Vector operator+ (const math_Vector &Right) const
Standard_EXPORT void Multiply (const math_Vector &Left, const math_Matrix &Right)
 sets a vector to the product of the vector <left>
with the matrix <right>.

Standard_EXPORT void Multiply (const math_Matrix &Left, const math_Vector &Right)
 sets a vector to the product of the matrix <left>
with the vector <right>.

Standard_EXPORT void TMultiply (const math_Matrix &TLeft, const math_Vector &Right)
 sets a vector to the product of the transpose
of the matrix <tleft> by the vector <right>.

Standard_EXPORT void TMultiply (const math_Vector &Left, const math_Matrix &TRight)
 sets a vector to the product of the vector
<left> by the transpose of the matrix <tright>.

Standard_EXPORT void Add (const math_Vector &Left, const math_Vector &Right)
 sets a vector to the sum of the vector <left>
and the vector <right>.
An exception is raised if the lengths are different.

Standard_EXPORT void Subtract (const math_Vector &Left, const math_Vector &Right)
 sets a vector to the Subtraction of the
vector <right> from the vector <left>.
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_RealValue (const Standard_Integer Num) const
 accesses (in read or write mode) the value of index Num of
a vector.

Standard_Realoperator() (const Standard_Integer Num) const
Standard_EXPORT math_VectorInitialized (const math_Vector &Other)
 Initialises a vector by copying <other>.
An exception is raised if the Lengths are differents.
.
math_Vectoroperator= (const math_Vector &Other)
Standard_EXPORT Standard_Real Multiplied (const math_Vector &Right) const
 returns the inner product of 2 vectors.
An exception is raised if the lengths are not equal.

Standard_Real operator * (const math_Vector &Right) const
Standard_EXPORT math_Vector Multiplied (const math_Matrix &Right) const
 returns the product of a vector by a matrix.

math_Vector operator * (const math_Matrix &Right) const
Standard_EXPORT math_Vector Opposite ()
 returns the opposite of a vector.

math_Vector operator- ()
Standard_EXPORT void Subtract (const math_Vector &Right)
 returns the subtraction of <right> from <me>.
An exception is raised if the vectors have not the same length.

void operator-= (const math_Vector &Right)
Standard_EXPORT math_Vector Subtracted (const math_Vector &Right) const
 returns the subtraction of <right> from <me>.
An exception is raised if the vectors have not the same length.

math_Vector operator- (const math_Vector &Right) const
Standard_EXPORT void Multiply (const Standard_Real Left, const math_Vector &Right)
 returns the multiplication of a real by a vector.
<me> = <left> * <right>

Standard_EXPORT void Dump (Standard_OStream &o) const
 Prints information on the current state of the object.
Is used to redefine the operator <<.
.

Protected Member Functions

Standard_EXPORT void SetLower (const Standard_Integer Lower)
 Is used internally to set the Lower value of the vector.
.

Private Attributes

Standard_Integer LowerIndex
Standard_Integer UpperIndex
math_SingleTabOfReal Array

Friends

math_Vector operator * (const Standard_Real Left, const math_Vector &Right)


Constructor & Destructor Documentation

Standard_EXPORT math_Vector::math_Vector const Standard_Integer  Lower,
const Standard_Integer  Upper
 

Standard_EXPORT math_Vector::math_Vector const Standard_Integer  Lower,
const Standard_Integer  Upper,
const Standard_Real  InitialValue
 

Standard_EXPORT math_Vector::math_Vector const Standard_Address  Tab,
const Standard_Integer  Lower,
const Standard_Integer  Upper
 

Standard_EXPORT math_Vector::math_Vector const math_Vector Other  ) 
 


Member Function Documentation

Standard_EXPORT void math_Vector::Add const math_Vector Left,
const math_Vector Right
 

Standard_EXPORT void math_Vector::Add const math_Vector Right  ) 
 

Standard_EXPORT math_Vector math_Vector::Added const math_Vector Right  )  const
 

Standard_EXPORT void math_Vector::Divide const Standard_Real  Right  ) 
 

Standard_EXPORT math_Vector math_Vector::Divided const Standard_Real  Right  )  const
 

Standard_EXPORT void math_Vector::Dump Standard_OStream o  )  const
 

Standard_EXPORT void math_Vector::Init const Standard_Real  InitialValue  ) 
 

Standard_EXPORT math_Vector& math_Vector::Initialized const math_Vector Other  ) 
 

Standard_EXPORT math_Vector math_Vector::Inverse  )  const
 

Standard_EXPORT void math_Vector::Invert  ) 
 

Standard_Integer math_Vector::Length  )  const [inline]
 

Standard_Integer math_Vector::Lower  )  const [inline]
 

Standard_EXPORT Standard_Integer math_Vector::Max  )  const
 

Standard_EXPORT Standard_Integer math_Vector::Min  )  const
 

Standard_EXPORT math_Vector math_Vector::Multiplied const math_Matrix Right  )  const
 

Standard_EXPORT Standard_Real math_Vector::Multiplied const math_Vector Right  )  const
 

Standard_EXPORT math_Vector math_Vector::Multiplied const Standard_Real  Right  )  const
 

Standard_EXPORT void math_Vector::Multiply const Standard_Real  Left,
const math_Vector Right
 

Standard_EXPORT void math_Vector::Multiply const math_Matrix Left,
const math_Vector Right
 

Standard_EXPORT void math_Vector::Multiply const math_Vector Left,
const math_Matrix Right
 

Standard_EXPORT void math_Vector::Multiply const Standard_Real  Right  ) 
 

Standard_EXPORT Standard_Real math_Vector::Norm  )  const
 

Standard_EXPORT Standard_Real math_Vector::Norm2  )  const
 

Standard_EXPORT void math_Vector::Normalize  ) 
 

Standard_EXPORT math_Vector math_Vector::Normalized  )  const
 

math_Vector math_Vector::operator * const math_Matrix Right  )  const [inline]
 

Standard_Real math_Vector::operator * const math_Vector Right  )  const [inline]
 

math_Vector math_Vector::operator * const Standard_Real  Right  )  const [inline]
 

void math_Vector::operator *= const Standard_Real  Right  )  [inline]
 

void math_Vector::operator delete void *  anAddress  )  [inline]
 

void* math_Vector::operator new size_t  size  )  [inline]
 

void* math_Vector::operator new size_t  ,
void *  anAddress
[inline]
 

Standard_Real& math_Vector::operator() const Standard_Integer  Num  )  const [inline]
 

math_Vector math_Vector::operator+ const math_Vector Right  )  const [inline]
 

void math_Vector::operator+= const math_Vector Right  )  [inline]
 

math_Vector math_Vector::operator- const math_Vector Right  )  const [inline]
 

math_Vector math_Vector::operator-  )  [inline]
 

void math_Vector::operator-= const math_Vector Right  )  [inline]
 

math_Vector math_Vector::operator/ const Standard_Real  Right  )  const [inline]
 

void math_Vector::operator/= const Standard_Real  Right  )  [inline]
 

math_Vector& math_Vector::operator= const math_Vector Other  )  [inline]
 

Standard_EXPORT math_Vector math_Vector::Opposite  ) 
 

Standard_EXPORT void math_Vector::Set const Standard_Integer  I1,
const Standard_Integer  I2,
const math_Vector V
 

Standard_EXPORT void math_Vector::SetLower const Standard_Integer  Lower  )  [protected]
 

Standard_EXPORT math_Vector math_Vector::Slice const Standard_Integer  I1,
const Standard_Integer  I2
const
 

Standard_EXPORT void math_Vector::Subtract const math_Vector Right  ) 
 

Standard_EXPORT void math_Vector::Subtract const math_Vector Left,
const math_Vector Right
 

Standard_EXPORT math_Vector math_Vector::Subtracted const math_Vector Right  )  const
 

Standard_EXPORT math_Vector math_Vector::TMultiplied const Standard_Real  Right  )  const
 

Standard_EXPORT void math_Vector::TMultiply const math_Vector Left,
const math_Matrix TRight
 

Standard_EXPORT void math_Vector::TMultiply const math_Matrix TLeft,
const math_Vector Right
 

Standard_Integer math_Vector::Upper  )  const [inline]
 

Standard_Real & math_Vector::Value const Standard_Integer  Num  )  const [inline]
 


Friends And Related Function Documentation

math_Vector operator * const Standard_Real  Left,
const math_Vector Right
[friend]
 


Field Documentation

math_SingleTabOfReal math_Vector::Array [private]
 

Standard_Integer math_Vector::LowerIndex [private]
 

Standard_Integer math_Vector::UpperIndex [private]
 


The documentation for this class was generated from the following files:
Generated on Mon Aug 25 13:12:47 2008 for OpenCASCADE by  doxygen 1.4.1