Open CASCADE Technology  7.2.0
Public Member Functions | Protected Member Functions | Friends
math_IntegerVector Class Reference

This class implements the real IntegerVector abstract data type. IntegerVectors can have an arbitrary range which must be define at the declaration and cannot be changed after this declaration. Example: More...

#include <math_IntegerVector.hxx>

Public Member Functions

 math_IntegerVector (const Standard_Integer theFirst, const Standard_Integer theLast)
 contructs an IntegerVector in the range [Lower..Upper] More...
 
 math_IntegerVector (const Standard_Integer theFirst, const Standard_Integer theLast, const Standard_Integer theInitialValue)
 contructs an IntegerVector in the range [Lower..Upper] with all the elements set to theInitialValue. More...
 
void Init (const Standard_Integer theInitialValue)
 Initialize an IntegerVector with all the elements set to theInitialValue. More...
 
 math_IntegerVector (const Standard_Address theTab, const Standard_Integer theFirst, const Standard_Integer theLast)
 constructs an IntegerVector in the range [Lower..Upper] which share the "c array" theTab. More...
 
 math_IntegerVector (const math_IntegerVector &theOther)
 constructs a copy for initialization. An exception is raised if the lengths of the IntegerVectors are different. More...
 
Standard_Integer Length () const
 returns the length of an IntegerVector More...
 
Standard_Integer Lower () const
 returns the value of the Lower index of an IntegerVector. More...
 
Standard_Integer Upper () const
 returns the value of the Upper index of an IntegerVector. More...
 
Standard_Real Norm () const
 returns the value of the norm of an IntegerVector. More...
 
Standard_Real Norm2 () const
 returns the value of the square of the norm of an IntegerVector. More...
 
Standard_Integer Max () const
 returns the value of the Index of the maximum element of an IntegerVector. More...
 
Standard_Integer Min () const
 returns the value of the Index of the minimum element of an IntegerVector. More...
 
void Invert ()
 inverses an IntegerVector. More...
 
math_IntegerVector Inverse () const
 returns the inverse IntegerVector of an IntegerVector. More...
 
void Set (const Standard_Integer theI1, const Standard_Integer theI2, const math_IntegerVector &theV)
 sets an IntegerVector from "theI1" to "theI2" to the IntegerVector "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". More...
 
math_IntegerVector Slice (const Standard_Integer theI1, const Standard_Integer theI2) const
 slices the values of the IntegerVector between "theI1" and "theI2": Example: [2, 1, 2, 3, 4, 5] becomes [2, 4, 3, 2, 1, 5] between 2 and 5. An exception is raised if "theI1" is less than "LowerIndex" or "theI2" is greater than "UpperIndex". More...
 
void Multiply (const Standard_Integer theRight)
 returns the product of an IntegerVector by an integer value. More...
 
void operator*= (const Standard_Integer theRight)
 
math_IntegerVector Multiplied (const Standard_Integer theRight) const
 returns the product of an IntegerVector by an integer value. More...
 
math_IntegerVector operator* (const Standard_Integer theRight) const
 
math_IntegerVector TMultiplied (const Standard_Integer theRight) const
 returns the product of a vector and a real value. More...
 
void Add (const math_IntegerVector &theRight)
 adds the IntegerVector "theRight" to an IntegerVector. An exception is raised if the IntegerVectors have not the same length. An exception is raised if the lengths are not equal. More...
 
void operator+= (const math_IntegerVector &theRight)
 
math_IntegerVector Added (const math_IntegerVector &theRight) const
 adds the IntegerVector "theRight" to an IntegerVector. An exception is raised if the IntegerVectors have not the same length. An exception is raised if the lengths are not equal. More...
 
math_IntegerVector operator+ (const math_IntegerVector &theRight) const
 
void Add (const math_IntegerVector &theLeft, const math_IntegerVector &theRight)
 sets an IntegerVector to the sum of the IntegerVector "theLeft" and the IntegerVector "theRight". An exception is raised if the lengths are different. More...
 
void Subtract (const math_IntegerVector &theLeft, const math_IntegerVector &theRight)
 sets an IntegerVector to the substraction of "theRight" from "theLeft". An exception is raised if the IntegerVectors have not the same length. More...
 
Standard_IntegerValue (const Standard_Integer theNum) const
 accesses (in read or write mode) the value of index theNum of an IntegerVector. More...
 
Standard_Integeroperator() (const Standard_Integer theNum) const
 
math_IntegerVectorInitialized (const math_IntegerVector &theOther)
 Initialises an IntegerVector by copying "theOther". An exception is raised if the Lengths are different. More...
 
math_IntegerVectoroperator= (const math_IntegerVector &theOther)
 
Standard_Integer Multiplied (const math_IntegerVector &theRight) const
 returns the inner product of 2 IntegerVectors. An exception is raised if the lengths are not equal. More...
 
Standard_Integer operator* (const math_IntegerVector &theRight) const
 
