Skip to content
Snippets Groups Projects
Commit a557ccd7 authored by Max Kahnt's avatar Max Kahnt
Browse files

Add convenience functions to create result instances.

parent 38b03ac4
No related branches found
No related tags found
No related merge requests found
...@@ -23,7 +23,6 @@ namespace MatrixVector { ...@@ -23,7 +23,6 @@ namespace MatrixVector {
bool BisScalar, bool CisScalar> bool BisScalar, bool CisScalar>
struct ScaledProductHelper; struct ScaledProductHelper;
/** \brief Add a product to some matrix or vector /** \brief Add a product to some matrix or vector
* *
* This function computes a+=b*c. * This function computes a+=b*c.
...@@ -94,6 +93,21 @@ namespace MatrixVector { ...@@ -94,6 +93,21 @@ namespace MatrixVector {
isScalar<D>()>::addProduct(a, -b, c, d); isScalar<D>()>::addProduct(a, -b, c, d);
} }
template <class A, class... BCD>
A getAddProduct(const A& a, BCD&&... bcd) {
auto sum = a;
addProduct(sum, std::forward<BCD>(bcd)...);
return sum;
}
template <class A, class... BCD>
A getSubtractProduct(const A& a, BCD&&... bcd) {
auto difference = a;
subtractProduct(difference, std::forward<BCD>(bcd)...);
return difference;
}
/** \brief Internal helper class for product operations /** \brief Internal helper class for product operations
* *
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment