Commit 4a4331b8 authored by Gabriele Buondonno's avatar Gabriele Buondonno
Browse files

[isNormalized] Use ref for prec everywhere

parent f10534a7
Pipeline #11816 passed with stage
in 147 minutes and 47 seconds
......@@ -199,7 +199,7 @@ namespace pinocchio
template <class Config_t>
bool isNormalized_impl (const Eigen::MatrixBase<Config_t>& qout,
const Scalar prec) const;
const Scalar& prec) const;
template <class Config_t>
void random_impl (const Eigen::MatrixBase<Config_t>& qout) const;
......
......@@ -367,7 +367,7 @@ template<typename _Scalar, int _Options, template<typename,int> class LieGroupCo
template <class Config_t>
bool CartesianProductOperationVariantTpl<_Scalar,_Options,LieGroupCollectionTpl>::
isNormalized_impl (const Eigen::MatrixBase<Config_t>& qin,
const Scalar prec) const
const Scalar& prec) const
{
Index id_q = 0;
for(size_t k = 0; k < liegroups.size(); ++k)
......
......@@ -514,7 +514,7 @@ namespace pinocchio
: public fusion::JointUnaryVisitorBase< IsNormalizedStep<LieGroup_t,ConfigVectorIn,Scalar> >
{
typedef boost::fusion::vector<const ConfigVectorIn &,
const Scalar,
const Scalar&,
bool &> ArgsType;
PINOCCHIO_DETAILS_VISITOR_METHOD_ALGO_3(IsNormalizedStepAlgo, IsNormalizedStep)
......@@ -526,7 +526,7 @@ namespace pinocchio
template<typename ConfigVectorIn>
static void run(const JointModelBase<JointModel> & jmodel,
const Eigen::MatrixBase<ConfigVectorIn> & q,
const typename ConfigVectorIn::Scalar prec,
const typename ConfigVectorIn::Scalar& prec,
bool& res)
{
typedef typename Visitor::LieGroupMap LieGroupMap;
......
......@@ -374,7 +374,7 @@ PINOCCHIO_LIE_GROUP_PUBLIC_INTERFACE_GENERIC(Derived,typename)
*/
template <class Config_t>
bool isNormalized(const Eigen::MatrixBase<Config_t> & qin,
const Scalar prec = Eigen::NumTraits<Scalar>::dummy_precision()) const;
const Scalar& prec = Eigen::NumTraits<Scalar>::dummy_precision()) const;
/**
* @brief Generate a random joint configuration, normalizing quaternions when necessary.
......
......@@ -324,7 +324,7 @@ namespace pinocchio {
template <class Derived>
template <class Config_t>
bool LieGroupBase<Derived>::isNormalized
(const Eigen::MatrixBase<Config_t> & qin, const Scalar prec) const
(const Eigen::MatrixBase<Config_t> & qin, const Scalar& prec) const
{
EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(Config_t, ConfigVector_t);
return derived().isNormalized_impl(qin, prec);
......
......@@ -78,7 +78,7 @@ namespace pinocchio
template<typename LieGroupCollection, class Config_t>
inline bool isNormalized(const LieGroupGenericTpl<LieGroupCollection> & lg,
const Eigen::MatrixBase<Config_t> & qin,
const typename Config_t::Scalar prec = Eigen::NumTraits<typename Config_t::Scalar>::dummy_precision());
const typename Config_t::Scalar& prec = Eigen::NumTraits<typename Config_t::Scalar>::dummy_precision());
template<typename LieGroupCollection, class ConfigL_t, class ConfigR_t>
inline bool isSameConfiguration(const LieGroupGenericTpl<LieGroupCollection> & lg,
......
......@@ -196,13 +196,13 @@ namespace pinocchio
: visitor::LieGroupVisitorBase< LieGroupIsNormalizedVisitor<Matrix_t> >
{
typedef boost::fusion::vector<const Eigen::MatrixBase<Matrix_t> &,
const typename Matrix_t::Scalar,
const typename Matrix_t::Scalar&,
bool&> ArgsType;
LIE_GROUP_VISITOR(LieGroupIsNormalizedVisitor);
template<typename LieGroupDerived>
static void algo(const LieGroupBase<LieGroupDerived> & lg,
const Eigen::MatrixBase<Matrix_t>& qin,
const typename Matrix_t::Scalar prec,
const typename Matrix_t::Scalar& prec,
bool& res)
{
res = lg.isNormalized(qin, prec);
......@@ -212,7 +212,7 @@ namespace pinocchio
template<typename LieGroupCollection, class Config_t>
inline bool isNormalized(const LieGroupGenericTpl<LieGroupCollection> & lg,
const Eigen::MatrixBase<Config_t> & qin,
const typename Config_t::Scalar prec)
const typename Config_t::Scalar& prec)
{
PINOCCHIO_LG_CHECK_VECTOR_SIZE(Config_t, qin, nq(lg));
......
......@@ -238,7 +238,7 @@ namespace pinocchio
{}
template <class Config_t>
static bool isNormalized_impl (const Eigen::MatrixBase<Config_t>& /*qout*/, const Scalar /*prec*/)
static bool isNormalized_impl (const Eigen::MatrixBase<Config_t>& /*qout*/, const Scalar& /*prec*/)
{
return true;
}
......
Markdown is supported
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