67 #include "utility/kernel/CommandEntity.h" 70 #include <boost/python/list.hpp> 98 typedef std::vector<int> v_int;
100 static int ID_NOT_VALID_ENTRY;
104 explicit ID(
const int &);
105 explicit ID(
const v_int &);
106 ID(
const boost::python::list &);
107 explicit ID(
const std::set<int> &);
108 explicit ID(
const std::initializer_list<int> &);
109 template <
class InputIterator>
110 inline ID(InputIterator first, InputIterator last)
112 inline virtual ~
ID(){}
121 {
return this->data(); }
124 {
return this->data(); }
128 int resize(
const int &newSize,
const int &fill_value= 0);
129 void fill(
const int &fill_value);
130 const int &
max(
void)
const;
131 const int &
min(
void)
const;
139 {
return this->at(i); }
143 {
return this->at(i); }
153 boost::python::list
getPyList(
void)
const;
154 void setPyList(
const boost::python::list &);
155 boost::python::dict
getPyDict(
void)
const;
156 void setPyDict(
const boost::python::dict &);
158 friend std::ostream &operator<<(std::ostream &,
const ID &);
168 ID getIDFromIntPtr(
const int *,
const int &);
170 std::ostream &operator<<(std::ostream &,
const ID &);
175 const int sz=
Size();
176 if((i < 0) || (i >= sz))
178 std::cerr <<
"ID::(loc) - loc " 179 << i <<
" outside range 0 - " << sz-1 << std::endl;
194 return ID_NOT_VALID_ENTRY;
207 return ID_NOT_VALID_ENTRY;
bool isEmpty(void) const
Returns true if the vector is empty.
Definition: ID.h:126
boost::python::list getPyList(void) const
Return the vector values in a Python list.
Definition: ID.cpp:249
int & operator()(const int &)
Returns a reference to the element at position i in the container (does not range checking unless _G3...
Definition: ID.h:189
int resize(const int &newSize, const int &fill_value=0)
Changes the size of the array.
Definition: ID.cpp:195
Vector of integers.
Definition: ID.h:95
TCP_Socket is a sub-class of channel.
Definition: TCP_Socket.h:71
const int * getDataPtr(void) const
Returns a const pointer to the vector data.
Definition: ID.h:120
const int & min(void) const
Returns the minimum of vector components.
Definition: ID.cpp:224
TCP_SocketNoDelay is a sub-class of channel.
Definition: TCP_SocketNoDelay.h:73
int getLocationOrdered(const int &) const
Returns the position of the given vvalue in the vector assuming its values are ordered.
Definition: ID.cpp:136
int * getDataPtr(void)
Returns a const pointer to the vector data.
Definition: ID.h:123
Objet that can execute python scripts.
Definition: CommandEntity.h:40
boost::python::dict getPyDict(void) const
Return a Python dictionary with the object members values.
Definition: ID.cpp:270
MPI_Channel is a sub-class of channel.
Definition: MPI_Channel.h:70
int getLocation(const int &) const
Returns the position of the given value in the vector.
Definition: ID.cpp:120
int removeValue(const int &)
Remove value from the array.
Definition: ID.cpp:168
void reverse(void)
Reverse sequence.
Definition: ID.cpp:183
void fill(const int &fill_value)
Fills the array with the argument.
Definition: ID.cpp:212
int & operator[](const int &i)
Returns a reference to the element at position i in the container (does range checking => slower than...
Definition: ID.h:138
const int & operator[](const int &i) const
Returns a reference to the element at position i in the container (does range checking => slower than...
Definition: ID.h:142
void Zero(void)
Zeros out the ID, i.e.
Definition: ID.cpp:113
bool checkRange(const int &) const
check if argument is inside range [0,sz-1]
Definition: ID.h:173
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
void setPyDict(const boost::python::dict &)
Set the values of the object members from a Python dictionary.
Definition: ID.cpp:278
ID getReversed(void) const
Return the reversed sequence.
Definition: ID.cpp:187
void setPyList(const boost::python::list &)
Populate the vector with the values of the given list.
Definition: ID.cpp:259
DP_Socket is a sub-class of channel.
Definition: UDP_Socket.h:76
const int & max(void) const
Returns the maximum of vector components.
Definition: ID.cpp:220
CommandEntity(CommandEntity *owr=nullptr)
Default constructor.
Definition: CommandEntity.cc:40
int Size(void) const
Returns the vector size.
Definition: ID.h:116
ID(void)
Default constructor, sets size = 0;.
Definition: ID.cpp:67