30 #ifndef MATRIZPTRBASE_H 31 #define MATRIZPTRBASE_H 33 #include "xc_utils/src/nucleo/EntCmd.h" 34 #include "xc_basic/src/matrices/matrizT.h" 36 #include "boost/any.hpp" 37 #include "boost/lexical_cast.hpp" 40 #include "xc_basic/src/matrices/m_int.h" 49 class MatrizPtrBase:
public MatrizT<T *,std::vector<T *> >,
public EntCmd
52 typedef MatrizT<T *,std::vector<T *> > m_ptr;
53 typedef typename m_ptr::iterator iterator;
54 typedef typename m_ptr::const_iterator const_iterator;
55 typedef typename m_ptr::value_type value_type;
56 typedef typename m_ptr::reference reference;
57 typedef typename m_ptr::const_reference const_reference;
63 : m_ptr(f,c,nullptr), EntCmd() {}
65 bool Null(
void)
const;
68 void dim(
const size_t &,
const size_t &);
75 std::vector<int> getTagsObjs(
void);
81 { this->resize(nRows,nCols,
nullptr); }
90 return (this->
operator()(1,1)==
nullptr);
102 const size_t nfilas= this->getNumFilas();
103 const size_t ncols= this->getNumCols();
104 for(
size_t j= 1;j<=nfilas;j++)
105 for(
size_t k= 1;k<=ncols;k++)
106 if(this->
operator()(j,k)==
nullptr)
120 const std::string nmbBlq= nombre_clase()+
":objetos_fila:"+boost::lexical_cast<std::string>(f);
121 const size_t numCols= this->getNumCols();
122 std::vector<int> retval(numCols);
123 for(
size_t i= 1;i<=numCols;i++)
124 retval[i-1]= (*
this)(f,i)->getTag();
133 const std::string nmbBlq= nombre_clase()+
":objetos_columna:"+boost::lexical_cast<std::string>(c);
134 const size_t numFilas= this->getNumFilas();
135 std::vector<int> retval(numFilas);
136 for(
size_t i= 1;i<=numFilas;i++)
137 retval[i-1]= (*
this)(i,c)->getTag();
146 const std::string nmbBlq= nombre_clase()+
":objetos_interiores_fila:"+boost::lexical_cast<std::string>(f);
147 const size_t numCols= this->getNumCols();
148 std::vector<int> retval(numCols-2);
149 for(
size_t i= 2;i<numCols;i++)
150 retval[i-2]= (*
this)(f,i)->getTag();
159 const std::string nmbBlq= nombre_clase()+
":objetos_interiores_columna:"+boost::lexical_cast<std::string>(c);
160 const size_t numFilas= this->getNumFilas();
161 std::vector<int> retval(numFilas-2);
162 for(
size_t i= 2;i<numFilas;i++)
163 retval[i-2]= (*
this)(i,c)->getTag();
172 const size_t numFilas= this->getNumFilas();
173 const size_t numCols= this->getNumCols();
174 std::vector<int> retval((numFilas-1)*(numCols-1));
181 m_int tmp(numFilas-2,numCols-2);
182 for(
size_t i= 2;i<numFilas;i++)
183 for(
size_t j= 2;j<numCols;j++)
184 tmp(i-1,j-1)= (*this)(i,j)->getTag();
185 retval= tmp.getVector();
193 const size_t numFilas= this->getNumFilas();
194 const size_t numCols= this->getNumCols();
195 std::vector<int> retval(numFilas*numCols);
196 m_int tmp(numFilas,numCols);
197 for(
size_t i= 1;i<=numFilas;i++)
198 for(
size_t j= 1;j<=numCols;j++)
199 tmp(i,j)= (*this)(i,j)->getTag();
200 retval= tmp.getVector();
std::vector< int > getTagsInteriorObjs(void)
Asks each of the objects at the interior to execute the code being passed as parameter.
Definition: MatrizPtrBase.h:170
std::vector< int > getTagsObjsFila(const size_t &)
Asks each of the objects in the row to execute the code being passed as parameter.
Definition: MatrizPtrBase.h:118
void dim(const size_t &, const size_t &)
Matrix dimensions.
Definition: MatrizPtrBase.h:80
MatrizPtrBase(const size_t &f=0, const size_t &c=0)
Constructor.
Definition: MatrizPtrBase.h:62
std::vector< int > getTagsObjsColumna(const size_t &)
Asks each of the objects in the column to execute the code being passed as parameter.
Definition: MatrizPtrBase.h:131
std::vector< int > getTagsObjsInterioresFila(const size_t &)
Asks each of the objects at the interior of the row to execute the code being passed as parameter...
Definition: MatrizPtrBase.h:144
Base class for matrices of pointers to nodes, elements and points.
Definition: MatrizPtrBase.h:49
std::vector< int > getTagsObjsInterioresColumna(const size_t &)
Asks each of the objects at the interior of the column to execute the code being passed as parameter...
Definition: MatrizPtrBase.h:157
================================================================================
Definition: ContinuaReprComponent.h:34
bool HasNull(void) const
Returns true if it's empty or any of the pointers are NULL.
Definition: MatrizPtrBase.h:95
bool Null(void) const
Returns true if it's empty or the pointers are NULL.
Definition: MatrizPtrBase.h:85