Commit 6d1ae9da authored by Lucas Serrano's avatar Lucas Serrano
Browse files

Remove redundant param for inverse

parent bd185204
......@@ -176,9 +176,9 @@ static void matrix_mul_m_v(BaseMatrix<T, l, m, MVS> &a, Vector<T, m, MVS> &b, Ve
}
}
template <typename T, int NumberRows, int NumberCols, int MaximumVectorSize>
template <typename T, int Size, int MaximumVectorSize>
class Inverse {
using M = BaseMatrix<T, NumberRows, NumberCols, MaximumVectorSize>;
using M = BaseMatrix<T, Size, Size, MaximumVectorSize>;
public:
static void inverse(M &a, M &inv) {
/* Computes inverse of `a` by using Cholesky decomposition.
......@@ -235,7 +235,7 @@ class Inverse {
};
template <typename T, int MaximumVectorSize>
class Inverse<T, 2, 2, MaximumVectorSize> {
class Inverse<T, 2, MaximumVectorSize> {
using M = BaseMatrix<T, 2, 2, MaximumVectorSize>;
public:
static void inverse(M &a, M &inv) {
......@@ -361,7 +361,7 @@ class BaseMatrix {
template <typename U, int l, int m, int n, int MVS> friend void matrix_mul_mt_m(BaseMatrix<U, m, l, MVS> &a, BaseMatrix<U, m, n, MVS> &b, BaseMatrix<U, l, n, MVS> &c);
template <typename U, int l, int m, int n, int MVS> friend void matrix_mul_m_mt(BaseMatrix<U, l, m, MVS> &a, BaseMatrix<U, n, m, MVS> &b, BaseMatrix<U, l, n, MVS> &c);
template <typename U, int l, int m, int MVS> friend void matrix_mul_m_v(BaseMatrix<U, l, m, MVS> &a, Vector<U, m, MVS> &b, Vector<U, l, MVS> &c);
friend class Inverse<T, NRows, NCols, MaxVecSize>;
friend class Inverse<T, NCols, MaxVecSize>;
friend std::ostream & operator<<<T, NRows, NCols, MaxVecSize>(std::ostream &os, const matrix_t &mat);
protected:
......
......@@ -52,7 +52,7 @@ TEST(Inverse, Cholesky) {
BaseMatrix<float, 3, 3, 8> inverse_easy_float_mat;
BaseMatrix<float, 3, 3, 8> result_easy_float_mat(&result_easy_float_array[0]);
Inverse<float, 3, 3, 8>::inverse(base_easy_float_mat, inverse_easy_float_mat);
Inverse<float, 3, 8>::inverse(base_easy_float_mat, inverse_easy_float_mat);
EXPECT_PRED_FORMAT2(compare_floating_point_matrices, inverse_easy_float_mat, result_easy_float_mat);
EXPECT_TRUE(inverse_easy_float_mat.is_padding_zero());
......@@ -72,7 +72,7 @@ TEST(Inverse, Cholesky) {
BaseMatrix<float, 3, 3, 8> inverse_harder_float_mat;
BaseMatrix<float, 3, 3, 8> result_harder_float_mat(&result_harder_float_array[0]);
Inverse<float, 3, 3, 8>::inverse(base_harder_float_mat, inverse_harder_float_mat);
Inverse<float, 3, 8>::inverse(base_harder_float_mat, inverse_harder_float_mat);
EXPECT_PRED_FORMAT2(compare_floating_point_matrices, inverse_harder_float_mat, result_harder_float_mat);
EXPECT_TRUE(inverse_harder_float_mat.is_padding_zero());
......@@ -94,7 +94,7 @@ TEST(Inverse, Cholesky) {
BaseMatrix<double, 3, 3, 8> inverse_easy_double_mat;
BaseMatrix<double, 3, 3, 8> result_easy_double_mat(&result_easy_double_array[0]);
Inverse<double, 3, 3, 8>::inverse(base_easy_double_mat, inverse_easy_double_mat);
Inverse<double, 3, 8>::inverse(base_easy_double_mat, inverse_easy_double_mat);
EXPECT_PRED_FORMAT2(compare_floating_point_matrices, inverse_easy_double_mat, result_easy_double_mat);
EXPECT_TRUE(inverse_easy_double_mat.is_padding_zero());
......@@ -114,7 +114,7 @@ TEST(Inverse, Cholesky) {
BaseMatrix<double, 3, 3, 8> inverse_harder_double_mat;
BaseMatrix<double, 3, 3, 8> result_harder_double_mat(&result_harder_double_array[0]);
Inverse<double, 3, 3, 8>::inverse(base_harder_double_mat, inverse_harder_double_mat);
Inverse<double, 3, 8>::inverse(base_harder_double_mat, inverse_harder_double_mat);
EXPECT_PRED_FORMAT2(compare_floating_point_matrices, inverse_harder_double_mat, result_harder_double_mat);
EXPECT_TRUE(inverse_harder_double_mat.is_padding_zero());
}
......@@ -134,7 +134,7 @@ TEST(Inverse, Small) {
BaseMatrix<float, 2, 2, 8> inverse_float_mat;
BaseMatrix<float, 2, 2, 8> result_float_mat(&result_float_array[0]);
Inverse<float, 2, 2, 8>::inverse(base_float_mat, inverse_float_mat);
Inverse<float, 2, 8>::inverse(base_float_mat, inverse_float_mat);
EXPECT_PRED_FORMAT2(compare_floating_point_matrices, inverse_float_mat, result_float_mat);
EXPECT_TRUE(inverse_float_mat.is_padding_zero());
......@@ -153,7 +153,7 @@ TEST(Inverse, Small) {
BaseMatrix<double, 2, 2, 8> inverse_double_mat;
BaseMatrix<double, 2, 2, 8> result_double_mat(&result_double_array[0]);
Inverse<double, 2, 2, 8>::inverse(base_double_mat, inverse_double_mat);
Inverse<double, 2, 8>::inverse(base_double_mat, inverse_double_mat);
EXPECT_PRED_FORMAT2(compare_floating_point_matrices, inverse_double_mat, result_double_mat);
EXPECT_TRUE(inverse_double_mat.is_padding_zero());
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment