const Tensor<2, dim, ADNumberType> A_T = transpose(A);
const Tensor<2, dim, ADNumberType> A_adj = adjugate(A);
const Tensor<2, dim, ADNumberType> A_cof = cofactor(A);
- const ADNumberType A_l1_norm = l1_norm(A);
+ const Tensor<2, dim, ADNumberType> A_orth = orthogonalize(A);
+ const ADNumberType A_l1_norm = l1_norm(A, 1e-8);
const ADNumberType A_linf_norm = linfty_norm(A);
const ADNumberType A_ddot_B = double_contract<0, 0, 1, 1>(A, B);
#include <deal.II/base/tensor.h>
+#include <deal.II/lac/full_matrix.h>
+
#include "../tests.h"
template <int rank, int dim, typename Number>
DEAL_II_CONSTEXPR const auto dummy_6 = contract3(a, middle, a);
DEAL_II_CONSTEXPR const auto dummy_7 = adjugate(a);
DEAL_II_CONSTEXPR const auto dummy_8 = cofactor(a);
+ deallog << "Deteriminant before orthogonalization: " << determinant(a)
+ << std::endl;
+ const auto dummy_9 = orthogonalize(a, 1e-8);
+ deallog << "Deteriminant after orthogonalization: " << determinant(dummy_9)
+ << std::endl;
+ Assert(determinant(dummy_9) - 1. < 1e-8, ExcInternalError());
+
+
+ constexpr double non_orthogonal_init[3][3] = {{1., 2., 3.},
+ {1., 1.5, 2.},
+ {2., 0., 1}};
+ constexpr Tensor<2, 3> non_orthogonal{non_orthogonal_init};
+
+ deallog << "Deteriminant before orthogonalization: "
+ << determinant(non_orthogonal) << std::endl;
+ const auto dummy_10 = orthogonalize(non_orthogonal, 1e-8);
+ deallog << "Deteriminant after orthogonalization: "
+ << determinant(dummy_10) << std::endl;
+ Assert(determinant(dummy_10) - 1. < 1e-8, ExcInternalError());
}
{
DEAL::15.2000
DEAL::116.000
DEAL::Used memory: 72
+DEAL::Deteriminant before orthogonalization: 1.00000
+DEAL::Deteriminant after orthogonalization: 1.00000
+DEAL::Deteriminant before orthogonalization: -1.50000
+DEAL::Deteriminant after orthogonalization: -1.00000
DEAL::OK