Implements map and ref for both static & dynamic mode
See merge request oss/rotgen!12
This commit is contained in:
parent
aacae1cbb1
commit
6c2b260229
58 changed files with 4121 additions and 1205 deletions
|
|
@ -50,21 +50,27 @@ struct CLASSNAME::payload
|
|||
|
||||
CLASSNAME::~CLASSNAME() = default;
|
||||
|
||||
void CLASSNAME::assign(SOURCENAME const& m)
|
||||
{
|
||||
storage_->data = m.storage()->data;
|
||||
}
|
||||
|
||||
//==================================================================================================
|
||||
// Matrix API
|
||||
//==================================================================================================
|
||||
rotgen::Index CLASSNAME::rows() const { return storage_->data.rows(); }
|
||||
rotgen::Index CLASSNAME::cols() const { return storage_->data.cols(); }
|
||||
rotgen::Index CLASSNAME::size() const { return storage_->data.size(); }
|
||||
rotgen::Index CLASSNAME::innerStride() const { return storage_->data.innerStride(); }
|
||||
rotgen::Index CLASSNAME::outerStride() const { return storage_->data.outerStride(); }
|
||||
|
||||
TYPE& CLASSNAME::operator()(std::size_t i, std::size_t j) { return storage_->data(i,j); }
|
||||
TYPE const& CLASSNAME::operator()(std::size_t i, std::size_t j) const { return storage_->data(i,j); }
|
||||
|
||||
/*
|
||||
TYPE& CLASSNAME::operator()(std::size_t index) { return storage_->data(index); }
|
||||
TYPE const& CLASSNAME::operator()(std::size_t index) const { return storage_->data(index); }
|
||||
*/
|
||||
TYPE& CLASSNAME::operator()(std::size_t index) { return storage_->data.data()[index]; }
|
||||
TYPE const& CLASSNAME::operator()(std::size_t index) const { return storage_->data.data()[index]; }
|
||||
|
||||
TYPE* CLASSNAME::data() { return storage_->data.data(); }
|
||||
const TYPE* CLASSNAME::data() const { return storage_->data.data(); }
|
||||
|
||||
SOURCENAME CLASSNAME::transpose() const
|
||||
|
|
@ -130,6 +136,11 @@ struct CLASSNAME::payload
|
|||
return lhs.storage_->data == rhs.storage_->data;
|
||||
}
|
||||
|
||||
bool operator!=(CLASSNAME const& lhs, CLASSNAME const& rhs)
|
||||
{
|
||||
return lhs.storage_->data != rhs.storage_->data;
|
||||
}
|
||||
|
||||
CLASSNAME& CLASSNAME::operator+=(CLASSNAME const& rhs)
|
||||
{
|
||||
storage_->data += rhs.storage_->data;
|
||||
|
|
@ -167,35 +178,35 @@ struct CLASSNAME::payload
|
|||
return *this;
|
||||
}
|
||||
|
||||
SOURCENAME CLASSNAME::matrix_addition(CLASSNAME const& rhs) const
|
||||
SOURCENAME CLASSNAME::add(CLASSNAME const& rhs) const
|
||||
{
|
||||
SOURCENAME result;
|
||||
result.storage()->assign(storage_->data + rhs.storage_->data);
|
||||
return result;
|
||||
}
|
||||
|
||||
SOURCENAME CLASSNAME::matrix_subtraction(CLASSNAME const& rhs) const
|
||||
SOURCENAME CLASSNAME::sub(CLASSNAME const& rhs) const
|
||||
{
|
||||
SOURCENAME result;
|
||||
result.storage()->assign(storage_->data - rhs.storage_->data);
|
||||
return result;
|
||||
}
|
||||
|
||||
SOURCENAME CLASSNAME::matrix_multiplication(CLASSNAME const& rhs) const
|
||||
SOURCENAME CLASSNAME::mul(CLASSNAME const& rhs) const
|
||||
{
|
||||
SOURCENAME result;
|
||||
result.storage()->assign(storage_->data * rhs.storage_->data);
|
||||
return result;
|
||||
}
|
||||
|
||||
SOURCENAME CLASSNAME::matrix_multiplication(TYPE s) const
|
||||
SOURCENAME CLASSNAME::mul(TYPE s) const
|
||||
{
|
||||
SOURCENAME result;
|
||||
result.storage()->assign(storage_->data * s);
|
||||
return result;
|
||||
}
|
||||
|
||||
SOURCENAME CLASSNAME::matrix_division(TYPE s) const
|
||||
SOURCENAME CLASSNAME::div(TYPE s) const
|
||||
{
|
||||
SOURCENAME result;
|
||||
result.storage()->assign(storage_->data / s);
|
||||
|
|
|
|||
20
src/info.cpp
20
src/info.cpp
|
|
@ -7,24 +7,12 @@
|
|||
*/
|
||||
//==================================================================================================
|
||||
#include <rotgen/config.hpp>
|
||||
#include <iostream>
|
||||
|
||||
namespace rotgen
|
||||
namespace rotgen::detail
|
||||
{
|
||||
std::ostream& setup_summary(std::ostream& os)
|
||||
std::ostream& dynamic_info(std::ostream& os)
|
||||
{
|
||||
if constexpr(rotgen::is_forcing_dynamic_status)
|
||||
{
|
||||
os << "[ROTGEN] - Fully Dynamic mode" << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
if constexpr(use_expression_templates)
|
||||
os << "[ROTGEN] - Expression templates : Disabled." << std::endl;
|
||||
else
|
||||
os << "[ROTGEN] - Static/Dynamic mode with maximum size: " << rotgen::max_static_size << std::endl;
|
||||
}
|
||||
|
||||
return os;
|
||||
if constexpr(rotgen::is_forcing_dynamic_status) return os << "[ROTGEN] - Fully Dynamic mode" << std::endl;
|
||||
else return os << "[ROTGEN] - Flexible mode with" << std::endl;
|
||||
}
|
||||
}
|
||||
110
src/map.cpp
Normal file
110
src/map.cpp
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
//==================================================================================================
|
||||
/*
|
||||
ROTGEN - Runtime Overlay for Eigen
|
||||
Copyright : CODE RECKONS
|
||||
SPDX-License-Identifier: BSL-1.0
|
||||
*/
|
||||
//==================================================================================================
|
||||
#include <rotgen/detail/generators.hpp>
|
||||
#include <rotgen/impl/map.hpp>
|
||||
#include <rotgen/impl/payload.hpp>
|
||||
#include <Eigen/Dense>
|
||||
|
||||
namespace rotgen
|
||||
{
|
||||
#define USE_CONST
|
||||
#define CONST const
|
||||
|
||||
#define SIZE 64
|
||||
#define TYPE double
|
||||
#define STORAGE_ORDER Eigen::ColMajor
|
||||
|
||||
#define CLASSNAME ROTGEN_MATRIX_NAME(map_const_impl,SIZE,_col)
|
||||
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
||||
#include "map_model.cpp"
|
||||
#undef CLASSNAME
|
||||
#undef SOURCENAME
|
||||
#undef STORAGE_ORDER
|
||||
|
||||
#define STORAGE_ORDER Eigen::RowMajor
|
||||
#define CLASSNAME ROTGEN_MATRIX_NAME(map_const_impl,SIZE,_row)
|
||||
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
||||
#include "map_model.cpp"
|
||||
#undef CLASSNAME
|
||||
#undef SOURCENAME
|
||||
#undef STORAGE_ORDER
|
||||
|
||||
#undef SIZE
|
||||
#undef TYPE
|
||||
|
||||
#define SIZE 32
|
||||
#define TYPE float
|
||||
#define STORAGE_ORDER Eigen::ColMajor
|
||||
|
||||
#define CLASSNAME ROTGEN_MATRIX_NAME(map_const_impl,SIZE,_col)
|
||||
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
||||
#include "map_model.cpp"
|
||||
#undef CLASSNAME
|
||||
#undef SOURCENAME
|
||||
#undef STORAGE_ORDER
|
||||
|
||||
#define STORAGE_ORDER Eigen::RowMajor
|
||||
#define CLASSNAME ROTGEN_MATRIX_NAME(map_const_impl,SIZE,_row)
|
||||
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
||||
#include "map_model.cpp"
|
||||
#undef CLASSNAME
|
||||
#undef SOURCENAME
|
||||
#undef STORAGE_ORDER
|
||||
|
||||
#undef SIZE
|
||||
#undef TYPE
|
||||
|
||||
#undef USE_CONST
|
||||
#undef CONST
|
||||
#define CONST
|
||||
|
||||
#define SIZE 64
|
||||
#define TYPE double
|
||||
#define STORAGE_ORDER Eigen::ColMajor
|
||||
|
||||
#define CLASSNAME ROTGEN_MATRIX_NAME(map_impl,SIZE,_col)
|
||||
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
||||
#include "map_model.cpp"
|
||||
#undef CLASSNAME
|
||||
#undef SOURCENAME
|
||||
#undef STORAGE_ORDER
|
||||
|
||||
#define STORAGE_ORDER Eigen::RowMajor
|
||||
#define CLASSNAME ROTGEN_MATRIX_NAME(map_impl,SIZE,_row)
|
||||
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
||||
#include "map_model.cpp"
|
||||
#undef CLASSNAME
|
||||
#undef SOURCENAME
|
||||
#undef STORAGE_ORDER
|
||||
|
||||
#undef SIZE
|
||||
#undef TYPE
|
||||
|
||||
#define SIZE 32
|
||||
#define TYPE float
|
||||
#define STORAGE_ORDER Eigen::ColMajor
|
||||
|
||||
#define CLASSNAME ROTGEN_MATRIX_NAME(map_impl,SIZE,_col)
|
||||
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
||||
#include "map_model.cpp"
|
||||
#undef CLASSNAME
|
||||
#undef SOURCENAME
|
||||
#undef STORAGE_ORDER
|
||||
|
||||
#define STORAGE_ORDER Eigen::RowMajor
|
||||
#define CLASSNAME ROTGEN_MATRIX_NAME(map_impl,SIZE,_row)
|
||||
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
||||
#include "map_model.cpp"
|
||||
#undef CLASSNAME
|
||||
#undef SOURCENAME
|
||||
#undef STORAGE_ORDER
|
||||
|
||||
#undef SIZE
|
||||
#undef TYPE
|
||||
#undef CONST
|
||||
}
|
||||
236
src/map_model.cpp
Normal file
236
src/map_model.cpp
Normal file
|
|
@ -0,0 +1,236 @@
|
|||
//==================================================================================================
|
||||
/*
|
||||
ROTGEN - Runtime Overlay for Eigen
|
||||
Copyright : CODE RECKONS
|
||||
SPDX-License-Identifier: BSL-1.0
|
||||
*/
|
||||
//==================================================================================================
|
||||
|
||||
//==================================================================================================
|
||||
/*
|
||||
This file is a X-File to generate various map_impl_* definitions variant
|
||||
*/
|
||||
//==================================================================================================
|
||||
|
||||
//==================================================================================================
|
||||
// Internal payload
|
||||
//==================================================================================================
|
||||
|
||||
//==================================================================================================
|
||||
// Constructors & Special Members
|
||||
//==================================================================================================
|
||||
CLASSNAME::CLASSNAME(TYPE CONST* ptr, Index r, Index c) : storage_(std::make_unique<payload>(ptr,r,c))
|
||||
{}
|
||||
|
||||
CLASSNAME::CLASSNAME(TYPE CONST* ptr, Index r, Index c, stride s)
|
||||
: storage_(std::make_unique<payload>(ptr,r,c,payload::stride_type{s.outer,s.inner}))
|
||||
{}
|
||||
|
||||
CLASSNAME::CLASSNAME(CLASSNAME const& o) : storage_(std::make_unique<payload>(o.storage_->data))
|
||||
{}
|
||||
|
||||
#if !defined(USE_CONST)
|
||||
CLASSNAME& CLASSNAME::operator=(CLASSNAME const& o)
|
||||
{
|
||||
if (this != &o) storage_->data = o.storage_->data;
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
|
||||
CLASSNAME::CLASSNAME(CLASSNAME&&) noexcept = default;
|
||||
CLASSNAME& CLASSNAME::operator=(CLASSNAME&&) noexcept = default;
|
||||
|
||||
CLASSNAME::~CLASSNAME() = default;
|
||||
|
||||
//==================================================================================================
|
||||
// Matrix API
|
||||
//==================================================================================================
|
||||
rotgen::Index CLASSNAME::rows() const { return storage_->data.rows(); }
|
||||
rotgen::Index CLASSNAME::cols() const { return storage_->data.cols(); }
|
||||
rotgen::Index CLASSNAME::size() const { return storage_->data.size(); }
|
||||
|
||||
rotgen::Index CLASSNAME::innerStride() const { return storage_->data.innerStride(); }
|
||||
rotgen::Index CLASSNAME::outerStride() const { return storage_->data.outerStride(); }
|
||||
|
||||
#if !defined(USE_CONST)
|
||||
TYPE& CLASSNAME::operator()(Index i, Index j) { return storage_->data(i,j); }
|
||||
TYPE& CLASSNAME::operator()(Index i) { return storage_->data.data()[i]; }
|
||||
#endif
|
||||
|
||||
TYPE CLASSNAME::operator()(Index i, Index j) const { return storage_->data(i,j); }
|
||||
TYPE CLASSNAME::operator()(Index i) const { return storage_->data.data()[i]; }
|
||||
|
||||
const TYPE* CLASSNAME::data() const { return storage_->data.data(); }
|
||||
|
||||
SOURCENAME CLASSNAME::transpose() const
|
||||
{
|
||||
SOURCENAME result;
|
||||
result.storage()->assign(storage_->data.transpose().eval());
|
||||
return result;
|
||||
}
|
||||
|
||||
SOURCENAME CLASSNAME::conjugate() const
|
||||
{
|
||||
SOURCENAME result;
|
||||
result.storage()->assign(storage_->data.conjugate().eval());
|
||||
return result;
|
||||
}
|
||||
|
||||
SOURCENAME CLASSNAME::adjoint() const
|
||||
{
|
||||
SOURCENAME result;
|
||||
result.storage()->assign(storage_->data.adjoint().eval());
|
||||
return result;
|
||||
}
|
||||
|
||||
#if !defined(USE_CONST)
|
||||
void CLASSNAME::transposeInPlace()
|
||||
{
|
||||
storage_->data.transposeInPlace();
|
||||
}
|
||||
|
||||
void CLASSNAME::adjointInPlace()
|
||||
{
|
||||
storage_->data.adjointInPlace();
|
||||
}
|
||||
#endif
|
||||
|
||||
TYPE CLASSNAME::sum() const { return storage_->data.sum(); }
|
||||
TYPE CLASSNAME::prod() const { return storage_->data.prod(); }
|
||||
TYPE CLASSNAME::mean() const { return storage_->data.mean(); }
|
||||
TYPE CLASSNAME::trace() const { return storage_->data.trace(); }
|
||||
|
||||
TYPE CLASSNAME::minCoeff() const { return storage_->data.minCoeff(); }
|
||||
TYPE CLASSNAME::maxCoeff() const { return storage_->data.maxCoeff(); }
|
||||
|
||||
TYPE CLASSNAME::minCoeff(Index* row, Index* col) const { return storage_->data.minCoeff(row, col); }
|
||||
TYPE CLASSNAME::maxCoeff(Index* row, Index* col) const { return storage_->data.maxCoeff(row, col); }
|
||||
|
||||
TYPE CLASSNAME::squaredNorm() const { return storage_->data.squaredNorm(); }
|
||||
TYPE CLASSNAME::norm() const { return storage_->data.norm(); }
|
||||
|
||||
TYPE CLASSNAME::lpNorm(int p) const
|
||||
{
|
||||
if (p == 1) return storage_->data.lpNorm<1>();
|
||||
else if (p == 2) return storage_->data.lpNorm<2>();
|
||||
else return storage_->data.lpNorm<Eigen::Infinity>();
|
||||
}
|
||||
|
||||
#if !defined(USE_CONST)
|
||||
void CLASSNAME::setZero()
|
||||
{
|
||||
storage_->data.setZero();
|
||||
}
|
||||
|
||||
void CLASSNAME::setOnes()
|
||||
{
|
||||
storage_->data.setOnes();
|
||||
}
|
||||
|
||||
void CLASSNAME::setIdentity()
|
||||
{
|
||||
storage_->data.setIdentity();
|
||||
}
|
||||
|
||||
void CLASSNAME::setRandom()
|
||||
{
|
||||
storage_->data.setRandom();
|
||||
}
|
||||
|
||||
void CLASSNAME::setConstant(TYPE s)
|
||||
{
|
||||
storage_->data.setConstant(s);
|
||||
}
|
||||
#endif
|
||||
|
||||
//==================================================================================================
|
||||
// Operators
|
||||
//==================================================================================================
|
||||
std::ostream& operator<<(std::ostream& os,CLASSNAME const& m)
|
||||
{
|
||||
return os << m.storage_->data;
|
||||
}
|
||||
|
||||
bool operator==(CLASSNAME const& lhs, CLASSNAME const& rhs)
|
||||
{
|
||||
return lhs.storage_->data == rhs.storage_->data;
|
||||
}
|
||||
|
||||
bool operator!=(CLASSNAME const& lhs, CLASSNAME const& rhs)
|
||||
{
|
||||
return lhs.storage_->data != rhs.storage_->data;
|
||||
}
|
||||
|
||||
SOURCENAME CLASSNAME::operator-() const
|
||||
{
|
||||
SOURCENAME result;
|
||||
result.storage()->assign(storage_->data);
|
||||
return -result;
|
||||
}
|
||||
|
||||
#if !defined(USE_CONST)
|
||||
CLASSNAME& CLASSNAME::operator+=(CLASSNAME const& rhs)
|
||||
{
|
||||
storage_->data += rhs.storage_->data;
|
||||
return *this;
|
||||
}
|
||||
|
||||
CLASSNAME& CLASSNAME::operator-=(CLASSNAME const& rhs)
|
||||
{
|
||||
storage_->data -= rhs.storage_->data;
|
||||
return *this;
|
||||
}
|
||||
|
||||
CLASSNAME& CLASSNAME::operator*=(CLASSNAME const& rhs)
|
||||
{
|
||||
storage_->data *= rhs.storage_->data;
|
||||
return *this;
|
||||
}
|
||||
|
||||
CLASSNAME& CLASSNAME::operator*=(TYPE s)
|
||||
{
|
||||
storage_->data *= s;
|
||||
return *this;
|
||||
}
|
||||
|
||||
CLASSNAME& CLASSNAME::operator/=(TYPE s)
|
||||
{
|
||||
storage_->data /= s;
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
|
||||
SOURCENAME CLASSNAME::add(CLASSNAME const& rhs) const
|
||||
{
|
||||
SOURCENAME result;
|
||||
result.storage()->assign(storage_->data + rhs.storage_->data);
|
||||
return result;
|
||||
}
|
||||
|
||||
SOURCENAME CLASSNAME::sub(CLASSNAME const& rhs) const
|
||||
{
|
||||
SOURCENAME result;
|
||||
result.storage()->assign(storage_->data - rhs.storage_->data);
|
||||
return result;
|
||||
}
|
||||
|
||||
SOURCENAME CLASSNAME::mul(CLASSNAME const& rhs) const
|
||||
{
|
||||
SOURCENAME result;
|
||||
result.storage()->assign(storage_->data * rhs.storage_->data);
|
||||
return result;
|
||||
}
|
||||
|
||||
SOURCENAME CLASSNAME::mul(TYPE s) const
|
||||
{
|
||||
SOURCENAME result;
|
||||
result.storage()->assign(storage_->data * s);
|
||||
return result;
|
||||
}
|
||||
|
||||
SOURCENAME CLASSNAME::div(TYPE s) const
|
||||
{
|
||||
SOURCENAME result;
|
||||
result.storage()->assign(storage_->data / s);
|
||||
return result;
|
||||
}
|
||||
|
|
@ -46,7 +46,7 @@ CLASSNAME& CLASSNAME::operator=(CLASSNAME const& o)
|
|||
|
||||
CLASSNAME& CLASSNAME::operator=(CLASSNAME&&) noexcept = default;
|
||||
|
||||
CLASSNAME::~CLASSNAME() = default;
|
||||
CLASSNAME::~CLASSNAME() = default;
|
||||
|
||||
//==================================================================================================
|
||||
// Matrix API
|
||||
|
|
@ -72,6 +72,7 @@ TYPE& CLASSNAME::operator()(std::size_t index) { return storage_->da
|
|||
TYPE const& CLASSNAME::operator()(std::size_t index) const { return storage_->data(index); }
|
||||
|
||||
const TYPE* CLASSNAME::data() const { return storage_->data.data(); }
|
||||
TYPE* CLASSNAME::data() { return storage_->data.data(); }
|
||||
|
||||
CLASSNAME CLASSNAME::transpose() const
|
||||
{
|
||||
|
|
@ -139,6 +140,11 @@ bool operator==(CLASSNAME const& lhs, CLASSNAME const& rhs)
|
|||
return lhs.storage_->data == rhs.storage_->data;
|
||||
}
|
||||
|
||||
bool operator!=(CLASSNAME const& lhs, CLASSNAME const& rhs)
|
||||
{
|
||||
return lhs.storage_->data != rhs.storage_->data;
|
||||
}
|
||||
|
||||
CLASSNAME& CLASSNAME::operator+=(CLASSNAME const& rhs)
|
||||
{
|
||||
storage_->data += rhs.storage_->data;
|
||||
|
|
@ -180,6 +186,13 @@ CLASSNAME& CLASSNAME::operator/=(TYPE s)
|
|||
// Static functions
|
||||
//==================================================================================================
|
||||
|
||||
CLASSNAME CLASSNAME::Ones(std::size_t rows, std::size_t cols)
|
||||
{
|
||||
CLASSNAME m;
|
||||
m.storage_ = std::make_unique<payload>(payload::data_type::Ones(rows, cols));
|
||||
return m;
|
||||
}
|
||||
|
||||
CLASSNAME CLASSNAME::Zero(std::size_t rows, std::size_t cols)
|
||||
{
|
||||
CLASSNAME m;
|
||||
|
|
|
|||
40
src/operators.cpp
Normal file
40
src/operators.cpp
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
//==================================================================================================
|
||||
/*
|
||||
ROTGEN - Runtime Overlay for Eigen
|
||||
Copyright : CODE RECKONS
|
||||
SPDX-License-Identifier: BSL-1.0
|
||||
*/
|
||||
//==================================================================================================
|
||||
|
||||
#include <rotgen/impl/map.hpp>
|
||||
#include <rotgen/impl/payload.hpp>
|
||||
#include <Eigen/Dense>
|
||||
|
||||
#define ROTGEN_IMPL_OP(OP,FN,RET) \
|
||||
RET operator OP(map_const_impl32_col const& a, map_impl32_col const& b ) { return FN(a, b); } \
|
||||
RET operator OP(map_const_impl32_col const& a, map_impl32_row const& b ) { return FN(a, b); } \
|
||||
RET operator OP(map_const_impl32_col const& a, map_const_impl32_row const& b ) { return FN(a, b); } \
|
||||
RET operator OP(map_const_impl32_row const& a, map_impl32_row const& b ) { return FN(a, b); } \
|
||||
RET operator OP(map_const_impl32_row const& a, map_impl32_col const& b ) { return FN(a, b); } \
|
||||
RET operator OP(map_impl32_col const& a, map_impl32_row const& b ) { return FN(a, b); } \
|
||||
RET operator OP(map_const_impl64_col const& a, map_impl64_col const& b ) { return FN(a, b); } \
|
||||
RET operator OP(map_const_impl64_col const& a, map_impl64_row const& b ) { return FN(a, b); } \
|
||||
RET operator OP(map_const_impl64_col const& a, map_const_impl64_row const& b ) { return FN(a, b); } \
|
||||
RET operator OP(map_const_impl64_row const& a, map_impl64_row const& b ) { return FN(a, b); } \
|
||||
RET operator OP(map_const_impl64_row const& a, map_impl64_col const& b ) { return FN(a, b); } \
|
||||
RET operator OP(map_impl64_col const& a, map_impl64_row const& b ) { return FN(a, b); } \
|
||||
/**/
|
||||
|
||||
namespace rotgen
|
||||
{
|
||||
namespace
|
||||
{
|
||||
auto add(auto const& a, auto const& b) { return a.storage()->data + b.storage()->data; }
|
||||
auto sub(auto const& a, auto const& b) { return a.storage()->data - b.storage()->data; }
|
||||
bool equal(auto const& a, auto const& b) { return a.storage()->data == b.storage()->data; }
|
||||
bool not_equal(auto const& a, auto const& b) { return a.storage()->data != b.storage()->data; }
|
||||
}
|
||||
|
||||
ROTGEN_IMPL_OP(==, equal , bool);
|
||||
ROTGEN_IMPL_OP(!=, not_equal, bool);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue