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,27 +8,28 @@
|
|||
#include "unit/tests.hpp"
|
||||
#include <rotgen/rotgen.hpp>
|
||||
|
||||
TTS_CASE_TPL("System solver using QR", rotgen::tests::types)
|
||||
<typename T, typename O>( tts::type< tts::types<T,O>> )
|
||||
TTS_CASE_TPL("System solver using QR",
|
||||
rotgen::tests::types)<typename T, typename O>(
|
||||
tts::type<tts::types<T, O>>)
|
||||
{
|
||||
rotgen::matrix<T,rotgen::Dynamic,rotgen::Dynamic>
|
||||
a { { 2.3, -1, 0.1}
|
||||
, {-1.6, 2.6, -1}
|
||||
, { 0.3, -1, 2}
|
||||
};
|
||||
rotgen::matrix<T, rotgen::Dynamic, rotgen::Dynamic> a{{2.3, -1, 0.1},
|
||||
{-1.6, 2.6, -1},
|
||||
{0.3, -1, 2}};
|
||||
|
||||
rotgen::matrix<T,rotgen::Dynamic,1> b(3,1);
|
||||
b(0) = b(2) = 1; b(1) = 0;
|
||||
rotgen::matrix<T, rotgen::Dynamic, 1> b(3, 1);
|
||||
b(0) = b(2) = 1;
|
||||
b(1) = 0;
|
||||
|
||||
rotgen::matrix<T,rotgen::Dynamic,rotgen::Dynamic> r(3,1), error;
|
||||
rotgen::matrix<T, rotgen::Dynamic, rotgen::Dynamic> r(3, 1), error;
|
||||
|
||||
auto x = rotgen::extract(r,0,0,3,1);
|
||||
auto x = rotgen::extract(r, 0, 0, 3, 1);
|
||||
rotgen::solver::qr(x, a, b);
|
||||
|
||||
error = a * r - b;
|
||||
auto eps = std::numeric_limits<T>::epsilon();
|
||||
|
||||
TTS_LESS(rotgen::maxCoeff(rotgen::abs(error)) / eps, 5)
|
||||
<< "Result:\n" << r << "\n"
|
||||
<< "Residuals:\n" << error << "\n";
|
||||
};
|
||||
TTS_LESS(rotgen::maxCoeff(rotgen::abs(error)) / eps, 5) << "Result:\n"
|
||||
<< r << "\n"
|
||||
<< "Residuals:\n"
|
||||
<< error << "\n";
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue