diff --git a/include/armadillo_bits/fn_as_scalar.hpp b/include/armadillo_bits/fn_as_scalar.hpp index a8e948c6..2d0edd09 100644 --- a/include/armadillo_bits/fn_as_scalar.hpp +++ b/include/armadillo_bits/fn_as_scalar.hpp @@ -140,7 +140,7 @@ as_scalar_redirect<3>::apply(const Glue< Glue, T3, glue_time const strip_inv strip1(X.A.B); const strip_diagmat strip2(strip1.M); - const bool tmp2_do_inv = strip1.do_inv; + const bool tmp2_do_inv_gen = strip1.do_inv_gen; const bool tmp2_do_diagmat = strip2.do_diagmat; if(tmp2_do_diagmat == false) @@ -187,7 +187,7 @@ as_scalar_redirect<3>::apply(const Glue< Glue, T3, glue_time if(B_is_vec) { - if(tmp2_do_inv) + if(tmp2_do_inv_gen) { return val * op_dotext::direct_rowvec_invdiagvec_colvec(A.mem, B, C.mem); } @@ -198,7 +198,7 @@ as_scalar_redirect<3>::apply(const Glue< Glue, T3, glue_time } else { - if(tmp2_do_inv) + if(tmp2_do_inv_gen) { return val * op_dotext::direct_rowvec_invdiagmat_colvec(A.mem, B, C.mem); } diff --git a/include/armadillo_bits/glue_times_meat.hpp b/include/armadillo_bits/glue_times_meat.hpp index 0937963b..eba129e5 100644 --- a/include/armadillo_bits/glue_times_meat.hpp +++ b/include/armadillo_bits/glue_times_meat.hpp @@ -83,7 +83,7 @@ glue_times_redirect2_helper::apply(Mat& out, const typedef typename T1::elem_type eT; - if(strip_inv::do_inv) + if(strip_inv::do_inv_gen || strip_inv::do_inv_spd) { // replace inv(A)*B with solve(A,B) @@ -95,7 +95,7 @@ glue_times_redirect2_helper::apply(Mat& out, const arma_debug_check( (A.is_square() == false), "inv(): given matrix must be square sized" ); - if(strip_inv::do_inv_sympd) + if(strip_inv::do_inv_spd) { // if(auxlib::rudimentary_sym_check(A) == false) // { @@ -121,7 +121,7 @@ glue_times_redirect2_helper::apply(Mat& out, const arma_debug_assert_mul_size(A, B, "matrix multiplication"); #if defined(ARMA_OPTIMISE_SYMPD) - const bool status = (strip_inv::do_inv_sympd) ? auxlib::solve_sympd_fast(out, A, B) : auxlib::solve_square_fast(out, A, B); + const bool status = (strip_inv::do_inv_spd) ? auxlib::solve_sympd_fast(out, A, B) : auxlib::solve_square_fast(out, A, B); #else const bool status = auxlib::solve_square_fast(out, A, B); #endif @@ -137,7 +137,7 @@ glue_times_redirect2_helper::apply(Mat& out, const #if defined(ARMA_OPTIMISE_SYMPD) { - if(strip_inv::do_inv_sympd) + if(strip_inv::do_inv_spd) { // replace A*inv_sympd(B) with trans( solve(trans(B),trans(A)) ) // transpose of B is avoided as B is explicitly marked as symmetric @@ -260,7 +260,7 @@ glue_times_redirect3_helper::apply(Mat& out, const typedef typename T1::elem_type eT; - if(strip_inv::do_inv) + if(strip_inv::do_inv_gen || strip_inv::do_inv_spd) { // replace inv(A)*B*C with solve(A,B*C); @@ -295,7 +295,7 @@ glue_times_redirect3_helper::apply(Mat& out, const arma_debug_assert_mul_size(A, BC, "matrix multiplication"); #if defined(ARMA_OPTIMISE_SYMPD) - const bool status = (strip_inv::do_inv_sympd) ? auxlib::solve_sympd_fast(out, A, BC) : auxlib::solve_square_fast(out, A, BC); + const bool status = (strip_inv::do_inv_spd) ? auxlib::solve_sympd_fast(out, A, BC) : auxlib::solve_square_fast(out, A, BC); #else const bool status = auxlib::solve_square_fast(out, A, BC); #endif @@ -310,7 +310,7 @@ glue_times_redirect3_helper::apply(Mat& out, const } - if(strip_inv::do_inv) + if(strip_inv::do_inv_gen || strip_inv::do_inv_spd) { // replace A*inv(B)*C with A*solve(B,C) @@ -330,7 +330,7 @@ glue_times_redirect3_helper::apply(Mat& out, const Mat solve_result; #if defined(ARMA_OPTIMISE_SYMPD) - const bool status = (strip_inv::do_inv_sympd) ? auxlib::solve_sympd_fast(solve_result, B, C) : auxlib::solve_square_fast(solve_result, B, C); + const bool status = (strip_inv::do_inv_spd) ? auxlib::solve_sympd_fast(solve_result, B, C) : auxlib::solve_square_fast(solve_result, B, C); #else const bool status = auxlib::solve_square_fast(solve_result, B, C); #endif diff --git a/include/armadillo_bits/strip.hpp b/include/armadillo_bits/strip.hpp index 6bf5dabb..1dad0e60 100644 --- a/include/armadillo_bits/strip.hpp +++ b/include/armadillo_bits/strip.hpp @@ -73,8 +73,8 @@ struct strip_inv const T1& M; - static constexpr bool do_inv = false; - static constexpr bool do_inv_sympd = false; + static constexpr bool do_inv_gen = false; + static constexpr bool do_inv_spd = false; }; @@ -93,8 +93,8 @@ struct strip_inv< Op > const T1& M; - static constexpr bool do_inv = true; - static constexpr bool do_inv_sympd = false; + static constexpr bool do_inv_gen = true; + static constexpr bool do_inv_spd = false; }; @@ -113,8 +113,8 @@ struct strip_inv< Op > const T1& M; - static constexpr bool do_inv = true; - static constexpr bool do_inv_sympd = true; + static constexpr bool do_inv_gen = false; + static constexpr bool do_inv_spd = true; };