Implement fixed size options for rotgen containers

See merge request oss/rotgen!11
This commit is contained in:
Joel Falcou 2025-07-20 20:23:51 +02:00
parent 8e545dd51a
commit 2084874b1b
39 changed files with 1247 additions and 323 deletions

View file

@ -6,8 +6,11 @@
*/
//==================================================================================================
#define TTS_MAIN
#define TTS_CUSTOM_DRIVER_FUNCTION rotgen_main
#include "tts.hpp"
#include <rotgen/detail/static_info.hpp>
#include <rotgen/config.hpp>
#include <rotgen/concepts.hpp>
#include <functional>
namespace rotgen::tests
@ -25,25 +28,50 @@ namespace rotgen::tests
struct matrix_descriptor
{
std::size_t rows, cols;
rotgen::Index rows, cols;
std::function<double(std::size_t,std::size_t)> init_fn;
};
template<typename MatrixType>
struct matrix_block_test_case
{
std::size_t rows, cols;
std::function<typename MatrixType::scalar_type(std::size_t, std::size_t)> init_fn;
std::size_t i0, j0, ni, nj;
rotgen::Index rows, cols;
std::function<typename MatrixType::scalar_type(std::size_t, rotgen::Index)> init_fn;
rotgen::Index i0, j0, ni, nj;
};
template<typename MatrixType, std::size_t NI, std::size_t NJ>
template<typename MatrixType, rotgen::Index NI, rotgen::Index NJ>
struct static_matrix_block_test_case
{
std::size_t rows, cols;
std::function<typename MatrixType::scalar_type(std::size_t, std::size_t)> init_fn;
static constexpr std::size_t ni = NI;
static constexpr std::size_t nj = NJ;
std::size_t i0, j0;
rotgen::Index rows, cols;
std::function<typename MatrixType::scalar_type(std::size_t, rotgen::Index)> init_fn;
static constexpr rotgen::Index ni = NI;
static constexpr rotgen::Index nj = NJ;
rotgen::Index i0, j0;
};
}
#include <iostream>
template<typename T>
constexpr bool verify_rotgen_reentrance(T const&)
{
return rotgen::concepts::entity<T>;
}
int main(int argc, char const **argv)
{
::tts::initialize(argc,argv);
#ifdef NDEBUG
constexpr auto assert_status = "Disabled";
#else
constexpr auto assert_status = "Enabled";
#endif
std::cout << "[ROTGEN] - Assertions: " << assert_status << std::endl;
rotgen::setup_summary(std::cout);
rotgen_main(argc, argv);
return tts::report(0,0);
}