math_IntegerVector Opposite ()
 returns the opposite of an IntegerVector. More...
 
math_IntegerVector operator- ()
 
void Subtract (const math_IntegerVector &theRight)
 returns the subtraction of "theRight" from "me". An exception is raised if the IntegerVectors have not the same length. More...
 
void operator-= (const math_IntegerVector &theRight)
 
math_IntegerVector Subtracted (const math_IntegerVector &theRight) const
 returns the subtraction of "theRight" from "me". An exception is raised if the IntegerVectors have not the same length. More...
 
math_IntegerVector operator- (const math_IntegerVector &theRight) const
 
void Multiply (const Standard_Integer theLeft, const math_IntegerVector &theRight)
 returns the multiplication of an integer by an IntegerVector. More...
 
void Dump (Standard_OStream &theO) const
 Prints on the stream theO information on the current state of the object. Is used to redefine the operator <<. More...
 

Protected Member Functions

void SetFirst (const Standard_Integer theFirst)
 is used internally to set the Lower value of the IntegerVector. More...
 

Friends

math_IntegerVector operator* (const Standard_Integer theLeft, const math_IntegerVector &theRight)
 
Standard_OStreamoperator<< (Standard_OStream &theO, const math_IntegerVector &theVec)
 

Detailed Description

This class implements the real IntegerVector abstract data type. IntegerVectors can have an arbitrary range which must be define at the declaration and cannot be changed after this declaration. Example:

math_IntegerVector V1(-3, 5); // an IntegerVector with range [-3..5]

IntegerVector is copied through assignement :

....
V2 = V1;
V1(1) = 2.0; // the IntegerVector V2 will not be modified.

The Exception RangeError is raised when trying to access outside the range of an IntegerVector :

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

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

V3 = V1; // --> will raise DimensionError;
V1.Add(V3) // --> will raise DimensionError;

Constructor & Destructor Documentation

◆ math_IntegerVector() [1/4]

math_IntegerVector::math_IntegerVector ( const Standard_Integer  theFirst,
const Standard_Integer  theLast 
)

contructs an IntegerVector in the range [Lower..Upper]

◆ math_IntegerVector() [2/4]

math_IntegerVector::math_IntegerVector ( const Standard_Integer  theFirst,
const Standard_Integer  theLast,
const Standard_Integer  theInitialValue 
)

contructs an IntegerVector in the range [Lower..Upper] with all the elements set to theInitialValue.

◆ math_IntegerVector() [3/4]

math_IntegerVector::math_IntegerVector ( const Standard_Address  theTab,
const Standard_Integer  theFirst,
const Standard_Integer  theLast 
)

constructs an IntegerVector in the range [Lower..Upper] which share the "c array" theTab.

◆ math_IntegerVector() [4/4]

math_IntegerVector::math_IntegerVector ( const math_IntegerVector theOther)

constructs a copy for initialization. An exception is raised if the lengths of the IntegerVectors are different.

Member Function Documentation

◆ Add() [1/2]

void math_IntegerVector::Add ( const math_IntegerVector theRight)

adds the IntegerVector "theRight" to an IntegerVector. An exception is raised if the IntegerVectors have not the same length. An exception is raised if the lengths are not equal.

◆ Add() [2/2]

void math_IntegerVector::Add ( const math_IntegerVector theLeft,
const math_IntegerVector theRight 
)

sets an IntegerVector to the sum of the IntegerVector "theLeft" and the IntegerVector "theRight". An exception is raised if the lengths are different.

◆ Added()

math_IntegerVector math_IntegerVector::Added ( const math_IntegerVector theRight) const

adds the IntegerVector "theRight" to an IntegerVector. An exception is raised if the IntegerVectors have not the same length. An exception is raised if the lengths are not equal.

◆ Dump()

void math_IntegerVector::Dump ( Standard_OStream theO) const

Prints on the stream theO information on the current state of the object. Is used to redefine the operator <<.

◆ Init()

void math_IntegerVector::Init ( const Standard_Integer  theInitialValue)

Initialize an IntegerVector with all the elements set to theInitialValue.

◆ Initialized()

math_IntegerVector& math_IntegerVector::Initialized ( const math_IntegerVector theOther)

Initialises an IntegerVector by copying "theOther". An exception is raised if the Lengths are different.

◆ Inverse()

math_IntegerVector math_IntegerVector::Inverse ( ) const

returns the inverse IntegerVector of an IntegerVector.

◆ Invert()

void math_IntegerVector::Invert ( )

inverses an IntegerVector.

◆ Length()

Standard_Integer math_IntegerVector::Length ( void  ) const
inline

returns the length of an IntegerVector

◆ Lower()

Standard_Integer math_IntegerVector::Lower ( void  ) const
inline

returns the value of the Lower index of an IntegerVector.

◆ Max()

Standard_Integer math_IntegerVector::Max ( ) const

returns the value of the Index of the maximum element of an IntegerVector.

◆ Min()

Standard_Integer math_IntegerVector::Min ( ) const

returns the value of the Index of the minimum element of an IntegerVector.

◆ Multiplied() [1/2]

math_IntegerVector math_IntegerVector::Multiplied ( const Standard_Integer  theRight) const

returns the product of an IntegerVector by an integer value.

◆ Multiplied() [2/2]

Standard_Integer math_IntegerVector::Multiplied ( const math_IntegerVector theRight) const

returns the inner product of 2 IntegerVectors. An exception is raised if the lengths are not equal.

◆ Multiply() [1/2]

void math_IntegerVector::Multiply ( const Standard_Integer  theRight)

returns the product of an IntegerVector by an integer value.

◆ Multiply() [2/2]

void math_IntegerVector::Multiply ( const Standard_Integer  theLeft,
const math_IntegerVector theRight 
)

returns the multiplication of an integer by an IntegerVector.

◆ Norm()

Standard_Real math_IntegerVector::Norm ( ) const

returns the value of the norm of an IntegerVector.

◆ Norm2()

Standard_Real math_IntegerVector::Norm2 ( ) const

returns the value of the square of the norm of an IntegerVector.

◆ operator()()

Standard_Integer& math_IntegerVector::operator() ( const Standard_Integer  theNum) const
inline

◆ operator*() [1/2]

math_IntegerVector math_IntegerVector::operator* ( const Standard_Integer  theRight) const
inline

◆ operator*() [2/2]

Standard_Integer math_IntegerVector::operator* ( const math_IntegerVector theRight) const
inline

◆ operator*=()

void math_IntegerVector::operator*= ( const Standard_Integer  theRight)
inline

◆ operator+()

math_IntegerVector math_IntegerVector::operator+ ( const math_IntegerVector theRight) const
inline

◆ operator+=()

void math_IntegerVector::operator+= ( const math_IntegerVector theRight)
inline

◆ operator-() [1/2]

math_IntegerVector math_IntegerVector::operator- ( )
inline

◆ operator-() [2/2]

math_IntegerVector math_IntegerVector::operator- ( const math_IntegerVector theRight) const
inline

◆ operator-=()

void math_IntegerVector::operator-= ( const math_IntegerVector theRight)
inline

◆ operator=()

math_IntegerVector& math_IntegerVector::operator= ( const math_IntegerVector theOther)
inline

◆ Opposite()

math_IntegerVector math_IntegerVector::Opposite ( )

returns the opposite of an IntegerVector.

◆ Set()

void math_IntegerVector::Set ( const Standard_Integer  theI1,
const Standard_Integer  theI2,
const math_IntegerVector theV 
)

sets an IntegerVector from "theI1" to "theI2" to the IntegerVector "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".

◆ SetFirst()

void math_IntegerVector::SetFirst ( const Standard_Integer  theFirst)
protected

is used internally to set the Lower value of the IntegerVector.

◆ Slice()

math_IntegerVector math_IntegerVector::Slice ( const Standard_Integer  theI1,
const Standard_Integer  theI2 
) const

slices the values of the IntegerVector between "theI1" and "theI2": Example: [2, 1, 2, 3, 4, 5] becomes [2, 4, 3, 2, 1, 5] between 2 and 5. An exception is raised if "theI1" is less than "LowerIndex" or "theI2" is greater than "UpperIndex".

◆ Subtract() [1/2]

void math_IntegerVector::Subtract ( const math_IntegerVector theLeft,
const math_IntegerVector theRight 
)

sets an IntegerVector to the substraction of "theRight" from "theLeft". An exception is raised if the IntegerVectors have not the same length.

◆ Subtract() [2/2]

void math_IntegerVector::Subtract ( const math_IntegerVector theRight)

returns the subtraction of "theRight" from "me". An exception is raised if the IntegerVectors have not the same length.

◆ Subtracted()

math_IntegerVector math_IntegerVector::Subtracted ( const math_IntegerVector theRight) const

returns the subtraction of "theRight" from "me". An exception is raised if the IntegerVectors have not the same length.

◆ TMultiplied()

math_IntegerVector math_IntegerVector::TMultiplied ( const Standard_Integer  theRight) const

returns the product of a vector and a real value.

◆ Upper()

Standard_Integer math_IntegerVector::Upper ( void  ) const
inline

returns the value of the Upper index of an IntegerVector.

◆ Value()

Standard_Integer& math_IntegerVector::Value ( const Standard_Integer  theNum) const
inline

accesses (in read or write mode) the value of index theNum of an IntegerVector.

Friends And Related Function Documentation

◆ operator*

math_IntegerVector operator* ( const Standard_Integer  theLeft,
const math_IntegerVector theRight 
)
friend

◆ operator<<

Standard_OStream& operator<< ( Standard_OStream theO,
const math_IntegerVector theVec 
)
friend

The documentation for this class was generated from the following file: