31 #ifndef PTRARRAYBASE_H    32 #define PTRARRAYBASE_H    34 #include "utility/kernel/CommandEntity.h"    35 #include "utility/matrices/TMatrix.h"    37 #include "boost/any.hpp"    38 #include "boost/lexical_cast.hpp"    41 #include "utility/matrices/m_int.h"    54     typedef typename m_ptr::iterator iterator;
    55     typedef typename m_ptr::const_iterator const_iterator;
    56     typedef typename m_ptr::value_type value_type;
    57     typedef typename m_ptr::reference reference;
    58     typedef typename m_ptr::const_reference const_reference;
    61     PtrArrayBase(
const size_t &f=0,
const size_t &c=0, 
const value_type &def_value= 
nullptr)
    65     bool Null(
void) 
const;
    68     void dim(
const size_t &, 
const size_t &);
    75     std::vector<int> getTagsObjs(
void);
    81   { this->
resize(nRows,numberOfColumns,
nullptr); }
   106       return (this->
operator()(1,1)==
nullptr);
   118         const size_t numberOfRows= this->getNumberOfRows();
   119         const size_t numberOfColumns= this->getNumberOfColumns();
   120         for(
size_t j= 1;j<=numberOfRows;j++)
   121           for(
size_t k= 1;k<=numberOfColumns;k++)
   122             if(this->
operator()(j,k)== 
nullptr)
   136     const std::string nmbBlq= 
getClassName()+
":row_objects:"+boost::lexical_cast<std::string>(f);
   137     const size_t numCols= this->getNumberOfColumns();
   138     std::vector<int> retval(numCols);
   139     for(
size_t i= 1;i<=numCols;i++)
   140       retval[i-1]= (*
this)(f,i)->getTag();
   149     const std::string nmbBlq= 
getClassName()+
":column_objects:"+boost::lexical_cast<std::string>(c);
   150     const size_t n_rows= this->getNumberOfRows();
   151     std::vector<int> retval(n_rows);
   152     for(
size_t i= 1;i<=n_rows;i++)
   153       retval[i-1]= (*
this)(i,c)->getTag();
   162     const std::string nmbBlq= 
getClassName()+
":row_interior_objects:"+boost::lexical_cast<std::string>(f);
   163     const size_t numCols= this->getNumberOfColumns();
   164     std::vector<int> retval(numCols-2);
   165     for(
size_t i= 2;i<numCols;i++)
   166       retval[i-2]= (*
this)(f,i)->getTag();
   175     const std::string nmbBlq= 
getClassName()+
":column_interior_objects:"+boost::lexical_cast<std::string>(c);
   176     const size_t n_rows= this->getNumberOfRows();
   177     std::vector<int> retval(n_rows-2);
   178     for(
size_t i= 2;i<n_rows;i++)
   179       retval[i-2]= (*
this)(i,c)->getTag();
   188     const size_t n_rows= this->getNumberOfRows();
   189     const size_t numCols= this->getNumberOfColumns();
   190     std::vector<int> retval((n_rows-1)*(numCols-1));
   197         m_int tmp(n_rows-2,numCols-2);
   198         for(
size_t i= 2;i<n_rows;i++)
   199           for(
size_t j= 2;j<numCols;j++)
   200             tmp(i-1,j-1)= (*this)(i,j)->getTag();
   201         retval= tmp.getVector();
   209     const size_t n_rows= this->getNumberOfRows();
   210     const size_t numCols= this->getNumberOfColumns();
   211     std::vector<int> retval(n_rows*numCols);
   212     m_int tmp(n_rows,numCols);
   213     for(
size_t i= 1;i<=n_rows;i++)
   214       for(
size_t j= 1;j<=numCols;j++)
   215         tmp(i,j)= (*this)(i,j)->getTag();
   216     retval= tmp.getVector();
 bool HasNull(void) const
Returns true if it's empty or any of the pointers are NULL. 
Definition: PtrArrayBase.h:111
Matrix which element type has estructura de anillo respecto a las operaciones + y *...
Definition: ZMatrix.h:37
std::vector< int > getColumnObjectsTags(const size_t &)
Asks each of the objects in the column to execute the code being passed as parameter. 
Definition: PtrArrayBase.h:147
std::vector< int > getRowInteriorObjectsTags(const size_t &)
Asks each of the objects at the interior of the row to execute the code being passed as parameter...
Definition: PtrArrayBase.h:160
virtual bool operator==(const TMatrix< T *, std::vector< T * > > &) const
Comparison operator. 
Definition: TMatrix.h:209
bool Null(void) const
Returns true if it's empty or the pointers are NULL. 
Definition: PtrArrayBase.h:101
std::vector< int > getRowObjectsTags(const size_t &)
Asks each of the objects in the row to execute the code being passed as parameter. 
Definition: PtrArrayBase.h:134
virtual std::string getClassName(void) const
Returns demangled class name. 
Definition: EntityWithOwner.cc:90
virtual bool operator==(const EntityWithOwner &) const
Comparison operator. 
Definition: EntityWithOwner.cc:86
Objet that can execute python scripts. 
Definition: CommandEntity.h:40
void dim(const size_t &, const size_t &)
Matrix dimensions. 
Definition: PtrArrayBase.h:80
std::vector< int > getColumnInteriorObjectsTags(const size_t &)
Asks each of the objects at the interior of the column to execute the code being passed as parameter...
Definition: PtrArrayBase.h:173
virtual bool operator==(const PtrArrayBase< T > &) const
Comparison operator. 
Definition: PtrArrayBase.h:85
std::vector< int > getTagsInteriorObjs(void)
Asks each of the objects at the interior to execute the code being passed as parameter. 
Definition: PtrArrayBase.h:186
Open source finite element program for structural analysis. 
Definition: ContinuaReprComponent.h:35
Base class for matrices of pointers to nodes, elements and points. 
Definition: PtrArrayBase.h:50
void resize(size_t n_rows, size_t n_columns, T * val)
Assignment operator. 
Definition: TMatrix.h:201
PtrArrayBase(const size_t &f=0, const size_t &c=0, const value_type &def_value=nullptr)
Constructor. 
Definition: PtrArrayBase.h:61