From f447f144fec0c6b94f728cb8062a796399dff50a Mon Sep 17 00:00:00 2001 From: conrad Date: Thu, 16 Oct 2025 15:20:54 +1000 Subject: [PATCH] avoid unnecessary alias checks --- include/armadillo_bits/spop_trimat_bones.hpp | 3 +++ include/armadillo_bits/spop_trimat_meat.hpp | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/include/armadillo_bits/spop_trimat_bones.hpp b/include/armadillo_bits/spop_trimat_bones.hpp index 2575b565..d9472920 100644 --- a/include/armadillo_bits/spop_trimat_bones.hpp +++ b/include/armadillo_bits/spop_trimat_bones.hpp @@ -29,6 +29,9 @@ struct spop_trimat template inline static void apply(SpMat& out, const SpOp& in); + + template + inline static void apply(SpMat_noalias& out, const SpOp& in); }; diff --git a/include/armadillo_bits/spop_trimat_meat.hpp b/include/armadillo_bits/spop_trimat_meat.hpp index 0812bfcf..42a8861f 100644 --- a/include/armadillo_bits/spop_trimat_meat.hpp +++ b/include/armadillo_bits/spop_trimat_meat.hpp @@ -141,6 +141,26 @@ spop_trimat::apply(SpMat& out, const SpOp +inline +void +spop_trimat::apply(SpMat_noalias& out, const SpOp& in) + { + arma_debug_sigprint(); + + typedef typename T1::elem_type eT; + + const SpProxy P(in.m); + + arma_conform_check( (P.get_n_rows() != P.get_n_cols()), "trimatu()/trimatl(): given matrix must be square sized" ); + + const bool upper = (in.aux_uword_a == 0); + + spop_trimat::apply_noalias(out, P, upper); + } + + + //