|
C++ main module for gpm Package
1.0
|
this class describes an array More...
#include <CORE_Vector.h>


Public Member Functions | |
| CORE_Vector () | |
| build a vector of T More... | |
| CORE_Vector (const int &n) | |
| build a vector of T More... | |
| CORE_Vector (const CORE_Vector< T > &v) | |
| build a vector of T More... | |
| virtual | ~CORE_Vector () |
| destroy an array of T* More... | |
| void | getSharedPointer (boost::shared_ptr< CORE_Vector< T > > &p) |
| get the shared pointer into P More... | |
| void | getSharedPointer (boost::shared_ptr< const CORE_Vector< T > > &p) const |
| get the shared pointer into P More... | |
| const T & | operator[] (int i) const |
| get the i-th element ASSERT_IN(i>-1); ASSERT_IN(i<((int)mVector.size())); More... | |
| T & | operator[] (int i) |
| get the i-th element ASSERT_IN(i>-1); ASSERT_IN(i<((int)mVector.size())); More... | |
| void | setValue (const int &i, const T &v) |
| set value More... | |
| void | setSize (const int &n) |
| set the size of the array More... | |
| void | setCapacity (const int &n) |
| set the size of the array More... | |
| void | initValues (const T &v) |
| init the value to v More... | |
| void | divideBy (const tReal &v) |
| divide by value v More... | |
| void | multiplyBy (const tReal &v) |
| multiplied by value v More... | |
| void | addAfterIndex (const int &index, const T &v) |
| add an element after index More... | |
| void | addAfterIndices (boost::shared_ptr< CORE_Vector< int > > &p_indices, const CORE_SharedPointersList< CORE_Vector< T > > &values) |
| add alements after indices More... | |
| void | add (const CORE_Vector< T > &v) |
| init the value to v More... | |
| void | normalize () |
| normalize More... | |
| void | add (const tReal &f, const CORE_Vector< T > &v) |
| init the value to v More... | |
| void | sub (const CORE_Vector< T > &v) |
| init the value to v More... | |
| void | sub (const CORE_Vector< T > &u, const CORE_Vector< T > &v) |
| init the value to u-v More... | |
| void | sub (const tReal &f, const CORE_Vector< T > &v) |
| init the value to v More... | |
| template<class Y > | |
| void | copy (const CORE_Vector< Y > &array) |
| copy More... | |
| template<class Y > | |
| void | copy (const CORE_Vector< Y > *array) |
| copy More... | |
| template<class Y > | |
| void | copy (const boost::shared_ptr< CORE_Vector< T > > &array) |
| copy More... | |
| template<class Y > | |
| void | setValues (const vector< Y > &array) |
| copy More... | |
| template<class Y > | |
| void | setValues (const Y *array, const int &n) |
| copy More... | |
| tBoolean | set (int i, const T &obj) |
| set the pointer at the index i More... | |
| tBoolean | insert (int i, const T &obj) |
| insert the pointer at index i the old element i become the element i+1 More... | |
| int | insertInOrder (const T &obj, const tBoolean &evenIfEqual) |
| insert T More... | |
| int | insert (const T &obj) |
| insert T More... | |
| void | add (const T &obj) |
| add an element at the end More... | |
| virtual void | addInList (const T &obj) |
| add a core object More... | |
| void | merge (const CORE_Vector< T > &array) |
| merge the array in this More... | |
| void | sort (const tString &order) |
sort the vector
< increasing order More... | |
| tBoolean | remove (const T &obj) |
| remove the pointer More... | |
| tBoolean | removeAtIndex (const int &i) |
| remove the pointer at index i More... | |
| tBoolean | remove () |
| remove the last pointer More... | |
| void | clear () |
| clear the array More... | |
| T & | getLastElement () |
| get last element pointer More... | |
| const T & | get (int i) const |
| get the pointer at index i ASSERT_IN(i>-1); ASSERT_IN(i<((int)mVector.size())); More... | |
| T & | get (int i) |
| get the pointer at index i ASSERT_IN(i>-1); ASSERT_IN(i<((int)mVector.size())); More... | |
| int | size () const |
| return the size of the vector More... | |
| int | getSize () const |
| return the size of the vector More... | |
| int | getDimension () const |
| return the dimension of the vector More... | |
| const T & | getValue (const int &i) const |
| get value More... | |
| const vector< T > & | getValues () const |
| get values More... | |
| vector< T > & | getValues () |
| get values More... | |
| tBoolean | exists (const T &obj) const |
| exists More... | |
| vector< T > & | getVector () |
| get vector More... | |
| const vector< T > & | getVector () const |
| get vector More... | |
| int | search (const T &value, const tString &order) |
| search the value in values vector ordered in order More... | |
| void | permute (const int &i, const int &j) |
| permute More... | |
| void | reverse () |
| reverse the vector More... | |
| void | begin () |
| put the iterator on begin More... | |
| tBoolean | hasNext () const |
| return true if the array has next element More... | |
| T & | next () |
| return the next element More... | |
| template<class Q > | |
| tReal | distance2 (const CORE_Vector< Q > &a) const |
| return the squared distance of the vector with the a vector More... | |
| template<class Q > | |
| tReal | distance (const CORE_Vector< Q > &a) const |
| return the distance of the vector with the a vector More... | |
| template<class Q > | |
| tReal | scalarProduct (const CORE_Vector< Q > &a) const |
| return the scalar product of the vector with the a vector More... | |
| template<class Q > | |
| tReal | scalarProduct (const CORE_Vector< Q > *a) const |
| return the scalar product of the vector with the a vector More... | |
| template<class Q > | |
| void | crossProduct (const CORE_Vector< Q > &a, CORE_Vector< Q > &res) const |
| return the cross product of the vector with the a vector More... | |
| void | rotX (const tReal &alpha) |
| rotate the vector among x-axes with angle alpha More... | |
| void | rotZ (const tReal &gamma) |
| rotate the vector among z-axes with angle gamma More... | |
| tReal | norm2 () const |
| return the squared norm of the vector More... | |
| tReal | norm () const |
| return the norm of the vector More... | |
| virtual tString | toString () const |
| return the string representation of the object node More... | |
| void | getSharedPointer (SP::CORE_Object &p) |
| get the shared pointer of this class into p More... | |
| void | getSharedPointer (SPC::CORE_Object &p) const |
| get the shared pointer of this class into p More... | |
| tString | getClassName () const |
| return the class name of the object More... | |
| tString | getIdentityString () const |
| return the identity string of the object of the form className_at_address More... | |
| tString | getPointerAddress () const |
| return the identity string of the object More... | |
| template<class T > | |
| tBoolean | isInstanceOf () const |
| return true if the object is an instance of T More... | |
| virtual void | print () |
| print the class More... | |
| virtual ostream & | print (ostream &out) const |
| print the class More... | |
| virtual void | print (const tString &message) |
| print the class More... | |
| virtual void | print (const tInteger &str) |
| print More... | |
| virtual void | print (const tRelativeInteger &str) |
| print More... | |
| virtual void | print (const tReal &str) |
| print More... | |
| virtual void | print (const int &str) |
| print More... | |
Static Public Member Functions | |
| static boost::shared_ptr < CORE_Vector< T > > | New (const boost::shared_ptr< CORE_Vector< T > > &v) |
| create a shared pointer of vector which is a copy of vector v More... | |
| static boost::shared_ptr < CORE_Vector< T > > | New (const CORE_Vector< T > &v) |
| create a shared pointer of vector which is a copy of vector v More... | |
| static boost::shared_ptr < CORE_Vector< T > > | New (const CORE_Vector< T > *v) |
| create a shared pointer of vector which is a copy of vector v More... | |
| static boost::shared_ptr < CORE_Vector< T > > | New () |
| create a shared pointer of vector More... | |
| static boost::shared_ptr < CORE_Vector< T > > | New (const int &dim) |
| create a shared pointer of vector of size dim More... | |
| static void | sort (vector< T > &items, const tString &order) |
| sort the vector items More... | |
| static int | search (const vector< T > &values, const T &value, const tString &order) |
| search the value in values vector ordered in order More... | |
| template<class Q > | |
| static void | crossProduct (const CORE_Vector< Q > &a, const CORE_Vector< Q > &b, CORE_Vector< Q > &res) |
| return the cross product of the vector with the a vector More... | |
| static tBoolean | compare (const tString &a, const tString &b, const tString &order) |
| compare 2 strings More... | |
| static tBoolean | compare (const int &a, const int &b, const tString &order) |
| compare 2 ints More... | |
| static tBoolean | compare (const tReal &a, const tReal &b, const tString &order) |
| compare 2 reals More... | |
| static tBoolean | areEqual (const int &a, const int &b) |
| compare 2 primitive object More... | |
| static tBoolean | areEqual (const long int &a, const long int &b) |
| compare 2 primitive object More... | |
| static tBoolean | areEqual (const float &a, const float &b) |
| compare 2 primitive object More... | |
| static tBoolean | areEqual (const double &a, const double &b) |
| compare 2 primitive object More... | |
| static tBoolean | areEqual (const long double &a, const long double &b) |
| compare 2 primitive object More... | |
| static tBoolean | areEqual (const short &a, const short &b) |
| compare 2 primitive object More... | |
| static tBoolean | areEqual (const unsigned char &a, const unsigned char &b) |
| compare 2 primitive object More... | |
| static tBoolean | areEqual (const unsigned long int &a, const unsigned long int &b) |
| compare 2 primitive object More... | |
| static tBoolean | areEqual (const bool &a, const bool &b) |
| compare 2 primitive object More... | |
| static tBoolean | areEqual (const char &a, const char &b) |
| compare 2 primitive object More... | |
| static tBoolean | areEqual (const complex< double > &a, const complex< double > &b) |
| compare 2 primitive object More... | |
| static tBoolean | areEqual (const string &a, const string &b) |
| compare 2 primitive object More... | |
| static tString | getClassName (const tString &identityString) |
| return the class name of the object using only the identity string More... | |
| template<class T > | |
| static tString | getTypeName () |
| get type name More... | |
| static tBoolean | is64Architecture () |
| return true if the machine is a 64 bits machine More... | |
| static tBoolean | is32Architecture () |
| return true if the machine is a 32 bits machine More... | |
| static tString | pointer2String (const void *obj) |
| return the string represantation of a pointer More... | |
| static void | setOutput (ostream &out) |
| set output More... | |
| static ostream & | getOutput () |
| get output More... | |
| static void | printObjectsInMemory () |
| print object in memory More... | |
| static ostream & | print (ostream &out, const tString &message) |
| print the class More... | |
| static void | outputPrint (const tString &message) |
Static Public Attributes | |
| static tBoolean | mIsMemoryTesting =false |
| indicator to store all classes created and deleted only for debuging version More... | |
Protected Member Functions | |
| void | setThis (SP::CORE_Object p) |
| set this weak shared pointer called toDoAfterThis setting method More... | |
| virtual void | setType (tString type) |
| set the type of the object More... | |
| virtual void | toDoAfterThisSetting () |
| method called after setThis() method this method can oly be called once. More... | |
this class describes an array
| CORE_Vector< T >::CORE_Vector | ( | ) |
build a vector of T
| CORE_Vector< T >::CORE_Vector | ( | const int & | n | ) |
build a vector of T
| CORE_Vector< T >::CORE_Vector | ( | const CORE_Vector< T > & | v | ) |
build a vector of T
References CORE_Vector< T >::getSize().

|
virtual |
destroy an array of T*
|
inline |
init the value to v
Referenced by CORE_SharedPointersListVMap< Key, Value >::getKeys(), CORE_SharedPointersVMap< Key, Value >::getKeys(), and CORE_Map< Key, Value >::getKeys().

|
inline |
init the value to v
References CORE_Vector< T >::getSize().

|
inline |
add an element at the end
| void CORE_Vector< T >::addAfterIndex | ( | const int & | index, |
| const T & | v | ||
| ) |
add an element after index
| v | element add at index+1 |
| index | must be in [0,mSize-1] |
| void CORE_Vector< T >::addAfterIndices | ( | boost::shared_ptr< CORE_Vector< int > > & | p_indices, |
| const CORE_SharedPointersList< CORE_Vector< T > > & | values | ||
| ) |
add alements after indices
| p_indices | array of index to add values in increasing order |
| values | at index indices[index] add the values of the array of T |
References CORE_Vector< T >::get(), CORE_Vector< T >::getSize(), and null.

|
inlinevirtual |
add a core object
|
inlinestaticinherited |
compare 2 primitive object
|
inlinestaticinherited |
compare 2 primitive object
|
inlinestaticinherited |
compare 2 primitive object
|
inlinestaticinherited |
compare 2 primitive object
|
inlinestaticinherited |
compare 2 primitive object
|
inlinestaticinherited |
compare 2 primitive object
|
inlinestaticinherited |
compare 2 primitive object
|
inlinestaticinherited |
compare 2 primitive object
|
inlinestaticinherited |
compare 2 primitive object
|
inlinestaticinherited |
compare 2 primitive object
|
inlinestaticinherited |
compare 2 primitive object
|
inlinestaticinherited |
compare 2 primitive object
|
inline |
put the iterator on begin
|
inlinevirtual |
clear the array
Implements CORE_List.
Referenced by CORE_SharedPointersListVMap< Key, Value >::getKeys(), CORE_SharedPointersVMap< Key, Value >::getKeys(), CORE_Map< Key, Value >::getKeys(), CORE_SharedPointersKVMap< Key, Value >::getValues(), CORE_SharedPointersVMap< Key, Value >::getValues(), and CORE_Map< Key, Value >::getValues().

|
inlinestaticinherited |
compare 2 strings
|
inlinestaticinherited |
compare 2 ints
|
inlinestaticinherited |
compare 2 reals
|
inline |
|
inline |
copy
References null.
|
inline |
copy
|
inlinestatic |
return the cross product of the vector with the a vector
References CORE_Vector< T >::getSize(), and CORE_Vector< T >::setSize().

|
inline |
return the cross product of the vector with the a vector
|
inline |
return the distance of the vector with the a vector
|
inline |
return the squared distance of the vector with the a vector
References CORE_Vector< T >::getSize(), and tReal.

|
inline |
divide by value v
| tBoolean CORE_Vector< T >::exists | ( | const T & | obj | ) | const |
exists
|
inline |
get the pointer at index i ASSERT_IN(i>-1); ASSERT_IN(i<((int)mVector.size()));
References ASSERT_IN.
Referenced by CORE_Vector< T >::addAfterIndices(), CORE_SharedPointersKVMap< Key, Value >::getValues(), CORE_SharedPointersVMap< Key, Value >::getValues(), and CORE_Matrix< T >::set().

|
inline |
get the pointer at index i ASSERT_IN(i>-1); ASSERT_IN(i<((int)mVector.size()));
References ASSERT_IN.
return the class name of the object using only the identity string
Referenced by CORE_Object::printObjectsInMemory().

|
inherited |
return the class name of the object
References tString.
Referenced by CORE_Object::getIdentityString().

|
inline |
return the dimension of the vector
|
inlineinherited |
return the identity string of the object of the form className_at_address
References CORE_Object::getClassName(), CORE_Object::pointer2String(), and tString.
Referenced by CORE_Object::toString().


|
inline |
get last element pointer
References ASSERT_IN.
|
inlinestaticinherited |
get output
|
inlineinherited |
return the identity string of the object
References CORE_Object::pointer2String().

|
inlineinherited |
get the shared pointer of this class into p
Referenced by MATH_ParentExpression::addArgument(), GPMG_EnvironmentPanel::componentClicked(), GPM_GraphElement::copy(), CORE_Map< Key, Value >::getSharedPointer(), CORE_Array< T >::getSharedPointer(), CORE_Vector< T >::getSharedPointer(), CORE_Matrix< T >::getSharedPointer(), CORE_Object::printObjectsInMemory(), MATH_ParentExpression::setArgument(), GPMG_EnvironmentPanel::setEnvironment(), GPM_GraphElement::setGraph(), GPMG_GraphElementWindow::setGraphElement(), GPMG_ShowGraphDrawPanel::showGraph(), and GPMG_RuleGraphDrawPanel::showRule().

|
inlineinherited |
get the shared pointer of this class into p
|
inline |
get the shared pointer into P
References CORE_Object::getSharedPointer().

|
inline |
get the shared pointer into P
References CORE_Object::getSharedPointer().

|
inline |
return the size of the vector
Referenced by CORE_Vector< T >::add(), CORE_Vector< T >::addAfterIndices(), CORE_Vector< T >::copy(), CORE_Vector< T >::CORE_Vector(), CORE_Vector< T >::crossProduct(), CORE_Vector< T >::distance2(), CORE_Vector< T >::scalarProduct(), CORE_Matrix< T >::set(), CORE_Array2D< T >::setRowValue(), and CORE_Vector< T >::sub().

|
inlinestaticinherited |
get type name
References tString.
|
inline |
get value
|
inline |
get values
|
inline |
get values
|
inline |
get vector
|
inline |
get vector
|
inline |
return true if the array has next element
|
inline |
init the value to v
| tBoolean CORE_Vector< T >::insert | ( | int | i, |
| const T & | obj | ||
| ) |
insert the pointer at index i the old element i become the element i+1
|
inline |
insert T
the elements are ranged in creasing order Do not insert if the obj already exists
| int CORE_Vector< T >::insertInOrder | ( | const T & | obj, |
| const tBoolean & | evenIfEqual | ||
| ) |
insert T
the elements are ranged in creasing order
| obj | object to insert |
| evenIfEqual | true insert even if obj already exists |
|
inlinestaticinherited |
return true if the machine is a 32 bits machine
References CORE_Object::is64Architecture().

|
staticinherited |
return true if the machine is a 64 bits machine
Referenced by CORE_Object::is32Architecture().

|
inlineinherited |
return true if the object is an instance of T
References null.
Referenced by MATH_BinaryOperator::insertInTree(), MATH_UnaryOperator::insertInTree(), and MATH_EndBlock::insertInTree().

| void CORE_Vector< T >::merge | ( | const CORE_Vector< T > & | array | ) |
merge the array in this
References CORE_Vector< T >::size().

|
inline |
multiplied by value v
|
inlinestatic |
create a shared pointer of vector which is a copy of vector v
| v | vector to copy |
|
inlinestatic |
create a shared pointer of vector which is a copy of vector v
| v | vector to copy |
|
inlinestatic |
create a shared pointer of vector which is a copy of vector v
| v | vector to copy |
References null.
|
inlinestatic |
create a shared pointer of vector
Referenced by CORE_Matrix< T >::add(), and CORE_Matrix< T >::copy().

|
inlinestatic |
create a shared pointer of vector of size dim
| dim | size of the vector |
|
inline |
return the next element
|
inline |
return the norm of the vector
|
inline |
return the squared norm of the vector
References tReal.
|
inline |
normalize
References tReal.
|
inline |
get the i-th element ASSERT_IN(i>-1); ASSERT_IN(i<((int)mVector.size()));
References ASSERT_IN.
|
inline |
get the i-th element ASSERT_IN(i>-1); ASSERT_IN(i<((int)mVector.size()));
References ASSERT_IN.
|
staticinherited |
print on output
References null, and CORE_Object::print().
Referenced by CORE_Exception::CORE_Exception().


| void CORE_Vector< T >::permute | ( | const int & | i, |
| const int & | j | ||
| ) |
permute
|
staticinherited |
return the string represantation of a pointer
References tString.
Referenced by CORE_Object::CORE_Object(), CORE_Object::getIdentityString(), CORE_Object::getPointerAddress(), and CORE_Object::~CORE_Object().

|
inlinevirtualinherited |
print the class
References CORE_Object::toString().
Referenced by CORE_Object::outputPrint(), CORE_Out::print(), CORE_Object::print(), CORE_Out::printInt(), CORE_Out::println(), CORE_Out::printReal(), CORE_Out::printString(), and CORE_Out::setAction().


|
inlinevirtualinherited |
print the class
References CORE_Object::print(), and CORE_Object::toString().

|
virtualinherited |
print the class
Reimplemented in CORE_Out.
References null, and CORE_Object::print().

|
virtualinherited |
References null.
|
virtualinherited |
References null.
|
inlinestaticinherited |
print the class
|
staticinherited |
print object in memory
References CORE_Object::getClassName(), CORE_Object::getSharedPointer(), and CORE_Object::mIsMemoryTesting.
Referenced by main().


| tBoolean CORE_Vector< T >::remove | ( | const T & | obj | ) |
|
inline |
remove the last pointer
| tBoolean CORE_Vector< T >::removeAtIndex | ( | const int & | i | ) |
remove the pointer at index i
| void CORE_Vector< T >::reverse | ( | ) |
reverse the vector
|
inline |
rotate the vector among x-axes with angle alpha
References tReal.
|
inline |
rotate the vector among z-axes with angle gamma
References tReal.
|
inline |
return the scalar product of the vector with the a vector
References CORE_Vector< T >::getSize(), and tReal.

|
inline |
return the scalar product of the vector with the a vector
References null.
|
static |
search the value in values vector ordered in order
|
inline |
search the value in values vector ordered in order
| tBoolean CORE_Vector< T >::set | ( | int | i, |
| const T & | obj | ||
| ) |
set the pointer at the index i
Referenced by CORE_Map< Key, Value >::getValues().

|
inline |
set the size of the array
|
inlinestaticinherited |
set output
|
inline |
set the size of the array
Referenced by CORE_Vector< T >::crossProduct(), CORE_SharedPointersKVMap< Key, Value >::getKeys(), CORE_SharedPointersKVMap< Key, Value >::getValues(), CORE_SharedPointersVMap< Key, Value >::getValues(), and CORE_Map< Key, Value >::getValues().

|
inlineprotectedinherited |
set this weak shared pointer called toDoAfterThis setting method
References CORE_Object::toDoAfterThisSetting().

|
inlineprotectedvirtualinherited |
set the type of the object
Referenced by CORE_CommandLine::CORE_CommandLine(), CORE_IO::CORE_IO(), GPM_2DSnowGraph::GPM_2DSnowGraph(), GPM_BGLTest::GPM_BGLTest(), GPM_ClassFactory::GPM_ClassFactory(), GPM_ConwayFunction::GPM_ConwayFunction(), GPM_ConwayGraph::GPM_ConwayGraph(), GPM_CoreRun::GPM_CoreRun(), GPM_CoreTest::GPM_CoreTest(), GPM_Edge::GPM_Edge(), GPM_ExamplesRun::GPM_ExamplesRun(), GPM_Function::GPM_Function(), GPM_Graph::GPM_Graph(), GPM_GraphElement::GPM_GraphElement(), GPM_ModelGraph::GPM_ModelGraph(), GPM_Node::GPM_Node(), GPM_Object::GPM_Object(), GPM_PatternFunction::GPM_PatternFunction(), GPM_Port::GPM_Port(), GPM_PortGraph::GPM_PortGraph(), GPM_Snow2DFunction::GPM_Snow2DFunction(), GPM_Snow3DFunction::GPM_Snow3DFunction(), GPM_Vertex::GPM_Vertex(), and MATH_ExpressionRun::MATH_ExpressionRun().

|
inline |
set value
|
inline |
copy
|
inline |
copy
|
inline |
return the size of the vector
Referenced by CORE_Vector< T >::merge().

|
inline |
sort the vector
decreasing order
< increasing order
Referenced by CORE_IO::getFiles().

|
static |
sort the vector items
|
inline |
init the value to v
|
inline |
init the value to u-v
References CORE_Vector< T >::getSize().

|
inline |
init the value to v
References CORE_Vector< T >::getSize().

|
inlineprotectedvirtualinherited |
method called after setThis() method this method can oly be called once.
Reimplemented in GPM_2DSnowGraph, GPMG_EnvironmentWindow, GPM_GraphElement, GPM_ModelFunction, GPM_ModelGraph, GPMG_RuleGraphWindow, GPMG_MovieGraphWindow, GPMG_ShowGraphWindow, and GPM_Function.
Referenced by CORE_Object::setThis(), GPM_ModelGraph::toDoAfterThisSetting(), GPM_GraphElement::toDoAfterThisSetting(), and GPM_2DSnowGraph::toDoAfterThisSetting().

|
inlinevirtual |
return the string representation of the object node
Reimplemented from CORE_Object.
References CORE_String::toString(), and tString.

|
staticinherited |
indicator to store all classes created and deleted only for debuging version
Referenced by CORE_Object::CORE_Object(), main(), CORE_Object::printObjectsInMemory(), and CORE_Object::~CORE_Object().
1.8.8