Operators now mix storage_order and returns properly sized results
See merge request oss/rotgen!30
This commit is contained in:
parent
b61c91736f
commit
43d09f06fb
18 changed files with 237 additions and 88 deletions
22
include/rotgen/detail/helpers.hpp
Normal file
22
include/rotgen/detail/helpers.hpp
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
//==================================================================================================
|
||||||
|
/*
|
||||||
|
ROTGEN - Runtime Overlay for Eigen
|
||||||
|
Copyright : CODE RECKONS
|
||||||
|
SPDX-License-Identifier: BSL-1.0
|
||||||
|
*/
|
||||||
|
//==================================================================================================
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace rotgen::detail
|
||||||
|
{
|
||||||
|
template<auto M, auto N>
|
||||||
|
inline constexpr auto select_static = (M==rotgen::Dynamic || N==rotgen::Dynamic)
|
||||||
|
? rotgen::Dynamic : M;
|
||||||
|
|
||||||
|
template<typename M1, typename M2>
|
||||||
|
using composite_matrix_type = matrix< typename M1::value_type
|
||||||
|
, select_static<M1::RowsAtCompileTime,M2::RowsAtCompileTime>
|
||||||
|
, select_static<M1::ColsAtCompileTime,M2::ColsAtCompileTime>
|
||||||
|
, M1::storage_order
|
||||||
|
>;
|
||||||
|
}
|
||||||
|
|
@ -34,6 +34,7 @@ namespace rotgen
|
||||||
static constexpr int storage_order = Ref::storage_order;
|
static constexpr int storage_order = Ref::storage_order;
|
||||||
static constexpr bool is_immutable = std::is_const_v<Ref>;
|
static constexpr bool is_immutable = std::is_const_v<Ref>;
|
||||||
using concrete_type = matrix<value_type,Rows,Cols,storage_order>;
|
using concrete_type = matrix<value_type,Rows,Cols,storage_order>;
|
||||||
|
using transposed_type = matrix<value_type,Cols,Rows, storage_order ^ RowMajor>;
|
||||||
using concrete_dynamic_type = matrix<value_type,Dynamic,Dynamic,storage_order>;
|
using concrete_dynamic_type = matrix<value_type,Dynamic,Dynamic,storage_order>;
|
||||||
|
|
||||||
static constexpr int RowsAtCompileTime = Rows;
|
static constexpr int RowsAtCompileTime = Rows;
|
||||||
|
|
@ -139,9 +140,9 @@ namespace rotgen
|
||||||
{
|
{
|
||||||
return concrete_type(base().normalized());
|
return concrete_type(base().normalized());
|
||||||
}
|
}
|
||||||
concrete_type transpose() const { return concrete_type(base().transpose());}
|
transposed_type transpose() const { return transposed_type(base().transpose());}
|
||||||
concrete_type conjugate() const { return concrete_type(base().conjugate());}
|
concrete_type conjugate() const { return concrete_type(base().conjugate());}
|
||||||
concrete_type adjoint() const { return concrete_type(base().adjoint());}
|
transposed_type adjoint() const { return transposed_type(base().adjoint());}
|
||||||
|
|
||||||
concrete_type cwiseAbs() const { return concrete_type(base().cwiseAbs()); }
|
concrete_type cwiseAbs() const { return concrete_type(base().cwiseAbs()); }
|
||||||
concrete_type cwiseAbs2() const { return concrete_type(base().cwiseAbs2()); }
|
concrete_type cwiseAbs2() const { return concrete_type(base().cwiseAbs2()); }
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
#include <rotgen/concepts.hpp>
|
#include <rotgen/concepts.hpp>
|
||||||
#include <rotgen/impl/map.hpp>
|
#include <rotgen/impl/map.hpp>
|
||||||
|
#include <rotgen/detail/helpers.hpp>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
namespace rotgen
|
namespace rotgen
|
||||||
|
|
@ -28,7 +29,7 @@ namespace rotgen
|
||||||
using concrete_type = typename std::remove_const_t<Ref>::concrete_type;
|
using concrete_type = typename std::remove_const_t<Ref>::concrete_type;
|
||||||
|
|
||||||
static constexpr bool IsRowMajor = Ref::IsRowMajor;
|
static constexpr bool IsRowMajor = Ref::IsRowMajor;
|
||||||
static constexpr int storage_order = Ref::storage_order;
|
static constexpr int storage_order = Ref::storage_order;
|
||||||
static constexpr bool has_static_storage = false;
|
static constexpr bool has_static_storage = false;
|
||||||
|
|
||||||
static constexpr bool is_immutable = std::is_const_v<Ref>;
|
static constexpr bool is_immutable = std::is_const_v<Ref>;
|
||||||
|
|
@ -40,8 +41,19 @@ namespace rotgen
|
||||||
static constexpr int RowsAtCompileTime = Ref::RowsAtCompileTime;
|
static constexpr int RowsAtCompileTime = Ref::RowsAtCompileTime;
|
||||||
static constexpr int ColsAtCompileTime = Ref::ColsAtCompileTime;
|
static constexpr int ColsAtCompileTime = Ref::ColsAtCompileTime;
|
||||||
static constexpr bool IsVectorAtCompileTime = Ref::IsVectorAtCompileTime;
|
static constexpr bool IsVectorAtCompileTime = Ref::IsVectorAtCompileTime;
|
||||||
|
static constexpr bool IsCompileTimeSized = RowsAtCompileTime != -1 && ColsAtCompileTime != -1;
|
||||||
|
|
||||||
|
using transposed_type = matrix<value_type,ColsAtCompileTime,RowsAtCompileTime, storage_order ^ RowMajor>;
|
||||||
|
|
||||||
|
map(ptr_type ptr, Index r, Index c, stride_type s) : parent(ptr, r, c, strides<storage_order>(s,r,c))
|
||||||
|
{
|
||||||
|
if constexpr(RowsAtCompileTime != -1)
|
||||||
|
assert(r == RowsAtCompileTime && "Mismatched between dynamic and static row size");
|
||||||
|
|
||||||
|
if constexpr(ColsAtCompileTime != -1)
|
||||||
|
assert(c == ColsAtCompileTime && "Mismatched between dynamic and static column size");
|
||||||
|
}
|
||||||
|
|
||||||
map(ptr_type ptr, Index r, Index c, stride_type s) : parent(ptr, r, c, strides<storage_order>(s,r,c)) {}
|
|
||||||
map(ptr_type ptr, Index r, Index c)
|
map(ptr_type ptr, Index r, Index c)
|
||||||
: parent( ptr, r, c
|
: parent( ptr, r, c
|
||||||
, [&]()
|
, [&]()
|
||||||
|
|
@ -52,7 +64,7 @@ namespace rotgen
|
||||||
)
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
map(ptr_type ptr, stride_type s) requires(RowsAtCompileTime!=-1 && ColsAtCompileTime!=-1)
|
map(ptr_type ptr, stride_type s) requires(IsCompileTimeSized)
|
||||||
: parent(ptr,RowsAtCompileTime,ColsAtCompileTime, strides<storage_order>(s))
|
: parent(ptr,RowsAtCompileTime,ColsAtCompileTime, strides<storage_order>(s))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
@ -60,7 +72,7 @@ namespace rotgen
|
||||||
: map( ptr, RowsAtCompileTime==1?1:size, ColsAtCompileTime==1?1:size)
|
: map( ptr, RowsAtCompileTime==1?1:size, ColsAtCompileTime==1?1:size)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
map(ptr_type ptr) requires(RowsAtCompileTime!=-1 && ColsAtCompileTime!=-1)
|
map(ptr_type ptr) requires(IsCompileTimeSized)
|
||||||
: map( ptr, RowsAtCompileTime, ColsAtCompileTime )
|
: map( ptr, RowsAtCompileTime, ColsAtCompileTime )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
@ -128,9 +140,9 @@ namespace rotgen
|
||||||
return concrete_type(base().normalized());
|
return concrete_type(base().normalized());
|
||||||
}
|
}
|
||||||
|
|
||||||
concrete_type transpose() const { return concrete_type(base().transpose()); }
|
transposed_type transpose() const { return transposed_type(base().transpose()); }
|
||||||
concrete_type conjugate() const { return concrete_type(base().conjugate()); }
|
concrete_type conjugate() const { return concrete_type(base().conjugate()); }
|
||||||
concrete_type adjoint() const { return concrete_type(base().adjoint()); }
|
transposed_type adjoint() const { return transposed_type(base().adjoint()); }
|
||||||
|
|
||||||
concrete_type cwiseAbs() const { return concrete_type(base().cwiseAbs()); }
|
concrete_type cwiseAbs() const { return concrete_type(base().cwiseAbs()); }
|
||||||
concrete_type cwiseAbs2() const { return concrete_type(base().cwiseAbs2()); }
|
concrete_type cwiseAbs2() const { return concrete_type(base().cwiseAbs2()); }
|
||||||
|
|
@ -318,28 +330,35 @@ namespace rotgen
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename R1, typename R2, int O1, typename S1, int O2, typename S2>
|
template<typename R1, typename R2, int O1, typename S1, int O2, typename S2>
|
||||||
typename map<R1,O1,S1>::concrete_type operator+(map<R1,O1,S1> const& lhs, map<R2,O2,S2> const& rhs)
|
detail::composite_matrix_type<R1,R2> operator+(map<R1,O1,S1> const& lhs, map<R2,O2,S2> const& rhs)
|
||||||
{
|
{
|
||||||
// REPLICATE TODO
|
using map1_type = map<R1 const,O1,S1>;
|
||||||
using map_type = map<R1 const,O1,S1>;
|
using map2_type = map<R2 const,O2,S2>;
|
||||||
using concrete_type = typename map_type::concrete_type;
|
using concrete_type = detail::composite_matrix_type<R1,R2>;
|
||||||
return concrete_type(map_type(lhs).base().add(map_type(rhs)));
|
return concrete_type(map1_type(lhs).base().add(map2_type(rhs)));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename R1, typename R2, int O1, typename S1, int O2, typename S2>
|
template<typename R1, typename R2, int O1, typename S1, int O2, typename S2>
|
||||||
typename map<R1,O1,S1>::concrete_type operator-(map<R1,O1,S1> const& lhs, map<R2,O2,S2> const& rhs)
|
detail::composite_matrix_type<R1,R2> operator-(map<R1,O1,S1> const& lhs, map<R2,O2,S2> const& rhs)
|
||||||
{
|
{
|
||||||
using map_type = map<R1 const,O1,S1>;
|
using map1_type = map<R1 const,O1,S1>;
|
||||||
using concrete_type = typename map_type::concrete_type;
|
using map2_type = map<R2 const,O2,S2>;
|
||||||
return concrete_type(map_type(lhs).base().sub(map_type(rhs)));
|
using concrete_type = detail::composite_matrix_type<R1,R2>;
|
||||||
|
return concrete_type(map1_type(lhs).base().sub(map2_type(rhs)));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename R1, typename R2, int O1, typename S1, int O2, typename S2>
|
template<typename R1, typename R2, int O1, typename S1, int O2, typename S2>
|
||||||
typename map<R1,O1,S1>::concrete_type operator*(map<R1,O1,S1> const& lhs, map<R2,O2,S2> const& rhs)
|
matrix<typename R1::value_type,R1::RowsAtCompileTime,R2::ColsAtCompileTime,R1::storage_order>
|
||||||
|
operator*(map<R1,O1,S1> const& lhs, map<R2,O2,S2> const& rhs)
|
||||||
{
|
{
|
||||||
using map_type = map<R1 const,O1,S1>;
|
using map1_type = map<R1 const,O1,S1>;
|
||||||
using concrete_type = typename map_type::concrete_type;
|
using map2_type = map<R2 const,O2,S2>;
|
||||||
return concrete_type(map_type(lhs).base().mul(map_type(rhs)));
|
using concrete_type = matrix< typename R1::value_type
|
||||||
|
, R1::RowsAtCompileTime,R2::ColsAtCompileTime
|
||||||
|
, R1::storage_order
|
||||||
|
>;
|
||||||
|
|
||||||
|
return concrete_type(map1_type(lhs).base().mul(map2_type(rhs).base()));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename R, int O, typename S>
|
template<typename R, int O, typename S>
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,8 @@ namespace rotgen
|
||||||
static constexpr bool is_defined_static = false;
|
static constexpr bool is_defined_static = false;
|
||||||
static constexpr bool has_static_storage = false;
|
static constexpr bool has_static_storage = false;
|
||||||
|
|
||||||
|
using transposed_type = matrix<value_type,Cols,Rows, storage_order ^ RowMajor>;
|
||||||
|
|
||||||
matrix() : parent(Rows==-1?0:Rows,Cols==-1?0:Cols) {}
|
matrix() : parent(Rows==-1?0:Rows,Cols==-1?0:Cols) {}
|
||||||
|
|
||||||
matrix(Index r, Index c) requires(!IsCompileTimeSized)
|
matrix(Index r, Index c) requires(!IsCompileTimeSized)
|
||||||
|
|
@ -136,9 +138,9 @@ namespace rotgen
|
||||||
return matrix(base().normalized());
|
return matrix(base().normalized());
|
||||||
}
|
}
|
||||||
|
|
||||||
matrix<Scalar,ColsAtCompileTime,RowsAtCompileTime,storage_order> transpose() const
|
transposed_type transpose() const
|
||||||
{
|
{
|
||||||
return matrix<Scalar,ColsAtCompileTime,RowsAtCompileTime,storage_order>(base().transpose());
|
return transposed_type(base().transpose());
|
||||||
}
|
}
|
||||||
|
|
||||||
matrix conjugate() const
|
matrix conjugate() const
|
||||||
|
|
@ -146,9 +148,9 @@ namespace rotgen
|
||||||
return matrix(base().conjugate());
|
return matrix(base().conjugate());
|
||||||
}
|
}
|
||||||
|
|
||||||
matrix<Scalar,ColsAtCompileTime,RowsAtCompileTime,storage_order> adjoint() const
|
transposed_type adjoint() const
|
||||||
{
|
{
|
||||||
return matrix<Scalar,ColsAtCompileTime,RowsAtCompileTime,storage_order>(base().adjoint());
|
return transposed_type(base().adjoint());
|
||||||
}
|
}
|
||||||
|
|
||||||
void normalize() requires(IsVectorAtCompileTime)
|
void normalize() requires(IsVectorAtCompileTime)
|
||||||
|
|
|
||||||
|
|
@ -427,9 +427,13 @@ namespace rotgen
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename R1, typename R2, int O1, typename S1, int O2, typename S2>
|
template<typename R1, typename R2, int O1, typename S1, int O2, typename S2>
|
||||||
typename map<R1,O1,S1>::concrete_type operator*(map<R1, O1, S1> const& lhs, map<R2,O2,S2> const& rhs)
|
matrix<typename R1::value_type,R1::RowsAtCompileTime,R2::ColsAtCompileTime>
|
||||||
|
operator*(map<R1,O1,S1> const& lhs, map<R2,O2,S2> const& rhs)
|
||||||
{
|
{
|
||||||
using concrete_type = typename map<R1,O1,S1>::concrete_type;
|
using concrete_type = matrix< typename R1::value_type
|
||||||
|
, R1::RowsAtCompileTime,R2::ColsAtCompileTime
|
||||||
|
>;
|
||||||
|
|
||||||
return concrete_type(lhs.base() * rhs.base());
|
return concrete_type(lhs.base() * rhs.base());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,23 @@
|
||||||
#define SIZE 64
|
#define SIZE 64
|
||||||
#define TYPE double
|
#define TYPE double
|
||||||
|
|
||||||
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_col)
|
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_col)
|
||||||
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
||||||
#define MAPNAME ROTGEN_MATRIX_NAME(map_impl,SIZE,_col)
|
#define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
||||||
|
#define MAPNAME ROTGEN_MATRIX_NAME(map_impl,SIZE,_col)
|
||||||
#include <rotgen/impl/block_model.hpp>
|
#include <rotgen/impl/block_model.hpp>
|
||||||
#undef CLASSNAME
|
#undef CLASSNAME
|
||||||
|
#undef TRANSSOURCENAME
|
||||||
#undef SOURCENAME
|
#undef SOURCENAME
|
||||||
#undef MAPNAME
|
#undef MAPNAME
|
||||||
|
|
||||||
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_row)
|
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_row)
|
||||||
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
||||||
#define MAPNAME ROTGEN_MATRIX_NAME(map_impl,SIZE,_row)
|
#define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
||||||
|
#define MAPNAME ROTGEN_MATRIX_NAME(map_impl,SIZE,_row)
|
||||||
#include <rotgen/impl/block_model.hpp>
|
#include <rotgen/impl/block_model.hpp>
|
||||||
#undef CLASSNAME
|
#undef CLASSNAME
|
||||||
|
#undef TRANSSOURCENAME
|
||||||
#undef SOURCENAME
|
#undef SOURCENAME
|
||||||
#undef MAPNAME
|
#undef MAPNAME
|
||||||
|
|
||||||
|
|
@ -23,19 +27,23 @@
|
||||||
#define SIZE 32
|
#define SIZE 32
|
||||||
#define TYPE float
|
#define TYPE float
|
||||||
|
|
||||||
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_col)
|
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_col)
|
||||||
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
||||||
#define MAPNAME ROTGEN_MATRIX_NAME(map_impl,SIZE,_col)
|
#define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
||||||
|
#define MAPNAME ROTGEN_MATRIX_NAME(map_impl,SIZE,_col)
|
||||||
#include <rotgen/impl/block_model.hpp>
|
#include <rotgen/impl/block_model.hpp>
|
||||||
#undef CLASSNAME
|
#undef CLASSNAME
|
||||||
|
#undef TRANSSOURCENAME
|
||||||
#undef SOURCENAME
|
#undef SOURCENAME
|
||||||
#undef MAPNAME
|
#undef MAPNAME
|
||||||
|
|
||||||
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_row)
|
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_row)
|
||||||
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
||||||
#define MAPNAME ROTGEN_MATRIX_NAME(map_impl,SIZE,_row)
|
#define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
||||||
|
#define MAPNAME ROTGEN_MATRIX_NAME(map_impl,SIZE,_row)
|
||||||
#include <rotgen/impl/block_model.hpp>
|
#include <rotgen/impl/block_model.hpp>
|
||||||
#undef CLASSNAME
|
#undef CLASSNAME
|
||||||
|
#undef TRANSSOURCENAME
|
||||||
#undef SOURCENAME
|
#undef SOURCENAME
|
||||||
#undef MAPNAME
|
#undef MAPNAME
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,10 +46,10 @@ class ROTGEN_EXPORT CLASSNAME
|
||||||
Index startRow() const;
|
Index startRow() const;
|
||||||
Index startCol() const;
|
Index startCol() const;
|
||||||
|
|
||||||
SOURCENAME normalized() const;
|
SOURCENAME normalized() const;
|
||||||
SOURCENAME transpose() const;
|
TRANSSOURCENAME transpose() const;
|
||||||
SOURCENAME conjugate() const;
|
SOURCENAME conjugate() const;
|
||||||
SOURCENAME adjoint() const;
|
TRANSSOURCENAME adjoint() const;
|
||||||
|
|
||||||
SOURCENAME cwiseAbs() const;
|
SOURCENAME cwiseAbs() const;
|
||||||
SOURCENAME cwiseAbs2() const;
|
SOURCENAME cwiseAbs2() const;
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,15 @@
|
||||||
|
|
||||||
namespace rotgen
|
namespace rotgen
|
||||||
{
|
{
|
||||||
|
class map_impl64_row;
|
||||||
|
class map_const_impl64_row;
|
||||||
|
class map_impl64_col;
|
||||||
|
class map_const_impl64_col;
|
||||||
|
class map_impl32_row;
|
||||||
|
class map_const_impl32_row;
|
||||||
|
class map_impl32_col;
|
||||||
|
class map_const_impl32_col;
|
||||||
|
|
||||||
#define USE_CONST
|
#define USE_CONST
|
||||||
#define CONST const
|
#define CONST const
|
||||||
#define BASENAME map_const_impl
|
#define BASENAME map_const_impl
|
||||||
|
|
@ -30,7 +39,6 @@ namespace rotgen
|
||||||
#undef BASENAME
|
#undef BASENAME
|
||||||
#undef CONST
|
#undef CONST
|
||||||
|
|
||||||
|
|
||||||
template<typename Scalar,int Options, bool isConst> struct find_map_impl;
|
template<typename Scalar,int Options, bool isConst> struct find_map_impl;
|
||||||
|
|
||||||
template<> struct find_map_impl<float , ColMajor, true> { using type = map_const_impl32_col; };
|
template<> struct find_map_impl<float , ColMajor, true> { using type = map_const_impl32_col; };
|
||||||
|
|
|
||||||
|
|
@ -2,18 +2,26 @@
|
||||||
#define TYPE double
|
#define TYPE double
|
||||||
|
|
||||||
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_col)
|
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_col)
|
||||||
|
#define TRANSCLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_row)
|
||||||
#define CLASSCONSTNAME ROTGEN_MATRIX_NAME(map_const_impl,SIZE,_col)
|
#define CLASSCONSTNAME ROTGEN_MATRIX_NAME(map_const_impl,SIZE,_col)
|
||||||
|
#define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
||||||
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
||||||
#include <rotgen/impl/map_model.hpp>
|
#include <rotgen/impl/map_model.hpp>
|
||||||
#undef CLASSNAME
|
#undef CLASSNAME
|
||||||
|
#undef TRANSCLASSNAME
|
||||||
|
#undef TRANSSOURCENAME
|
||||||
#undef SOURCENAME
|
#undef SOURCENAME
|
||||||
#undef CLASSCONSTNAME
|
#undef CLASSCONSTNAME
|
||||||
|
|
||||||
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_row)
|
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_row)
|
||||||
|
#define TRANSCLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_col)
|
||||||
#define CLASSCONSTNAME ROTGEN_MATRIX_NAME(map_const_impl,SIZE,_row)
|
#define CLASSCONSTNAME ROTGEN_MATRIX_NAME(map_const_impl,SIZE,_row)
|
||||||
|
#define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
||||||
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
||||||
#include <rotgen/impl/map_model.hpp>
|
#include <rotgen/impl/map_model.hpp>
|
||||||
#undef CLASSNAME
|
#undef CLASSNAME
|
||||||
|
#undef TRANSCLASSNAME
|
||||||
|
#undef TRANSSOURCENAME
|
||||||
#undef SOURCENAME
|
#undef SOURCENAME
|
||||||
#undef CLASSCONSTNAME
|
#undef CLASSCONSTNAME
|
||||||
|
|
||||||
|
|
@ -24,18 +32,26 @@
|
||||||
#define TYPE float
|
#define TYPE float
|
||||||
|
|
||||||
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_col)
|
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_col)
|
||||||
|
#define TRANSCLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_row)
|
||||||
#define CLASSCONSTNAME ROTGEN_MATRIX_NAME(map_const_impl,SIZE,_col)
|
#define CLASSCONSTNAME ROTGEN_MATRIX_NAME(map_const_impl,SIZE,_col)
|
||||||
|
#define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
||||||
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
||||||
#include <rotgen/impl/map_model.hpp>
|
#include <rotgen/impl/map_model.hpp>
|
||||||
#undef CLASSNAME
|
#undef CLASSNAME
|
||||||
|
#undef TRANSCLASSNAME
|
||||||
|
#undef TRANSSOURCENAME
|
||||||
#undef SOURCENAME
|
#undef SOURCENAME
|
||||||
#undef CLASSCONSTNAME
|
#undef CLASSCONSTNAME
|
||||||
|
|
||||||
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_row)
|
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_row)
|
||||||
|
#define TRANSCLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_col)
|
||||||
#define CLASSCONSTNAME ROTGEN_MATRIX_NAME(map_const_impl,SIZE,_row)
|
#define CLASSCONSTNAME ROTGEN_MATRIX_NAME(map_const_impl,SIZE,_row)
|
||||||
|
#define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
||||||
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
||||||
#include <rotgen/impl/map_model.hpp>
|
#include <rotgen/impl/map_model.hpp>
|
||||||
#undef CLASSNAME
|
#undef CLASSNAME
|
||||||
|
#undef TRANSCLASSNAME
|
||||||
|
#undef TRANSSOURCENAME
|
||||||
#undef SOURCENAME
|
#undef SOURCENAME
|
||||||
#undef CLASSCONSTNAME
|
#undef CLASSCONSTNAME
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,10 +34,10 @@ class ROTGEN_EXPORT CLASSNAME
|
||||||
Index innerStride() const;
|
Index innerStride() const;
|
||||||
Index outerStride() const;
|
Index outerStride() const;
|
||||||
|
|
||||||
SOURCENAME normalized() const;
|
SOURCENAME normalized() const;
|
||||||
SOURCENAME transpose() const;
|
TRANSSOURCENAME transpose() const;
|
||||||
SOURCENAME conjugate() const;
|
SOURCENAME conjugate() const;
|
||||||
SOURCENAME adjoint() const;
|
TRANSSOURCENAME adjoint() const;
|
||||||
|
|
||||||
SOURCENAME cwiseAbs() const;
|
SOURCENAME cwiseAbs() const;
|
||||||
SOURCENAME cwiseAbs2() const;
|
SOURCENAME cwiseAbs2() const;
|
||||||
|
|
@ -94,8 +94,11 @@ class ROTGEN_EXPORT CLASSNAME
|
||||||
|
|
||||||
SOURCENAME operator-() const;
|
SOURCENAME operator-() const;
|
||||||
SOURCENAME add(CLASSNAME const& rhs) const;
|
SOURCENAME add(CLASSNAME const& rhs) const;
|
||||||
|
SOURCENAME add(TRANSCLASSNAME const& rhs) const;
|
||||||
SOURCENAME sub(CLASSNAME const& rhs) const;
|
SOURCENAME sub(CLASSNAME const& rhs) const;
|
||||||
|
SOURCENAME sub(TRANSCLASSNAME const& rhs) const;
|
||||||
SOURCENAME mul(CLASSNAME const& rhs) const;
|
SOURCENAME mul(CLASSNAME const& rhs) const;
|
||||||
|
SOURCENAME mul(TRANSCLASSNAME const& rhs) const;
|
||||||
SOURCENAME mul(TYPE s) const;
|
SOURCENAME mul(TYPE s) const;
|
||||||
SOURCENAME div(TYPE s) const;
|
SOURCENAME div(TYPE s) const;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,16 +15,25 @@
|
||||||
|
|
||||||
namespace rotgen
|
namespace rotgen
|
||||||
{
|
{
|
||||||
|
class matrix_impl64_row;
|
||||||
|
class matrix_impl64_col;
|
||||||
|
class matrix_impl32_row;
|
||||||
|
class matrix_impl32_col;
|
||||||
|
|
||||||
#define SIZE 64
|
#define SIZE 64
|
||||||
#define TYPE double
|
#define TYPE double
|
||||||
|
|
||||||
#define CLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
#define CLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
||||||
|
#define TRANSCLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
||||||
#include <rotgen/impl/matrix_model.hpp>
|
#include <rotgen/impl/matrix_model.hpp>
|
||||||
#undef CLASSNAME
|
#undef CLASSNAME
|
||||||
|
#undef TRANSCLASSNAME
|
||||||
|
|
||||||
#define CLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
#define CLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
||||||
|
#define TRANSCLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
||||||
#include <rotgen/impl/matrix_model.hpp>
|
#include <rotgen/impl/matrix_model.hpp>
|
||||||
#undef CLASSNAME
|
#undef CLASSNAME
|
||||||
|
#undef TRANSCLASSNAME
|
||||||
|
|
||||||
#undef SIZE
|
#undef SIZE
|
||||||
#undef TYPE
|
#undef TYPE
|
||||||
|
|
@ -32,13 +41,17 @@ namespace rotgen
|
||||||
#define SIZE 32
|
#define SIZE 32
|
||||||
#define TYPE float
|
#define TYPE float
|
||||||
|
|
||||||
#define CLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
#define CLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
||||||
|
#define TRANSCLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
||||||
#include <rotgen/impl/matrix_model.hpp>
|
#include <rotgen/impl/matrix_model.hpp>
|
||||||
#undef CLASSNAME
|
#undef CLASSNAME
|
||||||
|
#undef TRANSCLASSNAME
|
||||||
|
|
||||||
#define CLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
#define CLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
||||||
|
#define TRANSCLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
||||||
#include <rotgen/impl/matrix_model.hpp>
|
#include <rotgen/impl/matrix_model.hpp>
|
||||||
#undef CLASSNAME
|
#undef CLASSNAME
|
||||||
|
#undef TRANSCLASSNAME
|
||||||
|
|
||||||
#undef SIZE
|
#undef SIZE
|
||||||
#undef TYPE
|
#undef TYPE
|
||||||
|
|
|
||||||
|
|
@ -35,10 +35,10 @@ class ROTGEN_EXPORT CLASSNAME
|
||||||
void resize(std::size_t new_rows, std::size_t new_cols);
|
void resize(std::size_t new_rows, std::size_t new_cols);
|
||||||
void conservativeResize(std::size_t new_rows, std::size_t new_cols);
|
void conservativeResize(std::size_t new_rows, std::size_t new_cols);
|
||||||
|
|
||||||
CLASSNAME normalized() const;
|
CLASSNAME normalized() const;
|
||||||
CLASSNAME transpose() const;
|
TRANSCLASSNAME transpose() const;
|
||||||
CLASSNAME conjugate() const;
|
CLASSNAME conjugate() const;
|
||||||
CLASSNAME adjoint() const;
|
TRANSCLASSNAME adjoint() const;
|
||||||
|
|
||||||
CLASSNAME cwiseAbs() const;
|
CLASSNAME cwiseAbs() const;
|
||||||
CLASSNAME cwiseAbs2() const;
|
CLASSNAME cwiseAbs2() const;
|
||||||
|
|
|
||||||
|
|
@ -2,21 +2,25 @@
|
||||||
#define TYPE double
|
#define TYPE double
|
||||||
#define STORAGE_ORDER Eigen::ColMajor
|
#define STORAGE_ORDER Eigen::ColMajor
|
||||||
|
|
||||||
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_col)
|
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_col)
|
||||||
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
||||||
#define MAPNAME ROTGEN_MATRIX_NAME(map_impl,SIZE,_col)
|
#define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
||||||
|
#define MAPNAME ROTGEN_MATRIX_NAME(map_impl,SIZE,_col)
|
||||||
#include "block_model.cpp"
|
#include "block_model.cpp"
|
||||||
#undef CLASSNAME
|
#undef CLASSNAME
|
||||||
|
#undef TRANSSOURCENAME
|
||||||
#undef SOURCENAME
|
#undef SOURCENAME
|
||||||
#undef MAPNAME
|
#undef MAPNAME
|
||||||
#undef STORAGE_ORDER
|
#undef STORAGE_ORDER
|
||||||
|
|
||||||
#define STORAGE_ORDER Eigen::RowMajor
|
#define STORAGE_ORDER Eigen::RowMajor
|
||||||
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_row)
|
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_row)
|
||||||
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
||||||
#define MAPNAME ROTGEN_MATRIX_NAME(map_impl,SIZE,_row)
|
#define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
||||||
|
#define MAPNAME ROTGEN_MATRIX_NAME(map_impl,SIZE,_row)
|
||||||
#include "block_model.cpp"
|
#include "block_model.cpp"
|
||||||
#undef CLASSNAME
|
#undef CLASSNAME
|
||||||
|
#undef TRANSSOURCENAME
|
||||||
#undef SOURCENAME
|
#undef SOURCENAME
|
||||||
#undef MAPNAME
|
#undef MAPNAME
|
||||||
#undef STORAGE_ORDER
|
#undef STORAGE_ORDER
|
||||||
|
|
@ -28,21 +32,25 @@
|
||||||
#define TYPE float
|
#define TYPE float
|
||||||
#define STORAGE_ORDER Eigen::ColMajor
|
#define STORAGE_ORDER Eigen::ColMajor
|
||||||
|
|
||||||
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_col)
|
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_col)
|
||||||
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
||||||
#define MAPNAME ROTGEN_MATRIX_NAME(map_impl,SIZE,_col)
|
#define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
||||||
|
#define MAPNAME ROTGEN_MATRIX_NAME(map_impl,SIZE,_col)
|
||||||
#include "block_model.cpp"
|
#include "block_model.cpp"
|
||||||
#undef CLASSNAME
|
#undef CLASSNAME
|
||||||
|
#undef TRANSSOURCENAME
|
||||||
#undef SOURCENAME
|
#undef SOURCENAME
|
||||||
#undef MAPNAME
|
#undef MAPNAME
|
||||||
#undef STORAGE_ORDER
|
#undef STORAGE_ORDER
|
||||||
|
|
||||||
#define STORAGE_ORDER Eigen::RowMajor
|
#define STORAGE_ORDER Eigen::RowMajor
|
||||||
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_row)
|
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_row)
|
||||||
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
||||||
#define MAPNAME ROTGEN_MATRIX_NAME(map_impl,SIZE,_row)
|
#define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
||||||
|
#define MAPNAME ROTGEN_MATRIX_NAME(map_impl,SIZE,_row)
|
||||||
#include "block_model.cpp"
|
#include "block_model.cpp"
|
||||||
#undef CLASSNAME
|
#undef CLASSNAME
|
||||||
|
#undef TRANSSOURCENAME
|
||||||
#undef SOURCENAME
|
#undef SOURCENAME
|
||||||
#undef MAPNAME
|
#undef MAPNAME
|
||||||
#undef STORAGE_ORDER
|
#undef STORAGE_ORDER
|
||||||
|
|
|
||||||
|
|
@ -234,9 +234,9 @@ struct CLASSNAME::payload
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
SOURCENAME CLASSNAME::transpose() const
|
TRANSSOURCENAME CLASSNAME::transpose() const
|
||||||
{
|
{
|
||||||
SOURCENAME result;
|
TRANSSOURCENAME result;
|
||||||
storage_->apply([&](const auto& blk) { result.storage()->assign(blk.transpose().eval()); });
|
storage_->apply([&](const auto& blk) { result.storage()->assign(blk.transpose().eval()); });
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
@ -248,9 +248,9 @@ struct CLASSNAME::payload
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
SOURCENAME CLASSNAME::adjoint() const
|
TRANSSOURCENAME CLASSNAME::adjoint() const
|
||||||
{
|
{
|
||||||
SOURCENAME result;
|
TRANSSOURCENAME result;
|
||||||
storage_->apply([&](const auto& blk) { result.storage()->assign(blk.adjoint().eval()); });
|
storage_->apply([&](const auto& blk) { result.storage()->assign(blk.adjoint().eval()); });
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,20 +3,28 @@
|
||||||
#define STORAGE_ORDER Eigen::ColMajor
|
#define STORAGE_ORDER Eigen::ColMajor
|
||||||
|
|
||||||
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_col)
|
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_col)
|
||||||
|
#define TRANSCLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_row)
|
||||||
|
#define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
||||||
#define CLASSCONSTNAME ROTGEN_MATRIX_NAME(map_const_impl,SIZE,_col)
|
#define CLASSCONSTNAME ROTGEN_MATRIX_NAME(map_const_impl,SIZE,_col)
|
||||||
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
||||||
#include "map_model.cpp"
|
#include "map_model.cpp"
|
||||||
#undef CLASSNAME
|
#undef CLASSNAME
|
||||||
|
#undef TRANSCLASSNAME
|
||||||
|
#undef TRANSSOURCENAME
|
||||||
#undef CLASSCONSTNAME
|
#undef CLASSCONSTNAME
|
||||||
#undef SOURCENAME
|
#undef SOURCENAME
|
||||||
#undef STORAGE_ORDER
|
#undef STORAGE_ORDER
|
||||||
|
|
||||||
#define STORAGE_ORDER Eigen::RowMajor
|
#define STORAGE_ORDER Eigen::RowMajor
|
||||||
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_row)
|
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_row)
|
||||||
|
#define TRANSCLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_col)
|
||||||
|
#define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
||||||
#define CLASSCONSTNAME ROTGEN_MATRIX_NAME(map_const_impl,SIZE,_row)
|
#define CLASSCONSTNAME ROTGEN_MATRIX_NAME(map_const_impl,SIZE,_row)
|
||||||
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
||||||
#include "map_model.cpp"
|
#include "map_model.cpp"
|
||||||
#undef CLASSNAME
|
#undef CLASSNAME
|
||||||
|
#undef TRANSCLASSNAME
|
||||||
|
#undef TRANSSOURCENAME
|
||||||
#undef SOURCENAME
|
#undef SOURCENAME
|
||||||
#undef CLASSCONSTNAME
|
#undef CLASSCONSTNAME
|
||||||
#undef STORAGE_ORDER
|
#undef STORAGE_ORDER
|
||||||
|
|
@ -29,20 +37,28 @@
|
||||||
#define STORAGE_ORDER Eigen::ColMajor
|
#define STORAGE_ORDER Eigen::ColMajor
|
||||||
|
|
||||||
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_col)
|
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_col)
|
||||||
|
#define TRANSCLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_row)
|
||||||
|
#define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
||||||
#define CLASSCONSTNAME ROTGEN_MATRIX_NAME(map_const_impl,SIZE,_col)
|
#define CLASSCONSTNAME ROTGEN_MATRIX_NAME(map_const_impl,SIZE,_col)
|
||||||
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
||||||
#include "map_model.cpp"
|
#include "map_model.cpp"
|
||||||
#undef CLASSNAME
|
#undef CLASSNAME
|
||||||
|
#undef TRANSCLASSNAME
|
||||||
|
#undef TRANSSOURCENAME
|
||||||
#undef CLASSCONSTNAME
|
#undef CLASSCONSTNAME
|
||||||
#undef SOURCENAME
|
#undef SOURCENAME
|
||||||
#undef STORAGE_ORDER
|
#undef STORAGE_ORDER
|
||||||
|
|
||||||
#define STORAGE_ORDER Eigen::RowMajor
|
#define STORAGE_ORDER Eigen::RowMajor
|
||||||
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_row)
|
#define CLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_row)
|
||||||
|
#define TRANSCLASSNAME ROTGEN_MATRIX_NAME(BASENAME,SIZE,_col)
|
||||||
|
#define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
||||||
#define CLASSCONSTNAME ROTGEN_MATRIX_NAME(map_const_impl,SIZE,_row)
|
#define CLASSCONSTNAME ROTGEN_MATRIX_NAME(map_const_impl,SIZE,_row)
|
||||||
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
||||||
#include "map_model.cpp"
|
#include "map_model.cpp"
|
||||||
#undef CLASSNAME
|
#undef CLASSNAME
|
||||||
|
#undef TRANSCLASSNAME
|
||||||
|
#undef TRANSSOURCENAME
|
||||||
#undef CLASSCONSTNAME
|
#undef CLASSCONSTNAME
|
||||||
#undef SOURCENAME
|
#undef SOURCENAME
|
||||||
#undef STORAGE_ORDER
|
#undef STORAGE_ORDER
|
||||||
|
|
|
||||||
|
|
@ -74,9 +74,9 @@
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
SOURCENAME CLASSNAME::transpose() const
|
TRANSSOURCENAME CLASSNAME::transpose() const
|
||||||
{
|
{
|
||||||
SOURCENAME result;
|
TRANSSOURCENAME result;
|
||||||
result.storage()->assign(storage_->data.transpose().eval());
|
result.storage()->assign(storage_->data.transpose().eval());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
@ -88,9 +88,9 @@
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
SOURCENAME CLASSNAME::adjoint() const
|
TRANSSOURCENAME CLASSNAME::adjoint() const
|
||||||
{
|
{
|
||||||
SOURCENAME result;
|
TRANSSOURCENAME result;
|
||||||
result.storage()->assign(storage_->data.adjoint().eval());
|
result.storage()->assign(storage_->data.adjoint().eval());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
@ -329,6 +329,13 @@
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SOURCENAME CLASSNAME::add(TRANSCLASSNAME const& rhs) const
|
||||||
|
{
|
||||||
|
SOURCENAME result;
|
||||||
|
result.storage()->assign(storage_->data + rhs.storage()->data);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
SOURCENAME CLASSNAME::sub(CLASSNAME const& rhs) const
|
SOURCENAME CLASSNAME::sub(CLASSNAME const& rhs) const
|
||||||
{
|
{
|
||||||
SOURCENAME result;
|
SOURCENAME result;
|
||||||
|
|
@ -336,6 +343,13 @@
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SOURCENAME CLASSNAME::sub(TRANSCLASSNAME const& rhs) const
|
||||||
|
{
|
||||||
|
SOURCENAME result;
|
||||||
|
result.storage()->assign(storage_->data - rhs.storage()->data);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
SOURCENAME CLASSNAME::mul(CLASSNAME const& rhs) const
|
SOURCENAME CLASSNAME::mul(CLASSNAME const& rhs) const
|
||||||
{
|
{
|
||||||
SOURCENAME result;
|
SOURCENAME result;
|
||||||
|
|
@ -343,6 +357,13 @@
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SOURCENAME CLASSNAME::mul(TRANSCLASSNAME const& rhs) const
|
||||||
|
{
|
||||||
|
SOURCENAME result;
|
||||||
|
result.storage()->assign(storage_->data * rhs.storage()->data);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
SOURCENAME CLASSNAME::mul(TYPE s) const
|
SOURCENAME CLASSNAME::mul(TYPE s) const
|
||||||
{
|
{
|
||||||
SOURCENAME result;
|
SOURCENAME result;
|
||||||
|
|
|
||||||
|
|
@ -17,15 +17,19 @@ namespace rotgen
|
||||||
#define TYPE double
|
#define TYPE double
|
||||||
#define STORAGE_ORDER Eigen::ColMajor
|
#define STORAGE_ORDER Eigen::ColMajor
|
||||||
|
|
||||||
#define CLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
#define CLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
||||||
|
#define TRANSCLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
||||||
#include "matrix_model.cpp"
|
#include "matrix_model.cpp"
|
||||||
#undef CLASSNAME
|
#undef CLASSNAME
|
||||||
|
#undef TRANSCLASSNAME
|
||||||
#undef STORAGE_ORDER
|
#undef STORAGE_ORDER
|
||||||
|
|
||||||
#define STORAGE_ORDER Eigen::RowMajor
|
#define STORAGE_ORDER Eigen::RowMajor
|
||||||
#define CLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
#define CLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
||||||
|
#define TRANSCLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
||||||
#include "matrix_model.cpp"
|
#include "matrix_model.cpp"
|
||||||
#undef CLASSNAME
|
#undef CLASSNAME
|
||||||
|
#undef TRANSCLASSNAME
|
||||||
#undef STORAGE_ORDER
|
#undef STORAGE_ORDER
|
||||||
|
|
||||||
#undef SIZE
|
#undef SIZE
|
||||||
|
|
@ -35,15 +39,19 @@ namespace rotgen
|
||||||
#define TYPE float
|
#define TYPE float
|
||||||
#define STORAGE_ORDER Eigen::ColMajor
|
#define STORAGE_ORDER Eigen::ColMajor
|
||||||
|
|
||||||
#define CLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
#define CLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
||||||
|
#define TRANSCLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
||||||
#include "matrix_model.cpp"
|
#include "matrix_model.cpp"
|
||||||
#undef CLASSNAME
|
#undef CLASSNAME
|
||||||
|
#undef TRANSCLASSNAME
|
||||||
#undef STORAGE_ORDER
|
#undef STORAGE_ORDER
|
||||||
|
|
||||||
#define STORAGE_ORDER Eigen::RowMajor
|
#define STORAGE_ORDER Eigen::RowMajor
|
||||||
#define CLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
#define CLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
|
||||||
|
#define TRANSCLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
|
||||||
#include "matrix_model.cpp"
|
#include "matrix_model.cpp"
|
||||||
#undef CLASSNAME
|
#undef CLASSNAME
|
||||||
|
#undef TRANSCLASSNAME
|
||||||
#undef STORAGE_ORDER
|
#undef STORAGE_ORDER
|
||||||
|
|
||||||
#undef SIZE
|
#undef SIZE
|
||||||
|
|
|
||||||
|
|
@ -82,10 +82,10 @@ CLASSNAME CLASSNAME::normalized() const
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
CLASSNAME CLASSNAME::transpose() const
|
TRANSCLASSNAME CLASSNAME::transpose() const
|
||||||
{
|
{
|
||||||
CLASSNAME result(*this);
|
TRANSCLASSNAME result;
|
||||||
result.storage_->data.transposeInPlace();
|
result.storage()->data = storage_->data.transpose();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -96,10 +96,10 @@ CLASSNAME CLASSNAME::conjugate() const
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
CLASSNAME CLASSNAME::adjoint() const
|
TRANSCLASSNAME CLASSNAME::adjoint() const
|
||||||
{
|
{
|
||||||
CLASSNAME result(*this);
|
TRANSCLASSNAME result;
|
||||||
result.storage_->data.adjointInPlace();
|
result.storage()->data = storage_->data.adjoint();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue