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:
parent
e92e824a18
commit
648dd768ee
94 changed files with 6778 additions and 4722 deletions
|
|
@ -8,82 +8,84 @@
|
|||
#include "unit/tests.hpp"
|
||||
#include <rotgen/rotgen.hpp>
|
||||
|
||||
TTS_CASE_TPL("map constructor from pointer and single static size", rotgen::tests::types)
|
||||
<typename T, typename O>( tts::type< tts::types<T,O>> )
|
||||
TTS_CASE_TPL("map constructor from pointer and single static size",
|
||||
rotgen::tests::types)<typename T, typename O>(
|
||||
tts::type<tts::types<T, O>>)
|
||||
{
|
||||
T data[] = {1,2,3,4,5,6,7,8,9,10,11,12};
|
||||
T data[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
|
||||
|
||||
rotgen::map<rotgen::matrix<T,1,12,rotgen::RowMajor>> row_map(data);
|
||||
for(rotgen::Index i=0;i<12;i++)
|
||||
TTS_EQUAL(row_map(i), data[i]);
|
||||
rotgen::map<rotgen::matrix<T, 1, 12, rotgen::RowMajor>> row_map(data);
|
||||
for (rotgen::Index i = 0; i < 12; i++) TTS_EQUAL(row_map(i), data[i]);
|
||||
|
||||
rotgen::map<rotgen::matrix<T,1,12,rotgen::RowMajor> const> const_row_map(data);
|
||||
for(rotgen::Index i=0;i<12;i++)
|
||||
TTS_EQUAL(const_row_map(i), data[i]);
|
||||
rotgen::map<rotgen::matrix<T, 1, 12, rotgen::RowMajor> const> const_row_map(
|
||||
data);
|
||||
for (rotgen::Index i = 0; i < 12; i++) TTS_EQUAL(const_row_map(i), data[i]);
|
||||
|
||||
rotgen::map<rotgen::matrix<T,12,1,rotgen::ColMajor>> col_map(data);
|
||||
for(rotgen::Index i=0;i<12;i++)
|
||||
TTS_EQUAL(col_map(i), data[i]);
|
||||
rotgen::map<rotgen::matrix<T, 12, 1, rotgen::ColMajor>> col_map(data);
|
||||
for (rotgen::Index i = 0; i < 12; i++) TTS_EQUAL(col_map(i), data[i]);
|
||||
|
||||
rotgen::map<rotgen::matrix<T,12,1,rotgen::ColMajor> const> const_col_map(data);
|
||||
for(rotgen::Index i=0;i<12;i++)
|
||||
TTS_EQUAL(const_col_map(i), data[i]);
|
||||
rotgen::map<rotgen::matrix<T, 12, 1, rotgen::ColMajor> const> const_col_map(
|
||||
data);
|
||||
for (rotgen::Index i = 0; i < 12; i++) TTS_EQUAL(const_col_map(i), data[i]);
|
||||
};
|
||||
|
||||
TTS_CASE_TPL("map constructor from pointer and static size", rotgen::tests::types)
|
||||
<typename T, typename O>( tts::type< tts::types<T,O>> )
|
||||
TTS_CASE_TPL("map constructor from pointer and static size",
|
||||
rotgen::tests::types)<typename T, typename O>(
|
||||
tts::type<tts::types<T, O>>)
|
||||
{
|
||||
using base = rotgen::matrix<T,4,3,O::value>;
|
||||
using base = rotgen::matrix<T, 4, 3, O::value>;
|
||||
|
||||
T data[] = {1,2,3,4,5,6,7,8,9,10,11,12};
|
||||
T data[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
|
||||
|
||||
rotgen::map<base> dyn_map(data);
|
||||
for(rotgen::Index i=0;i<4;i++)
|
||||
for (rotgen::Index i = 0; i < 4; i++)
|
||||
{
|
||||
for(rotgen::Index j=0;j<3;j++)
|
||||
for (rotgen::Index j = 0; j < 3; j++)
|
||||
{
|
||||
if constexpr(O::value) TTS_EQUAL(dyn_map(i,j), data[j+3*i]);
|
||||
else TTS_EQUAL(dyn_map(i,j), data[i+4*j]);
|
||||
if constexpr (O::value) TTS_EQUAL(dyn_map(i, j), data[j + 3 * i]);
|
||||
else TTS_EQUAL(dyn_map(i, j), data[i + 4 * j]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
TTS_CASE_TPL("map constructor from pointer and single dynamic size", rotgen::tests::types)
|
||||
<typename T, typename O>( tts::type< tts::types<T,O>> )
|
||||
TTS_CASE_TPL("map constructor from pointer and single dynamic size",
|
||||
rotgen::tests::types)<typename T, typename O>(
|
||||
tts::type<tts::types<T, O>>)
|
||||
{
|
||||
T data[] = {1,2,3,4,5,6,7,8,9,10,11,12};
|
||||
T data[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
|
||||
|
||||
rotgen::map<rotgen::matrix<T,1,rotgen::Dynamic,rotgen::RowMajor>> row_map(data,12);
|
||||
for(rotgen::Index i=0;i<12;i++)
|
||||
TTS_EQUAL(row_map(i), data[i]);
|
||||
rotgen::map<rotgen::matrix<T, 1, rotgen::Dynamic, rotgen::RowMajor>> row_map(
|
||||
data, 12);
|
||||
for (rotgen::Index i = 0; i < 12; i++) TTS_EQUAL(row_map(i), data[i]);
|
||||
|
||||
rotgen::map<rotgen::matrix<T,1,rotgen::Dynamic,rotgen::RowMajor> const> const_row_map(data,12);
|
||||
for(rotgen::Index i=0;i<12;i++)
|
||||
TTS_EQUAL(const_row_map(i), data[i]);
|
||||
rotgen::map<rotgen::matrix<T, 1, rotgen::Dynamic, rotgen::RowMajor> const>
|
||||
const_row_map(data, 12);
|
||||
for (rotgen::Index i = 0; i < 12; i++) TTS_EQUAL(const_row_map(i), data[i]);
|
||||
|
||||
rotgen::map<rotgen::matrix<T,rotgen::Dynamic,1,rotgen::ColMajor>> col_map(data,12);
|
||||
for(rotgen::Index i=0;i<12;i++)
|
||||
TTS_EQUAL(col_map(i), data[i]);
|
||||
rotgen::map<rotgen::matrix<T, rotgen::Dynamic, 1, rotgen::ColMajor>> col_map(
|
||||
data, 12);
|
||||
for (rotgen::Index i = 0; i < 12; i++) TTS_EQUAL(col_map(i), data[i]);
|
||||
|
||||
rotgen::map<rotgen::matrix<T,rotgen::Dynamic,1,rotgen::ColMajor> const> const_col_map(data,12);
|
||||
for(rotgen::Index i=0;i<12;i++)
|
||||
TTS_EQUAL(const_col_map(i), data[i]);
|
||||
rotgen::map<rotgen::matrix<T, rotgen::Dynamic, 1, rotgen::ColMajor> const>
|
||||
const_col_map(data, 12);
|
||||
for (rotgen::Index i = 0; i < 12; i++) TTS_EQUAL(const_col_map(i), data[i]);
|
||||
};
|
||||
|
||||
TTS_CASE_TPL("map constructor from pointer and dynamic size", rotgen::tests::types)
|
||||
<typename T, typename O>( tts::type< tts::types<T,O>> )
|
||||
TTS_CASE_TPL("map constructor from pointer and dynamic size",
|
||||
rotgen::tests::types)<typename T, typename O>(
|
||||
tts::type<tts::types<T, O>>)
|
||||
{
|
||||
using base = rotgen::matrix<T,rotgen::Dynamic,rotgen::Dynamic,O::value>;
|
||||
using base = rotgen::matrix<T, rotgen::Dynamic, rotgen::Dynamic, O::value>;
|
||||
|
||||
T data[] = {1,2,3,4,5,6,7,8,9,10,11,12};
|
||||
T data[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
|
||||
|
||||
rotgen::map<base> dyn_map(data,4,3);
|
||||
for(rotgen::Index i=0;i<4;i++)
|
||||
rotgen::map<base> dyn_map(data, 4, 3);
|
||||
for (rotgen::Index i = 0; i < 4; i++)
|
||||
{
|
||||
for(rotgen::Index j=0;j<3;j++)
|
||||
for (rotgen::Index j = 0; j < 3; j++)
|
||||
{
|
||||
if constexpr(O::value) TTS_EQUAL(dyn_map(i,j), data[j+3*i]);
|
||||
else TTS_EQUAL(dyn_map(i,j), data[i+4*j]);
|
||||
if constexpr (O::value) TTS_EQUAL(dyn_map(i, j), data[j + 3 * i]);
|
||||
else TTS_EQUAL(dyn_map(i, j), data[i + 4 * j]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue