ensure junk args are const and are explicitly ignored

This commit is contained in:
conrad
2025-07-09 13:48:27 +10:00
parent 7dadab9eb1
commit c3db1ead03
2 changed files with 17 additions and 11 deletions
+13 -9
View File
@@ -27,16 +27,20 @@ class op_norm
template<typename T1> arma_hot inline static typename T1::pod_type vec_norm_1(const Proxy<T1>& P, const typename arma_not_cx<typename T1::elem_type>::result* junk = nullptr);
template<typename T1> arma_hot inline static typename T1::pod_type vec_norm_1(const Proxy<T1>& P, const typename arma_cx_only<typename T1::elem_type>::result* junk = nullptr);
template<typename eT> arma_hot inline static eT vec_norm_1_direct_std(const Mat<eT>& X, const typename arma_blas_real_only<eT>::result* junk = nullptr);
template<typename eT> arma_hot inline static eT vec_norm_1_direct_std(const Mat<eT>& X, const typename arma_fp16_only<eT>::result* junk = nullptr);
template<typename eT> arma_hot inline static eT vec_norm_1_direct_mem(const uword N, const eT* A);
template<typename eT> arma_hot inline static eT vec_norm_1_direct_std(const Mat<eT>& X, const typename arma_blas_real_only<eT>::result* junk = nullptr);
template<typename eT> arma_hot inline static eT vec_norm_1_direct_std(const Mat<eT>& X, const typename arma_fp16_only<eT>::result* junk = nullptr);
template<typename eT> arma_hot inline static eT vec_norm_1_direct_mem(const uword N, const eT* A);
template<typename T1> arma_hot inline static typename T1::pod_type vec_norm_2(const Proxy<T1>& P, const typename arma_not_cx<typename T1::elem_type>::result* junk = nullptr);
template<typename T1> arma_hot inline static typename T1::pod_type vec_norm_2(const Proxy<T1>& P, const typename arma_cx_only<typename T1::elem_type>::result* junk = nullptr);
template<typename eT> arma_hot inline static eT vec_norm_2_direct_std(const Mat<eT>& X, const typename arma_blas_real_only<eT>::result* junk = nullptr);
template<typename eT> arma_hot inline static eT vec_norm_2_direct_std(const Mat<eT>& X, const typename arma_fp16_only<eT>::result* junk = nullptr);
template<typename eT> arma_hot inline static eT vec_norm_2_direct_mem(const uword N, const eT* A);
template<typename eT> arma_hot inline static eT vec_norm_2_direct_robust(const Mat<eT>& X);
template<typename eT> arma_hot inline static eT vec_norm_2_direct_std(const Mat<eT>& X, const typename arma_blas_real_only<eT>::result* junk = nullptr);
template<typename eT> arma_hot inline static eT vec_norm_2_direct_std(const Mat<eT>& X, const typename arma_fp16_only<eT>::result* junk = nullptr);
template<typename eT> arma_hot inline static eT vec_norm_2_direct_mem(const uword N, const eT* A);
template<typename eT> arma_hot inline static eT vec_norm_2_direct_robust(const Mat<eT>& X);
template<typename T1> arma_hot inline static typename T1::pod_type vec_norm_k(const Proxy<T1>& P, const int k);
@@ -44,8 +48,8 @@ class op_norm
template<typename T1> arma_hot inline static typename T1::pod_type vec_norm_min(const Proxy<T1>& P);
template<typename eT> inline static typename get_pod_type<eT>::result mat_norm_1(const Mat<eT>& X);
template<typename eT> inline static typename get_pod_type<eT>::result mat_norm_2(const Mat<eT>& X, typename arma_blas_real_or_cx_only<eT>::result* junk = nullptr);
template<typename eT> inline static typename get_pod_type<eT>::result mat_norm_2(const Mat<eT>& X, typename arma_fp16_only<eT>::result* junk = nullptr);
template<typename eT> inline static typename get_pod_type<eT>::result mat_norm_2(const Mat<eT>& X, const typename arma_blas_real_or_cx_only<eT>::result* junk = nullptr);
template<typename eT> inline static typename get_pod_type<eT>::result mat_norm_2(const Mat<eT>& X, const typename arma_fp16_only<eT>::result* junk = nullptr);
template<typename eT> inline static typename get_pod_type<eT>::result mat_norm_inf(const Mat<eT>& X);
};
+4 -2
View File
@@ -931,9 +931,10 @@ op_norm::mat_norm_1(const Mat<eT>& X)
template<typename eT>
inline
typename get_pod_type<eT>::result
op_norm::mat_norm_2(const Mat<eT>& X, typename arma_blas_real_or_cx_only<eT>::result* junk)
op_norm::mat_norm_2(const Mat<eT>& X, const typename arma_blas_real_or_cx_only<eT>::result* junk)
{
arma_debug_sigprint();
arma_ignore(junk);
typedef typename get_pod_type<eT>::result T;
@@ -953,9 +954,10 @@ op_norm::mat_norm_2(const Mat<eT>& X, typename arma_blas_real_or_cx_only<eT>::re
template<typename eT>
inline
typename get_pod_type<eT>::result
op_norm::mat_norm_2(const Mat<eT>& X, typename arma_fp16_only<eT>::result* junk)
op_norm::mat_norm_2(const Mat<eT>& X, const typename arma_fp16_only<eT>::result* junk)
{
arma_debug_sigprint();
arma_ignore(junk);
arma_stop_logic_error("norm(): matrix 2-norm currently not supported for fp16; try norm2est() instead");