@@ -104,9 +104,7 @@ namespace pinocchio
104
104
// /
105
105
// / \brief Default constructor
106
106
// /
107
- ContactCholeskyDecompositionTpl ()
108
- {
109
- }
107
+ ContactCholeskyDecompositionTpl () = default ;
110
108
111
109
// /
112
110
// / \brief Constructor from a model.
@@ -463,35 +461,10 @@ namespace pinocchio
463
461
// /@}
464
462
465
463
template <typename S1, int O1>
466
- bool operator ==(const ContactCholeskyDecompositionTpl<S1, O1> & other) const
467
- {
468
- bool is_same = true ;
469
-
470
- if (nv != other.nv || num_contacts != other.num_contacts )
471
- return false ;
472
-
473
- if (
474
- D.size () != other.D .size () || Dinv.size () != other.Dinv .size () || U.rows () != other.U .rows ()
475
- || U.cols () != other.U .cols ())
476
- return false ;
477
-
478
- is_same &= (D == other.D );
479
- is_same &= (Dinv == other.Dinv );
480
- is_same &= (U == other.U );
481
-
482
- is_same &= (parents_fromRow == other.parents_fromRow );
483
- is_same &= (nv_subtree_fromRow == other.nv_subtree_fromRow );
484
- is_same &= (last_child == other.last_child );
485
- // is_same &= (rowise_sparsity_pattern == other.rowise_sparsity_pattern);
486
-
487
- return is_same;
488
- }
464
+ bool operator ==(const ContactCholeskyDecompositionTpl<S1, O1> & other) const ;
489
465
490
466
template <typename S1, int O1>
491
- bool operator !=(const ContactCholeskyDecompositionTpl<S1, O1> & other) const
492
- {
493
- return !(*this == other);
494
- }
467
+ bool operator !=(const ContactCholeskyDecompositionTpl<S1, O1> & other) const ;
495
468
PINOCCHIO_COMPILER_DIAGNOSTIC_POP
496
469
497
470
protected:
@@ -702,10 +675,17 @@ namespace pinocchio
702
675
703
676
} // namespace pinocchio
704
677
705
- #include " pinocchio/algorithm/contact-cholesky.hxx"
706
-
678
+ // Because of a GCC bug we should NEVER define a function that use ContactCholeskyDecompositionTpl
679
+ // before doing the explicit template instantiation.
680
+ // If we don't take care, GCC will not accept any visibility attribute when declaring the
681
+ // explicit template instantiation of the ContactCholeskyDecompositionTpl class.
682
+ // The warning message will look like this: type attributes ignored after type is already defined
683
+ // [-Wattributes] A minimal code example is added on the PR
684
+ // (https://github.com/stack-of-tasks/pinocchio/pull/2469)
707
685
#if PINOCCHIO_ENABLE_TEMPLATE_INSTANTIATION
708
686
#include " pinocchio/algorithm/contact-cholesky.txx"
709
687
#endif // PINOCCHIO_ENABLE_TEMPLATE_INSTANTIATION
710
688
689
+ #include " pinocchio/algorithm/contact-cholesky.hxx"
690
+
711
691
#endif // ifndef __pinocchio_algorithm_contact_cholesky_hpp__
0 commit comments