diff --git a/include/armadillo_bits/fn_norm.hpp b/include/armadillo_bits/fn_norm.hpp index c71f4bc3..448b1eaa 100644 --- a/include/armadillo_bits/fn_norm.hpp +++ b/include/armadillo_bits/fn_norm.hpp @@ -90,10 +90,9 @@ norm if(is_vec) { - if( (sig == 'i') || (sig == 'I') || (sig == '+') ) { return op_norm::vec_norm_max(P); } - if( (sig == '-') ) { return op_norm::vec_norm_min(P); } - if( (sig == 'f') || (sig == 'F') ) { return op_norm::vec_norm_2(P); } - if( (sig == 'h') || (sig == 'H') ) { return op_norm::vec_norm_hamm(P); } + if( (sig == 'i') || (sig == 'I') || (sig == '+') ) { return op_norm::vec_norm_max(P); } + if( (sig == '-') ) { return op_norm::vec_norm_min(P); } + if( (sig == 'f') || (sig == 'F') ) { return op_norm::vec_norm_2(P); } arma_stop_logic_error("norm(): unsupported vector norm type"); } @@ -223,10 +222,6 @@ norm { return op_norm::vec_norm_2(P_fake_vector); } - if( (sig == 'h') || (sig == 'H') ) // Hamming "norm" - { - return T(X.n_nonzero); - } arma_stop_logic_error("norm(): unsupported vector norm type"); } diff --git a/include/armadillo_bits/op_norm_bones.hpp b/include/armadillo_bits/op_norm_bones.hpp index 7d85f101..cc778e5e 100644 --- a/include/armadillo_bits/op_norm_bones.hpp +++ b/include/armadillo_bits/op_norm_bones.hpp @@ -39,8 +39,6 @@ class op_norm template arma_hot inline static typename T1::pod_type vec_norm_max(const Proxy& P); template arma_hot inline static typename T1::pod_type vec_norm_min(const Proxy& P); - template arma_hot inline static typename T1::pod_type vec_norm_hamm(const Proxy& P); - template inline static typename get_pod_type::result mat_norm_1(const Mat& X); template inline static typename get_pod_type::result mat_norm_2(const Mat& X); diff --git a/include/armadillo_bits/op_norm_meat.hpp b/include/armadillo_bits/op_norm_meat.hpp index 8e9fb440..629a29cc 100644 --- a/include/armadillo_bits/op_norm_meat.hpp +++ b/include/armadillo_bits/op_norm_meat.hpp @@ -867,57 +867,6 @@ op_norm::vec_norm_min(const Proxy& P) -template -arma_hot -inline -typename T1::pod_type -op_norm::vec_norm_hamm(const Proxy& P) - { - arma_extra_debug_sigprint(); - - // Hamming "norm", aka L0 "norm", defined as the number of non-zero elements - // this is not really a norm, but is implemented for completeness - // https://en.wikipedia.org/wiki/Lp_space - - typedef typename T1::elem_type eT; - typedef typename T1::pod_type T; - - const eT zero = eT(0); - - uword count = 0; - - if(Proxy::use_at == false) - { - typename Proxy::ea_type A = P.get_ea(); - - const uword N = P.get_n_elem(); - - for(uword i=0; i < N; ++i) { count += (A[i] != zero) ? uword(1) : uword(0); } - } - else - { - const uword n_rows = P.get_n_rows(); - const uword n_cols = P.get_n_cols(); - - if(n_rows == 1) - { - for(uword col=0; col < n_cols; ++col) { count += (P.at(0,col) != zero) ? uword(1) : uword(0); } - } - else - { - for(uword col=0; col < n_cols; ++col) - for(uword row=0; row < n_rows; ++row) - { - count += (P.at(row,col) != zero) ? uword(1) : uword(0); - } - } - } - - return T(count); - } - - - template inline typename get_pod_type::result