-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Lie bracket Signed-off-by: artivis <[email protected]> * bracket spe & doc fix --------- Signed-off-by: artivis <[email protected]>
- Loading branch information
Showing
4 changed files
with
118 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#ifndef _MANIF_MANIF_IMPL_BRACKET_H_ | ||
#define _MANIF_MANIF_IMPL_BRACKET_H_ | ||
|
||
namespace manif { | ||
namespace internal { | ||
|
||
template <typename Derived> | ||
struct BracketEvaluatorImpl { | ||
template <typename TL, typename TR> | ||
static typename Derived::Tangent run(const TL& a, const TR& b) { | ||
return a.smallAdj() * b; | ||
} | ||
}; | ||
|
||
template <typename Derived, typename DerivedOther> | ||
struct BracketEvaluator : BracketEvaluatorImpl<Derived> { | ||
using Base = BracketEvaluatorImpl<Derived>; | ||
|
||
BracketEvaluator(const Derived& xptr, const DerivedOther& xptr_o) | ||
: xptr_(xptr), xptr_o_(xptr_o) {} | ||
|
||
typename Derived::Tangent run() { | ||
return Base::run(xptr_, xptr_o_); | ||
} | ||
|
||
protected: | ||
|
||
const Derived& xptr_; | ||
const DerivedOther& xptr_o_; | ||
}; | ||
|
||
} // namespace internal | ||
} // namespace manif | ||
|
||
#endif // _MANIF_MANIF_IMPL_BRACKET_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters