5 #ifndef __pinocchio_multibody_pool_model_hpp__ 6 #define __pinocchio_multibody_pool_model_hpp__ 11 #include "pinocchio/multibody/model.hpp" 12 #include "pinocchio/multibody/data.hpp" 14 #include "pinocchio/utils/openmp.hpp" 18 template<
typename _Scalar,
int _Options,
template<
typename,
int>
class JointCollectionTpl>
23 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
25 typedef _Scalar Scalar;
26 enum { Options = _Options };
31 typedef std::vector<Model,Eigen::aligned_allocator<Model> > ModelVector;
32 typedef std::vector<Data,Eigen::aligned_allocator<Data> > DataVector;
40 const int pool_size = omp_get_max_threads())
42 ,
m_datas((size_t)pool_size, Data(model))
101 m_datas.resize((
size_t)new_size);
104 typename DataVector::iterator it =
m_datas.begin();
105 std::advance(it, (
long)(new_size -
m_size));
119 const Data &
data(
const size_t index)
const 121 PINOCCHIO_CHECK_INPUT_ARGUMENT(index <
m_datas.size(),
122 "Index greater than the size of the datas vector.");
127 Data &
data(
const size_t index)
129 PINOCCHIO_CHECK_INPUT_ARGUMENT(index <
m_datas.size(),
130 "Index greater than the size of the datas vector.");
151 PINOCCHIO_UNUSED_VARIABLE(new_size);
159 #endif // ifndef __pinocchio_multibody_pool_model_hpp__ void update(const Data &data)
Update all the datas with the input data value.
Model m_model
Model stored within the pool.
DataVector & datas()
Returns the data vectors.
int m_size
Number of threads used for parallel computations.
const DataVector & datas() const
Returns the data vectors.
virtual ~ModelPoolTpl()
.
const Data & data(const size_t index) const
Return a specific data.
ModelPoolTpl(const Model &model, const int pool_size=omp_get_max_threads())
Default constructor from a model and a pool size.
Data & data(const size_t index)
Returns a specific data.
void update(const Model &model, const Data &data)
Update the model and data with the new input values. In this case, all the geometry_datas will be rep...
ModelPoolTpl(const ModelPoolTpl &pool_model)
Copy constructor from an other PoolModel.
Model & model()
Returns the model stored within the pool.
void resize(const int new_size)
Set the size of the pool and perform the appropriate resize.
int size() const
Returns the size of the pool.
Main pinocchio namespace.
virtual void do_resize(const int new_size)
.
void update(const Model &model)
Update the model, meaning that all the datas will be refreshed accordingly.
const Model & model() const
Returns the model stored within the pool.