Adding clang-format configuration file and formatting all source files

Co-authored-by: Jules Pénuchot <jules@penuchot.com>
Co-authored-by: Joel FALCOU <jfalcou@codereckons.com>

See merge request oss/rotgen!41
This commit is contained in:
Jules Pénuchot 2025-10-14 16:19:03 +02:00
parent e92e824a18
commit 648dd768ee
94 changed files with 6778 additions and 4722 deletions

View file

@ -8,7 +8,9 @@
#include "unit/tests.hpp"
#include <rotgen/rotgen.hpp>
template<int size = rotgen::Dynamic, typename Scalar = float, int maxSize = size>
template<int size = rotgen::Dynamic,
typename Scalar = float,
int maxSize = size>
using column = rotgen::matrix<Scalar, size, 1, rotgen::ColMajor, maxSize, 1>;
template<int size = rotgen::Dynamic, typename Scalar = float>
@ -17,22 +19,27 @@ using column_ref = rotgen::ref<column<size, Scalar>>;
template<int size = rotgen::Dynamic, typename Scalar = float>
using const_column_ref = rotgen::ref<column<size, Scalar> const>;
template<int N>
void process( column_ref<N> v )
template<int N> void process(column_ref<N> v)
{
v(0) = rotgen::sum(v);
}
auto process( column_ref<> v )
auto process(column_ref<> v)
{
auto sz = v.size();
switch(sz)
switch (sz)
{
case 1 : process<1>(v); break;
case 2 : process<2>(v); break;
case 3 : process<3>(v); break;
default: break;
case 1:
process<1>(v);
break;
case 2:
process<2>(v);
break;
case 3:
process<3>(v);
break;
default:
break;
}
return sz;
@ -40,9 +47,9 @@ auto process( column_ref<> v )
TTS_CASE("Reference of reference check")
{
auto v1 = rotgen::matrix<float,1,1>::Ones();
auto v2 = rotgen::matrix<float,2,1>::Random();
auto v3 = rotgen::matrix<float,3,1>::Constant(6.66);
auto v1 = rotgen::matrix<float, 1, 1>::Ones();
auto v2 = rotgen::matrix<float, 2, 1>::Random();
auto v3 = rotgen::matrix<float, 3, 1>::Constant(6.66);
auto sum1 = v1(0);
auto sum2 = v2(0) + v2(1);
@ -55,4 +62,4 @@ TTS_CASE("Reference of reference check")
TTS_EQUAL(v1[0], sum1);
TTS_EQUAL(v2[0], sum2);
TTS_EQUAL(v3[0], sum3);
};
};