From f4efd943263e3e39601b4d2e77f6fd938bf6f461 Mon Sep 17 00:00:00 2001 From: conrad Date: Thu, 15 Jun 2023 12:51:35 +1000 Subject: [PATCH] clarify intent --- include/armadillo_bits/BaseCube_meat.hpp | 96 +++++++------- include/armadillo_bits/Base_meat.hpp | 160 ++++++++++++----------- 2 files changed, 136 insertions(+), 120 deletions(-) diff --git a/include/armadillo_bits/BaseCube_meat.hpp b/include/armadillo_bits/BaseCube_meat.hpp index 45dc07d0..d267d948 100644 --- a/include/armadillo_bits/BaseCube_meat.hpp +++ b/include/armadillo_bits/BaseCube_meat.hpp @@ -316,18 +316,20 @@ BaseCube::is_finite() const return arrayops::is_finite( U.M.memptr(), U.M.n_elem ); } - - const ProxyCube P( (*this).get_ref() ); - - const uword n_r = P.get_n_rows(); - const uword n_c = P.get_n_cols(); - const uword n_s = P.get_n_slices(); - - for(uword s=0; s P( (*this).get_ref() ); + + const uword n_r = P.get_n_rows(); + const uword n_c = P.get_n_cols(); + const uword n_s = P.get_n_slices(); + + for(uword s=0; s::has_inf() const return arrayops::has_inf( U.M.memptr(), U.M.n_elem ); } - - const ProxyCube P( (*this).get_ref() ); - - const uword n_r = P.get_n_rows(); - const uword n_c = P.get_n_cols(); - const uword n_s = P.get_n_slices(); - - for(uword s=0; s P( (*this).get_ref() ); + + const uword n_r = P.get_n_rows(); + const uword n_c = P.get_n_cols(); + const uword n_s = P.get_n_slices(); + + for(uword s=0; s::has_nan() const return arrayops::has_nan( U.M.memptr(), U.M.n_elem ); } - - const ProxyCube P( (*this).get_ref() ); - - const uword n_r = P.get_n_rows(); - const uword n_c = P.get_n_cols(); - const uword n_s = P.get_n_slices(); - - for(uword s=0; s P( (*this).get_ref() ); + + const uword n_r = P.get_n_rows(); + const uword n_c = P.get_n_cols(); + const uword n_s = P.get_n_slices(); + + for(uword s=0; s::has_nonfinite() const return (arrayops::is_finite( U.M.memptr(), U.M.n_elem ) == false); } - - const ProxyCube P( (*this).get_ref() ); - - const uword n_r = P.get_n_rows(); - const uword n_c = P.get_n_cols(); - const uword n_s = P.get_n_slices(); - - for(uword s=0; s P( (*this).get_ref() ); + + const uword n_r = P.get_n_rows(); + const uword n_c = P.get_n_cols(); + const uword n_s = P.get_n_slices(); + + for(uword s=0; s::is_finite() const return arrayops::is_finite( U.M.memptr(), U.M.n_elem ); } - - const Proxy P( (*this).get_ref() ); - - if(Proxy::use_at == false) - { - const typename Proxy::ea_type Pea = P.get_ea(); - - const uword n_elem = P.get_n_elem(); - - for(uword i=0; i P( (*this).get_ref() ); - for(uword col=0; col::use_at == false) { - if(arma_isfinite(P.at(row,col)) == false) { return false; } + const typename Proxy::ea_type Pea = P.get_ea(); + + const uword n_elem = P.get_n_elem(); + + for(uword i=0; i::has_inf() const return arrayops::has_inf( U.M.memptr(), U.M.n_elem ); } - - const Proxy P( (*this).get_ref() ); - - if(Proxy::use_at == false) - { - const typename Proxy::ea_type Pea = P.get_ea(); - - const uword n_elem = P.get_n_elem(); - - for(uword i=0; i P( (*this).get_ref() ); - for(uword col=0; col::use_at == false) { - if(arma_isinf(P.at(row,col))) { return true; } + const typename Proxy::ea_type Pea = P.get_ea(); + + const uword n_elem = P.get_n_elem(); + + for(uword i=0; i::has_nan() const return arrayops::has_nan( U.M.memptr(), U.M.n_elem ); } - - const Proxy P( (*this).get_ref() ); - - if(Proxy::use_at == false) - { - const typename Proxy::ea_type Pea = P.get_ea(); - - const uword n_elem = P.get_n_elem(); - - for(uword i=0; i P( (*this).get_ref() ); - for(uword col=0; col::use_at == false) { - if(arma_isnan(P.at(row,col))) { return true; } + const typename Proxy::ea_type Pea = P.get_ea(); + + const uword n_elem = P.get_n_elem(); + + for(uword i=0; i::has_nonfinite() const return (arrayops::is_finite( U.M.memptr(), U.M.n_elem ) == false); } - - const Proxy P( (*this).get_ref() ); - - if(Proxy::use_at == false) - { - const typename Proxy::ea_type Pea = P.get_ea(); - - const uword n_elem = P.get_n_elem(); - - for(uword i=0; i P( (*this).get_ref() ); - for(uword col=0; col::use_at == false) { - if(arma_isfinite(P.at(row,col)) == false) { return true; } + const typename Proxy::ea_type Pea = P.get_ea(); + + const uword n_elem = P.get_n_elem(); + + for(uword i=0; i