Reorganize internals

See merge request oss/rotgen!36
This commit is contained in:
Joel Falcou 2025-10-12 19:01:13 +02:00
commit 746e2dcf9a
55 changed files with 585 additions and 495 deletions

View file

@ -40,12 +40,11 @@ handle_option(ROTGEN_COMPILE_DEFS)
##====================================================================================================================== ##======================================================================================================================
if(ROTGEN_FORCE_DYNAMIC) if(ROTGEN_FORCE_DYNAMIC)
set ( SOURCES set ( SOURCES
src/map.cpp src/map/impl.cpp
src/matrix.cpp src/matrix/impl.cpp
src/block.cpp src/block/impl.cpp
src/svd/impl.cpp
src/info.cpp src/info.cpp
src/svd.cpp
src/operators.cpp
src/format.cpp src/format.cpp
) )
else() else()

View file

@ -0,0 +1,16 @@
//==================================================================================================
/*
ROTGEN - Runtime Overlay for Eigen
Copyright : CODE RECKONS
SPDX-License-Identifier: BSL-1.0
*/
//==================================================================================================
#pragma once
#include <rotgen/algebra/qr.hpp>
#if defined(ROTGEN_FORCE_DYNAMIC)
#include <rotgen/algebra/svd/dynamic.hpp>
#else
#include <rotgen/algebra/svd/fixed.hpp>
#endif

View file

@ -7,7 +7,7 @@
//================================================================================================== //==================================================================================================
#pragma once #pragma once
#include <rotgen/impl/svd.hpp> #include <rotgen/algebra/svd/dynamic/impl.hpp>
namespace rotgen namespace rotgen
{ {

View file

@ -24,13 +24,13 @@ namespace rotgen
#define CLASSNAME ROTGEN_MATRIX_NAME(svd_impl,SIZE,_col) #define CLASSNAME ROTGEN_MATRIX_NAME(svd_impl,SIZE,_col)
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col) #define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
#include <rotgen/impl/svd_model.hpp> #include <rotgen/algebra/svd/dynamic/model.hpp>
#undef CLASSNAME #undef CLASSNAME
#undef SOURCENAME #undef SOURCENAME
#define CLASSNAME ROTGEN_MATRIX_NAME(svd_impl,SIZE,_row) #define CLASSNAME ROTGEN_MATRIX_NAME(svd_impl,SIZE,_row)
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row) #define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
#include <rotgen/impl/svd_model.hpp> #include <rotgen/algebra/svd/dynamic/model.hpp>
#undef CLASSNAME #undef CLASSNAME
#undef SOURCENAME #undef SOURCENAME
@ -42,13 +42,13 @@ namespace rotgen
#define CLASSNAME ROTGEN_MATRIX_NAME(svd_impl,SIZE,_col) #define CLASSNAME ROTGEN_MATRIX_NAME(svd_impl,SIZE,_col)
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col) #define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
#include <rotgen/impl/svd_model.hpp> #include <rotgen/algebra/svd/dynamic/model.hpp>
#undef CLASSNAME #undef CLASSNAME
#undef SOURCENAME #undef SOURCENAME
#define CLASSNAME ROTGEN_MATRIX_NAME(svd_impl,SIZE,_row) #define CLASSNAME ROTGEN_MATRIX_NAME(svd_impl,SIZE,_row)
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row) #define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
#include <rotgen/impl/svd_model.hpp> #include <rotgen/algebra/svd/dynamic/model.hpp>
#undef CLASSNAME #undef CLASSNAME
#undef SOURCENAME #undef SOURCENAME

View file

@ -26,19 +26,19 @@ namespace rotgen
auto singular_values() const auto singular_values() const
{ {
if constexpr(!use_expression_templates) return as_concrete_t<d_type, matrix>{svd_.singularValues()}; if constexpr(!use_expression_templates) return detail::as_concrete_t<d_type, matrix>{svd_.singularValues()};
else return svd_.singularValues(); else return svd_.singularValues();
} }
auto U() const auto U() const
{ {
if constexpr(!use_expression_templates) return as_concrete_t<u_type, matrix>{svd_.matrixU()}; if constexpr(!use_expression_templates) return detail::as_concrete_t<u_type, matrix>{svd_.matrixU()};
else return svd_.matrixU(); else return svd_.matrixU();
} }
auto V() const auto V() const
{ {
if constexpr(!use_expression_templates) return as_concrete_t<v_type, matrix>{svd_.matrixV()}; if constexpr(!use_expression_templates) return detail::as_concrete_t<v_type, matrix>{svd_.matrixV()};
else return svd_.matrixV(); else return svd_.matrixV();
} }
@ -46,7 +46,7 @@ namespace rotgen
{ {
auto d = svd_.singularValues().asDiagonal(); auto d = svd_.singularValues().asDiagonal();
if constexpr(!use_expression_templates) if constexpr(!use_expression_templates)
return as_concrete_t<decltype(d.toDenseMatrix()), matrix>{d.toDenseMatrix ()}; return detail::as_concrete_t<decltype(d.toDenseMatrix()), matrix>{d.toDenseMatrix ()};
else else
return d; return d;
} }
@ -55,21 +55,21 @@ namespace rotgen
auto singular_values(int r) const auto singular_values(int r) const
{ {
auto that = svd_.singularValues().head(r); auto that = svd_.singularValues().head(r);
if constexpr(!use_expression_templates) return as_concrete_t<decltype(that), matrix>{that}; if constexpr(!use_expression_templates) return detail::as_concrete_t<decltype(that), matrix>{that};
else return svd_.singularValues(); else return svd_.singularValues();
} }
auto U(int r) const auto U(int r) const
{ {
auto that = svd_.matrixU().leftCols(r); auto that = svd_.matrixU().leftCols(r);
if constexpr(!use_expression_templates) return as_concrete_t<decltype(that), matrix>{that}; if constexpr(!use_expression_templates) return detail::as_concrete_t<decltype(that), matrix>{that};
else return that; else return that;
} }
auto V(int r) const auto V(int r) const
{ {
auto that = svd_.matrixV().leftCols(r); auto that = svd_.matrixV().leftCols(r);
if constexpr(!use_expression_templates) return as_concrete_t<decltype(that), matrix>{that}; if constexpr(!use_expression_templates) return detail::as_concrete_t<decltype(that), matrix>{that};
else return that; else return that;
} }
@ -77,7 +77,7 @@ namespace rotgen
{ {
auto d = svd_.singularValues().head(r).asDiagonal(); auto d = svd_.singularValues().head(r).asDiagonal();
if constexpr(!use_expression_templates) if constexpr(!use_expression_templates)
return as_concrete_t<decltype(d.toDenseMatrix()), matrix>{d.toDenseMatrix ()}; return detail::as_concrete_t<decltype(d.toDenseMatrix()), matrix>{d.toDenseMatrix ()};
else else
return d; return d;
} }

View file

@ -1,28 +0,0 @@
//==================================================================================================
/*
ROTGEN - Runtime Overlay for Eigen
Copyright : CODE RECKONS
SPDX-License-Identifier: BSL-1.0
*/
//==================================================================================================
#pragma once
namespace rotgen
{
template< typename EigenType
, template<typename,int,int,int,int,int> typename Wrapper
>
struct as_concrete
{
using type = Wrapper< typename EigenType::value_type
, EigenType::RowsAtCompileTime, EigenType::ColsAtCompileTime
, EigenType::Flags & 1
, EigenType::MaxRowsAtCompileTime, EigenType::MaxColsAtCompileTime
>;
};
template<typename EigenType
, template<typename,int,int,int,int,int> typename Wrapper
>
using as_concrete_t = typename as_concrete<std::remove_cvref_t<EigenType>,Wrapper>::type;
}

View file

@ -9,7 +9,7 @@
#include <cstddef> #include <cstddef>
#include <iostream> #include <iostream>
#include <rotgen/common/export.hpp> #include <rotgen/detail/export.hpp>
#include <rotgen/detail/spy.hpp> #include <rotgen/detail/spy.hpp>
namespace rotgen namespace rotgen

View file

@ -0,0 +1,13 @@
//==================================================================================================
/*
ROTGEN - Runtime Overlay for Eigen
Copyright : CODE RECKONS
SPDX-License-Identifier: BSL-1.0
*/
//==================================================================================================
#pragma once
#include <rotgen/container/matrix.hpp>
#include <rotgen/container/block.hpp>
#include <rotgen/container/map.hpp>
#include <rotgen/container/ref.hpp>

View file

@ -0,0 +1,16 @@
//==================================================================================================
/*
ROTGEN - Runtime Overlay for Eigen
Copyright : CODE RECKONS
SPDX-License-Identifier: BSL-1.0
*/
//==================================================================================================
#pragma once
#include <rotgen/config.hpp>
#if defined(ROTGEN_FORCE_DYNAMIC)
#include <rotgen/container/block/dynamic.hpp>
#else
#include <rotgen/container/block/fixed.hpp>
#endif

View file

@ -8,8 +8,8 @@
#pragma once #pragma once
#include <rotgen/concepts.hpp> #include <rotgen/concepts.hpp>
#include <rotgen/impl/block.hpp> #include <rotgen/container/block/dynamic/impl.hpp>
#include <rotgen/dynamic/matrix.hpp> #include <rotgen/container/matrix/dynamic.hpp>
#include <initializer_list> #include <initializer_list>
#include <cassert> #include <cassert>
@ -39,6 +39,8 @@ namespace rotgen
static constexpr int RowsAtCompileTime = Rows; static constexpr int RowsAtCompileTime = Rows;
static constexpr int ColsAtCompileTime = Cols; static constexpr int ColsAtCompileTime = Cols;
static constexpr int MaxRowsAtCompileTime = Rows;
static constexpr int MaxColsAtCompileTime = Cols;
static constexpr bool IsVectorAtCompileTime = Ref::IsVectorAtCompileTime; static constexpr bool IsVectorAtCompileTime = Ref::IsVectorAtCompileTime;
static constexpr int Options = Ref::Options; static constexpr int Options = Ref::Options;
static constexpr bool IsRowMajor = (storage_order & RowMajor) == RowMajor; static constexpr bool IsRowMajor = (storage_order & RowMajor) == RowMajor;

View file

@ -8,8 +8,8 @@
#pragma once #pragma once
#include <rotgen/detail/generators.hpp> #include <rotgen/detail/generators.hpp>
#include <rotgen/impl/matrix.hpp> #include <rotgen/container/matrix/dynamic.hpp>
#include <rotgen/impl/map.hpp> #include <rotgen/container/map/dynamic.hpp>
#include <initializer_list> #include <initializer_list>
#include <cstddef> #include <cstddef>
#include <memory> #include <memory>
@ -26,7 +26,7 @@ namespace rotgen
#define CONST const #define CONST const
#define BASENAME block_const_impl #define BASENAME block_const_impl
#define BASEMAP map_const_impl #define BASEMAP map_const_impl
#include <rotgen/impl/block_indirect.hpp> #include <rotgen/container/block/dynamic/indirect.hpp>
#undef BASENAME #undef BASENAME
#undef BASEMAP #undef BASEMAP
#undef CONST #undef CONST
@ -35,7 +35,7 @@ namespace rotgen
#define CONST #define CONST
#define BASENAME block_impl #define BASENAME block_impl
#define BASEMAP map_impl #define BASEMAP map_impl
#include <rotgen/impl/block_indirect.hpp> #include <rotgen/container/block/dynamic/indirect.hpp>
#undef BASENAME #undef BASENAME
#undef BASEMAP #undef BASEMAP
#undef CONST #undef CONST

View file

@ -5,7 +5,7 @@
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col) #define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
#define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row) #define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
#define MAPNAME ROTGEN_MATRIX_NAME(BASEMAP,SIZE,_col) #define MAPNAME ROTGEN_MATRIX_NAME(BASEMAP,SIZE,_col)
#include <rotgen/impl/block_model.hpp> #include <rotgen/container/block/dynamic/model.hpp>
#undef CLASSNAME #undef CLASSNAME
#undef TRANSSOURCENAME #undef TRANSSOURCENAME
#undef SOURCENAME #undef SOURCENAME
@ -15,7 +15,7 @@
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row) #define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
#define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col) #define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
#define MAPNAME ROTGEN_MATRIX_NAME(BASEMAP,SIZE,_row) #define MAPNAME ROTGEN_MATRIX_NAME(BASEMAP,SIZE,_row)
#include <rotgen/impl/block_model.hpp> #include <rotgen/container/block/dynamic/model.hpp>
#undef CLASSNAME #undef CLASSNAME
#undef TRANSSOURCENAME #undef TRANSSOURCENAME
#undef SOURCENAME #undef SOURCENAME
@ -31,7 +31,7 @@
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col) #define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
#define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row) #define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
#define MAPNAME ROTGEN_MATRIX_NAME(BASEMAP,SIZE,_col) #define MAPNAME ROTGEN_MATRIX_NAME(BASEMAP,SIZE,_col)
#include <rotgen/impl/block_model.hpp> #include <rotgen/container/block/dynamic/model.hpp>
#undef CLASSNAME #undef CLASSNAME
#undef TRANSSOURCENAME #undef TRANSSOURCENAME
#undef SOURCENAME #undef SOURCENAME
@ -41,7 +41,7 @@
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row) #define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
#define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col) #define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
#define MAPNAME ROTGEN_MATRIX_NAME(BASEMAP,SIZE,_row) #define MAPNAME ROTGEN_MATRIX_NAME(BASEMAP,SIZE,_row)
#include <rotgen/impl/block_model.hpp> #include <rotgen/container/block/dynamic/model.hpp>
#undef CLASSNAME #undef CLASSNAME
#undef TRANSSOURCENAME #undef TRANSSOURCENAME
#undef SOURCENAME #undef SOURCENAME

View file

@ -7,6 +7,7 @@
//================================================================================================== //==================================================================================================
#pragma once #pragma once
#include <rotgen/container/strides.hpp>
#include <Eigen/Dense> #include <Eigen/Dense>
#include <iostream> #include <iostream>
@ -64,11 +65,13 @@ namespace rotgen
using concrete_dynamic_type = matrix<value_type,Dynamic,Dynamic,storage_order>; using concrete_dynamic_type = matrix<value_type,Dynamic,Dynamic,storage_order>;
template<typename ET> template<typename ET>
using as_concrete_type = as_concrete_t<ET, matrix>; using as_concrete_type = detail::as_concrete_t<ET, matrix>;
static constexpr int Options = Ref::Options; static constexpr int Options = Ref::Options;
static constexpr int RowsAtCompileTime = Rows; static constexpr int RowsAtCompileTime = Rows;
static constexpr int ColsAtCompileTime = Cols; static constexpr int ColsAtCompileTime = Cols;
static constexpr int MaxRowsAtCompileTime = Ref::MaxRowsAtCompileTime;
static constexpr int MaxColsAtCompileTime = Ref::MaxColsAtCompileTime;
static constexpr bool IsVectorAtCompileTime = Ref::IsVectorAtCompileTime; static constexpr bool IsVectorAtCompileTime = Ref::IsVectorAtCompileTime;
static constexpr bool is_defined_static = Rows!=-1 && Cols!=-1; static constexpr bool is_defined_static = Rows!=-1 && Cols!=-1;
static constexpr bool has_static_storage = storage_status<Rows,Cols,Rows,Cols>; static constexpr bool has_static_storage = storage_status<Rows,Cols,Rows,Cols>;

View file

@ -0,0 +1,16 @@
//==================================================================================================
/*
ROTGEN - Runtime Overlay for Eigen
Copyright : CODE RECKONS
SPDX-License-Identifier: BSL-1.0
*/
//==================================================================================================
#pragma once
#include <rotgen/config.hpp>
#if defined(ROTGEN_FORCE_DYNAMIC)
#include <rotgen/container/map/dynamic.hpp>
#else
#include <rotgen/container/map/fixed.hpp>
#endif

View file

@ -8,7 +8,7 @@
#pragma once #pragma once
#include <rotgen/concepts.hpp> #include <rotgen/concepts.hpp>
#include <rotgen/impl/map.hpp> #include <rotgen/container/map/dynamic/impl.hpp>
#include <rotgen/detail/helpers.hpp> #include <rotgen/detail/helpers.hpp>
#include <cassert> #include <cassert>
@ -40,6 +40,8 @@ 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 int MaxRowsAtCompileTime = Ref::MaxRowsAtCompileTime;
static constexpr int MaxColsAtCompileTime = Ref::MaxColsAtCompileTime;
static constexpr bool IsVectorAtCompileTime = Ref::IsVectorAtCompileTime; static constexpr bool IsVectorAtCompileTime = Ref::IsVectorAtCompileTime;
static constexpr bool IsCompileTimeSized = RowsAtCompileTime != -1 && ColsAtCompileTime != -1; static constexpr bool IsCompileTimeSized = RowsAtCompileTime != -1 && ColsAtCompileTime != -1;
@ -336,20 +338,20 @@ 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>
detail::composite_matrix_type<R1,R2> operator+(map<R1,O1,S1> const& lhs, map<R2,O2,S2> const& rhs) detail::composite_type<R1,R2,matrix> operator+(map<R1,O1,S1> const& lhs, map<R2,O2,S2> const& rhs)
{ {
using map1_type = map<R1 const,O1,S1>; using map1_type = map<R1 const,O1,S1>;
using map2_type = map<R2 const,O2,S2>; using map2_type = map<R2 const,O2,S2>;
using concrete_type = detail::composite_matrix_type<R1,R2>; using concrete_type = detail::composite_type<R1,R2,matrix>;
return concrete_type(map1_type(lhs).base().add(map2_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>
detail::composite_matrix_type<R1,R2> operator-(map<R1,O1,S1> const& lhs, map<R2,O2,S2> const& rhs) detail::composite_type<R1,R2,matrix> operator-(map<R1,O1,S1> const& lhs, map<R2,O2,S2> const& rhs)
{ {
using map1_type = map<R1 const,O1,S1>; using map1_type = map<R1 const,O1,S1>;
using map2_type = map<R2 const,O2,S2>; using map2_type = map<R2 const,O2,S2>;
using concrete_type = detail::composite_matrix_type<R1,R2>; using concrete_type = detail::composite_type<R1,R2,matrix>;
return concrete_type(map1_type(lhs).base().sub(map2_type(rhs))); return concrete_type(map1_type(lhs).base().sub(map2_type(rhs)));
} }

View file

@ -8,8 +8,8 @@
#pragma once #pragma once
#include <rotgen/detail/generators.hpp> #include <rotgen/detail/generators.hpp>
#include <rotgen/impl/matrix.hpp> #include <rotgen/container/matrix/dynamic/impl.hpp>
#include <rotgen/common/strides.hpp> #include <rotgen/container/strides.hpp>
#include <initializer_list> #include <initializer_list>
#include <cstddef> #include <cstddef>
#include <memory> #include <memory>
@ -28,14 +28,14 @@ namespace rotgen
#define USE_CONST #define USE_CONST
#define CONST const #define CONST const
#define BASENAME map_const_impl #define BASENAME map_const_impl
#include <rotgen/impl/map_indirect.hpp> #include <rotgen/container/map/dynamic/indirect.hpp>
#undef BASENAME #undef BASENAME
#undef CONST #undef CONST
#undef USE_CONST #undef USE_CONST
#define CONST #define CONST
#define BASENAME map_impl #define BASENAME map_impl
#include <rotgen/impl/map_indirect.hpp> #include <rotgen/container/map/dynamic/indirect.hpp>
#undef BASENAME #undef BASENAME
#undef CONST #undef CONST
@ -57,4 +57,4 @@ namespace rotgen
>::type; >::type;
} }
#include <rotgen/impl/map_operators.hpp> #include <rotgen/container/map/dynamic/operators.hpp>

View file

@ -6,7 +6,7 @@
#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 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/container/map/dynamic/model.hpp>
#undef CLASSNAME #undef CLASSNAME
#undef TRANSCLASSNAME #undef TRANSCLASSNAME
#undef TRANSSOURCENAME #undef TRANSSOURCENAME
@ -18,7 +18,7 @@
#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 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/container/map/dynamic/model.hpp>
#undef CLASSNAME #undef CLASSNAME
#undef TRANSCLASSNAME #undef TRANSCLASSNAME
#undef TRANSSOURCENAME #undef TRANSSOURCENAME
@ -36,7 +36,7 @@
#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 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/container/map/dynamic/model.hpp>
#undef CLASSNAME #undef CLASSNAME
#undef TRANSCLASSNAME #undef TRANSCLASSNAME
#undef TRANSSOURCENAME #undef TRANSSOURCENAME
@ -48,7 +48,7 @@
#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 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/container/map/dynamic/model.hpp>
#undef CLASSNAME #undef CLASSNAME
#undef TRANSCLASSNAME #undef TRANSCLASSNAME
#undef TRANSSOURCENAME #undef TRANSSOURCENAME

View file

@ -39,8 +39,10 @@ namespace rotgen
using value_type = typename std::remove_const_t<Ref>::value_type; using value_type = typename std::remove_const_t<Ref>::value_type;
using concrete_type = typename std::remove_const_t<Ref>::concrete_type; using concrete_type = typename std::remove_const_t<Ref>::concrete_type;
static constexpr Index RowsAtCompileTime = Ref::RowsAtCompileTime; static constexpr int RowsAtCompileTime = Ref::RowsAtCompileTime;
static constexpr Index ColsAtCompileTime = Ref::ColsAtCompileTime; static constexpr int ColsAtCompileTime = Ref::ColsAtCompileTime;
static constexpr int MaxRowsAtCompileTime = Ref::MaxRowsAtCompileTime;
static constexpr int MaxColsAtCompileTime = Ref::MaxColsAtCompileTime;
static constexpr bool IsVectorAtCompileTime = Ref::IsVectorAtCompileTime; static constexpr bool IsVectorAtCompileTime = Ref::IsVectorAtCompileTime;
static constexpr bool has_static_storage = Ref::has_static_storage; static constexpr bool has_static_storage = Ref::has_static_storage;
static constexpr int storage_order = Ref::storage_order; static constexpr int storage_order = Ref::storage_order;
@ -48,7 +50,7 @@ namespace rotgen
static constexpr bool is_defined_static = Ref::is_defined_static; static constexpr bool is_defined_static = Ref::is_defined_static;
template<typename ET> template<typename ET>
using as_concrete_type = as_concrete_t<ET, matrix>; using as_concrete_type = detail::as_concrete_t<ET, matrix>;
using ptr_type = std::conditional_t<is_immutable, value_type const*, value_type*>; using ptr_type = std::conditional_t<is_immutable, value_type const*, value_type*>;
using stride_type = Stride; using stride_type = Stride;

View file

@ -0,0 +1,16 @@
//==================================================================================================
/*
ROTGEN - Runtime Overlay for Eigen
Copyright : CODE RECKONS
SPDX-License-Identifier: BSL-1.0
*/
//==================================================================================================
#pragma once
#include <rotgen/config.hpp>
#if defined(ROTGEN_FORCE_DYNAMIC)
#include <rotgen/container/matrix/dynamic.hpp>
#else
#include <rotgen/container/matrix/fixed.hpp>
#endif

View file

@ -7,7 +7,8 @@
//================================================================================================== //==================================================================================================
#pragma once #pragma once
#include <rotgen/impl/matrix.hpp> #include <rotgen/container/matrix/dynamic/impl.hpp>
#include <rotgen/concepts.hpp>
#include <initializer_list> #include <initializer_list>
#include <cassert> #include <cassert>
@ -27,8 +28,10 @@ namespace rotgen
using value_type = Scalar; using value_type = Scalar;
static constexpr auto storage_order = Opts & 1; static constexpr auto storage_order = Opts & 1;
static constexpr Index RowsAtCompileTime = Rows; static constexpr int RowsAtCompileTime = Rows;
static constexpr Index ColsAtCompileTime = Cols; static constexpr int ColsAtCompileTime = Cols;
static constexpr int MaxRowsAtCompileTime = MaxRows;
static constexpr int MaxColsAtCompileTime = MaxCols;
static constexpr bool IsCompileTimeSized = Rows != -1 && Cols != -1; static constexpr bool IsCompileTimeSized = Rows != -1 && Cols != -1;
static constexpr bool IsVectorAtCompileTime = (RowsAtCompileTime == 1) || (ColsAtCompileTime == 1); static constexpr bool IsVectorAtCompileTime = (RowsAtCompileTime == 1) || (ColsAtCompileTime == 1);
static constexpr int Options = Opts; static constexpr int Options = Opts;

View file

@ -8,7 +8,7 @@
#pragma once #pragma once
#include <rotgen/detail/generators.hpp> #include <rotgen/detail/generators.hpp>
#include <rotgen/dynamic/format.hpp> #include <rotgen/format/dynamic.hpp>
#include <rotgen/config.hpp> #include <rotgen/config.hpp>
#include <initializer_list> #include <initializer_list>
#include <cstddef> #include <cstddef>
@ -26,13 +26,13 @@ namespace rotgen
#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) #define TRANSCLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
#include <rotgen/impl/matrix_model.hpp> #include <rotgen/container/matrix/dynamic/model.hpp>
#undef CLASSNAME #undef CLASSNAME
#undef TRANSCLASSNAME #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) #define TRANSCLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
#include <rotgen/impl/matrix_model.hpp> #include <rotgen/container/matrix/dynamic/model.hpp>
#undef CLASSNAME #undef CLASSNAME
#undef TRANSCLASSNAME #undef TRANSCLASSNAME
@ -44,13 +44,13 @@ namespace rotgen
#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) #define TRANSCLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
#include <rotgen/impl/matrix_model.hpp> #include <rotgen/container/matrix/dynamic/model.hpp>
#undef CLASSNAME #undef CLASSNAME
#undef TRANSCLASSNAME #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) #define TRANSCLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
#include <rotgen/impl/matrix_model.hpp> #include <rotgen/container/matrix/dynamic/model.hpp>
#undef CLASSNAME #undef CLASSNAME
#undef TRANSCLASSNAME #undef TRANSCLASSNAME

View file

@ -7,6 +7,7 @@
//================================================================================================== //==================================================================================================
#pragma once #pragma once
#include <rotgen/detail/helpers.hpp>
#include <Eigen/Dense> #include <Eigen/Dense>
#include <iostream> #include <iostream>
@ -40,13 +41,15 @@ namespace rotgen
static constexpr int RowsAtCompileTime = Rows; static constexpr int RowsAtCompileTime = Rows;
static constexpr int ColsAtCompileTime = Cols; static constexpr int ColsAtCompileTime = Cols;
static constexpr int MaxRowsAtCompileTime = MaxRows;
static constexpr int MaxColsAtCompileTime = MaxCols;
static constexpr bool IsCompileTimeSized = Rows != -1 && Cols != -1; static constexpr bool IsCompileTimeSized = Rows != -1 && Cols != -1;
static constexpr bool IsVectorAtCompileTime = (RowsAtCompileTime == 1) || (ColsAtCompileTime == 1); static constexpr bool IsVectorAtCompileTime = (RowsAtCompileTime == 1) || (ColsAtCompileTime == 1);
static constexpr int Options = parent::Options; static constexpr int Options = parent::Options;
static constexpr bool IsRowMajor = parent::IsRowMajor; static constexpr bool IsRowMajor = parent::IsRowMajor;
template<typename ET> template<typename ET>
using as_concrete_type = as_concrete_t<ET, matrix>; using as_concrete_type = detail::as_concrete_t<ET, matrix>;
static constexpr bool is_immutable = false; static constexpr bool is_immutable = false;
static constexpr bool is_defined_static = Rows!=-1 && Cols!=-1; static constexpr bool is_defined_static = Rows!=-1 && Cols!=-1;

View file

@ -9,6 +9,23 @@
namespace rotgen::detail namespace rotgen::detail
{ {
template< typename EigenType
, template<typename,int,int,int,int,int> typename Wrapper
>
struct as_concrete
{
using type = Wrapper< typename EigenType::value_type
, EigenType::RowsAtCompileTime, EigenType::ColsAtCompileTime
, EigenType::Flags & 1
, EigenType::MaxRowsAtCompileTime, EigenType::MaxColsAtCompileTime
>;
};
template<typename EigenType
, template<typename,int,int,int,int,int> typename Wrapper
>
using as_concrete_t = typename as_concrete<std::remove_cvref_t<EigenType>,Wrapper>::type;
template<typename M, typename N> template<typename M, typename N>
inline constexpr bool has_same_vector_size = []() inline constexpr bool has_same_vector_size = []()
{ {
@ -28,10 +45,14 @@ namespace rotgen::detail
template<auto M, auto N> template<auto M, auto N>
inline constexpr auto select_static = (M==rotgen::Dynamic || N==rotgen::Dynamic) ? rotgen::Dynamic : M; inline constexpr auto select_static = (M==rotgen::Dynamic || N==rotgen::Dynamic) ? rotgen::Dynamic : M;
template<typename M1, typename M2> template< typename M1, typename M2
using composite_matrix_type = matrix< typename M1::value_type , template<typename,int,int,int,int,int> typename Wrapper
>
using composite_type = Wrapper< typename M1::value_type
, select_static<M1::RowsAtCompileTime,M2::RowsAtCompileTime> , select_static<M1::RowsAtCompileTime,M2::RowsAtCompileTime>
, select_static<M1::ColsAtCompileTime,M2::ColsAtCompileTime> , select_static<M1::ColsAtCompileTime,M2::ColsAtCompileTime>
, M1::storage_order , M1::storage_order
, select_static<M1::MaxRowsAtCompileTime,M2::MaxRowsAtCompileTime>
, select_static<M1::MaxColsAtCompileTime,M2::MaxColsAtCompileTime>
>; >;
} }

View file

@ -9,8 +9,8 @@
#include <cstddef> #include <cstddef>
#include <memory> #include <memory>
#include <rotgen/impl/matrix.hpp> #include <rotgen/container/matrix/dynamic/impl.hpp>
#include <rotgen/impl/map.hpp> #include <rotgen/container/map/dynamic/impl.hpp>
#include <Eigen/Dense> #include <Eigen/Dense>
#include <Eigen/Core> #include <Eigen/Core>

14
include/rotgen/format.hpp Normal file
View file

@ -0,0 +1,14 @@
//==================================================================================================
/*
ROTGEN - Runtime Overlay for Eigen
Copyright : CODE RECKONS
SPDX-License-Identifier: BSL-1.0
*/
//==================================================================================================
#pragma once
#if defined(ROTGEN_FORCE_DYNAMIC)
#include <rotgen/format/dynamic.hpp>
#else
#include <rotgen/format/fixed.hpp>
#endif

View file

@ -9,6 +9,7 @@
#include <rotgen/config.hpp> #include <rotgen/config.hpp>
#include <rotgen/concepts.hpp> #include <rotgen/concepts.hpp>
#include <Eigen/Core>
#include <memory> #include <memory>
#include <string> #include <string>

View file

@ -7,325 +7,7 @@
//================================================================================================== //==================================================================================================
#pragma once #pragma once
#include <rotgen/detail/helpers.hpp> #include <rotgen/functions/extract.hpp>
#include <rotgen/functions/functions.hpp>
namespace rotgen #include <rotgen/functions/operators.hpp>
{ #include <rotgen/functions/reshaper.hpp>
//-----------------------------------------------------------------------------------------------
// Infos & Shape
//-----------------------------------------------------------------------------------------------
std::size_t rows(auto const& m) requires(requires{ m.rows(); }){ return m.rows(); }
std::size_t cols(auto const& m) requires(requires{ m.cols(); }){ return m.cols(); }
std::size_t size(auto const& m) requires(requires{ m.size(); }){ return m.size(); }
void resize(auto& a, int s) requires requires{a.resize(s);} { a.resize(s); }
void resize(auto& a, int r, int c) requires requires{a.resize(r,c);} { a.resize(r,c); }
void conservativeResize(auto& a, int s) requires requires{a.conservativeResize(s);}
{
a.conservativeResize(s);
}
void conservativeResize(auto& a, int r, int c) requires requires{a.conservativeResize(r,c);}
{
a.conservativeResize(r, c);
}
//-----------------------------------------------------------------------------------------------
// Global operations
//-----------------------------------------------------------------------------------------------
decltype(auto) normalized (auto const& m) requires(requires{ m.normalized(); }) { return m.normalized(); }
decltype(auto) transpose (auto const& m) requires(requires{ m.transpose(); }) { return m.transpose(); }
decltype(auto) conjugate (auto const& m) requires(requires{ m.conjugate(); }) { return m.conjugate(); }
decltype(auto) adjoint (auto const& m) requires(requires{ m.adjoint(); }) { return m.adjoint(); }
void normalize(auto& a) requires(requires{ a.normalize(); }) { a.normalize(); }
void transposeInPlace(auto& a) requires(requires{ a.transposeInPlace(); }) { a.transposeInPlace(); }
void adjointInPlace(auto& a) requires(requires{ a.adjointInPlace(); }) { a.adjointInPlace(); }
//-----------------------------------------------------------------------------------------------
// Component-wise functions
//-----------------------------------------------------------------------------------------------
auto abs (auto const& arg) requires(requires{arg.cwiseAbs();} ) { return arg.cwiseAbs(); }
auto abs2(auto const& arg) requires(requires{arg.cwiseAbs2();} ) { return arg.cwiseAbs2(); }
auto rec (auto const& arg) requires(requires{arg.cwiseInverse();}) { return arg.cwiseInverse(); }
auto sqrt(auto const& arg) requires(requires{arg.cwiseSqrt();} ) { return arg.cwiseSqrt(); }
template<concepts::entity A, concepts::entity B>
auto min(A const& a, B const& b)
{
if constexpr(!use_expression_templates) return min(generalize_t<A const>(a), generalize_t<B const>(b));
else return base_of(a).cwiseMin(base_of(b));
}
template<concepts::entity A>
auto min(A const& a, std::convertible_to<typename A::value_type> auto b)
{
if constexpr(!use_expression_templates) return min(generalize_t<A const>(a), b);
else return base_of(a).cwiseMin(b);
}
template<concepts::entity B>
auto min(std::convertible_to<typename B::value_type> auto a, B const& b)
{
if constexpr(!use_expression_templates) return min(a,generalize_t<B const>(b));
else return base_of(b).cwiseMin(a);
}
template<concepts::entity A, concepts::entity B>
auto max(A const& a, B const& b)
{
if constexpr(!use_expression_templates) return max(generalize_t<A const>(a), generalize_t<B const>(b));
else return base_of(a).cwiseMax(base_of(b));
}
template<concepts::entity A>
auto max(A const& a, std::convertible_to<typename A::value_type> auto b)
{
if constexpr(!use_expression_templates) return max(generalize_t<A const>(a), b);
else return base_of(a).cwiseMax(b);
}
template<concepts::entity B>
auto max(std::convertible_to<typename B::value_type> auto a, B const& b)
{
if constexpr(!use_expression_templates) return max(a, generalize_t<B const>(b));
else return base_of(b).cwiseMax(a);
}
template<concepts::entity A, concepts::entity B>
auto mul(A const& a, B const& b)
{
if constexpr(!use_expression_templates) return mul(generalize_t<A const>(a), generalize_t<B const>(b));
else return base_of(a).cwiseProduct(base_of(b));
}
template<concepts::entity A>
auto mul(A const& a, std::convertible_to<typename A::value_type> auto b)
{
return a * b;
}
template<concepts::entity B>
auto mul(std::convertible_to<typename B::value_type> auto a, B const& b)
{
return a * b;
}
template<concepts::entity A, concepts::entity B>
auto div(A const& a, B const& b)
{
if constexpr(!use_expression_templates) return div(generalize_t<A const>(a), generalize_t<B const>(b));
else return base_of(a).array() / base_of(b).array();
}
template<concepts::entity A>
auto div(A const& a, std::convertible_to<typename A::value_type> auto b)
{
return a / b;
}
//-----------------------------------------------------------------------------------------------
// Reductions
//-----------------------------------------------------------------------------------------------
auto trace(concepts::entity auto const& arg) { return arg.trace(); }
auto squaredNorm(concepts::entity auto const& arg) { return arg.squaredNorm(); }
auto norm(concepts::entity auto const& arg) { return arg.norm(); }
auto sum(auto const& arg) requires requires{ arg.sum(); } { return arg.sum(); }
auto prod(concepts::entity auto const& arg) { return arg.prod(); }
auto mean(concepts::entity auto const& arg) { return arg.mean(); }
template<concepts::entity A, concepts::entity B>
auto dot(A const& a, B const& b)
requires(detail::has_same_vector_size<A,B> && std::same_as<typename A::value_type, typename B::value_type>)
{
if constexpr(!use_expression_templates) return dot(generalize_t<A const>(a), generalize_t<B const>(b));
else return base_of(a).dot(base_of(b));
}
auto maxCoeff(auto const& arg) requires( requires{ arg.maxCoeff(); } ) { return arg.maxCoeff(); }
auto minCoeff(auto const& arg) requires( requires{ arg.minCoeff(); } ) { return arg.minCoeff(); }
template<std::integral IndexType>
auto maxCoeff(concepts::entity auto const& arg, IndexType* row, IndexType* col)
{
return arg.maxCoeff(row, col);
}
template<std::integral IndexType>
auto minCoeff(concepts::entity auto const& arg, IndexType* row, IndexType* col)
{
return arg.minCoeff(row, col);
}
template<int P, typename T>
auto lpNorm(T const& arg) requires( requires{arg.template lpNorm<P>();} )
{
static_assert(P == 1 || P == 2 || P == Infinity);
return arg.template lpNorm<P>();
}
//-----------------------------------------------------------------------------------------------
// Expression handling
//-----------------------------------------------------------------------------------------------
template<typename T>
decltype(auto) noalias(T&& t) requires( requires{std::forward<T>(t).noalias();} )
{
return std::forward<T>(t).noalias();
}
template<typename T>
auto evaluate(T&& t) requires( requires{std::forward<T>(t).evaluate();} )
{
return std::forward<T>(t).evaluate();
}
template<typename T>
auto evaluate(T&& t) requires( requires{std::forward<T>(t).eval();} )
{
return std::forward<T>(t).eval();
}
//-----------------------------------------------------------------------------------------------
// Generators
//-----------------------------------------------------------------------------------------------
template<typename T>
auto setZero(T&& t) requires( requires{std::forward<T>(t).setZero();} )
{
return std::forward<T>(t).setZero();
}
template<typename T>
auto setZero() requires( requires{T::Zero();} )
{
return T::Zero();
}
template<typename T>
auto setZero(std::integral auto n) requires( requires{T::Zero(n);} )
{
return T::Zero(n);
}
template<typename T>
auto setZero(std::integral auto r,std::integral auto c) requires( requires{T::Zero(r,c);} )
{
return T::Zero(r,c);
}
template<typename T>
auto setOnes(T&& t) requires( requires{std::forward<T>(t).setOnes();} )
{
return std::forward<T>(t).setOnes();
}
template<typename T>
auto setOnes() requires( requires{T::Ones();} )
{
return T::Ones();
}
template<typename T>
auto setOnes(std::integral auto n) requires( requires{T::Ones(n);} )
{
return T::Ones(n);
}
template<typename T>
auto setOnes(std::integral auto r,std::integral auto c) requires( requires{T::Ones(r,c);} )
{
return T::Ones(r,c);
}
template<typename T>
auto setIdentity(T&& t) requires( requires{std::forward<T>(t).setIdentity();} )
{
return std::forward<T>(t).setIdentity();
}
template<typename T>
auto setIdentity() requires( requires{T::Identity();} )
{
return T::Identity();
}
template<typename T>
auto setIdentity(std::integral auto n) requires( requires{T::Identity(n);} )
{
return T::Identity(n);
}
template<typename T>
auto setIdentity(std::integral auto r,std::integral auto c) requires( requires{T::Identity(r,c);} )
{
return T::Identity(r,c);
}
template<typename T>
auto setRandom(T&& t) requires( requires{std::forward<T>(t).setRandom();} )
{
return std::forward<T>(t).setRandom();
}
template<typename T>
auto setRandom() requires( requires{T::Random();} )
{
return T::Random();
}
template<typename T>
auto setRandom(std::integral auto n) requires( requires{T::Random(n);} )
{
return T::Random(n);
}
template<typename T>
auto setRandom(std::integral auto r,std::integral auto c) requires( requires{T::Random(r,c);} )
{
return T::Random(r,c);
}
template<typename T>
auto setConstant(T&& t, auto v) requires( requires{std::forward<T>(t).setConstant(v);} )
{
return std::forward<T>(t).setConstant(v);
}
template<typename T>
auto setConstant(auto v) requires( requires{T::Constant(v);} )
{
return T::Constant(v);
}
template<typename T>
auto setConstant(std::integral auto n, auto v) requires( requires{T::Constant(n,v);} )
{
return T::Constant(n,v);
}
template<typename T>
auto setConstant(std::integral auto r,std::integral auto c, auto v) requires( requires{T::Constant(r,c,v);} )
{
return T::Constant(r,c,v);
}
//-----------------------------------------------------------------------------------------------
// Others
// TODO: Adapt other functions ot behave as inverse and limit code in non-ref/non-map containers
//-----------------------------------------------------------------------------------------------
template<typename A> auto inverse(A const& a)
{
if constexpr(!use_expression_templates) return inverse(generalize_t<A const>(a));
else if constexpr(requires{typename A::rotgen_tag;}) return base_of(a).inverse();
else return a.inverse();
}
template<concepts::vectorND<3> L, concepts::vectorND<3> R> auto cross(L const& l, R const& r)
{
if constexpr(!use_expression_templates)
return cross(generalize_t<R const>(l),generalize_t<R const>(r));
else if constexpr(requires{typename L::rotgen_tag;} || requires{typename R::rotgen_tag;} )
return base_of(l).cross(base_of(r));
else return l.cross(r);
}
}

View file

@ -0,0 +1,331 @@
//==================================================================================================
/*
ROTGEN - Runtime Overlay for Eigen
Copyright : CODE RECKONS
SPDX-License-Identifier: BSL-1.0
*/
//==================================================================================================
#pragma once
#include <rotgen/detail/helpers.hpp>
namespace rotgen
{
//-----------------------------------------------------------------------------------------------
// Infos & Shape
//-----------------------------------------------------------------------------------------------
std::size_t rows(auto const& m) requires(requires{ m.rows(); }){ return m.rows(); }
std::size_t cols(auto const& m) requires(requires{ m.cols(); }){ return m.cols(); }
std::size_t size(auto const& m) requires(requires{ m.size(); }){ return m.size(); }
void resize(auto& a, int s) requires requires{a.resize(s);} { a.resize(s); }
void resize(auto& a, int r, int c) requires requires{a.resize(r,c);} { a.resize(r,c); }
void conservativeResize(auto& a, int s) requires requires{a.conservativeResize(s);}
{
a.conservativeResize(s);
}
void conservativeResize(auto& a, int r, int c) requires requires{a.conservativeResize(r,c);}
{
a.conservativeResize(r, c);
}
//-----------------------------------------------------------------------------------------------
// Global operations
//-----------------------------------------------------------------------------------------------
decltype(auto) normalized (auto const& m) requires(requires{ m.normalized(); }) { return m.normalized(); }
decltype(auto) transpose (auto const& m) requires(requires{ m.transpose(); }) { return m.transpose(); }
decltype(auto) conjugate (auto const& m) requires(requires{ m.conjugate(); }) { return m.conjugate(); }
decltype(auto) adjoint (auto const& m) requires(requires{ m.adjoint(); }) { return m.adjoint(); }
void normalize(auto& a) requires(requires{ a.normalize(); }) { a.normalize(); }
void transposeInPlace(auto& a) requires(requires{ a.transposeInPlace(); }) { a.transposeInPlace(); }
void adjointInPlace(auto& a) requires(requires{ a.adjointInPlace(); }) { a.adjointInPlace(); }
//-----------------------------------------------------------------------------------------------
// Component-wise functions
//-----------------------------------------------------------------------------------------------
auto abs (auto const& arg) requires(requires{arg.cwiseAbs();} ) { return arg.cwiseAbs(); }
auto abs2(auto const& arg) requires(requires{arg.cwiseAbs2();} ) { return arg.cwiseAbs2(); }
auto rec (auto const& arg) requires(requires{arg.cwiseInverse();}) { return arg.cwiseInverse(); }
auto sqrt(auto const& arg) requires(requires{arg.cwiseSqrt();} ) { return arg.cwiseSqrt(); }
template<concepts::entity A, concepts::entity B>
auto min(A const& a, B const& b)
{
if constexpr(!use_expression_templates) return min(generalize_t<A const>(a), generalize_t<B const>(b));
else return base_of(a).cwiseMin(base_of(b));
}
template<concepts::entity A>
auto min(A const& a, std::convertible_to<typename A::value_type> auto b)
{
if constexpr(!use_expression_templates) return min(generalize_t<A const>(a), b);
else return base_of(a).cwiseMin(b);
}
template<concepts::entity B>
auto min(std::convertible_to<typename B::value_type> auto a, B const& b)
{
if constexpr(!use_expression_templates) return min(a,generalize_t<B const>(b));
else return base_of(b).cwiseMin(a);
}
template<concepts::entity A, concepts::entity B>
auto max(A const& a, B const& b)
{
if constexpr(!use_expression_templates) return max(generalize_t<A const>(a), generalize_t<B const>(b));
else return base_of(a).cwiseMax(base_of(b));
}
template<concepts::entity A>
auto max(A const& a, std::convertible_to<typename A::value_type> auto b)
{
if constexpr(!use_expression_templates) return max(generalize_t<A const>(a), b);
else return base_of(a).cwiseMax(b);
}
template<concepts::entity B>
auto max(std::convertible_to<typename B::value_type> auto a, B const& b)
{
if constexpr(!use_expression_templates) return max(a, generalize_t<B const>(b));
else return base_of(b).cwiseMax(a);
}
template<concepts::entity A, concepts::entity B>
auto mul(A const& a, B const& b)
{
if constexpr(!use_expression_templates) return mul(generalize_t<A const>(a), generalize_t<B const>(b));
else return base_of(a).cwiseProduct(base_of(b));
}
template<concepts::entity A>
auto mul(A const& a, std::convertible_to<typename A::value_type> auto b)
{
return a * b;
}
template<concepts::entity B>
auto mul(std::convertible_to<typename B::value_type> auto a, B const& b)
{
return a * b;
}
template<concepts::entity A, concepts::entity B>
auto div(A const& a, B const& b)
{
if constexpr(!use_expression_templates) return div(generalize_t<A const>(a), generalize_t<B const>(b));
else return base_of(a).array() / base_of(b).array();
}
template<concepts::entity A>
auto div(A const& a, std::convertible_to<typename A::value_type> auto b)
{
return a / b;
}
//-----------------------------------------------------------------------------------------------
// Reductions
//-----------------------------------------------------------------------------------------------
auto trace(concepts::entity auto const& arg) { return arg.trace(); }
auto squaredNorm(concepts::entity auto const& arg) { return arg.squaredNorm(); }
auto norm(concepts::entity auto const& arg) { return arg.norm(); }
auto sum(auto const& arg) requires requires{ arg.sum(); } { return arg.sum(); }
auto prod(concepts::entity auto const& arg) { return arg.prod(); }
auto mean(concepts::entity auto const& arg) { return arg.mean(); }
template<concepts::entity A, concepts::entity B>
auto dot(A const& a, B const& b)
requires(detail::has_same_vector_size<A,B> && std::same_as<typename A::value_type, typename B::value_type>)
{
if constexpr(!use_expression_templates) return dot(generalize_t<A const>(a), generalize_t<B const>(b));
else return base_of(a).dot(base_of(b));
}
auto maxCoeff(auto const& arg) requires( requires{ arg.maxCoeff(); } ) { return arg.maxCoeff(); }
auto minCoeff(auto const& arg) requires( requires{ arg.minCoeff(); } ) { return arg.minCoeff(); }
template<std::integral IndexType>
auto maxCoeff(concepts::entity auto const& arg, IndexType* row, IndexType* col)
{
return arg.maxCoeff(row, col);
}
template<std::integral IndexType>
auto minCoeff(concepts::entity auto const& arg, IndexType* row, IndexType* col)
{
return arg.minCoeff(row, col);
}
template<int P, typename T>
auto lpNorm(T const& arg) requires( requires{arg.template lpNorm<P>();} )
{
static_assert(P == 1 || P == 2 || P == Infinity);
return arg.template lpNorm<P>();
}
//-----------------------------------------------------------------------------------------------
// Expression handling
//-----------------------------------------------------------------------------------------------
template<typename T>
decltype(auto) noalias(T&& t) requires( requires{std::forward<T>(t).noalias();} )
{
return std::forward<T>(t).noalias();
}
template<typename T>
auto evaluate(T&& t) requires( requires{std::forward<T>(t).evaluate();} )
{
return std::forward<T>(t).evaluate();
}
template<typename T>
auto evaluate(T&& t) requires( requires{std::forward<T>(t).eval();} )
{
return std::forward<T>(t).eval();
}
//-----------------------------------------------------------------------------------------------
// Generators
//-----------------------------------------------------------------------------------------------
template<typename T>
auto setZero(T&& t) requires( requires{std::forward<T>(t).setZero();} )
{
return std::forward<T>(t).setZero();
}
template<typename T>
auto setZero() requires( requires{T::Zero();} )
{
return T::Zero();
}
template<typename T>
auto setZero(std::integral auto n) requires( requires{T::Zero(n);} )
{
return T::Zero(n);
}
template<typename T>
auto setZero(std::integral auto r,std::integral auto c) requires( requires{T::Zero(r,c);} )
{
return T::Zero(r,c);
}
template<typename T>
auto setOnes(T&& t) requires( requires{std::forward<T>(t).setOnes();} )
{
return std::forward<T>(t).setOnes();
}
template<typename T>
auto setOnes() requires( requires{T::Ones();} )
{
return T::Ones();
}
template<typename T>
auto setOnes(std::integral auto n) requires( requires{T::Ones(n);} )
{
return T::Ones(n);
}
template<typename T>
auto setOnes(std::integral auto r,std::integral auto c) requires( requires{T::Ones(r,c);} )
{
return T::Ones(r,c);
}
template<typename T>
auto setIdentity(T&& t) requires( requires{std::forward<T>(t).setIdentity();} )
{
return std::forward<T>(t).setIdentity();
}
template<typename T>
auto setIdentity() requires( requires{T::Identity();} )
{
return T::Identity();
}
template<typename T>
auto setIdentity(std::integral auto n) requires( requires{T::Identity(n);} )
{
return T::Identity(n);
}
template<typename T>
auto setIdentity(std::integral auto r,std::integral auto c) requires( requires{T::Identity(r,c);} )
{
return T::Identity(r,c);
}
template<typename T>
auto setRandom(T&& t) requires( requires{std::forward<T>(t).setRandom();} )
{
return std::forward<T>(t).setRandom();
}
template<typename T>
auto setRandom() requires( requires{T::Random();} )
{
return T::Random();
}
template<typename T>
auto setRandom(std::integral auto n) requires( requires{T::Random(n);} )
{
return T::Random(n);
}
template<typename T>
auto setRandom(std::integral auto r,std::integral auto c) requires( requires{T::Random(r,c);} )
{
return T::Random(r,c);
}
template<typename T>
auto setConstant(T&& t, auto v) requires( requires{std::forward<T>(t).setConstant(v);} )
{
return std::forward<T>(t).setConstant(v);
}
template<typename T>
auto setConstant(auto v) requires( requires{T::Constant(v);} )
{
return T::Constant(v);
}
template<typename T>
auto setConstant(std::integral auto n, auto v) requires( requires{T::Constant(n,v);} )
{
return T::Constant(n,v);
}
template<typename T>
auto setConstant(std::integral auto r,std::integral auto c, auto v) requires( requires{T::Constant(r,c,v);} )
{
return T::Constant(r,c,v);
}
//-----------------------------------------------------------------------------------------------
// Others
// TODO: Adapt other functions ot behave as inverse and limit code in non-ref/non-map containers
//-----------------------------------------------------------------------------------------------
template<typename A> auto inverse(A const& a)
{
if constexpr(!use_expression_templates) return inverse(generalize_t<A const>(a));
else if constexpr(requires{typename A::rotgen_tag;}) return base_of(a).inverse();
else return a.inverse();
}
template<concepts::vectorND<3> L, concepts::vectorND<3> R> auto cross(L const& l, R const& r)
{
if constexpr(!use_expression_templates)
return cross(generalize_t<R const>(l),generalize_t<R const>(r));
else if constexpr(requires{typename L::rotgen_tag;} || requires{typename R::rotgen_tag;} )
return base_of(l).cross(base_of(r));
else return l.cross(r);
}
}

View file

@ -8,28 +8,8 @@
#pragma once #pragma once
#include <rotgen/config.hpp> #include <rotgen/config.hpp>
#include <rotgen/concepts.hpp> #include <rotgen/format.hpp>
#include <rotgen/common/traits.hpp> #include <rotgen/container.hpp>
#include <rotgen/common/strides.hpp>
#if defined(ROTGEN_FORCE_DYNAMIC)
#include <rotgen/dynamic/matrix.hpp>
#include <rotgen/dynamic/block.hpp>
#include <rotgen/dynamic/map.hpp>
#include <rotgen/dynamic/svd.hpp>
#include <rotgen/dynamic/format.hpp>
#else
#include <rotgen/fixed/matrix.hpp>
#include <rotgen/fixed/block.hpp>
#include <rotgen/fixed/map.hpp>
#include <rotgen/fixed/svd.hpp>
#include <rotgen/fixed/format.hpp>
#endif
#include <rotgen/common/ref.hpp>
#include <rotgen/extract.hpp>
#include <rotgen/functions.hpp>
#include <rotgen/operators.hpp>
#include <rotgen/common/reshaper.hpp>
#include <rotgen/solver.hpp>
#include <rotgen/alias.hpp> #include <rotgen/alias.hpp>
#include <rotgen/algebra.hpp>
#include <rotgen/functions.hpp>

View file

@ -13,7 +13,7 @@
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col) #define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
#define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row) #define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
#define MAPNAME ROTGEN_MATRIX_NAME(BASEMAP,SIZE,_col) #define MAPNAME ROTGEN_MATRIX_NAME(BASEMAP,SIZE,_col)
#include "block_model.cpp" #include "model.cpp"
#undef CLASSNAME #undef CLASSNAME
#undef TRANSSOURCENAME #undef TRANSSOURCENAME
#undef SOURCENAME #undef SOURCENAME
@ -25,7 +25,7 @@
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row) #define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
#define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col) #define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
#define MAPNAME ROTGEN_MATRIX_NAME(BASEMAP,SIZE,_row) #define MAPNAME ROTGEN_MATRIX_NAME(BASEMAP,SIZE,_row)
#include "block_model.cpp" #include "model.cpp"
#undef CLASSNAME #undef CLASSNAME
#undef TRANSSOURCENAME #undef TRANSSOURCENAME
#undef SOURCENAME #undef SOURCENAME
@ -43,7 +43,7 @@
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col) #define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
#define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row) #define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
#define MAPNAME ROTGEN_MATRIX_NAME(BASEMAP,SIZE,_col) #define MAPNAME ROTGEN_MATRIX_NAME(BASEMAP,SIZE,_col)
#include "block_model.cpp" #include "model.cpp"
#undef CLASSNAME #undef CLASSNAME
#undef TRANSSOURCENAME #undef TRANSSOURCENAME
#undef SOURCENAME #undef SOURCENAME
@ -55,7 +55,7 @@
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row) #define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
#define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col) #define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
#define MAPNAME ROTGEN_MATRIX_NAME(BASEMAP,SIZE,_row) #define MAPNAME ROTGEN_MATRIX_NAME(BASEMAP,SIZE,_row)
#include "block_model.cpp" #include "model.cpp"
#undef CLASSNAME #undef CLASSNAME
#undef TRANSSOURCENAME #undef TRANSSOURCENAME
#undef SOURCENAME #undef SOURCENAME

View file

@ -6,8 +6,8 @@
*/ */
//================================================================================================== //==================================================================================================
#include <rotgen/detail/generators.hpp> #include <rotgen/detail/generators.hpp>
#include <rotgen/impl/block.hpp> #include <rotgen/container/block/dynamic/impl.hpp>
#include <rotgen/impl/payload.hpp> #include <rotgen/detail/payload.hpp>
#include <Eigen/Dense> #include <Eigen/Dense>
#include <variant> #include <variant>
@ -17,7 +17,7 @@ namespace rotgen
#define CONST const #define CONST const
#define BASENAME block_const_impl #define BASENAME block_const_impl
#define BASEMAP map_const_impl #define BASEMAP map_const_impl
#include "block_indirect.cpp" #include "generate.cpp"
#undef BASENAME #undef BASENAME
#undef BASEMAP #undef BASEMAP
#undef USE_CONST #undef USE_CONST
@ -26,7 +26,7 @@ namespace rotgen
#define CONST #define CONST
#define BASENAME block_impl #define BASENAME block_impl
#define BASEMAP map_impl #define BASEMAP map_impl
#include "block_indirect.cpp" #include "generate.cpp"
#undef BASENAME #undef BASENAME
#undef BASEMAP #undef BASEMAP
#undef CONST #undef CONST

View file

@ -7,8 +7,8 @@
//================================================================================================== //==================================================================================================
#include <rotgen/config.hpp> #include <rotgen/config.hpp>
#include <rotgen/dynamic/format.hpp> #include <rotgen/format/dynamic.hpp>
#include <rotgen/impl/payload.hpp> #include <rotgen/detail/payload.hpp>
#include <Eigen/Core> #include <Eigen/Core>
#include <string> #include <string>

View file

@ -7,7 +7,6 @@
*/ */
//================================================================================================== //==================================================================================================
#include <rotgen/config.hpp> #include <rotgen/config.hpp>
#include <rotgen/common/export.hpp>
namespace rotgen::detail namespace rotgen::detail
{ {

View file

@ -14,7 +14,7 @@
#define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,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 "model.cpp"
#undef CLASSNAME #undef CLASSNAME
#undef TRANSCLASSNAME #undef TRANSCLASSNAME
#undef TRANSSOURCENAME #undef TRANSSOURCENAME
@ -28,7 +28,7 @@
#define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,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 "model.cpp"
#undef CLASSNAME #undef CLASSNAME
#undef TRANSCLASSNAME #undef TRANSCLASSNAME
#undef TRANSSOURCENAME #undef TRANSSOURCENAME
@ -48,7 +48,7 @@
#define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,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 "model.cpp"
#undef CLASSNAME #undef CLASSNAME
#undef TRANSCLASSNAME #undef TRANSCLASSNAME
#undef TRANSSOURCENAME #undef TRANSSOURCENAME
@ -62,7 +62,7 @@
#define TRANSSOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,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 "model.cpp"
#undef CLASSNAME #undef CLASSNAME
#undef TRANSCLASSNAME #undef TRANSCLASSNAME
#undef TRANSSOURCENAME #undef TRANSSOURCENAME

View file

@ -6,8 +6,8 @@
*/ */
//================================================================================================== //==================================================================================================
#include <rotgen/detail/generators.hpp> #include <rotgen/detail/generators.hpp>
#include <rotgen/impl/map.hpp> #include <rotgen/container/map/dynamic/impl.hpp>
#include <rotgen/impl/payload.hpp> #include <rotgen/detail/payload.hpp>
#include <Eigen/Dense> #include <Eigen/Dense>
#include <Eigen/LU> #include <Eigen/LU>
@ -16,14 +16,16 @@ namespace rotgen
#define USE_CONST #define USE_CONST
#define CONST const #define CONST const
#define BASENAME map_const_impl #define BASENAME map_const_impl
#include "map_indirect.cpp" #include "generate.cpp"
#undef BASENAME #undef BASENAME
#undef USE_CONST #undef USE_CONST
#undef CONST #undef CONST
#define CONST #define CONST
#define BASENAME map_impl #define BASENAME map_impl
#include "map_indirect.cpp" #include "generate.cpp"
#undef BASENAME #undef BASENAME
#undef CONST #undef CONST
} }
#include "operators.cpp"

View file

@ -6,8 +6,8 @@
*/ */
//================================================================================================== //==================================================================================================
#include <rotgen/impl/map.hpp> #include <rotgen/container/map/dynamic/impl.hpp>
#include <rotgen/impl/payload.hpp> #include <rotgen/detail/payload.hpp>
#include <Eigen/Dense> #include <Eigen/Dense>
#define ROTGEN_IMPL_OP(OP,FN,RET) \ #define ROTGEN_IMPL_OP(OP,FN,RET) \
@ -29,12 +29,9 @@ namespace rotgen
{ {
namespace 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 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; } bool not_equal(auto const& a, auto const& b) { return a.storage()->data != b.storage()->data; }
} }
ROTGEN_IMPL_OP(==, equal , bool); ROTGEN_IMPL_OP(==, equal , bool);
ROTGEN_IMPL_OP(!=, not_equal, bool); ROTGEN_IMPL_OP(!=, not_equal, bool);
} }

View file

@ -6,8 +6,8 @@
*/ */
//================================================================================================== //==================================================================================================
#include <rotgen/detail/generators.hpp> #include <rotgen/detail/generators.hpp>
#include <rotgen/impl/matrix.hpp> #include <rotgen/container/matrix/dynamic/impl.hpp>
#include <rotgen/impl/payload.hpp> #include <rotgen/detail/payload.hpp>
#include <rotgen/config.hpp> #include <rotgen/config.hpp>
#include <Eigen/Dense> #include <Eigen/Dense>
@ -19,7 +19,7 @@ namespace rotgen
#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) #define TRANSCLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
#include "matrix_model.cpp" #include "model.cpp"
#undef CLASSNAME #undef CLASSNAME
#undef TRANSCLASSNAME #undef TRANSCLASSNAME
#undef STORAGE_ORDER #undef STORAGE_ORDER
@ -27,7 +27,7 @@ namespace rotgen
#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) #define TRANSCLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
#include "matrix_model.cpp" #include "model.cpp"
#undef CLASSNAME #undef CLASSNAME
#undef TRANSCLASSNAME #undef TRANSCLASSNAME
#undef STORAGE_ORDER #undef STORAGE_ORDER
@ -41,7 +41,7 @@ namespace rotgen
#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) #define TRANSCLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
#include "matrix_model.cpp" #include "model.cpp"
#undef CLASSNAME #undef CLASSNAME
#undef TRANSCLASSNAME #undef TRANSCLASSNAME
#undef STORAGE_ORDER #undef STORAGE_ORDER
@ -49,7 +49,7 @@ namespace rotgen
#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) #define TRANSCLASSNAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
#include "matrix_model.cpp" #include "model.cpp"
#undef CLASSNAME #undef CLASSNAME
#undef TRANSCLASSNAME #undef TRANSCLASSNAME
#undef STORAGE_ORDER #undef STORAGE_ORDER

View file

@ -6,9 +6,9 @@
*/ */
//================================================================================================== //==================================================================================================
#include <rotgen/detail/generators.hpp> #include <rotgen/detail/generators.hpp>
#include <rotgen/impl/matrix.hpp> #include <rotgen/container/matrix/dynamic/impl.hpp>
#include <rotgen/impl/payload.hpp> #include <rotgen/algebra/svd/dynamic/impl.hpp>
#include <rotgen/impl/svd.hpp> #include <rotgen/detail/payload.hpp>
#include <rotgen/config.hpp> #include <rotgen/config.hpp>
#include <Eigen/Dense> #include <Eigen/Dense>
#include <Eigen/SVD> #include <Eigen/SVD>
@ -21,7 +21,7 @@ namespace rotgen
#define CLASSNAME ROTGEN_MATRIX_NAME(svd_impl,SIZE,_col) #define CLASSNAME ROTGEN_MATRIX_NAME(svd_impl,SIZE,_col)
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col) #define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
#include "svd_model.cpp" #include "model.cpp"
#undef CLASSNAME #undef CLASSNAME
#undef SOURCENAME #undef SOURCENAME
#undef STORAGE_ORDER #undef STORAGE_ORDER
@ -29,7 +29,7 @@ namespace rotgen
#define STORAGE_ORDER Eigen::RowMajor #define STORAGE_ORDER Eigen::RowMajor
#define CLASSNAME ROTGEN_MATRIX_NAME(svd_impl,SIZE,_row) #define CLASSNAME ROTGEN_MATRIX_NAME(svd_impl,SIZE,_row)
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row) #define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
#include "svd_model.cpp" #include "model.cpp"
#undef CLASSNAME #undef CLASSNAME
#undef SOURCENAME #undef SOURCENAME
#undef STORAGE_ORDER #undef STORAGE_ORDER
@ -43,7 +43,7 @@ namespace rotgen
#define CLASSNAME ROTGEN_MATRIX_NAME(svd_impl,SIZE,_col) #define CLASSNAME ROTGEN_MATRIX_NAME(svd_impl,SIZE,_col)
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col) #define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
#include "svd_model.cpp" #include "model.cpp"
#undef CLASSNAME #undef CLASSNAME
#undef SOURCENAME #undef SOURCENAME
#undef STORAGE_ORDER #undef STORAGE_ORDER
@ -51,7 +51,7 @@ namespace rotgen
#define STORAGE_ORDER Eigen::RowMajor #define STORAGE_ORDER Eigen::RowMajor
#define CLASSNAME ROTGEN_MATRIX_NAME(svd_impl,SIZE,_row) #define CLASSNAME ROTGEN_MATRIX_NAME(svd_impl,SIZE,_row)
#define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row) #define SOURCENAME ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
#include "svd_model.cpp" #include "model.cpp"
#undef CLASSNAME #undef CLASSNAME
#undef SOURCENAME #undef SOURCENAME
#undef STORAGE_ORDER #undef STORAGE_ORDER