rotgen/include/rotgen/impl/matrix.hpp
Joel Falcou 8647639c0d Merge branch 'feat/x-files' into 'main'
Use X-macros to generate all combinations of supported Eigen Matrix types

Co-authored-by: Joel Falcou <joel.falcou@lri.fr>

See merge request oss/rotgen!8
2025-05-26 14:49:20 +02:00

55 lines
1.6 KiB
C++

//==================================================================================================
/*
ROTGEN - Runtime Overlay for Eigen
Copyright : CODE RECKONS
SPDX-License-Identifier: BSL-1.0
*/
//==================================================================================================
#pragma once
#include <rotgen/detail/generators.hpp>
#include <rotgen/detail/static_info.hpp>
#include <initializer_list>
#include <cstddef>
#include <memory>
namespace rotgen
{
#define SIZE 64
#define TYPE double
#define MATRIX ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
#include <rotgen/impl/matrix_model.hpp>
#undef MATRIX
#define MATRIX ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
#include <rotgen/impl/matrix_model.hpp>
#undef MATRIX
#undef SIZE
#undef TYPE
#define SIZE 32
#define TYPE float
#define MATRIX ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_col)
#include <rotgen/impl/matrix_model.hpp>
#undef MATRIX
#define MATRIX ROTGEN_MATRIX_NAME(matrix_impl,SIZE,_row)
#include <rotgen/impl/matrix_model.hpp>
#undef MATRIX
#undef SIZE
#undef TYPE
template<typename Scalar,int Options> struct find_matrix_impl;
template<> struct find_matrix_impl<float , ColMajor> { using type = matrix_impl32_col; };
template<> struct find_matrix_impl<float , RowMajor> { using type = matrix_impl32_row; };
template<> struct find_matrix_impl<double, ColMajor> { using type = matrix_impl64_col; };
template<> struct find_matrix_impl<double, RowMajor> { using type = matrix_impl64_row; };
template<typename Scalar,int Options>
using find_matrix = typename find_matrix_impl<Scalar,(Options & 1)>::type;
}