Verified Commit 49e07418 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

bench: adjust w.r.t. new API

parent a1d9f00f
...@@ -29,8 +29,8 @@ EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Eigen::VectorXd) ...@@ -29,8 +29,8 @@ EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Eigen::VectorXd)
namespace pinocchio namespace pinocchio
{ {
template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl> template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl>
struct EmptyForwardStep struct EmptyForwardStepUnaryVisit
: fusion::JointUnaryVisitorBase< EmptyForwardStep<Scalar,Options,JointCollectionTpl> > : fusion::JointUnaryVisitorBase< EmptyForwardStepUnaryVisit<Scalar,Options,JointCollectionTpl> >
{ {
typedef ModelTpl<Scalar,Options,JointCollectionTpl> Model; typedef ModelTpl<Scalar,Options,JointCollectionTpl> Model;
typedef DataTpl<Scalar,Options,JointCollectionTpl> Data; typedef DataTpl<Scalar,Options,JointCollectionTpl> Data;
...@@ -47,19 +47,17 @@ namespace pinocchio ...@@ -47,19 +47,17 @@ namespace pinocchio
}; };
template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl> template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl>
inline void emptyForwardPass(const ModelTpl<Scalar,Options,JointCollectionTpl> & model, inline void emptyForwardPassUnaryVisit(const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
DataTpl<Scalar,Options,JointCollectionTpl> & data) DataTpl<Scalar,Options,JointCollectionTpl> & data)
{ {
assert(model.check(data) && "data is not consistent with model."); assert(model.check(data) && "data is not consistent with model.");
typedef typename ModelTpl<Scalar,Options,JointCollectionTpl>::JointIndex JointIndex; typedef typename ModelTpl<Scalar,Options,JointCollectionTpl>::JointIndex JointIndex;
typedef EmptyForwardStep<Scalar,Options,JointCollectionTpl> Algo; typedef EmptyForwardStepUnaryVisit<Scalar,Options,JointCollectionTpl> Algo;
for(JointIndex i=1; i < (JointIndex)model.njoints; ++i) for(JointIndex i=1; i < (JointIndex)model.njoints; ++i)
{ {
Algo::run(model.joints[i], Algo::run(model.joints[i],data.joints[i]);
data.joints[i]
);
} }
} }
} }
...@@ -250,7 +248,7 @@ int main(int argc, const char ** argv) ...@@ -250,7 +248,7 @@ int main(int argc, const char ** argv)
timer.tic(); timer.tic();
SMOOTH(NBT) SMOOTH(NBT)
{ {
emptyForwardPass(model,data); emptyForwardPassUnaryVisit(model,data);
} }
std::cout << "Empty Forward Pass = \t"; timer.toc(std::cout,NBT); std::cout << "Empty Forward Pass = \t"; timer.toc(std::cout,NBT);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment