From adc4991f6c906c199f12d8bc27aaf36614b12893 Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Mon, 10 Jun 2024 07:33:12 -0500 Subject: [PATCH 1/7] Initial test of draft for 14.0.0 --- inst/include/armadillo | 30 +- inst/include/armadillo_bits/BaseCube_meat.hpp | 42 +- inst/include/armadillo_bits/Base_meat.hpp | 74 +- inst/include/armadillo_bits/Col_meat.hpp | 301 ++-- .../armadillo_bits/CubeToMatOp_meat.hpp | 6 +- inst/include/armadillo_bits/Cube_bones.hpp | 4 +- inst/include/armadillo_bits/Cube_meat.hpp | 743 +++++---- inst/include/armadillo_bits/GenCube_meat.hpp | 24 +- inst/include/armadillo_bits/Gen_meat.hpp | 24 +- inst/include/armadillo_bits/GlueCube_meat.hpp | 4 +- inst/include/armadillo_bits/Glue_meat.hpp | 6 +- inst/include/armadillo_bits/MapMat_meat.hpp | 176 +-- inst/include/armadillo_bits/Mat_bones.hpp | 12 +- inst/include/armadillo_bits/Mat_meat.hpp | 1368 ++++++++++------- inst/include/armadillo_bits/OpCube_meat.hpp | 12 +- inst/include/armadillo_bits/Op_meat.hpp | 10 +- inst/include/armadillo_bits/Proxy.hpp | 159 +- inst/include/armadillo_bits/ProxyCube.hpp | 20 +- inst/include/armadillo_bits/Row_meat.hpp | 301 ++-- inst/include/armadillo_bits/SizeCube_meat.hpp | 4 +- inst/include/armadillo_bits/SizeMat_meat.hpp | 4 +- inst/include/armadillo_bits/SpBase_meat.hpp | 88 +- inst/include/armadillo_bits/SpCol_meat.hpp | 58 +- inst/include/armadillo_bits/SpGlue_meat.hpp | 6 +- inst/include/armadillo_bits/SpMat_bones.hpp | 10 +- inst/include/armadillo_bits/SpMat_meat.hpp | 767 ++++----- inst/include/armadillo_bits/SpOp_meat.hpp | 8 +- inst/include/armadillo_bits/SpProxy.hpp | 24 +- inst/include/armadillo_bits/SpRow_meat.hpp | 58 +- .../SpSubview_col_list_meat.hpp | 70 +- .../include/armadillo_bits/SpSubview_meat.hpp | 198 +-- .../armadillo_bits/SpToDGlue_bones.hpp | 8 +- .../include/armadillo_bits/SpToDGlue_meat.hpp | 4 +- inst/include/armadillo_bits/SpToDOp_bones.hpp | 22 +- inst/include/armadillo_bits/SpToDOp_meat.hpp | 18 +- inst/include/armadillo_bits/arma_config.hpp | 30 +- inst/include/armadillo_bits/arma_forward.hpp | 7 +- .../armadillo_bits/arma_ostream_meat.hpp | 24 +- inst/include/armadillo_bits/arma_rng.hpp | 2 +- inst/include/armadillo_bits/arma_version.hpp | 8 +- inst/include/armadillo_bits/auxlib_meat.hpp | 880 +++++------ inst/include/armadillo_bits/band_helper.hpp | 14 +- .../include/armadillo_bits/compiler_check.hpp | 12 +- .../include/armadillo_bits/compiler_setup.hpp | 62 +- inst/include/armadillo_bits/config.hpp | 68 +- inst/include/armadillo_bits/constants.hpp | 18 +- inst/include/armadillo_bits/debug.hpp | 181 ++- inst/include/armadillo_bits/diagmat_proxy.hpp | 16 +- inst/include/armadillo_bits/diagview_meat.hpp | 92 +- inst/include/armadillo_bits/diskio_meat.hpp | 228 +-- .../include/armadillo_bits/eGlueCube_meat.hpp | 6 +- inst/include/armadillo_bits/eGlue_meat.hpp | 8 +- inst/include/armadillo_bits/eOpCube_meat.hpp | 12 +- inst/include/armadillo_bits/eOp_meat.hpp | 10 +- .../armadillo_bits/eglue_core_meat.hpp | 36 +- inst/include/armadillo_bits/eop_aux.hpp | 4 +- inst/include/armadillo_bits/eop_core_meat.hpp | 44 +- .../armadillo_bits/fft_engine_fftw3.hpp | 20 +- .../armadillo_bits/fft_engine_kissfft.hpp | 14 +- inst/include/armadillo_bits/field_meat.hpp | 356 ++--- inst/include/armadillo_bits/fn_accu.hpp | 114 +- inst/include/armadillo_bits/fn_all.hpp | 6 +- inst/include/armadillo_bits/fn_any.hpp | 6 +- .../armadillo_bits/fn_approx_equal.hpp | 54 +- inst/include/armadillo_bits/fn_as_scalar.hpp | 54 +- inst/include/armadillo_bits/fn_chi2rnd.hpp | 22 +- inst/include/armadillo_bits/fn_chol.hpp | 26 +- inst/include/armadillo_bits/fn_clamp.hpp | 16 +- inst/include/armadillo_bits/fn_cond_rcond.hpp | 6 +- inst/include/armadillo_bits/fn_conv.hpp | 8 +- inst/include/armadillo_bits/fn_conv_to.hpp | 84 +- inst/include/armadillo_bits/fn_cor.hpp | 8 +- inst/include/armadillo_bits/fn_cov.hpp | 8 +- inst/include/armadillo_bits/fn_cross.hpp | 2 +- inst/include/armadillo_bits/fn_cumprod.hpp | 6 +- inst/include/armadillo_bits/fn_cumsum.hpp | 6 +- inst/include/armadillo_bits/fn_det.hpp | 6 +- inst/include/armadillo_bits/fn_diagmat.hpp | 8 +- .../armadillo_bits/fn_diags_spdiags.hpp | 16 +- inst/include/armadillo_bits/fn_diagvec.hpp | 10 +- inst/include/armadillo_bits/fn_diff.hpp | 6 +- inst/include/armadillo_bits/fn_dot.hpp | 26 +- inst/include/armadillo_bits/fn_eig_gen.hpp | 38 +- inst/include/armadillo_bits/fn_eig_pair.hpp | 22 +- inst/include/armadillo_bits/fn_eig_sym.hpp | 22 +- inst/include/armadillo_bits/fn_eigs_gen.hpp | 42 +- inst/include/armadillo_bits/fn_eigs_sym.hpp | 30 +- inst/include/armadillo_bits/fn_elem.hpp | 166 +- inst/include/armadillo_bits/fn_eps.hpp | 4 +- inst/include/armadillo_bits/fn_expmat.hpp | 12 +- inst/include/armadillo_bits/fn_eye.hpp | 20 +- inst/include/armadillo_bits/fn_fft.hpp | 12 +- inst/include/armadillo_bits/fn_fft2.hpp | 8 +- inst/include/armadillo_bits/fn_find.hpp | 38 +- .../include/armadillo_bits/fn_find_unique.hpp | 4 +- inst/include/armadillo_bits/fn_flip.hpp | 8 +- inst/include/armadillo_bits/fn_hess.hpp | 12 +- inst/include/armadillo_bits/fn_hist.hpp | 6 +- inst/include/armadillo_bits/fn_histc.hpp | 4 +- inst/include/armadillo_bits/fn_index_max.hpp | 14 +- inst/include/armadillo_bits/fn_index_min.hpp | 14 +- .../armadillo_bits/fn_inplace_strans.hpp | 4 +- .../armadillo_bits/fn_inplace_trans.hpp | 14 +- inst/include/armadillo_bits/fn_interp1.hpp | 18 +- inst/include/armadillo_bits/fn_interp2.hpp | 32 +- inst/include/armadillo_bits/fn_intersect.hpp | 4 +- inst/include/armadillo_bits/fn_inv.hpp | 16 +- inst/include/armadillo_bits/fn_inv_sympd.hpp | 16 +- inst/include/armadillo_bits/fn_join.hpp | 58 +- inst/include/armadillo_bits/fn_kmeans.hpp | 2 +- inst/include/armadillo_bits/fn_kron.hpp | 8 +- inst/include/armadillo_bits/fn_log_det.hpp | 12 +- .../include/armadillo_bits/fn_log_normpdf.hpp | 12 +- inst/include/armadillo_bits/fn_logmat.hpp | 18 +- inst/include/armadillo_bits/fn_lu.hpp | 12 +- inst/include/armadillo_bits/fn_max.hpp | 34 +- inst/include/armadillo_bits/fn_mean.hpp | 24 +- inst/include/armadillo_bits/fn_median.hpp | 6 +- inst/include/armadillo_bits/fn_min.hpp | 34 +- inst/include/armadillo_bits/fn_misc.hpp | 64 +- inst/include/armadillo_bits/fn_mvnrnd.hpp | 12 +- inst/include/armadillo_bits/fn_n_unique.hpp | 4 +- inst/include/armadillo_bits/fn_nonzeros.hpp | 4 +- inst/include/armadillo_bits/fn_norm.hpp | 18 +- inst/include/armadillo_bits/fn_normalise.hpp | 6 +- inst/include/armadillo_bits/fn_normcdf.hpp | 12 +- inst/include/armadillo_bits/fn_normpdf.hpp | 12 +- inst/include/armadillo_bits/fn_numel.hpp | 10 +- inst/include/armadillo_bits/fn_ones.hpp | 24 +- inst/include/armadillo_bits/fn_orth_null.hpp | 12 +- inst/include/armadillo_bits/fn_pinv.hpp | 12 +- inst/include/armadillo_bits/fn_polyfit.hpp | 6 +- inst/include/armadillo_bits/fn_polyval.hpp | 2 +- inst/include/armadillo_bits/fn_powext.hpp | 16 +- inst/include/armadillo_bits/fn_powmat.hpp | 12 +- inst/include/armadillo_bits/fn_princomp.hpp | 18 +- inst/include/armadillo_bits/fn_prod.hpp | 6 +- inst/include/armadillo_bits/fn_qr.hpp | 20 +- inst/include/armadillo_bits/fn_quantile.hpp | 4 +- inst/include/armadillo_bits/fn_qz.hpp | 6 +- inst/include/armadillo_bits/fn_randg.hpp | 36 +- inst/include/armadillo_bits/fn_randi.hpp | 40 +- inst/include/armadillo_bits/fn_randn.hpp | 48 +- inst/include/armadillo_bits/fn_randperm.hpp | 14 +- inst/include/armadillo_bits/fn_randu.hpp | 48 +- inst/include/armadillo_bits/fn_range.hpp | 6 +- inst/include/armadillo_bits/fn_rank.hpp | 4 +- inst/include/armadillo_bits/fn_regspace.hpp | 24 +- inst/include/armadillo_bits/fn_repelem.hpp | 4 +- inst/include/armadillo_bits/fn_repmat.hpp | 4 +- inst/include/armadillo_bits/fn_reshape.hpp | 16 +- inst/include/armadillo_bits/fn_resize.hpp | 12 +- inst/include/armadillo_bits/fn_reverse.hpp | 8 +- inst/include/armadillo_bits/fn_roots.hpp | 6 +- inst/include/armadillo_bits/fn_schur.hpp | 12 +- inst/include/armadillo_bits/fn_shift.hpp | 12 +- inst/include/armadillo_bits/fn_shuffle.hpp | 6 +- inst/include/armadillo_bits/fn_size.hpp | 46 +- inst/include/armadillo_bits/fn_solve.hpp | 24 +- inst/include/armadillo_bits/fn_sort.hpp | 16 +- inst/include/armadillo_bits/fn_sort_index.hpp | 12 +- inst/include/armadillo_bits/fn_speye.hpp | 12 +- inst/include/armadillo_bits/fn_spones.hpp | 2 +- inst/include/armadillo_bits/fn_sprandn.hpp | 14 +- inst/include/armadillo_bits/fn_sprandu.hpp | 14 +- inst/include/armadillo_bits/fn_spsolve.hpp | 22 +- inst/include/armadillo_bits/fn_sqrtmat.hpp | 18 +- inst/include/armadillo_bits/fn_stddev.hpp | 62 +- inst/include/armadillo_bits/fn_strans.hpp | 8 +- inst/include/armadillo_bits/fn_sum.hpp | 22 +- inst/include/armadillo_bits/fn_svd.hpp | 26 +- inst/include/armadillo_bits/fn_svds.hpp | 26 +- inst/include/armadillo_bits/fn_sylvester.hpp | 6 +- inst/include/armadillo_bits/fn_symmat.hpp | 16 +- inst/include/armadillo_bits/fn_toeplitz.hpp | 6 +- inst/include/armadillo_bits/fn_trace.hpp | 38 +- inst/include/armadillo_bits/fn_trans.hpp | 8 +- inst/include/armadillo_bits/fn_trapz.hpp | 4 +- inst/include/armadillo_bits/fn_trig.hpp | 60 +- inst/include/armadillo_bits/fn_trimat.hpp | 16 +- inst/include/armadillo_bits/fn_trimat_ind.hpp | 8 +- inst/include/armadillo_bits/fn_trunc_exp.hpp | 4 +- inst/include/armadillo_bits/fn_trunc_log.hpp | 4 +- inst/include/armadillo_bits/fn_unique.hpp | 4 +- inst/include/armadillo_bits/fn_var.hpp | 22 +- inst/include/armadillo_bits/fn_vecnorm.hpp | 42 +- inst/include/armadillo_bits/fn_vectorise.hpp | 14 +- inst/include/armadillo_bits/fn_wishrnd.hpp | 24 +- inst/include/armadillo_bits/fn_zeros.hpp | 32 +- .../armadillo_bits/glue_affmul_meat.hpp | 12 +- .../armadillo_bits/glue_atan2_meat.hpp | 16 +- .../include/armadillo_bits/glue_conv_meat.hpp | 12 +- inst/include/armadillo_bits/glue_cor_meat.hpp | 4 +- inst/include/armadillo_bits/glue_cov_meat.hpp | 4 +- .../armadillo_bits/glue_cross_meat.hpp | 4 +- .../include/armadillo_bits/glue_hist_meat.hpp | 12 +- .../armadillo_bits/glue_histc_meat.hpp | 12 +- .../armadillo_bits/glue_hypot_meat.hpp | 8 +- .../armadillo_bits/glue_intersect_meat.hpp | 4 +- .../include/armadillo_bits/glue_join_meat.hpp | 52 +- .../include/armadillo_bits/glue_kron_meat.hpp | 8 +- inst/include/armadillo_bits/glue_max_meat.hpp | 12 +- inst/include/armadillo_bits/glue_min_meat.hpp | 12 +- .../armadillo_bits/glue_mixed_meat.hpp | 56 +- .../armadillo_bits/glue_mvnrnd_meat.hpp | 18 +- .../armadillo_bits/glue_polyfit_meat.hpp | 12 +- .../armadillo_bits/glue_polyval_meat.hpp | 6 +- .../armadillo_bits/glue_powext_meat.hpp | 32 +- .../armadillo_bits/glue_quantile_meat.hpp | 16 +- .../armadillo_bits/glue_relational_meat.hpp | 40 +- .../armadillo_bits/glue_solve_meat.hpp | 158 +- .../armadillo_bits/glue_times_meat.hpp | 151 +- .../armadillo_bits/glue_times_misc_meat.hpp | 52 +- .../armadillo_bits/glue_toeplitz_meat.hpp | 4 +- .../armadillo_bits/glue_trapz_meat.hpp | 18 +- inst/include/armadillo_bits/gmm_diag_meat.hpp | 218 +-- inst/include/armadillo_bits/gmm_full_meat.hpp | 206 +-- inst/include/armadillo_bits/gmm_misc_meat.hpp | 10 +- inst/include/armadillo_bits/injector_meat.hpp | 32 +- inst/include/armadillo_bits/memory.hpp | 2 +- .../armadillo_bits/mtGlueCube_meat.hpp | 6 +- inst/include/armadillo_bits/mtGlue_meat.hpp | 6 +- inst/include/armadillo_bits/mtOpCube_meat.hpp | 14 +- inst/include/armadillo_bits/mtOp_meat.hpp | 14 +- inst/include/armadillo_bits/mtSpGlue_meat.hpp | 4 +- inst/include/armadillo_bits/mtSpOp_bones.hpp | 3 - inst/include/armadillo_bits/mtSpOp_meat.hpp | 8 +- .../armadillo_bits/mtSpToDOp_bones.hpp | 49 + .../include/armadillo_bits/mtSpToDOp_meat.hpp | 55 + inst/include/armadillo_bits/mul_gemm.hpp | 22 +- .../include/armadillo_bits/mul_gemm_mixed.hpp | 4 +- inst/include/armadillo_bits/mul_gemv.hpp | 18 +- inst/include/armadillo_bits/mul_herk.hpp | 12 +- inst/include/armadillo_bits/mul_syrk.hpp | 10 +- .../newarp_DenseGenMatProd_meat.hpp | 4 +- .../newarp_DoubleShiftQR_meat.hpp | 32 +- .../newarp_GenEigsSolver_meat.hpp | 30 +- .../armadillo_bits/newarp_SortEigenvalue.hpp | 4 +- .../newarp_SparseGenMatProd_meat.hpp | 4 +- .../newarp_SparseGenRealShiftSolve_meat.hpp | 14 +- .../newarp_SymEigsShiftSolver_meat.hpp | 4 +- .../newarp_SymEigsSolver_meat.hpp | 30 +- .../newarp_TridiagEigen_meat.hpp | 20 +- .../newarp_UpperHessenbergEigen_meat.hpp | 20 +- .../newarp_UpperHessenbergQR_meat.hpp | 24 +- inst/include/armadillo_bits/op_all_meat.hpp | 20 +- inst/include/armadillo_bits/op_any_meat.hpp | 20 +- .../armadillo_bits/op_chi2rnd_meat.hpp | 12 +- inst/include/armadillo_bits/op_chol_meat.hpp | 12 +- inst/include/armadillo_bits/op_clamp_meat.hpp | 52 +- .../armadillo_bits/op_col_as_mat_meat.hpp | 4 +- inst/include/armadillo_bits/op_cond_meat.hpp | 18 +- inst/include/armadillo_bits/op_cor_meat.hpp | 4 +- inst/include/armadillo_bits/op_cov_meat.hpp | 4 +- .../armadillo_bits/op_cumprod_meat.hpp | 8 +- .../include/armadillo_bits/op_cumsum_meat.hpp | 8 +- .../armadillo_bits/op_cx_scalar_meat.hpp | 24 +- inst/include/armadillo_bits/op_det_meat.hpp | 16 +- .../armadillo_bits/op_diagmat_meat.hpp | 60 +- .../armadillo_bits/op_diagvec_meat.hpp | 42 +- inst/include/armadillo_bits/op_diff_meat.hpp | 8 +- inst/include/armadillo_bits/op_dot_meat.hpp | 129 +- .../include/armadillo_bits/op_dotext_meat.hpp | 10 +- .../include/armadillo_bits/op_expmat_meat.hpp | 24 +- inst/include/armadillo_bits/op_fft_meat.hpp | 14 +- inst/include/armadillo_bits/op_find_meat.hpp | 38 +- .../armadillo_bits/op_find_unique_meat.hpp | 6 +- inst/include/armadillo_bits/op_flip_meat.hpp | 12 +- inst/include/armadillo_bits/op_hist_meat.hpp | 6 +- .../include/armadillo_bits/op_htrans_meat.hpp | 28 +- .../armadillo_bits/op_index_max_meat.hpp | 38 +- .../armadillo_bits/op_index_min_meat.hpp | 38 +- .../armadillo_bits/op_inv_gen_meat.hpp | 48 +- .../armadillo_bits/op_inv_spd_meat.hpp | 56 +- .../armadillo_bits/op_log_det_meat.hpp | 32 +- .../include/armadillo_bits/op_logmat_meat.hpp | 62 +- inst/include/armadillo_bits/op_max_meat.hpp | 88 +- inst/include/armadillo_bits/op_mean_meat.hpp | 46 +- .../include/armadillo_bits/op_median_meat.hpp | 34 +- inst/include/armadillo_bits/op_min_meat.hpp | 88 +- inst/include/armadillo_bits/op_misc_meat.hpp | 16 +- .../armadillo_bits/op_nonzeros_meat.hpp | 6 +- .../armadillo_bits/op_norm2est_meat.hpp | 36 +- inst/include/armadillo_bits/op_norm_meat.hpp | 48 +- .../armadillo_bits/op_normalise_meat.hpp | 12 +- .../armadillo_bits/op_orth_null_meat.hpp | 12 +- inst/include/armadillo_bits/op_pinv_meat.hpp | 20 +- .../include/armadillo_bits/op_powmat_meat.hpp | 24 +- .../armadillo_bits/op_princomp_meat.hpp | 10 +- inst/include/armadillo_bits/op_prod_meat.hpp | 10 +- inst/include/armadillo_bits/op_range_meat.hpp | 10 +- inst/include/armadillo_bits/op_rank_meat.hpp | 12 +- inst/include/armadillo_bits/op_rcond_meat.hpp | 12 +- .../armadillo_bits/op_relational_meat.hpp | 40 +- .../armadillo_bits/op_repelem_meat.hpp | 4 +- .../include/armadillo_bits/op_repmat_meat.hpp | 4 +- .../armadillo_bits/op_reshape_meat.hpp | 14 +- .../include/armadillo_bits/op_resize_meat.hpp | 12 +- .../armadillo_bits/op_reverse_meat.hpp | 6 +- inst/include/armadillo_bits/op_roots_meat.hpp | 8 +- .../armadillo_bits/op_row_as_mat_meat.hpp | 4 +- inst/include/armadillo_bits/op_shift_meat.hpp | 8 +- .../armadillo_bits/op_shuffle_meat.hpp | 16 +- .../armadillo_bits/op_sort_index_meat.hpp | 14 +- inst/include/armadillo_bits/op_sort_meat.hpp | 26 +- .../armadillo_bits/op_sp_diagvec_bones.hpp | 35 + .../armadillo_bits/op_sp_diagvec_meat.hpp | 62 + ...spop_max_bones.hpp => op_sp_max_bones.hpp} | 11 +- .../{spop_max_meat.hpp => op_sp_max_meat.hpp} | 103 +- ...op_mean_bones.hpp => op_sp_mean_bones.hpp} | 24 +- ...spop_mean_meat.hpp => op_sp_mean_meat.hpp} | 183 ++- ...spop_min_bones.hpp => op_sp_min_bones.hpp} | 11 +- .../{spop_min_meat.hpp => op_sp_min_meat.hpp} | 137 +- .../armadillo_bits/op_sp_minus_meat.hpp | 24 +- .../armadillo_bits/op_sp_plus_meat.hpp | 12 +- .../armadillo_bits/op_sp_stddev_bones.hpp | 41 + .../armadillo_bits/op_sp_stddev_meat.hpp | 162 ++ ...spop_sum_bones.hpp => op_sp_sum_bones.hpp} | 6 +- .../{spop_sum_meat.hpp => op_sp_sum_meat.hpp} | 42 +- ...spop_var_bones.hpp => op_sp_var_bones.hpp} | 22 +- .../{spop_var_meat.hpp => op_sp_var_meat.hpp} | 102 +- ...norm_bones.hpp => op_sp_vecnorm_bones.hpp} | 10 +- ...ecnorm_meat.hpp => op_sp_vecnorm_meat.hpp} | 42 +- .../armadillo_bits/op_sqrtmat_meat.hpp | 54 +- .../armadillo_bits/op_stddev_bones.hpp | 11 + .../include/armadillo_bits/op_stddev_meat.hpp | 99 +- .../include/armadillo_bits/op_strans_meat.hpp | 36 +- inst/include/armadillo_bits/op_sum_meat.hpp | 20 +- .../include/armadillo_bits/op_symmat_meat.hpp | 16 +- .../armadillo_bits/op_toeplitz_meat.hpp | 8 +- .../include/armadillo_bits/op_trimat_meat.hpp | 28 +- .../include/armadillo_bits/op_unique_meat.hpp | 10 +- inst/include/armadillo_bits/op_var_meat.hpp | 59 +- .../armadillo_bits/op_vecnorm_meat.hpp | 28 +- .../armadillo_bits/op_vectorise_meat.hpp | 24 +- .../armadillo_bits/op_wishrnd_meat.hpp | 32 +- .../armadillo_bits/operator_cube_div.hpp | 20 +- .../armadillo_bits/operator_cube_minus.hpp | 22 +- .../armadillo_bits/operator_cube_plus.hpp | 22 +- .../operator_cube_relational.hpp | 40 +- .../armadillo_bits/operator_cube_schur.hpp | 12 +- .../armadillo_bits/operator_cube_times.hpp | 12 +- inst/include/armadillo_bits/operator_div.hpp | 32 +- .../include/armadillo_bits/operator_minus.hpp | 52 +- .../armadillo_bits/operator_ostream.hpp | 22 +- inst/include/armadillo_bits/operator_plus.hpp | 50 +- .../armadillo_bits/operator_relational.hpp | 48 +- .../include/armadillo_bits/operator_schur.hpp | 28 +- .../include/armadillo_bits/operator_times.hpp | 44 +- inst/include/armadillo_bits/podarray_meat.hpp | 36 +- .../armadillo_bits/running_stat_meat.hpp | 40 +- .../armadillo_bits/running_stat_vec_meat.hpp | 50 +- .../include/armadillo_bits/sp_auxlib_meat.hpp | 266 ++-- .../armadillo_bits/spdiagview_meat.hpp | 102 +- .../armadillo_bits/spglue_join_meat.hpp | 34 +- .../armadillo_bits/spglue_kron_meat.hpp | 6 +- .../armadillo_bits/spglue_max_meat.hpp | 12 +- .../armadillo_bits/spglue_merge_meat.hpp | 8 +- .../armadillo_bits/spglue_min_meat.hpp | 12 +- .../armadillo_bits/spglue_minus_meat.hpp | 18 +- .../armadillo_bits/spglue_plus_meat.hpp | 14 +- .../armadillo_bits/spglue_relational_meat.hpp | 24 +- .../armadillo_bits/spglue_schur_meat.hpp | 18 +- .../armadillo_bits/spglue_times_meat.hpp | 10 +- .../armadillo_bits/spop_diagmat_meat.hpp | 26 +- .../armadillo_bits/spop_htrans_meat.hpp | 4 +- .../armadillo_bits/spop_misc_bones.hpp | 11 - .../include/armadillo_bits/spop_misc_meat.hpp | 106 +- .../include/armadillo_bits/spop_norm_meat.hpp | 12 +- .../armadillo_bits/spop_normalise_meat.hpp | 8 +- .../armadillo_bits/spop_repmat_meat.hpp | 6 +- .../armadillo_bits/spop_reverse_meat.hpp | 8 +- .../armadillo_bits/spop_shift_meat.hpp | 6 +- .../armadillo_bits/spop_strans_meat.hpp | 6 +- .../armadillo_bits/spop_symmat_meat.hpp | 8 +- .../armadillo_bits/spop_trimat_meat.hpp | 22 +- .../armadillo_bits/spop_vectorise_meat.hpp | 10 +- .../spsolve_factoriser_meat.hpp | 32 +- inst/include/armadillo_bits/strip.hpp | 20 +- .../armadillo_bits/subview_cube_each_meat.hpp | 86 +- .../armadillo_bits/subview_cube_meat.hpp | 198 +-- .../subview_cube_slices_meat.hpp | 80 +- .../armadillo_bits/subview_each_meat.hpp | 104 +- .../armadillo_bits/subview_elem1_meat.hpp | 136 +- .../armadillo_bits/subview_elem2_meat.hpp | 122 +- .../armadillo_bits/subview_field_meat.hpp | 36 +- inst/include/armadillo_bits/subview_meat.hpp | 536 +++---- inst/include/armadillo_bits/sym_helper.hpp | 16 +- inst/include/armadillo_bits/traits.hpp | 31 +- inst/include/armadillo_bits/trimat_helper.hpp | 8 +- inst/include/armadillo_bits/unwrap.hpp | 331 ++-- inst/include/armadillo_bits/unwrap_cube.hpp | 14 +- inst/include/armadillo_bits/unwrap_spmat.hpp | 16 +- .../armadillo_bits/wall_clock_meat.hpp | 8 +- .../armadillo_bits/xtrans_mat_meat.hpp | 4 +- .../armadillo_bits/xvec_htrans_meat.hpp | 4 +- 396 files changed, 8889 insertions(+), 8066 deletions(-) create mode 100644 inst/include/armadillo_bits/mtSpToDOp_bones.hpp create mode 100644 inst/include/armadillo_bits/mtSpToDOp_meat.hpp create mode 100644 inst/include/armadillo_bits/op_sp_diagvec_bones.hpp create mode 100644 inst/include/armadillo_bits/op_sp_diagvec_meat.hpp rename inst/include/armadillo_bits/{spop_max_bones.hpp => op_sp_max_bones.hpp} (79%) rename inst/include/armadillo_bits/{spop_max_meat.hpp => op_sp_max_meat.hpp} (85%) rename inst/include/armadillo_bits/{spop_mean_bones.hpp => op_sp_mean_bones.hpp} (83%) rename inst/include/armadillo_bits/{spop_mean_meat.hpp => op_sp_mean_meat.hpp} (67%) rename inst/include/armadillo_bits/{spop_min_bones.hpp => op_sp_min_bones.hpp} (79%) rename inst/include/armadillo_bits/{spop_min_meat.hpp => op_sp_min_meat.hpp} (85%) create mode 100644 inst/include/armadillo_bits/op_sp_stddev_bones.hpp create mode 100644 inst/include/armadillo_bits/op_sp_stddev_meat.hpp rename inst/include/armadillo_bits/{spop_sum_bones.hpp => op_sp_sum_bones.hpp} (86%) rename inst/include/armadillo_bits/{spop_sum_meat.hpp => op_sp_sum_meat.hpp} (72%) rename inst/include/armadillo_bits/{spop_var_bones.hpp => op_sp_var_bones.hpp} (88%) rename inst/include/armadillo_bits/{spop_var_meat.hpp => op_sp_var_meat.hpp} (78%) rename inst/include/armadillo_bits/{spop_vecnorm_bones.hpp => op_sp_vecnorm_bones.hpp} (79%) rename inst/include/armadillo_bits/{spop_vecnorm_meat.hpp => op_sp_vecnorm_meat.hpp} (74%) diff --git a/inst/include/armadillo b/inst/include/armadillo index b5c888f1..c94313f7 100644 --- a/inst/include/armadillo +++ b/inst/include/armadillo @@ -221,6 +221,7 @@ namespace arma #include "armadillo_bits/OpCube_bones.hpp" #include "armadillo_bits/SpOp_bones.hpp" #include "armadillo_bits/SpToDOp_bones.hpp" + #include "armadillo_bits/mtSpToDOp_bones.hpp" #include "armadillo_bits/eOp_bones.hpp" #include "armadillo_bits/eOpCube_bones.hpp" @@ -316,6 +317,14 @@ namespace arma #include "armadillo_bits/op_rcond_bones.hpp" #include "armadillo_bits/op_sp_plus_bones.hpp" #include "armadillo_bits/op_sp_minus_bones.hpp" + #include "armadillo_bits/op_sp_sum_bones.hpp" + #include "armadillo_bits/op_sp_max_bones.hpp" + #include "armadillo_bits/op_sp_min_bones.hpp" + #include "armadillo_bits/op_sp_mean_bones.hpp" + #include "armadillo_bits/op_sp_var_bones.hpp" + #include "armadillo_bits/op_sp_stddev_bones.hpp" + #include "armadillo_bits/op_sp_vecnorm_bones.hpp" + #include "armadillo_bits/op_sp_diagvec_bones.hpp" #include "armadillo_bits/op_powmat_bones.hpp" #include "armadillo_bits/op_rank_bones.hpp" #include "armadillo_bits/op_row_as_mat_bones.hpp" @@ -352,15 +361,10 @@ namespace arma #include "armadillo_bits/gmm_diag_bones.hpp" #include "armadillo_bits/gmm_full_bones.hpp" - #include "armadillo_bits/spop_max_bones.hpp" - #include "armadillo_bits/spop_min_bones.hpp" - #include "armadillo_bits/spop_sum_bones.hpp" #include "armadillo_bits/spop_strans_bones.hpp" #include "armadillo_bits/spop_htrans_bones.hpp" #include "armadillo_bits/spop_misc_bones.hpp" #include "armadillo_bits/spop_diagmat_bones.hpp" - #include "armadillo_bits/spop_mean_bones.hpp" - #include "armadillo_bits/spop_var_bones.hpp" #include "armadillo_bits/spop_trimat_bones.hpp" #include "armadillo_bits/spop_symmat_bones.hpp" #include "armadillo_bits/spop_normalise_bones.hpp" @@ -368,7 +372,6 @@ namespace arma #include "armadillo_bits/spop_repmat_bones.hpp" #include "armadillo_bits/spop_vectorise_bones.hpp" #include "armadillo_bits/spop_norm_bones.hpp" - #include "armadillo_bits/spop_vecnorm_bones.hpp" #include "armadillo_bits/spop_shift_bones.hpp" #include "armadillo_bits/spglue_plus_bones.hpp" @@ -620,6 +623,7 @@ namespace arma #include "armadillo_bits/OpCube_meat.hpp" #include "armadillo_bits/SpOp_meat.hpp" #include "armadillo_bits/SpToDOp_meat.hpp" + #include "armadillo_bits/mtSpToDOp_meat.hpp" #include "armadillo_bits/mtOp_meat.hpp" #include "armadillo_bits/mtOpCube_meat.hpp" @@ -764,6 +768,14 @@ namespace arma #include "armadillo_bits/op_rcond_meat.hpp" #include "armadillo_bits/op_sp_plus_meat.hpp" #include "armadillo_bits/op_sp_minus_meat.hpp" + #include "armadillo_bits/op_sp_sum_meat.hpp" + #include "armadillo_bits/op_sp_max_meat.hpp" + #include "armadillo_bits/op_sp_min_meat.hpp" + #include "armadillo_bits/op_sp_mean_meat.hpp" + #include "armadillo_bits/op_sp_var_meat.hpp" + #include "armadillo_bits/op_sp_stddev_meat.hpp" + #include "armadillo_bits/op_sp_vecnorm_meat.hpp" + #include "armadillo_bits/op_sp_diagvec_meat.hpp" #include "armadillo_bits/op_powmat_meat.hpp" #include "armadillo_bits/op_rank_meat.hpp" #include "armadillo_bits/op_row_as_mat_meat.hpp" @@ -800,15 +812,10 @@ namespace arma #include "armadillo_bits/gmm_diag_meat.hpp" #include "armadillo_bits/gmm_full_meat.hpp" - #include "armadillo_bits/spop_max_meat.hpp" - #include "armadillo_bits/spop_min_meat.hpp" - #include "armadillo_bits/spop_sum_meat.hpp" #include "armadillo_bits/spop_strans_meat.hpp" #include "armadillo_bits/spop_htrans_meat.hpp" #include "armadillo_bits/spop_misc_meat.hpp" #include "armadillo_bits/spop_diagmat_meat.hpp" - #include "armadillo_bits/spop_mean_meat.hpp" - #include "armadillo_bits/spop_var_meat.hpp" #include "armadillo_bits/spop_trimat_meat.hpp" #include "armadillo_bits/spop_symmat_meat.hpp" #include "armadillo_bits/spop_normalise_meat.hpp" @@ -816,7 +823,6 @@ namespace arma #include "armadillo_bits/spop_repmat_meat.hpp" #include "armadillo_bits/spop_vectorise_meat.hpp" #include "armadillo_bits/spop_norm_meat.hpp" - #include "armadillo_bits/spop_vecnorm_meat.hpp" #include "armadillo_bits/spop_shift_meat.hpp" #include "armadillo_bits/spglue_plus_meat.hpp" diff --git a/inst/include/armadillo_bits/BaseCube_meat.hpp b/inst/include/armadillo_bits/BaseCube_meat.hpp index 2d0df91e..b521629f 100644 --- a/inst/include/armadillo_bits/BaseCube_meat.hpp +++ b/inst/include/armadillo_bits/BaseCube_meat.hpp @@ -36,7 +36,7 @@ inline void BaseCube::print(const std::string extra_text) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_cube tmp( (*this).get_ref() ); @@ -59,7 +59,7 @@ inline void BaseCube::print(std::ostream& user_stream, const std::string extra_text) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_cube tmp( (*this).get_ref() ); @@ -82,7 +82,7 @@ inline void BaseCube::raw_print(const std::string extra_text) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_cube tmp( (*this).get_ref() ); @@ -105,7 +105,7 @@ inline void BaseCube::raw_print(std::ostream& user_stream, const std::string extra_text) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_cube tmp( (*this).get_ref() ); @@ -128,7 +128,7 @@ inline void BaseCube::brief_print(const std::string extra_text) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_cube tmp( (*this).get_ref() ); @@ -151,7 +151,7 @@ inline void BaseCube::brief_print(std::ostream& user_stream, const std::string extra_text) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_cube tmp( (*this).get_ref() ); @@ -200,7 +200,7 @@ BaseCube::index_min() const if(P.get_n_elem() == 0) { - arma_debug_check(true, "index_min(): object has no elements"); + arma_conform_check(true, "index_min(): object has no elements"); } else { @@ -223,7 +223,7 @@ BaseCube::index_max() const if(P.get_n_elem() == 0) { - arma_debug_check(true, "index_max(): object has no elements"); + arma_conform_check(true, "index_max(): object has no elements"); } else { @@ -240,11 +240,11 @@ inline bool BaseCube::is_zero(const typename get_pod_type::result tol) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; - arma_debug_check( (tol < T(0)), "is_zero(): parameter 'tol' must be >= 0" ); + arma_conform_check( (tol < T(0)), "is_zero(): parameter 'tol' must be >= 0" ); if(ProxyCube::use_at || is_Cube::stored_type>::value) { @@ -292,7 +292,7 @@ inline bool BaseCube::is_empty() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const ProxyCube P( (*this).get_ref() ); @@ -306,9 +306,9 @@ inline bool BaseCube::is_finite() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "is_finite(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_conform_warn(1, "is_finite(): detection of non-finite values is not reliable in fast math mode"); } if(is_Cube::stored_type>::value) { @@ -342,9 +342,9 @@ inline bool BaseCube::has_inf() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "has_inf(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_inf(): detection of non-finite values is not reliable in fast math mode"); } if(is_Cube::stored_type>::value) { @@ -378,9 +378,9 @@ inline bool BaseCube::has_nan() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "has_nan(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_nan(): detection of non-finite values is not reliable in fast math mode"); } if(is_Cube::stored_type>::value) { @@ -414,9 +414,9 @@ inline bool BaseCube::has_nonfinite() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "has_nonfinite(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_nonfinite(): detection of non-finite values is not reliable in fast math mode"); } if(is_Cube::stored_type>::value) { @@ -473,7 +473,7 @@ arma_inline const derived& BaseCube_eval_Cube::eval() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return static_cast(*this); } @@ -488,7 +488,7 @@ inline Cube BaseCube_eval_expr::eval() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Cube( static_cast(*this) ); } diff --git a/inst/include/armadillo_bits/Base_meat.hpp b/inst/include/armadillo_bits/Base_meat.hpp index 646f33aa..85fd36e0 100644 --- a/inst/include/armadillo_bits/Base_meat.hpp +++ b/inst/include/armadillo_bits/Base_meat.hpp @@ -36,7 +36,7 @@ inline void Base::print(const std::string extra_text) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap tmp( (*this).get_ref() ); @@ -59,7 +59,7 @@ inline void Base::print(std::ostream& user_stream, const std::string extra_text) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap tmp( (*this).get_ref() ); @@ -82,7 +82,7 @@ inline void Base::raw_print(const std::string extra_text) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap tmp( (*this).get_ref() ); @@ -105,7 +105,7 @@ inline void Base::raw_print(std::ostream& user_stream, const std::string extra_text) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap tmp( (*this).get_ref() ); @@ -128,7 +128,7 @@ inline void Base::brief_print(const std::string extra_text) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap tmp( (*this).get_ref() ); @@ -151,7 +151,7 @@ inline void Base::brief_print(std::ostream& user_stream, const std::string extra_text) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap tmp( (*this).get_ref() ); @@ -266,7 +266,7 @@ Base::index_min() const if(P.get_n_elem() == 0) { - arma_debug_check(true, "index_min(): object has no elements"); + arma_conform_check(true, "index_min(): object has no elements"); } else { @@ -289,7 +289,7 @@ Base::index_max() const if(P.get_n_elem() == 0) { - arma_debug_check(true, "index_max(): object has no elements"); + arma_conform_check(true, "index_max(): object has no elements"); } else { @@ -306,7 +306,7 @@ inline bool Base::is_symmetric() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap U( (*this).get_ref() ); @@ -346,13 +346,13 @@ inline bool Base::is_symmetric(const typename get_pod_type::result tol) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; if(tol == T(0)) { return (*this).is_symmetric(); } - arma_debug_check( (tol < T(0)), "is_symmetric(): parameter 'tol' must be >= 0" ); + arma_conform_check( (tol < T(0)), "is_symmetric(): parameter 'tol' must be >= 0" ); const quasi_unwrap U( (*this).get_ref() ); @@ -377,7 +377,7 @@ inline bool Base::is_hermitian() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -429,13 +429,13 @@ inline bool Base::is_hermitian(const typename get_pod_type::result tol) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; if(tol == T(0)) { return (*this).is_hermitian(); } - arma_debug_check( (tol < T(0)), "is_hermitian(): parameter 'tol' must be >= 0" ); + arma_conform_check( (tol < T(0)), "is_hermitian(): parameter 'tol' must be >= 0" ); const quasi_unwrap U( (*this).get_ref() ); @@ -460,11 +460,11 @@ inline bool Base::is_zero(const typename get_pod_type::result tol) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; - arma_debug_check( (tol < T(0)), "is_zero(): parameter 'tol' must be >= 0" ); + arma_conform_check( (tol < T(0)), "is_zero(): parameter 'tol' must be >= 0" ); if(Proxy::use_at || is_Mat::stored_type>::value) { @@ -512,7 +512,7 @@ inline bool Base::is_trimatu() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap U( (*this).get_ref() ); @@ -530,7 +530,7 @@ inline bool Base::is_trimatl() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap U( (*this).get_ref() ); @@ -548,7 +548,7 @@ inline bool Base::is_diagmat() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap U( (*this).get_ref() ); @@ -587,7 +587,7 @@ inline bool Base::is_empty() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Proxy P( (*this).get_ref() ); @@ -601,7 +601,7 @@ inline bool Base::is_square() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Proxy P( (*this).get_ref() ); @@ -615,7 +615,7 @@ inline bool Base::is_vec() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if( (Proxy::is_row) || (Proxy::is_col) || (Proxy::is_xvec) ) { return true; } @@ -631,7 +631,7 @@ inline bool Base::is_colvec() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(Proxy::is_col) { return true; } @@ -647,7 +647,7 @@ inline bool Base::is_rowvec() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(Proxy::is_row) { return true; } @@ -663,9 +663,9 @@ inline bool Base::is_finite() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "is_finite(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_conform_warn(1, "is_finite(): detection of non-finite values is not reliable in fast math mode"); } if(is_Mat::stored_type>::value) { @@ -711,9 +711,9 @@ inline bool Base::has_inf() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "has_inf(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_inf(): detection of non-finite values is not reliable in fast math mode"); } if(is_Mat::stored_type>::value) { @@ -759,9 +759,9 @@ inline bool Base::has_nan() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "has_nan(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_nan(): detection of non-finite values is not reliable in fast math mode"); } if(is_Mat::stored_type>::value) { @@ -807,9 +807,9 @@ inline bool Base::has_nonfinite() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "has_nonfinite(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_nonfinite(): detection of non-finite values is not reliable in fast math mode"); } if(is_Mat::stored_type>::value) { @@ -888,7 +888,7 @@ inline bool Base_extra_yes::is_sympd() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -913,11 +913,11 @@ inline bool Base_extra_yes::is_sympd(typename get_pod_type::result tol) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; - arma_debug_check( (tol < T(0)), "is_sympd(): parameter 'tol' must be >= 0" ); + arma_conform_check( (tol < T(0)), "is_sympd(): parameter 'tol' must be >= 0" ); Mat X = static_cast(*this); @@ -940,7 +940,7 @@ arma_inline const derived& Base_eval_Mat::eval() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return static_cast(*this); } @@ -955,7 +955,7 @@ inline Mat Base_eval_expr::eval() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Mat( static_cast(*this) ); } diff --git a/inst/include/armadillo_bits/Col_meat.hpp b/inst/include/armadillo_bits/Col_meat.hpp index a6a1945f..cbbf7c43 100644 --- a/inst/include/armadillo_bits/Col_meat.hpp +++ b/inst/include/armadillo_bits/Col_meat.hpp @@ -26,7 +26,7 @@ inline Col::Col() : Mat(arma_vec_indicator(), 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -36,7 +36,7 @@ inline Col::Col(const Col& X) : Mat(arma_vec_indicator(), X.n_elem, 1, 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arrayops::copy((*this).memptr(), X.memptr(), X.n_elem); } @@ -49,13 +49,11 @@ inline Col::Col(const uword in_n_elem) : Mat(arma_vec_indicator(), in_n_elem, 1, 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - if(arma_config::zero_init) - { - arma_extra_debug_print("Col::constructor: zeroing memory"); - arrayops::fill_zeros(Mat::memptr(), Mat::n_elem); - } + arma_debug_print("Col::constructor: zeroing memory"); + + arrayops::fill_zeros(Mat::memptr(), Mat::n_elem); } @@ -65,15 +63,13 @@ inline Col::Col(const uword in_n_rows, const uword in_n_cols) : Mat(arma_vec_indicator(), 0, 0, 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::init_warm(in_n_rows, in_n_cols); - if(arma_config::zero_init) - { - arma_extra_debug_print("Col::constructor: zeroing memory"); - arrayops::fill_zeros(Mat::memptr(), Mat::n_elem); - } + arma_debug_print("Col::constructor: zeroing memory"); + + arrayops::fill_zeros(Mat::memptr(), Mat::n_elem); } @@ -83,15 +79,13 @@ inline Col::Col(const SizeMat& s) : Mat(arma_vec_indicator(), 0, 0, 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::init_warm(s.n_rows, s.n_cols); - if(arma_config::zero_init) - { - arma_extra_debug_print("Col::constructor: zeroing memory"); - arrayops::fill_zeros(Mat::memptr(), Mat::n_elem); - } + arma_debug_print("Col::constructor: zeroing memory"); + + arrayops::fill_zeros(Mat::memptr(), Mat::n_elem); } @@ -103,11 +97,11 @@ inline Col::Col(const uword in_n_elem, const arma_initmode_indicator&) : Mat(arma_vec_indicator(), in_n_elem, 1, 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(do_zeros) { - arma_extra_debug_print("Col::constructor: zeroing memory"); + arma_debug_print("Col::constructor: zeroing memory"); arrayops::fill_zeros(Mat::memptr(), Mat::n_elem); } } @@ -121,13 +115,13 @@ inline Col::Col(const uword in_n_rows, const uword in_n_cols, const arma_initmode_indicator&) : Mat(arma_vec_indicator(), 0, 0, 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::init_warm(in_n_rows, in_n_cols); if(do_zeros) { - arma_extra_debug_print("Col::constructor: zeroing memory"); + arma_debug_print("Col::constructor: zeroing memory"); arrayops::fill_zeros(Mat::memptr(), Mat::n_elem); } } @@ -141,13 +135,13 @@ inline Col::Col(const SizeMat& s, const arma_initmode_indicator&) : Mat(arma_vec_indicator(), 0, 0, 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::init_warm(s.n_rows, s.n_cols); if(do_zeros) { - arma_extra_debug_print("Col::constructor: zeroing memory"); + arma_debug_print("Col::constructor: zeroing memory"); arrayops::fill_zeros(Mat::memptr(), Mat::n_elem); } } @@ -160,7 +154,7 @@ inline Col::Col(const uword in_n_elem, const fill::fill_class& f) : Mat(arma_vec_indicator(), in_n_elem, 1, 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).fill(f); } @@ -173,7 +167,7 @@ inline Col::Col(const uword in_n_rows, const uword in_n_cols, const fill::fill_class& f) : Mat(arma_vec_indicator(), 0, 0, 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::init_warm(in_n_rows, in_n_cols); @@ -188,7 +182,7 @@ inline Col::Col(const SizeMat& s, const fill::fill_class& f) : Mat(arma_vec_indicator(), 0, 0, 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::init_warm(s.n_rows, s.n_cols); @@ -202,7 +196,7 @@ inline Col::Col(const uword in_n_elem, const fill::scalar_holder f) : Mat(arma_vec_indicator(), in_n_elem, 1, 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).fill(f.scalar); } @@ -214,7 +208,7 @@ inline Col::Col(const uword in_n_rows, const uword in_n_cols, const fill::scalar_holder f) : Mat(arma_vec_indicator(), 0, 0, 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::init_warm(in_n_rows, in_n_cols); @@ -228,7 +222,7 @@ inline Col::Col(const SizeMat& s, const fill::scalar_holder f) : Mat(arma_vec_indicator(), 0, 0, 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::init_warm(s.n_rows, s.n_cols); @@ -242,7 +236,7 @@ inline Col::Col(const char* text) : Mat(arma_vec_indicator(), 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).operator=(text); } @@ -254,11 +248,11 @@ inline Col& Col::operator=(const char* text) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat tmp(text); - arma_debug_check( ((tmp.n_elem > 0) && (tmp.is_vec() == false)), "Mat::init(): requested size is not compatible with column vector layout" ); + arma_conform_check( ((tmp.n_elem > 0) && (tmp.is_vec() == false)), "Mat::init(): requested size is not compatible with column vector layout" ); access::rw(tmp.n_rows) = tmp.n_elem; access::rw(tmp.n_cols) = 1; @@ -275,7 +269,7 @@ inline Col::Col(const std::string& text) : Mat(arma_vec_indicator(), 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).operator=(text); } @@ -287,11 +281,11 @@ inline Col& Col::operator=(const std::string& text) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat tmp(text); - arma_debug_check( ((tmp.n_elem > 0) && (tmp.is_vec() == false)), "Mat::init(): requested size is not compatible with column vector layout" ); + arma_conform_check( ((tmp.n_elem > 0) && (tmp.is_vec() == false)), "Mat::init(): requested size is not compatible with column vector layout" ); access::rw(tmp.n_rows) = tmp.n_elem; access::rw(tmp.n_cols) = 1; @@ -309,7 +303,7 @@ inline Col::Col(const std::vector& x) : Mat(arma_vec_indicator(), uword(x.size()), 1, 1) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); const uword N = uword(x.size()); @@ -324,7 +318,7 @@ inline Col& Col::operator=(const std::vector& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N = uword(x.size()); @@ -342,7 +336,7 @@ inline Col::Col(const std::initializer_list& list) : Mat(arma_vec_indicator(), uword(list.size()), 1, 1) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); const uword N = uword(list.size()); @@ -356,7 +350,7 @@ inline Col& Col::operator=(const std::initializer_list& list) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N = uword(list.size()); @@ -374,7 +368,7 @@ inline Col::Col(Col&& X) : Mat(arma_vec_indicator(), 1) { - arma_extra_debug_sigprint(arma_str::format("this = %x X = %x") % this % &X); + arma_debug_sigprint(arma_str::format("this: %x; X: %x") % this % &X); access::rw(Mat::n_rows) = X.n_rows; access::rw(Mat::n_cols) = 1; @@ -416,7 +410,7 @@ inline Col& Col::operator=(Col&& X) { - arma_extra_debug_sigprint(arma_str::format("this = %x X = %x") % this % &X); + arma_debug_sigprint(arma_str::format("this: %x; X: %x") % this % &X); (*this).steal_mem(X, true); @@ -430,7 +424,7 @@ Col::operator=(Col&& X) // Col::Col(Mat&& X) // : Mat(arma_vec_indicator(), 1) // { -// arma_extra_debug_sigprint(arma_str::format("this = %x X = %x") % this % &X); +// arma_debug_sigprint(arma_str::format("this: %x; X: %x") % this % &X); // // if(X.n_cols != 1) { const Mat& XX = X; Mat::operator=(XX); return; } // @@ -472,7 +466,7 @@ Col::operator=(Col&& X) // Col& // Col::operator=(Mat&& X) // { -// arma_extra_debug_sigprint(arma_str::format("this = %x X = %x") % this % &X); +// arma_debug_sigprint(arma_str::format("this: %x; X: %x") % this % &X); // // if(X.n_cols != 1) { const Mat& XX = X; Mat::operator=(XX); return *this; } // @@ -488,7 +482,7 @@ inline Col& Col::operator=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::operator=(val); @@ -502,7 +496,7 @@ inline Col& Col::operator=(const Col& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::operator=(X); @@ -517,7 +511,7 @@ inline Col::Col(const Base& X) : Mat(arma_vec_indicator(), 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::operator=(X.get_ref()); } @@ -530,7 +524,7 @@ inline Col& Col::operator=(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::operator=(X.get_ref()); @@ -545,7 +539,7 @@ inline Col::Col(const SpBase& X) : Mat(arma_vec_indicator(), 1) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); Mat::operator=(X.get_ref()); } @@ -558,7 +552,7 @@ inline Col& Col::operator=(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::operator=(X.get_ref()); @@ -573,7 +567,7 @@ inline Col::Col(eT* aux_mem, const uword aux_length, const bool copy_aux_mem, const bool strict) : Mat(aux_mem, aux_length, 1, copy_aux_mem, strict) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); access::rw(Mat::vec_state) = 1; } @@ -586,7 +580,7 @@ inline Col::Col(const eT* aux_mem, const uword aux_length) : Mat(aux_mem, aux_length, 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); access::rw(Mat::vec_state) = 1; } @@ -602,7 +596,7 @@ Col::Col const Base::pod_type, T2>& B ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); access::rw(Mat::vec_state) = 1; @@ -616,7 +610,7 @@ template inline Col::Col(const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); access::rw(Mat::vec_state) = 1; @@ -631,7 +625,7 @@ inline Col& Col::operator=(const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::operator=(X); @@ -644,7 +638,7 @@ template inline Col::Col(const subview_cube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); access::rw(Mat::vec_state) = 1; @@ -658,7 +652,7 @@ inline Col& Col::operator=(const subview_cube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::operator=(X); @@ -722,9 +716,9 @@ arma_inline subview_col Col::row(const uword in_row1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (in_row1 >= Mat::n_rows), "Col::row(): indices out of bounds or incorrectly used" ); + arma_conform_check_bounds( (in_row1 >= Mat::n_rows), "Col::row(): indices out of bounds or incorrectly used" ); return subview_col(*this, 0, in_row1, 1); } @@ -736,9 +730,9 @@ arma_inline const subview_col Col::row(const uword in_row1) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (in_row1 >= Mat::n_rows), "Col::row(): indices out of bounds or incorrectly used" ); + arma_conform_check_bounds( (in_row1 >= Mat::n_rows), "Col::row(): indices out of bounds or incorrectly used" ); return subview_col(*this, 0, in_row1, 1); } @@ -750,9 +744,9 @@ arma_inline subview_col Col::rows(const uword in_row1, const uword in_row2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( ( (in_row1 > in_row2) || (in_row2 >= Mat::n_rows) ), "Col::rows(): indices out of bounds or incorrectly used" ); + arma_conform_check_bounds( ( (in_row1 > in_row2) || (in_row2 >= Mat::n_rows) ), "Col::rows(): indices out of bounds or incorrectly used" ); const uword subview_n_rows = in_row2 - in_row1 + 1; @@ -766,9 +760,9 @@ arma_inline const subview_col Col::rows(const uword in_row1, const uword in_row2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( ( (in_row1 > in_row2) || (in_row2 >= Mat::n_rows) ), "Col::rows(): indices out of bounds or incorrectly used" ); + arma_conform_check_bounds( ( (in_row1 > in_row2) || (in_row2 >= Mat::n_rows) ), "Col::rows(): indices out of bounds or incorrectly used" ); const uword subview_n_rows = in_row2 - in_row1 + 1; @@ -782,9 +776,9 @@ arma_inline subview_col Col::subvec(const uword in_row1, const uword in_row2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( ( (in_row1 > in_row2) || (in_row2 >= Mat::n_rows) ), "Col::subvec(): indices out of bounds or incorrectly used" ); + arma_conform_check_bounds( ( (in_row1 > in_row2) || (in_row2 >= Mat::n_rows) ), "Col::subvec(): indices out of bounds or incorrectly used" ); const uword subview_n_rows = in_row2 - in_row1 + 1; @@ -798,9 +792,9 @@ arma_inline const subview_col Col::subvec(const uword in_row1, const uword in_row2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( ( (in_row1 > in_row2) || (in_row2 >= Mat::n_rows) ), "Col::subvec(): indices out of bounds or incorrectly used" ); + arma_conform_check_bounds( ( (in_row1 > in_row2) || (in_row2 >= Mat::n_rows) ), "Col::subvec(): indices out of bounds or incorrectly used" ); const uword subview_n_rows = in_row2 - in_row1 + 1; @@ -814,7 +808,7 @@ arma_inline subview_col Col::rows(const span& row_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subvec(row_span); } @@ -826,7 +820,7 @@ arma_inline const subview_col Col::rows(const span& row_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subvec(row_span); } @@ -838,7 +832,7 @@ arma_inline subview_col Col::subvec(const span& row_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool row_all = row_span.whole; @@ -848,7 +842,7 @@ Col::subvec(const span& row_span) const uword in_row2 = row_span.b; const uword subvec_n_rows = row_all ? local_n_rows : in_row2 - in_row1 + 1; - arma_debug_check_bounds( ( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= local_n_rows)) ), "Col::subvec(): indices out of bounds or incorrectly used" ); + arma_conform_check_bounds( ( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= local_n_rows)) ), "Col::subvec(): indices out of bounds or incorrectly used" ); return subview_col(*this, 0, in_row1, subvec_n_rows); } @@ -860,7 +854,7 @@ arma_inline const subview_col Col::subvec(const span& row_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool row_all = row_span.whole; @@ -870,7 +864,7 @@ Col::subvec(const span& row_span) const const uword in_row2 = row_span.b; const uword subvec_n_rows = row_all ? local_n_rows : in_row2 - in_row1 + 1; - arma_debug_check_bounds( ( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= local_n_rows)) ), "Col::subvec(): indices out of bounds or incorrectly used" ); + arma_conform_check_bounds( ( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= local_n_rows)) ), "Col::subvec(): indices out of bounds or incorrectly used" ); return subview_col(*this, 0, in_row1, subvec_n_rows); } @@ -882,7 +876,7 @@ arma_inline subview_col Col::operator()(const span& row_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subvec(row_span); } @@ -894,7 +888,7 @@ arma_inline const subview_col Col::operator()(const span& row_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subvec(row_span); } @@ -906,11 +900,11 @@ arma_inline subview_col Col::subvec(const uword start_row, const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (s.n_cols != 1), "Col::subvec(): given size does not specify a column vector" ); + arma_conform_check( (s.n_cols != 1), "Col::subvec(): given size does not specify a column vector" ); - arma_debug_check_bounds( ( (start_row >= Mat::n_rows) || ((start_row + s.n_rows) > Mat::n_rows) ), "Col::subvec(): size out of bounds" ); + arma_conform_check_bounds( ( (start_row >= Mat::n_rows) || ((start_row + s.n_rows) > Mat::n_rows) ), "Col::subvec(): size out of bounds" ); return subview_col(*this, 0, start_row, s.n_rows); } @@ -922,11 +916,11 @@ arma_inline const subview_col Col::subvec(const uword start_row, const SizeMat& s) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (s.n_cols != 1), "Col::subvec(): given size does not specify a column vector" ); + arma_conform_check( (s.n_cols != 1), "Col::subvec(): given size does not specify a column vector" ); - arma_debug_check_bounds( ( (start_row >= Mat::n_rows) || ((start_row + s.n_rows) > Mat::n_rows) ), "Col::subvec(): size out of bounds" ); + arma_conform_check_bounds( ( (start_row >= Mat::n_rows) || ((start_row + s.n_rows) > Mat::n_rows) ), "Col::subvec(): size out of bounds" ); return subview_col(*this, 0, start_row, s.n_rows); } @@ -938,9 +932,9 @@ arma_inline subview_col Col::head(const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > Mat::n_rows), "Col::head(): size out of bounds" ); + arma_conform_check_bounds( (N > Mat::n_rows), "Col::head(): size out of bounds" ); return subview_col(*this, 0, 0, N); } @@ -952,9 +946,9 @@ arma_inline const subview_col Col::head(const uword N) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > Mat::n_rows), "Col::head(): size out of bounds" ); + arma_conform_check_bounds( (N > Mat::n_rows), "Col::head(): size out of bounds" ); return subview_col(*this, 0, 0, N); } @@ -966,9 +960,9 @@ arma_inline subview_col Col::tail(const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > Mat::n_rows), "Col::tail(): size out of bounds" ); + arma_conform_check_bounds( (N > Mat::n_rows), "Col::tail(): size out of bounds" ); const uword start_row = Mat::n_rows - N; @@ -982,9 +976,9 @@ arma_inline const subview_col Col::tail(const uword N) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > Mat::n_rows), "Col::tail(): size out of bounds" ); + arma_conform_check_bounds( (N > Mat::n_rows), "Col::tail(): size out of bounds" ); const uword start_row = Mat::n_rows - N; @@ -998,7 +992,7 @@ arma_inline subview_col Col::head_rows(const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).head(N); } @@ -1010,7 +1004,7 @@ arma_inline const subview_col Col::head_rows(const uword N) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).head(N); } @@ -1022,7 +1016,7 @@ arma_inline subview_col Col::tail_rows(const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).tail(N); } @@ -1034,7 +1028,7 @@ arma_inline const subview_col Col::tail_rows(const uword N) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).tail(N); } @@ -1047,9 +1041,9 @@ inline void Col::shed_row(const uword row_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( row_num >= Mat::n_rows, "Col::shed_row(): index out of bounds" ); + arma_conform_check_bounds( row_num >= Mat::n_rows, "Col::shed_row(): index out of bounds" ); shed_rows(row_num, row_num); } @@ -1062,9 +1056,9 @@ inline void Col::shed_rows(const uword in_row1, const uword in_row2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_row2 >= Mat::n_rows), "Col::shed_rows(): indices out of bounds or incorrectly used" @@ -1100,7 +1094,7 @@ inline void Col::shed_rows(const Base& indices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::shed_rows(indices); } @@ -1112,7 +1106,7 @@ inline void Col::insert_rows(const uword row_num, const uword N, const bool set_to_zero) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(set_to_zero); @@ -1126,7 +1120,7 @@ inline void Col::insert_rows(const uword row_num, const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword t_n_rows = Mat::n_rows; @@ -1134,7 +1128,7 @@ Col::insert_rows(const uword row_num, const uword N) const uword B_n_rows = t_n_rows - row_num; // insertion at row_num == n_rows is in effect an append operation - arma_debug_check_bounds( (row_num > t_n_rows), "Col::insert_rows(): index out of bounds" ); + arma_conform_check_bounds( (row_num > t_n_rows), "Col::insert_rows(): index out of bounds" ); if(N == 0) { return; } @@ -1168,7 +1162,7 @@ inline void Col::insert_rows(const uword row_num, const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::insert_rows(row_num, X); } @@ -1220,9 +1214,9 @@ inline typename Col::row_iterator Col::begin_row(const uword row_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (row_num >= Mat::n_rows), "Col::begin_row(): index out of bounds" ); + arma_conform_check_bounds( (row_num >= Mat::n_rows), "Col::begin_row(): index out of bounds" ); return Mat::memptr() + row_num; } @@ -1234,9 +1228,9 @@ inline typename Col::const_row_iterator Col::begin_row(const uword row_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (row_num >= Mat::n_rows), "Col::begin_row(): index out of bounds" ); + arma_conform_check_bounds( (row_num >= Mat::n_rows), "Col::begin_row(): index out of bounds" ); return Mat::memptr() + row_num; } @@ -1248,9 +1242,9 @@ inline typename Col::row_iterator Col::end_row(const uword row_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (row_num >= Mat::n_rows), "Col::end_row(): index out of bounds" ); + arma_conform_check_bounds( (row_num >= Mat::n_rows), "Col::end_row(): index out of bounds" ); return Mat::memptr() + row_num + 1; } @@ -1262,9 +1256,9 @@ inline typename Col::const_row_iterator Col::end_row(const uword row_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (row_num >= Mat::n_rows), "Col::end_row(): index out of bounds" ); + arma_conform_check_bounds( (row_num >= Mat::n_rows), "Col::end_row(): index out of bounds" ); return Mat::memptr() + row_num + 1; } @@ -1277,16 +1271,13 @@ arma_inline Col::fixed::fixed() : Col( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); - if(arma_config::zero_init) - { - arma_extra_debug_print("Col::fixed::constructor: zeroing memory"); - - eT* mem_use = (use_extra) ? &(mem_local_extra[0]) : &(Mat::mem_local[0]); - - arrayops::inplace_set_fixed( mem_use, eT(0) ); - } + arma_debug_print("Col::fixed::constructor: zeroing memory"); + + eT* mem_use = (use_extra) ? &(mem_local_extra[0]) : &(Mat::mem_local[0]); + + arrayops::inplace_set_fixed( mem_use, eT(0) ); } @@ -1297,7 +1288,7 @@ arma_inline Col::fixed::fixed(const fixed& X) : Col( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); eT* dest = (use_extra) ? mem_local_extra : Mat::mem_local; const eT* src = (use_extra) ? X.mem_local_extra : X.mem_local; @@ -1313,7 +1304,7 @@ arma_inline Col::fixed::fixed(const subview_cube& X) : Col( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); Col::operator=(X); } @@ -1326,7 +1317,7 @@ inline Col::fixed::fixed(const fill::scalar_holder f) : Col( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); (*this).fill(f.scalar); } @@ -1340,7 +1331,7 @@ inline Col::fixed::fixed(const fill::fill_class&) : Col( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); if(is_same_type::yes) { (*this).zeros(); } if(is_same_type::yes) { (*this).ones(); } @@ -1358,7 +1349,7 @@ arma_inline Col::fixed::fixed(const Base& A) : Col( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); Col::operator=(A.get_ref()); } @@ -1372,7 +1363,7 @@ arma_inline Col::fixed::fixed(const Base& A, const Base& B) : Col( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); Col::init(A,B); } @@ -1385,7 +1376,7 @@ inline Col::fixed::fixed(const eT* aux_mem) : Col( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); eT* dest = (use_extra) ? mem_local_extra : Mat::mem_local; @@ -1400,7 +1391,7 @@ inline Col::fixed::fixed(const char* text) : Col( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); Col::operator=(text); } @@ -1413,7 +1404,7 @@ inline Col::fixed::fixed(const std::string& text) : Col( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); Col::operator=(text); } @@ -1426,7 +1417,7 @@ template Col& Col::fixed::operator=(const Base& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Col::operator=(A.get_ref()); @@ -1440,7 +1431,7 @@ template Col& Col::fixed::operator=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Col::operator=(val); @@ -1454,7 +1445,7 @@ template Col& Col::fixed::operator=(const char* text) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Col::operator=(text); @@ -1468,7 +1459,7 @@ template Col& Col::fixed::operator=(const std::string& text) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Col::operator=(text); @@ -1482,7 +1473,7 @@ template Col& Col::fixed::operator=(const subview_cube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Col::operator=(X); @@ -1497,7 +1488,7 @@ inline Col::fixed::fixed(const std::initializer_list& list) : Col( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); (*this).operator=(list); } @@ -1510,11 +1501,11 @@ inline Col& Col::fixed::operator=(const std::initializer_list& list) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N = uword(list.size()); - arma_debug_check( (N > fixed_n_elem), "Col::fixed: initialiser list is too long" ); + arma_conform_check( (N > fixed_n_elem), "Col::fixed: initialiser list is too long" ); eT* this_mem = (*this).memptr(); @@ -1533,7 +1524,7 @@ arma_inline Col& Col::fixed::operator=(const fixed& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(this != &X) { @@ -1557,7 +1548,7 @@ Col::fixed::operator=(const fixed& X) Col& Col::fixed::operator=(const eOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -1565,13 +1556,13 @@ Col::fixed::operator=(const fixed& X) if(bad_alias == false) { - arma_debug_assert_same_size(fixed_n_elem, uword(1), X.get_n_rows(), X.get_n_cols(), "Col::fixed::operator="); + arma_conform_assert_same_size(fixed_n_elem, uword(1), X.get_n_rows(), X.get_n_cols(), "Col::fixed::operator="); eop_type::apply(*this, X); } else { - arma_extra_debug_print("bad_alias = true"); + arma_debug_print("bad_alias = true"); Col tmp(X); @@ -1590,7 +1581,7 @@ Col::fixed::operator=(const fixed& X) Col& Col::fixed::operator=(const eGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -1604,13 +1595,13 @@ Col::fixed::operator=(const fixed& X) if(bad_alias == false) { - arma_debug_assert_same_size(fixed_n_elem, uword(1), X.get_n_rows(), X.get_n_cols(), "Col::fixed::operator="); + arma_conform_assert_same_size(fixed_n_elem, uword(1), X.get_n_rows(), X.get_n_cols(), "Col::fixed::operator="); eglue_type::apply(*this, X); } else { - arma_extra_debug_print("bad_alias = true"); + arma_debug_print("bad_alias = true"); Col tmp(X); @@ -1728,7 +1719,7 @@ arma_inline eT& Col::fixed::operator() (const uword ii) { - arma_debug_check_bounds( (ii >= fixed_n_elem), "Col::operator(): index out of bounds" ); + arma_conform_check_bounds( (ii >= fixed_n_elem), "Col::operator(): index out of bounds" ); return (use_extra) ? mem_local_extra[ii] : Mat::mem_local[ii]; } @@ -1741,7 +1732,7 @@ arma_inline const eT& Col::fixed::operator() (const uword ii) const { - arma_debug_check_bounds( (ii >= fixed_n_elem), "Col::operator(): index out of bounds" ); + arma_conform_check_bounds( (ii >= fixed_n_elem), "Col::operator(): index out of bounds" ); return (use_extra) ? mem_local_extra[ii] : Mat::mem_local[ii]; } @@ -1776,7 +1767,7 @@ arma_inline eT& Col::fixed::operator() (const uword in_row, const uword in_col) { - arma_debug_check_bounds( ((in_row >= fixed_n_elem) || (in_col > 0)), "Col::operator(): index out of bounds" ); + arma_conform_check_bounds( ((in_row >= fixed_n_elem) || (in_col > 0)), "Col::operator(): index out of bounds" ); return (use_extra) ? mem_local_extra[in_row] : Mat::mem_local[in_row]; } @@ -1789,7 +1780,7 @@ arma_inline const eT& Col::fixed::operator() (const uword in_row, const uword in_col) const { - arma_debug_check_bounds( ((in_row >= fixed_n_elem) || (in_col > 0)), "Col::operator(): index out of bounds" ); + arma_conform_check_bounds( ((in_row >= fixed_n_elem) || (in_col > 0)), "Col::operator(): index out of bounds" ); return (use_extra) ? mem_local_extra[in_row] : Mat::mem_local[in_row]; } @@ -1824,7 +1815,7 @@ inline const Col& Col::fixed::fill(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eT* mem_use = (use_extra) ? &(mem_local_extra[0]) : &(Mat::mem_local[0]); @@ -1841,7 +1832,7 @@ inline const Col& Col::fixed::zeros() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eT* mem_use = (use_extra) ? &(mem_local_extra[0]) : &(Mat::mem_local[0]); @@ -1858,7 +1849,7 @@ inline const Col& Col::fixed::ones() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eT* mem_use = (use_extra) ? &(mem_local_extra[0]) : &(Mat::mem_local[0]); @@ -1874,7 +1865,7 @@ inline Col::Col(const arma_fixed_indicator&, const uword in_n_elem, const eT* in_mem) : Mat(arma_fixed_indicator(), in_n_elem, 1, 1, in_mem) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } diff --git a/inst/include/armadillo_bits/CubeToMatOp_meat.hpp b/inst/include/armadillo_bits/CubeToMatOp_meat.hpp index abe83e81..d02b686c 100644 --- a/inst/include/armadillo_bits/CubeToMatOp_meat.hpp +++ b/inst/include/armadillo_bits/CubeToMatOp_meat.hpp @@ -26,7 +26,7 @@ inline CubeToMatOp::CubeToMatOp(const T1& in_m) : m(in_m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -37,7 +37,7 @@ CubeToMatOp::CubeToMatOp(const T1& in_m, const uword in_aux_uword) : m(in_m) , aux_uword(in_aux_uword) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -46,7 +46,7 @@ template inline CubeToMatOp::~CubeToMatOp() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } diff --git a/inst/include/armadillo_bits/Cube_bones.hpp b/inst/include/armadillo_bits/Cube_bones.hpp index 5cf364aa..91449e18 100644 --- a/inst/include/armadillo_bits/Cube_bones.hpp +++ b/inst/include/armadillo_bits/Cube_bones.hpp @@ -62,7 +62,7 @@ class Cube : public BaseCube< eT, Cube > #if defined(ARMA_USE_OPENMP) using raw_mat_ptr_type = mat_type*; using atomic_mat_ptr_type = mat_type*; - #elif (!defined(ARMA_DONT_USE_STD_MUTEX)) + #elif defined(ARMA_USE_STD_MUTEX) using raw_mat_ptr_type = mat_type*; using atomic_mat_ptr_type = std::atomic; #else @@ -72,7 +72,7 @@ class Cube : public BaseCube< eT, Cube > atomic_mat_ptr_type* mat_ptrs = nullptr; - #if (!defined(ARMA_DONT_USE_STD_MUTEX)) + #if defined(ARMA_USE_STD_MUTEX) mutable std::mutex mat_mutex; // required for slice() #endif diff --git a/inst/include/armadillo_bits/Cube_meat.hpp b/inst/include/armadillo_bits/Cube_meat.hpp index 265dcf47..a136306f 100644 --- a/inst/include/armadillo_bits/Cube_meat.hpp +++ b/inst/include/armadillo_bits/Cube_meat.hpp @@ -24,18 +24,18 @@ template inline Cube::~Cube() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); delete_mat(); if( (mem_state == 0) && (n_alloc > 0) ) { - arma_extra_debug_print("Cube::destructor: releasing memory"); + arma_debug_print("Cube::destructor: releasing memory"); memory::release( access::rw(mem) ); } // try to expose buggy user code that accesses deleted objects - if(arma_config::debug) { access::rw(mem) = nullptr; } + access::rw(mem) = nullptr; arma_type_check(( is_supported_elem_type::value == false )); } @@ -54,7 +54,7 @@ Cube::Cube() , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } @@ -72,15 +72,13 @@ Cube::Cube(const uword in_n_rows, const uword in_n_cols, const uword in_n_sl , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); - if(arma_config::zero_init) - { - arma_extra_debug_print("Cube::constructor: zeroing memory"); - arrayops::fill_zeros(memptr(), n_elem); - } + arma_debug_print("Cube::constructor: zeroing memory"); + + arrayops::fill_zeros(memptr(), n_elem); } @@ -97,15 +95,13 @@ Cube::Cube(const SizeCube& s) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); - if(arma_config::zero_init) - { - arma_extra_debug_print("Cube::constructor: zeroing memory"); - arrayops::fill_zeros(memptr(), n_elem); - } + arma_debug_print("Cube::constructor: zeroing memory"); + + arrayops::fill_zeros(memptr(), n_elem); } @@ -124,13 +120,13 @@ Cube::Cube(const uword in_n_rows, const uword in_n_cols, const uword in_n_sl , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); if(do_zeros) { - arma_extra_debug_print("Cube::constructor: zeroing memory"); + arma_debug_print("Cube::constructor: zeroing memory"); arrayops::fill_zeros(memptr(), n_elem); } } @@ -151,13 +147,13 @@ Cube::Cube(const SizeCube& s, const arma_initmode_indicator&) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); if(do_zeros) { - arma_extra_debug_print("Cube::constructor: zeroing memory"); + arma_debug_print("Cube::constructor: zeroing memory"); arrayops::fill_zeros(memptr(), n_elem); } } @@ -178,7 +174,7 @@ Cube::Cube(const uword in_n_rows, const uword in_n_cols, const uword in_n_sl , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); @@ -205,7 +201,7 @@ Cube::Cube(const SizeCube& s, const fill::fill_class&) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); @@ -232,7 +228,7 @@ Cube::Cube(const uword in_n_rows, const uword in_n_cols, const uword in_n_sl , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); @@ -253,7 +249,7 @@ Cube::Cube(const SizeCube& s, const fill::scalar_holder f) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); @@ -274,7 +270,7 @@ Cube::Cube(Cube&& in_cube) , mem_state(0) , mem() { - arma_extra_debug_sigprint(arma_str::format("this = %x in_cube = %x") % this % &in_cube); + arma_debug_sigprint(arma_str::format("this: %x; in_cube: %x") % this % &in_cube); (*this).steal_mem(in_cube, true); } @@ -286,7 +282,7 @@ inline Cube& Cube::operator=(Cube&& in_cube) { - arma_extra_debug_sigprint(arma_str::format("this = %x in_cube = %x") % this % &in_cube); + arma_debug_sigprint(arma_str::format("this: %x; in_cube: %x") % this % &in_cube); (*this).steal_mem(in_cube, true); @@ -300,7 +296,7 @@ inline void Cube::init_cold() { - arma_extra_debug_sigprint( arma_str::format("n_rows = %u, n_cols = %u, n_slices = %u") % n_rows % n_cols % n_slices ); + arma_debug_sigprint( arma_str::format("n_rows: %u; n_cols: %u; n_slices: %u") % n_rows % n_cols % n_slices ); #if defined(ARMA_64BIT_WORD) const char* error_message = "Cube::init(): requested size is too large"; @@ -308,7 +304,7 @@ Cube::init_cold() const char* error_message = "Cube::init(): requested size is too large; suggest to enable ARMA_64BIT_WORD"; #endif - arma_debug_check + arma_conform_check ( ( ( (n_rows > 0x0FFF) || (n_cols > 0x0FFF) || (n_slices > 0xFF) ) @@ -321,14 +317,14 @@ Cube::init_cold() if(n_elem <= Cube_prealloc::mem_n_elem) { - if(n_elem > 0) { arma_extra_debug_print("Cube::init(): using local memory"); } + if(n_elem > 0) { arma_debug_print("Cube::init(): using local memory"); } access::rw(mem) = (n_elem == 0) ? nullptr : mem_local; access::rw(n_alloc) = 0; } else { - arma_extra_debug_print("Cube::init(): acquiring memory"); + arma_debug_print("Cube::init(): acquiring memory"); access::rw(mem) = memory::acquire(n_elem); access::rw(n_alloc) = n_elem; @@ -344,7 +340,7 @@ inline void Cube::init_warm(const uword in_n_rows, const uword in_n_cols, const uword in_n_slices) { - arma_extra_debug_sigprint( arma_str::format("in_n_rows = %u, in_n_cols = %u, in_n_slices = %u") % in_n_rows % in_n_cols % in_n_slices ); + arma_debug_sigprint( arma_str::format("in_n_rows: %u; in_n_cols: %u; in_n_slices: %u") % in_n_rows % in_n_cols % in_n_slices ); if( (n_rows == in_n_rows) && (n_cols == in_n_cols) && (n_slices == in_n_slices) ) { return; } @@ -355,7 +351,7 @@ Cube::init_warm(const uword in_n_rows, const uword in_n_cols, const uword in const char* error_message_1 = "Cube::init(): size is fixed and hence cannot be changed"; - arma_debug_set_error( err_state, err_msg, (t_mem_state == 3), error_message_1 ); + arma_conform_set_error( err_state, err_msg, (t_mem_state == 3), error_message_1 ); #if defined(ARMA_64BIT_WORD) const char* error_message_2 = "Cube::init(): requested size is too large"; @@ -363,7 +359,7 @@ Cube::init_warm(const uword in_n_rows, const uword in_n_cols, const uword in const char* error_message_2 = "Cube::init(): requested size is too large; suggest to enable ARMA_64BIT_WORD"; #endif - arma_debug_set_error + arma_conform_set_error ( err_state, err_msg, @@ -375,14 +371,14 @@ Cube::init_warm(const uword in_n_rows, const uword in_n_cols, const uword in error_message_2 ); - arma_debug_check(err_state, err_msg); + arma_conform_check(err_state, err_msg); const uword old_n_elem = n_elem; const uword new_n_elem = in_n_rows * in_n_cols * in_n_slices; if(old_n_elem == new_n_elem) { - arma_extra_debug_print("Cube::init(): reusing memory"); + arma_debug_print("Cube::init(): reusing memory"); delete_mat(); @@ -396,7 +392,7 @@ Cube::init_warm(const uword in_n_rows, const uword in_n_cols, const uword in return; } - arma_debug_check( (t_mem_state == 2), "Cube::init(): mismatch between size of auxiliary memory and requested size" ); + arma_conform_check( (t_mem_state == 2), "Cube::init(): mismatch between size of auxiliary memory and requested size" ); delete_mat(); @@ -404,11 +400,11 @@ Cube::init_warm(const uword in_n_rows, const uword in_n_cols, const uword in { if(n_alloc > 0) { - arma_extra_debug_print("Cube::init(): releasing memory"); + arma_debug_print("Cube::init(): releasing memory"); memory::release( access::rw(mem) ); } - if(new_n_elem > 0) { arma_extra_debug_print("Cube::init(): using local memory"); } + if(new_n_elem > 0) { arma_debug_print("Cube::init(): using local memory"); } access::rw(mem) = (new_n_elem == 0) ? nullptr : mem_local; access::rw(n_alloc) = 0; @@ -419,7 +415,7 @@ Cube::init_warm(const uword in_n_rows, const uword in_n_cols, const uword in { if(n_alloc > 0) { - arma_extra_debug_print("Cube::init(): releasing memory"); + arma_debug_print("Cube::init(): releasing memory"); memory::release( access::rw(mem) ); // in case memory::acquire() throws an exception @@ -432,13 +428,13 @@ Cube::init_warm(const uword in_n_rows, const uword in_n_cols, const uword in access::rw(n_alloc) = 0; } - arma_extra_debug_print("Cube::init(): acquiring memory"); + arma_debug_print("Cube::init(): acquiring memory"); access::rw(mem) = memory::acquire(new_n_elem); access::rw(n_alloc) = new_n_elem; } else // condition: new_n_elem <= n_alloc { - arma_extra_debug_print("Cube::init(): reusing memory"); + arma_debug_print("Cube::init(): reusing memory"); } } @@ -465,7 +461,7 @@ Cube::init const BaseCube::pod_type,T2>& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type T; @@ -477,7 +473,7 @@ Cube::init const ProxyCube PX(X.get_ref()); const ProxyCube PY(Y.get_ref()); - arma_debug_assert_same_size(PX, PY, "Cube()"); + arma_conform_assert_same_size(PX, PY, "Cube()"); const uword local_n_rows = PX.get_n_rows(); const uword local_n_cols = PX.get_n_cols(); @@ -487,7 +483,7 @@ Cube::init eT* out_mem = (*this).memptr(); - const bool use_at = ( ProxyCube::use_at || ProxyCube::use_at ); + constexpr bool use_at = ( ProxyCube::use_at || ProxyCube::use_at ); if(use_at == false) { @@ -523,7 +519,7 @@ inline void Cube::delete_mat() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if((n_slices > 0) && (mat_ptrs != nullptr)) { @@ -533,7 +529,7 @@ Cube::delete_mat() if(mat_ptr != nullptr) { - arma_extra_debug_print( arma_str::format("Cube::delete_mat(): destroying matrix %u") % s ); + arma_debug_print( arma_str::format("Cube::delete_mat(): destroying matrix %u") % s ); delete mat_ptr; mat_ptrs[s] = nullptr; } @@ -541,7 +537,7 @@ Cube::delete_mat() if( (mem_state <= 2) && (n_slices > Cube_prealloc::mat_ptrs_size) ) { - arma_extra_debug_print("Cube::delete_mat(): freeing mat_ptrs array"); + arma_debug_print("Cube::delete_mat(): freeing mat_ptrs array"); delete [] mat_ptrs; mat_ptrs = nullptr; } @@ -555,7 +551,7 @@ inline void Cube::create_mat() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(n_slices == 0) { mat_ptrs = nullptr; return; } @@ -563,13 +559,13 @@ Cube::create_mat() { if(n_slices <= Cube_prealloc::mat_ptrs_size) { - arma_extra_debug_print("Cube::create_mat(): using local memory for mat_ptrs array"); + arma_debug_print("Cube::create_mat(): using local memory for mat_ptrs array"); mat_ptrs = mat_ptrs_local; } else { - arma_extra_debug_print("Cube::create_mat(): allocating mat_ptrs array"); + arma_debug_print("Cube::create_mat(): allocating mat_ptrs array"); mat_ptrs = new(std::nothrow) atomic_mat_ptr_type[n_slices]; @@ -587,9 +583,9 @@ inline Mat* Cube::create_mat_ptr(const uword in_slice) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_extra_debug_print( arma_str::format("Cube::create_mat_ptr(): creating matrix %u") % in_slice ); + arma_debug_print( arma_str::format("Cube::create_mat_ptr(): creating matrix %u") % in_slice ); const eT* mat_mem = (n_elem_slice > 0) ? slice_memptr(in_slice) : nullptr; @@ -605,7 +601,7 @@ inline Mat* Cube::get_mat_ptr(const uword in_slice) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); raw_mat_ptr_type mat_ptr = nullptr; @@ -614,7 +610,7 @@ Cube::get_mat_ptr(const uword in_slice) const #pragma omp atomic read mat_ptr = mat_ptrs[in_slice]; } - #elif (!defined(ARMA_DONT_USE_STD_MUTEX)) + #elif defined(ARMA_USE_STD_MUTEX) { mat_ptr = mat_ptrs[in_slice].load(); } @@ -639,7 +635,7 @@ Cube::get_mat_ptr(const uword in_slice) const mat_ptrs[in_slice] = mat_ptr; } } - #elif (!defined(ARMA_DONT_USE_STD_MUTEX)) + #elif defined(ARMA_USE_STD_MUTEX) { const std::lock_guard lock(mat_mutex); @@ -672,7 +668,7 @@ inline Cube& Cube::operator=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init_warm(1,1,1); @@ -689,7 +685,7 @@ inline Cube& Cube::operator+=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arrayops::inplace_plus( memptr(), val, n_elem ); @@ -704,7 +700,7 @@ inline Cube& Cube::operator-=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arrayops::inplace_minus( memptr(), val, n_elem ); @@ -719,7 +715,7 @@ inline Cube& Cube::operator*=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arrayops::inplace_mul( memptr(), val, n_elem ); @@ -734,7 +730,7 @@ inline Cube& Cube::operator/=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arrayops::inplace_div( memptr(), val, n_elem ); @@ -756,8 +752,8 @@ Cube::Cube(const Cube& x) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); - arma_extra_debug_sigprint(arma_str::format("this = %x in_cube = %x") % this % &x); + arma_debug_sigprint_this(this); + arma_debug_sigprint(arma_str::format("this: %x; in_cube: %x") % this % &x); init_cold(); @@ -772,7 +768,7 @@ inline Cube& Cube::operator=(const Cube& x) { - arma_extra_debug_sigprint(arma_str::format("this = %x in_cube = %x") % this % &x); + arma_debug_sigprint(arma_str::format("this: %x; in_cube: %x") % this % &x); if(this != &x) { @@ -801,7 +797,7 @@ Cube::Cube(eT* aux_mem, const uword aux_n_rows, const uword aux_n_cols, cons , mem_state ( copy_aux_mem ? 0 : (strict ? 2 : 1) ) , mem ( copy_aux_mem ? nullptr : aux_mem ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); arma_ignore(prealloc_mat); // kept only for compatibility with old user code @@ -833,7 +829,7 @@ Cube::Cube(const eT* aux_mem, const uword aux_n_rows, const uword aux_n_cols , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); @@ -848,9 +844,9 @@ inline Cube& Cube::operator+=(const Cube& m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(*this, m, "addition"); + arma_conform_assert_same_size(*this, m, "addition"); arrayops::inplace_plus( memptr(), m.memptr(), n_elem ); @@ -865,9 +861,9 @@ inline Cube& Cube::operator-=(const Cube& m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(*this, m, "subtraction"); + arma_conform_assert_same_size(*this, m, "subtraction"); arrayops::inplace_minus( memptr(), m.memptr(), n_elem ); @@ -882,9 +878,9 @@ inline Cube& Cube::operator%=(const Cube& m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(*this, m, "element-wise multiplication"); + arma_conform_assert_same_size(*this, m, "element-wise multiplication"); arrayops::inplace_mul( memptr(), m.memptr(), n_elem ); @@ -899,9 +895,9 @@ inline Cube& Cube::operator/=(const Cube& m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(*this, m, "element-wise division"); + arma_conform_assert_same_size(*this, m, "element-wise division"); arrayops::inplace_div( memptr(), m.memptr(), n_elem ); @@ -928,7 +924,7 @@ Cube::Cube , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init(A,B); } @@ -948,7 +944,7 @@ Cube::Cube(const subview_cube& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); @@ -963,7 +959,7 @@ inline Cube& Cube::operator=(const subview_cube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool alias = (this == &(X.m)); @@ -991,7 +987,7 @@ inline Cube& Cube::operator+=(const subview_cube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_cube::plus_inplace(*this, X); @@ -1006,7 +1002,7 @@ inline Cube& Cube::operator-=(const subview_cube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_cube::minus_inplace(*this, X); @@ -1021,7 +1017,7 @@ inline Cube& Cube::operator%=(const subview_cube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_cube::schur_inplace(*this, X); @@ -1036,7 +1032,7 @@ inline Cube& Cube::operator/=(const subview_cube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_cube::div_inplace(*this, X); @@ -1058,7 +1054,7 @@ Cube::Cube(const subview_cube_slices& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); subview_cube_slices::extract(*this, X); } @@ -1071,7 +1067,7 @@ inline Cube& Cube::operator=(const subview_cube_slices& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool alias = (this == &(X.m)); @@ -1097,7 +1093,7 @@ inline Cube& Cube::operator+=(const subview_cube_slices& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_cube_slices::plus_inplace(*this, X); @@ -1112,7 +1108,7 @@ inline Cube& Cube::operator-=(const subview_cube_slices& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_cube_slices::minus_inplace(*this, X); @@ -1127,7 +1123,7 @@ inline Cube& Cube::operator%=(const subview_cube_slices& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_cube_slices::schur_inplace(*this, X); @@ -1142,7 +1138,7 @@ inline Cube& Cube::operator/=(const subview_cube_slices& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_cube_slices::div_inplace(*this, X); @@ -1157,9 +1153,9 @@ arma_inline subview_cube Cube::row(const uword in_row) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (in_row >= n_rows), "Cube::row(): index out of bounds" ); + arma_conform_check_bounds( (in_row >= n_rows), "Cube::row(): index out of bounds" ); return (*this).rows(in_row, in_row); } @@ -1172,9 +1168,9 @@ arma_inline const subview_cube Cube::row(const uword in_row) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (in_row >= n_rows), "Cube::row(): index out of bounds" ); + arma_conform_check_bounds( (in_row >= n_rows), "Cube::row(): index out of bounds" ); return (*this).rows(in_row, in_row); } @@ -1187,9 +1183,9 @@ arma_inline subview_cube Cube::col(const uword in_col) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (in_col >= n_cols), "Cube::col(): index out of bounds" ); + arma_conform_check_bounds( (in_col >= n_cols), "Cube::col(): index out of bounds" ); return (*this).cols(in_col, in_col); } @@ -1202,9 +1198,9 @@ arma_inline const subview_cube Cube::col(const uword in_col) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (in_col >= n_cols), "Cube::col(): index out of bounds" ); + arma_conform_check_bounds( (in_col >= n_cols), "Cube::col(): index out of bounds" ); return (*this).cols(in_col, in_col); } @@ -1217,9 +1213,9 @@ inline Mat& Cube::slice(const uword in_slice) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (in_slice >= n_slices), "Cube::slice(): index out of bounds" ); + arma_conform_check_bounds( (in_slice >= n_slices), "Cube::slice(): index out of bounds" ); return *(get_mat_ptr(in_slice)); } @@ -1232,9 +1228,9 @@ inline const Mat& Cube::slice(const uword in_slice) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (in_slice >= n_slices), "Cube::slice(): index out of bounds" ); + arma_conform_check_bounds( (in_slice >= n_slices), "Cube::slice(): index out of bounds" ); return *(get_mat_ptr(in_slice)); } @@ -1247,9 +1243,9 @@ arma_inline subview_cube Cube::rows(const uword in_row1, const uword in_row2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_row2 >= n_rows), "Cube::rows(): indices out of bounds or incorrectly used" @@ -1268,9 +1264,9 @@ arma_inline const subview_cube Cube::rows(const uword in_row1, const uword in_row2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_row2 >= n_rows), "Cube::rows(): indices out of bounds or incorrectly used" @@ -1289,9 +1285,9 @@ arma_inline subview_cube Cube::cols(const uword in_col1, const uword in_col2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_col1 > in_col2) || (in_col2 >= n_cols), "Cube::cols(): indices out of bounds or incorrectly used" @@ -1310,9 +1306,9 @@ arma_inline const subview_cube Cube::cols(const uword in_col1, const uword in_col2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_col1 > in_col2) || (in_col2 >= n_cols), "Cube::cols(): indices out of bounds or incorrectly used" @@ -1331,9 +1327,9 @@ arma_inline subview_cube Cube::slices(const uword in_slice1, const uword in_slice2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_slice1 > in_slice2) || (in_slice2 >= n_slices), "Cube::slices(): indices out of bounds or incorrectly used" @@ -1352,9 +1348,9 @@ arma_inline const subview_cube Cube::slices(const uword in_slice1, const uword in_slice2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_slice1 > in_slice2) || (in_slice2 >= n_slices), "Cube::slices(): indices out of bounds or incorrectly used" @@ -1373,9 +1369,9 @@ arma_inline subview_cube Cube::subcube(const uword in_row1, const uword in_col1, const uword in_slice1, const uword in_row2, const uword in_col2, const uword in_slice2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_col1 > in_col2) || (in_slice1 > in_slice2) || (in_row2 >= n_rows) || (in_col2 >= n_cols) || (in_slice2 >= n_slices), @@ -1397,9 +1393,9 @@ arma_inline const subview_cube Cube::subcube(const uword in_row1, const uword in_col1, const uword in_slice1, const uword in_row2, const uword in_col2, const uword in_slice2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_col1 > in_col2) || (in_slice1 > in_slice2) || (in_row2 >= n_rows) || (in_col2 >= n_cols) || (in_slice2 >= n_slices), @@ -1421,7 +1417,7 @@ inline subview_cube Cube::subcube(const uword in_row1, const uword in_col1, const uword in_slice1, const SizeCube& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword l_n_rows = n_rows; const uword l_n_cols = n_cols; @@ -1431,7 +1427,7 @@ Cube::subcube(const uword in_row1, const uword in_col1, const uword in_slice const uword s_n_cols = s.n_cols; const uword s_n_slices = s.n_slices; - arma_debug_check_bounds + arma_conform_check_bounds ( ( in_row1 >= l_n_rows) || ( in_col1 >= l_n_cols) || ( in_slice1 >= l_n_slices) || ((in_row1 + s_n_rows) > l_n_rows) || ((in_col1 + s_n_cols) > l_n_cols) || ((in_slice1 + s_n_slices) > l_n_slices), @@ -1449,7 +1445,7 @@ inline const subview_cube Cube::subcube(const uword in_row1, const uword in_col1, const uword in_slice1, const SizeCube& s) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword l_n_rows = n_rows; const uword l_n_cols = n_cols; @@ -1459,7 +1455,7 @@ Cube::subcube(const uword in_row1, const uword in_col1, const uword in_slice const uword s_n_cols = s.n_cols; const uword s_n_slices = s.n_slices; - arma_debug_check_bounds + arma_conform_check_bounds ( ( in_row1 >= l_n_rows) || ( in_col1 >= l_n_cols) || ( in_slice1 >= l_n_slices) || ((in_row1 + s_n_rows) > l_n_rows) || ((in_col1 + s_n_cols) > l_n_cols) || ((in_slice1 + s_n_slices) > l_n_slices), @@ -1477,7 +1473,7 @@ inline subview_cube Cube::subcube(const span& row_span, const span& col_span, const span& slice_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool row_all = row_span.whole; const bool col_all = col_span.whole; @@ -1499,7 +1495,7 @@ Cube::subcube(const span& row_span, const span& col_span, const span& slice_ const uword in_slice2 = slice_span.b; const uword subcube_n_slices = slice_all ? local_n_slices : in_slice2 - in_slice1 + 1; - arma_debug_check_bounds + arma_conform_check_bounds ( ( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= local_n_rows)) ) || @@ -1521,7 +1517,7 @@ inline const subview_cube Cube::subcube(const span& row_span, const span& col_span, const span& slice_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool row_all = row_span.whole; const bool col_all = col_span.whole; @@ -1543,7 +1539,7 @@ Cube::subcube(const span& row_span, const span& col_span, const span& slice_ const uword in_slice2 = slice_span.b; const uword subcube_n_slices = slice_all ? local_n_slices : in_slice2 - in_slice1 + 1; - arma_debug_check_bounds + arma_conform_check_bounds ( ( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= local_n_rows)) ) || @@ -1564,7 +1560,7 @@ inline subview_cube Cube::operator()(const span& row_span, const span& col_span, const span& slice_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).subcube(row_span, col_span, slice_span); } @@ -1576,7 +1572,7 @@ inline const subview_cube Cube::operator()(const span& row_span, const span& col_span, const span& slice_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).subcube(row_span, col_span, slice_span); } @@ -1588,7 +1584,7 @@ inline subview_cube Cube::operator()(const uword in_row1, const uword in_col1, const uword in_slice1, const SizeCube& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).subcube(in_row1, in_col1, in_slice1, s); } @@ -1600,7 +1596,7 @@ inline const subview_cube Cube::operator()(const uword in_row1, const uword in_col1, const uword in_slice1, const SizeCube& s) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).subcube(in_row1, in_col1, in_slice1, s); } @@ -1612,9 +1608,9 @@ arma_inline subview_cube Cube::tube(const uword in_row1, const uword in_col1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( ((in_row1 >= n_rows) || (in_col1 >= n_cols)), "Cube::tube(): indices out of bounds" @@ -1630,9 +1626,9 @@ arma_inline const subview_cube Cube::tube(const uword in_row1, const uword in_col1) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( ((in_row1 >= n_rows) || (in_col1 >= n_cols)), "Cube::tube(): indices out of bounds" @@ -1648,9 +1644,9 @@ arma_inline subview_cube Cube::tube(const uword in_row1, const uword in_col1, const uword in_row2, const uword in_col2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols), @@ -1670,9 +1666,9 @@ arma_inline const subview_cube Cube::tube(const uword in_row1, const uword in_col1, const uword in_row2, const uword in_col2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols), @@ -1692,7 +1688,7 @@ arma_inline subview_cube Cube::tube(const uword in_row1, const uword in_col1, const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword l_n_rows = n_rows; const uword l_n_cols = n_cols; @@ -1700,7 +1696,7 @@ Cube::tube(const uword in_row1, const uword in_col1, const SizeMat& s) const uword s_n_rows = s.n_rows; const uword s_n_cols = s.n_cols; - arma_debug_check_bounds + arma_conform_check_bounds ( ((in_row1 >= l_n_rows) || (in_col1 >= l_n_cols) || ((in_row1 + s_n_rows) > l_n_rows) || ((in_col1 + s_n_cols) > l_n_cols)), "Cube::tube(): indices or size out of bounds" @@ -1716,7 +1712,7 @@ arma_inline const subview_cube Cube::tube(const uword in_row1, const uword in_col1, const SizeMat& s) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword l_n_rows = n_rows; const uword l_n_cols = n_cols; @@ -1724,7 +1720,7 @@ Cube::tube(const uword in_row1, const uword in_col1, const SizeMat& s) const const uword s_n_rows = s.n_rows; const uword s_n_cols = s.n_cols; - arma_debug_check_bounds + arma_conform_check_bounds ( ((in_row1 >= l_n_rows) || (in_col1 >= l_n_cols) || ((in_row1 + s_n_rows) > l_n_rows) || ((in_col1 + s_n_cols) > l_n_cols)), "Cube::tube(): indices or size out of bounds" @@ -1740,7 +1736,7 @@ inline subview_cube Cube::tube(const span& row_span, const span& col_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool row_all = row_span.whole; const bool col_all = col_span.whole; @@ -1756,7 +1752,7 @@ Cube::tube(const span& row_span, const span& col_span) const uword in_col2 = col_span.b; const uword subcube_n_cols = col_all ? local_n_cols : in_col2 - in_col1 + 1; - arma_debug_check_bounds + arma_conform_check_bounds ( ( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= local_n_rows)) ) || @@ -1775,7 +1771,7 @@ inline const subview_cube Cube::tube(const span& row_span, const span& col_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool row_all = row_span.whole; const bool col_all = col_span.whole; @@ -1791,7 +1787,7 @@ Cube::tube(const span& row_span, const span& col_span) const const uword in_col2 = col_span.b; const uword subcube_n_cols = col_all ? local_n_cols : in_col2 - in_col1 + 1; - arma_debug_check_bounds + arma_conform_check_bounds ( ( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= local_n_rows)) ) || @@ -1810,9 +1806,9 @@ inline subview_cube Cube::head_slices(const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > n_slices), "Cube::head_slices(): size out of bounds" ); + arma_conform_check_bounds( (N > n_slices), "Cube::head_slices(): size out of bounds" ); return subview_cube(*this, 0, 0, 0, n_rows, n_cols, N); } @@ -1824,9 +1820,9 @@ inline const subview_cube Cube::head_slices(const uword N) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > n_slices), "Cube::head_slices(): size out of bounds" ); + arma_conform_check_bounds( (N > n_slices), "Cube::head_slices(): size out of bounds" ); return subview_cube(*this, 0, 0, 0, n_rows, n_cols, N); } @@ -1838,9 +1834,9 @@ inline subview_cube Cube::tail_slices(const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > n_slices), "Cube::tail_slices(): size out of bounds" ); + arma_conform_check_bounds( (N > n_slices), "Cube::tail_slices(): size out of bounds" ); const uword start_slice = n_slices - N; @@ -1854,9 +1850,9 @@ inline const subview_cube Cube::tail_slices(const uword N) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > n_slices), "Cube::tail_slices(): size out of bounds" ); + arma_conform_check_bounds( (N > n_slices), "Cube::tail_slices(): size out of bounds" ); const uword start_slice = n_slices - N; @@ -1871,7 +1867,7 @@ arma_inline subview_elem1 Cube::elem(const Base& a) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_elem1(*this, a); } @@ -1884,7 +1880,7 @@ arma_inline const subview_elem1 Cube::elem(const Base& a) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_elem1(*this, a); } @@ -1897,7 +1893,7 @@ arma_inline subview_elem1 Cube::operator()(const Base& a) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_elem1(*this, a); } @@ -1910,7 +1906,7 @@ arma_inline const subview_elem1 Cube::operator()(const Base& a) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_elem1(*this, a); } @@ -1922,7 +1918,7 @@ arma_inline subview_cube_each1 Cube::each_slice() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_cube_each1(*this); } @@ -1934,7 +1930,7 @@ arma_inline const subview_cube_each1 Cube::each_slice() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_cube_each1(*this); } @@ -1947,7 +1943,7 @@ inline subview_cube_each2 Cube::each_slice(const Base& indices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_cube_each2(*this, indices); } @@ -1960,7 +1956,7 @@ inline const subview_cube_each2 Cube::each_slice(const Base& indices) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_cube_each2(*this, indices); } @@ -1973,7 +1969,7 @@ inline Cube& Cube::each_slice(const std::function< void(Mat&) >& F) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); for(uword slice_id=0; slice_id < n_slices; ++slice_id) { @@ -1992,7 +1988,7 @@ inline const Cube& Cube::each_slice(const std::function< void(const Mat&) >& F) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); for(uword slice_id=0; slice_id < n_slices; ++slice_id) { @@ -2011,7 +2007,7 @@ inline Cube& Cube::each_slice(const std::function< void(Mat&) >& F, const bool use_mp) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if((use_mp == false) || (arma_config::openmp == false)) { @@ -2043,7 +2039,7 @@ inline const Cube& Cube::each_slice(const std::function< void(const Mat&) >& F, const bool use_mp) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if((use_mp == false) || (arma_config::openmp == false)) { @@ -2076,7 +2072,7 @@ inline subview_cube_slices Cube::slices(const Base& indices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_cube_slices(*this, indices); } @@ -2089,7 +2085,7 @@ inline const subview_cube_slices Cube::slices(const Base& indices) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_cube_slices(*this, indices); } @@ -2102,9 +2098,9 @@ inline void Cube::shed_row(const uword row_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( row_num >= n_rows, "Cube::shed_row(): index out of bounds" ); + arma_conform_check_bounds( row_num >= n_rows, "Cube::shed_row(): index out of bounds" ); shed_rows(row_num, row_num); } @@ -2117,9 +2113,9 @@ inline void Cube::shed_col(const uword col_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( col_num >= n_cols, "Cube::shed_col(): index out of bounds" ); + arma_conform_check_bounds( col_num >= n_cols, "Cube::shed_col(): index out of bounds" ); shed_cols(col_num, col_num); } @@ -2132,9 +2128,9 @@ inline void Cube::shed_slice(const uword slice_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( slice_num >= n_slices, "Cube::shed_slice(): index out of bounds" ); + arma_conform_check_bounds( slice_num >= n_slices, "Cube::shed_slice(): index out of bounds" ); shed_slices(slice_num, slice_num); } @@ -2147,9 +2143,9 @@ inline void Cube::shed_rows(const uword in_row1, const uword in_row2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_row2 >= n_rows), "Cube::shed_rows(): indices out of bounds or incorrectly used" @@ -2181,9 +2177,9 @@ inline void Cube::shed_cols(const uword in_col1, const uword in_col2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_col1 > in_col2) || (in_col2 >= n_cols), "Cube::shed_cols(): indices out of bounds or incorrectly used" @@ -2215,9 +2211,9 @@ inline void Cube::shed_slices(const uword in_slice1, const uword in_slice2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_slice1 > in_slice2) || (in_slice2 >= n_slices), "Cube::shed_slices(): indices out of bounds or incorrectly used" @@ -2250,12 +2246,12 @@ inline void Cube::shed_slices(const Base& indices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap U(indices.get_ref()); const Mat& tmp1 = U.M; - arma_debug_check( ((tmp1.is_vec() == false) && (tmp1.is_empty() == false)), "Cube::shed_slices(): list of indices must be a vector" ); + arma_conform_check( ((tmp1.is_vec() == false) && (tmp1.is_empty() == false)), "Cube::shed_slices(): list of indices must be a vector" ); if(tmp1.is_empty()) { return; } @@ -2268,11 +2264,11 @@ Cube::shed_slices(const Base& indices) const uword* slices_to_shed_mem = slices_to_shed.memptr(); const uword N = slices_to_shed.n_elem; - if(arma_config::debug) + if(arma_config::check_conformance) { for(uword i=0; i= n_slices), "Cube::shed_slices(): indices out of bounds" ); + arma_conform_check_bounds( (slices_to_shed_mem[i] >= n_slices), "Cube::shed_slices(): indices out of bounds" ); } } @@ -2318,7 +2314,7 @@ inline void Cube::insert_rows(const uword row_num, const uword N, const bool set_to_zero) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(set_to_zero); @@ -2332,7 +2328,7 @@ inline void Cube::insert_rows(const uword row_num, const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword t_n_rows = n_rows; @@ -2340,7 +2336,7 @@ Cube::insert_rows(const uword row_num, const uword N) const uword B_n_rows = t_n_rows - row_num; // insertion at row_num == n_rows is in effect an append operation - arma_debug_check_bounds( (row_num > t_n_rows), "Cube::insert_rows(): index out of bounds" ); + arma_conform_check_bounds( (row_num > t_n_rows), "Cube::insert_rows(): index out of bounds" ); if(N == 0) { return; } @@ -2368,7 +2364,7 @@ inline void Cube::insert_cols(const uword col_num, const uword N, const bool set_to_zero) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(set_to_zero); @@ -2382,7 +2378,7 @@ inline void Cube::insert_cols(const uword col_num, const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword t_n_cols = n_cols; @@ -2390,7 +2386,7 @@ Cube::insert_cols(const uword col_num, const uword N) const uword B_n_cols = t_n_cols - col_num; // insertion at col_num == n_cols is in effect an append operation - arma_debug_check_bounds( (col_num > t_n_cols), "Cube::insert_cols(): index out of bounds" ); + arma_conform_check_bounds( (col_num > t_n_cols), "Cube::insert_cols(): index out of bounds" ); if(N == 0) { return; } @@ -2418,7 +2414,7 @@ inline void Cube::insert_slices(const uword slice_num, const uword N, const bool set_to_zero) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(set_to_zero); @@ -2432,7 +2428,7 @@ inline void Cube::insert_slices(const uword slice_num, const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword t_n_slices = n_slices; @@ -2440,7 +2436,7 @@ Cube::insert_slices(const uword slice_num, const uword N) const uword B_n_slices = t_n_slices - slice_num; // insertion at slice_num == n_slices is in effect an append operation - arma_debug_check_bounds( (slice_num > t_n_slices), "Cube::insert_slices(): index out of bounds" ); + arma_conform_check_bounds( (slice_num > t_n_slices), "Cube::insert_slices(): index out of bounds" ); if(N == 0) { return; } @@ -2474,7 +2470,7 @@ inline void Cube::insert_rows(const uword row_num, const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_cube tmp(X.get_ref()); const Cube& C = tmp.M; @@ -2487,9 +2483,9 @@ Cube::insert_rows(const uword row_num, const BaseCube& X) const uword B_n_rows = t_n_rows - row_num; // insertion at row_num == n_rows is in effect an append operation - arma_debug_check_bounds( (row_num > t_n_rows), "Cube::insert_rows(): index out of bounds" ); + arma_conform_check_bounds( (row_num > t_n_rows), "Cube::insert_rows(): index out of bounds" ); - arma_debug_check + arma_conform_check ( ( (C.n_cols != n_cols) || (C.n_slices != n_slices) ), "Cube::insert_rows(): given object has incompatible dimensions" @@ -2522,7 +2518,7 @@ inline void Cube::insert_cols(const uword col_num, const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_cube tmp(X.get_ref()); const Cube& C = tmp.M; @@ -2535,9 +2531,9 @@ Cube::insert_cols(const uword col_num, const BaseCube& X) const uword B_n_cols = t_n_cols - col_num; // insertion at col_num == n_cols is in effect an append operation - arma_debug_check_bounds( (col_num > t_n_cols), "Cube::insert_cols(): index out of bounds" ); + arma_conform_check_bounds( (col_num > t_n_cols), "Cube::insert_cols(): index out of bounds" ); - arma_debug_check + arma_conform_check ( ( (C.n_rows != n_rows) || (C.n_slices != n_slices) ), "Cube::insert_cols(): given object has incompatible dimensions" @@ -2572,7 +2568,7 @@ inline void Cube::insert_slices(const uword slice_num, const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_cube tmp(X.get_ref()); const Cube& C = tmp.M; @@ -2585,9 +2581,9 @@ Cube::insert_slices(const uword slice_num, const BaseCube& X) const uword B_n_slices = t_n_slices - slice_num; // insertion at slice_num == n_slices is in effect an append operation - arma_debug_check_bounds( (slice_num > t_n_slices), "Cube::insert_slices(): index out of bounds" ); + arma_conform_check_bounds( (slice_num > t_n_slices), "Cube::insert_slices(): index out of bounds" ); - arma_debug_check + arma_conform_check ( ( (C.n_rows != n_rows) || (C.n_cols != n_cols) ), "Cube::insert_slices(): given object has incompatible dimensions" @@ -2620,7 +2616,7 @@ inline void Cube::insert_slices(const uword slice_num, const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap U(X.get_ref()); @@ -2645,7 +2641,7 @@ Cube::Cube(const GenCube& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); @@ -2660,7 +2656,7 @@ inline Cube& Cube::operator=(const GenCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init_warm(X.n_rows, X.n_cols, X.n_slices); @@ -2677,7 +2673,7 @@ inline Cube& Cube::operator+=(const GenCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); X.apply_inplace_plus(*this); @@ -2692,7 +2688,7 @@ inline Cube& Cube::operator-=(const GenCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); X.apply_inplace_minus(*this); @@ -2707,7 +2703,7 @@ inline Cube& Cube::operator%=(const GenCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); X.apply_inplace_schur(*this); @@ -2722,7 +2718,7 @@ inline Cube& Cube::operator/=(const GenCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); X.apply_inplace_div(*this); @@ -2745,7 +2741,7 @@ Cube::Cube(const OpCube& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -2761,7 +2757,7 @@ inline Cube& Cube::operator=(const OpCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -2779,7 +2775,7 @@ inline Cube& Cube::operator+=(const OpCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -2797,7 +2793,7 @@ inline Cube& Cube::operator-=(const OpCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -2815,7 +2811,7 @@ inline Cube& Cube::operator%=(const OpCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -2833,7 +2829,7 @@ inline Cube& Cube::operator/=(const OpCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -2858,7 +2854,7 @@ Cube::Cube(const eOpCube& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -2876,7 +2872,7 @@ inline Cube& Cube::operator=(const eOpCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -2900,7 +2896,7 @@ inline Cube& Cube::operator+=(const eOpCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -2922,7 +2918,7 @@ inline Cube& Cube::operator-=(const eOpCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -2944,7 +2940,7 @@ inline Cube& Cube::operator%=(const eOpCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -2966,7 +2962,7 @@ inline Cube& Cube::operator/=(const eOpCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -2994,7 +2990,7 @@ Cube::Cube(const mtOpCube& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); op_type::apply(*this, X); } @@ -3007,7 +3003,7 @@ inline Cube& Cube::operator=(const mtOpCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); op_type::apply(*this, X); @@ -3022,7 +3018,7 @@ inline Cube& Cube::operator+=(const mtOpCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Cube m(X); @@ -3037,7 +3033,7 @@ inline Cube& Cube::operator-=(const mtOpCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Cube m(X); @@ -3052,7 +3048,7 @@ inline Cube& Cube::operator%=(const mtOpCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Cube m(X); @@ -3067,7 +3063,7 @@ inline Cube& Cube::operator/=(const mtOpCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Cube m(X); @@ -3090,7 +3086,7 @@ Cube::Cube(const GlueCube& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); this->operator=(X); } @@ -3104,7 +3100,7 @@ inline Cube& Cube::operator=(const GlueCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -3122,7 +3118,7 @@ inline Cube& Cube::operator+=(const GlueCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -3141,7 +3137,7 @@ inline Cube& Cube::operator-=(const GlueCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -3160,7 +3156,7 @@ inline Cube& Cube::operator%=(const GlueCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -3179,7 +3175,7 @@ inline Cube& Cube::operator/=(const GlueCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -3205,7 +3201,7 @@ Cube::Cube(const eGlueCube& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -3224,7 +3220,7 @@ inline Cube& Cube::operator=(const eGlueCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -3249,7 +3245,7 @@ inline Cube& Cube::operator+=(const eGlueCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -3272,7 +3268,7 @@ inline Cube& Cube::operator-=(const eGlueCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -3295,7 +3291,7 @@ inline Cube& Cube::operator%=(const eGlueCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -3318,7 +3314,7 @@ inline Cube& Cube::operator/=(const eGlueCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -3347,7 +3343,7 @@ Cube::Cube(const mtGlueCube& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); glue_type::apply(*this, X); } @@ -3360,7 +3356,7 @@ inline Cube& Cube::operator=(const mtGlueCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); glue_type::apply(*this, X); @@ -3375,7 +3371,7 @@ inline Cube& Cube::operator+=(const mtGlueCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Cube m(X); @@ -3390,7 +3386,7 @@ inline Cube& Cube::operator-=(const mtGlueCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Cube m(X); @@ -3405,7 +3401,7 @@ inline Cube& Cube::operator%=(const mtGlueCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Cube m(X); @@ -3420,7 +3416,7 @@ inline Cube& Cube::operator/=(const mtGlueCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Cube m(X); @@ -3450,7 +3446,7 @@ arma_inline eT& Cube::operator() (const uword i) { - arma_debug_check_bounds( (i >= n_elem), "Cube::operator(): index out of bounds" ); + arma_conform_check_bounds( (i >= n_elem), "Cube::operator(): index out of bounds" ); return access::rw(mem[i]); } @@ -3463,7 +3459,7 @@ arma_inline const eT& Cube::operator() (const uword i) const { - arma_debug_check_bounds( (i >= n_elem), "Cube::operator(): index out of bounds" ); + arma_conform_check_bounds( (i >= n_elem), "Cube::operator(): index out of bounds" ); return mem[i]; } @@ -3519,7 +3515,7 @@ arma_inline eT& Cube::operator() (const uword in_row, const uword in_col, const uword in_slice) { - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row >= n_rows) || (in_col >= n_cols) || @@ -3539,7 +3535,7 @@ arma_inline const eT& Cube::operator() (const uword in_row, const uword in_col, const uword in_slice) const { - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row >= n_rows) || (in_col >= n_cols) || @@ -3664,7 +3660,7 @@ inline bool Cube::internal_is_finite() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return arrayops::is_finite(memptr(), n_elem); } @@ -3676,7 +3672,7 @@ inline bool Cube::internal_has_inf() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return arrayops::has_inf(memptr(), n_elem); } @@ -3688,7 +3684,7 @@ inline bool Cube::internal_has_nan() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return arrayops::has_nan(memptr(), n_elem); } @@ -3700,7 +3696,7 @@ inline bool Cube::internal_has_nonfinite() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (arrayops::is_finite(memptr(), n_elem) == false); } @@ -3724,7 +3720,7 @@ arma_inline bool Cube::in_range(const span& x) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(x.whole) { @@ -3757,7 +3753,7 @@ inline bool Cube::in_range(const span& row_span, const span& col_span, const span& slice_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword in_row1 = row_span.a; const uword in_row2 = row_span.b; @@ -3875,7 +3871,7 @@ inline Cube& Cube::set_size(const uword new_n_rows, const uword new_n_cols, const uword new_n_slices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init_warm(new_n_rows, new_n_cols, new_n_slices); @@ -3890,7 +3886,7 @@ inline Cube& Cube::reshape(const uword new_n_rows, const uword new_n_cols, const uword new_n_slices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); op_reshape::apply_cube_inplace((*this), new_n_rows, new_n_cols, new_n_slices); @@ -3905,7 +3901,7 @@ inline Cube& Cube::resize(const uword new_n_rows, const uword new_n_cols, const uword new_n_slices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); op_resize::apply_cube_inplace((*this), new_n_rows, new_n_cols, new_n_slices); @@ -3919,7 +3915,7 @@ inline Cube& Cube::set_size(const SizeCube& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init_warm(s.n_rows, s.n_cols, s.n_slices); @@ -3933,7 +3929,7 @@ inline Cube& Cube::reshape(const SizeCube& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); op_reshape::apply_cube_inplace((*this), s.n_rows, s.n_cols, s.n_slices); @@ -3947,7 +3943,7 @@ inline Cube& Cube::resize(const SizeCube& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); op_resize::apply_cube_inplace((*this), s.n_rows, s.n_cols, s.n_slices); @@ -3963,7 +3959,7 @@ inline Cube& Cube::copy_size(const Cube& m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init_warm(m.n_rows, m.n_cols, m.n_slices); @@ -3979,7 +3975,7 @@ inline Cube& Cube::for_each(functor F) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eT* data = memptr(); @@ -4009,7 +4005,7 @@ inline const Cube& Cube::for_each(functor F) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const eT* data = memptr(); @@ -4040,7 +4036,7 @@ inline Cube& Cube::transform(functor F) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eT* out_mem = memptr(); @@ -4077,7 +4073,7 @@ inline Cube& Cube::imbue(functor F) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eT* out_mem = memptr(); @@ -4109,7 +4105,7 @@ inline Cube& Cube::replace(const eT old_val, const eT new_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arrayops::replace(memptr(), n_elem, old_val, new_val); @@ -4123,7 +4119,7 @@ inline Cube& Cube::clean(const typename get_pod_type::result threshold) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arrayops::clean(memptr(), n_elem, threshold); @@ -4137,16 +4133,16 @@ inline Cube& Cube::clamp(const eT min_val, const eT max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(is_cx::no) { - arma_debug_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "Cube::clamp(): min_val must be less than max_val" ); + arma_conform_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "Cube::clamp(): min_val must be less than max_val" ); } else { - arma_debug_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "Cube::clamp(): real(min_val) must be less than real(max_val)" ); - arma_debug_check( (access::tmp_imag(min_val) > access::tmp_imag(max_val)), "Cube::clamp(): imag(min_val) must be less than imag(max_val)" ); + arma_conform_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "Cube::clamp(): real(min_val) must be less than real(max_val)" ); + arma_conform_check( (access::tmp_imag(min_val) > access::tmp_imag(max_val)), "Cube::clamp(): imag(min_val) must be less than imag(max_val)" ); } arrayops::clamp(memptr(), n_elem, min_val, max_val); @@ -4162,7 +4158,7 @@ inline Cube& Cube::fill(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arrayops::inplace_set( memptr(), val, n_elem ); @@ -4176,7 +4172,7 @@ inline Cube& Cube::zeros() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arrayops::fill_zeros(memptr(), n_elem); @@ -4190,7 +4186,7 @@ inline Cube& Cube::zeros(const uword new_n_rows, const uword new_n_cols, const uword new_n_slices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); set_size(new_n_rows, new_n_cols, new_n_slices); @@ -4204,7 +4200,7 @@ inline Cube& Cube::zeros(const SizeCube& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).zeros(s.n_rows, s.n_cols, s.n_slices); } @@ -4216,7 +4212,7 @@ inline Cube& Cube::ones() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).fill(eT(1)); } @@ -4228,7 +4224,7 @@ inline Cube& Cube::ones(const uword new_n_rows, const uword new_n_cols, const uword new_n_slices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); set_size(new_n_rows, new_n_cols, new_n_slices); @@ -4242,7 +4238,7 @@ inline Cube& Cube::ones(const SizeCube& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).ones(s.n_rows, s.n_cols, s.n_slices); } @@ -4254,7 +4250,7 @@ inline Cube& Cube::randu() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_rng::randu::fill( memptr(), n_elem ); @@ -4268,7 +4264,7 @@ inline Cube& Cube::randu(const uword new_n_rows, const uword new_n_cols, const uword new_n_slices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); set_size(new_n_rows, new_n_cols, new_n_slices); @@ -4282,7 +4278,7 @@ inline Cube& Cube::randu(const SizeCube& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).randu(s.n_rows, s.n_cols, s.n_slices); } @@ -4294,7 +4290,7 @@ inline Cube& Cube::randn() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_rng::randn::fill( memptr(), n_elem ); @@ -4308,7 +4304,7 @@ inline Cube& Cube::randn(const uword new_n_rows, const uword new_n_cols, const uword new_n_slices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); set_size(new_n_rows, new_n_cols, new_n_slices); @@ -4322,7 +4318,7 @@ inline Cube& Cube::randn(const SizeCube& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).randn(s.n_rows, s.n_cols, s.n_slices); } @@ -4334,7 +4330,7 @@ inline void Cube::reset() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init_warm(0,0,0); } @@ -4346,7 +4342,7 @@ inline void Cube::soft_reset() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // don't change the size if the cube has a fixed size if(mem_state <= 1) @@ -4367,7 +4363,7 @@ inline void Cube::set_real(const BaseCube::pod_type,T1>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Cube_aux::set_real(*this, X); } @@ -4380,7 +4376,7 @@ inline void Cube::set_imag(const BaseCube::pod_type,T1>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Cube_aux::set_imag(*this, X); } @@ -4392,11 +4388,11 @@ inline eT Cube::min() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(n_elem == 0) { - arma_debug_check(true, "Cube::min(): object has no elements"); + arma_conform_check(true, "Cube::min(): object has no elements"); return Datum::nan; } @@ -4411,11 +4407,11 @@ inline eT Cube::max() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(n_elem == 0) { - arma_debug_check(true, "Cube::max(): object has no elements"); + arma_conform_check(true, "Cube::max(): object has no elements"); return Datum::nan; } @@ -4430,11 +4426,11 @@ inline eT Cube::min(uword& index_of_min_val) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(n_elem == 0) { - arma_debug_check(true, "Cube::min(): object has no elements"); + arma_conform_check(true, "Cube::min(): object has no elements"); index_of_min_val = uword(0); @@ -4451,11 +4447,11 @@ inline eT Cube::max(uword& index_of_max_val) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(n_elem == 0) { - arma_debug_check(true, "Cube::max(): object has no elements"); + arma_conform_check(true, "Cube::max(): object has no elements"); index_of_max_val = uword(0); @@ -4472,11 +4468,11 @@ inline eT Cube::min(uword& row_of_min_val, uword& col_of_min_val, uword& slice_of_min_val) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(n_elem == 0) { - arma_debug_check(true, "Cube::min(): object has no elements"); + arma_conform_check(true, "Cube::min(): object has no elements"); row_of_min_val = uword(0); col_of_min_val = uword(0); @@ -4507,11 +4503,11 @@ inline eT Cube::max(uword& row_of_max_val, uword& col_of_max_val, uword& slice_of_max_val) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(n_elem == 0) { - arma_debug_check(true, "Cube::max(): object has no elements"); + arma_conform_check(true, "Cube::max(): object has no elements"); row_of_max_val = uword(0); col_of_max_val = uword(0); @@ -4543,7 +4539,7 @@ inline bool Cube::save(const std::string name, const file_type type) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); bool save_okay = false; @@ -4578,11 +4574,11 @@ Cube::save(const std::string name, const file_type type) const break; default: - arma_debug_warn_level(1, "Cube::save(): unsupported file type"); + arma_conform_warn(1, "Cube::save(): unsupported file type"); save_okay = false; } - if(save_okay == false) { arma_debug_warn_level(3, "Cube::save(): write failed; file: ", name); } + if(save_okay == false) { arma_conform_warn(3, "Cube::save(): write failed; file: ", name); } return save_okay; } @@ -4594,7 +4590,7 @@ inline bool Cube::save(const hdf5_name& spec, const file_type type) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // handling of hdf5_binary_trans kept for compatibility with earlier versions of Armadillo @@ -4634,11 +4630,11 @@ Cube::save(const hdf5_name& spec, const file_type type) const { if(err_msg.length() > 0) { - arma_debug_warn_level(3, "Cube::save(): ", err_msg, "; file: ", spec.filename); + arma_conform_warn(3, "Cube::save(): ", err_msg, "; file: ", spec.filename); } else { - arma_debug_warn_level(3, "Cube::save(): write failed; file: ", spec.filename); + arma_conform_warn(3, "Cube::save(): write failed; file: ", spec.filename); } } @@ -4653,7 +4649,7 @@ inline bool Cube::save(std::ostream& os, const file_type type) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); bool save_okay = false; @@ -4680,11 +4676,11 @@ Cube::save(std::ostream& os, const file_type type) const break; default: - arma_debug_warn_level(1, "Cube::save(): unsupported file type"); + arma_conform_warn(1, "Cube::save(): unsupported file type"); save_okay = false; } - if(save_okay == false) { arma_debug_warn_level(3, "Cube::save(): stream write failed"); } + if(save_okay == false) { arma_conform_warn(3, "Cube::save(): stream write failed"); } return save_okay; } @@ -4697,7 +4693,7 @@ inline bool Cube::load(const std::string name, const file_type type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); bool load_okay = false; std::string err_msg; @@ -4737,7 +4733,7 @@ Cube::load(const std::string name, const file_type type) break; default: - arma_debug_warn_level(1, "Cube::load(): unsupported file type"); + arma_conform_warn(1, "Cube::load(): unsupported file type"); load_okay = false; } @@ -4747,11 +4743,11 @@ Cube::load(const std::string name, const file_type type) if(err_msg.length() > 0) { - arma_debug_warn_level(3, "Cube::load(): ", err_msg, "; file: ", name); + arma_conform_warn(3, "Cube::load(): ", err_msg, "; file: ", name); } else { - arma_debug_warn_level(3, "Cube::load(): read failed; file: ", name); + arma_conform_warn(3, "Cube::load(): read failed; file: ", name); } } @@ -4765,7 +4761,7 @@ inline bool Cube::load(const hdf5_name& spec, const file_type type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if( (type != hdf5_binary) && (type != hdf5_binary_trans) ) { @@ -4798,11 +4794,11 @@ Cube::load(const hdf5_name& spec, const file_type type) if(err_msg.length() > 0) { - arma_debug_warn_level(3, "Cube::load(): ", err_msg, "; file: ", spec.filename); + arma_conform_warn(3, "Cube::load(): ", err_msg, "; file: ", spec.filename); } else { - arma_debug_warn_level(3, "Cube::load(): read failed; file: ", spec.filename); + arma_conform_warn(3, "Cube::load(): read failed; file: ", spec.filename); } } @@ -4817,7 +4813,7 @@ inline bool Cube::load(std::istream& is, const file_type type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); bool load_okay = false; std::string err_msg; @@ -4849,7 +4845,7 @@ Cube::load(std::istream& is, const file_type type) break; default: - arma_debug_warn_level(1, "Cube::load(): unsupported file type"); + arma_conform_warn(1, "Cube::load(): unsupported file type"); load_okay = false; } @@ -4859,11 +4855,11 @@ Cube::load(std::istream& is, const file_type type) if(err_msg.length() > 0) { - arma_debug_warn_level(3, "Cube::load(): ", err_msg); + arma_conform_warn(3, "Cube::load(): ", err_msg); } else { - arma_debug_warn_level(3, "Cube::load(): stream read failed"); + arma_conform_warn(3, "Cube::load(): stream read failed"); } } @@ -4877,7 +4873,7 @@ inline bool Cube::quiet_save(const std::string name, const file_type type) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).save(name, type); } @@ -4889,7 +4885,7 @@ inline bool Cube::quiet_save(const hdf5_name& spec, const file_type type) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).save(spec, type); } @@ -4901,7 +4897,7 @@ inline bool Cube::quiet_save(std::ostream& os, const file_type type) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).save(os, type); } @@ -4913,7 +4909,7 @@ inline bool Cube::quiet_load(const std::string name, const file_type type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).load(name, type); } @@ -4925,7 +4921,7 @@ inline bool Cube::quiet_load(const hdf5_name& spec, const file_type type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).load(spec, type); } @@ -4937,7 +4933,7 @@ inline bool Cube::quiet_load(std::istream& is, const file_type type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).load(is, type); } @@ -4949,7 +4945,7 @@ inline typename Cube::iterator Cube::begin() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return memptr(); } @@ -4961,7 +4957,7 @@ inline typename Cube::const_iterator Cube::begin() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return memptr(); } @@ -4973,7 +4969,7 @@ inline typename Cube::const_iterator Cube::cbegin() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return memptr(); } @@ -4985,7 +4981,7 @@ inline typename Cube::iterator Cube::end() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return memptr() + n_elem; } @@ -4997,7 +4993,7 @@ inline typename Cube::const_iterator Cube::end() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return memptr() + n_elem; } @@ -5009,7 +5005,7 @@ inline typename Cube::const_iterator Cube::cend() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return memptr() + n_elem; } @@ -5021,9 +5017,9 @@ inline typename Cube::slice_iterator Cube::begin_slice(const uword slice_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (slice_num >= n_slices), "begin_slice(): index out of bounds" ); + arma_conform_check_bounds( (slice_num >= n_slices), "begin_slice(): index out of bounds" ); return slice_memptr(slice_num); } @@ -5035,9 +5031,9 @@ inline typename Cube::const_slice_iterator Cube::begin_slice(const uword slice_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (slice_num >= n_slices), "begin_slice(): index out of bounds" ); + arma_conform_check_bounds( (slice_num >= n_slices), "begin_slice(): index out of bounds" ); return slice_memptr(slice_num); } @@ -5049,9 +5045,9 @@ inline typename Cube::slice_iterator Cube::end_slice(const uword slice_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (slice_num >= n_slices), "end_slice(): index out of bounds" ); + arma_conform_check_bounds( (slice_num >= n_slices), "end_slice(): index out of bounds" ); return slice_memptr(slice_num) + n_elem_slice; } @@ -5063,9 +5059,9 @@ inline typename Cube::const_slice_iterator Cube::end_slice(const uword slice_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (slice_num >= n_slices), "end_slice(): index out of bounds" ); + arma_conform_check_bounds( (slice_num >= n_slices), "end_slice(): index out of bounds" ); return slice_memptr(slice_num) + n_elem_slice; } @@ -5110,7 +5106,7 @@ inline eT& Cube::front() { - arma_debug_check( (n_elem == 0), "Cube::front(): cube is empty" ); + arma_conform_check( (n_elem == 0), "Cube::front(): cube is empty" ); return access::rw(mem[0]); } @@ -5122,7 +5118,7 @@ inline const eT& Cube::front() const { - arma_debug_check( (n_elem == 0), "Cube::front(): cube is empty" ); + arma_conform_check( (n_elem == 0), "Cube::front(): cube is empty" ); return mem[0]; } @@ -5134,7 +5130,7 @@ inline eT& Cube::back() { - arma_debug_check( (n_elem == 0), "Cube::back(): cube is empty" ); + arma_conform_check( (n_elem == 0), "Cube::back(): cube is empty" ); return access::rw(mem[n_elem-1]); } @@ -5146,7 +5142,7 @@ inline const eT& Cube::back() const { - arma_debug_check( (n_elem == 0), "Cube::back(): cube is empty" ); + arma_conform_check( (n_elem == 0), "Cube::back(): cube is empty" ); return mem[n_elem-1]; } @@ -5160,7 +5156,7 @@ Cube::swap(Cube& B) { Cube& A = (*this); - arma_extra_debug_sigprint(arma_str::format("A = %x B = %x") % &A % &B); + arma_debug_sigprint(arma_str::format("A: %x; B: %x") % &A % &B); if( (A.mem_state == 0) && (B.mem_state == 0) && (A.n_elem > Cube_prealloc::mem_n_elem) && (B.n_elem > Cube_prealloc::mem_n_elem) ) { @@ -5229,7 +5225,7 @@ inline void Cube::steal_mem(Cube& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).steal_mem(x, false); } @@ -5241,13 +5237,13 @@ inline void Cube::steal_mem(Cube& x, const bool is_move) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(this == &x) { return; } if( (mem_state <= 1) && ( (x.n_alloc > Cube_prealloc::mem_n_elem) || (x.mem_state == 1) || (is_move && (x.mem_state == 2)) ) ) { - arma_extra_debug_print("Cube::steal_mem(): stealing memory"); + arma_debug_print("Cube::steal_mem(): stealing memory"); reset(); @@ -5264,14 +5260,14 @@ Cube::steal_mem(Cube& x, const bool is_move) if(x_n_slices > Cube_prealloc::mat_ptrs_size) { - arma_extra_debug_print("Cube::steal_mem(): stealing mat_ptrs array"); + arma_debug_print("Cube::steal_mem(): stealing mat_ptrs array"); mat_ptrs = x.mat_ptrs; x.mat_ptrs = nullptr; } else { - arma_extra_debug_print("Cube::steal_mem(): copying mat_ptrs array"); + arma_debug_print("Cube::steal_mem(): copying mat_ptrs array"); mat_ptrs = mat_ptrs_local; @@ -5293,7 +5289,7 @@ Cube::steal_mem(Cube& x, const bool is_move) } else { - arma_extra_debug_print("Cube::steal_mem(): copying memory"); + arma_debug_print("Cube::steal_mem(): copying memory"); (*this).operator=(x); @@ -5317,7 +5313,7 @@ arma_inline void Cube::fixed::mem_setup() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(fixed_n_elem > 0) { @@ -5354,18 +5350,15 @@ template inline Cube::fixed::fixed() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); mem_setup(); - if(arma_config::zero_init) - { - arma_extra_debug_print("Cube::fixed::constructor: zeroing memory"); - - eT* mem_use = (use_extra) ? &(mem_local_extra[0]) : &(mem_local[0]); - - arrayops::fill_zeros(mem_use, fixed_n_elem); - } + arma_debug_print("Cube::fixed::constructor: zeroing memory"); + + eT* mem_use = (use_extra) ? &(mem_local_extra[0]) : &(mem_local[0]); + + arrayops::fill_zeros(mem_use, fixed_n_elem); } @@ -5375,7 +5368,7 @@ template inline Cube::fixed::fixed(const fixed& X) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); mem_setup(); @@ -5392,7 +5385,7 @@ template inline Cube::fixed::fixed(const fill::scalar_holder f) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); mem_setup(); @@ -5407,7 +5400,7 @@ template inline Cube::fixed::fixed(const fill::fill_class&) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); mem_setup(); @@ -5427,7 +5420,7 @@ template inline Cube::fixed::fixed(const BaseCube& A) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); mem_setup(); @@ -5442,7 +5435,7 @@ template inline Cube::fixed::fixed(const BaseCube& A, const BaseCube& B) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); mem_setup(); @@ -5457,7 +5450,7 @@ inline Cube& Cube::fixed::operator=(const fixed& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eT* dest = (use_extra) ? mem_local_extra : mem_local; const eT* src = (use_extra) ? X.mem_local_extra : X.mem_local; @@ -5519,7 +5512,7 @@ arma_inline eT& Cube::fixed::operator() (const uword i) { - arma_debug_check_bounds( (i >= fixed_n_elem), "Cube::operator(): index out of bounds" ); + arma_conform_check_bounds( (i >= fixed_n_elem), "Cube::operator(): index out of bounds" ); return (use_extra) ? mem_local_extra[i] : mem_local[i]; } @@ -5532,7 +5525,7 @@ arma_inline const eT& Cube::fixed::operator() (const uword i) const { - arma_debug_check_bounds( (i >= fixed_n_elem), "Cube::operator(): index out of bounds" ); + arma_conform_check_bounds( (i >= fixed_n_elem), "Cube::operator(): index out of bounds" ); return (use_extra) ? mem_local_extra[i] : mem_local[i]; } @@ -5601,7 +5594,7 @@ arma_inline eT& Cube::fixed::operator() (const uword in_row, const uword in_col, const uword in_slice) { - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row >= fixed_n_rows ) || (in_col >= fixed_n_cols ) || @@ -5623,7 +5616,7 @@ arma_inline const eT& Cube::fixed::operator() (const uword in_row, const uword in_col, const uword in_slice) const { - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row >= fixed_n_rows ) || (in_col >= fixed_n_cols ) || @@ -5793,12 +5786,12 @@ inline void Cube_aux::set_real(Cube& out, const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_cube tmp(X.get_ref()); const Cube& A = tmp.M; - arma_debug_assert_same_size( out, A, "Cube::set_real()" ); + arma_conform_assert_same_size( out, A, "Cube::set_real()" ); out = A; } @@ -5810,7 +5803,7 @@ inline void Cube_aux::set_imag(Cube&, const BaseCube&) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -5820,7 +5813,7 @@ inline void Cube_aux::set_real(Cube< std::complex >& out, const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; @@ -5830,7 +5823,7 @@ Cube_aux::set_real(Cube< std::complex >& out, const BaseCube& X) const uword local_n_cols = P.get_n_cols(); const uword local_n_slices = P.get_n_slices(); - arma_debug_assert_same_size + arma_conform_assert_same_size ( out.n_rows, out.n_cols, out.n_slices, local_n_rows, local_n_cols, local_n_slices, @@ -5868,7 +5861,7 @@ inline void Cube_aux::set_imag(Cube< std::complex >& out, const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; @@ -5878,7 +5871,7 @@ Cube_aux::set_imag(Cube< std::complex >& out, const BaseCube& X) const uword local_n_cols = P.get_n_cols(); const uword local_n_slices = P.get_n_slices(); - arma_debug_assert_same_size + arma_conform_assert_same_size ( out.n_rows, out.n_cols, out.n_slices, local_n_rows, local_n_cols, local_n_slices, diff --git a/inst/include/armadillo_bits/GenCube_meat.hpp b/inst/include/armadillo_bits/GenCube_meat.hpp index 61735f3b..0700da39 100644 --- a/inst/include/armadillo_bits/GenCube_meat.hpp +++ b/inst/include/armadillo_bits/GenCube_meat.hpp @@ -28,7 +28,7 @@ GenCube::GenCube(const uword in_n_rows, const uword in_n_cols, con , n_cols (in_n_cols ) , n_slices(in_n_slices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -37,7 +37,7 @@ template arma_inline GenCube::~GenCube() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -86,7 +86,7 @@ inline void GenCube::apply(Cube& out) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: we're assuming that the cube has already been set to the correct size; // this is done by either the Cube contructor or operator=() @@ -102,9 +102,9 @@ inline void GenCube::apply_inplace_plus(Cube& out) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "addition"); + arma_conform_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "addition"); if(is_same_type::yes) { @@ -120,9 +120,9 @@ inline void GenCube::apply_inplace_minus(Cube& out) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "subtraction"); + arma_conform_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "subtraction"); if(is_same_type::yes) { @@ -138,9 +138,9 @@ inline void GenCube::apply_inplace_schur(Cube& out) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "element-wise multiplication"); + arma_conform_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "element-wise multiplication"); if(is_same_type::yes) { @@ -157,9 +157,9 @@ inline void GenCube::apply_inplace_div(Cube& out) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "element-wise division"); + arma_conform_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "element-wise division"); if(is_same_type::yes) { @@ -174,7 +174,7 @@ inline void GenCube::apply(subview_cube& out) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: we're assuming that the subcube has the same dimensions as the GenCube object // this is checked by subview_cube::operator=() diff --git a/inst/include/armadillo_bits/Gen_meat.hpp b/inst/include/armadillo_bits/Gen_meat.hpp index 96b8940c..76562135 100644 --- a/inst/include/armadillo_bits/Gen_meat.hpp +++ b/inst/include/armadillo_bits/Gen_meat.hpp @@ -27,7 +27,7 @@ Gen::Gen(const uword in_n_rows, const uword in_n_cols) : n_rows(in_n_rows) , n_cols(in_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -36,7 +36,7 @@ template arma_inline Gen::~Gen() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -88,7 +88,7 @@ inline void Gen::apply(Mat& out) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: we're assuming that the matrix has already been set to the correct size; // this is done by either the Mat contructor or operator=() @@ -105,9 +105,9 @@ inline void Gen::apply_inplace_plus(Mat& out) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "addition"); + arma_conform_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "addition"); typedef typename T1::elem_type eT; @@ -132,9 +132,9 @@ inline void Gen::apply_inplace_minus(Mat& out) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "subtraction"); + arma_conform_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "subtraction"); typedef typename T1::elem_type eT; @@ -159,9 +159,9 @@ inline void Gen::apply_inplace_schur(Mat& out) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "element-wise multiplication"); + arma_conform_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "element-wise multiplication"); typedef typename T1::elem_type eT; @@ -189,9 +189,9 @@ inline void Gen::apply_inplace_div(Mat& out) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "element-wise division"); + arma_conform_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "element-wise division"); typedef typename T1::elem_type eT; @@ -217,7 +217,7 @@ inline void Gen::apply(subview& out) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: we're assuming that the submatrix has the same dimensions as the Gen object // this is checked by subview::operator=() diff --git a/inst/include/armadillo_bits/GlueCube_meat.hpp b/inst/include/armadillo_bits/GlueCube_meat.hpp index 41956507..5140e546 100644 --- a/inst/include/armadillo_bits/GlueCube_meat.hpp +++ b/inst/include/armadillo_bits/GlueCube_meat.hpp @@ -27,7 +27,7 @@ GlueCube::GlueCube(const BaseCube& : A(in_A.get_ref()) , B(in_B.get_ref()) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -36,7 +36,7 @@ template inline GlueCube::~GlueCube() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } diff --git a/inst/include/armadillo_bits/Glue_meat.hpp b/inst/include/armadillo_bits/Glue_meat.hpp index 713fb16a..cf4cfc68 100644 --- a/inst/include/armadillo_bits/Glue_meat.hpp +++ b/inst/include/armadillo_bits/Glue_meat.hpp @@ -27,7 +27,7 @@ Glue::Glue(const T1& in_A, const T2& in_B) : A(in_A) , B(in_B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -39,7 +39,7 @@ Glue::Glue(const T1& in_A, const T2& in_B, const uword in_aux_u , B(in_B) , aux_uword(in_aux_uword) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -48,7 +48,7 @@ template inline Glue::~Glue() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } diff --git a/inst/include/armadillo_bits/MapMat_meat.hpp b/inst/include/armadillo_bits/MapMat_meat.hpp index e67a3072..9311511b 100644 --- a/inst/include/armadillo_bits/MapMat_meat.hpp +++ b/inst/include/armadillo_bits/MapMat_meat.hpp @@ -25,12 +25,12 @@ template inline MapMat::~MapMat() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); if(map_ptr) { (*map_ptr).clear(); delete map_ptr; } // try to expose buggy user code that accesses deleted objects - if(arma_config::debug) { map_ptr = nullptr; } + map_ptr = nullptr; arma_type_check(( is_supported_elem_type::value == false )); } @@ -45,7 +45,7 @@ MapMat::MapMat() , n_elem (0) , map_ptr(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); } @@ -60,7 +60,7 @@ MapMat::MapMat(const uword in_n_rows, const uword in_n_cols) , n_elem (in_n_rows * in_n_cols) , map_ptr(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); } @@ -75,7 +75,7 @@ MapMat::MapMat(const SizeMat& s) , n_elem (s.n_rows * s.n_cols) , map_ptr(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); } @@ -90,7 +90,7 @@ MapMat::MapMat(const MapMat& x) , n_elem (0) , map_ptr(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); @@ -104,7 +104,7 @@ inline void MapMat::operator=(const MapMat& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(this == &x) { return; } @@ -125,7 +125,7 @@ MapMat::MapMat(const SpMat& x) , n_elem (0) , map_ptr(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); @@ -139,7 +139,7 @@ inline void MapMat::operator=(const SpMat& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword x_n_rows = x.n_rows; const uword x_n_cols = x.n_cols; @@ -181,7 +181,7 @@ MapMat::MapMat(MapMat&& x) , n_elem (x.n_elem ) , map_ptr(x.map_ptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); access::rw(x.n_rows) = 0; access::rw(x.n_cols) = 0; @@ -196,7 +196,7 @@ inline void MapMat::operator=(MapMat&& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(this == &x) { return; } @@ -222,7 +222,7 @@ inline void MapMat::reset() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); access::rw(n_rows) = 0; access::rw(n_cols) = 0; @@ -238,7 +238,7 @@ inline void MapMat::set_size(const uword in_n_rows) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init_warm(in_n_rows, 1); } @@ -250,7 +250,7 @@ inline void MapMat::set_size(const uword in_n_rows, const uword in_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init_warm(in_n_rows, in_n_cols); } @@ -262,7 +262,7 @@ inline void MapMat::set_size(const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init_warm(s.n_rows, s.n_cols); } @@ -274,7 +274,7 @@ inline void MapMat::zeros() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*map_ptr).clear(); } @@ -286,7 +286,7 @@ inline void MapMat::zeros(const uword in_n_rows) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init_warm(in_n_rows, 1); @@ -300,7 +300,7 @@ inline void MapMat::zeros(const uword in_n_rows, const uword in_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init_warm(in_n_rows, in_n_cols); @@ -314,7 +314,7 @@ inline void MapMat::zeros(const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init_warm(s.n_rows, s.n_cols); @@ -328,7 +328,7 @@ inline void MapMat::eye() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).eye(n_rows, n_cols); } @@ -340,7 +340,7 @@ inline void MapMat::eye(const uword in_n_rows, const uword in_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); zeros(in_n_rows, in_n_cols); @@ -363,7 +363,7 @@ inline void MapMat::eye(const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).eye(s.n_rows, s.n_cols); } @@ -375,7 +375,7 @@ inline void MapMat::speye() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).eye(); } @@ -387,7 +387,7 @@ inline void MapMat::speye(const uword in_n_rows, const uword in_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).eye(in_n_rows, in_n_cols); } @@ -399,7 +399,7 @@ inline void MapMat::speye(const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).eye(s); } @@ -436,7 +436,7 @@ arma_inline MapMat_val MapMat::operator()(const uword index) { - arma_debug_check_bounds( (index >= n_elem), "MapMat::operator(): index out of bounds" ); + arma_conform_check_bounds( (index >= n_elem), "MapMat::operator(): index out of bounds" ); return MapMat_val(*this, index); } @@ -448,7 +448,7 @@ inline eT MapMat::operator()(const uword index) const { - arma_debug_check_bounds( (index >= n_elem), "MapMat::operator(): index out of bounds" ); + arma_conform_check_bounds( (index >= n_elem), "MapMat::operator(): index out of bounds" ); map_type& map_ref = (*map_ptr); @@ -494,7 +494,7 @@ arma_inline MapMat_val MapMat::operator()(const uword in_row, const uword in_col) { - arma_debug_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols)), "MapMat::operator(): index out of bounds" ); + arma_conform_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols)), "MapMat::operator(): index out of bounds" ); const uword index = (n_rows * in_col) + in_row; @@ -508,7 +508,7 @@ inline eT MapMat::operator()(const uword in_row, const uword in_col) const { - arma_debug_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols)), "MapMat::operator(): index out of bounds" ); + arma_conform_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols)), "MapMat::operator(): index out of bounds" ); const uword index = (n_rows * in_col) + in_row; @@ -579,7 +579,7 @@ inline void MapMat::sprandu(const uword in_n_rows, const uword in_n_cols, const double density) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); zeros(in_n_rows, in_n_cols); @@ -610,7 +610,7 @@ inline void MapMat::print(const std::string& extra_text) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(extra_text.length() != 0) { @@ -662,7 +662,7 @@ inline uword MapMat::get_n_nonzero() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return uword((*map_ptr).size()); } @@ -674,7 +674,7 @@ inline void MapMat::get_locval_format(umat& locs, Col& vals) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); map_type& map_ref = (*map_ptr); @@ -715,7 +715,7 @@ inline void MapMat::init_cold() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // ensure that n_elem can hold the result of (n_rows * n_cols) @@ -725,7 +725,7 @@ MapMat::init_cold() const char* error_message = "MapMat(): requested size is too large; suggest to enable ARMA_64BIT_WORD"; #endif - arma_debug_check + arma_conform_check ( ( ( (n_rows > ARMA_MAX_UHWORD) || (n_cols > ARMA_MAX_UHWORD) ) @@ -747,7 +747,7 @@ inline void MapMat::init_warm(const uword in_n_rows, const uword in_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if( (n_rows == in_n_rows) && (n_cols == in_n_cols)) { return; } @@ -759,7 +759,7 @@ MapMat::init_warm(const uword in_n_rows, const uword in_n_cols) const char* error_message = "MapMat(): requested size is too large; suggest to enable ARMA_64BIT_WORD"; #endif - arma_debug_check + arma_conform_check ( ( ( (in_n_rows > ARMA_MAX_UHWORD) || (in_n_cols > ARMA_MAX_UHWORD) ) @@ -785,7 +785,7 @@ arma_inline void MapMat::set_val(const uword index, const eT& in_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(in_val != eT(0)) { @@ -813,7 +813,7 @@ inline void MapMat::erase_val(const uword index) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); map_type& map_ref = (*map_ptr); @@ -838,7 +838,7 @@ MapMat_val::MapMat_val(MapMat& in_parent, const uword in_index) : parent(in_parent) , index (in_index ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -847,7 +847,7 @@ template arma_inline MapMat_val::operator eT() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const MapMat& const_parent = parent; @@ -861,7 +861,7 @@ arma_inline typename get_pod_type::result MapMat_val::real() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -877,7 +877,7 @@ arma_inline typename get_pod_type::result MapMat_val::imag() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -893,7 +893,7 @@ arma_inline void MapMat_val::operator=(const MapMat_val& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const eT in_val = eT(x); @@ -907,7 +907,7 @@ arma_inline void MapMat_val::operator=(const eT in_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); parent.set_val(index, in_val); } @@ -919,7 +919,7 @@ arma_inline void MapMat_val::operator+=(const eT in_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typename MapMat::map_type& map_ref = *(parent.map_ptr); @@ -940,7 +940,7 @@ arma_inline void MapMat_val::operator-=(const eT in_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typename MapMat::map_type& map_ref = *(parent.map_ptr); @@ -961,7 +961,7 @@ arma_inline void MapMat_val::operator*=(const eT in_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typename MapMat::map_type& map_ref = *(parent.map_ptr); @@ -992,7 +992,7 @@ arma_inline void MapMat_val::operator/=(const eT in_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typename MapMat::map_type& map_ref = *(parent.map_ptr); @@ -1024,7 +1024,7 @@ arma_inline void MapMat_val::operator++() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typename MapMat::map_type& map_ref = *(parent.map_ptr); @@ -1042,7 +1042,7 @@ arma_inline void MapMat_val::operator++(int) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).operator++(); } @@ -1054,7 +1054,7 @@ arma_inline void MapMat_val::operator--() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typename MapMat::map_type& map_ref = *(parent.map_ptr); @@ -1072,7 +1072,7 @@ arma_inline void MapMat_val::operator--(int) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).operator--(); } @@ -1093,7 +1093,7 @@ SpMat_MapMat_val::SpMat_MapMat_val(SpMat& in_s_parent, MapMat& in_m_ , row (in_row ) , col (in_col ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -1102,7 +1102,7 @@ template inline SpMat_MapMat_val::operator eT() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpMat& const_s_parent = s_parent; // declare as const for clarity of intent @@ -1116,7 +1116,7 @@ inline typename get_pod_type::result SpMat_MapMat_val::real() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -1132,7 +1132,7 @@ inline typename get_pod_type::result SpMat_MapMat_val::imag() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -1148,7 +1148,7 @@ inline SpMat_MapMat_val& SpMat_MapMat_val::operator=(const SpMat_MapMat_val& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const eT in_val = eT(x); @@ -1162,7 +1162,7 @@ inline SpMat_MapMat_val& SpMat_MapMat_val::operator=(const eT in_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_OPENMP) { @@ -1171,7 +1171,7 @@ SpMat_MapMat_val::operator=(const eT in_val) (*this).set(in_val); } } - #elif (!defined(ARMA_DONT_USE_STD_MUTEX)) + #elif defined(ARMA_USE_STD_MUTEX) { const std::lock_guard lock(s_parent.cache_mutex); @@ -1193,7 +1193,7 @@ inline SpMat_MapMat_val& SpMat_MapMat_val::operator+=(const eT in_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(in_val == eT(0)) { return *this; } @@ -1204,7 +1204,7 @@ SpMat_MapMat_val::operator+=(const eT in_val) (*this).add(in_val); } } - #elif (!defined(ARMA_DONT_USE_STD_MUTEX)) + #elif defined(ARMA_USE_STD_MUTEX) { const std::lock_guard lock(s_parent.cache_mutex); @@ -1226,7 +1226,7 @@ inline SpMat_MapMat_val& SpMat_MapMat_val::operator-=(const eT in_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(in_val == eT(0)) { return *this; } @@ -1237,7 +1237,7 @@ SpMat_MapMat_val::operator-=(const eT in_val) (*this).sub(in_val); } } - #elif (!defined(ARMA_DONT_USE_STD_MUTEX)) + #elif defined(ARMA_USE_STD_MUTEX) { const std::lock_guard lock(s_parent.cache_mutex); @@ -1259,7 +1259,7 @@ inline SpMat_MapMat_val& SpMat_MapMat_val::operator*=(const eT in_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_OPENMP) { @@ -1268,7 +1268,7 @@ SpMat_MapMat_val::operator*=(const eT in_val) (*this).mul(in_val); } } - #elif (!defined(ARMA_DONT_USE_STD_MUTEX)) + #elif defined(ARMA_USE_STD_MUTEX) { const std::lock_guard lock(s_parent.cache_mutex); @@ -1290,7 +1290,7 @@ inline SpMat_MapMat_val& SpMat_MapMat_val::operator/=(const eT in_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_OPENMP) { @@ -1299,7 +1299,7 @@ SpMat_MapMat_val::operator/=(const eT in_val) (*this).div(in_val); } } - #elif (!defined(ARMA_DONT_USE_STD_MUTEX)) + #elif defined(ARMA_USE_STD_MUTEX) { const std::lock_guard lock(s_parent.cache_mutex); @@ -1321,7 +1321,7 @@ inline SpMat_MapMat_val& SpMat_MapMat_val::operator++() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).operator+=( eT(1) ); } @@ -1333,7 +1333,7 @@ inline eT SpMat_MapMat_val::operator++(int) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const eT old_val = eT(*this); @@ -1349,7 +1349,7 @@ inline SpMat_MapMat_val& SpMat_MapMat_val::operator--() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).operator-=( eT(1) ); } @@ -1361,7 +1361,7 @@ inline eT SpMat_MapMat_val::operator--(int) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const eT old_val = eT(*this); @@ -1377,7 +1377,7 @@ inline void SpMat_MapMat_val::set(const eT in_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool done = (s_parent.sync_state == 0) ? s_parent.try_set_value_csc(row, col, in_val) : false; @@ -1402,7 +1402,7 @@ inline void SpMat_MapMat_val::add(const eT in_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool done = (s_parent.sync_state == 0) ? s_parent.try_add_value_csc(row, col, in_val) : false; @@ -1433,7 +1433,7 @@ inline void SpMat_MapMat_val::sub(const eT in_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool done = (s_parent.sync_state == 0) ? s_parent.try_sub_value_csc(row, col, in_val) : false; @@ -1464,7 +1464,7 @@ inline void SpMat_MapMat_val::mul(const eT in_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool done = (s_parent.sync_state == 0) ? s_parent.try_mul_value_csc(row, col, in_val) : false; @@ -1525,7 +1525,7 @@ inline void SpMat_MapMat_val::div(const eT in_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool done = (s_parent.sync_state == 0) ? s_parent.try_div_value_csc(row, col, in_val) : false; @@ -1585,7 +1585,7 @@ SpSubview_MapMat_val::SpSubview_MapMat_val(SpSubview& in_sv_parent, MapM : SpMat_MapMat_val(access::rw(in_sv_parent.m), in_m_parent, in_row, in_col) , sv_parent(in_sv_parent) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -1595,7 +1595,7 @@ inline SpSubview_MapMat_val& SpSubview_MapMat_val::operator=(const SpSubview_MapMat_val& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const eT in_val = eT(x); @@ -1609,7 +1609,7 @@ inline SpSubview_MapMat_val& SpSubview_MapMat_val::operator=(const eT in_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword old_n_nonzero = sv_parent.m.n_nonzero; @@ -1628,7 +1628,7 @@ inline SpSubview_MapMat_val& SpSubview_MapMat_val::operator+=(const eT in_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword old_n_nonzero = sv_parent.m.n_nonzero; @@ -1647,7 +1647,7 @@ inline SpSubview_MapMat_val& SpSubview_MapMat_val::operator-=(const eT in_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword old_n_nonzero = sv_parent.m.n_nonzero; @@ -1666,7 +1666,7 @@ inline SpSubview_MapMat_val& SpSubview_MapMat_val::operator*=(const eT in_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword old_n_nonzero = sv_parent.m.n_nonzero; @@ -1685,7 +1685,7 @@ inline SpSubview_MapMat_val& SpSubview_MapMat_val::operator/=(const eT in_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword old_n_nonzero = sv_parent.m.n_nonzero; @@ -1704,7 +1704,7 @@ inline SpSubview_MapMat_val& SpSubview_MapMat_val::operator++() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword old_n_nonzero = sv_parent.m.n_nonzero; @@ -1723,7 +1723,7 @@ inline eT SpSubview_MapMat_val::operator++(int) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword old_n_nonzero = sv_parent.m.n_nonzero; @@ -1742,7 +1742,7 @@ inline SpSubview_MapMat_val& SpSubview_MapMat_val::operator--() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword old_n_nonzero = sv_parent.m.n_nonzero; @@ -1761,7 +1761,7 @@ inline eT SpSubview_MapMat_val::operator--(int) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword old_n_nonzero = sv_parent.m.n_nonzero; diff --git a/inst/include/armadillo_bits/Mat_bones.hpp b/inst/include/armadillo_bits/Mat_bones.hpp index baa41daf..81a855de 100644 --- a/inst/include/armadillo_bits/Mat_bones.hpp +++ b/inst/include/armadillo_bits/Mat_bones.hpp @@ -178,8 +178,10 @@ class Mat : public Base< eT, Mat > inline explicit Mat(const SpSubview& X); inline Mat& operator= (const SpSubview& X); + inline Mat& operator+=(const SpSubview& X); + inline Mat& operator-=(const SpSubview& X); - inline explicit Mat(const spdiagview& X); + inline Mat(const spdiagview& X); inline Mat& operator= (const spdiagview& X); inline Mat& operator+=(const spdiagview& X); inline Mat& operator-=(const spdiagview& X); @@ -366,6 +368,14 @@ class Mat : public Base< eT, Mat > template inline Mat& operator%=(const SpToDOp& X); template inline Mat& operator/=(const SpToDOp& X); + template inline Mat(const mtSpToDOp& X); + template inline Mat& operator= (const mtSpToDOp& X); + template inline Mat& operator+=(const mtSpToDOp& X); + template inline Mat& operator-=(const mtSpToDOp& X); + template inline Mat& operator*=(const mtSpToDOp& X); + template inline Mat& operator%=(const mtSpToDOp& X); + template inline Mat& operator/=(const mtSpToDOp& X); + template inline Mat(const Glue& X); template inline Mat& operator= (const Glue& X); template inline Mat& operator+=(const Glue& X); diff --git a/inst/include/armadillo_bits/Mat_meat.hpp b/inst/include/armadillo_bits/Mat_meat.hpp index 75e5c401..3db9bcd8 100644 --- a/inst/include/armadillo_bits/Mat_meat.hpp +++ b/inst/include/armadillo_bits/Mat_meat.hpp @@ -24,16 +24,16 @@ template inline Mat::~Mat() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); if(n_alloc > 0) { - arma_extra_debug_print("Mat::destructor: releasing memory"); + arma_debug_print("Mat::destructor: releasing memory"); memory::release( access::rw(mem) ); } // try to expose buggy user code that accesses deleted objects - if(arma_config::debug) { access::rw(mem) = nullptr; } + access::rw(mem) = nullptr; arma_type_check(( is_supported_elem_type::value == false )); } @@ -51,7 +51,7 @@ Mat::Mat() , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } @@ -68,15 +68,13 @@ Mat::Mat(const uword in_n_rows, const uword in_n_cols) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); - if(arma_config::zero_init) - { - arma_extra_debug_print("Mat::constructor: zeroing memory"); - arrayops::fill_zeros(memptr(), n_elem); - } + arma_debug_print("Mat::constructor: zeroing memory"); + + arrayops::fill_zeros(memptr(), n_elem); } @@ -92,15 +90,13 @@ Mat::Mat(const SizeMat& s) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); - if(arma_config::zero_init) - { - arma_extra_debug_print("Mat::constructor: zeroing memory"); - arrayops::fill_zeros(memptr(), n_elem); - } + arma_debug_print("Mat::constructor: zeroing memory"); + + arrayops::fill_zeros(memptr(), n_elem); } @@ -118,13 +114,13 @@ Mat::Mat(const uword in_n_rows, const uword in_n_cols, const arma_initmode_i , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); if(do_zeros) { - arma_extra_debug_print("Mat::constructor: zeroing memory"); + arma_debug_print("Mat::constructor: zeroing memory"); arrayops::fill_zeros(memptr(), n_elem); } } @@ -144,13 +140,13 @@ Mat::Mat(const SizeMat& s, const arma_initmode_indicator&) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); if(do_zeros) { - arma_extra_debug_print("Mat::constructor: zeroing memory"); + arma_debug_print("Mat::constructor: zeroing memory"); arrayops::fill_zeros(memptr(), n_elem); } } @@ -170,7 +166,7 @@ Mat::Mat(const uword in_n_rows, const uword in_n_cols, const fill::fill_clas , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); @@ -191,7 +187,7 @@ Mat::Mat(const SizeMat& s, const fill::fill_class& f) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); @@ -212,7 +208,7 @@ Mat::Mat(const uword in_n_rows, const uword in_n_cols, const fill::scalar_ho , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); @@ -232,7 +228,7 @@ Mat::Mat(const SizeMat& s, const fill::scalar_holder f) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); @@ -253,7 +249,7 @@ Mat::Mat(const arma_vec_indicator&, const uhword in_vec_state) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } @@ -270,7 +266,7 @@ Mat::Mat(const arma_vec_indicator&, const uword in_n_rows, const uword in_n_ , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); } @@ -288,7 +284,7 @@ Mat::Mat(const arma_fixed_indicator&, const uword in_n_rows, const uword in_ , mem_state (3) , mem (in_mem) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } @@ -298,7 +294,7 @@ inline void Mat::init_cold() { - arma_extra_debug_sigprint( arma_str::format("n_rows = %u, n_cols = %u") % n_rows % n_cols ); + arma_debug_sigprint( arma_str::format("n_rows: %u; n_cols: %u") % n_rows % n_cols ); // ensure that n_elem can hold the result of (n_rows * n_cols) @@ -308,7 +304,7 @@ Mat::init_cold() const char* error_message = "Mat::init(): requested size is too large; suggest to enable ARMA_64BIT_WORD"; #endif - arma_debug_check + arma_conform_check ( ( ( (n_rows > ARMA_MAX_UHWORD) || (n_cols > ARMA_MAX_UHWORD) ) @@ -320,14 +316,14 @@ Mat::init_cold() if(n_elem <= arma_config::mat_prealloc) { - if(n_elem > 0) { arma_extra_debug_print("Mat::init(): using local memory"); } + if(n_elem > 0) { arma_debug_print("Mat::init(): using local memory"); } access::rw(mem) = (n_elem == 0) ? nullptr : mem_local; access::rw(n_alloc) = 0; } else { - arma_extra_debug_print("Mat::init(): acquiring memory"); + arma_debug_print("Mat::init(): acquiring memory"); access::rw(mem) = memory::acquire(n_elem); access::rw(n_alloc) = n_elem; @@ -341,7 +337,7 @@ inline void Mat::init_warm(uword in_n_rows, uword in_n_cols) { - arma_extra_debug_sigprint( arma_str::format("in_n_rows = %u, in_n_cols = %u") % in_n_rows % in_n_cols ); + arma_debug_sigprint( arma_str::format("in_n_rows: %u; in_n_cols: %u") % in_n_rows % in_n_cols ); if( (n_rows == in_n_rows) && (n_cols == in_n_cols) ) { return; } @@ -355,7 +351,7 @@ Mat::init_warm(uword in_n_rows, uword in_n_cols) const char* error_message_2 = "Mat::init(): requested size is not compatible with column vector layout"; const char* error_message_3 = "Mat::init(): requested size is not compatible with row vector layout"; - arma_debug_set_error( err_state, err_msg, (t_mem_state == 3), error_message_1 ); + arma_conform_set_error( err_state, err_msg, (t_mem_state == 3), error_message_1 ); if(t_vec_state > 0) { @@ -366,8 +362,8 @@ Mat::init_warm(uword in_n_rows, uword in_n_cols) } else { - if(t_vec_state == 1) { arma_debug_set_error( err_state, err_msg, (in_n_cols != 1), error_message_2 ); } - if(t_vec_state == 2) { arma_debug_set_error( err_state, err_msg, (in_n_rows != 1), error_message_3 ); } + if(t_vec_state == 1) { arma_conform_set_error( err_state, err_msg, (in_n_cols != 1), error_message_2 ); } // TODO: (in_n_cols > 1) ? + if(t_vec_state == 2) { arma_conform_set_error( err_state, err_msg, (in_n_rows != 1), error_message_3 ); } // TODO: (in_n_rows > 1) ? } } @@ -379,7 +375,7 @@ Mat::init_warm(uword in_n_rows, uword in_n_cols) const char* error_message_4 = "Mat::init(): requested size is too large; suggest to enable ARMA_64BIT_WORD"; #endif - arma_debug_set_error + arma_conform_set_error ( err_state, err_msg, @@ -391,30 +387,30 @@ Mat::init_warm(uword in_n_rows, uword in_n_cols) error_message_4 ); - arma_debug_check(err_state, err_msg); + arma_conform_check(err_state, err_msg); const uword old_n_elem = n_elem; const uword new_n_elem = in_n_rows * in_n_cols; if(old_n_elem == new_n_elem) { - arma_extra_debug_print("Mat::init(): reusing memory"); + arma_debug_print("Mat::init(): reusing memory"); access::rw(n_rows) = in_n_rows; access::rw(n_cols) = in_n_cols; return; } - arma_debug_check( (t_mem_state == 2), "Mat::init(): mismatch between size of auxiliary memory and requested size" ); + arma_conform_check( (t_mem_state == 2), "Mat::init(): mismatch between size of auxiliary memory and requested size" ); if(new_n_elem <= arma_config::mat_prealloc) { if(n_alloc > 0) { - arma_extra_debug_print("Mat::init(): releasing memory"); + arma_debug_print("Mat::init(): releasing memory"); memory::release( access::rw(mem) ); } - if(new_n_elem > 0) { arma_extra_debug_print("Mat::init(): using local memory"); } + if(new_n_elem > 0) { arma_debug_print("Mat::init(): using local memory"); } access::rw(mem) = (new_n_elem == 0) ? nullptr : mem_local; access::rw(n_alloc) = 0; @@ -425,7 +421,7 @@ Mat::init_warm(uword in_n_rows, uword in_n_cols) { if(n_alloc > 0) { - arma_extra_debug_print("Mat::init(): releasing memory"); + arma_debug_print("Mat::init(): releasing memory"); memory::release( access::rw(mem) ); // in case memory::acquire() throws an exception @@ -436,13 +432,13 @@ Mat::init_warm(uword in_n_rows, uword in_n_cols) access::rw(n_alloc) = 0; } - arma_extra_debug_print("Mat::init(): acquiring memory"); + arma_debug_print("Mat::init(): acquiring memory"); access::rw(mem) = memory::acquire(new_n_elem); access::rw(n_alloc) = new_n_elem; } else // condition: new_n_elem <= n_alloc { - arma_extra_debug_print("Mat::init(): reusing memory"); + arma_debug_print("Mat::init(): reusing memory"); } } @@ -466,7 +462,7 @@ Mat::Mat(const char* text) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init( std::string(text) ); } @@ -479,7 +475,7 @@ inline Mat& Mat::operator=(const char* text) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init( std::string(text) ); @@ -500,7 +496,7 @@ Mat::Mat(const std::string& text) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init(text); } @@ -513,7 +509,7 @@ inline Mat& Mat::operator=(const std::string& text) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init(text); @@ -528,7 +524,7 @@ inline void Mat::init(const std::string& text_orig) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool replace_commas = (is_cx::yes) ? false : ( text_orig.find(',') != std::string::npos ); @@ -651,7 +647,7 @@ Mat::Mat(const std::vector& x) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); @@ -666,7 +662,7 @@ inline Mat& Mat::operator=(const std::vector& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init_warm(uword(x.size()), 1); @@ -688,7 +684,7 @@ Mat::Mat(const std::initializer_list& list) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init(list); } @@ -700,7 +696,7 @@ inline Mat& Mat::operator=(const std::initializer_list& list) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init(list); @@ -720,7 +716,7 @@ Mat::Mat(const std::initializer_list< std::initializer_list >& list) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init(list); } @@ -732,7 +728,7 @@ inline Mat& Mat::operator=(const std::initializer_list< std::initializer_list >& list) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init(list); @@ -752,7 +748,7 @@ Mat::Mat(Mat&& X) , mem_state(0 ) , mem ( ) { - arma_extra_debug_sigprint(arma_str::format("this = %x X = %x") % this % &X); + arma_debug_sigprint(arma_str::format("this: %x; X: %x") % this % &X); if( (X.n_alloc > arma_config::mat_prealloc) || (X.mem_state == 1) || (X.mem_state == 2) ) { @@ -789,7 +785,7 @@ inline Mat& Mat::operator=(Mat&& X) { - arma_extra_debug_sigprint(arma_str::format("this = %x X = %x") % this % &X); + arma_debug_sigprint(arma_str::format("this: %x; X: %x") % this % &X); (*this).steal_mem(X, true); @@ -805,7 +801,7 @@ inline Mat& Mat::operator=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init_warm(1,1); @@ -822,7 +818,7 @@ inline Mat& Mat::operator+=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arrayops::inplace_plus( memptr(), val, n_elem ); @@ -837,7 +833,7 @@ inline Mat& Mat::operator-=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arrayops::inplace_minus( memptr(), val, n_elem ); @@ -852,7 +848,7 @@ inline Mat& Mat::operator*=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arrayops::inplace_mul( memptr(), val, n_elem ); @@ -867,7 +863,7 @@ inline Mat& Mat::operator/=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arrayops::inplace_div( memptr(), val, n_elem ); @@ -888,7 +884,7 @@ Mat::Mat(const Mat& in_mat) , mem_state(0) , mem() { - arma_extra_debug_sigprint(arma_str::format("this = %x in_mat = %x") % this % &in_mat); + arma_debug_sigprint(arma_str::format("this: %x; in_mat: %x") % this % &in_mat); init_cold(); @@ -903,7 +899,7 @@ inline Mat& Mat::operator=(const Mat& in_mat) { - arma_extra_debug_sigprint(arma_str::format("this = %x in_mat = %x") % this % &in_mat); + arma_debug_sigprint(arma_str::format("this: %x; in_mat: %x") % this % &in_mat); if(this != &in_mat) { @@ -922,7 +918,7 @@ inline void Mat::init(const std::initializer_list& list) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N = uword(list.size()); @@ -938,7 +934,7 @@ inline void Mat::init(const std::initializer_list< std::initializer_list >& list) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uword x_n_rows = uword(list.size()); uword x_n_cols = 0; @@ -960,7 +956,7 @@ Mat::init(const std::initializer_list< std::initializer_list >& list) if(t.mem_state == 3) { - arma_debug_check( ((x_n_rows != t.n_rows) || (x_n_cols != t.n_cols)), "Mat::init(): size mismatch between fixed size matrix and initialiser list" ); + arma_conform_check( ((x_n_rows != t.n_rows) || (x_n_cols != t.n_cols)), "Mat::init(): size mismatch between fixed size matrix and initialiser list" ); } else { @@ -1005,7 +1001,7 @@ Mat::init const Base::pod_type, T2>& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type T; @@ -1017,7 +1013,7 @@ Mat::init const Proxy PX(X.get_ref()); const Proxy PY(Y.get_ref()); - arma_debug_assert_same_size(PX, PY, "Mat()"); + arma_conform_assert_same_size(PX, PY, "Mat()"); const uword local_n_rows = PX.get_n_rows(); const uword local_n_cols = PX.get_n_cols(); @@ -1026,7 +1022,7 @@ Mat::init eT* out_mem = (*this).memptr(); - const bool use_at = ( Proxy::use_at || Proxy::use_at ); + constexpr bool use_at = ( Proxy::use_at || Proxy::use_at ); if(use_at == false) { @@ -1064,7 +1060,7 @@ Mat::swap(Mat& B) { Mat& A = (*this); - arma_extra_debug_sigprint(arma_str::format("A = %x B = %x") % &A % &B); + arma_debug_sigprint(arma_str::format("A: %x; B: %x") % &A % &B); bool layout_ok = false; @@ -1192,7 +1188,7 @@ inline void Mat::steal_mem(Mat& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).steal_mem(x, false); } @@ -1204,7 +1200,7 @@ inline void Mat::steal_mem(Mat& x, const bool is_move) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(this == &x) { return; } @@ -1222,7 +1218,7 @@ Mat::steal_mem(Mat& x, const bool is_move) if( layout_ok && (t_mem_state <= 1) && ( (x_n_alloc > arma_config::mat_prealloc) || (x_mem_state == 1) || (is_move && (x_mem_state == 2)) ) ) { - arma_extra_debug_print("Mat::steal_mem(): stealing memory"); + arma_debug_print("Mat::steal_mem(): stealing memory"); reset(); @@ -1242,7 +1238,7 @@ Mat::steal_mem(Mat& x, const bool is_move) } else { - arma_extra_debug_print("Mat::steal_mem(): copying memory"); + arma_debug_print("Mat::steal_mem(): copying memory"); (*this).operator=(x); @@ -1263,7 +1259,7 @@ inline void Mat::steal_mem_col(Mat& x, const uword max_n_rows) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword x_n_elem = x.n_elem; const uword x_n_alloc = x.n_alloc; @@ -1336,7 +1332,7 @@ Mat::Mat(eT* aux_mem, const uword aux_n_rows, const uword aux_n_cols, const , mem_state( copy_aux_mem ? 0 : ( strict ? 2 : 1 ) ) , mem ( copy_aux_mem ? nullptr : aux_mem ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); if(copy_aux_mem) { @@ -1361,7 +1357,7 @@ Mat::Mat(const eT* aux_mem, const uword aux_n_rows, const uword aux_n_cols) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); @@ -1385,7 +1381,7 @@ Mat::Mat(const char junk, const eT* aux_mem, const uword aux_n_rows, const u , mem_state(3 ) , mem (aux_mem ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); arma_ignore(junk); } @@ -1398,9 +1394,9 @@ inline Mat& Mat::operator+=(const Mat& m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(*this, m, "addition"); + arma_conform_assert_same_size(*this, m, "addition"); arrayops::inplace_plus( memptr(), m.memptr(), n_elem ); @@ -1415,9 +1411,9 @@ inline Mat& Mat::operator-=(const Mat& m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(*this, m, "subtraction"); + arma_conform_assert_same_size(*this, m, "subtraction"); arrayops::inplace_minus( memptr(), m.memptr(), n_elem ); @@ -1432,7 +1428,7 @@ inline Mat& Mat::operator*=(const Mat& m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); glue_times::apply_inplace(*this, m); @@ -1447,9 +1443,9 @@ inline Mat& Mat::operator%=(const Mat& m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(*this, m, "element-wise multiplication"); + arma_conform_assert_same_size(*this, m, "element-wise multiplication"); arrayops::inplace_mul( memptr(), m.memptr(), n_elem ); @@ -1464,9 +1460,9 @@ inline Mat& Mat::operator/=(const Mat& m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(*this, m, "element-wise division"); + arma_conform_assert_same_size(*this, m, "element-wise division"); arrayops::inplace_div( memptr(), m.memptr(), n_elem ); @@ -1487,7 +1483,7 @@ Mat::Mat(const BaseCube& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); (*this).operator=(X); } @@ -1500,14 +1496,14 @@ inline Mat& Mat::operator=(const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat& out = *this; const unwrap_cube tmp(X.get_ref()); const Cube& in = tmp.M; - arma_debug_assert_cube_as_mat(out, in, "copy into matrix", false); + arma_conform_assert_cube_as_mat(out, in, "copy into matrix", false); const uword in_n_rows = in.n_rows; const uword in_n_cols = in.n_cols; @@ -1587,14 +1583,14 @@ inline Mat& Mat::operator+=(const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat& out = *this; const unwrap_cube tmp(X.get_ref()); const Cube& in = tmp.M; - arma_debug_assert_cube_as_mat(out, in, "addition", true); + arma_conform_assert_cube_as_mat(out, in, "addition", true); const uword in_n_rows = in.n_rows; const uword in_n_cols = in.n_cols; @@ -1668,14 +1664,14 @@ inline Mat& Mat::operator-=(const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat& out = *this; const unwrap_cube tmp(X.get_ref()); const Cube& in = tmp.M; - arma_debug_assert_cube_as_mat(out, in, "subtraction", true); + arma_conform_assert_cube_as_mat(out, in, "subtraction", true); const uword in_n_rows = in.n_rows; const uword in_n_cols = in.n_cols; @@ -1749,7 +1745,7 @@ inline Mat& Mat::operator*=(const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat B(X); @@ -1766,14 +1762,14 @@ inline Mat& Mat::operator%=(const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat& out = *this; const unwrap_cube tmp(X.get_ref()); const Cube& in = tmp.M; - arma_debug_assert_cube_as_mat(out, in, "element-wise multiplication", true); + arma_conform_assert_cube_as_mat(out, in, "element-wise multiplication", true); const uword in_n_rows = in.n_rows; const uword in_n_cols = in.n_cols; @@ -1847,14 +1843,14 @@ inline Mat& Mat::operator/=(const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat& out = *this; const unwrap_cube tmp(X.get_ref()); const Cube& in = tmp.M; - arma_debug_assert_cube_as_mat(out, in, "element-wise division", true); + arma_conform_assert_cube_as_mat(out, in, "element-wise division", true); const uword in_n_rows = in.n_rows; const uword in_n_cols = in.n_cols; @@ -1939,7 +1935,7 @@ Mat::Mat , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init(A,B); } @@ -1957,11 +1953,11 @@ Mat::Mat(const subview& X, const bool use_colmem) , mem_state(use_colmem ? 3 : 0) , mem (use_colmem ? X.colptr(0) : nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); if(use_colmem) { - arma_extra_debug_print("Mat::Mat(): using existing memory in a submatrix"); + arma_debug_print("Mat::Mat(): using existing memory in a submatrix"); } else { @@ -1985,7 +1981,7 @@ Mat::Mat(const subview& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); @@ -2000,7 +1996,7 @@ inline Mat& Mat::operator=(const subview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool alias = (this == &(X.m)); @@ -2027,7 +2023,7 @@ inline Mat& Mat::operator+=(const subview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview::plus_inplace(*this, X); @@ -2041,7 +2037,7 @@ inline Mat& Mat::operator-=(const subview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview::minus_inplace(*this, X); @@ -2056,7 +2052,7 @@ inline Mat& Mat::operator*=(const subview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); glue_times::apply_inplace(*this, X); @@ -2071,7 +2067,7 @@ inline Mat& Mat::operator%=(const subview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview::schur_inplace(*this, X); @@ -2086,7 +2082,7 @@ inline Mat& Mat::operator/=(const subview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview::div_inplace(*this, X); @@ -2106,7 +2102,7 @@ Mat::Mat(const subview_row_strans& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); @@ -2126,7 +2122,7 @@ Mat::Mat(const subview_row_htrans& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); @@ -2146,7 +2142,7 @@ Mat::Mat(const xvec_htrans& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); @@ -2167,7 +2163,7 @@ Mat::Mat(const xtrans_mat& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); @@ -2188,7 +2184,7 @@ Mat::Mat(const subview_cube& x) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); this->operator=(x); } @@ -2201,7 +2197,7 @@ inline Mat& Mat::operator=(const subview_cube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_cube::extract(*this, X); @@ -2216,7 +2212,7 @@ inline Mat& Mat::operator+=(const subview_cube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_cube::plus_inplace(*this, X); @@ -2231,7 +2227,7 @@ inline Mat& Mat::operator-=(const subview_cube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_cube::minus_inplace(*this, X); @@ -2246,7 +2242,7 @@ inline Mat& Mat::operator*=(const subview_cube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat tmp(X); @@ -2263,7 +2259,7 @@ inline Mat& Mat::operator%=(const subview_cube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_cube::schur_inplace(*this, X); @@ -2278,7 +2274,7 @@ inline Mat& Mat::operator/=(const subview_cube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_cube::div_inplace(*this, X); @@ -2299,7 +2295,7 @@ Mat::Mat(const diagview& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); @@ -2314,7 +2310,7 @@ inline Mat& Mat::operator=(const diagview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool alias = (this == &(X.m)); @@ -2342,7 +2338,7 @@ inline Mat& Mat::operator+=(const diagview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); diagview::plus_inplace(*this, X); @@ -2357,7 +2353,7 @@ inline Mat& Mat::operator-=(const diagview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); diagview::minus_inplace(*this, X); @@ -2372,7 +2368,7 @@ inline Mat& Mat::operator*=(const diagview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); glue_times::apply_inplace(*this, X); @@ -2387,7 +2383,7 @@ inline Mat& Mat::operator%=(const diagview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); diagview::schur_inplace(*this, X); @@ -2402,7 +2398,7 @@ inline Mat& Mat::operator/=(const diagview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); diagview::div_inplace(*this, X); @@ -2423,7 +2419,7 @@ Mat::Mat(const subview_elem1& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); this->operator=(X); } @@ -2436,7 +2432,7 @@ inline Mat& Mat::operator=(const subview_elem1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_elem1::extract(*this, X); @@ -2451,7 +2447,7 @@ inline Mat& Mat::operator+=(const subview_elem1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_elem1::plus_inplace(*this, X); @@ -2466,7 +2462,7 @@ inline Mat& Mat::operator-=(const subview_elem1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_elem1::minus_inplace(*this, X); @@ -2481,7 +2477,7 @@ inline Mat& Mat::operator*=(const subview_elem1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); glue_times::apply_inplace(*this, X); @@ -2496,7 +2492,7 @@ inline Mat& Mat::operator%=(const subview_elem1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_elem1::schur_inplace(*this, X); @@ -2511,7 +2507,7 @@ inline Mat& Mat::operator/=(const subview_elem1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_elem1::div_inplace(*this, X); @@ -2532,7 +2528,7 @@ Mat::Mat(const subview_elem2& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); this->operator=(X); } @@ -2545,7 +2541,7 @@ inline Mat& Mat::operator=(const subview_elem2& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_elem2::extract(*this, X); @@ -2560,7 +2556,7 @@ inline Mat& Mat::operator+=(const subview_elem2& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_elem2::plus_inplace(*this, X); @@ -2575,7 +2571,7 @@ inline Mat& Mat::operator-=(const subview_elem2& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_elem2::minus_inplace(*this, X); @@ -2590,7 +2586,7 @@ inline Mat& Mat::operator*=(const subview_elem2& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); glue_times::apply_inplace(*this, X); @@ -2605,7 +2601,7 @@ inline Mat& Mat::operator%=(const subview_elem2& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_elem2::schur_inplace(*this, X); @@ -2620,7 +2616,7 @@ inline Mat& Mat::operator/=(const subview_elem2& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_elem2::div_inplace(*this, X); @@ -2641,7 +2637,7 @@ Mat::Mat(const SpBase& m) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); (*this).operator=(m); } @@ -2654,7 +2650,7 @@ inline Mat& Mat::operator=(const SpBase& m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat U(m.get_ref()); const SpMat& x = U.M; @@ -2694,11 +2690,11 @@ inline Mat& Mat::operator+=(const SpBase& m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy p(m.get_ref()); - arma_debug_assert_same_size(n_rows, n_cols, p.get_n_rows(), p.get_n_cols(), "addition"); + arma_conform_assert_same_size(n_rows, n_cols, p.get_n_rows(), p.get_n_cols(), "addition"); typename SpProxy::const_iterator_type it = p.begin(); typename SpProxy::const_iterator_type it_end = p.end(); @@ -2716,11 +2712,11 @@ inline Mat& Mat::operator-=(const SpBase& m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy p(m.get_ref()); - arma_debug_assert_same_size(n_rows, n_cols, p.get_n_rows(), p.get_n_cols(), "subtraction"); + arma_conform_assert_same_size(n_rows, n_cols, p.get_n_rows(), p.get_n_cols(), "subtraction"); typename SpProxy::const_iterator_type it = p.begin(); typename SpProxy::const_iterator_type it_end = p.end(); @@ -2738,7 +2734,7 @@ inline Mat& Mat::operator*=(const SpBase& m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat z = (*this) * m.get_ref(); @@ -2755,11 +2751,13 @@ inline Mat& Mat::operator%=(const SpBase& m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy p(m.get_ref()); - arma_debug_assert_same_size(n_rows, n_cols, p.get_n_rows(), p.get_n_cols(), "element-wise multiplication"); + arma_conform_assert_same_size(n_rows, n_cols, p.get_n_rows(), p.get_n_cols(), "element-wise multiplication"); + + if(p.get_n_nonzero() == 0) { return (*this).zeros(); } typename SpProxy::const_iterator_type it = p.begin(); typename SpProxy::const_iterator_type it_end = p.end(); @@ -2793,13 +2791,13 @@ inline Mat& Mat::operator/=(const SpBase& m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: use of this function is not advised; it is implemented only for completeness const SpProxy p(m.get_ref()); - arma_debug_assert_same_size(n_rows, n_cols, p.get_n_rows(), p.get_n_cols(), "element-wise division"); + arma_conform_assert_same_size(n_rows, n_cols, p.get_n_rows(), p.get_n_cols(), "element-wise division"); for(uword c = 0; c < n_cols; ++c) for(uword r = 0; r < n_rows; ++r) @@ -2823,7 +2821,7 @@ Mat::Mat(const SpSubview& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); (*this).operator=(X); } @@ -2835,7 +2833,7 @@ inline Mat& Mat::operator=(const SpSubview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).zeros(X.n_rows, X.n_cols); @@ -2881,6 +2879,108 @@ Mat::operator=(const SpSubview& X) +template +inline +Mat& +Mat::operator+=(const SpSubview& X) + { + arma_debug_sigprint(); + + arma_conform_assert_same_size(n_rows, n_cols, X.n_rows, X.n_cols, "addition"); + + if(X.n_nonzero == 0) { return *this; } + + if(X.n_rows == X.m.n_rows) + { + X.m.sync(); + + const uword sv_col_start = X.aux_col1; + const uword sv_col_end = X.aux_col1 + X.n_cols - 1; + + const eT* m_values = X.m.values; + const uword* m_row_indices = X.m.row_indices; + const uword* m_col_ptrs = X.m.col_ptrs; + + for(uword m_col = sv_col_start; m_col <= sv_col_end; ++m_col) + { + const uword m_col_adjusted = m_col - sv_col_start; + + const uword start = m_col_ptrs[m_col ]; + const uword end = m_col_ptrs[m_col + 1]; + + for(uword ii = start; ii < end; ++ii) + { + const uword m_row = m_row_indices[ii]; + const eT m_val = m_values[ii]; + + at(m_row, m_col_adjusted) += m_val; + } + } + } + else + { + typename SpSubview::const_iterator it = X.begin(); + typename SpSubview::const_iterator it_end = X.end(); + + for(; it != it_end; ++it) { at(it.row(), it.col()) += (*it); } + } + + return *this; + } + + + +template +inline +Mat& +Mat::operator-=(const SpSubview& X) + { + arma_debug_sigprint(); + + arma_conform_assert_same_size(n_rows, n_cols, X.n_rows, X.n_cols, "subtraction"); + + if(X.n_nonzero == 0) { return *this; } + + if(X.n_rows == X.m.n_rows) + { + X.m.sync(); + + const uword sv_col_start = X.aux_col1; + const uword sv_col_end = X.aux_col1 + X.n_cols - 1; + + const eT* m_values = X.m.values; + const uword* m_row_indices = X.m.row_indices; + const uword* m_col_ptrs = X.m.col_ptrs; + + for(uword m_col = sv_col_start; m_col <= sv_col_end; ++m_col) + { + const uword m_col_adjusted = m_col - sv_col_start; + + const uword start = m_col_ptrs[m_col ]; + const uword end = m_col_ptrs[m_col + 1]; + + for(uword ii = start; ii < end; ++ii) + { + const uword m_row = m_row_indices[ii]; + const eT m_val = m_values[ii]; + + at(m_row, m_col_adjusted) -= m_val; + } + } + } + else + { + typename SpSubview::const_iterator it = X.begin(); + typename SpSubview::const_iterator it_end = X.end(); + + for(; it != it_end; ++it) { at(it.row(), it.col()) -= (*it); } + } + + return *this; + } + + + template inline Mat::Mat(const spdiagview& X) @@ -2892,7 +2992,7 @@ Mat::Mat(const spdiagview& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(); @@ -2906,7 +3006,7 @@ inline Mat& Mat::operator=(const spdiagview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init_warm(X.n_rows, X.n_cols); @@ -2922,13 +3022,11 @@ inline Mat& Mat::operator+=(const spdiagview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat tmp(X); - (*this).operator+=(tmp); - - return *this; + return (*this).operator+=(tmp); } @@ -2938,13 +3036,11 @@ inline Mat& Mat::operator-=(const spdiagview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat tmp(X); - (*this).operator-=(tmp); - - return *this; + return (*this).operator-=(tmp); } @@ -2954,13 +3050,11 @@ inline Mat& Mat::operator*=(const spdiagview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat tmp(X); - (*this).operator*=(tmp); - - return *this; + return (*this).operator*=(tmp); } @@ -2970,13 +3064,11 @@ inline Mat& Mat::operator%=(const spdiagview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat tmp(X); - (*this).operator%=(tmp); - - return *this; + return (*this).operator%=(tmp); } @@ -2986,13 +3078,11 @@ inline Mat& Mat::operator/=(const spdiagview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat tmp(X); - (*this).operator/=(tmp); - - return *this; + return (*this).operator/=(tmp); } @@ -3023,9 +3113,9 @@ arma_inline subview_row Mat::row(const uword row_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( row_num >= n_rows, "Mat::row(): index out of bounds" ); + arma_conform_check_bounds( row_num >= n_rows, "Mat::row(): index out of bounds" ); return subview_row(*this, row_num); } @@ -3038,9 +3128,9 @@ arma_inline const subview_row Mat::row(const uword row_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( row_num >= n_rows, "Mat::row(): index out of bounds" ); + arma_conform_check_bounds( row_num >= n_rows, "Mat::row(): index out of bounds" ); return subview_row(*this, row_num); } @@ -3052,7 +3142,7 @@ inline subview_row Mat::operator()(const uword row_num, const span& col_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool col_all = col_span.whole; @@ -3062,7 +3152,7 @@ Mat::operator()(const uword row_num, const span& col_span) const uword in_col2 = col_span.b; const uword submat_n_cols = col_all ? local_n_cols : in_col2 - in_col1 + 1; - arma_debug_check_bounds + arma_conform_check_bounds ( (row_num >= n_rows) || @@ -3081,7 +3171,7 @@ inline const subview_row Mat::operator()(const uword row_num, const span& col_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool col_all = col_span.whole; @@ -3091,7 +3181,7 @@ Mat::operator()(const uword row_num, const span& col_span) const const uword in_col2 = col_span.b; const uword submat_n_cols = col_all ? local_n_cols : in_col2 - in_col1 + 1; - arma_debug_check_bounds + arma_conform_check_bounds ( (row_num >= n_rows) || @@ -3111,9 +3201,9 @@ arma_inline subview_col Mat::col(const uword col_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( col_num >= n_cols, "Mat::col(): index out of bounds" ); + arma_conform_check_bounds( col_num >= n_cols, "Mat::col(): index out of bounds" ); return subview_col(*this, col_num); } @@ -3126,9 +3216,9 @@ arma_inline const subview_col Mat::col(const uword col_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( col_num >= n_cols, "Mat::col(): index out of bounds" ); + arma_conform_check_bounds( col_num >= n_cols, "Mat::col(): index out of bounds" ); return subview_col(*this, col_num); } @@ -3140,7 +3230,7 @@ inline subview_col Mat::operator()(const span& row_span, const uword col_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool row_all = row_span.whole; @@ -3150,7 +3240,7 @@ Mat::operator()(const span& row_span, const uword col_num) const uword in_row2 = row_span.b; const uword submat_n_rows = row_all ? local_n_rows : in_row2 - in_row1 + 1; - arma_debug_check_bounds + arma_conform_check_bounds ( (col_num >= n_cols) || @@ -3169,7 +3259,7 @@ inline const subview_col Mat::operator()(const span& row_span, const uword col_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool row_all = row_span.whole; @@ -3179,7 +3269,7 @@ Mat::operator()(const span& row_span, const uword col_num) const const uword in_row2 = row_span.b; const uword submat_n_rows = row_all ? local_n_rows : in_row2 - in_row1 + 1; - arma_debug_check_bounds + arma_conform_check_bounds ( (col_num >= n_cols) || @@ -3203,9 +3293,9 @@ inline Col Mat::unsafe_col(const uword col_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( col_num >= n_cols, "Mat::unsafe_col(): index out of bounds" ); + arma_conform_check_bounds( col_num >= n_cols, "Mat::unsafe_col(): index out of bounds" ); return Col(colptr(col_num), n_rows, false, true); } @@ -3222,9 +3312,9 @@ inline const Col Mat::unsafe_col(const uword col_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( col_num >= n_cols, "Mat::unsafe_col(): index out of bounds" ); + arma_conform_check_bounds( col_num >= n_cols, "Mat::unsafe_col(): index out of bounds" ); typedef const Col out_type; @@ -3239,9 +3329,9 @@ arma_inline subview Mat::rows(const uword in_row1, const uword in_row2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_row2 >= n_rows), "Mat::rows(): indices out of bounds or incorrectly used" @@ -3260,9 +3350,9 @@ arma_inline const subview Mat::rows(const uword in_row1, const uword in_row2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_row2 >= n_rows), "Mat::rows(): indices out of bounds or incorrectly used" @@ -3281,9 +3371,9 @@ arma_inline subview_cols Mat::cols(const uword in_col1, const uword in_col2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_col1 > in_col2) || (in_col2 >= n_cols), "Mat::cols(): indices out of bounds or incorrectly used" @@ -3302,9 +3392,9 @@ arma_inline const subview_cols Mat::cols(const uword in_col1, const uword in_col2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_col1 > in_col2) || (in_col2 >= n_cols), "Mat::cols(): indices out of bounds or incorrectly used" @@ -3323,7 +3413,7 @@ inline subview Mat::rows(const span& row_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool row_all = row_span.whole; @@ -3333,7 +3423,7 @@ Mat::rows(const span& row_span) const uword in_row2 = row_span.b; const uword submat_n_rows = row_all ? local_n_rows : in_row2 - in_row1 + 1; - arma_debug_check_bounds + arma_conform_check_bounds ( ( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= local_n_rows)) ) , @@ -3351,7 +3441,7 @@ inline const subview Mat::rows(const span& row_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool row_all = row_span.whole; @@ -3361,7 +3451,7 @@ Mat::rows(const span& row_span) const const uword in_row2 = row_span.b; const uword submat_n_rows = row_all ? local_n_rows : in_row2 - in_row1 + 1; - arma_debug_check_bounds + arma_conform_check_bounds ( ( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= local_n_rows)) ) , @@ -3379,7 +3469,7 @@ arma_inline subview_cols Mat::cols(const span& col_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool col_all = col_span.whole; @@ -3389,7 +3479,7 @@ Mat::cols(const span& col_span) const uword in_col2 = col_span.b; const uword submat_n_cols = col_all ? local_n_cols : in_col2 - in_col1 + 1; - arma_debug_check_bounds + arma_conform_check_bounds ( ( col_all ? false : ((in_col1 > in_col2) || (in_col2 >= local_n_cols)) ) , @@ -3407,7 +3497,7 @@ arma_inline const subview_cols Mat::cols(const span& col_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool col_all = col_span.whole; @@ -3417,7 +3507,7 @@ Mat::cols(const span& col_span) const const uword in_col2 = col_span.b; const uword submat_n_cols = col_all ? local_n_cols : in_col2 - in_col1 + 1; - arma_debug_check_bounds + arma_conform_check_bounds ( ( col_all ? false : ((in_col1 > in_col2) || (in_col2 >= local_n_cols)) ) , @@ -3435,9 +3525,9 @@ arma_inline subview Mat::submat(const uword in_row1, const uword in_col1, const uword in_row2, const uword in_col2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols), "Mat::submat(): indices out of bounds or incorrectly used" @@ -3457,9 +3547,9 @@ arma_inline const subview Mat::submat(const uword in_row1, const uword in_col1, const uword in_row2, const uword in_col2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols), "Mat::submat(): indices out of bounds or incorrectly used" @@ -3479,7 +3569,7 @@ arma_inline subview Mat::submat(const uword in_row1, const uword in_col1, const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword l_n_rows = n_rows; const uword l_n_cols = n_cols; @@ -3487,7 +3577,7 @@ Mat::submat(const uword in_row1, const uword in_col1, const SizeMat& s) const uword s_n_rows = s.n_rows; const uword s_n_cols = s.n_cols; - arma_debug_check_bounds + arma_conform_check_bounds ( ((in_row1 >= l_n_rows) || (in_col1 >= l_n_cols) || ((in_row1 + s_n_rows) > l_n_rows) || ((in_col1 + s_n_cols) > l_n_cols)), "Mat::submat(): indices or size out of bounds" @@ -3504,7 +3594,7 @@ arma_inline const subview Mat::submat(const uword in_row1, const uword in_col1, const SizeMat& s) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword l_n_rows = n_rows; const uword l_n_cols = n_cols; @@ -3512,7 +3602,7 @@ Mat::submat(const uword in_row1, const uword in_col1, const SizeMat& s) cons const uword s_n_rows = s.n_rows; const uword s_n_cols = s.n_cols; - arma_debug_check_bounds + arma_conform_check_bounds ( ((in_row1 >= l_n_rows) || (in_col1 >= l_n_cols) || ((in_row1 + s_n_rows) > l_n_rows) || ((in_col1 + s_n_cols) > l_n_cols)), "Mat::submat(): indices or size out of bounds" @@ -3529,7 +3619,7 @@ inline subview Mat::submat(const span& row_span, const span& col_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool row_all = row_span.whole; const bool col_all = col_span.whole; @@ -3545,7 +3635,7 @@ Mat::submat(const span& row_span, const span& col_span) const uword in_col2 = col_span.b; const uword submat_n_cols = col_all ? local_n_cols : in_col2 - in_col1 + 1; - arma_debug_check_bounds + arma_conform_check_bounds ( ( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= local_n_rows)) ) || @@ -3565,7 +3655,7 @@ inline const subview Mat::submat(const span& row_span, const span& col_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool row_all = row_span.whole; const bool col_all = col_span.whole; @@ -3581,7 +3671,7 @@ Mat::submat(const span& row_span, const span& col_span) const const uword in_col2 = col_span.b; const uword submat_n_cols = col_all ? local_n_cols : in_col2 - in_col1 + 1; - arma_debug_check_bounds + arma_conform_check_bounds ( ( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= local_n_rows)) ) || @@ -3600,7 +3690,7 @@ inline subview Mat::operator()(const span& row_span, const span& col_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).submat(row_span, col_span); } @@ -3612,7 +3702,7 @@ inline const subview Mat::operator()(const span& row_span, const span& col_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).submat(row_span, col_span); } @@ -3624,7 +3714,7 @@ inline subview Mat::operator()(const uword in_row1, const uword in_col1, const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).submat(in_row1, in_col1, s); } @@ -3636,7 +3726,7 @@ inline const subview Mat::operator()(const uword in_row1, const uword in_col1, const SizeMat& s) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).submat(in_row1, in_col1, s); } @@ -3648,9 +3738,9 @@ inline subview Mat::head_rows(const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > n_rows), "Mat::head_rows(): size out of bounds" ); + arma_conform_check_bounds( (N > n_rows), "Mat::head_rows(): size out of bounds" ); return subview(*this, 0, 0, N, n_cols); } @@ -3662,9 +3752,9 @@ inline const subview Mat::head_rows(const uword N) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > n_rows), "Mat::head_rows(): size out of bounds" ); + arma_conform_check_bounds( (N > n_rows), "Mat::head_rows(): size out of bounds" ); return subview(*this, 0, 0, N, n_cols); } @@ -3676,9 +3766,9 @@ inline subview Mat::tail_rows(const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > n_rows), "Mat::tail_rows(): size out of bounds" ); + arma_conform_check_bounds( (N > n_rows), "Mat::tail_rows(): size out of bounds" ); const uword start_row = n_rows - N; @@ -3692,9 +3782,9 @@ inline const subview Mat::tail_rows(const uword N) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > n_rows), "Mat::tail_rows(): size out of bounds" ); + arma_conform_check_bounds( (N > n_rows), "Mat::tail_rows(): size out of bounds" ); const uword start_row = n_rows - N; @@ -3708,9 +3798,9 @@ inline subview_cols Mat::head_cols(const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > n_cols), "Mat::head_cols(): size out of bounds" ); + arma_conform_check_bounds( (N > n_cols), "Mat::head_cols(): size out of bounds" ); return subview_cols(*this, 0, N); } @@ -3722,9 +3812,9 @@ inline const subview_cols Mat::head_cols(const uword N) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > n_cols), "Mat::head_cols(): size out of bounds" ); + arma_conform_check_bounds( (N > n_cols), "Mat::head_cols(): size out of bounds" ); return subview_cols(*this, 0, N); } @@ -3736,9 +3826,9 @@ inline subview_cols Mat::tail_cols(const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > n_cols), "Mat::tail_cols(): size out of bounds" ); + arma_conform_check_bounds( (N > n_cols), "Mat::tail_cols(): size out of bounds" ); const uword start_col = n_cols - N; @@ -3752,9 +3842,9 @@ inline const subview_cols Mat::tail_cols(const uword N) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > n_cols), "Mat::tail_cols(): size out of bounds" ); + arma_conform_check_bounds( (N > n_cols), "Mat::tail_cols(): size out of bounds" ); const uword start_col = n_cols - N; @@ -3769,7 +3859,7 @@ arma_inline subview_elem1 Mat::elem(const Base& a) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_elem1(*this, a); } @@ -3782,7 +3872,7 @@ arma_inline const subview_elem1 Mat::elem(const Base& a) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_elem1(*this, a); } @@ -3795,7 +3885,7 @@ arma_inline subview_elem1 Mat::operator()(const Base& a) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_elem1(*this, a); } @@ -3808,7 +3898,7 @@ arma_inline const subview_elem1 Mat::operator()(const Base& a) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_elem1(*this, a); } @@ -3821,7 +3911,7 @@ arma_inline subview_elem2 Mat::elem(const Base& ri, const Base& ci) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_elem2(*this, ri, ci, false, false); } @@ -3834,7 +3924,7 @@ arma_inline const subview_elem2 Mat::elem(const Base& ri, const Base& ci) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_elem2(*this, ri, ci, false, false); } @@ -3847,7 +3937,7 @@ arma_inline subview_elem2 Mat::submat(const Base& ri, const Base& ci) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_elem2(*this, ri, ci, false, false); } @@ -3860,7 +3950,7 @@ arma_inline const subview_elem2 Mat::submat(const Base& ri, const Base& ci) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_elem2(*this, ri, ci, false, false); } @@ -3873,7 +3963,7 @@ arma_inline subview_elem2 Mat::operator()(const Base& ri, const Base& ci) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_elem2(*this, ri, ci, false, false); } @@ -3886,7 +3976,7 @@ arma_inline const subview_elem2 Mat::operator()(const Base& ri, const Base& ci) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_elem2(*this, ri, ci, false, false); } @@ -3899,7 +3989,7 @@ arma_inline subview_elem2 Mat::rows(const Base& ri) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_elem2(*this, ri, ri, false, true); } @@ -3912,7 +4002,7 @@ arma_inline const subview_elem2 Mat::rows(const Base& ri) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_elem2(*this, ri, ri, false, true); } @@ -3925,7 +4015,7 @@ arma_inline subview_elem2 Mat::cols(const Base& ci) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_elem2(*this, ci, ci, true, false); } @@ -3938,7 +4028,7 @@ arma_inline const subview_elem2 Mat::cols(const Base& ci) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_elem2(*this, ci, ci, true, false); } @@ -3950,7 +4040,7 @@ arma_inline subview_each1< Mat, 0 > Mat::each_col() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_each1< Mat, 0>(*this); } @@ -3962,7 +4052,7 @@ arma_inline subview_each1< Mat, 1 > Mat::each_row() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_each1< Mat, 1>(*this); } @@ -3974,7 +4064,7 @@ arma_inline const subview_each1< Mat, 0 > Mat::each_col() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_each1< Mat, 0>(*this); } @@ -3986,7 +4076,7 @@ arma_inline const subview_each1< Mat, 1 > Mat::each_row() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_each1< Mat, 1>(*this); } @@ -3999,7 +4089,7 @@ inline subview_each2< Mat, 0, T1 > Mat::each_col(const Base& indices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_each2< Mat, 0, T1 >(*this, indices); } @@ -4012,7 +4102,7 @@ inline subview_each2< Mat, 1, T1 > Mat::each_row(const Base& indices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_each2< Mat, 1, T1 >(*this, indices); } @@ -4025,7 +4115,7 @@ inline const subview_each2< Mat, 0, T1 > Mat::each_col(const Base& indices) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_each2< Mat, 0, T1 >(*this, indices); } @@ -4038,7 +4128,7 @@ inline const subview_each2< Mat, 1, T1 > Mat::each_row(const Base& indices) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_each2< Mat, 1, T1 >(*this, indices); } @@ -4051,7 +4141,7 @@ inline Mat& Mat::each_col(const std::function< void(Col&) >& F) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); for(uword ii=0; ii < n_cols; ++ii) { @@ -4069,7 +4159,7 @@ inline const Mat& Mat::each_col(const std::function< void(const Col&) >& F) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); for(uword ii=0; ii < n_cols; ++ii) { @@ -4088,7 +4178,7 @@ inline Mat& Mat::each_row(const std::function< void(Row&) >& F) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); podarray array1(n_cols); podarray array2(n_cols); @@ -4142,7 +4232,7 @@ inline const Mat& Mat::each_row(const std::function< void(const Row&) >& F) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); podarray array1(n_cols); podarray array2(n_cols); @@ -4187,12 +4277,12 @@ arma_inline diagview Mat::diag(const sword in_id) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword row_offset = (in_id < 0) ? uword(-in_id) : 0; const uword col_offset = (in_id > 0) ? uword( in_id) : 0; - arma_debug_check_bounds + arma_conform_check_bounds ( ((row_offset > 0) && (row_offset >= n_rows)) || ((col_offset > 0) && (col_offset >= n_cols)), "Mat::diag(): requested diagonal out of bounds" @@ -4211,12 +4301,12 @@ arma_inline const diagview Mat::diag(const sword in_id) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword row_offset = uword( (in_id < 0) ? -in_id : 0 ); const uword col_offset = uword( (in_id > 0) ? in_id : 0 ); - arma_debug_check_bounds + arma_conform_check_bounds ( ((row_offset > 0) && (row_offset >= n_rows)) || ((col_offset > 0) && (col_offset >= n_cols)), "Mat::diag(): requested diagonal out of bounds" @@ -4234,12 +4324,12 @@ inline void Mat::swap_rows(const uword in_row1, const uword in_row2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword local_n_rows = n_rows; const uword local_n_cols = n_cols; - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 >= local_n_rows) || (in_row2 >= local_n_rows), "Mat::swap_rows(): index out of bounds" @@ -4265,12 +4355,12 @@ inline void Mat::swap_cols(const uword in_colA, const uword in_colB) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword local_n_rows = n_rows; const uword local_n_cols = n_cols; - arma_debug_check_bounds + arma_conform_check_bounds ( (in_colA >= local_n_cols) || (in_colB >= local_n_cols), "Mat::swap_cols(): index out of bounds" @@ -4312,9 +4402,9 @@ inline void Mat::shed_row(const uword row_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( row_num >= n_rows, "Mat::shed_row(): index out of bounds" ); + arma_conform_check_bounds( row_num >= n_rows, "Mat::shed_row(): index out of bounds" ); shed_rows(row_num, row_num); } @@ -4327,9 +4417,9 @@ inline void Mat::shed_col(const uword col_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( col_num >= n_cols, "Mat::shed_col(): index out of bounds" ); + arma_conform_check_bounds( col_num >= n_cols, "Mat::shed_col(): index out of bounds" ); shed_cols(col_num, col_num); } @@ -4342,9 +4432,9 @@ inline void Mat::shed_rows(const uword in_row1, const uword in_row2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_row2 >= n_rows), "Mat::shed_rows(): indices out of bounds or incorrectly used" @@ -4376,9 +4466,9 @@ inline void Mat::shed_cols(const uword in_col1, const uword in_col2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_col1 > in_col2) || (in_col2 >= n_cols), "Mat::shed_cols(): indices out of bounds or incorrectly used" @@ -4411,12 +4501,12 @@ inline void Mat::shed_rows(const Base& indices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_check_mixed U(indices.get_ref(), *this); const Mat& tmp1 = U.M; - arma_debug_check( ((tmp1.is_vec() == false) && (tmp1.is_empty() == false)), "Mat::shed_rows(): list of indices must be a vector" ); + arma_conform_check( ((tmp1.is_vec() == false) && (tmp1.is_empty() == false)), "Mat::shed_rows(): list of indices must be a vector" ); if(tmp1.is_empty()) { return; } @@ -4429,11 +4519,11 @@ Mat::shed_rows(const Base& indices) const uword* rows_to_shed_mem = rows_to_shed.memptr(); const uword N = rows_to_shed.n_elem; - if(arma_config::debug) + if(arma_config::check_conformance) { for(uword i=0; i= n_rows), "Mat::shed_rows(): indices out of bounds" ); + arma_conform_check_bounds( (rows_to_shed_mem[i] >= n_rows), "Mat::shed_rows(): indices out of bounds" ); } } @@ -4481,12 +4571,12 @@ inline void Mat::shed_cols(const Base& indices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_check_mixed U(indices.get_ref(), *this); const Mat& tmp1 = U.M; - arma_debug_check( ((tmp1.is_vec() == false) && (tmp1.is_empty() == false)), "Mat::shed_cols(): list of indices must be a vector" ); + arma_conform_check( ((tmp1.is_vec() == false) && (tmp1.is_empty() == false)), "Mat::shed_cols(): list of indices must be a vector" ); if(tmp1.is_empty()) { return; } @@ -4499,11 +4589,11 @@ Mat::shed_cols(const Base& indices) const uword* cols_to_shed_mem = cols_to_shed.memptr(); const uword N = cols_to_shed.n_elem; - if(arma_config::debug) + if(arma_config::check_conformance) { for(uword i=0; i= n_cols), "Mat::shed_cols(): indices out of bounds" ); + arma_conform_check_bounds( (cols_to_shed_mem[i] >= n_cols), "Mat::shed_cols(): indices out of bounds" ); } } @@ -4549,7 +4639,7 @@ inline void Mat::insert_rows(const uword row_num, const uword N, const bool set_to_zero) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(set_to_zero); @@ -4563,7 +4653,7 @@ inline void Mat::insert_rows(const uword row_num, const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword t_n_rows = n_rows; const uword t_n_cols = n_cols; @@ -4572,7 +4662,7 @@ Mat::insert_rows(const uword row_num, const uword N) const uword B_n_rows = t_n_rows - row_num; // insertion at row_num == n_rows is in effect an append operation - arma_debug_check_bounds( (row_num > t_n_rows), "Mat::insert_rows(): index out of bounds" ); + arma_conform_check_bounds( (row_num > t_n_rows), "Mat::insert_rows(): index out of bounds" ); if(N == 0) { return; } @@ -4600,7 +4690,7 @@ inline void Mat::insert_cols(const uword col_num, const uword N, const bool set_to_zero) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(set_to_zero); @@ -4614,7 +4704,7 @@ inline void Mat::insert_cols(const uword col_num, const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword t_n_rows = n_rows; const uword t_n_cols = n_cols; @@ -4623,7 +4713,7 @@ Mat::insert_cols(const uword col_num, const uword N) const uword B_n_cols = t_n_cols - col_num; // insertion at col_num == n_cols is in effect an append operation - arma_debug_check_bounds( (col_num > t_n_cols), "Mat::insert_cols(): index out of bounds" ); + arma_conform_check_bounds( (col_num > t_n_cols), "Mat::insert_cols(): index out of bounds" ); if(N == 0) { return; } @@ -4654,7 +4744,7 @@ inline void Mat::insert_rows(const uword row_num, const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap tmp(X.get_ref()); const Mat& C = tmp.M; @@ -4676,7 +4766,7 @@ Mat::insert_rows(const uword row_num, const Base& X) // insertion at row_num == n_rows is in effect an append operation - arma_debug_set_error + arma_conform_set_error ( err_state, err_msg, @@ -4684,7 +4774,7 @@ Mat::insert_rows(const uword row_num, const Base& X) error_message_1 ); - arma_debug_set_error + arma_conform_set_error ( err_state, err_msg, @@ -4692,7 +4782,7 @@ Mat::insert_rows(const uword row_num, const Base& X) error_message_2 ); - arma_debug_check_bounds(err_state, err_msg); + arma_conform_check_bounds(err_state, err_msg); if(C_n_rows > 0) { @@ -4730,7 +4820,7 @@ inline void Mat::insert_cols(const uword col_num, const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap tmp(X.get_ref()); const Mat& C = tmp.M; @@ -4752,7 +4842,7 @@ Mat::insert_cols(const uword col_num, const Base& X) // insertion at col_num == n_cols is in effect an append operation - arma_debug_set_error + arma_conform_set_error ( err_state, err_msg, @@ -4760,7 +4850,7 @@ Mat::insert_cols(const uword col_num, const Base& X) error_message_1 ); - arma_debug_set_error + arma_conform_set_error ( err_state, err_msg, @@ -4768,7 +4858,7 @@ Mat::insert_cols(const uword col_num, const Base& X) error_message_2 ); - arma_debug_check_bounds(err_state, err_msg); + arma_conform_check_bounds(err_state, err_msg); if(C_n_cols > 0) { @@ -4810,7 +4900,7 @@ Mat::Mat(const Gen& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -4827,7 +4917,7 @@ inline Mat& Mat::operator=(const Gen& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -4846,7 +4936,7 @@ inline Mat& Mat::operator+=(const Gen& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -4863,7 +4953,7 @@ inline Mat& Mat::operator-=(const Gen& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -4880,7 +4970,7 @@ inline Mat& Mat::operator*=(const Gen& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -4897,7 +4987,7 @@ inline Mat& Mat::operator%=(const Gen& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -4914,7 +5004,7 @@ inline Mat& Mat::operator/=(const Gen& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -4938,7 +5028,7 @@ Mat::Mat(const Op& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -4954,7 +5044,7 @@ inline Mat& Mat::operator=(const Op& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -4972,7 +5062,7 @@ inline Mat& Mat::operator+=(const Op& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -4990,7 +5080,7 @@ inline Mat& Mat::operator-=(const Op& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -5008,7 +5098,7 @@ inline Mat& Mat::operator*=(const Op& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -5026,7 +5116,7 @@ inline Mat& Mat::operator%=(const Op& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -5044,7 +5134,7 @@ inline Mat& Mat::operator/=(const Op& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -5068,7 +5158,7 @@ Mat::Mat(const eOp& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -5086,7 +5176,7 @@ inline Mat& Mat::operator=(const eOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -5109,7 +5199,7 @@ inline Mat& Mat::operator+=(const eOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -5130,7 +5220,7 @@ inline Mat& Mat::operator-=(const eOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -5151,7 +5241,7 @@ inline Mat& Mat::operator*=(const eOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -5168,7 +5258,7 @@ inline Mat& Mat::operator%=(const eOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -5189,7 +5279,7 @@ inline Mat& Mat::operator/=(const eOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -5216,7 +5306,7 @@ Mat::Mat(const mtOp& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); op_type::apply(*this, X); } @@ -5229,7 +5319,7 @@ inline Mat& Mat::operator=(const mtOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); op_type::apply(*this, X); @@ -5244,7 +5334,7 @@ inline Mat& Mat::operator+=(const mtOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat m(X); @@ -5259,7 +5349,7 @@ inline Mat& Mat::operator-=(const mtOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat m(X); @@ -5274,7 +5364,7 @@ inline Mat& Mat::operator*=(const mtOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat m(X); @@ -5289,7 +5379,7 @@ inline Mat& Mat::operator%=(const mtOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat m(X); @@ -5304,7 +5394,7 @@ inline Mat& Mat::operator/=(const mtOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat m(X); @@ -5325,7 +5415,7 @@ Mat::Mat(const CubeToMatOp& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -5340,7 +5430,7 @@ inline Mat& Mat::operator=(const CubeToMatOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -5357,7 +5447,7 @@ inline Mat& Mat::operator+=(const CubeToMatOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -5374,7 +5464,7 @@ inline Mat& Mat::operator-=(const CubeToMatOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -5391,7 +5481,7 @@ inline Mat& Mat::operator*=(const CubeToMatOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -5408,7 +5498,7 @@ inline Mat& Mat::operator%=(const CubeToMatOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -5425,7 +5515,7 @@ inline Mat& Mat::operator/=(const CubeToMatOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -5448,7 +5538,7 @@ Mat::Mat(const SpToDOp& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -5464,7 +5554,7 @@ inline Mat& Mat::operator=(const SpToDOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -5482,7 +5572,7 @@ inline Mat& Mat::operator+=(const SpToDOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -5500,7 +5590,7 @@ inline Mat& Mat::operator-=(const SpToDOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -5518,7 +5608,7 @@ inline Mat& Mat::operator*=(const SpToDOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -5536,7 +5626,7 @@ inline Mat& Mat::operator%=(const SpToDOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -5554,7 +5644,7 @@ inline Mat& Mat::operator/=(const SpToDOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -5565,6 +5655,115 @@ Mat::operator/=(const SpToDOp& X) +template +template +inline +Mat::Mat(const mtSpToDOp& X) + : n_rows(0) + , n_cols(0) + , n_elem(0) + , n_alloc(0) + , vec_state(0) + , mem_state(0) + , mem() + { + arma_debug_sigprint_this(this); + + op_type::apply(*this, X); + } + + + +template +template +inline +Mat& +Mat::operator=(const mtSpToDOp& X) + { + arma_debug_sigprint(); + + op_type::apply(*this, X); + + return *this; + } + + + +template +template +inline +Mat& +Mat::operator+=(const mtSpToDOp& X) + { + arma_debug_sigprint(); + + const Mat m(X); + + return (*this).operator+=(m); + } + + + +template +template +inline +Mat& +Mat::operator-=(const mtSpToDOp& X) + { + arma_debug_sigprint(); + + const Mat m(X); + + return (*this).operator-=(m); + } + + + +template +template +inline +Mat& +Mat::operator*=(const mtSpToDOp& X) + { + arma_debug_sigprint(); + + glue_times::apply_inplace(*this, X); + + return *this; + } + + + +template +template +inline +Mat& +Mat::operator%=(const mtSpToDOp& X) + { + arma_debug_sigprint(); + + const Mat m(X); + + return (*this).operator%=(m); + } + + + +template +template +inline +Mat& +Mat::operator/=(const mtSpToDOp& X) + { + arma_debug_sigprint(); + + const Mat m(X); + + return (*this).operator/=(m); + } + + + //! create a matrix from Glue, ie. run the previously delayed binary operations template template @@ -5578,7 +5777,7 @@ Mat::Mat(const Glue& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -5595,7 +5794,7 @@ inline Mat& Mat::operator=(const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -5614,7 +5813,7 @@ inline Mat& Mat::operator+=(const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -5633,7 +5832,7 @@ inline Mat& Mat::operator-=(const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -5652,7 +5851,7 @@ inline Mat& Mat::operator*=(const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -5671,7 +5870,7 @@ inline Mat& Mat::operator%=(const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -5690,7 +5889,7 @@ inline Mat& Mat::operator/=(const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -5708,7 +5907,7 @@ inline Mat& Mat::operator+=(const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); glue_times::apply_inplace_plus(*this, X, sword(+1)); @@ -5723,7 +5922,7 @@ inline Mat& Mat::operator-=(const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); glue_times::apply_inplace_plus(*this, X, sword(-1)); @@ -5745,7 +5944,7 @@ Mat::Mat(const eGlue& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -5764,7 +5963,7 @@ inline Mat& Mat::operator=(const eGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -5794,7 +5993,7 @@ inline Mat& Mat::operator+=(const eGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -5822,7 +6021,7 @@ inline Mat& Mat::operator-=(const eGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -5849,7 +6048,7 @@ inline Mat& Mat::operator*=(const eGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -5867,7 +6066,7 @@ inline Mat& Mat::operator%=(const eGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -5894,7 +6093,7 @@ inline Mat& Mat::operator/=(const eGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -5927,7 +6126,7 @@ Mat::Mat(const mtGlue& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); glue_type::apply(*this, X); } @@ -5940,7 +6139,7 @@ inline Mat& Mat::operator=(const mtGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); glue_type::apply(*this, X); @@ -5955,7 +6154,7 @@ inline Mat& Mat::operator+=(const mtGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat m(X); @@ -5970,7 +6169,7 @@ inline Mat& Mat::operator-=(const mtGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat m(X); @@ -5985,7 +6184,7 @@ inline Mat& Mat::operator*=(const mtGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat m(X); @@ -6002,7 +6201,7 @@ inline Mat& Mat::operator%=(const mtGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat m(X); @@ -6017,7 +6216,7 @@ inline Mat& Mat::operator/=(const mtGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat m(X); @@ -6038,7 +6237,7 @@ Mat::Mat(const SpToDGlue& X) , mem_state(0) , mem() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -6054,7 +6253,7 @@ inline Mat& Mat::operator=(const SpToDGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -6072,7 +6271,7 @@ inline Mat& Mat::operator+=(const SpToDGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -6090,7 +6289,7 @@ inline Mat& Mat::operator-=(const SpToDGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -6108,7 +6307,7 @@ inline Mat& Mat::operator*=(const SpToDGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -6126,7 +6325,7 @@ inline Mat& Mat::operator%=(const SpToDGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -6144,7 +6343,7 @@ inline Mat& Mat::operator/=(const SpToDGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -6177,7 +6376,7 @@ arma_inline eT& Mat::operator() (const uword ii) { - arma_debug_check_bounds( (ii >= n_elem), "Mat::operator(): index out of bounds" ); + arma_conform_check_bounds( (ii >= n_elem), "Mat::operator(): index out of bounds" ); return access::rw(mem[ii]); } @@ -6190,7 +6389,7 @@ arma_inline const eT& Mat::operator() (const uword ii) const { - arma_debug_check_bounds( (ii >= n_elem), "Mat::operator(): index out of bounds" ); + arma_conform_check_bounds( (ii >= n_elem), "Mat::operator(): index out of bounds" ); return mem[ii]; } @@ -6246,7 +6445,7 @@ arma_inline eT& Mat::operator() (const uword in_row, const uword in_col) { - arma_debug_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols)), "Mat::operator(): index out of bounds" ); + arma_conform_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols)), "Mat::operator(): index out of bounds" ); return access::rw(mem[in_row + in_col*n_rows]); } @@ -6259,7 +6458,7 @@ arma_inline const eT& Mat::operator() (const uword in_row, const uword in_col) const { - arma_debug_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols)), "Mat::operator(): index out of bounds" ); + arma_conform_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols)), "Mat::operator(): index out of bounds" ); return mem[in_row + in_col*n_rows]; } @@ -6422,7 +6621,7 @@ inline bool Mat::internal_is_finite() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return arrayops::is_finite(memptr(), n_elem); } @@ -6434,7 +6633,7 @@ inline bool Mat::internal_has_inf() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return arrayops::has_inf(memptr(), n_elem); } @@ -6446,7 +6645,7 @@ inline bool Mat::internal_has_nan() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return arrayops::has_nan(memptr(), n_elem); } @@ -6458,7 +6657,7 @@ inline bool Mat::internal_has_nonfinite() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (arrayops::is_finite(memptr(), n_elem) == false); } @@ -6470,7 +6669,7 @@ inline bool Mat::is_sorted(const char* direction) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).is_sorted(direction, (((vec_state == 2) || (n_rows == 1)) ? uword(1) : uword(0))); } @@ -6482,7 +6681,7 @@ inline bool Mat::is_sorted(const char* direction, const uword dim) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const char sig1 = (direction != nullptr) ? direction[0] : char(0); @@ -6492,7 +6691,7 @@ Mat::is_sorted(const char* direction, const uword dim) const // "strictascend" // "strictdescend" - arma_debug_check( ((sig1 != 'a') && (sig1 != 'd') && (sig1 != 's')), "Mat::is_sorted(): unknown sort direction" ); + arma_conform_check( ((sig1 != 'a') && (sig1 != 'd') && (sig1 != 's')), "Mat::is_sorted(): unknown sort direction" ); // "strictascend" // "strictdescend" @@ -6500,9 +6699,9 @@ Mat::is_sorted(const char* direction, const uword dim) const const char sig2 = (sig1 == 's') ? direction[6] : char(0); - if(sig1 == 's') { arma_debug_check( ((sig2 != 'a') && (sig2 != 'd')), "Mat::is_sorted(): unknown sort direction" ); } + if(sig1 == 's') { arma_conform_check( ((sig2 != 'a') && (sig2 != 'd')), "Mat::is_sorted(): unknown sort direction" ); } - arma_debug_check( (dim > 1), "Mat::is_sorted(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "Mat::is_sorted(): parameter 'dim' must be 0 or 1" ); if(sig1 == 'a') { @@ -6557,7 +6756,7 @@ inline bool Mat::is_sorted_helper(const comparator& comp, const uword dim) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(n_elem <= 1) { return true; } @@ -6637,7 +6836,7 @@ arma_inline bool Mat::in_range(const span& x) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(x.whole) { @@ -6670,7 +6869,7 @@ arma_inline bool Mat::in_range(const span& row_span, const uword in_col) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(row_span.whole) { @@ -6692,7 +6891,7 @@ arma_inline bool Mat::in_range(const uword in_row, const span& col_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(col_span.whole) { @@ -6714,7 +6913,7 @@ arma_inline bool Mat::in_range(const span& row_span, const span& col_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword in_row1 = row_span.a; const uword in_row2 = row_span.b; @@ -6800,7 +6999,7 @@ inline Mat& Mat::set_size(const uword new_n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword new_n_rows = (vec_state == 2) ? uword(1 ) : uword(new_n_elem); const uword new_n_cols = (vec_state == 2) ? uword(new_n_elem) : uword(1 ); @@ -6818,7 +7017,7 @@ inline Mat& Mat::set_size(const uword new_n_rows, const uword new_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init_warm(new_n_rows, new_n_cols); @@ -6832,7 +7031,7 @@ inline Mat& Mat::set_size(const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init_warm(s.n_rows, s.n_cols); @@ -6847,7 +7046,7 @@ inline Mat& Mat::resize(const uword new_n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword new_n_rows = (vec_state == 2) ? uword(1 ) : uword(new_n_elem); const uword new_n_cols = (vec_state == 2) ? uword(new_n_elem) : uword(1 ); @@ -6863,7 +7062,7 @@ inline Mat& Mat::resize(const uword new_n_rows, const uword new_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); op_resize::apply_mat_inplace((*this), new_n_rows, new_n_cols); @@ -6877,7 +7076,7 @@ inline Mat& Mat::resize(const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); op_resize::apply_mat_inplace((*this), s.n_rows, s.n_cols); @@ -6892,7 +7091,7 @@ inline Mat& Mat::reshape(const uword new_n_rows, const uword new_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); op_reshape::apply_mat_inplace((*this), new_n_rows, new_n_cols); @@ -6906,7 +7105,7 @@ inline Mat& Mat::reshape(const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); op_reshape::apply_mat_inplace((*this), s.n_rows, s.n_cols); @@ -6921,9 +7120,9 @@ inline void Mat::reshape(const uword new_n_rows, const uword new_n_cols, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (dim > 1), "reshape(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "reshape(): parameter 'dim' must be 0 or 1" ); if(dim == 0) { @@ -6949,7 +7148,7 @@ inline Mat& Mat::copy_size(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Proxy P(X.get_ref()); @@ -6970,7 +7169,7 @@ inline Mat& Mat::for_each(functor F) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eT* data = memptr(); @@ -7000,7 +7199,7 @@ inline const Mat& Mat::for_each(functor F) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const eT* data = memptr(); @@ -7031,7 +7230,7 @@ inline Mat& Mat::transform(functor F) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eT* out_mem = memptr(); @@ -7068,7 +7267,7 @@ inline Mat& Mat::imbue(functor F) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eT* out_mem = memptr(); @@ -7100,7 +7299,7 @@ inline Mat& Mat::replace(const eT old_val, const eT new_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arrayops::replace(memptr(), n_elem, old_val, new_val); @@ -7114,7 +7313,7 @@ inline Mat& Mat::clean(const typename get_pod_type::result threshold) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arrayops::clean(memptr(), n_elem, threshold); @@ -7128,16 +7327,16 @@ inline Mat& Mat::clamp(const eT min_val, const eT max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(is_cx::no) { - arma_debug_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "Mat::clamp(): min_val must be less than max_val" ); + arma_conform_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "Mat::clamp(): min_val must be less than max_val" ); } else { - arma_debug_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "Mat::clamp(): real(min_val) must be less than real(max_val)" ); - arma_debug_check( (access::tmp_imag(min_val) > access::tmp_imag(max_val)), "Mat::clamp(): imag(min_val) must be less than imag(max_val)" ); + arma_conform_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "Mat::clamp(): real(min_val) must be less than real(max_val)" ); + arma_conform_check( (access::tmp_imag(min_val) > access::tmp_imag(max_val)), "Mat::clamp(): imag(min_val) must be less than imag(max_val)" ); } arrayops::clamp(memptr(), n_elem, min_val, max_val); @@ -7153,7 +7352,7 @@ inline Mat& Mat::fill(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arrayops::inplace_set( memptr(), val, n_elem ); @@ -7169,7 +7368,7 @@ inline Mat& Mat::fill(const fill::fill_class&) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(is_same_type::yes) { (*this).zeros(); } if(is_same_type::yes) { (*this).ones(); } @@ -7187,7 +7386,7 @@ inline Mat& Mat::zeros() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arrayops::fill_zeros(memptr(), n_elem); @@ -7201,7 +7400,7 @@ inline Mat& Mat::zeros(const uword new_n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); set_size(new_n_elem); @@ -7215,7 +7414,7 @@ inline Mat& Mat::zeros(const uword new_n_rows, const uword new_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); set_size(new_n_rows, new_n_cols); @@ -7229,7 +7428,7 @@ inline Mat& Mat::zeros(const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).zeros(s.n_rows, s.n_cols); } @@ -7241,7 +7440,7 @@ inline Mat& Mat::ones() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return fill(eT(1)); } @@ -7253,7 +7452,7 @@ inline Mat& Mat::ones(const uword new_n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); set_size(new_n_elem); @@ -7267,7 +7466,7 @@ inline Mat& Mat::ones(const uword new_n_rows, const uword new_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); set_size(new_n_rows, new_n_cols); @@ -7281,7 +7480,7 @@ inline Mat& Mat::ones(const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).ones(s.n_rows, s.n_cols); } @@ -7293,7 +7492,7 @@ inline Mat& Mat::randu() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_rng::randu::fill( memptr(), n_elem ); @@ -7307,7 +7506,7 @@ inline Mat& Mat::randu(const uword new_n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); set_size(new_n_elem); @@ -7321,7 +7520,7 @@ inline Mat& Mat::randu(const uword new_n_rows, const uword new_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); set_size(new_n_rows, new_n_cols); @@ -7335,7 +7534,7 @@ inline Mat& Mat::randu(const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).randu(s.n_rows, s.n_cols); } @@ -7347,7 +7546,7 @@ inline Mat& Mat::randn() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_rng::randn::fill( memptr(), n_elem ); @@ -7361,7 +7560,7 @@ inline Mat& Mat::randn(const uword new_n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); set_size(new_n_elem); @@ -7375,7 +7574,7 @@ inline Mat& Mat::randn(const uword new_n_rows, const uword new_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); set_size(new_n_rows, new_n_cols); @@ -7389,7 +7588,7 @@ inline Mat& Mat::randn(const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).randn(s.n_rows, s.n_cols); } @@ -7401,7 +7600,7 @@ inline Mat& Mat::eye() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).zeros(); @@ -7419,7 +7618,7 @@ inline Mat& Mat::eye(const uword new_n_rows, const uword new_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); set_size(new_n_rows, new_n_cols); @@ -7433,7 +7632,7 @@ inline Mat& Mat::eye(const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).eye(s.n_rows, s.n_cols); } @@ -7445,7 +7644,7 @@ inline void Mat::reset() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword new_n_rows = (vec_state == 2) ? 1 : 0; const uword new_n_cols = (vec_state == 1) ? 1 : 0; @@ -7460,7 +7659,7 @@ inline void Mat::soft_reset() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // don't change the size if the matrix has a fixed size or is a cube slice if(mem_state <= 1) @@ -7481,7 +7680,7 @@ inline void Mat::set_real(const Base::pod_type,T1>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat_aux::set_real(*this, X); } @@ -7494,7 +7693,7 @@ inline void Mat::set_imag(const Base::pod_type,T1>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat_aux::set_imag(*this, X); } @@ -7506,11 +7705,11 @@ inline eT Mat::min() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(n_elem == 0) { - arma_debug_check(true, "Mat::min(): object has no elements"); + arma_conform_check(true, "Mat::min(): object has no elements"); return Datum::nan; } @@ -7525,11 +7724,11 @@ inline eT Mat::max() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(n_elem == 0) { - arma_debug_check(true, "Mat::max(): object has no elements"); + arma_conform_check(true, "Mat::max(): object has no elements"); return Datum::nan; } @@ -7544,11 +7743,11 @@ inline eT Mat::min(uword& index_of_min_val) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(n_elem == 0) { - arma_debug_check(true, "Mat::min(): object has no elements"); + arma_conform_check(true, "Mat::min(): object has no elements"); index_of_min_val = uword(0); @@ -7565,11 +7764,11 @@ inline eT Mat::max(uword& index_of_max_val) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(n_elem == 0) { - arma_debug_check(true, "Mat::max(): object has no elements"); + arma_conform_check(true, "Mat::max(): object has no elements"); index_of_max_val = uword(0); @@ -7586,11 +7785,11 @@ inline eT Mat::min(uword& row_of_min_val, uword& col_of_min_val) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(n_elem == 0) { - arma_debug_check(true, "Mat::min(): object has no elements"); + arma_conform_check(true, "Mat::min(): object has no elements"); row_of_min_val = uword(0); col_of_min_val = uword(0); @@ -7615,11 +7814,11 @@ inline eT Mat::max(uword& row_of_max_val, uword& col_of_max_val) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(n_elem == 0) { - arma_debug_check(true, "Mat::max(): object has no elements"); + arma_conform_check(true, "Mat::max(): object has no elements"); row_of_max_val = uword(0); col_of_max_val = uword(0); @@ -7645,7 +7844,7 @@ inline bool Mat::save(const std::string name, const file_type type) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); bool save_okay = false; @@ -7692,11 +7891,11 @@ Mat::save(const std::string name, const file_type type) const break; default: - arma_debug_warn_level(1, "Mat::save(): unsupported file type"); + arma_conform_warn(1, "Mat::save(): unsupported file type"); save_okay = false; } - if(save_okay == false) { arma_debug_warn_level(3, "Mat::save(): write failed; file: ", name); } + if(save_okay == false) { arma_conform_warn(3, "Mat::save(): write failed; file: ", name); } return save_okay; } @@ -7708,7 +7907,7 @@ inline bool Mat::save(const hdf5_name& spec, const file_type type) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // handling of hdf5_binary_trans kept for compatibility with earlier versions of Armadillo @@ -7749,11 +7948,11 @@ Mat::save(const hdf5_name& spec, const file_type type) const { if(err_msg.length() > 0) { - arma_debug_warn_level(3, "Mat::save(): ", err_msg, "; file: ", spec.filename); + arma_conform_warn(3, "Mat::save(): ", err_msg, "; file: ", spec.filename); } else { - arma_debug_warn_level(3, "Mat::save(): write failed; file: ", spec.filename); + arma_conform_warn(3, "Mat::save(): write failed; file: ", spec.filename); } } @@ -7767,7 +7966,7 @@ inline bool Mat::save(const csv_name& spec, const file_type type) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if( (type != csv_ascii) && (type != ssv_ascii) ) { @@ -7780,12 +7979,12 @@ Mat::save(const csv_name& spec, const file_type type) const const bool with_header = bool(spec.opts.flags & csv_opts::flag_with_header) && (no_header == false); const bool use_semicolon = bool(spec.opts.flags & csv_opts::flag_semicolon ) || (type == ssv_ascii); - arma_extra_debug_print("Mat::save(csv_name): enabled flags:"); + arma_debug_print("Mat::save(csv_name): enabled flags:"); - if(do_trans ) { arma_extra_debug_print("trans"); } - if(no_header ) { arma_extra_debug_print("no_header"); } - if(with_header ) { arma_extra_debug_print("with_header"); } - if(use_semicolon) { arma_extra_debug_print("semicolon"); } + if(do_trans ) { arma_debug_print("trans"); } + if(no_header ) { arma_debug_print("no_header"); } + if(with_header ) { arma_debug_print("with_header"); } + if(use_semicolon) { arma_debug_print("semicolon"); } const char separator = (use_semicolon) ? char(';') : char(','); @@ -7793,7 +7992,7 @@ Mat::save(const csv_name& spec, const file_type type) const { if( (spec.header_ro.n_cols != 1) && (spec.header_ro.n_rows != 1) ) { - arma_debug_warn_level(1, "Mat::save(): given header must have a vector layout"); + arma_conform_warn(1, "Mat::save(): given header must have a vector layout"); return false; } @@ -7803,7 +8002,7 @@ Mat::save(const csv_name& spec, const file_type type) const if(token.find(separator) != std::string::npos) { - arma_debug_warn_level(1, "Mat::save(): token within the header contains the separator character: '", token, "'"); + arma_conform_warn(1, "Mat::save(): token within the header contains the separator character: '", token, "'"); return false; } } @@ -7812,7 +8011,7 @@ Mat::save(const csv_name& spec, const file_type type) const if(spec.header_ro.n_elem != save_n_cols) { - arma_debug_warn_level(1, "Mat::save(): size mismatch between header and matrix"); + arma_conform_warn(1, "Mat::save(): size mismatch between header and matrix"); return false; } } @@ -7830,7 +8029,7 @@ Mat::save(const csv_name& spec, const file_type type) const save_okay = diskio::save_csv_ascii(*this, spec.filename, spec.header_ro, with_header, separator); } - if(save_okay == false) { arma_debug_warn_level(3, "Mat::save(): write failed; file: ", spec.filename); } + if(save_okay == false) { arma_conform_warn(3, "Mat::save(): write failed; file: ", spec.filename); } return save_okay; } @@ -7843,7 +8042,7 @@ inline bool Mat::save(std::ostream& os, const file_type type) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); bool save_okay = false; @@ -7882,11 +8081,11 @@ Mat::save(std::ostream& os, const file_type type) const break; default: - arma_debug_warn_level(1, "Mat::save(): unsupported file type"); + arma_conform_warn(1, "Mat::save(): unsupported file type"); save_okay = false; } - if(save_okay == false) { arma_debug_warn_level(3, "Mat::save(): stream write failed"); } + if(save_okay == false) { arma_conform_warn(3, "Mat::save(): stream write failed"); } return save_okay; } @@ -7899,7 +8098,7 @@ inline bool Mat::load(const std::string name, const file_type type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); bool load_okay = false; std::string err_msg; @@ -7951,7 +8150,7 @@ Mat::load(const std::string name, const file_type type) break; default: - arma_debug_warn_level(1, "Mat::load(): unsupported file type"); + arma_conform_warn(1, "Mat::load(): unsupported file type"); load_okay = false; } @@ -7959,11 +8158,11 @@ Mat::load(const std::string name, const file_type type) { if(err_msg.length() > 0) { - arma_debug_warn_level(3, "Mat::load(): ", err_msg, "; file: ", name); + arma_conform_warn(3, "Mat::load(): ", err_msg, "; file: ", name); } else { - arma_debug_warn_level(3, "Mat::load(): read failed; file: ", name); + arma_conform_warn(3, "Mat::load(): read failed; file: ", name); } } @@ -7979,7 +8178,7 @@ inline bool Mat::load(const hdf5_name& spec, const file_type type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if( (type != hdf5_binary) && (type != hdf5_binary_trans) ) { @@ -8010,11 +8209,11 @@ Mat::load(const hdf5_name& spec, const file_type type) { if(err_msg.length() > 0) { - arma_debug_warn_level(3, "Mat::load(): ", err_msg, "; file: ", spec.filename); + arma_conform_warn(3, "Mat::load(): ", err_msg, "; file: ", spec.filename); } else { - arma_debug_warn_level(3, "Mat::load(): read failed; file: ", spec.filename); + arma_conform_warn(3, "Mat::load(): read failed; file: ", spec.filename); } } @@ -8030,7 +8229,7 @@ inline bool Mat::load(const csv_name& spec, const file_type type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if( (type != csv_ascii) && (type != ssv_ascii) ) { @@ -8044,13 +8243,13 @@ Mat::load(const csv_name& spec, const file_type type) const bool use_semicolon = bool(spec.opts.flags & csv_opts::flag_semicolon ) || (type == ssv_ascii); const bool strict = bool(spec.opts.flags & csv_opts::flag_strict ); - arma_extra_debug_print("Mat::load(csv_name): enabled flags:"); + arma_debug_print("Mat::load(csv_name): enabled flags:"); - if(do_trans ) { arma_extra_debug_print("trans"); } - if(no_header ) { arma_extra_debug_print("no_header"); } - if(with_header ) { arma_extra_debug_print("with_header"); } - if(use_semicolon) { arma_extra_debug_print("semicolon"); } - if(strict ) { arma_extra_debug_print("strict"); } + if(do_trans ) { arma_debug_print("trans"); } + if(no_header ) { arma_debug_print("no_header"); } + if(with_header ) { arma_debug_print("with_header"); } + if(use_semicolon) { arma_debug_print("semicolon"); } + if(strict ) { arma_debug_print("strict"); } const char separator = (use_semicolon) ? char(';') : char(','); @@ -8083,11 +8282,11 @@ Mat::load(const csv_name& spec, const file_type type) { if(err_msg.length() > 0) { - arma_debug_warn_level(3, "Mat::load(): ", err_msg, "; file: ", spec.filename); + arma_conform_warn(3, "Mat::load(): ", err_msg, "; file: ", spec.filename); } else { - arma_debug_warn_level(3, "Mat::load(): read failed; file: ", spec.filename); + arma_conform_warn(3, "Mat::load(): read failed; file: ", spec.filename); } } else @@ -8096,7 +8295,7 @@ Mat::load(const csv_name& spec, const file_type type) if(with_header && (spec.header_rw.n_elem != load_n_cols)) { - arma_debug_warn_level(3, "Mat::load(): size mismatch between header and matrix"); + arma_conform_warn(3, "Mat::load(): size mismatch between header and matrix"); } } @@ -8118,7 +8317,7 @@ inline bool Mat::load(std::istream& is, const file_type type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); bool load_okay = false; std::string err_msg; @@ -8162,7 +8361,7 @@ Mat::load(std::istream& is, const file_type type) break; default: - arma_debug_warn_level(1, "Mat::load(): unsupported file type"); + arma_conform_warn(1, "Mat::load(): unsupported file type"); load_okay = false; } @@ -8170,11 +8369,11 @@ Mat::load(std::istream& is, const file_type type) { if(err_msg.length() > 0) { - arma_debug_warn_level(3, "Mat::load(): ", err_msg); + arma_conform_warn(3, "Mat::load(): ", err_msg); } else { - arma_debug_warn_level(3, "Mat::load(): stream read failed"); + arma_conform_warn(3, "Mat::load(): stream read failed"); } } @@ -8190,7 +8389,7 @@ inline bool Mat::quiet_save(const std::string name, const file_type type) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).save(name, type); } @@ -8202,7 +8401,7 @@ inline bool Mat::quiet_save(const hdf5_name& spec, const file_type type) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).save(spec, type); } @@ -8214,7 +8413,7 @@ inline bool Mat::quiet_save(const csv_name& spec, const file_type type) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).save(spec, type); } @@ -8226,7 +8425,7 @@ inline bool Mat::quiet_save(std::ostream& os, const file_type type) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).save(os, type); } @@ -8238,7 +8437,7 @@ inline bool Mat::quiet_load(const std::string name, const file_type type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).load(name, type); } @@ -8250,7 +8449,7 @@ inline bool Mat::quiet_load(const hdf5_name& spec, const file_type type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).load(spec, type); } @@ -8262,7 +8461,7 @@ inline bool Mat::quiet_load(const csv_name& spec, const file_type type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).load(spec, type); } @@ -8274,7 +8473,7 @@ inline bool Mat::quiet_load(std::istream& is, const file_type type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).load(is, type); } @@ -8288,7 +8487,7 @@ Mat::row_iterator::row_iterator() , current_row(0 ) , current_col(0 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: this instance of row_iterator is invalid (it does not point to a valid element) } @@ -8302,7 +8501,7 @@ Mat::row_iterator::row_iterator(const row_iterator& X) , current_row(X.current_row) , current_col(X.current_col) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -8314,7 +8513,7 @@ Mat::row_iterator::row_iterator(Mat& in_M, const uword in_row, const uwo , current_row(in_row) , current_col(in_col) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -8445,7 +8644,7 @@ Mat::const_row_iterator::const_row_iterator() , current_row(0 ) , current_col(0 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: this instance of const_row_iterator is invalid (it does not point to a valid element) } @@ -8459,7 +8658,7 @@ Mat::const_row_iterator::const_row_iterator(const typename Mat::row_iter , current_row(X.current_row) , current_col(X.current_col) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -8471,7 +8670,7 @@ Mat::const_row_iterator::const_row_iterator(const typename Mat::const_ro , current_row(X.current_row) , current_col(X.current_col) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -8483,7 +8682,7 @@ Mat::const_row_iterator::const_row_iterator(const Mat& in_M, const uword , current_row(in_row) , current_col(in_col) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -8615,7 +8814,7 @@ Mat::row_col_iterator::row_col_iterator() , current_col(0 ) , current_row(0 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // Technically this iterator is invalid (it does not point to a valid element) } @@ -8629,7 +8828,7 @@ Mat::row_col_iterator::row_col_iterator(const row_col_iterator& in_it) , current_col(in_it.current_col) , current_row(in_it.current_row) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -8642,7 +8841,7 @@ Mat::row_col_iterator::row_col_iterator(Mat& in_M, const uword in_row, c , current_col(in_col ) , current_row(in_row ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -8798,7 +8997,7 @@ Mat::const_row_col_iterator::const_row_col_iterator() , current_col(0 ) , current_row(0 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // Technically this iterator is invalid (it does not point to a valid element) } @@ -8812,7 +9011,7 @@ Mat::const_row_col_iterator::const_row_col_iterator(const row_col_iterator& , current_col(in_it.col() ) , current_row(in_it.row() ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -8825,7 +9024,7 @@ Mat::const_row_col_iterator::const_row_col_iterator(const const_row_col_iter , current_col(in_it.col() ) , current_row(in_it.row() ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -8838,7 +9037,7 @@ Mat::const_row_col_iterator::const_row_col_iterator(const Mat& in_M, con , current_col(in_col ) , current_row(in_row ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -8992,7 +9191,7 @@ inline typename Mat::iterator Mat::begin() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return memptr(); } @@ -9004,7 +9203,7 @@ inline typename Mat::const_iterator Mat::begin() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return memptr(); } @@ -9016,7 +9215,7 @@ inline typename Mat::const_iterator Mat::cbegin() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return memptr(); } @@ -9028,7 +9227,7 @@ inline typename Mat::iterator Mat::end() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return memptr() + n_elem; } @@ -9040,7 +9239,7 @@ inline typename Mat::const_iterator Mat::end() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return memptr() + n_elem; } @@ -9052,7 +9251,7 @@ inline typename Mat::const_iterator Mat::cend() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return memptr() + n_elem; } @@ -9064,9 +9263,9 @@ inline typename Mat::col_iterator Mat::begin_col(const uword col_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (col_num >= n_cols), "Mat::begin_col(): index out of bounds" ); + arma_conform_check_bounds( (col_num >= n_cols), "Mat::begin_col(): index out of bounds" ); return colptr(col_num); } @@ -9078,9 +9277,9 @@ inline typename Mat::const_col_iterator Mat::begin_col(const uword col_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (col_num >= n_cols), "Mat::begin_col(): index out of bounds" ); + arma_conform_check_bounds( (col_num >= n_cols), "Mat::begin_col(): index out of bounds" ); return colptr(col_num); } @@ -9092,9 +9291,9 @@ inline typename Mat::col_iterator Mat::end_col(const uword col_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (col_num >= n_cols), "Mat::end_col(): index out of bounds" ); + arma_conform_check_bounds( (col_num >= n_cols), "Mat::end_col(): index out of bounds" ); return colptr(col_num) + n_rows; } @@ -9106,9 +9305,9 @@ inline typename Mat::const_col_iterator Mat::end_col(const uword col_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (col_num >= n_cols), "Mat::end_col(): index out of bounds" ); + arma_conform_check_bounds( (col_num >= n_cols), "Mat::end_col(): index out of bounds" ); return colptr(col_num) + n_rows; } @@ -9120,9 +9319,9 @@ inline typename Mat::row_iterator Mat::begin_row(const uword row_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (row_num >= n_rows), "Mat::begin_row(): index out of bounds" ); + arma_conform_check_bounds( (row_num >= n_rows), "Mat::begin_row(): index out of bounds" ); return typename Mat::row_iterator(*this, row_num, uword(0)); } @@ -9134,9 +9333,9 @@ inline typename Mat::const_row_iterator Mat::begin_row(const uword row_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (row_num >= n_rows), "Mat::begin_row(): index out of bounds" ); + arma_conform_check_bounds( (row_num >= n_rows), "Mat::begin_row(): index out of bounds" ); return typename Mat::const_row_iterator(*this, row_num, uword(0)); } @@ -9148,9 +9347,9 @@ inline typename Mat::row_iterator Mat::end_row(const uword row_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (row_num >= n_rows), "Mat::end_row(): index out of bounds" ); + arma_conform_check_bounds( (row_num >= n_rows), "Mat::end_row(): index out of bounds" ); return typename Mat::row_iterator(*this, (row_num + uword(1)), 0); } @@ -9162,9 +9361,9 @@ inline typename Mat::const_row_iterator Mat::end_row(const uword row_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (row_num >= n_rows), "Mat::end_row(): index out of bounds" ); + arma_conform_check_bounds( (row_num >= n_rows), "Mat::end_row(): index out of bounds" ); return typename Mat::const_row_iterator(*this, (row_num + uword(1)), 0); } @@ -9247,7 +9446,7 @@ inline eT& Mat::front() { - arma_debug_check( (n_elem == 0), "Mat::front(): matrix is empty" ); + arma_conform_check( (n_elem == 0), "Mat::front(): matrix is empty" ); return access::rw(mem[0]); } @@ -9259,7 +9458,7 @@ inline const eT& Mat::front() const { - arma_debug_check( (n_elem == 0), "Mat::front(): matrix is empty" ); + arma_conform_check( (n_elem == 0), "Mat::front(): matrix is empty" ); return mem[0]; } @@ -9271,7 +9470,7 @@ inline eT& Mat::back() { - arma_debug_check( (n_elem == 0), "Mat::back(): matrix is empty" ); + arma_conform_check( (n_elem == 0), "Mat::back(): matrix is empty" ); return access::rw(mem[n_elem-1]); } @@ -9283,7 +9482,7 @@ inline const eT& Mat::back() const { - arma_debug_check( (n_elem == 0), "Mat::back(): matrix is empty" ); + arma_conform_check( (n_elem == 0), "Mat::back(): matrix is empty" ); return mem[n_elem-1]; } @@ -9296,16 +9495,13 @@ arma_inline Mat::fixed::fixed() : Mat( arma_fixed_indicator(), fixed_n_rows, fixed_n_cols, 0, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); - if(arma_config::zero_init) - { - arma_extra_debug_print("Mat::fixed::constructor: zeroing memory"); - - eT* mem_use = (use_extra) ? &(mem_local_extra[0]) : &(mem_local[0]); - - arrayops::inplace_set_fixed( mem_use, eT(0) ); - } + arma_debug_print("Mat::fixed::constructor: zeroing memory"); + + eT* mem_use = (use_extra) ? &(mem_local_extra[0]) : &(mem_local[0]); + + arrayops::inplace_set_fixed( mem_use, eT(0) ); } @@ -9316,7 +9512,7 @@ arma_inline Mat::fixed::fixed(const fixed& X) : Mat( arma_fixed_indicator(), fixed_n_rows, fixed_n_cols, 0, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); eT* dest = (use_extra) ? mem_local_extra : mem_local; const eT* src = (use_extra) ? X.mem_local_extra : X.mem_local; @@ -9332,7 +9528,7 @@ inline Mat::fixed::fixed(const fill::scalar_holder f) : Mat( arma_fixed_indicator(), fixed_n_rows, fixed_n_cols, 0, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); (*this).fill(f.scalar); } @@ -9346,7 +9542,7 @@ inline Mat::fixed::fixed(const fill::fill_class&) : Mat( arma_fixed_indicator(), fixed_n_rows, fixed_n_cols, 0, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); if(is_same_type::yes) { (*this).zeros(); } if(is_same_type::yes) { (*this).ones(); } @@ -9364,7 +9560,7 @@ inline Mat::fixed::fixed(const Base& A) : Mat( arma_fixed_indicator(), fixed_n_rows, fixed_n_cols, 0, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); Mat::operator=(A.get_ref()); } @@ -9378,7 +9574,7 @@ inline Mat::fixed::fixed(const Base& A, const Base& B) : Mat( arma_fixed_indicator(), fixed_n_rows, fixed_n_cols, 0, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); Mat::init(A,B); } @@ -9391,7 +9587,7 @@ inline Mat::fixed::fixed(const eT* aux_mem) : Mat( arma_fixed_indicator(), fixed_n_rows, fixed_n_cols, 0, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); eT* dest = (use_extra) ? mem_local_extra : mem_local; @@ -9406,7 +9602,7 @@ inline Mat::fixed::fixed(const char* text) : Mat( arma_fixed_indicator(), fixed_n_rows, fixed_n_cols, 0, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); Mat::operator=(text); } @@ -9419,7 +9615,7 @@ inline Mat::fixed::fixed(const std::string& text) : Mat( arma_fixed_indicator(), fixed_n_rows, fixed_n_cols, 0, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); Mat::operator=(text); } @@ -9432,7 +9628,7 @@ inline Mat::fixed::fixed(const std::initializer_list& list) : Mat( arma_fixed_indicator(), fixed_n_rows, fixed_n_cols, 0, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); (*this).operator=(list); } @@ -9445,11 +9641,11 @@ inline Mat& Mat::fixed::operator=(const std::initializer_list& list) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N = uword(list.size()); - arma_debug_check( (N > fixed_n_elem), "Mat::fixed: initialiser list is too long" ); + arma_conform_check( (N > fixed_n_elem), "Mat::fixed: initialiser list is too long" ); eT* this_mem = (*this).memptr(); @@ -9468,7 +9664,7 @@ inline Mat::fixed::fixed(const std::initializer_list< std::initializer_list >& list) : Mat( arma_fixed_indicator(), fixed_n_rows, fixed_n_cols, 0, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); Mat::init(list); } @@ -9481,7 +9677,7 @@ inline Mat& Mat::fixed::operator=(const std::initializer_list< std::initializer_list >& list) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::init(list); @@ -9496,7 +9692,7 @@ arma_inline Mat& Mat::fixed::operator=(const fixed& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(this != &X) { @@ -9520,7 +9716,7 @@ Mat::fixed::operator=(const fixed& Mat::fixed::operator=(const eOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -9528,7 +9724,7 @@ Mat::fixed::operator=(const fixed tmp(X); (*this) = tmp; return *this; } - arma_debug_assert_same_size(fixed_n_rows, fixed_n_cols, X.get_n_rows(), X.get_n_cols(), "Mat::fixed::operator="); + arma_conform_assert_same_size(fixed_n_rows, fixed_n_cols, X.get_n_rows(), X.get_n_cols(), "Mat::fixed::operator="); eop_type::apply(*this, X); @@ -9544,7 +9740,7 @@ Mat::fixed::operator=(const fixed& Mat::fixed::operator=(const eGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -9558,7 +9754,7 @@ Mat::fixed::operator=(const fixed tmp(X); (*this) = tmp; return *this; } - arma_debug_assert_same_size(fixed_n_rows, fixed_n_cols, X.get_n_rows(), X.get_n_cols(), "Mat::fixed::operator="); + arma_conform_assert_same_size(fixed_n_rows, fixed_n_cols, X.get_n_rows(), X.get_n_cols(), "Mat::fixed::operator="); eglue_type::apply(*this, X); @@ -9673,7 +9869,7 @@ arma_inline eT& Mat::fixed::operator() (const uword ii) { - arma_debug_check_bounds( (ii >= fixed_n_elem), "Mat::operator(): index out of bounds" ); + arma_conform_check_bounds( (ii >= fixed_n_elem), "Mat::operator(): index out of bounds" ); return (use_extra) ? mem_local_extra[ii] : mem_local[ii]; } @@ -9686,7 +9882,7 @@ arma_inline const eT& Mat::fixed::operator() (const uword ii) const { - arma_debug_check_bounds( (ii >= fixed_n_elem), "Mat::operator(): index out of bounds" ); + arma_conform_check_bounds( (ii >= fixed_n_elem), "Mat::operator(): index out of bounds" ); return (use_extra) ? mem_local_extra[ii] : mem_local[ii]; } @@ -9755,7 +9951,7 @@ arma_inline eT& Mat::fixed::operator() (const uword in_row, const uword in_col) { - arma_debug_check_bounds( ((in_row >= fixed_n_rows) || (in_col >= fixed_n_cols)), "Mat::operator(): index out of bounds" ); + arma_conform_check_bounds( ((in_row >= fixed_n_rows) || (in_col >= fixed_n_cols)), "Mat::operator(): index out of bounds" ); const uword iq = in_row + in_col*fixed_n_rows; @@ -9770,7 +9966,7 @@ arma_inline const eT& Mat::fixed::operator() (const uword in_row, const uword in_col) const { - arma_debug_check_bounds( ((in_row >= fixed_n_rows) || (in_col >= fixed_n_cols)), "Mat::operator(): index out of bounds" ); + arma_conform_check_bounds( ((in_row >= fixed_n_rows) || (in_col >= fixed_n_cols)), "Mat::operator(): index out of bounds" ); const uword iq = in_row + in_col*fixed_n_rows; @@ -9844,7 +10040,7 @@ inline const Mat& Mat::fixed::fill(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eT* mem_use = (use_extra) ? &(mem_local_extra[0]) : &(mem_local[0]); @@ -9861,7 +10057,7 @@ inline const Mat& Mat::fixed::zeros() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eT* mem_use = (use_extra) ? &(mem_local_extra[0]) : &(mem_local[0]); @@ -9878,7 +10074,7 @@ inline const Mat& Mat::fixed::ones() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eT* mem_use = (use_extra) ? &(mem_local_extra[0]) : &(mem_local[0]); @@ -10038,12 +10234,12 @@ inline void Mat_aux::set_real(Mat& out, const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap tmp(X.get_ref()); const Mat& A = tmp.M; - arma_debug_assert_same_size( out, A, "Mat::set_real()" ); + arma_conform_assert_same_size( out, A, "Mat::set_real()" ); out = A; } @@ -10055,7 +10251,7 @@ inline void Mat_aux::set_imag(Mat&, const Base&) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -10065,7 +10261,7 @@ inline void Mat_aux::set_real(Mat< std::complex >& out, const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; @@ -10074,7 +10270,7 @@ Mat_aux::set_real(Mat< std::complex >& out, const Base& X) const uword local_n_rows = P.get_n_rows(); const uword local_n_cols = P.get_n_cols(); - arma_debug_assert_same_size( out.n_rows, out.n_cols, local_n_rows, local_n_cols, "Mat::set_real()" ); + arma_conform_assert_same_size( out.n_rows, out.n_cols, local_n_rows, local_n_cols, "Mat::set_real()" ); eT* out_mem = out.memptr(); @@ -10106,7 +10302,7 @@ inline void Mat_aux::set_imag(Mat< std::complex >& out, const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; @@ -10115,7 +10311,7 @@ Mat_aux::set_imag(Mat< std::complex >& out, const Base& X) const uword local_n_rows = P.get_n_rows(); const uword local_n_cols = P.get_n_cols(); - arma_debug_assert_same_size( out.n_rows, out.n_cols, local_n_rows, local_n_cols, "Mat::set_imag()" ); + arma_conform_assert_same_size( out.n_rows, out.n_cols, local_n_rows, local_n_cols, "Mat::set_imag()" ); eT* out_mem = out.memptr(); diff --git a/inst/include/armadillo_bits/OpCube_meat.hpp b/inst/include/armadillo_bits/OpCube_meat.hpp index a20d6b9f..3dc4d45e 100644 --- a/inst/include/armadillo_bits/OpCube_meat.hpp +++ b/inst/include/armadillo_bits/OpCube_meat.hpp @@ -25,7 +25,7 @@ template OpCube::OpCube(const BaseCube& in_m) : m(in_m.get_ref()) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -35,7 +35,7 @@ OpCube::OpCube(const BaseCube& in_m, co : m(in_m.get_ref()) , aux(in_aux) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -47,7 +47,7 @@ OpCube::OpCube(const BaseCube& in_m, co , aux_uword_b(in_aux_uword_b) , aux_uword_c(in_aux_uword_c) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -59,7 +59,7 @@ OpCube::OpCube(const BaseCube& in_m, co , aux_uword_a(in_aux_uword_a) , aux_uword_b(in_aux_uword_b) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -71,7 +71,7 @@ OpCube::OpCube(const BaseCube& in_m, co , aux_uword_b(in_aux_uword_b) , aux_uword_c(in_aux_uword_c) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -79,7 +79,7 @@ OpCube::OpCube(const BaseCube& in_m, co template OpCube::~OpCube() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } diff --git a/inst/include/armadillo_bits/Op_meat.hpp b/inst/include/armadillo_bits/Op_meat.hpp index cd08ff93..66fbaba6 100644 --- a/inst/include/armadillo_bits/Op_meat.hpp +++ b/inst/include/armadillo_bits/Op_meat.hpp @@ -26,7 +26,7 @@ inline Op::Op(const T1& in_m) : m(in_m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -37,7 +37,7 @@ Op::Op(const T1& in_m, const typename T1::elem_type in_aux) : m(in_m) , aux(in_aux) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -50,7 +50,7 @@ Op::Op(const T1& in_m, const typename T1::elem_type in_aux, const u , aux_uword_a(in_aux_uword_a) , aux_uword_b(in_aux_uword_b) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -62,7 +62,7 @@ Op::Op(const T1& in_m, const uword in_aux_uword_a, const uword in_a , aux_uword_a(in_aux_uword_a) , aux_uword_b(in_aux_uword_b) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -71,7 +71,7 @@ template inline Op::~Op() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } diff --git a/inst/include/armadillo_bits/Proxy.hpp b/inst/include/armadillo_bits/Proxy.hpp index ca3f713e..023b703f 100644 --- a/inst/include/armadillo_bits/Proxy.hpp +++ b/inst/include/armadillo_bits/Proxy.hpp @@ -88,7 +88,7 @@ struct Proxy_fixed inline explicit Proxy_fixed(const T1& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } //// this may require T1::n_elem etc to be declared as static constexpr inline variables (C++17) @@ -173,7 +173,7 @@ struct Proxy< Mat > inline explicit Proxy(const Mat& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -220,7 +220,7 @@ struct Proxy< Col > inline explicit Proxy(const Col& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -267,7 +267,7 @@ struct Proxy< Row > inline explicit Proxy(const Row& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr uword get_n_rows() const { return 1; } @@ -314,7 +314,7 @@ struct Proxy< Gen > inline explicit Proxy(const Gen& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return (is_row ? 1 : Q.n_rows); } @@ -361,7 +361,7 @@ struct Proxy< eOp > inline explicit Proxy(const eOp& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return is_row ? 1 : Q.get_n_rows(); } @@ -408,7 +408,7 @@ struct Proxy< eGlue > inline explicit Proxy(const eGlue& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return is_row ? 1 : Q.get_n_rows(); } @@ -455,7 +455,7 @@ struct Proxy< Op > inline explicit Proxy(const Op& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; } @@ -502,7 +502,7 @@ struct Proxy< Glue > inline explicit Proxy(const Glue& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; } @@ -558,9 +558,9 @@ struct Proxy< Glue > , P1(X.A) , P2(X.B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(P1, P2, "element-wise min()"); + arma_conform_assert_same_size(P1, P2, "element-wise min()"); } arma_inline uword get_n_rows() const { return is_row ? 1 : P1.get_n_rows(); } @@ -616,9 +616,9 @@ struct Proxy< Glue > , P1(X.A) , P2(X.B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(P1, P2, "element-wise max()"); + arma_conform_assert_same_size(P1, P2, "element-wise max()"); } arma_inline uword get_n_rows() const { return is_row ? 1 : P1.get_n_rows(); } @@ -665,7 +665,7 @@ struct Proxy< mtOp > inline explicit Proxy(const mtOp& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; } @@ -712,7 +712,7 @@ struct Proxy< mtGlue > inline explicit Proxy(const mtGlue& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; } @@ -759,7 +759,7 @@ struct Proxy< CubeToMatOp > inline explicit Proxy(const CubeToMatOp& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; } @@ -808,7 +808,7 @@ struct Proxy< CubeToMatOp > : U(A.m) , Q(const_cast(U.M.memptr()), U.M.n_elem, 1, false, true) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -855,7 +855,7 @@ struct Proxy< SpToDOp > inline explicit Proxy(const SpToDOp& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; } @@ -904,7 +904,7 @@ struct Proxy< SpToDOp > : U(A.m) , Q(const_cast(U.M.values), U.M.n_nonzero, 1, false, true) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -929,6 +929,53 @@ struct Proxy< SpToDOp > +template +struct Proxy< mtSpToDOp > + { + typedef out_eT elem_type; + typedef typename get_pod_type::result pod_type; + typedef Mat stored_type; + typedef const elem_type* ea_type; + typedef const Mat& aligned_ea_type; + + static constexpr bool use_at = false; + static constexpr bool use_mp = false; + static constexpr bool has_subview = false; + + static constexpr bool is_row = mtSpToDOp::is_row; + static constexpr bool is_col = mtSpToDOp::is_col; + static constexpr bool is_xvec = mtSpToDOp::is_xvec; + + arma_aligned const Mat Q; + + inline explicit Proxy(const mtSpToDOp& A) + : Q(A) + { + arma_debug_sigprint(); + } + + arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; } + arma_inline uword get_n_cols() const { return is_col ? 1 : Q.n_cols; } + arma_inline uword get_n_elem() const { return Q.n_elem; } + + arma_inline elem_type operator[] (const uword i) const { return Q[i]; } + arma_inline elem_type at (const uword r, const uword c) const { return Q.at(r, c); } + arma_inline elem_type at_alt (const uword i) const { return Q.at_alt(i); } + + arma_inline ea_type get_ea() const { return Q.memptr(); } + arma_inline aligned_ea_type get_aligned_ea() const { return Q; } + + template + constexpr bool is_alias(const Mat&) const { return false; } + + template + constexpr bool has_overlap(const subview&) const { return false; } + + arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr()); } + }; + + + template struct Proxy< SpToDGlue > { @@ -951,7 +998,7 @@ struct Proxy< SpToDGlue > inline explicit Proxy(const SpToDGlue& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; } @@ -998,7 +1045,7 @@ struct Proxy< subview > inline explicit Proxy(const subview& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -1045,7 +1092,7 @@ struct Proxy< subview_col > inline explicit Proxy(const subview_col& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -1094,7 +1141,7 @@ struct Proxy< subview_cols > : sv(A) , Q ( const_cast( A.colptr(0) ), A.n_rows, A.n_cols, false, false ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -1141,7 +1188,7 @@ struct Proxy< subview_row > inline explicit Proxy(const subview_row& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr uword get_n_rows() const { return 1; } @@ -1190,21 +1237,21 @@ struct Proxy< subview_elem1 > : Q(A) , R(A.a.get_ref()) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool R_is_vec = ((R.get_n_rows() == 1) || (R.get_n_cols() == 1)); const bool R_is_empty = (R.get_n_elem() == 0); - arma_debug_check( ((R_is_vec == false) && (R_is_empty == false)), "Mat::elem(): given object must be a vector" ); + arma_conform_check( ((R_is_vec == false) && (R_is_empty == false)), "Mat::elem(): given object must be a vector" ); } arma_inline uword get_n_rows() const { return R.get_n_elem(); } constexpr uword get_n_cols() const { return 1; } arma_inline uword get_n_elem() const { return R.get_n_elem(); } - arma_inline elem_type operator[] (const uword i) const { const uword ii = (Proxy::use_at) ? R.at(i,0) : R[i]; arma_debug_check_bounds( (ii >= Q.m.n_elem), "Mat::elem(): index out of bounds" ); return Q.m[ii]; } - arma_inline elem_type at (const uword r, const uword) const { const uword ii = (Proxy::use_at) ? R.at(r,0) : R[r]; arma_debug_check_bounds( (ii >= Q.m.n_elem), "Mat::elem(): index out of bounds" ); return Q.m[ii]; } - arma_inline elem_type at_alt (const uword i) const { const uword ii = (Proxy::use_at) ? R.at(i,0) : R[i]; arma_debug_check_bounds( (ii >= Q.m.n_elem), "Mat::elem(): index out of bounds" ); return Q.m[ii]; } + arma_inline elem_type operator[] (const uword i) const { const uword ii = (Proxy::use_at) ? R.at(i,0) : R[i]; arma_conform_check_bounds( (ii >= Q.m.n_elem), "Mat::elem(): index out of bounds" ); return Q.m[ii]; } + arma_inline elem_type at (const uword r, const uword) const { const uword ii = (Proxy::use_at) ? R.at(r,0) : R[r]; arma_conform_check_bounds( (ii >= Q.m.n_elem), "Mat::elem(): index out of bounds" ); return Q.m[ii]; } + arma_inline elem_type at_alt (const uword i) const { const uword ii = (Proxy::use_at) ? R.at(i,0) : R[i]; arma_conform_check_bounds( (ii >= Q.m.n_elem), "Mat::elem(): index out of bounds" ); return Q.m[ii]; } arma_inline ea_type get_ea() const { return (*this); } arma_inline aligned_ea_type get_aligned_ea() const { return (*this); } @@ -1242,7 +1289,7 @@ struct Proxy< subview_elem2 > inline explicit Proxy(const subview_elem2& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -1289,7 +1336,7 @@ struct Proxy< diagview > inline explicit Proxy(const diagview& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -1345,7 +1392,7 @@ struct Proxy_diagvec_mat< Op > inline explicit Proxy_diagvec_mat(const Op& A) : R(A.m), Q( R.diag() ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -1400,7 +1447,7 @@ struct Proxy_diagvec_expr< Op > inline explicit Proxy_diagvec_expr(const Op& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -1445,7 +1492,7 @@ struct Proxy< Op > inline explicit Proxy(const Op& A) : Proxy_diagvec(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } }; @@ -1473,7 +1520,7 @@ struct Proxy< Op > inline explicit Proxy(const Op& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -1530,7 +1577,7 @@ struct Proxy_xtrans_default< Op > : U(A.m) , Q(U.M) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline ea_type get_ea() const { return Q; } @@ -1571,7 +1618,7 @@ struct Proxy_xtrans_default< Op > : U(A.m) , Q(U.M) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline ea_type get_ea() const { return Q; } @@ -1621,7 +1668,7 @@ struct Proxy_xtrans_vector< Op > : U(A.m) , Q(const_cast(U.M.memptr()), U.M.n_cols, U.M.n_rows, false, false) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline ea_type get_ea() const { return Q.memptr(); } @@ -1663,7 +1710,7 @@ struct Proxy_xtrans_vector< Op > : U(A.m) , Q(const_cast(U.M.memptr()), U.M.n_cols, U.M.n_rows, false, false) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline ea_type get_ea() const { return Q.memptr(); } @@ -1728,7 +1775,7 @@ struct Proxy< Op > inline explicit Proxy(const Op& A) : Proxy_xtrans(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; } @@ -1790,7 +1837,7 @@ struct Proxy< Op > inline explicit Proxy(const Op& A) : Proxy_xtrans(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; } @@ -1837,7 +1884,7 @@ struct Proxy_subview_row_htrans_cx inline explicit Proxy_subview_row_htrans_cx(const Op, op_htrans>& A) : Q(A.m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } template @@ -1871,7 +1918,7 @@ struct Proxy_subview_row_htrans_non_cx inline explicit Proxy_subview_row_htrans_non_cx(const Op, op_htrans>& A) : Q(A.m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } template @@ -1931,7 +1978,7 @@ struct Proxy< Op, op_htrans> > inline explicit Proxy(const Op, op_htrans>& A) : Proxy_sv_row_ht(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -1978,7 +2025,7 @@ struct Proxy< Op, op_strans> > inline explicit Proxy(const Op, op_strans>& A) : Q(A.m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -2029,7 +2076,7 @@ struct Proxy< Op< Row< std::complex >, op_htrans> > : Q (A.m.memptr(), A.m.n_rows, A.m.n_cols) , src(A.m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -2080,7 +2127,7 @@ struct Proxy< Op< Col< std::complex >, op_htrans> > : Q (A.m.memptr(), A.m.n_rows, A.m.n_cols) , src(A.m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr uword get_n_rows() const { return 1; } @@ -2131,7 +2178,7 @@ struct Proxy< Op< subview_col< std::complex >, op_htrans> > : Q (A.m.colptr(0), A.m.n_rows, A.m.n_cols) , src(A.m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr uword get_n_rows() const { return 1; } @@ -2181,7 +2228,7 @@ struct Proxy< Op > : R(A.m) , Q(R, A.aux) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return is_row ? 1 : Q.get_n_rows(); } @@ -2228,7 +2275,7 @@ struct Proxy< subview_row_strans > inline explicit Proxy(const subview_row_strans& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -2275,7 +2322,7 @@ struct Proxy< subview_row_htrans > inline explicit Proxy(const subview_row_htrans& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -2322,7 +2369,7 @@ struct Proxy< xtrans_mat > inline explicit Proxy(const xtrans_mat& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -2369,7 +2416,7 @@ struct Proxy< xvec_htrans > inline explicit Proxy(const xvec_htrans& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -2426,7 +2473,7 @@ struct Proxy_vectorise_col_mat< Op > : U(A.m) , Q(const_cast(U.M.memptr()), U.M.n_elem, 1, false, false) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -2483,7 +2530,7 @@ struct Proxy_vectorise_col_expr< Op > : Q(A) , R(A.m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return R.get_n_elem(); } @@ -2528,7 +2575,7 @@ struct Proxy< Op > inline explicit Proxy(const Op& A) : Proxy_vectorise_col(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } }; diff --git a/inst/include/armadillo_bits/ProxyCube.hpp b/inst/include/armadillo_bits/ProxyCube.hpp index ef639284..7f7cc0e0 100644 --- a/inst/include/armadillo_bits/ProxyCube.hpp +++ b/inst/include/armadillo_bits/ProxyCube.hpp @@ -53,7 +53,7 @@ struct ProxyCube< Cube > inline explicit ProxyCube(const Cube& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -98,7 +98,7 @@ struct ProxyCube< GenCube > inline explicit ProxyCube(const GenCube& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -143,7 +143,7 @@ struct ProxyCube< OpCube > inline explicit ProxyCube(const OpCube& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -188,7 +188,7 @@ struct ProxyCube< GlueCube > inline explicit ProxyCube(const GlueCube& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -233,7 +233,7 @@ struct ProxyCube< subview_cube > inline explicit ProxyCube(const subview_cube& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -278,7 +278,7 @@ struct ProxyCube< subview_cube_slices > inline explicit ProxyCube(const subview_cube_slices& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -323,7 +323,7 @@ struct ProxyCube< eOpCube > inline explicit ProxyCube(const eOpCube& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.get_n_rows(); } @@ -368,7 +368,7 @@ struct ProxyCube< eGlueCube > inline explicit ProxyCube(const eGlueCube& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.get_n_rows(); } @@ -413,7 +413,7 @@ struct ProxyCube< mtOpCube > inline explicit ProxyCube(const mtOpCube& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -458,7 +458,7 @@ struct ProxyCube< mtGlueCube > inline explicit ProxyCube(const mtGlueCube& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } diff --git a/inst/include/armadillo_bits/Row_meat.hpp b/inst/include/armadillo_bits/Row_meat.hpp index f61a1792..935e7fe3 100644 --- a/inst/include/armadillo_bits/Row_meat.hpp +++ b/inst/include/armadillo_bits/Row_meat.hpp @@ -26,7 +26,7 @@ inline Row::Row() : Mat(arma_vec_indicator(), 2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -36,7 +36,7 @@ inline Row::Row(const Row& X) : Mat(arma_vec_indicator(), 1, X.n_elem, 2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arrayops::copy((*this).memptr(), X.memptr(), X.n_elem); } @@ -49,13 +49,11 @@ inline Row::Row(const uword in_n_elem) : Mat(arma_vec_indicator(), 1, in_n_elem, 2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - if(arma_config::zero_init) - { - arma_extra_debug_print("Row::constructor: zeroing memory"); - arrayops::fill_zeros(Mat::memptr(), Mat::n_elem); - } + arma_debug_print("Row::constructor: zeroing memory"); + + arrayops::fill_zeros(Mat::memptr(), Mat::n_elem); } @@ -65,15 +63,13 @@ inline Row::Row(const uword in_n_rows, const uword in_n_cols) : Mat(arma_vec_indicator(), 0, 0, 2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::init_warm(in_n_rows, in_n_cols); - if(arma_config::zero_init) - { - arma_extra_debug_print("Row::constructor: zeroing memory"); - arrayops::fill_zeros(Mat::memptr(), Mat::n_elem); - } + arma_debug_print("Row::constructor: zeroing memory"); + + arrayops::fill_zeros(Mat::memptr(), Mat::n_elem); } @@ -83,15 +79,13 @@ inline Row::Row(const SizeMat& s) : Mat(arma_vec_indicator(), 0, 0, 2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::init_warm(s.n_rows, s.n_cols); - if(arma_config::zero_init) - { - arma_extra_debug_print("Row::constructor: zeroing memory"); - arrayops::fill_zeros(Mat::memptr(), Mat::n_elem); - } + arma_debug_print("Row::constructor: zeroing memory"); + + arrayops::fill_zeros(Mat::memptr(), Mat::n_elem); } @@ -103,11 +97,11 @@ inline Row::Row(const uword in_n_elem, const arma_initmode_indicator&) : Mat(arma_vec_indicator(), 1, in_n_elem, 2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(do_zeros) { - arma_extra_debug_print("Row::constructor: zeroing memory"); + arma_debug_print("Row::constructor: zeroing memory"); arrayops::fill_zeros(Mat::memptr(), Mat::n_elem); } } @@ -121,13 +115,13 @@ inline Row::Row(const uword in_n_rows, const uword in_n_cols, const arma_initmode_indicator&) : Mat(arma_vec_indicator(), 0, 0, 2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::init_warm(in_n_rows, in_n_cols); if(do_zeros) { - arma_extra_debug_print("Row::constructor: zeroing memory"); + arma_debug_print("Row::constructor: zeroing memory"); arrayops::fill_zeros(Mat::memptr(), Mat::n_elem); } } @@ -141,13 +135,13 @@ inline Row::Row(const SizeMat& s, const arma_initmode_indicator&) : Mat(arma_vec_indicator(), 0, 0, 2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::init_warm(s.n_rows, s.n_cols); if(do_zeros) { - arma_extra_debug_print("Row::constructor: zeroing memory"); + arma_debug_print("Row::constructor: zeroing memory"); arrayops::fill_zeros(Mat::memptr(), Mat::n_elem); } } @@ -160,7 +154,7 @@ inline Row::Row(const uword in_n_elem, const fill::fill_class& f) : Mat(arma_vec_indicator(), 1, in_n_elem, 2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).fill(f); } @@ -173,7 +167,7 @@ inline Row::Row(const uword in_n_rows, const uword in_n_cols, const fill::fill_class& f) : Mat(arma_vec_indicator(), 0, 0, 2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::init_warm(in_n_rows, in_n_cols); @@ -188,7 +182,7 @@ inline Row::Row(const SizeMat& s, const fill::fill_class& f) : Mat(arma_vec_indicator(), 0, 0, 2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::init_warm(s.n_rows, s.n_cols); @@ -202,7 +196,7 @@ inline Row::Row(const uword in_n_elem, const fill::scalar_holder f) : Mat(arma_vec_indicator(), 1, in_n_elem, 2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).fill(f.scalar); } @@ -214,7 +208,7 @@ inline Row::Row(const uword in_n_rows, const uword in_n_cols, const fill::scalar_holder f) : Mat(arma_vec_indicator(), 0, 0, 2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::init_warm(in_n_rows, in_n_cols); @@ -228,7 +222,7 @@ inline Row::Row(const SizeMat& s, const fill::scalar_holder f) : Mat(arma_vec_indicator(), 0, 0, 2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::init_warm(s.n_rows, s.n_cols); @@ -242,7 +236,7 @@ inline Row::Row(const char* text) : Mat(arma_vec_indicator(), 2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).operator=(text); } @@ -254,11 +248,11 @@ inline Row& Row::operator=(const char* text) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat tmp(text); - arma_debug_check( ((tmp.n_elem > 0) && (tmp.is_vec() == false)), "Mat::init(): requested size is not compatible with row vector layout" ); + arma_conform_check( ((tmp.n_elem > 0) && (tmp.is_vec() == false)), "Mat::init(): requested size is not compatible with row vector layout" ); access::rw(tmp.n_rows) = 1; access::rw(tmp.n_cols) = tmp.n_elem; @@ -275,7 +269,7 @@ inline Row::Row(const std::string& text) : Mat(arma_vec_indicator(), 2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).operator=(text); } @@ -287,11 +281,11 @@ inline Row& Row::operator=(const std::string& text) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat tmp(text); - arma_debug_check( ((tmp.n_elem > 0) && (tmp.is_vec() == false)), "Mat::init(): requested size is not compatible with row vector layout" ); + arma_conform_check( ((tmp.n_elem > 0) && (tmp.is_vec() == false)), "Mat::init(): requested size is not compatible with row vector layout" ); access::rw(tmp.n_rows) = 1; access::rw(tmp.n_cols) = tmp.n_elem; @@ -309,7 +303,7 @@ inline Row::Row(const std::vector& x) : Mat(arma_vec_indicator(), 1, uword(x.size()), 2) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); const uword N = uword(x.size()); @@ -324,7 +318,7 @@ inline Row& Row::operator=(const std::vector& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N = uword(x.size()); @@ -342,7 +336,7 @@ inline Row::Row(const std::initializer_list& list) : Mat(arma_vec_indicator(), 1, uword(list.size()), 2) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); const uword N = uword(list.size()); @@ -356,7 +350,7 @@ inline Row& Row::operator=(const std::initializer_list& list) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N = uword(list.size()); @@ -374,7 +368,7 @@ inline Row::Row(Row&& X) : Mat(arma_vec_indicator(), 2) { - arma_extra_debug_sigprint(arma_str::format("this = %x X = %x") % this % &X); + arma_debug_sigprint(arma_str::format("this: %x; X: %x") % this % &X); access::rw(Mat::n_rows) = 1; access::rw(Mat::n_cols) = X.n_cols; @@ -416,7 +410,7 @@ inline Row& Row::operator=(Row&& X) { - arma_extra_debug_sigprint(arma_str::format("this = %x X = %x") % this % &X); + arma_debug_sigprint(arma_str::format("this: %x; X: %x") % this % &X); (*this).steal_mem(X, true); @@ -430,7 +424,7 @@ Row::operator=(Row&& X) // Row::Row(Mat&& X) // : Mat(arma_vec_indicator(), 2) // { -// arma_extra_debug_sigprint(arma_str::format("this = %x X = %x") % this % &X); +// arma_debug_sigprint(arma_str::format("this: %x; X: %x") % this % &X); // // if(X.n_rows != 1) { const Mat& XX = X; Mat::operator=(XX); return; } // @@ -472,7 +466,7 @@ Row::operator=(Row&& X) // Row& // Row::operator=(Mat&& X) // { -// arma_extra_debug_sigprint(arma_str::format("this = %x X = %x") % this % &X); +// arma_debug_sigprint(arma_str::format("this: %x; X: %x") % this % &X); // // if(X.n_rows != 1) { const Mat& XX = X; Mat::operator=(XX); return *this; } // @@ -488,7 +482,7 @@ inline Row& Row::operator=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::operator=(val); @@ -502,7 +496,7 @@ inline Row& Row::operator=(const Row& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::operator=(X); @@ -517,7 +511,7 @@ inline Row::Row(const Base& X) : Mat(arma_vec_indicator(), 2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::operator=(X.get_ref()); } @@ -530,7 +524,7 @@ inline Row& Row::operator=(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::operator=(X.get_ref()); @@ -545,7 +539,7 @@ inline Row::Row(const SpBase& X) : Mat(arma_vec_indicator(), 2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::operator=(X.get_ref()); } @@ -558,7 +552,7 @@ inline Row& Row::operator=(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::operator=(X.get_ref()); @@ -573,7 +567,7 @@ inline Row::Row(eT* aux_mem, const uword aux_length, const bool copy_aux_mem, const bool strict) : Mat(aux_mem, 1, aux_length, copy_aux_mem, strict) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); access::rw(Mat::vec_state) = 2; } @@ -586,7 +580,7 @@ inline Row::Row(const eT* aux_mem, const uword aux_length) : Mat(aux_mem, 1, aux_length) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); access::rw(Mat::vec_state) = 2; } @@ -602,7 +596,7 @@ Row::Row const Base::pod_type, T2>& B ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); access::rw(Mat::vec_state) = 2; @@ -616,7 +610,7 @@ template inline Row::Row(const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); access::rw(Mat::vec_state) = 2; @@ -631,7 +625,7 @@ inline Row& Row::operator=(const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::operator=(X); @@ -644,7 +638,7 @@ template inline Row::Row(const subview_cube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); access::rw(Mat::vec_state) = 2; @@ -658,7 +652,7 @@ inline Row& Row::operator=(const subview_cube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::operator=(X); @@ -722,9 +716,9 @@ arma_inline subview_row Row::col(const uword in_col1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (in_col1 >= Mat::n_cols), "Row::col(): indices out of bounds or incorrectly used" ); + arma_conform_check_bounds( (in_col1 >= Mat::n_cols), "Row::col(): indices out of bounds or incorrectly used" ); return subview_row(*this, 0, in_col1, 1); } @@ -736,9 +730,9 @@ arma_inline const subview_row Row::col(const uword in_col1) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (in_col1 >= Mat::n_cols), "Row::col(): indices out of bounds or incorrectly used" ); + arma_conform_check_bounds( (in_col1 >= Mat::n_cols), "Row::col(): indices out of bounds or incorrectly used" ); return subview_row(*this, 0, in_col1, 1); } @@ -750,9 +744,9 @@ arma_inline subview_row Row::cols(const uword in_col1, const uword in_col2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( ( (in_col1 > in_col2) || (in_col2 >= Mat::n_cols) ), "Row::cols(): indices out of bounds or incorrectly used" ); + arma_conform_check_bounds( ( (in_col1 > in_col2) || (in_col2 >= Mat::n_cols) ), "Row::cols(): indices out of bounds or incorrectly used" ); const uword subview_n_cols = in_col2 - in_col1 + 1; @@ -766,9 +760,9 @@ arma_inline const subview_row Row::cols(const uword in_col1, const uword in_col2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( ( (in_col1 > in_col2) || (in_col2 >= Mat::n_cols) ), "Row::cols(): indices out of bounds or incorrectly used" ); + arma_conform_check_bounds( ( (in_col1 > in_col2) || (in_col2 >= Mat::n_cols) ), "Row::cols(): indices out of bounds or incorrectly used" ); const uword subview_n_cols = in_col2 - in_col1 + 1; @@ -782,9 +776,9 @@ arma_inline subview_row Row::subvec(const uword in_col1, const uword in_col2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( ( (in_col1 > in_col2) || (in_col2 >= Mat::n_cols) ), "Row::subvec(): indices out of bounds or incorrectly used" ); + arma_conform_check_bounds( ( (in_col1 > in_col2) || (in_col2 >= Mat::n_cols) ), "Row::subvec(): indices out of bounds or incorrectly used" ); const uword subview_n_cols = in_col2 - in_col1 + 1; @@ -798,9 +792,9 @@ arma_inline const subview_row Row::subvec(const uword in_col1, const uword in_col2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( ( (in_col1 > in_col2) || (in_col2 >= Mat::n_cols) ), "Row::subvec(): indices out of bounds or incorrectly used" ); + arma_conform_check_bounds( ( (in_col1 > in_col2) || (in_col2 >= Mat::n_cols) ), "Row::subvec(): indices out of bounds or incorrectly used" ); const uword subview_n_cols = in_col2 - in_col1 + 1; @@ -814,7 +808,7 @@ arma_inline subview_row Row::cols(const span& col_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subvec(col_span); } @@ -826,7 +820,7 @@ arma_inline const subview_row Row::cols(const span& col_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subvec(col_span); } @@ -838,7 +832,7 @@ arma_inline subview_row Row::subvec(const span& col_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool col_all = col_span.whole; @@ -848,7 +842,7 @@ Row::subvec(const span& col_span) const uword in_col2 = col_span.b; const uword subvec_n_cols = col_all ? local_n_cols : in_col2 - in_col1 + 1; - arma_debug_check_bounds( ( col_all ? false : ((in_col1 > in_col2) || (in_col2 >= local_n_cols)) ), "Row::subvec(): indices out of bounds or incorrectly used" ); + arma_conform_check_bounds( ( col_all ? false : ((in_col1 > in_col2) || (in_col2 >= local_n_cols)) ), "Row::subvec(): indices out of bounds or incorrectly used" ); return subview_row(*this, 0, in_col1, subvec_n_cols); } @@ -860,7 +854,7 @@ arma_inline const subview_row Row::subvec(const span& col_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool col_all = col_span.whole; @@ -870,7 +864,7 @@ Row::subvec(const span& col_span) const const uword in_col2 = col_span.b; const uword subvec_n_cols = col_all ? local_n_cols : in_col2 - in_col1 + 1; - arma_debug_check_bounds( ( col_all ? false : ((in_col1 > in_col2) || (in_col2 >= local_n_cols)) ), "Row::subvec(): indices out of bounds or incorrectly used" ); + arma_conform_check_bounds( ( col_all ? false : ((in_col1 > in_col2) || (in_col2 >= local_n_cols)) ), "Row::subvec(): indices out of bounds or incorrectly used" ); return subview_row(*this, 0, in_col1, subvec_n_cols); } @@ -882,7 +876,7 @@ arma_inline subview_row Row::operator()(const span& col_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subvec(col_span); } @@ -894,7 +888,7 @@ arma_inline const subview_row Row::operator()(const span& col_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subvec(col_span); } @@ -906,11 +900,11 @@ arma_inline subview_row Row::subvec(const uword start_col, const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (s.n_rows != 1), "Row::subvec(): given size does not specify a row vector" ); + arma_conform_check( (s.n_rows != 1), "Row::subvec(): given size does not specify a row vector" ); - arma_debug_check_bounds( ( (start_col >= Mat::n_cols) || ((start_col + s.n_cols) > Mat::n_cols) ), "Row::subvec(): size out of bounds" ); + arma_conform_check_bounds( ( (start_col >= Mat::n_cols) || ((start_col + s.n_cols) > Mat::n_cols) ), "Row::subvec(): size out of bounds" ); return subview_row(*this, 0, start_col, s.n_cols); } @@ -922,11 +916,11 @@ arma_inline const subview_row Row::subvec(const uword start_col, const SizeMat& s) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (s.n_rows != 1), "Row::subvec(): given size does not specify a row vector" ); + arma_conform_check( (s.n_rows != 1), "Row::subvec(): given size does not specify a row vector" ); - arma_debug_check_bounds( ( (start_col >= Mat::n_cols) || ((start_col + s.n_cols) > Mat::n_cols) ), "Row::subvec(): size out of bounds" ); + arma_conform_check_bounds( ( (start_col >= Mat::n_cols) || ((start_col + s.n_cols) > Mat::n_cols) ), "Row::subvec(): size out of bounds" ); return subview_row(*this, 0, start_col, s.n_cols); } @@ -938,9 +932,9 @@ arma_inline subview_row Row::head(const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > Mat::n_cols), "Row::head(): size out of bounds" ); + arma_conform_check_bounds( (N > Mat::n_cols), "Row::head(): size out of bounds" ); return subview_row(*this, 0, 0, N); } @@ -952,9 +946,9 @@ arma_inline const subview_row Row::head(const uword N) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > Mat::n_cols), "Row::head(): size out of bounds" ); + arma_conform_check_bounds( (N > Mat::n_cols), "Row::head(): size out of bounds" ); return subview_row(*this, 0, 0, N); } @@ -966,9 +960,9 @@ arma_inline subview_row Row::tail(const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > Mat::n_cols), "Row::tail(): size out of bounds" ); + arma_conform_check_bounds( (N > Mat::n_cols), "Row::tail(): size out of bounds" ); const uword start_col = Mat::n_cols - N; @@ -982,9 +976,9 @@ arma_inline const subview_row Row::tail(const uword N) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > Mat::n_cols), "Row::tail(): size out of bounds" ); + arma_conform_check_bounds( (N > Mat::n_cols), "Row::tail(): size out of bounds" ); const uword start_col = Mat::n_cols - N; @@ -998,7 +992,7 @@ arma_inline subview_row Row::head_cols(const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).head(N); } @@ -1010,7 +1004,7 @@ arma_inline const subview_row Row::head_cols(const uword N) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).head(N); } @@ -1022,7 +1016,7 @@ arma_inline subview_row Row::tail_cols(const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).tail(N); } @@ -1034,7 +1028,7 @@ arma_inline const subview_row Row::tail_cols(const uword N) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).tail(N); } @@ -1047,9 +1041,9 @@ inline void Row::shed_col(const uword col_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( col_num >= Mat::n_cols, "Row::shed_col(): index out of bounds" ); + arma_conform_check_bounds( col_num >= Mat::n_cols, "Row::shed_col(): index out of bounds" ); shed_cols(col_num, col_num); } @@ -1062,9 +1056,9 @@ inline void Row::shed_cols(const uword in_col1, const uword in_col2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_col1 > in_col2) || (in_col2 >= Mat::n_cols), "Row::shed_cols(): indices out of bounds or incorrectly used" @@ -1100,7 +1094,7 @@ inline void Row::shed_cols(const Base& indices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::shed_cols(indices); } @@ -1112,7 +1106,7 @@ inline void Row::insert_cols(const uword col_num, const uword N, const bool set_to_zero) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(set_to_zero); @@ -1126,7 +1120,7 @@ inline void Row::insert_cols(const uword col_num, const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword t_n_cols = Mat::n_cols; @@ -1134,7 +1128,7 @@ Row::insert_cols(const uword col_num, const uword N) const uword B_n_cols = t_n_cols - col_num; // insertion at col_num == n_cols is in effect an append operation - arma_debug_check_bounds( (col_num > t_n_cols), "Row::insert_cols(): index out of bounds" ); + arma_conform_check_bounds( (col_num > t_n_cols), "Row::insert_cols(): index out of bounds" ); if(N == 0) { return; } @@ -1168,7 +1162,7 @@ inline void Row::insert_cols(const uword col_num, const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat::insert_cols(col_num, X); } @@ -1220,9 +1214,9 @@ inline typename Row::row_iterator Row::begin_row(const uword row_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (row_num >= Mat::n_rows), "Row::begin_row(): index out of bounds" ); + arma_conform_check_bounds( (row_num >= Mat::n_rows), "Row::begin_row(): index out of bounds" ); return Mat::memptr(); } @@ -1234,9 +1228,9 @@ inline typename Row::const_row_iterator Row::begin_row(const uword row_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (row_num >= Mat::n_rows), "Row::begin_row(): index out of bounds" ); + arma_conform_check_bounds( (row_num >= Mat::n_rows), "Row::begin_row(): index out of bounds" ); return Mat::memptr(); } @@ -1248,9 +1242,9 @@ inline typename Row::row_iterator Row::end_row(const uword row_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (row_num >= Mat::n_rows), "Row::end_row(): index out of bounds" ); + arma_conform_check_bounds( (row_num >= Mat::n_rows), "Row::end_row(): index out of bounds" ); return Mat::memptr() + Mat::n_cols; } @@ -1262,9 +1256,9 @@ inline typename Row::const_row_iterator Row::end_row(const uword row_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (row_num >= Mat::n_rows), "Row::end_row(): index out of bounds" ); + arma_conform_check_bounds( (row_num >= Mat::n_rows), "Row::end_row(): index out of bounds" ); return Mat::memptr() + Mat::n_cols; } @@ -1277,16 +1271,13 @@ arma_inline Row::fixed::fixed() : Row( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); - if(arma_config::zero_init) - { - arma_extra_debug_print("Row::fixed::constructor: zeroing memory"); - - eT* mem_use = (use_extra) ? &(mem_local_extra[0]) : &(Mat::mem_local[0]); - - arrayops::inplace_set_fixed( mem_use, eT(0) ); - } + arma_debug_print("Row::fixed::constructor: zeroing memory"); + + eT* mem_use = (use_extra) ? &(mem_local_extra[0]) : &(Mat::mem_local[0]); + + arrayops::inplace_set_fixed( mem_use, eT(0) ); } @@ -1297,7 +1288,7 @@ arma_inline Row::fixed::fixed(const fixed& X) : Row( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); eT* dest = (use_extra) ? mem_local_extra : Mat::mem_local; const eT* src = (use_extra) ? X.mem_local_extra : X.mem_local; @@ -1313,7 +1304,7 @@ arma_inline Row::fixed::fixed(const subview_cube& X) : Row( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); Row::operator=(X); } @@ -1326,7 +1317,7 @@ inline Row::fixed::fixed(const fill::scalar_holder f) : Row( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); (*this).fill(f.scalar); } @@ -1340,7 +1331,7 @@ inline Row::fixed::fixed(const fill::fill_class&) : Row( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); if(is_same_type::yes) { (*this).zeros(); } if(is_same_type::yes) { (*this).ones(); } @@ -1358,7 +1349,7 @@ arma_inline Row::fixed::fixed(const Base& A) : Row( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); Row::operator=(A.get_ref()); } @@ -1372,7 +1363,7 @@ arma_inline Row::fixed::fixed(const Base& A, const Base& B) : Row( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); Row::init(A,B); } @@ -1385,7 +1376,7 @@ inline Row::fixed::fixed(const eT* aux_mem) : Row( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); eT* dest = (use_extra) ? mem_local_extra : Mat::mem_local; @@ -1400,7 +1391,7 @@ inline Row::fixed::fixed(const char* text) : Row( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); Row::operator=(text); } @@ -1413,7 +1404,7 @@ inline Row::fixed::fixed(const std::string& text) : Row( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); Row::operator=(text); } @@ -1426,7 +1417,7 @@ template Row& Row::fixed::operator=(const Base& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Row::operator=(A.get_ref()); @@ -1440,7 +1431,7 @@ template Row& Row::fixed::operator=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Row::operator=(val); @@ -1454,7 +1445,7 @@ template Row& Row::fixed::operator=(const char* text) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Row::operator=(text); @@ -1468,7 +1459,7 @@ template Row& Row::fixed::operator=(const std::string& text) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Row::operator=(text); @@ -1482,7 +1473,7 @@ template Row& Row::fixed::operator=(const subview_cube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Row::operator=(X); @@ -1497,7 +1488,7 @@ inline Row::fixed::fixed(const std::initializer_list& list) : Row( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat::mem_local) ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); (*this).operator=(list); } @@ -1510,11 +1501,11 @@ inline Row& Row::fixed::operator=(const std::initializer_list& list) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N = uword(list.size()); - arma_debug_check( (N > fixed_n_elem), "Row::fixed: initialiser list is too long" ); + arma_conform_check( (N > fixed_n_elem), "Row::fixed: initialiser list is too long" ); eT* this_mem = (*this).memptr(); @@ -1533,7 +1524,7 @@ arma_inline Row& Row::fixed::operator=(const fixed& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(this != &X) { @@ -1557,7 +1548,7 @@ Row::fixed::operator=(const fixed& X) Row& Row::fixed::operator=(const eOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -1565,13 +1556,13 @@ Row::fixed::operator=(const fixed& X) if(bad_alias == false) { - arma_debug_assert_same_size(uword(1), fixed_n_elem, X.get_n_rows(), X.get_n_cols(), "Row::fixed::operator="); + arma_conform_assert_same_size(uword(1), fixed_n_elem, X.get_n_rows(), X.get_n_cols(), "Row::fixed::operator="); eop_type::apply(*this, X); } else { - arma_extra_debug_print("bad_alias = true"); + arma_debug_print("bad_alias = true"); Row tmp(X); @@ -1590,7 +1581,7 @@ Row::fixed::operator=(const fixed& X) Row& Row::fixed::operator=(const eGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); arma_type_check(( is_same_type< eT, typename T2::elem_type >::no )); @@ -1604,13 +1595,13 @@ Row::fixed::operator=(const fixed& X) if(bad_alias == false) { - arma_debug_assert_same_size(uword(1), fixed_n_elem, X.get_n_rows(), X.get_n_cols(), "Row::fixed::operator="); + arma_conform_assert_same_size(uword(1), fixed_n_elem, X.get_n_rows(), X.get_n_cols(), "Row::fixed::operator="); eglue_type::apply(*this, X); } else { - arma_extra_debug_print("bad_alias = true"); + arma_debug_print("bad_alias = true"); Row tmp(X); @@ -1728,7 +1719,7 @@ arma_inline eT& Row::fixed::operator() (const uword ii) { - arma_debug_check_bounds( (ii >= fixed_n_elem), "Row::operator(): index out of bounds" ); + arma_conform_check_bounds( (ii >= fixed_n_elem), "Row::operator(): index out of bounds" ); return (use_extra) ? mem_local_extra[ii] : Mat::mem_local[ii]; } @@ -1741,7 +1732,7 @@ arma_inline const eT& Row::fixed::operator() (const uword ii) const { - arma_debug_check_bounds( (ii >= fixed_n_elem), "Row::operator(): index out of bounds" ); + arma_conform_check_bounds( (ii >= fixed_n_elem), "Row::operator(): index out of bounds" ); return (use_extra) ? mem_local_extra[ii] : Mat::mem_local[ii]; } @@ -1776,7 +1767,7 @@ arma_inline eT& Row::fixed::operator() (const uword in_row, const uword in_col) { - arma_debug_check_bounds( ((in_row > 0) || (in_col >= fixed_n_elem)), "Row::operator(): index out of bounds" ); + arma_conform_check_bounds( ((in_row > 0) || (in_col >= fixed_n_elem)), "Row::operator(): index out of bounds" ); return (use_extra) ? mem_local_extra[in_col] : Mat::mem_local[in_col]; } @@ -1789,7 +1780,7 @@ arma_inline const eT& Row::fixed::operator() (const uword in_row, const uword in_col) const { - arma_debug_check_bounds( ((in_row > 0) || (in_col >= fixed_n_elem)), "Row::operator(): index out of bounds" ); + arma_conform_check_bounds( ((in_row > 0) || (in_col >= fixed_n_elem)), "Row::operator(): index out of bounds" ); return (use_extra) ? mem_local_extra[in_col] : Mat::mem_local[in_col]; } @@ -1824,7 +1815,7 @@ inline const Row& Row::fixed::fill(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eT* mem_use = (use_extra) ? &(mem_local_extra[0]) : &(Mat::mem_local[0]); @@ -1841,7 +1832,7 @@ inline const Row& Row::fixed::zeros() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eT* mem_use = (use_extra) ? &(mem_local_extra[0]) : &(Mat::mem_local[0]); @@ -1858,7 +1849,7 @@ inline const Row& Row::fixed::ones() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eT* mem_use = (use_extra) ? &(mem_local_extra[0]) : &(Mat::mem_local[0]); @@ -1874,7 +1865,7 @@ inline Row::Row(const arma_fixed_indicator&, const uword in_n_elem, const eT* in_mem) : Mat(arma_fixed_indicator(), 1, in_n_elem, 2, in_mem) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } diff --git a/inst/include/armadillo_bits/SizeCube_meat.hpp b/inst/include/armadillo_bits/SizeCube_meat.hpp index 8354ca12..e54540e5 100644 --- a/inst/include/armadillo_bits/SizeCube_meat.hpp +++ b/inst/include/armadillo_bits/SizeCube_meat.hpp @@ -27,7 +27,7 @@ SizeCube::SizeCube(const uword in_n_rows, const uword in_n_cols, const uword in_ , n_cols (in_n_cols ) , n_slices(in_n_slices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -53,7 +53,7 @@ SizeCube::operator()(const uword dim) const if(dim == 1) { return n_cols; } if(dim == 2) { return n_slices; } - arma_debug_check_bounds(true, "size(): index out of bounds"); + arma_conform_check_bounds(true, "size(): index out of bounds"); return uword(1); } diff --git a/inst/include/armadillo_bits/SizeMat_meat.hpp b/inst/include/armadillo_bits/SizeMat_meat.hpp index e00fd4f0..f6f21dda 100644 --- a/inst/include/armadillo_bits/SizeMat_meat.hpp +++ b/inst/include/armadillo_bits/SizeMat_meat.hpp @@ -26,7 +26,7 @@ SizeMat::SizeMat(const uword in_n_rows, const uword in_n_cols) : n_rows(in_n_rows) , n_cols(in_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -50,7 +50,7 @@ SizeMat::operator()(const uword dim) const if(dim == 0) { return n_rows; } if(dim == 1) { return n_cols; } - arma_debug_check_bounds(true, "size(): index out of bounds"); + arma_conform_check_bounds(true, "size(): index out of bounds"); return uword(1); } diff --git a/inst/include/armadillo_bits/SpBase_meat.hpp b/inst/include/armadillo_bits/SpBase_meat.hpp index 4ebc4243..b8ba23e5 100644 --- a/inst/include/armadillo_bits/SpBase_meat.hpp +++ b/inst/include/armadillo_bits/SpBase_meat.hpp @@ -75,7 +75,7 @@ inline void SpBase::print(const std::string extra_text) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat tmp( (*this).get_ref() ); @@ -98,7 +98,7 @@ inline void SpBase::print(std::ostream& user_stream, const std::string extra_text) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat tmp( (*this).get_ref() ); @@ -121,7 +121,7 @@ inline void SpBase::raw_print(const std::string extra_text) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat tmp( (*this).get_ref() ); @@ -144,7 +144,7 @@ inline void SpBase::raw_print(std::ostream& user_stream, const std::string extra_text) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat tmp( (*this).get_ref() ); @@ -167,7 +167,7 @@ inline void SpBase::print_dense(const std::string extra_text) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat tmp( (*this).get_ref() ); @@ -190,7 +190,7 @@ inline void SpBase::print_dense(std::ostream& user_stream, const std::string extra_text) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat tmp( (*this).get_ref() ); @@ -213,7 +213,7 @@ inline void SpBase::raw_print_dense(const std::string extra_text) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat tmp( (*this).get_ref() ); @@ -236,7 +236,7 @@ inline void SpBase::raw_print_dense(std::ostream& user_stream, const std::string extra_text) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat tmp( (*this).get_ref() ); @@ -259,7 +259,7 @@ inline void SpBase::brief_print(const std::string extra_text) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat tmp( (*this).get_ref() ); @@ -282,7 +282,7 @@ inline void SpBase::brief_print(std::ostream& user_stream, const std::string extra_text) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat tmp( (*this).get_ref() ); @@ -308,7 +308,7 @@ inline const derived& SpBase_eval_SpMat::eval() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return static_cast(*this); } @@ -323,7 +323,7 @@ inline SpMat SpBase_eval_expr::eval() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpMat( static_cast(*this) ); } @@ -335,7 +335,7 @@ inline elem_type SpBase::min() const { - return spop_min::min( (*this).get_ref() ); + return op_sp_min::min( (*this).get_ref() ); } @@ -345,7 +345,7 @@ inline elem_type SpBase::max() const { - return spop_max::max( (*this).get_ref() ); + return op_sp_max::max( (*this).get_ref() ); } @@ -357,7 +357,7 @@ SpBase::min(uword& index_of_min_val) const { const SpProxy P( (*this).get_ref() ); - return spop_min::min_with_index(P, index_of_min_val); + return op_sp_min::min_with_index(P, index_of_min_val); } @@ -369,7 +369,7 @@ SpBase::max(uword& index_of_max_val) const { const SpProxy P( (*this).get_ref() ); - return spop_max::max_with_index(P, index_of_max_val); + return op_sp_max::max_with_index(P, index_of_max_val); } @@ -383,7 +383,7 @@ SpBase::min(uword& row_of_min_val, uword& col_of_min_val) co uword index = 0; - const elem_type val = spop_min::min_with_index(P, index); + const elem_type val = op_sp_min::min_with_index(P, index); const uword local_n_rows = P.get_n_rows(); @@ -404,7 +404,7 @@ SpBase::max(uword& row_of_max_val, uword& col_of_max_val) co uword index = 0; - const elem_type val = spop_max::max_with_index(P, index); + const elem_type val = op_sp_max::max_with_index(P, index); const uword local_n_rows = P.get_n_rows(); @@ -427,11 +427,11 @@ SpBase::index_min() const if(P.get_n_elem() == 0) { - arma_debug_check(true, "index_min(): object has no elements"); + arma_conform_check(true, "index_min(): object has no elements"); } else { - spop_min::min_with_index(P, index); + op_sp_min::min_with_index(P, index); } return index; @@ -450,11 +450,11 @@ SpBase::index_max() const if(P.get_n_elem() == 0) { - arma_debug_check(true, "index_max(): object has no elements"); + arma_conform_check(true, "index_max(): object has no elements"); } else { - spop_max::max_with_index(P, index); + op_sp_max::max_with_index(P, index); } return index; @@ -467,7 +467,7 @@ inline bool SpBase::is_symmetric() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat tmp( (*this).get_ref() ); @@ -481,7 +481,7 @@ inline bool SpBase::is_symmetric(const typename get_pod_type::result tol) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat tmp( (*this).get_ref() ); @@ -495,7 +495,7 @@ inline bool SpBase::is_hermitian() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat tmp( (*this).get_ref() ); @@ -509,7 +509,7 @@ inline bool SpBase::is_hermitian(const typename get_pod_type::result tol) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat tmp( (*this).get_ref() ); @@ -523,11 +523,11 @@ inline bool SpBase::is_zero(const typename get_pod_type::result tol) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; - arma_debug_check( (tol < T(0)), "is_zero(): parameter 'tol' must be >= 0" ); + arma_conform_check( (tol < T(0)), "is_zero(): parameter 'tol' must be >= 0" ); const SpProxy P( (*this).get_ref() ); @@ -580,7 +580,7 @@ inline bool SpBase::is_trimatu() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy P( (*this).get_ref() ); @@ -605,7 +605,7 @@ inline bool SpBase::is_trimatl() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy P( (*this).get_ref() ); @@ -630,7 +630,7 @@ inline bool SpBase::is_diagmat() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy P( (*this).get_ref() ); @@ -653,7 +653,7 @@ inline bool SpBase::is_empty() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy P( (*this).get_ref() ); @@ -667,7 +667,7 @@ inline bool SpBase::is_square() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy P( (*this).get_ref() ); @@ -681,7 +681,7 @@ inline bool SpBase::is_vec() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if( (SpProxy::is_row) || (SpProxy::is_col) || (SpProxy::is_xvec) ) { return true; } @@ -697,7 +697,7 @@ inline bool SpBase::is_colvec() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(SpProxy::is_col) { return true; } @@ -713,7 +713,7 @@ inline bool SpBase::is_rowvec() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(SpProxy::is_row) { return true; } @@ -729,9 +729,9 @@ inline bool SpBase::is_finite() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "is_finite(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_conform_warn(1, "is_finite(): detection of non-finite values is not reliable in fast math mode"); } if(is_SpMat::stored_type>::value) { @@ -763,9 +763,9 @@ inline bool SpBase::has_inf() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "has_inf(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_inf(): detection of non-finite values is not reliable in fast math mode"); } if(is_SpMat::stored_type>::value) { @@ -797,9 +797,9 @@ inline bool SpBase::has_nan() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "has_nan(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_nan(): detection of non-finite values is not reliable in fast math mode"); } if(is_SpMat::stored_type>::value) { @@ -831,9 +831,9 @@ inline bool SpBase::has_nonfinite() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "has_nonfinite(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_nonfinite(): detection of non-finite values is not reliable in fast math mode"); } if(is_SpMat::stored_type>::value) { diff --git a/inst/include/armadillo_bits/SpCol_meat.hpp b/inst/include/armadillo_bits/SpCol_meat.hpp index 9b3c824e..58806d94 100644 --- a/inst/include/armadillo_bits/SpCol_meat.hpp +++ b/inst/include/armadillo_bits/SpCol_meat.hpp @@ -26,7 +26,7 @@ inline SpCol::SpCol() : SpMat(arma_vec_indicator(), 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -36,7 +36,7 @@ inline SpCol::SpCol(const uword in_n_elem) : SpMat(arma_vec_indicator(), in_n_elem, 1, 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -46,7 +46,7 @@ inline SpCol::SpCol(const uword in_n_rows, const uword in_n_cols) : SpMat(arma_vec_indicator(), in_n_rows, in_n_cols, 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -56,7 +56,7 @@ inline SpCol::SpCol(const SizeMat& s) : SpMat(arma_vec_indicator(), 0, 0, 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat::init(s.n_rows, s.n_cols); } @@ -68,7 +68,7 @@ inline SpCol::SpCol(const char* text) : SpMat(arma_vec_indicator(), 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat::init(std::string(text)); } @@ -80,7 +80,7 @@ inline SpCol& SpCol::operator=(const char* text) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat::init(std::string(text)); @@ -94,7 +94,7 @@ inline SpCol::SpCol(const std::string& text) : SpMat(arma_vec_indicator(), 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat::init(text); } @@ -106,7 +106,7 @@ inline SpCol& SpCol::operator=(const std::string& text) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat::init(text); @@ -120,7 +120,7 @@ inline SpCol& SpCol::operator=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat::operator=(val); @@ -135,7 +135,7 @@ inline SpCol::SpCol(const Base& X) : SpMat(arma_vec_indicator(), 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat::operator=(X.get_ref()); } @@ -148,7 +148,7 @@ inline SpCol& SpCol::operator=(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat::operator=(X.get_ref()); @@ -163,7 +163,7 @@ inline SpCol::SpCol(const SpBase& X) : SpMat(arma_vec_indicator(), 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat::operator=(X.get_ref()); } @@ -176,7 +176,7 @@ inline SpCol& SpCol::operator=(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat::operator=(X.get_ref()); @@ -195,7 +195,7 @@ SpCol::SpCol ) : SpMat(arma_vec_indicator(), 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat::init(A,B); } @@ -238,9 +238,9 @@ inline void SpCol::shed_row(const uword row_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( row_num >= SpMat::n_rows, "SpCol::shed_row(): out of bounds" ); + arma_conform_check_bounds( row_num >= SpMat::n_rows, "SpCol::shed_row(): out of bounds" ); shed_rows(row_num, row_num); } @@ -253,9 +253,9 @@ inline void SpCol::shed_rows(const uword in_row1, const uword in_row2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_row2 >= SpMat::n_rows), "SpCol::shed_rows(): indices out of bounds or incorrectly used" @@ -339,11 +339,11 @@ SpCol::shed_rows(const uword in_row1, const uword in_row2) // void // SpCol::insert_rows(const uword row_num, const uword N, const bool set_to_zero) // { -// arma_extra_debug_sigprint(); +// arma_debug_sigprint(); // -// arma_debug_check(set_to_zero == false, "SpCol::insert_rows(): cannot set nonzero values"); +// arma_conform_check(set_to_zero == false, "SpCol::insert_rows(): cannot set nonzero values"); // -// arma_debug_check_bounds((row_num > SpMat::n_rows), "SpCol::insert_rows(): out of bounds"); +// arma_conform_check_bounds((row_num > SpMat::n_rows), "SpCol::insert_rows(): out of bounds"); // // for(uword row = 0; row < SpMat::n_rows; ++row) // { @@ -364,9 +364,9 @@ inline typename SpCol::row_iterator SpCol::begin_row(const uword row_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (row_num >= SpMat::n_rows), "SpCol::begin_row(): index out of bounds" ); + arma_conform_check_bounds( (row_num >= SpMat::n_rows), "SpCol::begin_row(): index out of bounds" ); SpMat::sync_csc(); @@ -380,9 +380,9 @@ inline typename SpCol::const_row_iterator SpCol::begin_row(const uword row_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (row_num >= SpMat::n_rows), "SpCol::begin_row(): index out of bounds" ); + arma_conform_check_bounds( (row_num >= SpMat::n_rows), "SpCol::begin_row(): index out of bounds" ); SpMat::sync_csc(); @@ -396,9 +396,9 @@ inline typename SpCol::row_iterator SpCol::end_row(const uword row_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (row_num >= SpMat::n_rows), "SpCol::end_row(): index out of bounds" ); + arma_conform_check_bounds( (row_num >= SpMat::n_rows), "SpCol::end_row(): index out of bounds" ); SpMat::sync_csc(); @@ -412,9 +412,9 @@ inline typename SpCol::const_row_iterator SpCol::end_row(const uword row_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (row_num >= SpMat::n_rows), "SpCol::end_row(): index out of bounds" ); + arma_conform_check_bounds( (row_num >= SpMat::n_rows), "SpCol::end_row(): index out of bounds" ); SpMat::sync_csc(); diff --git a/inst/include/armadillo_bits/SpGlue_meat.hpp b/inst/include/armadillo_bits/SpGlue_meat.hpp index 04d40e1a..5cf5bbd2 100644 --- a/inst/include/armadillo_bits/SpGlue_meat.hpp +++ b/inst/include/armadillo_bits/SpGlue_meat.hpp @@ -27,7 +27,7 @@ SpGlue::SpGlue(const T1& in_A, const T2& in_B) : A(in_A) , B(in_B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -39,7 +39,7 @@ SpGlue::SpGlue(const T1& in_A, const T2& in_B, const typename , B(in_B) , aux(in_aux) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -48,7 +48,7 @@ template inline SpGlue::~SpGlue() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } diff --git a/inst/include/armadillo_bits/SpMat_bones.hpp b/inst/include/armadillo_bits/SpMat_bones.hpp index 9a91e8bf..73f00d2e 100644 --- a/inst/include/armadillo_bits/SpMat_bones.hpp +++ b/inst/include/armadillo_bits/SpMat_bones.hpp @@ -124,7 +124,7 @@ class SpMat : public SpBase< eT, SpMat > inline SpMat& operator%=(const SpMat& m); inline SpMat& operator/=(const SpMat& m); - template inline explicit SpMat(const Base& m); + template inline SpMat(const Base& m); template inline SpMat& operator= (const Base& m); template inline SpMat& operator+=(const Base& m); template inline SpMat& operator-=(const Base& m); @@ -132,7 +132,7 @@ class SpMat : public SpBase< eT, SpMat > template inline SpMat& operator/=(const Base& m); template inline SpMat& operator%=(const Base& m); - template inline explicit SpMat(const Op& expr); + template inline SpMat(const Op& expr); template inline SpMat& operator= (const Op& expr); template inline SpMat& operator+=(const Op& expr); template inline SpMat& operator-=(const Op& expr); @@ -140,8 +140,8 @@ class SpMat : public SpBase< eT, SpMat > template inline SpMat& operator/=(const Op& expr); template inline SpMat& operator%=(const Op& expr); - //! explicit specification of sparse +/- scalar - template inline explicit SpMat(const SpToDOp& expr); + // template inline SpMat(const SpToDOp< T1, op_type>& expr); + // template inline SpMat(const mtSpToDOp& expr); //! construction of complex matrix out of two non-complex matrices template @@ -695,7 +695,7 @@ class SpMat : public SpBase< eT, SpMat > // 1: CSC needs to be updated from cache (ie. cache has more recent data) // 2: no update required (ie. CSC and cache contain the same data) - #if (!defined(ARMA_DONT_USE_STD_MUTEX)) + #if defined(ARMA_USE_STD_MUTEX) arma_aligned mutable std::mutex cache_mutex; #endif diff --git a/inst/include/armadillo_bits/SpMat_meat.hpp b/inst/include/armadillo_bits/SpMat_meat.hpp index 247348d1..6ef8088a 100644 --- a/inst/include/armadillo_bits/SpMat_meat.hpp +++ b/inst/include/armadillo_bits/SpMat_meat.hpp @@ -35,7 +35,7 @@ SpMat::SpMat() , row_indices(nullptr) , col_ptrs(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(0,0); } @@ -49,7 +49,7 @@ template inline SpMat::~SpMat() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); if(values ) { memory::release(access::rw(values)); } if(row_indices) { memory::release(access::rw(row_indices)); } @@ -73,7 +73,7 @@ SpMat::SpMat(const uword in_rows, const uword in_cols) , row_indices(nullptr) , col_ptrs(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(in_rows, in_cols); } @@ -92,7 +92,7 @@ SpMat::SpMat(const SizeMat& s) , row_indices(nullptr) , col_ptrs(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(s.n_rows, s.n_cols); } @@ -111,7 +111,7 @@ SpMat::SpMat(const arma_reserve_indicator&, const uword in_rows, const uword , row_indices(nullptr) , col_ptrs(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(in_rows, in_cols, new_n_nonzero); } @@ -131,7 +131,7 @@ SpMat::SpMat(const arma_layout_indicator&, const SpMat& x) , row_indices(nullptr) , col_ptrs(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(x.n_rows, x.n_cols, x.n_nonzero); @@ -160,7 +160,7 @@ SpMat::SpMat(const char* text) , row_indices(nullptr) , col_ptrs(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init(std::string(text)); } @@ -172,7 +172,7 @@ inline SpMat& SpMat::operator=(const char* text) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init(std::string(text)); @@ -193,7 +193,7 @@ SpMat::SpMat(const std::string& text) , row_indices(nullptr) , col_ptrs(nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init(text); } @@ -205,7 +205,7 @@ inline SpMat& SpMat::operator=(const std::string& text) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init(text); @@ -226,7 +226,7 @@ SpMat::SpMat(const SpMat& x) , row_indices(nullptr) , col_ptrs(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init(x); } @@ -245,8 +245,8 @@ SpMat::SpMat(SpMat&& in_mat) , row_indices(nullptr) , col_ptrs(nullptr) { - arma_extra_debug_sigprint_this(this); - arma_extra_debug_sigprint(arma_str::format("this = %x in_mat = %x") % this % &in_mat); + arma_debug_sigprint_this(this); + arma_debug_sigprint(arma_str::format("this: %x; in_mat: %x") % this % &in_mat); (*this).steal_mem(in_mat); } @@ -258,7 +258,7 @@ inline SpMat& SpMat::operator=(SpMat&& in_mat) { - arma_extra_debug_sigprint(arma_str::format("this = %x in_mat = %x") % this % &in_mat); + arma_debug_sigprint(arma_str::format("this: %x; in_mat: %x") % this % &in_mat); (*this).steal_mem(in_mat); @@ -279,7 +279,7 @@ SpMat::SpMat(const MapMat& x) , row_indices(nullptr) , col_ptrs(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init(x); } @@ -291,7 +291,7 @@ inline SpMat& SpMat::operator=(const MapMat& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init(x); @@ -318,7 +318,7 @@ SpMat::SpMat(const Base& locations_expr, const Base& vals_e , row_indices(nullptr) , col_ptrs(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); const quasi_unwrap locs_tmp( locations_expr.get_ref() ); const quasi_unwrap vals_tmp( vals_expr.get_ref() ); @@ -326,9 +326,9 @@ SpMat::SpMat(const Base& locations_expr, const Base& vals_e const Mat& locs = locs_tmp.M; const Mat& vals = vals_tmp.M; - arma_debug_check( (vals.is_vec() == false), "SpMat::SpMat(): given 'values' object must be a vector" ); - arma_debug_check( (locs.n_rows != 2), "SpMat::SpMat(): locations matrix must have two rows" ); - arma_debug_check( (locs.n_cols != vals.n_elem), "SpMat::SpMat(): number of locations is different than number of values" ); + arma_conform_check( (vals.is_vec() == false), "SpMat::SpMat(): given 'values' object must be a vector" ); + arma_conform_check( (locs.n_rows != 2), "SpMat::SpMat(): locations matrix must have two rows" ); + arma_conform_check( (locs.n_cols != vals.n_elem), "SpMat::SpMat(): number of locations is different than number of values" ); // If there are no elements in the list, max() will fail. if(locs.n_cols == 0) { init_cold(0, 0); return; } @@ -391,7 +391,7 @@ SpMat::SpMat(const Base& locations_expr, const Base& vals_e , row_indices(nullptr) , col_ptrs(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); const quasi_unwrap locs_tmp( locations_expr.get_ref() ); const quasi_unwrap vals_tmp( vals_expr.get_ref() ); @@ -399,9 +399,9 @@ SpMat::SpMat(const Base& locations_expr, const Base& vals_e const Mat& locs = locs_tmp.M; const Mat& vals = vals_tmp.M; - arma_debug_check( (vals.is_vec() == false), "SpMat::SpMat(): given 'values' object must be a vector" ); - arma_debug_check( (locs.n_rows != 2), "SpMat::SpMat(): locations matrix must have two rows" ); - arma_debug_check( (locs.n_cols != vals.n_elem), "SpMat::SpMat(): number of locations is different than number of values" ); + arma_conform_check( (vals.is_vec() == false), "SpMat::SpMat(): given 'values' object must be a vector" ); + arma_conform_check( (locs.n_rows != 2), "SpMat::SpMat(): locations matrix must have two rows" ); + arma_conform_check( (locs.n_cols != vals.n_elem), "SpMat::SpMat(): number of locations is different than number of values" ); init_cold(in_n_rows, in_n_cols); @@ -460,7 +460,7 @@ SpMat::SpMat(const bool add_values, const Base& locations_expr, co , row_indices(nullptr) , col_ptrs(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); const quasi_unwrap locs_tmp( locations_expr.get_ref() ); const quasi_unwrap vals_tmp( vals_expr.get_ref() ); @@ -468,9 +468,9 @@ SpMat::SpMat(const bool add_values, const Base& locations_expr, co const Mat& locs = locs_tmp.M; const Mat& vals = vals_tmp.M; - arma_debug_check( (vals.is_vec() == false), "SpMat::SpMat(): given 'values' object must be a vector" ); - arma_debug_check( (locs.n_rows != 2), "SpMat::SpMat(): locations matrix must have two rows" ); - arma_debug_check( (locs.n_cols != vals.n_elem), "SpMat::SpMat(): number of locations is different than number of values" ); + arma_conform_check( (vals.is_vec() == false), "SpMat::SpMat(): given 'values' object must be a vector" ); + arma_conform_check( (locs.n_rows != 2), "SpMat::SpMat(): locations matrix must have two rows" ); + arma_conform_check( (locs.n_cols != vals.n_elem), "SpMat::SpMat(): number of locations is different than number of values" ); init_cold(in_n_rows, in_n_cols); @@ -544,7 +544,7 @@ SpMat::SpMat , row_indices(nullptr) , col_ptrs(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); const quasi_unwrap rowind_tmp( rowind_expr.get_ref() ); const quasi_unwrap colptr_tmp( colptr_expr.get_ref() ); @@ -554,15 +554,15 @@ SpMat::SpMat const Mat& colptr = colptr_tmp.M; const Mat& vals = vals_tmp.M; - arma_debug_check( (rowind.is_vec() == false), "SpMat::SpMat(): given 'rowind' object must be a vector" ); - arma_debug_check( (colptr.is_vec() == false), "SpMat::SpMat(): given 'colptr' object must be a vector" ); - arma_debug_check( (vals.is_vec() == false), "SpMat::SpMat(): given 'values' object must be a vector" ); + arma_conform_check( (rowind.is_vec() == false), "SpMat::SpMat(): given 'rowind' object must be a vector" ); + arma_conform_check( (colptr.is_vec() == false), "SpMat::SpMat(): given 'colptr' object must be a vector" ); + arma_conform_check( (vals.is_vec() == false), "SpMat::SpMat(): given 'values' object must be a vector" ); // Resize to correct number of elements (this also sets n_nonzero) init_cold(in_n_rows, in_n_cols, vals.n_elem); - arma_debug_check( (rowind.n_elem != vals.n_elem), "SpMat::SpMat(): number of row indices is not equal to number of values" ); - arma_debug_check( (colptr.n_elem != (n_cols+1) ), "SpMat::SpMat(): number of column pointers is not equal to n_cols+1" ); + arma_conform_check( (rowind.n_elem != vals.n_elem), "SpMat::SpMat(): number of row indices is not equal to number of values" ); + arma_conform_check( (colptr.n_elem != (n_cols+1) ), "SpMat::SpMat(): number of column pointers is not equal to n_cols+1" ); // copy supplied values into sparse matrix -- not checked for consistency arrayops::copy(access::rwp(row_indices), rowind.memptr(), rowind.n_elem ); @@ -583,7 +583,7 @@ inline SpMat& SpMat::operator=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(val != eT(0)) { @@ -610,7 +610,7 @@ inline SpMat& SpMat::operator*=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(val != eT(0)) { @@ -649,9 +649,9 @@ inline SpMat& SpMat::operator/=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (val == eT(0)), "element-wise division: division by zero" ); + arma_conform_check( (val == eT(0)), "element-wise division: division by zero" ); sync_csc(); invalidate_cache(); @@ -683,7 +683,7 @@ inline SpMat& SpMat::operator=(const SpMat& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init(x); @@ -697,7 +697,7 @@ inline SpMat& SpMat::operator+=(const SpMat& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -715,7 +715,7 @@ inline SpMat& SpMat::operator-=(const SpMat& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -733,7 +733,7 @@ inline SpMat& SpMat::operator*=(const SpMat& y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -752,7 +752,7 @@ inline SpMat& SpMat::operator%=(const SpMat& y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -770,11 +770,11 @@ inline SpMat& SpMat::operator/=(const SpMat& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: use of this function is not advised; it is implemented only for completeness - arma_debug_assert_same_size(n_rows, n_cols, x.n_rows, x.n_cols, "element-wise division"); + arma_conform_assert_same_size(n_rows, n_cols, x.n_rows, x.n_cols, "element-wise division"); for(uword c = 0; c < n_cols; ++c) for(uword r = 0; r < n_rows; ++r) @@ -787,28 +787,45 @@ SpMat::operator/=(const SpMat& x) -template -template -inline -SpMat::SpMat(const SpToDOp& expr) - : n_rows(0) - , n_cols(0) - , n_elem(0) - , n_nonzero(0) - , vec_state(0) - , values(nullptr) - , row_indices(nullptr) - , col_ptrs(nullptr) - { - arma_extra_debug_sigprint_this(this); - - typedef typename T1::elem_type T; - - // Make sure the type is compatible. - arma_type_check(( is_same_type< eT, T >::no )); - - op_type::apply(*this, expr); - } +// template +// template +// inline +// SpMat::SpMat(const SpToDOp& expr) +// : n_rows(0) +// , n_cols(0) +// , n_elem(0) +// , n_nonzero(0) +// , vec_state(0) +// , values(nullptr) +// , row_indices(nullptr) +// , col_ptrs(nullptr) +// { +// arma_debug_sigprint_this(this); +// +// arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); +// +// (*this) = Mat(expr); +// } + + + +// template +// template +// inline +// SpMat::SpMat(const mtSpToDOp& expr) +// : n_rows(0) +// , n_cols(0) +// , n_elem(0) +// , n_nonzero(0) +// , vec_state(0) +// , values(nullptr) +// , row_indices(nullptr) +// , col_ptrs(nullptr) +// { +// arma_debug_sigprint_this(this); +// +// (*this) = Mat(expr); +// } @@ -830,7 +847,7 @@ SpMat::SpMat , row_indices(nullptr) , col_ptrs(nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type T; @@ -847,7 +864,7 @@ SpMat::SpMat const SpMat& X = tmp1.M; const SpMat& Y = tmp2.M; - arma_debug_assert_same_size(X.n_rows, X.n_cols, Y.n_rows, Y.n_cols, "SpMat()"); + arma_conform_assert_same_size(X.n_rows, X.n_cols, Y.n_rows, Y.n_cols, "SpMat()"); const uword l_n_rows = X.n_rows; const uword l_n_cols = X.n_cols; @@ -921,7 +938,7 @@ SpMat::SpMat(const Base& x) , row_indices(nullptr) , col_ptrs(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); (*this).operator=(x); } @@ -934,7 +951,7 @@ inline SpMat& SpMat::operator=(const Base& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(is_same_type< T1, Gen, gen_zeros> >::yes) { @@ -1005,7 +1022,7 @@ inline SpMat& SpMat::operator+=(const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -1020,7 +1037,7 @@ inline SpMat& SpMat::operator-=(const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -1035,7 +1052,7 @@ inline SpMat& SpMat::operator*=(const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -1051,7 +1068,7 @@ inline SpMat& SpMat::operator/=(const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -1070,12 +1087,12 @@ inline SpMat& SpMat::operator%=(const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap U(x.get_ref()); const Mat& B = U.M; - arma_debug_assert_same_size(n_rows, n_cols, B.n_rows, B.n_cols, "element-wise multiplication"); + arma_conform_assert_same_size(n_rows, n_cols, B.n_rows, B.n_cols, "element-wise multiplication"); sync_csc(); invalidate_cache(); @@ -1123,8 +1140,10 @@ SpMat::SpMat(const Op& expr) , row_indices(nullptr) , col_ptrs(nullptr) { - arma_extra_debug_sigprint_this(this); - + arma_debug_sigprint_this(this); + + arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); + (*this).operator=(expr); } @@ -1136,7 +1155,9 @@ inline SpMat& SpMat::operator=(const Op& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); + + arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); const diagmat_proxy P(expr.m); @@ -1182,7 +1203,9 @@ inline SpMat& SpMat::operator+=(const Op& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); + + arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); const SpMat tmp(expr); @@ -1197,7 +1220,9 @@ inline SpMat& SpMat::operator-=(const Op& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); + + arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); const SpMat tmp(expr); @@ -1212,7 +1237,9 @@ inline SpMat& SpMat::operator*=(const Op& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); + + arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); const SpMat tmp(expr); @@ -1227,7 +1254,9 @@ inline SpMat& SpMat::operator/=(const Op& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); + + arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); const SpMat tmp(expr); @@ -1242,7 +1271,9 @@ inline SpMat& SpMat::operator%=(const Op& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); + + arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); const SpMat tmp(expr); @@ -1266,7 +1297,7 @@ SpMat::SpMat(const SpSubview& X) , row_indices(nullptr) , col_ptrs(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); (*this).operator=(X); } @@ -1278,7 +1309,7 @@ inline SpMat& SpMat::operator=(const SpSubview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(X.n_nonzero == 0) { zeros(X.n_rows, X.n_cols); return *this; } @@ -1352,7 +1383,7 @@ inline SpMat& SpMat::operator+=(const SpSubview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -1370,7 +1401,7 @@ inline SpMat& SpMat::operator-=(const SpSubview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -1388,7 +1419,7 @@ inline SpMat& SpMat::operator*=(const SpSubview& y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -1406,7 +1437,7 @@ inline SpMat& SpMat::operator%=(const SpSubview& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -1424,9 +1455,9 @@ inline SpMat& SpMat::operator/=(const SpSubview& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(n_rows, n_cols, x.n_rows, x.n_cols, "element-wise division"); + arma_conform_assert_same_size(n_rows, n_cols, x.n_rows, x.n_cols, "element-wise division"); // There is no pretty way to do this. for(uword elem = 0; elem < n_elem; elem++) @@ -1452,7 +1483,7 @@ SpMat::SpMat(const SpSubview_col_list& X) , row_indices(nullptr) , col_ptrs(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); SpSubview_col_list::extract(*this, X); } @@ -1465,7 +1496,7 @@ inline SpMat& SpMat::operator=(const SpSubview_col_list& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool alias = (this == &(X.m)); @@ -1491,7 +1522,7 @@ inline SpMat& SpMat::operator+=(const SpSubview_col_list& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpSubview_col_list::plus_inplace(*this, X); @@ -1506,7 +1537,7 @@ inline SpMat& SpMat::operator-=(const SpSubview_col_list& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpSubview_col_list::minus_inplace(*this, X); @@ -1521,7 +1552,7 @@ inline SpMat& SpMat::operator*=(const SpSubview_col_list& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -1540,7 +1571,7 @@ inline SpMat& SpMat::operator%=(const SpSubview_col_list& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpSubview_col_list::schur_inplace(*this, X); @@ -1555,7 +1586,7 @@ inline SpMat& SpMat::operator/=(const SpSubview_col_list& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpSubview_col_list::div_inplace(*this, X); @@ -1576,7 +1607,7 @@ SpMat::SpMat(const spdiagview& X) , row_indices(nullptr) , col_ptrs(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); spdiagview::extract(*this, X); } @@ -1588,7 +1619,7 @@ inline SpMat& SpMat::operator=(const spdiagview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); spdiagview::extract(*this, X); @@ -1602,7 +1633,7 @@ inline SpMat& SpMat::operator+=(const spdiagview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpMat tmp(X); @@ -1616,7 +1647,7 @@ inline SpMat& SpMat::operator-=(const spdiagview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpMat tmp(X); @@ -1630,7 +1661,7 @@ inline SpMat& SpMat::operator*=(const spdiagview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpMat tmp(X); @@ -1644,7 +1675,7 @@ inline SpMat& SpMat::operator%=(const spdiagview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpMat tmp(X); @@ -1658,7 +1689,7 @@ inline SpMat& SpMat::operator/=(const spdiagview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpMat tmp(X); @@ -1680,7 +1711,7 @@ SpMat::SpMat(const SpOp& X) , row_indices(nullptr) , col_ptrs(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -1698,7 +1729,7 @@ inline SpMat& SpMat::operator=(const SpOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -1718,7 +1749,7 @@ inline SpMat& SpMat::operator+=(const SpOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -1737,7 +1768,7 @@ inline SpMat& SpMat::operator-=(const SpOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -1756,7 +1787,7 @@ inline SpMat& SpMat::operator*=(const SpOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -1775,7 +1806,7 @@ inline SpMat& SpMat::operator%=(const SpOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -1794,7 +1825,7 @@ inline SpMat& SpMat::operator/=(const SpOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -1820,7 +1851,7 @@ SpMat::SpMat(const SpGlue& X) , row_indices(nullptr) , col_ptrs(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -1838,7 +1869,7 @@ inline SpMat& SpMat::operator=(const SpGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -1858,7 +1889,7 @@ inline SpMat& SpMat::operator+=(const SpGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -1877,7 +1908,7 @@ inline SpMat& SpMat::operator-=(const SpGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -1896,7 +1927,7 @@ inline SpMat& SpMat::operator*=(const SpGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -1915,7 +1946,7 @@ inline SpMat& SpMat::operator%=(const SpGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -1934,7 +1965,7 @@ inline SpMat& SpMat::operator/=(const SpGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); @@ -1960,7 +1991,7 @@ SpMat::SpMat(const mtSpOp& X) , row_indices(nullptr) , col_ptrs(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); spop_type::apply(*this, X); @@ -1976,7 +2007,7 @@ inline SpMat& SpMat::operator=(const mtSpOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); spop_type::apply(*this, X); @@ -1994,7 +2025,7 @@ inline SpMat& SpMat::operator+=(const mtSpOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -2011,7 +2042,7 @@ inline SpMat& SpMat::operator-=(const mtSpOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -2028,7 +2059,7 @@ inline SpMat& SpMat::operator*=(const mtSpOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -2045,7 +2076,7 @@ inline SpMat& SpMat::operator%=(const mtSpOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -2062,7 +2093,7 @@ inline SpMat& SpMat::operator/=(const mtSpOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -2086,7 +2117,7 @@ SpMat::SpMat(const mtSpGlue& X) , row_indices(nullptr) , col_ptrs(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); spglue_type::apply(*this, X); @@ -2102,7 +2133,7 @@ inline SpMat& SpMat::operator=(const mtSpGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); spglue_type::apply(*this, X); @@ -2120,7 +2151,7 @@ inline SpMat& SpMat::operator+=(const mtSpGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -2137,7 +2168,7 @@ inline SpMat& SpMat::operator-=(const mtSpGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -2154,7 +2185,7 @@ inline SpMat& SpMat::operator*=(const mtSpGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -2171,7 +2202,7 @@ inline SpMat& SpMat::operator%=(const mtSpGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -2188,7 +2219,7 @@ inline SpMat& SpMat::operator/=(const mtSpGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -2204,9 +2235,9 @@ arma_inline SpSubview_row SpMat::row(const uword row_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds(row_num >= n_rows, "SpMat::row(): out of bounds"); + arma_conform_check_bounds(row_num >= n_rows, "SpMat::row(): out of bounds"); return SpSubview_row(*this, row_num); } @@ -2218,9 +2249,9 @@ arma_inline const SpSubview_row SpMat::row(const uword row_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds(row_num >= n_rows, "SpMat::row(): out of bounds"); + arma_conform_check_bounds(row_num >= n_rows, "SpMat::row(): out of bounds"); return SpSubview_row(*this, row_num); } @@ -2232,7 +2263,7 @@ inline SpSubview_row SpMat::operator()(const uword row_num, const span& col_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool col_all = col_span.whole; @@ -2242,7 +2273,7 @@ SpMat::operator()(const uword row_num, const span& col_span) const uword in_col2 = col_span.b; const uword submat_n_cols = col_all ? local_n_cols : in_col2 - in_col1 + 1; - arma_debug_check_bounds + arma_conform_check_bounds ( (row_num >= n_rows) || @@ -2261,7 +2292,7 @@ inline const SpSubview_row SpMat::operator()(const uword row_num, const span& col_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool col_all = col_span.whole; @@ -2271,7 +2302,7 @@ SpMat::operator()(const uword row_num, const span& col_span) const const uword in_col2 = col_span.b; const uword submat_n_cols = col_all ? local_n_cols : in_col2 - in_col1 + 1; - arma_debug_check_bounds + arma_conform_check_bounds ( (row_num >= n_rows) || @@ -2290,9 +2321,9 @@ arma_inline SpSubview_col SpMat::col(const uword col_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds(col_num >= n_cols, "SpMat::col(): out of bounds"); + arma_conform_check_bounds(col_num >= n_cols, "SpMat::col(): out of bounds"); return SpSubview_col(*this, col_num); } @@ -2304,9 +2335,9 @@ arma_inline const SpSubview_col SpMat::col(const uword col_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds(col_num >= n_cols, "SpMat::col(): out of bounds"); + arma_conform_check_bounds(col_num >= n_cols, "SpMat::col(): out of bounds"); return SpSubview_col(*this, col_num); } @@ -2318,7 +2349,7 @@ inline SpSubview_col SpMat::operator()(const span& row_span, const uword col_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool row_all = row_span.whole; @@ -2328,7 +2359,7 @@ SpMat::operator()(const span& row_span, const uword col_num) const uword in_row2 = row_span.b; const uword submat_n_rows = row_all ? local_n_rows : in_row2 - in_row1 + 1; - arma_debug_check_bounds + arma_conform_check_bounds ( (col_num >= n_cols) || @@ -2347,7 +2378,7 @@ inline const SpSubview_col SpMat::operator()(const span& row_span, const uword col_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool row_all = row_span.whole; @@ -2357,7 +2388,7 @@ SpMat::operator()(const span& row_span, const uword col_num) const const uword in_row2 = row_span.b; const uword submat_n_rows = row_all ? local_n_rows : in_row2 - in_row1 + 1; - arma_debug_check_bounds + arma_conform_check_bounds ( (col_num >= n_cols) || @@ -2376,9 +2407,9 @@ arma_inline SpSubview SpMat::rows(const uword in_row1, const uword in_row2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_row2 >= n_rows), "SpMat::rows(): indices out of bounds or incorrectly used" @@ -2396,9 +2427,9 @@ arma_inline const SpSubview SpMat::rows(const uword in_row1, const uword in_row2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_row2 >= n_rows), "SpMat::rows(): indices out of bounds or incorrectly used" @@ -2416,9 +2447,9 @@ arma_inline SpSubview SpMat::cols(const uword in_col1, const uword in_col2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_col1 > in_col2) || (in_col2 >= n_cols), "SpMat::cols(): indices out of bounds or incorrectly used" @@ -2436,9 +2467,9 @@ arma_inline const SpSubview SpMat::cols(const uword in_col1, const uword in_col2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_col1 > in_col2) || (in_col2 >= n_cols), "SpMat::cols(): indices out of bounds or incorrectly used" @@ -2456,9 +2487,9 @@ arma_inline SpSubview SpMat::submat(const uword in_row1, const uword in_col1, const uword in_row2, const uword in_col2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols), "SpMat::submat(): indices out of bounds or incorrectly used" @@ -2477,9 +2508,9 @@ arma_inline const SpSubview SpMat::submat(const uword in_row1, const uword in_col1, const uword in_row2, const uword in_col2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols), "SpMat::submat(): indices out of bounds or incorrectly used" @@ -2498,7 +2529,7 @@ arma_inline SpSubview SpMat::submat(const uword in_row1, const uword in_col1, const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword l_n_rows = n_rows; const uword l_n_cols = n_cols; @@ -2506,7 +2537,7 @@ SpMat::submat(const uword in_row1, const uword in_col1, const SizeMat& s) const uword s_n_rows = s.n_rows; const uword s_n_cols = s.n_cols; - arma_debug_check_bounds + arma_conform_check_bounds ( ((in_row1 >= l_n_rows) || (in_col1 >= l_n_cols) || ((in_row1 + s_n_rows) > l_n_rows) || ((in_col1 + s_n_cols) > l_n_cols)), "SpMat::submat(): indices or size out of bounds" @@ -2522,7 +2553,7 @@ arma_inline const SpSubview SpMat::submat(const uword in_row1, const uword in_col1, const SizeMat& s) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword l_n_rows = n_rows; const uword l_n_cols = n_cols; @@ -2530,7 +2561,7 @@ SpMat::submat(const uword in_row1, const uword in_col1, const SizeMat& s) co const uword s_n_rows = s.n_rows; const uword s_n_cols = s.n_cols; - arma_debug_check_bounds + arma_conform_check_bounds ( ((in_row1 >= l_n_rows) || (in_col1 >= l_n_cols) || ((in_row1 + s_n_rows) > l_n_rows) || ((in_col1 + s_n_cols) > l_n_cols)), "SpMat::submat(): indices or size out of bounds" @@ -2546,7 +2577,7 @@ inline SpSubview SpMat::submat(const span& row_span, const span& col_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool row_all = row_span.whole; const bool col_all = col_span.whole; @@ -2562,7 +2593,7 @@ SpMat::submat(const span& row_span, const span& col_span) const uword in_col2 = col_span.b; const uword submat_n_cols = col_all ? local_n_cols : in_col2 - in_col1 + 1; - arma_debug_check_bounds + arma_conform_check_bounds ( ( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= local_n_rows)) ) || @@ -2581,7 +2612,7 @@ inline const SpSubview SpMat::submat(const span& row_span, const span& col_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool row_all = row_span.whole; const bool col_all = col_span.whole; @@ -2597,7 +2628,7 @@ SpMat::submat(const span& row_span, const span& col_span) const const uword in_col2 = col_span.b; const uword submat_n_cols = col_all ? local_n_cols : in_col2 - in_col1 + 1; - arma_debug_check_bounds + arma_conform_check_bounds ( ( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= local_n_rows)) ) || @@ -2616,7 +2647,7 @@ inline SpSubview SpMat::operator()(const span& row_span, const span& col_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return submat(row_span, col_span); } @@ -2628,7 +2659,7 @@ inline const SpSubview SpMat::operator()(const span& row_span, const span& col_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return submat(row_span, col_span); } @@ -2640,7 +2671,7 @@ arma_inline SpSubview SpMat::operator()(const uword in_row1, const uword in_col1, const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).submat(in_row1, in_col1, s); } @@ -2652,7 +2683,7 @@ arma_inline const SpSubview SpMat::operator()(const uword in_row1, const uword in_col1, const SizeMat& s) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).submat(in_row1, in_col1, s); } @@ -2664,9 +2695,9 @@ inline SpSubview SpMat::head_rows(const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > n_rows), "SpMat::head_rows(): size out of bounds" ); + arma_conform_check_bounds( (N > n_rows), "SpMat::head_rows(): size out of bounds" ); return SpSubview(*this, 0, 0, N, n_cols); } @@ -2678,9 +2709,9 @@ inline const SpSubview SpMat::head_rows(const uword N) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > n_rows), "SpMat::head_rows(): size out of bounds" ); + arma_conform_check_bounds( (N > n_rows), "SpMat::head_rows(): size out of bounds" ); return SpSubview(*this, 0, 0, N, n_cols); } @@ -2692,9 +2723,9 @@ inline SpSubview SpMat::tail_rows(const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > n_rows), "SpMat::tail_rows(): size out of bounds" ); + arma_conform_check_bounds( (N > n_rows), "SpMat::tail_rows(): size out of bounds" ); const uword start_row = n_rows - N; @@ -2708,9 +2739,9 @@ inline const SpSubview SpMat::tail_rows(const uword N) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > n_rows), "SpMat::tail_rows(): size out of bounds" ); + arma_conform_check_bounds( (N > n_rows), "SpMat::tail_rows(): size out of bounds" ); const uword start_row = n_rows - N; @@ -2724,9 +2755,9 @@ inline SpSubview SpMat::head_cols(const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > n_cols), "SpMat::head_cols(): size out of bounds" ); + arma_conform_check_bounds( (N > n_cols), "SpMat::head_cols(): size out of bounds" ); return SpSubview(*this, 0, 0, n_rows, N); } @@ -2738,9 +2769,9 @@ inline const SpSubview SpMat::head_cols(const uword N) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > n_cols), "SpMat::head_cols(): size out of bounds" ); + arma_conform_check_bounds( (N > n_cols), "SpMat::head_cols(): size out of bounds" ); return SpSubview(*this, 0, 0, n_rows, N); } @@ -2752,9 +2783,9 @@ inline SpSubview SpMat::tail_cols(const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > n_cols), "SpMat::tail_cols(): size out of bounds" ); + arma_conform_check_bounds( (N > n_cols), "SpMat::tail_cols(): size out of bounds" ); const uword start_col = n_cols - N; @@ -2768,9 +2799,9 @@ inline const SpSubview SpMat::tail_cols(const uword N) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > n_cols), "SpMat::tail_cols(): size out of bounds" ); + arma_conform_check_bounds( (N > n_cols), "SpMat::tail_cols(): size out of bounds" ); const uword start_col = n_cols - N; @@ -2785,7 +2816,7 @@ arma_inline SpSubview_col_list SpMat::cols(const Base& indices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpSubview_col_list(*this, indices); } @@ -2798,7 +2829,7 @@ arma_inline const SpSubview_col_list SpMat::cols(const Base& indices) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpSubview_col_list(*this, indices); } @@ -2811,12 +2842,12 @@ inline spdiagview SpMat::diag(const sword in_id) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword row_offset = (in_id < 0) ? uword(-in_id) : 0; const uword col_offset = (in_id > 0) ? uword( in_id) : 0; - arma_debug_check_bounds + arma_conform_check_bounds ( ((row_offset > 0) && (row_offset >= n_rows)) || ((col_offset > 0) && (col_offset >= n_cols)), "SpMat::diag(): requested diagonal out of bounds" @@ -2835,12 +2866,12 @@ inline const spdiagview SpMat::diag(const sword in_id) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword row_offset = uword( (in_id < 0) ? -in_id : 0 ); const uword col_offset = uword( (in_id > 0) ? in_id : 0 ); - arma_debug_check_bounds + arma_conform_check_bounds ( ((row_offset > 0) && (row_offset >= n_rows)) || ((col_offset > 0) && (col_offset >= n_cols)), "SpMat::diag(): requested diagonal out of bounds" @@ -2858,9 +2889,9 @@ inline void SpMat::swap_rows(const uword in_row1, const uword in_row2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( ((in_row1 >= n_rows) || (in_row2 >= n_rows)), "SpMat::swap_rows(): out of bounds" ); + arma_conform_check_bounds( ((in_row1 >= n_rows) || (in_row2 >= n_rows)), "SpMat::swap_rows(): out of bounds" ); if(in_row1 == in_row2) { return; } @@ -2963,9 +2994,9 @@ inline void SpMat::swap_cols(const uword in_col1, const uword in_col2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( ((in_col1 >= n_cols) || (in_col2 >= n_cols)), "SpMat::swap_cols(): out of bounds" ); + arma_conform_check_bounds( ((in_col1 >= n_cols) || (in_col2 >= n_cols)), "SpMat::swap_cols(): out of bounds" ); if(in_col1 == in_col2) { return; } @@ -2992,9 +3023,9 @@ inline void SpMat::shed_row(const uword row_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds(row_num >= n_rows, "SpMat::shed_row(): out of bounds"); + arma_conform_check_bounds(row_num >= n_rows, "SpMat::shed_row(): out of bounds"); shed_rows (row_num, row_num); } @@ -3006,9 +3037,9 @@ inline void SpMat::shed_col(const uword col_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds(col_num >= n_cols, "SpMat::shed_col(): out of bounds"); + arma_conform_check_bounds(col_num >= n_cols, "SpMat::shed_col(): out of bounds"); shed_cols(col_num, col_num); } @@ -3020,9 +3051,9 @@ inline void SpMat::shed_rows(const uword in_row1, const uword in_row2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_row2 >= n_rows), "SpMat::shed_rows(): indices out of bounds or incorectly used" @@ -3106,9 +3137,9 @@ inline void SpMat::shed_cols(const uword in_col1, const uword in_col2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_col1 > in_col2) || (in_col2 >= n_cols), "SpMat::shed_cols(): indices out of bounds or incorrectly used" @@ -3242,7 +3273,7 @@ arma_inline SpMat_MapMat_val SpMat::operator()(const uword i) { - arma_debug_check_bounds( (i >= n_elem), "SpMat::operator(): out of bounds" ); + arma_conform_check_bounds( (i >= n_elem), "SpMat::operator(): out of bounds" ); const uword in_col = i / n_rows; const uword in_row = i % n_rows; @@ -3257,7 +3288,7 @@ arma_inline eT SpMat::operator()(const uword i) const { - arma_debug_check_bounds( (i >= n_elem), "SpMat::operator(): out of bounds" ); + arma_conform_check_bounds( (i >= n_elem), "SpMat::operator(): out of bounds" ); return get_value(i); } @@ -3318,7 +3349,7 @@ arma_inline SpMat_MapMat_val SpMat::operator()(const uword in_row, const uword in_col) { - arma_debug_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols)), "SpMat::operator(): out of bounds" ); + arma_conform_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols)), "SpMat::operator(): out of bounds" ); return SpMat_MapMat_val((*this), cache, in_row, in_col); } @@ -3330,7 +3361,7 @@ arma_inline eT SpMat::operator()(const uword in_row, const uword in_col) const { - arma_debug_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols)), "SpMat::operator(): out of bounds" ); + arma_conform_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols)), "SpMat::operator(): out of bounds" ); return get_value(in_row, in_col); } @@ -3399,7 +3430,7 @@ inline bool SpMat::is_symmetric() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpMat& A = (*this); @@ -3417,13 +3448,13 @@ inline bool SpMat::is_symmetric(const typename get_pod_type::result tol) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; if(tol == T(0)) { return (*this).is_symmetric(); } - arma_debug_check( (tol < T(0)), "is_symmetric(): parameter 'tol' must be >= 0" ); + arma_conform_check( (tol < T(0)), "is_symmetric(): parameter 'tol' must be >= 0" ); const SpMat& A = (*this); @@ -3445,7 +3476,7 @@ inline bool SpMat::is_hermitian() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpMat& A = (*this); @@ -3463,13 +3494,13 @@ inline bool SpMat::is_hermitian(const typename get_pod_type::result tol) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; if(tol == T(0)) { return (*this).is_hermitian(); } - arma_debug_check( (tol < T(0)), "is_hermitian(): parameter 'tol' must be >= 0" ); + arma_conform_check( (tol < T(0)), "is_hermitian(): parameter 'tol' must be >= 0" ); const SpMat& A = (*this); @@ -3491,7 +3522,7 @@ inline bool SpMat::internal_is_finite() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -3505,7 +3536,7 @@ inline bool SpMat::internal_has_inf() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -3519,7 +3550,7 @@ inline bool SpMat::internal_has_nan() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -3533,7 +3564,7 @@ inline bool SpMat::internal_has_nonfinite() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -3558,7 +3589,7 @@ arma_inline bool SpMat::in_range(const span& x) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(x.whole) { @@ -3591,7 +3622,7 @@ arma_inline bool SpMat::in_range(const span& row_span, const uword in_col) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(row_span.whole) { @@ -3613,7 +3644,7 @@ arma_inline bool SpMat::in_range(const uword in_row, const span& col_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(col_span.whole) { @@ -3635,7 +3666,7 @@ arma_inline bool SpMat::in_range(const span& row_span, const span& col_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword in_row1 = row_span.a; const uword in_row2 = row_span.b; @@ -3678,7 +3709,7 @@ inline SpMat& SpMat::copy_size(const SpMat& m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return set_size(m.n_rows, m.n_cols); } @@ -3691,7 +3722,7 @@ inline SpMat& SpMat::copy_size(const Mat& m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return set_size(m.n_rows, m.n_cols); } @@ -3703,7 +3734,7 @@ inline SpMat& SpMat::set_size(const uword new_n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword new_n_rows = (vec_state == 2) ? uword(1 ) : uword(new_n_elem); const uword new_n_cols = (vec_state == 2) ? uword(new_n_elem) : uword(1 ); @@ -3718,7 +3749,7 @@ inline SpMat& SpMat::set_size(const uword in_rows, const uword in_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); invalidate_cache(); // placed here, as set_size() is used during matrix modification @@ -3736,7 +3767,7 @@ inline SpMat& SpMat::set_size(const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).set_size(s.n_rows, s.n_cols); } @@ -3748,7 +3779,7 @@ inline SpMat& SpMat::resize(const uword in_rows, const uword in_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if( (n_rows == in_rows) && (n_cols == in_cols) ) { return *this; } @@ -3778,7 +3809,7 @@ inline SpMat& SpMat::resize(const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).resize(s.n_rows, s.n_cols); } @@ -3790,14 +3821,14 @@ inline SpMat& SpMat::reshape(const uword in_rows, const uword in_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_check( ((in_rows*in_cols) != n_elem), "SpMat::reshape(): changing the number of elements in a sparse matrix is currently not supported" ); if( (n_rows == in_rows) && (n_cols == in_cols) ) { return *this; } - if(vec_state == 1) { arma_debug_check( (in_cols != 1), "SpMat::reshape(): object is a column vector; requested size is not compatible" ); } - if(vec_state == 2) { arma_debug_check( (in_rows != 1), "SpMat::reshape(): object is a row vector; requested size is not compatible" ); } + if(vec_state == 1) { arma_conform_check( (in_cols != 1), "SpMat::reshape(): object is a column vector; requested size is not compatible" ); } + if(vec_state == 2) { arma_conform_check( (in_rows != 1), "SpMat::reshape(): object is a row vector; requested size is not compatible" ); } if(n_nonzero == 0) { return (*this).zeros(in_rows, in_cols); } @@ -3820,7 +3851,7 @@ inline SpMat& SpMat::reshape(const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).reshape(s.n_rows, s.n_cols); } @@ -3832,7 +3863,7 @@ inline void SpMat::reshape_helper_generic(const uword in_rows, const uword in_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); invalidate_cache(); @@ -3883,7 +3914,7 @@ inline void SpMat::reshape_helper_intovec() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); invalidate_cache(); @@ -3923,7 +3954,7 @@ inline SpMat& SpMat::for_each(functor F) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -3959,7 +3990,7 @@ inline const SpMat& SpMat::for_each(functor F) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -3979,7 +4010,7 @@ inline SpMat& SpMat::transform(functor F) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); invalidate_cache(); @@ -4011,11 +4042,11 @@ inline SpMat& SpMat::replace(const eT old_val, const eT new_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(old_val == eT(0)) { - arma_debug_warn_level(1, "SpMat::replace(): replacement not done, as old_val = 0"); + arma_conform_warn(1, "SpMat::replace(): replacement not done, as old_val = 0"); } else { @@ -4037,7 +4068,7 @@ inline SpMat& SpMat::clean(const typename get_pod_type::result threshold) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(n_nonzero == 0) { return *this; } @@ -4058,16 +4089,16 @@ inline SpMat& SpMat::clamp(const eT min_val, const eT max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(is_cx::no) { - arma_debug_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "SpMat::clamp(): min_val must be less than max_val" ); + arma_conform_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "SpMat::clamp(): min_val must be less than max_val" ); } else { - arma_debug_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "SpMat::clamp(): real(min_val) must be less than real(max_val)" ); - arma_debug_check( (access::tmp_imag(min_val) > access::tmp_imag(max_val)), "SpMat::clamp(): imag(min_val) must be less than imag(max_val)" ); + arma_conform_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "SpMat::clamp(): real(min_val) must be less than real(max_val)" ); + arma_conform_check( (access::tmp_imag(min_val) > access::tmp_imag(max_val)), "SpMat::clamp(): imag(min_val) must be less than imag(max_val)" ); } if(n_nonzero == 0) { return *this; } @@ -4089,7 +4120,7 @@ inline SpMat& SpMat::zeros() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if((n_nonzero == 0) && (values != nullptr)) { @@ -4110,7 +4141,7 @@ inline SpMat& SpMat::zeros(const uword new_n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword new_n_rows = (vec_state == 2) ? uword(1 ) : uword(new_n_elem); const uword new_n_cols = (vec_state == 2) ? uword(new_n_elem) : uword(1 ); @@ -4125,7 +4156,7 @@ inline SpMat& SpMat::zeros(const uword in_rows, const uword in_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if((n_nonzero == 0) && (n_rows == in_rows) && (n_cols == in_cols) && (values != nullptr)) { @@ -4146,7 +4177,7 @@ inline SpMat& SpMat::zeros(const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).zeros(s.n_rows, s.n_cols); } @@ -4158,7 +4189,7 @@ inline SpMat& SpMat::eye() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).eye(n_rows, n_cols); } @@ -4170,7 +4201,7 @@ inline SpMat& SpMat::eye(const uword in_rows, const uword in_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N = (std::min)(in_rows, in_cols); @@ -4197,7 +4228,7 @@ inline SpMat& SpMat::eye(const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).eye(s.n_rows, s.n_cols); } @@ -4209,7 +4240,7 @@ inline SpMat& SpMat::speye() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).eye(n_rows, n_cols); } @@ -4221,7 +4252,7 @@ inline SpMat& SpMat::speye(const uword in_n_rows, const uword in_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).eye(in_n_rows, in_n_cols); } @@ -4233,7 +4264,7 @@ inline SpMat& SpMat::speye(const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).eye(s.n_rows, s.n_cols); } @@ -4245,9 +4276,9 @@ inline SpMat& SpMat::sprandu(const uword in_rows, const uword in_cols, const double density) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( ( (density < double(0)) || (density > double(1)) ), "sprandu(): density must be in the [0,1] interval" ); + arma_conform_check( ( (density < double(0)) || (density > double(1)) ), "sprandu(): density must be in the [0,1] interval" ); const uword new_n_nonzero = uword(density * double(in_rows) * double(in_cols) + 0.5); @@ -4319,7 +4350,7 @@ inline SpMat& SpMat::sprandu(const SizeMat& s, const double density) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).sprandu(s.n_rows, s.n_cols, density); } @@ -4331,9 +4362,9 @@ inline SpMat& SpMat::sprandn(const uword in_rows, const uword in_cols, const double density) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( ( (density < double(0)) || (density > double(1)) ), "sprandn(): density must be in the [0,1] interval" ); + arma_conform_check( ( (density < double(0)) || (density > double(1)) ), "sprandn(): density must be in the [0,1] interval" ); const uword new_n_nonzero = uword(density * double(in_rows) * double(in_cols) + 0.5); @@ -4405,7 +4436,7 @@ inline SpMat& SpMat::sprandn(const SizeMat& s, const double density) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).sprandn(s.n_rows, s.n_cols, density); } @@ -4417,7 +4448,7 @@ inline void SpMat::reset() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword new_n_rows = (vec_state == 2) ? 1 : 0; const uword new_n_cols = (vec_state == 1) ? 1 : 0; @@ -4432,7 +4463,7 @@ inline void SpMat::reset_cache() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -4445,7 +4476,7 @@ SpMat::reset_cache() sync_state = 0; } } - #elif (!defined(ARMA_DONT_USE_STD_MUTEX)) + #elif defined(ARMA_USE_STD_MUTEX) { const std::lock_guard lock(cache_mutex); @@ -4469,7 +4500,7 @@ inline void SpMat::reserve(const uword in_rows, const uword in_cols, const uword new_n_nonzero) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init(in_rows, in_cols, new_n_nonzero); } @@ -4482,7 +4513,7 @@ inline void SpMat::set_real(const SpBase::pod_type,T1>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat_aux::set_real(*this, X); } @@ -4495,7 +4526,7 @@ inline void SpMat::set_imag(const SpBase::pod_type,T1>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat_aux::set_imag(*this, X); } @@ -4508,7 +4539,7 @@ inline bool SpMat::save(const std::string name, const file_type type) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -4533,11 +4564,11 @@ SpMat::save(const std::string name, const file_type type) const break; default: - arma_debug_warn_level(1, "SpMat::save(): unsupported file type"); + arma_conform_warn(1, "SpMat::save(): unsupported file type"); save_okay = false; } - if(save_okay == false) { arma_debug_warn_level(3, "SpMat::save(): write failed; file: ", name); } + if(save_okay == false) { arma_conform_warn(3, "SpMat::save(): write failed; file: ", name); } return save_okay; } @@ -4549,7 +4580,7 @@ inline bool SpMat::save(const csv_name& spec, const file_type type) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if( (type != csv_ascii) && (type != ssv_ascii) ) { @@ -4562,12 +4593,12 @@ SpMat::save(const csv_name& spec, const file_type type) const const bool with_header = bool(spec.opts.flags & csv_opts::flag_with_header) && (no_header == false); const bool use_semicolon = bool(spec.opts.flags & csv_opts::flag_semicolon ) || (type == ssv_ascii); - arma_extra_debug_print("SpMat::save(csv_name): enabled flags:"); + arma_debug_print("SpMat::save(csv_name): enabled flags:"); - if(do_trans ) { arma_extra_debug_print("trans"); } - if(no_header ) { arma_extra_debug_print("no_header"); } - if(with_header ) { arma_extra_debug_print("with_header"); } - if(use_semicolon) { arma_extra_debug_print("semicolon"); } + if(do_trans ) { arma_debug_print("trans"); } + if(no_header ) { arma_debug_print("no_header"); } + if(with_header ) { arma_debug_print("with_header"); } + if(use_semicolon) { arma_debug_print("semicolon"); } const char separator = (use_semicolon) ? char(';') : char(','); @@ -4575,7 +4606,7 @@ SpMat::save(const csv_name& spec, const file_type type) const { if( (spec.header_ro.n_cols != 1) && (spec.header_ro.n_rows != 1) ) { - arma_debug_warn_level(1, "SpMat::save(): given header must have a vector layout"); + arma_conform_warn(1, "SpMat::save(): given header must have a vector layout"); return false; } @@ -4585,7 +4616,7 @@ SpMat::save(const csv_name& spec, const file_type type) const if(token.find(separator) != std::string::npos) { - arma_debug_warn_level(1, "SpMat::save(): token within the header contains the separator character: '", token, "'"); + arma_conform_warn(1, "SpMat::save(): token within the header contains the separator character: '", token, "'"); return false; } } @@ -4594,7 +4625,7 @@ SpMat::save(const csv_name& spec, const file_type type) const if(spec.header_ro.n_elem != save_n_cols) { - arma_debug_warn_level(1, "SpMat::save(): size mismatch between header and matrix"); + arma_conform_warn(1, "SpMat::save(): size mismatch between header and matrix"); return false; } } @@ -4612,7 +4643,7 @@ SpMat::save(const csv_name& spec, const file_type type) const save_okay = diskio::save_csv_ascii(*this, spec.filename, spec.header_ro, with_header, separator); } - if(save_okay == false) { arma_debug_warn_level(3, "SpMat::save(): write failed; file: ", spec.filename); } + if(save_okay == false) { arma_conform_warn(3, "SpMat::save(): write failed; file: ", spec.filename); } return save_okay; } @@ -4625,7 +4656,7 @@ inline bool SpMat::save(std::ostream& os, const file_type type) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -4650,11 +4681,11 @@ SpMat::save(std::ostream& os, const file_type type) const break; default: - arma_debug_warn_level(1, "SpMat::save(): unsupported file type"); + arma_conform_warn(1, "SpMat::save(): unsupported file type"); save_okay = false; } - if(save_okay == false) { arma_debug_warn_level(3, "SpMat::save(): stream write failed"); } + if(save_okay == false) { arma_conform_warn(3, "SpMat::save(): stream write failed"); } return save_okay; } @@ -4667,7 +4698,7 @@ inline bool SpMat::load(const std::string name, const file_type type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); invalidate_cache(); @@ -4697,7 +4728,7 @@ SpMat::load(const std::string name, const file_type type) break; default: - arma_debug_warn_level(1, "SpMat::load(): unsupported file type"); + arma_conform_warn(1, "SpMat::load(): unsupported file type"); load_okay = false; } @@ -4705,11 +4736,11 @@ SpMat::load(const std::string name, const file_type type) { if(err_msg.length() > 0) { - arma_debug_warn_level(3, "SpMat::load(): ", err_msg, "; file: ", name); + arma_conform_warn(3, "SpMat::load(): ", err_msg, "; file: ", name); } else { - arma_debug_warn_level(3, "SpMat::load(): read failed; file: ", name); + arma_conform_warn(3, "SpMat::load(): read failed; file: ", name); } } @@ -4725,7 +4756,7 @@ inline bool SpMat::load(const csv_name& spec, const file_type type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if( (type != csv_ascii) && (type != ssv_ascii) ) { @@ -4739,15 +4770,15 @@ SpMat::load(const csv_name& spec, const file_type type) const bool use_semicolon = bool(spec.opts.flags & csv_opts::flag_semicolon ) || (type == ssv_ascii); const bool strict = bool(spec.opts.flags & csv_opts::flag_strict ); - arma_extra_debug_print("SpMat::load(csv_name): enabled flags:"); + arma_debug_print("SpMat::load(csv_name): enabled flags:"); - if(do_trans ) { arma_extra_debug_print("trans"); } - if(no_header ) { arma_extra_debug_print("no_header"); } - if(with_header ) { arma_extra_debug_print("with_header"); } - if(use_semicolon) { arma_extra_debug_print("semicolon"); } - if(strict ) { arma_extra_debug_print("strict"); } + if(do_trans ) { arma_debug_print("trans"); } + if(no_header ) { arma_debug_print("no_header"); } + if(with_header ) { arma_debug_print("with_header"); } + if(use_semicolon) { arma_debug_print("semicolon"); } + if(strict ) { arma_debug_print("strict"); } - if(strict) { arma_debug_warn_level(1, "SpMat::load(): option 'strict' not implemented for sparse matrices"); } + if(strict) { arma_conform_warn(1, "SpMat::load(): option 'strict' not implemented for sparse matrices"); } const char separator = (use_semicolon) ? char(';') : char(','); @@ -4780,11 +4811,11 @@ SpMat::load(const csv_name& spec, const file_type type) { if(err_msg.length() > 0) { - arma_debug_warn_level(3, "SpMat::load(): ", err_msg, "; file: ", spec.filename); + arma_conform_warn(3, "SpMat::load(): ", err_msg, "; file: ", spec.filename); } else { - arma_debug_warn_level(3, "SpMat::load(): read failed; file: ", spec.filename); + arma_conform_warn(3, "SpMat::load(): read failed; file: ", spec.filename); } } else @@ -4793,7 +4824,7 @@ SpMat::load(const csv_name& spec, const file_type type) if(with_header && (spec.header_rw.n_elem != load_n_cols)) { - arma_debug_warn_level(3, "SpMat::load(): size mismatch between header and matrix"); + arma_conform_warn(3, "SpMat::load(): size mismatch between header and matrix"); } } @@ -4815,7 +4846,7 @@ inline bool SpMat::load(std::istream& is, const file_type type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); invalidate_cache(); @@ -4845,7 +4876,7 @@ SpMat::load(std::istream& is, const file_type type) break; default: - arma_debug_warn_level(1, "SpMat::load(): unsupported file type"); + arma_conform_warn(1, "SpMat::load(): unsupported file type"); load_okay = false; } @@ -4853,11 +4884,11 @@ SpMat::load(std::istream& is, const file_type type) { if(err_msg.length() > 0) { - arma_debug_warn_level(3, "SpMat::load(): ", err_msg); + arma_conform_warn(3, "SpMat::load(): ", err_msg); } else { - arma_debug_warn_level(3, "SpMat::load(): stream read failed"); + arma_conform_warn(3, "SpMat::load(): stream read failed"); } } @@ -4873,7 +4904,7 @@ inline bool SpMat::quiet_save(const std::string name, const file_type type) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).save(name, type); } @@ -4885,7 +4916,7 @@ inline bool SpMat::quiet_save(std::ostream& os, const file_type type) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).save(os, type); } @@ -4897,7 +4928,7 @@ inline bool SpMat::quiet_load(const std::string name, const file_type type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).load(name, type); } @@ -4909,7 +4940,7 @@ inline bool SpMat::quiet_load(std::istream& is, const file_type type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).load(is, type); } @@ -4924,7 +4955,7 @@ inline void SpMat::init(uword in_rows, uword in_cols, const uword new_n_nonzero) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); invalidate_cache(); // placed here, as init() is used during matrix modification @@ -4952,7 +4983,7 @@ inline void SpMat::init_cold(uword in_rows, uword in_cols, const uword new_n_nonzero) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // Verify that we are allowed to do this. if(vec_state > 0) @@ -4964,8 +4995,8 @@ SpMat::init_cold(uword in_rows, uword in_cols, const uword new_n_nonzero) } else { - if(vec_state == 1) { arma_debug_check( (in_cols != 1), "SpMat::init(): object is a column vector; requested size is not compatible" ); } - if(vec_state == 2) { arma_debug_check( (in_rows != 1), "SpMat::init(): object is a row vector; requested size is not compatible" ); } + if(vec_state == 1) { arma_conform_check( (in_cols != 1), "SpMat::init(): object is a column vector; requested size is not compatible" ); } + if(vec_state == 2) { arma_conform_check( (in_rows != 1), "SpMat::init(): object is a row vector; requested size is not compatible" ); } } } @@ -4976,7 +5007,7 @@ SpMat::init_cold(uword in_rows, uword in_cols, const uword new_n_nonzero) #endif // Ensure that n_elem can hold the result of (n_rows * n_cols) - arma_debug_check + arma_conform_check ( ( ( (in_rows > ARMA_MAX_UHWORD) || (in_cols > ARMA_MAX_UHWORD) ) @@ -5014,7 +5045,7 @@ inline void SpMat::init(const std::string& text) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat tmp(text); @@ -5046,7 +5077,7 @@ inline void SpMat::init(const SpMat& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(this == &x) { return; } @@ -5062,7 +5093,7 @@ SpMat::init(const SpMat& x) init_done = true; } } - #elif (!defined(ARMA_DONT_USE_STD_MUTEX)) + #elif defined(ARMA_USE_STD_MUTEX) if(x.sync_state == 1) { const std::lock_guard lock(x.cache_mutex); @@ -5094,7 +5125,7 @@ inline void SpMat::init(const MapMat& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword x_n_rows = x.n_rows; const uword x_n_cols = x.n_cols; @@ -5187,7 +5218,7 @@ inline void SpMat::init_simple(const SpMat& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(this == &x) { return; } @@ -5215,7 +5246,7 @@ inline void SpMat::init_batch_std(const Mat& locs, const Mat& vals, const bool sort_locations) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // Resize to correct number of elements. mem_resize(vals.n_elem); @@ -5280,7 +5311,7 @@ SpMat::init_batch_std(const Mat& locs, const Mat& vals, const boo const uword row_i = locs_i[0]; const uword col_i = locs_i[1]; - arma_debug_check( ( (row_i >= n_rows) || (col_i >= n_cols) ), "SpMat::SpMat(): invalid row or column index" ); + arma_conform_check( ( (row_i >= n_rows) || (col_i >= n_cols) ), "SpMat::SpMat(): invalid row or column index" ); if(i > 0) { @@ -5291,7 +5322,7 @@ SpMat::init_batch_std(const Mat& locs, const Mat& vals, const boo const uword row_im1 = locs_im1[0]; const uword col_im1 = locs_im1[1]; - arma_debug_check( ( (row_i == row_im1) && (col_i == col_im1) ), "SpMat::SpMat(): detected identical locations" ); + arma_conform_check( ( (row_i == row_im1) && (col_i == col_im1) ), "SpMat::SpMat(): detected identical locations" ); } access::rw(values[i]) = vals[index]; @@ -5316,7 +5347,7 @@ SpMat::init_batch_std(const Mat& locs, const Mat& vals, const boo const uword row_i = locs_i[0]; const uword col_i = locs_i[1]; - arma_debug_check( ( (row_i >= n_rows) || (col_i >= n_cols) ), "SpMat::SpMat(): invalid row or column index" ); + arma_conform_check( ( (row_i >= n_rows) || (col_i >= n_cols) ), "SpMat::SpMat(): invalid row or column index" ); if(i > 0) { @@ -5325,13 +5356,13 @@ SpMat::init_batch_std(const Mat& locs, const Mat& vals, const boo const uword row_im1 = locs_im1[0]; const uword col_im1 = locs_im1[1]; - arma_debug_check + arma_conform_check ( ( (col_i < col_im1) || ((col_i == col_im1) && (row_i < row_im1)) ), "SpMat::SpMat(): out of order points; either pass sort_locations = true, or sort points in column-major ordering" ); - arma_debug_check( ( (col_i == col_im1) && (row_i == row_im1) ), "SpMat::SpMat(): detected identical locations" ); + arma_conform_check( ( (col_i == col_im1) && (row_i == row_im1) ), "SpMat::SpMat(): detected identical locations" ); } access::rw(values[i]) = vals[i]; @@ -5355,7 +5386,7 @@ inline void SpMat::init_batch_add(const Mat& locs, const Mat& vals, const bool sort_locations) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(locs.n_cols < 2) { @@ -5420,7 +5451,7 @@ SpMat::init_batch_add(const Mat& locs, const Mat& vals, const boo const uword i = 0; const uword* locs_i = locs.colptr( sorted_indices[i] ); - arma_debug_check( ( (locs_i[0] >= n_rows) || (locs_i[1] >= n_cols) ), "SpMat::SpMat(): invalid row or column index" ); + arma_conform_check( ( (locs_i[0] >= n_rows) || (locs_i[1] >= n_cols) ), "SpMat::SpMat(): invalid row or column index" ); access::rw(values[count]) = vals[ sorted_indices[i] ]; access::rw(row_indices[count]) = locs_i[0]; @@ -5433,7 +5464,7 @@ SpMat::init_batch_add(const Mat& locs, const Mat& vals, const boo const uword* locs_i = locs.colptr( sorted_indices[i ] ); const uword* locs_im1 = locs.colptr( sorted_indices[i-1] ); - arma_debug_check( ( (locs_i[0] >= n_rows) || (locs_i[1] >= n_cols) ), "SpMat::SpMat(): invalid row or column index" ); + arma_conform_check( ( (locs_i[0] >= n_rows) || (locs_i[1] >= n_cols) ), "SpMat::SpMat(): invalid row or column index" ); if( (locs_i[1] == locs_im1[1]) && (locs_i[0] == locs_im1[0]) ) { @@ -5477,7 +5508,7 @@ SpMat::init_batch_add(const Mat& locs, const Mat& vals, const boo const uword i = 0; const uword* locs_i = locs.colptr(i); - arma_debug_check( ( (locs_i[0] >= n_rows) || (locs_i[1] >= n_cols) ), "SpMat::SpMat(): invalid row or column index" ); + arma_conform_check( ( (locs_i[0] >= n_rows) || (locs_i[1] >= n_cols) ), "SpMat::SpMat(): invalid row or column index" ); access::rw(values[count]) = vals[i]; access::rw(row_indices[count]) = locs_i[0]; @@ -5490,9 +5521,9 @@ SpMat::init_batch_add(const Mat& locs, const Mat& vals, const boo const uword* locs_i = locs.colptr(i ); const uword* locs_im1 = locs.colptr(i-1); - arma_debug_check( ( (locs_i[0] >= n_rows) || (locs_i[1] >= n_cols) ), "SpMat::SpMat(): invalid row or column index" ); + arma_conform_check( ( (locs_i[0] >= n_rows) || (locs_i[1] >= n_cols) ), "SpMat::SpMat(): invalid row or column index" ); - arma_debug_check + arma_conform_check ( ( (locs_i[1] < locs_im1[1]) || (locs_i[1] == locs_im1[1] && locs_i[0] < locs_im1[0]) ), "SpMat::SpMat(): out of order points; either pass sort_locations = true, or sort points in column-major ordering" @@ -5536,7 +5567,7 @@ SpMat::SpMat(const arma_vec_indicator&, const uword in_vec_state) , row_indices(nullptr) , col_ptrs(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); const uword in_n_rows = (in_vec_state == 2) ? 1 : 0; const uword in_n_cols = (in_vec_state == 1) ? 1 : 0; @@ -5559,7 +5590,7 @@ SpMat::SpMat(const arma_vec_indicator&, const uword in_n_rows, const uword i , row_indices(nullptr) , col_ptrs(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(in_n_rows, in_n_cols); } @@ -5571,7 +5602,7 @@ inline void SpMat::mem_resize(const uword new_n_nonzero) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); invalidate_cache(); // placed here, as mem_resize() is used during matrix modification @@ -5610,7 +5641,7 @@ inline void SpMat::sync() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); } @@ -5622,7 +5653,7 @@ inline void SpMat::remove_zeros() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -5684,7 +5715,7 @@ inline void SpMat::steal_mem(SpMat& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(this == &x) { return; } @@ -5702,7 +5733,7 @@ SpMat::steal_mem(SpMat& x) if(layout_ok) { - arma_extra_debug_print("SpMat::steal_mem(): stealing memory"); + arma_debug_print("SpMat::steal_mem(): stealing memory"); x.sync_csc(); @@ -5714,7 +5745,7 @@ SpMat::steal_mem(SpMat& x) } else { - arma_extra_debug_print("SpMat::steal_mem(): copying memory"); + arma_debug_print("SpMat::steal_mem(): copying memory"); (*this).operator=(x); } @@ -5727,7 +5758,7 @@ inline void SpMat::steal_mem_simple(SpMat& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(this == &x) { return; } @@ -5763,7 +5794,7 @@ inline void SpMat::init_xform(const SpBase& A, const Functor& func) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // if possible, avoid doing a copy and instead apply func to the generated elements if(SpProxy::Q_is_generated) @@ -5801,7 +5832,7 @@ inline void SpMat::init_xform_mt(const SpBase& A, const Functor& func) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy P(A.get_ref()); @@ -5892,7 +5923,7 @@ inline typename SpMat::iterator SpMat::begin() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -5906,7 +5937,7 @@ inline typename SpMat::const_iterator SpMat::begin() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -5920,7 +5951,7 @@ inline typename SpMat::const_iterator SpMat::cbegin() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); @@ -6207,7 +6238,7 @@ arma_inline SpMat_MapMat_val SpMat::front() { - arma_debug_check( (n_elem == 0), "SpMat::front(): matrix is empty" ); + arma_conform_check( (n_elem == 0), "SpMat::front(): matrix is empty" ); return SpMat_MapMat_val((*this), cache, 0, 0); } @@ -6219,7 +6250,7 @@ arma_inline eT SpMat::front() const { - arma_debug_check( (n_elem == 0), "SpMat::front(): matrix is empty" ); + arma_conform_check( (n_elem == 0), "SpMat::front(): matrix is empty" ); return get_value(0,0); } @@ -6231,7 +6262,7 @@ arma_inline SpMat_MapMat_val SpMat::back() { - arma_debug_check( (n_elem == 0), "SpMat::back(): matrix is empty" ); + arma_conform_check( (n_elem == 0), "SpMat::back(): matrix is empty" ); return SpMat_MapMat_val((*this), cache, n_rows-1, n_cols-1); } @@ -6243,7 +6274,7 @@ arma_inline eT SpMat::back() const { - arma_debug_check( (n_elem == 0), "SpMat::back(): matrix is empty" ); + arma_conform_check( (n_elem == 0), "SpMat::back(): matrix is empty" ); return get_value(n_rows-1, n_cols-1); } @@ -6458,7 +6489,7 @@ inline eT& SpMat::insert_element(const uword in_row, const uword in_col, const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); invalidate_cache(); @@ -6545,7 +6576,7 @@ inline void SpMat::delete_element(const uword in_row, const uword in_col) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_csc(); invalidate_cache(); @@ -6607,7 +6638,7 @@ arma_inline void SpMat::invalidate_cache() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(sync_state == 0) { return; } @@ -6623,7 +6654,7 @@ arma_inline void SpMat::invalidate_csc() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sync_state = 1; } @@ -6635,7 +6666,7 @@ inline void SpMat::sync_cache() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // using approach adapted from http://preshing.com/20130930/double-checked-locking-is-fixed-in-cpp11/ // @@ -6659,7 +6690,7 @@ SpMat::sync_cache() const } } } - #elif (!defined(ARMA_DONT_USE_STD_MUTEX)) + #elif defined(ARMA_USE_STD_MUTEX) { if(sync_state == 0) { @@ -6683,7 +6714,7 @@ inline void SpMat::sync_cache_simple() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(sync_state == 0) { @@ -6700,7 +6731,7 @@ inline void SpMat::sync_csc() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_OPENMP) if(sync_state == 1) @@ -6710,7 +6741,7 @@ SpMat::sync_csc() const sync_csc_simple(); } } - #elif (!defined(ARMA_DONT_USE_STD_MUTEX)) + #elif defined(ARMA_USE_STD_MUTEX) if(sync_state == 1) { const std::lock_guard lock(cache_mutex); @@ -6731,7 +6762,7 @@ inline void SpMat::sync_csc_simple() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // method: // 1. construct temporary matrix to prevent the cache from getting zapped @@ -6767,12 +6798,12 @@ inline void SpMat_aux::set_real(SpMat& out, const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat tmp(X.get_ref()); const SpMat& A = tmp.M; - arma_debug_assert_same_size( out, A, "SpMat::set_real()" ); + arma_conform_assert_same_size( out, A, "SpMat::set_real()" ); out = A; } @@ -6784,7 +6815,7 @@ inline void SpMat_aux::set_imag(SpMat&, const SpBase&) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -6794,14 +6825,14 @@ inline void SpMat_aux::set_real(SpMat< std::complex >& out, const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; const unwrap_spmat U(X.get_ref()); const SpMat& Y = U.M; - arma_debug_assert_same_size(out, Y, "SpMat::set_real()"); + arma_conform_assert_same_size(out, Y, "SpMat::set_real()"); SpMat tmp(Y,arma::imag(out)); // arma:: prefix required due to bugs in GCC 4.4 - 4.6 @@ -6815,14 +6846,14 @@ inline void SpMat_aux::set_imag(SpMat< std::complex >& out, const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; const unwrap_spmat U(X.get_ref()); const SpMat& Y = U.M; - arma_debug_assert_same_size(out, Y, "SpMat::set_imag()"); + arma_conform_assert_same_size(out, Y, "SpMat::set_imag()"); SpMat tmp(arma::real(out),Y); // arma:: prefix required due to bugs in GCC 4.4 - 4.6 diff --git a/inst/include/armadillo_bits/SpOp_meat.hpp b/inst/include/armadillo_bits/SpOp_meat.hpp index 2a6f1f51..c3b59c8f 100644 --- a/inst/include/armadillo_bits/SpOp_meat.hpp +++ b/inst/include/armadillo_bits/SpOp_meat.hpp @@ -26,7 +26,7 @@ inline SpOp::SpOp(const T1& in_m) : m(in_m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -37,7 +37,7 @@ SpOp::SpOp(const T1& in_m, const typename T1::elem_type in_aux) : m(in_m) , aux(in_aux) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -49,7 +49,7 @@ SpOp::SpOp(const T1& in_m, const uword in_aux_uword_a, const uword , aux_uword_a(in_aux_uword_a) , aux_uword_b(in_aux_uword_b) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -58,7 +58,7 @@ template inline SpOp::~SpOp() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } diff --git a/inst/include/armadillo_bits/SpProxy.hpp b/inst/include/armadillo_bits/SpProxy.hpp index 50adcc80..ea22eeee 100644 --- a/inst/include/armadillo_bits/SpProxy.hpp +++ b/inst/include/armadillo_bits/SpProxy.hpp @@ -87,7 +87,7 @@ struct SpProxy< SpMat > inline explicit SpProxy(const SpMat& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Q.sync(); } @@ -139,7 +139,7 @@ struct SpProxy< SpCol > inline explicit SpProxy(const SpCol& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Q.sync(); } @@ -191,7 +191,7 @@ struct SpProxy< SpRow > inline explicit SpProxy(const SpRow& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Q.sync(); } @@ -243,7 +243,7 @@ struct SpProxy< SpSubview > inline explicit SpProxy(const SpSubview& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Q.m.sync(); } @@ -295,7 +295,7 @@ struct SpProxy< SpSubview_col > inline explicit SpProxy(const SpSubview_col& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Q.m.sync(); } @@ -347,7 +347,7 @@ struct SpProxy< SpSubview_col_list > inline explicit SpProxy(const SpSubview_col_list& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -398,7 +398,7 @@ struct SpProxy< SpSubview_row > inline explicit SpProxy(const SpSubview_row& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Q.m.sync(); } @@ -450,7 +450,7 @@ struct SpProxy< spdiagview > inline explicit SpProxy(const spdiagview& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return Q.n_rows; } @@ -502,7 +502,7 @@ struct SpProxy< SpOp > inline explicit SpProxy(const SpOp& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; } @@ -554,7 +554,7 @@ struct SpProxy< SpGlue > inline explicit SpProxy(const SpGlue& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; } @@ -605,7 +605,7 @@ struct SpProxy< mtSpOp > inline explicit SpProxy(const mtSpOp& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; } @@ -656,7 +656,7 @@ struct SpProxy< mtSpGlue > inline explicit SpProxy(const mtSpGlue& A) : Q(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; } diff --git a/inst/include/armadillo_bits/SpRow_meat.hpp b/inst/include/armadillo_bits/SpRow_meat.hpp index 10f052f7..a3de8e07 100644 --- a/inst/include/armadillo_bits/SpRow_meat.hpp +++ b/inst/include/armadillo_bits/SpRow_meat.hpp @@ -26,7 +26,7 @@ inline SpRow::SpRow() : SpMat(arma_vec_indicator(), 2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -36,7 +36,7 @@ inline SpRow::SpRow(const uword in_n_elem) : SpMat(arma_vec_indicator(), 1, in_n_elem, 2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -46,7 +46,7 @@ inline SpRow::SpRow(const uword in_n_rows, const uword in_n_cols) : SpMat(arma_vec_indicator(), in_n_rows, in_n_cols, 2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -56,7 +56,7 @@ inline SpRow::SpRow(const SizeMat& s) : SpMat(arma_vec_indicator(), 0, 0, 2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat::init(s.n_rows, s.n_cols); } @@ -68,7 +68,7 @@ inline SpRow::SpRow(const char* text) : SpMat(arma_vec_indicator(), 2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat::init(std::string(text)); } @@ -80,7 +80,7 @@ inline SpRow& SpRow::operator=(const char* text) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat::init(std::string(text)); @@ -94,7 +94,7 @@ inline SpRow::SpRow(const std::string& text) : SpMat(arma_vec_indicator(), 2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat::init(text); } @@ -106,7 +106,7 @@ inline SpRow& SpRow::operator=(const std::string& text) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat::init(text); @@ -120,7 +120,7 @@ inline SpRow& SpRow::operator=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat::operator=(val); @@ -135,7 +135,7 @@ inline SpRow::SpRow(const Base& X) : SpMat(arma_vec_indicator(), 2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat::operator=(X.get_ref()); } @@ -148,7 +148,7 @@ inline SpRow& SpRow::operator=(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat::operator=(X.get_ref()); @@ -163,7 +163,7 @@ inline SpRow::SpRow(const SpBase& X) : SpMat(arma_vec_indicator(), 2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat::operator=(X.get_ref()); } @@ -176,7 +176,7 @@ inline SpRow& SpRow::operator=(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat::operator=(X.get_ref()); @@ -195,7 +195,7 @@ SpRow::SpRow ) : SpMat(arma_vec_indicator(), 2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat::init(A,B); } @@ -238,9 +238,9 @@ inline void SpRow::shed_col(const uword col_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( col_num >= SpMat::n_cols, "SpRow::shed_col(): out of bounds" ); + arma_conform_check_bounds( col_num >= SpMat::n_cols, "SpRow::shed_col(): out of bounds" ); shed_cols(col_num, col_num); } @@ -253,9 +253,9 @@ inline void SpRow::shed_cols(const uword in_col1, const uword in_col2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_col1 > in_col2) || (in_col2 >= SpMat::n_cols), "SpRow::shed_cols(): indices out of bounds or incorrectly used" @@ -335,12 +335,12 @@ SpRow::shed_cols(const uword in_col1, const uword in_col2) // void // SpRow::insert_cols(const uword col_num, const uword N, const bool set_to_zero) // { -// arma_extra_debug_sigprint(); +// arma_debug_sigprint(); // // // insertion at col_num == n_cols is in effect an append operation -// arma_debug_check_bounds( (col_num > SpMat::n_cols), "SpRow::insert_cols(): out of bounds" ); +// arma_conform_check_bounds( (col_num > SpMat::n_cols), "SpRow::insert_cols(): out of bounds" ); // -// arma_debug_check( (set_to_zero == false), "SpRow::insert_cols(): cannot set elements to nonzero values" ); +// arma_conform_check( (set_to_zero == false), "SpRow::insert_cols(): cannot set elements to nonzero values" ); // // uword newVal = (col_num == 0) ? 0 : SpMat::col_ptrs[col_num]; // SpMat::col_ptrs.insert(col_num, N, newVal); @@ -364,11 +364,11 @@ inline typename SpRow::row_iterator SpRow::begin_row(const uword row_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // Since this is a row, row_num can only be 0. But the option is provided for // compatibility. - arma_debug_check_bounds((row_num >= 1), "SpRow::begin_row(): index out of bounds"); + arma_conform_check_bounds((row_num >= 1), "SpRow::begin_row(): index out of bounds"); return SpMat::begin(); } @@ -380,11 +380,11 @@ inline typename SpRow::const_row_iterator SpRow::begin_row(const uword row_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // Since this is a row, row_num can only be 0. But the option is provided for // compatibility. - arma_debug_check_bounds((row_num >= 1), "SpRow::begin_row(): index out of bounds"); + arma_conform_check_bounds((row_num >= 1), "SpRow::begin_row(): index out of bounds"); return SpMat::begin(); } @@ -396,11 +396,11 @@ inline typename SpRow::row_iterator SpRow::end_row(const uword row_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // Since this is a row, row_num can only be 0. But the option is provided for // compatibility. - arma_debug_check_bounds((row_num >= 1), "SpRow::end_row(): index out of bounds"); + arma_conform_check_bounds((row_num >= 1), "SpRow::end_row(): index out of bounds"); return SpMat::end(); } @@ -412,11 +412,11 @@ inline typename SpRow::const_row_iterator SpRow::end_row(const uword row_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // Since this is a row, row_num can only be 0. But the option is provided for // compatibility. - arma_debug_check_bounds((row_num >= 1), "SpRow::end_row(): index out of bounds"); + arma_conform_check_bounds((row_num >= 1), "SpRow::end_row(): index out of bounds"); return SpMat::end(); } diff --git a/inst/include/armadillo_bits/SpSubview_col_list_meat.hpp b/inst/include/armadillo_bits/SpSubview_col_list_meat.hpp index 46d2d8d5..1a1c397c 100644 --- a/inst/include/armadillo_bits/SpSubview_col_list_meat.hpp +++ b/inst/include/armadillo_bits/SpSubview_col_list_meat.hpp @@ -25,7 +25,7 @@ template inline SpSubview_col_list::~SpSubview_col_list() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -40,13 +40,13 @@ SpSubview_col_list::SpSubview_col_list : m (in_m ) , U_ci(in_ci.get_ref()) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const umat& ci = U_ci.M; const uword* ci_mem = ci.memptr(); const uword ci_n_elem = ci.n_elem; - arma_debug_check + arma_conform_check ( ( (ci.is_vec() == false) && (ci.is_empty() == false) ), "SpMat::cols(): given object must be a vector" @@ -56,7 +56,7 @@ SpSubview_col_list::SpSubview_col_list { const uword i = ci_mem[ci_count]; - arma_debug_check_bounds( (i >= in_m.n_cols), "SpMat::cols(): index out of bounds" ); + arma_conform_check_bounds( (i >= in_m.n_cols), "SpMat::cols(): index out of bounds" ); } } @@ -69,7 +69,7 @@ inline void SpSubview_col_list::for_each(functor F) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat tmp(*this); @@ -86,7 +86,7 @@ inline void SpSubview_col_list::for_each(functor F) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpMat tmp(*this); @@ -102,7 +102,7 @@ inline void SpSubview_col_list::transform(functor F) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat tmp(*this); @@ -118,7 +118,7 @@ inline void SpSubview_col_list::replace(const eT old_val, const eT new_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat tmp(*this); @@ -134,7 +134,7 @@ inline void SpSubview_col_list::clean(const typename get_pod_type::result threshold) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat tmp(*this); @@ -150,7 +150,7 @@ inline void SpSubview_col_list::fill(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat tmp(m.n_rows, U_ci.M.n_elem, arma_nozeros_indicator()); tmp.fill(val); @@ -164,7 +164,7 @@ inline void SpSubview_col_list::zeros() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat& m_local = const_cast< SpMat& >(m); @@ -201,7 +201,7 @@ inline void SpSubview_col_list::ones() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat tmp(m.n_rows, U_ci.M.n_elem, fill::ones); @@ -215,7 +215,7 @@ inline void SpSubview_col_list::operator+= (const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpMat tmp1(*this); @@ -233,7 +233,7 @@ inline void SpSubview_col_list::operator-= (const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpMat tmp1(*this); @@ -251,7 +251,7 @@ inline void SpSubview_col_list::operator*= (const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(val == eT(0)) { (*this).zeros(); return; } @@ -296,7 +296,7 @@ inline void SpSubview_col_list::operator/= (const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpMat tmp1(*this); @@ -315,7 +315,7 @@ inline void SpSubview_col_list::operator= (const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap U(x.get_ref()); const Mat& X = U.M; @@ -326,7 +326,7 @@ SpSubview_col_list::operator= (const Base& x) const uword* ci_mem = ci.memptr(); const uword ci_n_elem = ci.n_elem; - arma_debug_assert_same_size( m_local.n_rows, ci_n_elem, X.n_rows, X.n_cols, "SpMat::cols()" ); + arma_conform_assert_same_size( m_local.n_rows, ci_n_elem, X.n_rows, X.n_cols, "SpMat::cols()" ); const uword X_n_elem = X.n_elem; const eT* X_mem = X.memptr(); @@ -378,7 +378,7 @@ inline void SpSubview_col_list::operator+= (const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat tmp = SpMat(*this) + x.get_ref(); @@ -393,7 +393,7 @@ inline void SpSubview_col_list::operator-= (const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat tmp = SpMat(*this) - x.get_ref(); @@ -408,7 +408,7 @@ inline void SpSubview_col_list::operator%= (const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpMat tmp = SpMat(*this) % x.get_ref(); @@ -423,7 +423,7 @@ inline void SpSubview_col_list::operator/= (const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpMat tmp = SpMat(*this) / x.get_ref(); @@ -437,7 +437,7 @@ inline void SpSubview_col_list::operator= (const SpSubview_col_list& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpMat tmp(x); @@ -452,7 +452,7 @@ inline void SpSubview_col_list::operator= (const SpSubview_col_list& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpMat tmp(x); @@ -467,7 +467,7 @@ inline void SpSubview_col_list::operator= (const SpBase& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat U(x.get_ref()); const SpMat& X = U.M; @@ -487,7 +487,7 @@ SpSubview_col_list::operator= (const SpBase& x) const uword* ci_mem = ci.memptr(); const uword ci_n_elem = ci.n_elem; - arma_debug_assert_same_size( m_local.n_rows, ci_n_elem, X.n_rows, X.n_cols, "SpMat::cols()" ); + arma_conform_assert_same_size( m_local.n_rows, ci_n_elem, X.n_rows, X.n_cols, "SpMat::cols()" ); SpMat Y(arma_reserve_indicator(), X.n_rows, m_local.n_cols, X.n_nonzero); @@ -531,7 +531,7 @@ inline void SpSubview_col_list::operator+= (const SpBase& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpMat tmp = SpMat(*this) + x.get_ref(); @@ -546,7 +546,7 @@ inline void SpSubview_col_list::operator-= (const SpBase& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpMat tmp = SpMat(*this) - x.get_ref(); @@ -561,7 +561,7 @@ inline void SpSubview_col_list::operator%= (const SpBase& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpMat tmp = SpMat(*this) % x.get_ref(); @@ -576,7 +576,7 @@ inline void SpSubview_col_list::operator/= (const SpBase& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat tmp(*this); @@ -597,7 +597,7 @@ inline void SpSubview_col_list::extract(SpMat& out, const SpSubview_col_list& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: aliasing is handled by SpMat::operator=(const SpSubview_col_list& in) @@ -665,7 +665,7 @@ inline void SpSubview_col_list::plus_inplace(SpMat& out, const SpSubview_col_list& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpMat tmp(in); @@ -679,7 +679,7 @@ inline void SpSubview_col_list::minus_inplace(SpMat& out, const SpSubview_col_list& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpMat tmp(in); @@ -693,7 +693,7 @@ inline void SpSubview_col_list::schur_inplace(SpMat& out, const SpSubview_col_list& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpMat tmp(in); @@ -707,7 +707,7 @@ inline void SpSubview_col_list::div_inplace(SpMat& out, const SpSubview_col_list& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpMat tmp(in); diff --git a/inst/include/armadillo_bits/SpSubview_meat.hpp b/inst/include/armadillo_bits/SpSubview_meat.hpp index a598f21a..8b2e704a 100644 --- a/inst/include/armadillo_bits/SpSubview_meat.hpp +++ b/inst/include/armadillo_bits/SpSubview_meat.hpp @@ -24,7 +24,7 @@ template inline SpSubview::~SpSubview() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } @@ -40,7 +40,7 @@ SpSubview::SpSubview(const SpMat& in_m, const uword in_row1, const uword , n_elem(in_n_rows * in_n_cols) , n_nonzero(0) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); m.sync_csc(); @@ -53,7 +53,7 @@ SpSubview::SpSubview(const SpMat& in_m, const uword in_row1, const uword } else { - arma_extra_debug_print("counting non-zeros in sparse subview"); + arma_debug_print("counting non-zeros in sparse subview"); uword lend = m.col_ptrs[in_col1 + in_n_cols]; uword lend_row = in_row1 + in_n_rows; @@ -84,7 +84,7 @@ SpSubview::SpSubview(const SpSubview& in) , n_elem (in.n_elem ) , n_nonzero(in.n_nonzero) { - arma_extra_debug_sigprint(arma_str::format("this = %x in = %x") % this % &in); + arma_debug_sigprint(arma_str::format("this: %x; in: %x") % this % &in); } @@ -100,7 +100,7 @@ SpSubview::SpSubview(SpSubview&& in) , n_elem (in.n_elem ) , n_nonzero(in.n_nonzero) { - arma_extra_debug_sigprint(arma_str::format("this = %x in = %x") % this % &in); + arma_debug_sigprint(arma_str::format("this: %x; in: %x") % this % &in); // for paranoia @@ -119,7 +119,7 @@ inline const SpSubview& SpSubview::operator+=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(val == eT(0)) { return *this; } @@ -137,7 +137,7 @@ inline const SpSubview& SpSubview::operator-=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(val == eT(0)) { return *this; } @@ -155,7 +155,7 @@ inline const SpSubview& SpSubview::operator*=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(val == eT(0)) { (*this).zeros(); return *this; } @@ -217,9 +217,9 @@ inline const SpSubview& SpSubview::operator/=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (val == eT(0)), "element-wise division: division by zero" ); + arma_conform_check( (val == eT(0)), "element-wise division: division by zero" ); m.sync_csc(); m.invalidate_cache(); @@ -278,13 +278,13 @@ inline const SpSubview& SpSubview::operator=(const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(is_same_type< T1, Gen, gen_zeros> >::yes) { const Proxy P(in.get_ref()); - arma_debug_assert_same_size(n_rows, n_cols, P.get_n_rows(), P.get_n_cols(), "insertion into sparse submatrix"); + arma_conform_assert_same_size(n_rows, n_cols, P.get_n_rows(), P.get_n_cols(), "insertion into sparse submatrix"); (*this).zeros(); @@ -295,7 +295,7 @@ SpSubview::operator=(const Base& in) { const Proxy P(in.get_ref()); - arma_debug_assert_same_size(n_rows, n_cols, P.get_n_rows(), P.get_n_cols(), "insertion into sparse submatrix"); + arma_conform_assert_same_size(n_rows, n_cols, P.get_n_rows(), P.get_n_cols(), "insertion into sparse submatrix"); (*this).eye(); @@ -304,7 +304,7 @@ SpSubview::operator=(const Base& in) const quasi_unwrap U(in.get_ref()); - arma_debug_assert_same_size(n_rows, n_cols, U.M.n_rows, U.M.n_cols, "insertion into sparse submatrix"); + arma_conform_assert_same_size(n_rows, n_cols, U.M.n_rows, U.M.n_cols, "insertion into sparse submatrix"); spglue_merge::subview_merge(*this, U.M); @@ -319,7 +319,7 @@ inline const SpSubview& SpSubview::operator+=(const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).operator=( (*this) + x.get_ref() ); } @@ -332,7 +332,7 @@ inline const SpSubview& SpSubview::operator-=(const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).operator=( (*this) - x.get_ref() ); } @@ -345,7 +345,7 @@ inline const SpSubview& SpSubview::operator*=(const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat tmp(*this); @@ -362,14 +362,14 @@ inline const SpSubview& SpSubview::operator%=(const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpSubview& sv = (*this); const quasi_unwrap U(x.get_ref()); const Mat& B = U.M; - arma_debug_assert_same_size(sv.n_rows, sv.n_cols, B.n_rows, B.n_cols, "element-wise multiplication"); + arma_conform_assert_same_size(sv.n_rows, sv.n_cols, B.n_rows, B.n_cols, "element-wise multiplication"); SpMat& sv_m = access::rw(sv.m); @@ -428,14 +428,14 @@ inline const SpSubview& SpSubview::operator/=(const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpSubview& A = (*this); const quasi_unwrap U(x.get_ref()); const Mat& B = U.M; - arma_debug_assert_same_size(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "element-wise division"); + arma_conform_assert_same_size(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "element-wise division"); bool result_ok = true; @@ -501,7 +501,7 @@ inline const SpSubview& SpSubview::operator=(const SpSubview& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).operator_equ_common(x); } @@ -514,7 +514,7 @@ inline const SpSubview& SpSubview::operator=(const SpBase& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).operator_equ_common( x.get_ref() ); } @@ -527,11 +527,11 @@ inline const SpSubview& SpSubview::operator_equ_common(const SpBase& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat U(in.get_ref()); - arma_debug_assert_same_size(n_rows, n_cols, U.M.n_rows, U.M.n_cols, "insertion into sparse submatrix"); + arma_conform_assert_same_size(n_rows, n_cols, U.M.n_rows, U.M.n_cols, "insertion into sparse submatrix"); if(U.is_alias(m)) { @@ -555,7 +555,7 @@ inline const SpSubview& SpSubview::operator+=(const SpBase& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // TODO: implement dedicated machinery return (*this).operator=( (*this) + x.get_ref() ); @@ -569,7 +569,7 @@ inline const SpSubview& SpSubview::operator-=(const SpBase& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // TODO: implement dedicated machinery return (*this).operator=( (*this) - x.get_ref() ); @@ -583,7 +583,7 @@ inline const SpSubview& SpSubview::operator*=(const SpBase& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).operator=( (*this) * x.get_ref() ); } @@ -596,7 +596,7 @@ inline const SpSubview& SpSubview::operator%=(const SpBase& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // TODO: implement dedicated machinery return (*this).operator=( (*this) % x.get_ref() ); @@ -610,13 +610,13 @@ inline const SpSubview& SpSubview::operator/=(const SpBase& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: use of this function is not advised; it is implemented only for completeness SpProxy p(x.get_ref()); - arma_debug_assert_same_size(n_rows, n_cols, p.get_n_rows(), p.get_n_cols(), "element-wise division"); + arma_conform_assert_same_size(n_rows, n_cols, p.get_n_rows(), p.get_n_cols(), "element-wise division"); if(p.is_alias(m) == false) { @@ -645,7 +645,7 @@ inline void SpSubview::for_each(functor F) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); m.sync_csc(); m.invalidate_cache(); @@ -702,7 +702,7 @@ inline void SpSubview::for_each(functor F) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); m.sync_csc(); @@ -740,7 +740,7 @@ inline void SpSubview::transform(functor F) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); m.sync_csc(); m.invalidate_cache(); @@ -796,7 +796,7 @@ inline void SpSubview::replace(const eT old_val, const eT new_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(old_val == eT(0)) { @@ -875,7 +875,7 @@ inline void SpSubview::clean(const typename get_pod_type::result threshold) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if((n_elem == 0) || (n_nonzero == 0)) { return; } @@ -903,16 +903,16 @@ inline void SpSubview::clamp(const eT min_val, const eT max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(is_cx::no) { - arma_debug_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "SpSubview::clamp(): min_val must be less than max_val" ); + arma_conform_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "SpSubview::clamp(): min_val must be less than max_val" ); } else { - arma_debug_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "SpSubview::clamp(): real(min_val) must be less than real(max_val)" ); - arma_debug_check( (access::tmp_imag(min_val) > access::tmp_imag(max_val)), "SpSubview::clamp(): imag(min_val) must be less than imag(max_val)" ); + arma_conform_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "SpSubview::clamp(): real(min_val) must be less than real(max_val)" ); + arma_conform_check( (access::tmp_imag(min_val) > access::tmp_imag(max_val)), "SpSubview::clamp(): imag(min_val) must be less than imag(max_val)" ); } if((n_elem == 0) || (n_nonzero == 0)) { return; } @@ -933,7 +933,7 @@ inline void SpSubview::fill(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(val != eT(0)) { @@ -956,7 +956,7 @@ inline void SpSubview::zeros() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if((n_elem == 0) || (n_nonzero == 0)) { return; } @@ -1013,7 +1013,7 @@ inline void SpSubview::ones() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).fill(eT(1)); } @@ -1025,7 +1025,7 @@ inline void SpSubview::eye() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat tmp; @@ -1041,7 +1041,7 @@ inline void SpSubview::randu() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat tmp( (*this).n_rows, (*this).n_cols, fill::randu ); @@ -1055,7 +1055,7 @@ inline void SpSubview::randn() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat tmp( (*this).n_rows, (*this).n_cols, fill::randn ); @@ -1095,7 +1095,7 @@ inline SpSubview_MapMat_val SpSubview::operator()(const uword i) { - arma_debug_check_bounds( (i >= n_elem), "SpSubview::operator(): index out of bounds" ); + arma_conform_check_bounds( (i >= n_elem), "SpSubview::operator(): index out of bounds" ); const uword lrow = i % n_rows; const uword lcol = i / n_rows; @@ -1110,7 +1110,7 @@ inline eT SpSubview::operator()(const uword i) const { - arma_debug_check_bounds( (i >= n_elem), "SpSubview::operator(): index out of bounds" ); + arma_conform_check_bounds( (i >= n_elem), "SpSubview::operator(): index out of bounds" ); const uword lrow = i % n_rows; const uword lcol = i / n_rows; @@ -1125,7 +1125,7 @@ inline SpSubview_MapMat_val SpSubview::operator()(const uword in_row, const uword in_col) { - arma_debug_check_bounds( (in_row >= n_rows) || (in_col >= n_cols), "SpSubview::operator(): index out of bounds" ); + arma_conform_check_bounds( (in_row >= n_rows) || (in_col >= n_cols), "SpSubview::operator(): index out of bounds" ); return (*this).at(in_row, in_col); } @@ -1137,7 +1137,7 @@ inline eT SpSubview::operator()(const uword in_row, const uword in_col) const { - arma_debug_check_bounds( (in_row >= n_rows) || (in_col >= n_cols), "SpSubview::operator(): index out of bounds" ); + arma_conform_check_bounds( (in_row >= n_rows) || (in_col >= n_cols), "SpSubview::operator(): index out of bounds" ); return (*this).at(in_row, in_col); } @@ -1246,9 +1246,9 @@ inline SpSubview_row SpSubview::row(const uword row_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds(row_num >= n_rows, "SpSubview::row(): out of bounds"); + arma_conform_check_bounds(row_num >= n_rows, "SpSubview::row(): out of bounds"); return SpSubview_row(const_cast< SpMat& >(m), row_num + aux_row1, aux_col1, n_cols); } @@ -1260,9 +1260,9 @@ inline const SpSubview_row SpSubview::row(const uword row_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds(row_num >= n_rows, "SpSubview::row(): out of bounds"); + arma_conform_check_bounds(row_num >= n_rows, "SpSubview::row(): out of bounds"); return SpSubview_row(m, row_num + aux_row1, aux_col1, n_cols); } @@ -1274,9 +1274,9 @@ inline SpSubview_col SpSubview::col(const uword col_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds(col_num >= n_cols, "SpSubview::col(): out of bounds"); + arma_conform_check_bounds(col_num >= n_cols, "SpSubview::col(): out of bounds"); return SpSubview_col(const_cast< SpMat& >(m), col_num + aux_col1, aux_row1, n_rows); } @@ -1288,9 +1288,9 @@ inline const SpSubview_col SpSubview::col(const uword col_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds(col_num >= n_cols, "SpSubview::col(): out of bounds"); + arma_conform_check_bounds(col_num >= n_cols, "SpSubview::col(): out of bounds"); return SpSubview_col(m, col_num + aux_col1, aux_row1, n_rows); } @@ -1302,9 +1302,9 @@ inline SpSubview SpSubview::rows(const uword in_row1, const uword in_row2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_row2 >= n_rows), "SpSubview::rows(): indices out of bounds or incorrectly used" @@ -1320,9 +1320,9 @@ inline const SpSubview SpSubview::rows(const uword in_row1, const uword in_row2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_row2 >= n_rows), "SpSubview::rows(): indices out of bounds or incorrectly used" @@ -1338,9 +1338,9 @@ inline SpSubview SpSubview::cols(const uword in_col1, const uword in_col2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_col1 > in_col2) || (in_col2 >= n_cols), "SpSubview::cols(): indices out of bounds or incorrectly used" @@ -1356,9 +1356,9 @@ inline const SpSubview SpSubview::cols(const uword in_col1, const uword in_col2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_col1 > in_col2) || (in_col2 >= n_cols), "SpSubview::cols(): indices out of bounds or incorrectly used" @@ -1374,9 +1374,9 @@ inline SpSubview SpSubview::submat(const uword in_row1, const uword in_col1, const uword in_row2, const uword in_col2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols), "SpSubview::submat(): indices out of bounds or incorrectly used" @@ -1392,9 +1392,9 @@ inline const SpSubview SpSubview::submat(const uword in_row1, const uword in_col1, const uword in_row2, const uword in_col2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols), "SpSubview::submat(): indices out of bounds or incorrectly used" @@ -1410,7 +1410,7 @@ inline SpSubview SpSubview::submat(const span& row_span, const span& col_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool row_all = row_span.whole; const bool col_all = row_span.whole; @@ -1421,7 +1421,7 @@ SpSubview::submat(const span& row_span, const span& col_span) const uword in_col1 = col_all ? 0 : col_span.a; const uword in_col2 = col_all ? n_cols : col_span.b; - arma_debug_check_bounds + arma_conform_check_bounds ( ( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= n_rows))) || @@ -1439,7 +1439,7 @@ inline const SpSubview SpSubview::submat(const span& row_span, const span& col_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool row_all = row_span.whole; const bool col_all = row_span.whole; @@ -1450,7 +1450,7 @@ SpSubview::submat(const span& row_span, const span& col_span) const const uword in_col1 = col_all ? 0 : col_span.a; const uword in_col2 = col_all ? n_cols - 1 : col_span.b; - arma_debug_check_bounds + arma_conform_check_bounds ( ( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= n_rows))) || @@ -1468,7 +1468,7 @@ inline SpSubview SpSubview::operator()(const uword row_num, const span& col_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return submat(span(row_num, row_num), col_span); } @@ -1480,7 +1480,7 @@ inline const SpSubview SpSubview::operator()(const uword row_num, const span& col_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return submat(span(row_num, row_num), col_span); } @@ -1492,7 +1492,7 @@ inline SpSubview SpSubview::operator()(const span& row_span, const uword col_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return submat(row_span, span(col_num, col_num)); } @@ -1504,7 +1504,7 @@ inline const SpSubview SpSubview::operator()(const span& row_span, const uword col_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return submat(row_span, span(col_num, col_num)); } @@ -1516,7 +1516,7 @@ inline SpSubview SpSubview::operator()(const span& row_span, const span& col_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return submat(row_span, col_span); } @@ -1528,7 +1528,7 @@ inline const SpSubview SpSubview::operator()(const span& row_span, const span& col_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return submat(row_span, col_span); } @@ -1540,9 +1540,9 @@ inline void SpSubview::swap_rows(const uword in_row1, const uword in_row2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check((in_row1 >= n_rows) || (in_row2 >= n_rows), "SpSubview::swap_rows(): invalid row index"); + arma_conform_check((in_row1 >= n_rows) || (in_row2 >= n_rows), "SpSubview::swap_rows(): invalid row index"); const uword lstart_col = aux_col1; const uword lend_col = aux_col1 + n_cols; @@ -1562,9 +1562,9 @@ inline void SpSubview::swap_cols(const uword in_col1, const uword in_col2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check((in_col1 >= n_cols) || (in_col2 >= n_cols), "SpSubview::swap_cols(): invalid column index"); + arma_conform_check((in_col1 >= n_cols) || (in_col2 >= n_cols), "SpSubview::swap_cols(): invalid column index"); const uword lstart_row = aux_row1; const uword lend_row = aux_row1 + n_rows; @@ -1761,7 +1761,7 @@ inline eT& SpSubview::insert_element(const uword in_row, const uword in_col, const eT in_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // This may not actually insert an element. const uword old_n_nonzero = m.n_nonzero; @@ -1779,7 +1779,7 @@ inline void SpSubview::delete_element(const uword in_row, const uword in_col) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // This may not actually delete an element. const uword old_n_nonzero = m.n_nonzero; @@ -1794,7 +1794,7 @@ inline void SpSubview::invalidate_cache() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); m.invalidate_cache(); } @@ -1812,7 +1812,7 @@ inline SpSubview_col::SpSubview_col(const SpMat& in_m, const uword in_col) : SpSubview(in_m, 0, in_col, in_m.n_rows, 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -1822,7 +1822,7 @@ inline SpSubview_col::SpSubview_col(const SpMat& in_m, const uword in_col, const uword in_row1, const uword in_n_rows) : SpSubview(in_m, in_row1, in_col, in_n_rows, 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -1832,7 +1832,7 @@ inline void SpSubview_col::operator=(const SpSubview& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpSubview::operator=(x); } @@ -1844,7 +1844,7 @@ inline void SpSubview_col::operator=(const SpSubview_col& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpSubview::operator=(x); // interprets 'SpSubview_col' as 'SpSubview' } @@ -1857,7 +1857,7 @@ inline void SpSubview_col::operator=(const SpBase& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpSubview::operator=(x); } @@ -1870,7 +1870,7 @@ inline void SpSubview_col::operator=(const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpSubview::operator=(x); } @@ -1918,7 +1918,7 @@ inline SpSubview_row::SpSubview_row(const SpMat& in_m, const uword in_row) : SpSubview(in_m, in_row, 0, 1, in_m.n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -1928,7 +1928,7 @@ inline SpSubview_row::SpSubview_row(const SpMat& in_m, const uword in_row, const uword in_col1, const uword in_n_cols) : SpSubview(in_m, in_row, in_col1, 1, in_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -1938,7 +1938,7 @@ inline void SpSubview_row::operator=(const SpSubview& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpSubview::operator=(x); } @@ -1950,7 +1950,7 @@ inline void SpSubview_row::operator=(const SpSubview_row& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpSubview::operator=(x); // interprets 'SpSubview_row' as 'SpSubview' } @@ -1963,7 +1963,7 @@ inline void SpSubview_row::operator=(const SpBase& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpSubview::operator=(x); } @@ -1976,7 +1976,7 @@ inline void SpSubview_row::operator=(const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpSubview::operator=(x); } diff --git a/inst/include/armadillo_bits/SpToDGlue_bones.hpp b/inst/include/armadillo_bits/SpToDGlue_bones.hpp index 7d4ce9d3..158dd6b8 100644 --- a/inst/include/armadillo_bits/SpToDGlue_bones.hpp +++ b/inst/include/armadillo_bits/SpToDGlue_bones.hpp @@ -29,15 +29,15 @@ class SpToDGlue : public Base< typename T1::elem_type, SpToDGlue::result pod_type; + static constexpr bool is_row = glue_type::template traits::is_row; + static constexpr bool is_col = glue_type::template traits::is_col; + static constexpr bool is_xvec = glue_type::template traits::is_xvec; + inline explicit SpToDGlue(const T1& in_A, const T2& in_B); inline ~SpToDGlue(); const T1& A; //!< first operand; must be derived from Base or SpBase const T2& B; //!< second operand; must be derived from Base or SpBase - - static constexpr bool is_row = glue_type::template traits::is_row; - static constexpr bool is_col = glue_type::template traits::is_col; - static constexpr bool is_xvec = glue_type::template traits::is_xvec; }; diff --git a/inst/include/armadillo_bits/SpToDGlue_meat.hpp b/inst/include/armadillo_bits/SpToDGlue_meat.hpp index 1d3d095f..26c26a9b 100644 --- a/inst/include/armadillo_bits/SpToDGlue_meat.hpp +++ b/inst/include/armadillo_bits/SpToDGlue_meat.hpp @@ -27,7 +27,7 @@ SpToDGlue::SpToDGlue(const T1& in_A, const T2& in_B) : A(in_A) , B(in_B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -36,7 +36,7 @@ template inline SpToDGlue::~SpToDGlue() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } diff --git a/inst/include/armadillo_bits/SpToDOp_bones.hpp b/inst/include/armadillo_bits/SpToDOp_bones.hpp index b8ae6ccb..4a49028b 100644 --- a/inst/include/armadillo_bits/SpToDOp_bones.hpp +++ b/inst/include/armadillo_bits/SpToDOp_bones.hpp @@ -21,17 +21,6 @@ -//! Class for storing data required for delayed unary operations on a sparse -//! matrix that produce a dense matrix; the data for storage may include -//! the operand (eg. the matrix to which the operation is to be applied) and the unary operator (eg. inverse). -//! The operand is stored as a reference (which can be optimised away), -//! while the operator is "stored" through the template definition (op_type). -//! The operands can be 'SpMat', 'SpRow', 'SpCol', 'SpOp', and 'SpGlue'. -//! Note that as 'SpGlue' can be one of the operands, more than one matrix can be stored. -//! -//! For example, we could have: -//! SpToDOp< SpGlue< SpMat, SpMat, sp_glue_times >, op_sp_plus > - template class SpToDOp : public Base< typename T1::elem_type, SpToDOp > { @@ -40,16 +29,19 @@ class SpToDOp : public Base< typename T1::elem_type, SpToDOp > typedef typename T1::elem_type elem_type; typedef typename get_pod_type::result pod_type; + static constexpr bool is_row = op_type::template traits::is_row; + static constexpr bool is_col = op_type::template traits::is_col; + static constexpr bool is_xvec = op_type::template traits::is_xvec; + inline explicit SpToDOp(const T1& in_m); inline SpToDOp(const T1& in_m, const elem_type in_aux); + inline SpToDOp(const T1& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b); inline ~SpToDOp(); arma_aligned const T1& m; //!< the operand; must be derived from SpBase arma_aligned elem_type aux; //!< auxiliary data, using the element type as used by T1 - - static constexpr bool is_row = op_type::template traits::is_row; - static constexpr bool is_col = op_type::template traits::is_col; - static constexpr bool is_xvec = op_type::template traits::is_xvec; + arma_aligned uword aux_uword_a; //!< auxiliary data, uword format + arma_aligned uword aux_uword_b; //!< auxiliary data, uword format }; diff --git a/inst/include/armadillo_bits/SpToDOp_meat.hpp b/inst/include/armadillo_bits/SpToDOp_meat.hpp index 66ab6405..edcec8af 100644 --- a/inst/include/armadillo_bits/SpToDOp_meat.hpp +++ b/inst/include/armadillo_bits/SpToDOp_meat.hpp @@ -26,7 +26,7 @@ inline SpToDOp::SpToDOp(const T1& in_m) : m(in_m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -37,7 +37,19 @@ SpToDOp::SpToDOp(const T1& in_m, const typename T1::elem_type in_au : m(in_m) , aux(in_aux) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); + } + + + +template +inline +SpToDOp::SpToDOp(const T1& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b) + : m(in_m) + , aux_uword_a(in_aux_uword_a) + , aux_uword_b(in_aux_uword_b) + { + arma_debug_sigprint(); } @@ -46,7 +58,7 @@ template inline SpToDOp::~SpToDOp() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } diff --git a/inst/include/armadillo_bits/arma_config.hpp b/inst/include/armadillo_bits/arma_config.hpp index 139efa7d..e7d45314 100644 --- a/inst/include/armadillo_bits/arma_config.hpp +++ b/inst/include/armadillo_bits/arma_config.hpp @@ -65,6 +65,13 @@ struct arma_config #endif + #if defined(ARMA_CHECK_CONFORMANCE) + static constexpr bool check_conformance = true; + #else + static constexpr bool check_conformance = false; + #endif + + #if defined(ARMA_CHECK_NONFINITE) static constexpr bool check_nonfinite = true; #else @@ -121,20 +128,6 @@ struct arma_config #endif - #if defined(ARMA_NO_DEBUG) - static constexpr bool debug = false; - #else - static constexpr bool debug = true; - #endif - - - #if defined(ARMA_EXTRA_DEBUG) - static constexpr bool extra_debug = true; - #else - static constexpr bool extra_debug = false; - #endif - - #if defined(ARMA_GOOD_COMPILER) static constexpr bool good_comp = true; #else @@ -188,7 +181,7 @@ struct arma_config #endif - #if (!defined(ARMA_DONT_USE_STD_MUTEX)) + #if defined(ARMA_USE_STD_MUTEX) static constexpr bool std_mutex = true; #else static constexpr bool std_mutex = false; @@ -223,13 +216,6 @@ struct arma_config #endif - #if defined(ARMA_DONT_ZERO_INIT) - static constexpr bool zero_init = false; - #else - static constexpr bool zero_init = true; - #endif - - #if defined(ARMA_FAST_MATH) static constexpr bool fast_math = true; #else diff --git a/inst/include/armadillo_bits/arma_forward.hpp b/inst/include/armadillo_bits/arma_forward.hpp index 4b2f37f1..f1249df1 100644 --- a/inst/include/armadillo_bits/arma_forward.hpp +++ b/inst/include/armadillo_bits/arma_forward.hpp @@ -244,6 +244,7 @@ template< typename T1, typename eop_type> class eOp; template< typename T1, typename op_type> class SpToDOp; template< typename T1, typename op_type> class CubeToMatOp; template class mtOp; +template class mtSpToDOp; template< typename T1, typename T2, typename glue_type> class Glue; template< typename T1, typename T2, typename eglue_type> class eGlue; @@ -280,7 +281,7 @@ struct state_type { #if defined(ARMA_USE_OPENMP) int state; - #elif (!defined(ARMA_DONT_USE_STD_MUTEX)) + #elif defined(ARMA_USE_STD_MUTEX) std::atomic state; #else int state; @@ -299,7 +300,7 @@ struct state_type #if defined(ARMA_USE_OPENMP) #pragma omp atomic read out = state; - #elif (!defined(ARMA_DONT_USE_STD_MUTEX)) + #elif defined(ARMA_USE_STD_MUTEX) out = state.load(); #else out = state; @@ -315,7 +316,7 @@ struct state_type #if defined(ARMA_USE_OPENMP) #pragma omp atomic write state = in_state; - #elif (!defined(ARMA_DONT_USE_STD_MUTEX)) + #elif defined(ARMA_USE_STD_MUTEX) state.store(in_state); #else state = in_state; diff --git a/inst/include/armadillo_bits/arma_ostream_meat.hpp b/inst/include/armadillo_bits/arma_ostream_meat.hpp index dbd4b6ca..bf79a1b7 100644 --- a/inst/include/armadillo_bits/arma_ostream_meat.hpp +++ b/inst/include/armadillo_bits/arma_ostream_meat.hpp @@ -190,7 +190,7 @@ inline std::streamsize arma_ostream::modify_stream(std::ostream& o, typename SpMat::const_iterator begin, const uword n_elem, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); o.unsetf(ios::showbase); @@ -429,7 +429,7 @@ inline void arma_ostream::print(std::ostream& o, const Mat& m, const bool modify) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const arma_ostream_state stream_state(o); @@ -498,7 +498,7 @@ inline void arma_ostream::print(std::ostream& o, const Cube& x, const bool modify) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const arma_ostream_state stream_state(o); @@ -540,7 +540,7 @@ inline void arma_ostream::print(std::ostream& o, const field& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const arma_ostream_state stream_state(o); @@ -613,7 +613,7 @@ inline void arma_ostream::print(std::ostream& o, const subview_field& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const arma_ostream_state stream_state(o); @@ -683,7 +683,7 @@ inline void arma_ostream::print_dense(std::ostream& o, const SpMat& m, const bool modify) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const arma_ostream_state stream_state(o); @@ -765,7 +765,7 @@ inline void arma_ostream::print(std::ostream& o, const SpMat& m, const bool modify) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const arma_ostream_state stream_state(o); @@ -867,7 +867,7 @@ inline void arma_ostream::print(std::ostream& o, const SizeMat& S) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const arma_ostream_state stream_state(o); @@ -888,7 +888,7 @@ inline void arma_ostream::print(std::ostream& o, const SizeCube& S) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const arma_ostream_state stream_state(o); @@ -910,7 +910,7 @@ inline void arma_ostream::brief_print(std::ostream& o, const Mat& m, const bool print_size) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const arma_ostream_state stream_state(o); @@ -1068,7 +1068,7 @@ inline void arma_ostream::brief_print(std::ostream& o, const Cube& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const arma_ostream_state stream_state(o); @@ -1125,7 +1125,7 @@ inline void arma_ostream::brief_print(std::ostream& o, const SpMat& m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(m.n_nonzero <= 10) { arma_ostream::print(o, m, true); return; } diff --git a/inst/include/armadillo_bits/arma_rng.hpp b/inst/include/armadillo_bits/arma_rng.hpp index da1b4f7a..f1048810 100644 --- a/inst/include/armadillo_bits/arma_rng.hpp +++ b/inst/include/armadillo_bits/arma_rng.hpp @@ -74,7 +74,7 @@ #define ARMA_GUARD_PRODUCER #endif -#if (defined(ARMA_DONT_GUARD_PRODUCER) || defined(ARMA_DONT_USE_STD_MUTEX)) +#if (defined(ARMA_DONT_GUARD_PRODUCER) || (!defined(ARMA_USE_STD_MUTEX))) #undef ARMA_GUARD_PRODUCER #endif diff --git a/inst/include/armadillo_bits/arma_version.hpp b/inst/include/armadillo_bits/arma_version.hpp index db46be62..e7bec3e6 100644 --- a/inst/include/armadillo_bits/arma_version.hpp +++ b/inst/include/armadillo_bits/arma_version.hpp @@ -21,10 +21,10 @@ -#define ARMA_VERSION_MAJOR 12 -#define ARMA_VERSION_MINOR 8 -#define ARMA_VERSION_PATCH 4 -#define ARMA_VERSION_NAME "Cortisol Injector" +#define ARMA_VERSION_MAJOR 13 +#define ARMA_VERSION_MINOR 90 +#define ARMA_VERSION_PATCH 0 +#define ARMA_VERSION_NAME "unstable - not for production use" diff --git a/inst/include/armadillo_bits/auxlib_meat.hpp b/inst/include/armadillo_bits/auxlib_meat.hpp index 373aaa4e..ef697b3a 100644 --- a/inst/include/armadillo_bits/auxlib_meat.hpp +++ b/inst/include/armadillo_bits/auxlib_meat.hpp @@ -26,13 +26,13 @@ inline bool auxlib::inv(Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(A.is_empty()) { return true; } #if defined(ARMA_USE_LAPACK) { - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); blas_int n = blas_int(A.n_rows); blas_int lda = blas_int(A.n_rows); @@ -41,7 +41,7 @@ auxlib::inv(Mat& A) podarray ipiv(A.n_rows); - arma_extra_debug_print("lapack::getrf()"); + arma_debug_print("lapack::getrf()"); lapack::getrf(&n, &n, A.memptr(), &lda, ipiv.memptr(), &info); if(info != 0) { return false; } @@ -51,7 +51,7 @@ auxlib::inv(Mat& A) eT work_query[2] = {}; blas_int lwork_query = -1; - arma_extra_debug_print("lapack::getri()"); + arma_debug_print("lapack::getri()"); lapack::getri(&n, A.memptr(), &lda, ipiv.memptr(), &work_query[0], &lwork_query, &info); if(info != 0) { return false; } @@ -63,7 +63,7 @@ auxlib::inv(Mat& A) podarray work( static_cast(lwork) ); - arma_extra_debug_print("lapack::getri()"); + arma_debug_print("lapack::getri()"); lapack::getri(&n, A.memptr(), &lda, ipiv.memptr(), work.memptr(), &lwork, &info); return (info == 0); @@ -84,7 +84,7 @@ inline bool auxlib::inv(Mat& out, const Mat& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out = X; @@ -98,7 +98,7 @@ inline bool auxlib::inv_rcond(Mat& A, typename get_pod_type::result& out_rcond) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -108,7 +108,7 @@ auxlib::inv_rcond(Mat& A, typename get_pod_type::result& out_rcond) #if defined(ARMA_USE_LAPACK) { - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); char norm_id = '1'; blas_int n = blas_int(A.n_rows); @@ -120,10 +120,10 @@ auxlib::inv_rcond(Mat& A, typename get_pod_type::result& out_rcond) podarray junk(1); podarray ipiv(A.n_rows); - arma_extra_debug_print("lapack::lange()"); + arma_debug_print("lapack::lange()"); norm_val = (has_blas_float_bug::value) ? auxlib::norm1_gen(A) : lapack::lange(&norm_id, &n, &n, A.memptr(), &lda, junk.memptr()); - arma_extra_debug_print("lapack::getrf()"); + arma_debug_print("lapack::getrf()"); lapack::getrf(&n, &n, A.memptr(), &lda, ipiv.memptr(), &info); if(info != 0) { return false; } @@ -135,7 +135,7 @@ auxlib::inv_rcond(Mat& A, typename get_pod_type::result& out_rcond) eT work_query[2] = {}; blas_int lwork_query = -1; - arma_extra_debug_print("lapack::getri()"); + arma_debug_print("lapack::getri()"); lapack::getri(&n, A.memptr(), &lda, ipiv.memptr(), &work_query[0], &lwork_query, &info); if(info != 0) { return false; } @@ -147,7 +147,7 @@ auxlib::inv_rcond(Mat& A, typename get_pod_type::result& out_rcond) podarray work( static_cast(lwork) ); - arma_extra_debug_print("lapack::getri()"); + arma_debug_print("lapack::getri()"); lapack::getri(&n, A.memptr(), &lda, ipiv.memptr(), work.memptr(), &lwork, &info); return (info == 0); @@ -168,20 +168,20 @@ inline bool auxlib::inv_tr(Mat& A, const uword layout) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { if(A.is_empty()) { return true; } - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); char uplo = (layout == 0) ? 'U' : 'L'; char diag = 'N'; blas_int n = blas_int(A.n_rows); blas_int info = 0; - arma_extra_debug_print("lapack::trtri()"); + arma_debug_print("lapack::trtri()"); lapack::trtri(&uplo, &diag, &n, A.memptr(), &n, &info); if(info != 0) { return false; } @@ -205,7 +205,7 @@ inline bool auxlib::inv_tr_rcond(Mat& A, typename get_pod_type::result& out_rcond, const uword layout) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -215,14 +215,14 @@ auxlib::inv_tr_rcond(Mat& A, typename get_pod_type::result& out_rcond, c out_rcond = auxlib::rcond_trimat(A, layout); - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); char uplo = (layout == 0) ? 'U' : 'L'; char diag = 'N'; blas_int n = blas_int(A.n_rows); blas_int info = 0; - arma_extra_debug_print("lapack::trtri()"); + arma_debug_print("lapack::trtri()"); lapack::trtri(&uplo, &diag, &n, A.memptr(), &n, &info); if(info != 0) { out_rcond = T(0); return false; } @@ -247,7 +247,7 @@ inline bool auxlib::inv_sympd(Mat& A, bool& out_sympd_state) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out_sympd_state = false; @@ -255,7 +255,7 @@ auxlib::inv_sympd(Mat& A, bool& out_sympd_state) #if defined(ARMA_USE_LAPACK) { - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); char uplo = 'L'; blas_int n = blas_int(A.n_rows); @@ -263,14 +263,14 @@ auxlib::inv_sympd(Mat& A, bool& out_sympd_state) // NOTE: for complex matrices, zpotrf() assumes the matrix is hermitian (not simply symmetric) - arma_extra_debug_print("lapack::potrf()"); + arma_debug_print("lapack::potrf()"); lapack::potrf(&uplo, &n, A.memptr(), &n, &info); if(info != 0) { return false; } out_sympd_state = true; - arma_extra_debug_print("lapack::potri()"); + arma_debug_print("lapack::potri()"); lapack::potri(&uplo, &n, A.memptr(), &n, &info); if(info != 0) { return false; } @@ -296,7 +296,7 @@ inline bool auxlib::inv_sympd(Mat& out, const Mat& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out = X; @@ -312,7 +312,7 @@ inline bool auxlib::inv_sympd_rcond(Mat& A, bool& out_sympd_state, eT& out_rcond) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out_sympd_state = false; @@ -322,7 +322,7 @@ auxlib::inv_sympd_rcond(Mat& A, bool& out_sympd_state, eT& out_rcond) { typedef typename get_pod_type::result T; - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); char norm_id = '1'; char uplo = 'L'; @@ -332,10 +332,10 @@ auxlib::inv_sympd_rcond(Mat& A, bool& out_sympd_state, eT& out_rcond) podarray work(A.n_rows); - arma_extra_debug_print("lapack::lansy()"); + arma_debug_print("lapack::lansy()"); norm_val = (has_blas_float_bug::value) ? auxlib::norm1_sym(A) : lapack::lansy(&norm_id, &uplo, &n, A.memptr(), &n, work.memptr()); - arma_extra_debug_print("lapack::potrf()"); + arma_debug_print("lapack::potrf()"); lapack::potrf(&uplo, &n, A.memptr(), &n, &info); if(info != 0) { out_rcond = eT(0); return false; } @@ -346,7 +346,7 @@ auxlib::inv_sympd_rcond(Mat& A, bool& out_sympd_state, eT& out_rcond) if(arma_isnan(out_rcond)) { return false; } - arma_extra_debug_print("lapack::potri()"); + arma_debug_print("lapack::potri()"); lapack::potri(&uplo, &n, A.memptr(), &n, &info); if(info != 0) { return false; } @@ -373,7 +373,7 @@ inline bool auxlib::inv_sympd_rcond(Mat< std::complex >& A, bool& out_sympd_state, T& out_rcond) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out_sympd_state = false; @@ -388,7 +388,7 @@ auxlib::inv_sympd_rcond(Mat< std::complex >& A, bool& out_sympd_state, T& out } #elif defined(ARMA_USE_LAPACK) { - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); char norm_id = '1'; char uplo = 'L'; @@ -398,10 +398,10 @@ auxlib::inv_sympd_rcond(Mat< std::complex >& A, bool& out_sympd_state, T& out podarray work(A.n_rows); - arma_extra_debug_print("lapack::lanhe()"); + arma_debug_print("lapack::lanhe()"); norm_val = (has_blas_float_bug::value) ? auxlib::norm1_sym(A) : lapack::lanhe(&norm_id, &uplo, &n, A.memptr(), &n, work.memptr()); - arma_extra_debug_print("lapack::potrf()"); + arma_debug_print("lapack::potrf()"); lapack::potrf(&uplo, &n, A.memptr(), &n, &info); if(info != 0) { out_rcond = T(0); return false; } @@ -412,7 +412,7 @@ auxlib::inv_sympd_rcond(Mat< std::complex >& A, bool& out_sympd_state, T& out if(arma_isnan(out_rcond)) { return false; } - arma_extra_debug_print("lapack::potri()"); + arma_debug_print("lapack::potri()"); lapack::potri(&uplo, &n, A.memptr(), &n, &info); if(info != 0) { return false; } @@ -440,13 +440,13 @@ inline bool auxlib::det(eT& out_val, Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(A.is_empty()) { out_val = eT(1); return true; } #if defined(ARMA_USE_LAPACK) { - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); podarray ipiv(A.n_rows); @@ -454,7 +454,7 @@ auxlib::det(eT& out_val, Mat& A) blas_int n_rows = blas_int(A.n_rows); blas_int n_cols = blas_int(A.n_cols); - arma_extra_debug_print("lapack::getrf()"); + arma_debug_print("lapack::getrf()"); lapack::getrf(&n_rows, &n_cols, A.memptr(), &n_rows, ipiv.memptr(), &info); if(info < 0) { return false; } @@ -492,7 +492,7 @@ inline bool auxlib::log_det(eT& out_val, typename get_pod_type::result& out_sign, Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -500,7 +500,7 @@ auxlib::log_det(eT& out_val, typename get_pod_type::result& out_sign, Mat ipiv(A.n_rows); @@ -508,7 +508,7 @@ auxlib::log_det(eT& out_val, typename get_pod_type::result& out_sign, Mat::result& out_val, Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -565,13 +565,13 @@ auxlib::log_det_sympd(typename get_pod_type::result& out_val, Mat& A) #if defined(ARMA_USE_LAPACK) { - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); char uplo = 'L'; blas_int n = blas_int(A.n_rows); blas_int info = 0; - arma_extra_debug_print("lapack::potrf()"); + arma_debug_print("lapack::potrf()"); lapack::potrf(&uplo, &n, A.memptr(), &n, &info); if(info != 0) { return false; } @@ -602,7 +602,7 @@ inline bool auxlib::lu(Mat& L, Mat& U, podarray& ipiv, const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); U = X.get_ref(); @@ -613,7 +613,7 @@ auxlib::lu(Mat& L, Mat& U, podarray& ipiv, const Base& #if defined(ARMA_USE_LAPACK) { - arma_debug_assert_blas_size(U); + arma_conform_assert_blas_size(U); ipiv.set_size( (std::min)(U_n_rows, U_n_cols) ); @@ -622,7 +622,7 @@ auxlib::lu(Mat& L, Mat& U, podarray& ipiv, const Base& blas_int n_rows = blas_int(U_n_rows); blas_int n_cols = blas_int(U_n_cols); - arma_extra_debug_print("lapack::getrf()"); + arma_debug_print("lapack::getrf()"); lapack::getrf(&n_rows, &n_cols, U.memptr(), &n_rows, ipiv.memptr(), &info); if(info < 0) { return false; } @@ -668,7 +668,7 @@ inline bool auxlib::lu(Mat& L, Mat& U, Mat& P, const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); podarray ipiv1; const bool status = auxlib::lu(L, U, ipiv1, X); @@ -732,7 +732,7 @@ inline bool auxlib::lu(Mat& L, Mat& U, const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); podarray ipiv1; const bool status = auxlib::lu(L, U, ipiv1, X); @@ -796,7 +796,7 @@ auxlib::eig_gen const Base& expr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -804,9 +804,9 @@ auxlib::eig_gen Mat X = expr.get_ref(); - arma_debug_check( (X.is_square() == false), "eig_gen(): given matrix must be square sized" ); + arma_conform_check( (X.is_square() == false), "eig_gen(): given matrix must be square sized" ); - arma_debug_assert_blas_size(X); + arma_conform_assert_blas_size(X); if(X.is_empty()) { vals.reset(); vecs.reset(); return true; } @@ -839,13 +839,13 @@ auxlib::eig_gen podarray vals_real(X.n_rows); podarray vals_imag(X.n_rows); - arma_extra_debug_print("lapack::geev() -- START"); + arma_debug_print("lapack::geev() -- START"); lapack::geev(&jobvl, &jobvr, &N, X.memptr(), &N, vals_real.memptr(), vals_imag.memptr(), vl, &ldvl, vr, &ldvr, work.memptr(), &lwork, &info); - arma_extra_debug_print("lapack::geev() -- END"); + arma_debug_print("lapack::geev() -- END"); if(info != 0) { return false; } - arma_extra_debug_print("reformatting eigenvalues and eigenvectors"); + arma_debug_print("reformatting eigenvalues and eigenvectors"); std::complex* vals_mem = vals.memptr(); @@ -903,7 +903,7 @@ auxlib::eig_gen const Base< std::complex, T1 >& expr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -912,9 +912,9 @@ auxlib::eig_gen Mat X = expr.get_ref(); - arma_debug_check( (X.is_square() == false), "eig_gen(): given matrix must be square sized" ); + arma_conform_check( (X.is_square() == false), "eig_gen(): given matrix must be square sized" ); - arma_debug_assert_blas_size(X); + arma_conform_assert_blas_size(X); if(X.is_empty()) { vals.reset(); vecs.reset(); return true; } @@ -939,9 +939,9 @@ auxlib::eig_gen podarray work( static_cast(lwork) ); podarray< T> rwork( static_cast(2*N) ); - arma_extra_debug_print("lapack::cx_geev() -- START"); + arma_debug_print("lapack::cx_geev() -- START"); lapack::cx_geev(&jobvl, &jobvr, &N, X.memptr(), &N, vals.memptr(), vl, &ldvl, vr, &ldvr, work.memptr(), &lwork, rwork.memptr(), &info); - arma_extra_debug_print("lapack::cx_geev() -- END"); + arma_debug_print("lapack::cx_geev() -- END"); return (info == 0); } @@ -971,7 +971,7 @@ auxlib::eig_gen_balance const Base& expr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -979,9 +979,9 @@ auxlib::eig_gen_balance Mat X = expr.get_ref(); - arma_debug_check( (X.is_square() == false), "eig_gen(): given matrix must be square sized" ); + arma_conform_check( (X.is_square() == false), "eig_gen(): given matrix must be square sized" ); - arma_debug_assert_blas_size(X); + arma_conform_assert_blas_size(X); if(X.is_empty()) { vals.reset(); vecs.reset(); return true; } @@ -1024,13 +1024,13 @@ auxlib::eig_gen_balance podarray vals_real(X.n_rows); podarray vals_imag(X.n_rows); - arma_extra_debug_print("lapack::geevx() -- START"); + arma_debug_print("lapack::geevx() -- START"); lapack::geevx(&bal, &jobvl, &jobvr, &sense, &N, X.memptr(), &N, vals_real.memptr(), vals_imag.memptr(), vl, &ldvl, vr, &ldvr, &ilo, &ihi, scale.memptr(), &abnrm, rconde.memptr(), rcondv.memptr(), work.memptr(), &lwork, iwork.memptr(), &info); - arma_extra_debug_print("lapack::geevx() -- END"); + arma_debug_print("lapack::geevx() -- END"); if(info != 0) { return false; } - arma_extra_debug_print("reformatting eigenvalues and eigenvectors"); + arma_debug_print("reformatting eigenvalues and eigenvectors"); std::complex* vals_mem = vals.memptr(); @@ -1088,11 +1088,11 @@ auxlib::eig_gen_balance const Base< std::complex, T1 >& expr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_CRIPPLED_LAPACK) { - arma_extra_debug_print("auxlib::eig_gen_balance(): redirecting to auxlib::eig_gen() due to crippled LAPACK"); + arma_debug_print("auxlib::eig_gen_balance(): redirecting to auxlib::eig_gen() due to crippled LAPACK"); return auxlib::eig_gen(vals, vecs, vecs_on, expr); } @@ -1103,9 +1103,9 @@ auxlib::eig_gen_balance Mat X = expr.get_ref(); - arma_debug_check( (X.is_square() == false), "eig_gen(): given matrix must be square sized" ); + arma_conform_check( (X.is_square() == false), "eig_gen(): given matrix must be square sized" ); - arma_debug_assert_blas_size(X); + arma_conform_assert_blas_size(X); if(X.is_empty()) { vals.reset(); vecs.reset(); return true; } @@ -1139,9 +1139,9 @@ auxlib::eig_gen_balance podarray work( static_cast(lwork) ); podarray< T> rwork( static_cast(2*N) ); - arma_extra_debug_print("lapack::cx_geevx() -- START"); + arma_debug_print("lapack::cx_geevx() -- START"); lapack::cx_geevx(&bal, &jobvl, &jobvr, &sense, &N, X.memptr(), &N, vals.memptr(), vl, &ldvl, vr, &ldvr, &ilo, &ihi, scale.memptr(), &abnrm, rconde.memptr(), rcondv.memptr(), work.memptr(), &lwork, rwork.memptr(), &info); - arma_extra_debug_print("lapack::cx_geevx() -- END"); + arma_debug_print("lapack::cx_geevx() -- END"); return (info == 0); } @@ -1171,7 +1171,7 @@ auxlib::eig_gen_twosided const Base& expr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -1179,9 +1179,9 @@ auxlib::eig_gen_twosided Mat X = expr.get_ref(); - arma_debug_check( (X.is_square() == false), "eig_gen(): given matrix must be square sized" ); + arma_conform_check( (X.is_square() == false), "eig_gen(): given matrix must be square sized" ); - arma_debug_assert_blas_size(X); + arma_conform_assert_blas_size(X); if(X.is_empty()) { vals.reset(); lvecs.reset(); rvecs.reset(); return true; } @@ -1208,13 +1208,13 @@ auxlib::eig_gen_twosided podarray vals_real(X.n_rows); podarray vals_imag(X.n_rows); - arma_extra_debug_print("lapack::geev() -- START"); + arma_debug_print("lapack::geev() -- START"); lapack::geev(&jobvl, &jobvr, &N, X.memptr(), &N, vals_real.memptr(), vals_imag.memptr(), ltmp.memptr(), &ldvl, rtmp.memptr(), &ldvr, work.memptr(), &lwork, &info); - arma_extra_debug_print("lapack::geev() -- END"); + arma_debug_print("lapack::geev() -- END"); if(info != 0) { return false; } - arma_extra_debug_print("reformatting eigenvalues and eigenvectors"); + arma_debug_print("reformatting eigenvalues and eigenvectors"); std::complex* vals_mem = vals.memptr(); @@ -1271,7 +1271,7 @@ auxlib::eig_gen_twosided const Base< std::complex, T1 >& expr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -1280,9 +1280,9 @@ auxlib::eig_gen_twosided Mat X = expr.get_ref(); - arma_debug_check( (X.is_square() == false), "eig_gen(): given matrix must be square sized" ); + arma_conform_check( (X.is_square() == false), "eig_gen(): given matrix must be square sized" ); - arma_debug_assert_blas_size(X); + arma_conform_assert_blas_size(X); if(X.is_empty()) { vals.reset(); lvecs.reset(); rvecs.reset(); return true; } @@ -1304,9 +1304,9 @@ auxlib::eig_gen_twosided podarray work( static_cast(lwork) ); podarray< T> rwork( static_cast(2*N) ); - arma_extra_debug_print("lapack::cx_geev() -- START"); + arma_debug_print("lapack::cx_geev() -- START"); lapack::cx_geev(&jobvl, &jobvr, &N, X.memptr(), &N, vals.memptr(), lvecs.memptr(), &ldvl, rvecs.memptr(), &ldvr, work.memptr(), &lwork, rwork.memptr(), &info); - arma_extra_debug_print("lapack::cx_geev() -- END"); + arma_debug_print("lapack::cx_geev() -- END"); return (info == 0); } @@ -1336,7 +1336,7 @@ auxlib::eig_gen_twosided_balance const Base& expr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -1344,9 +1344,9 @@ auxlib::eig_gen_twosided_balance Mat X = expr.get_ref(); - arma_debug_check( (X.is_square() == false), "eig_gen(): given matrix must be square sized" ); + arma_conform_check( (X.is_square() == false), "eig_gen(): given matrix must be square sized" ); - arma_debug_assert_blas_size(X); + arma_conform_assert_blas_size(X); if(X.is_empty()) { vals.reset(); lvecs.reset(); rvecs.reset(); return true; } @@ -1383,13 +1383,13 @@ auxlib::eig_gen_twosided_balance podarray vals_real(X.n_rows); podarray vals_imag(X.n_rows); - arma_extra_debug_print("lapack::geevx() -- START"); + arma_debug_print("lapack::geevx() -- START"); lapack::geevx(&bal, &jobvl, &jobvr, &sense, &N, X.memptr(), &N, vals_real.memptr(), vals_imag.memptr(), ltmp.memptr(), &ldvl, rtmp.memptr(), &ldvr, &ilo, &ihi, scale.memptr(), &abnrm, rconde.memptr(), rcondv.memptr(), work.memptr(), &lwork, iwork.memptr(), &info); - arma_extra_debug_print("lapack::geevx() -- END"); + arma_debug_print("lapack::geevx() -- END"); if(info != 0) { return false; } - arma_extra_debug_print("reformatting eigenvalues and eigenvectors"); + arma_debug_print("reformatting eigenvalues and eigenvectors"); std::complex* vals_mem = vals.memptr(); @@ -1446,11 +1446,11 @@ auxlib::eig_gen_twosided_balance const Base< std::complex, T1 >& expr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_CRIPPLED_LAPACK) { - arma_extra_debug_print("auxlib::eig_gen_twosided_balance(): redirecting to auxlib::eig_gen() due to crippled LAPACK"); + arma_debug_print("auxlib::eig_gen_twosided_balance(): redirecting to auxlib::eig_gen() due to crippled LAPACK"); return auxlib::eig_gen(vals, lvecs, rvecs, expr); } @@ -1461,9 +1461,9 @@ auxlib::eig_gen_twosided_balance Mat X = expr.get_ref(); - arma_debug_check( (X.is_square() == false), "eig_gen(): given matrix must be square sized" ); + arma_conform_check( (X.is_square() == false), "eig_gen(): given matrix must be square sized" ); - arma_debug_assert_blas_size(X); + arma_conform_assert_blas_size(X); if(X.is_empty()) { vals.reset(); lvecs.reset(); rvecs.reset(); return true; } @@ -1494,9 +1494,9 @@ auxlib::eig_gen_twosided_balance podarray work( static_cast(lwork) ); podarray< T> rwork( static_cast(2*N) ); - arma_extra_debug_print("lapack::cx_geevx() -- START"); + arma_debug_print("lapack::cx_geevx() -- START"); lapack::cx_geevx(&bal, &jobvl, &jobvr, &sense, &N, X.memptr(), &N, vals.memptr(), lvecs.memptr(), &ldvl, rvecs.memptr(), &ldvr, &ilo, &ihi, scale.memptr(), &abnrm, rconde.memptr(), rcondv.memptr(), work.memptr(), &lwork, rwork.memptr(), &info); - arma_extra_debug_print("lapack::cx_geevx() -- END"); + arma_debug_print("lapack::cx_geevx() -- END"); return (info == 0); } @@ -1527,7 +1527,7 @@ auxlib::eig_pair const Base& B_expr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -1537,11 +1537,11 @@ auxlib::eig_pair Mat A(A_expr.get_ref()); Mat B(B_expr.get_ref()); - arma_debug_check( ((A.is_square() == false) || (B.is_square() == false)), "eig_pair(): given matrices must be square sized" ); + arma_conform_check( ((A.is_square() == false) || (B.is_square() == false)), "eig_pair(): given matrices must be square sized" ); - arma_debug_check( (A.n_rows != B.n_rows), "eig_pair(): given matrices must have the same size" ); + arma_conform_check( (A.n_rows != B.n_rows), "eig_pair(): given matrices must have the same size" ); - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); if(A.is_empty()) { vals.reset(); vecs.reset(); return true; } @@ -1576,12 +1576,12 @@ auxlib::eig_pair podarray work( static_cast(lwork) ); - arma_extra_debug_print("lapack::ggev()"); + arma_debug_print("lapack::ggev()"); lapack::ggev(&jobvl, &jobvr, &N, A.memptr(), &N, B.memptr(), &N, alphar.memptr(), alphai.memptr(), beta.memptr(), vl, &ldvl, vr, &ldvr, work.memptr(), &lwork, &info); if(info != 0) { return false; } - arma_extra_debug_print("reformatting eigenvalues and eigenvectors"); + arma_debug_print("reformatting eigenvalues and eigenvectors"); eT* vals_mem = vals.memptr(); const T* alphar_mem = alphar.memptr(); @@ -1609,7 +1609,7 @@ auxlib::eig_pair } } - if(beta_has_zero) { arma_debug_warn_level(1, "eig_pair(): given matrices appear ill-conditioned"); } + if(beta_has_zero) { arma_conform_warn(1, "eig_pair(): given matrices appear ill-conditioned"); } if(vecs_on) { @@ -1665,7 +1665,7 @@ auxlib::eig_pair const Base< std::complex, T2 >& B_expr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -1675,11 +1675,11 @@ auxlib::eig_pair Mat A(A_expr.get_ref()); Mat B(B_expr.get_ref()); - arma_debug_check( ((A.is_square() == false) || (B.is_square() == false)), "eig_pair(): given matrices must be square sized" ); + arma_conform_check( ((A.is_square() == false) || (B.is_square() == false)), "eig_pair(): given matrices must be square sized" ); - arma_debug_check( (A.n_rows != B.n_rows), "eig_pair(): given matrices must have the same size" ); + arma_conform_check( (A.n_rows != B.n_rows), "eig_pair(): given matrices must have the same size" ); - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); if(A.is_empty()) { vals.reset(); vecs.reset(); return true; } @@ -1708,7 +1708,7 @@ auxlib::eig_pair podarray work( static_cast(lwork) ); podarray rwork( static_cast(8*N) ); - arma_extra_debug_print("lapack::cx_ggev()"); + arma_debug_print("lapack::cx_ggev()"); lapack::cx_ggev(&jobvl, &jobvr, &N, A.memptr(), &N, B.memptr(), &N, alpha.memptr(), beta.memptr(), vl, &ldvl, vr, &ldvr, work.memptr(), &lwork, rwork.memptr(), &info); if(info != 0) { return false; } @@ -1730,7 +1730,7 @@ auxlib::eig_pair beta_has_zero = (beta_has_zero || (beta_val == zero)); } - if(beta_has_zero) { arma_debug_warn_level(1, "eig_pair(): given matrices appear ill-conditioned"); } + if(beta_has_zero) { arma_conform_warn(1, "eig_pair(): given matrices appear ill-conditioned"); } return true; } @@ -1762,7 +1762,7 @@ auxlib::eig_pair_twosided const Base& B_expr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -1772,11 +1772,11 @@ auxlib::eig_pair_twosided Mat A(A_expr.get_ref()); Mat B(B_expr.get_ref()); - arma_debug_check( ((A.is_square() == false) || (B.is_square() == false)), "eig_pair(): given matrices must be square sized" ); + arma_conform_check( ((A.is_square() == false) || (B.is_square() == false)), "eig_pair(): given matrices must be square sized" ); - arma_debug_check( (A.n_rows != B.n_rows), "eig_pair(): given matrices must have the same size" ); + arma_conform_check( (A.n_rows != B.n_rows), "eig_pair(): given matrices must have the same size" ); - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); if(A.is_empty()) { vals.reset(); lvecs.reset(); rvecs.reset(); return true; } @@ -1805,12 +1805,12 @@ auxlib::eig_pair_twosided podarray work( static_cast(lwork) ); - arma_extra_debug_print("lapack::ggev()"); + arma_debug_print("lapack::ggev()"); lapack::ggev(&jobvl, &jobvr, &N, A.memptr(), &N, B.memptr(), &N, alphar.memptr(), alphai.memptr(), beta.memptr(), ltmp.memptr(), &ldvl, rtmp.memptr(), &ldvr, work.memptr(), &lwork, &info); if(info != 0) { return false; } - arma_extra_debug_print("reformatting eigenvalues and eigenvectors"); + arma_debug_print("reformatting eigenvalues and eigenvectors"); eT* vals_mem = vals.memptr(); const T* alphar_mem = alphar.memptr(); @@ -1838,7 +1838,7 @@ auxlib::eig_pair_twosided } } - if(beta_has_zero) { arma_debug_warn_level(1, "eig_pair(): given matrices appear ill-conditioned"); } + if(beta_has_zero) { arma_conform_warn(1, "eig_pair(): given matrices appear ill-conditioned"); } for(uword j=0; j < A.n_rows; ++j) { @@ -1893,7 +1893,7 @@ auxlib::eig_pair_twosided const Base< std::complex, T2 >& B_expr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -1903,11 +1903,11 @@ auxlib::eig_pair_twosided Mat A(A_expr.get_ref()); Mat B(B_expr.get_ref()); - arma_debug_check( ((A.is_square() == false) || (B.is_square() == false)), "eig_pair(): given matrices must be square sized" ); + arma_conform_check( ((A.is_square() == false) || (B.is_square() == false)), "eig_pair(): given matrices must be square sized" ); - arma_debug_check( (A.n_rows != B.n_rows), "eig_pair(): given matrices must have the same size" ); + arma_conform_check( (A.n_rows != B.n_rows), "eig_pair(): given matrices must have the same size" ); - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); if(A.is_empty()) { vals.reset(); lvecs.reset(); rvecs.reset(); return true; } @@ -1933,7 +1933,7 @@ auxlib::eig_pair_twosided podarray work( static_cast(lwork) ); podarray rwork( static_cast(8*N) ); - arma_extra_debug_print("lapack::cx_ggev()"); + arma_debug_print("lapack::cx_ggev()"); lapack::cx_ggev(&jobvl, &jobvr, &N, A.memptr(), &N, B.memptr(), &N, alpha.memptr(), beta.memptr(), lvecs.memptr(), &ldvl, rvecs.memptr(), &ldvr, work.memptr(), &lwork, rwork.memptr(), &info); if(info != 0) { return false; } @@ -1955,7 +1955,7 @@ auxlib::eig_pair_twosided beta_has_zero = (beta_has_zero || (beta_val == zero)); } - if(beta_has_zero) { arma_debug_warn_level(1, "eig_pair(): given matrices appear ill-conditioned"); } + if(beta_has_zero) { arma_conform_warn(1, "eig_pair(): given matrices appear ill-conditioned"); } return true; } @@ -1980,22 +1980,22 @@ inline bool auxlib::eig_sym(Col& eigval, Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { - arma_debug_check( (A.is_square() == false), "eig_sym(): given matrix must be square sized" ); + arma_conform_check( (A.is_square() == false), "eig_sym(): given matrix must be square sized" ); if(A.is_empty()) { eigval.reset(); return true; } - if((arma_config::debug) && (auxlib::rudimentary_sym_check(A) == false)) + if((arma_config::check_conformance) && (auxlib::rudimentary_sym_check(A) == false)) { - arma_debug_warn_level(1, "eig_sym(): given matrix is not symmetric"); + arma_conform_warn(1, "eig_sym(): given matrix is not symmetric"); } if(arma_config::check_nonfinite && trimat_helper::has_nonfinite_triu(A)) { return false; } - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); eigval.set_size(A.n_rows); @@ -2008,7 +2008,7 @@ auxlib::eig_sym(Col& eigval, Mat& A) podarray work( static_cast(lwork) ); - arma_extra_debug_print("lapack::syev()"); + arma_debug_print("lapack::syev()"); lapack::syev(&jobz, &uplo, &N, A.memptr(), &N, eigval.memptr(), work.memptr(), &lwork, &info); return (info == 0); @@ -2031,24 +2031,24 @@ inline bool auxlib::eig_sym(Col& eigval, Mat< std::complex >& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { typedef typename std::complex eT; - arma_debug_check( (A.is_square() == false), "eig_sym(): given matrix must be square sized" ); + arma_conform_check( (A.is_square() == false), "eig_sym(): given matrix must be square sized" ); if(A.is_empty()) { eigval.reset(); return true; } - if((arma_config::debug) && (auxlib::rudimentary_sym_check(A) == false)) + if((arma_config::check_conformance) && (auxlib::rudimentary_sym_check(A) == false)) { - arma_debug_warn_level(1, "eig_sym(): given matrix is not hermitian"); + arma_conform_warn(1, "eig_sym(): given matrix is not hermitian"); } if(arma_config::check_nonfinite && trimat_helper::has_nonfinite_triu(A)) { return false; } - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); eigval.set_size(A.n_rows); @@ -2062,7 +2062,7 @@ auxlib::eig_sym(Col& eigval, Mat< std::complex >& A) podarray work( static_cast(lwork) ); podarray rwork( static_cast( (std::max)(blas_int(1), 3*N) ) ); - arma_extra_debug_print("lapack::heev()"); + arma_debug_print("lapack::heev()"); lapack::heev(&jobz, &uplo, &N, A.memptr(), &N, eigval.memptr(), work.memptr(), &lwork, rwork.memptr(), &info); return (info == 0); @@ -2085,11 +2085,11 @@ inline bool auxlib::eig_sym(Col& eigval, Mat& eigvec, const Mat& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { - arma_debug_check( (X.is_square() == false), "eig_sym(): given matrix must be square sized" ); + arma_conform_check( (X.is_square() == false), "eig_sym(): given matrix must be square sized" ); if(arma_config::check_nonfinite && trimat_helper::has_nonfinite_triu(X)) { return false; } @@ -2097,7 +2097,7 @@ auxlib::eig_sym(Col& eigval, Mat& eigvec, const Mat& X) if(eigvec.is_empty()) { eigval.reset(); eigvec.reset(); return true; } - arma_debug_assert_blas_size(eigvec); + arma_conform_assert_blas_size(eigvec); eigval.set_size(eigvec.n_rows); @@ -2110,7 +2110,7 @@ auxlib::eig_sym(Col& eigval, Mat& eigvec, const Mat& X) podarray work( static_cast(lwork) ); - arma_extra_debug_print("lapack::syev()"); + arma_debug_print("lapack::syev()"); lapack::syev(&jobz, &uplo, &N, eigvec.memptr(), &N, eigval.memptr(), work.memptr(), &lwork, &info); return (info == 0); @@ -2134,13 +2134,13 @@ inline bool auxlib::eig_sym(Col& eigval, Mat< std::complex >& eigvec, const Mat< std::complex >& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { typedef typename std::complex eT; - arma_debug_check( (X.is_square() == false), "eig_sym(): given matrix must be square sized" ); + arma_conform_check( (X.is_square() == false), "eig_sym(): given matrix must be square sized" ); if(arma_config::check_nonfinite && trimat_helper::has_nonfinite_triu(X)) { return false; } @@ -2148,7 +2148,7 @@ auxlib::eig_sym(Col& eigval, Mat< std::complex >& eigvec, const Mat< std:: if(eigvec.is_empty()) { eigval.reset(); eigvec.reset(); return true; } - arma_debug_assert_blas_size(eigvec); + arma_conform_assert_blas_size(eigvec); eigval.set_size(eigvec.n_rows); @@ -2162,7 +2162,7 @@ auxlib::eig_sym(Col& eigval, Mat< std::complex >& eigvec, const Mat< std:: podarray work( static_cast(lwork) ); podarray rwork( static_cast((std::max)(blas_int(1), 3*N)) ); - arma_extra_debug_print("lapack::heev()"); + arma_debug_print("lapack::heev()"); lapack::heev(&jobz, &uplo, &N, eigvec.memptr(), &N, eigval.memptr(), work.memptr(), &lwork, rwork.memptr(), &info); return (info == 0); @@ -2186,11 +2186,11 @@ inline bool auxlib::eig_sym_dc(Col& eigval, Mat& eigvec, const Mat& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { - arma_debug_check( (X.is_square() == false), "eig_sym(): given matrix must be square sized" ); + arma_conform_check( (X.is_square() == false), "eig_sym(): given matrix must be square sized" ); if(arma_config::check_nonfinite && trimat_helper::has_nonfinite_triu(X)) { return false; } @@ -2198,7 +2198,7 @@ auxlib::eig_sym_dc(Col& eigval, Mat& eigvec, const Mat& X) if(eigvec.is_empty()) { eigval.reset(); eigvec.reset(); return true; } - arma_debug_assert_blas_size(eigvec); + arma_conform_assert_blas_size(eigvec); eigval.set_size(eigvec.n_rows); @@ -2221,7 +2221,7 @@ auxlib::eig_sym_dc(Col& eigval, Mat& eigvec, const Mat& X) blas_int lwork_query = -1; blas_int liwork_query = -1; - arma_extra_debug_print("lapack::syevd()"); + arma_debug_print("lapack::syevd()"); lapack::syevd(&jobz, &uplo, &N, eigvec.memptr(), &N, eigval.memptr(), &work_query[0], &lwork_query, &iwork_query[0], &liwork_query, &info); if(info != 0) { return false; } @@ -2236,7 +2236,7 @@ auxlib::eig_sym_dc(Col& eigval, Mat& eigvec, const Mat& X) podarray work( static_cast( lwork_final) ); podarray iwork( static_cast(liwork_final) ); - arma_extra_debug_print("lapack::syevd()"); + arma_debug_print("lapack::syevd()"); lapack::syevd(&jobz, &uplo, &N, eigvec.memptr(), &N, eigval.memptr(), work.memptr(), &lwork_final, iwork.memptr(), &liwork_final, &info); return (info == 0); @@ -2260,13 +2260,13 @@ inline bool auxlib::eig_sym_dc(Col& eigval, Mat< std::complex >& eigvec, const Mat< std::complex >& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { typedef typename std::complex eT; - arma_debug_check( (X.is_square() == false), "eig_sym(): given matrix must be square sized" ); + arma_conform_check( (X.is_square() == false), "eig_sym(): given matrix must be square sized" ); if(arma_config::check_nonfinite && trimat_helper::has_nonfinite_triu(X)) { return false; } @@ -2274,7 +2274,7 @@ auxlib::eig_sym_dc(Col& eigval, Mat< std::complex >& eigvec, const Mat< st if(eigvec.is_empty()) { eigval.reset(); eigvec.reset(); return true; } - arma_debug_assert_blas_size(eigvec); + arma_conform_assert_blas_size(eigvec); eigval.set_size(eigvec.n_rows); @@ -2301,7 +2301,7 @@ auxlib::eig_sym_dc(Col& eigval, Mat< std::complex >& eigvec, const Mat< st blas_int lrwork_query = -1; blas_int liwork_query = -1; - arma_extra_debug_print("lapack::heevd()"); + arma_debug_print("lapack::heevd()"); lapack::heevd(&jobz, &uplo, &N, eigvec.memptr(), &N, eigval.memptr(), &work_query[0], &lwork_query, &rwork_query[0], &lrwork_query, &iwork_query[0], &liwork_query, &info); if(info != 0) { return false; } @@ -2319,7 +2319,7 @@ auxlib::eig_sym_dc(Col& eigval, Mat< std::complex >& eigvec, const Mat< st podarray< T> rwork( static_cast(lrwork_final) ); podarray iwork( static_cast(liwork_final) ); - arma_extra_debug_print("lapack::heevd()"); + arma_debug_print("lapack::heevd()"); lapack::heevd(&jobz, &uplo, &N, eigvec.memptr(), &N, eigval.memptr(), work.memptr(), &lwork_final, rwork.memptr(), &lrwork_final, iwork.memptr(), &liwork_final, &info); return (info == 0); @@ -2342,17 +2342,17 @@ inline bool auxlib::chol_simple(Mat& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { - arma_debug_assert_blas_size(X); + arma_conform_assert_blas_size(X); char uplo = 'U'; blas_int n = blas_int(X.n_rows); blas_int info = 0; - arma_extra_debug_print("lapack::potrf()"); + arma_debug_print("lapack::potrf()"); lapack::potrf(&uplo, &n, X.memptr(), &n, &info); return (info == 0); @@ -2374,17 +2374,17 @@ inline bool auxlib::chol(Mat& X, const uword layout) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { - arma_debug_assert_blas_size(X); + arma_conform_assert_blas_size(X); char uplo = (layout == 0) ? 'U' : 'L'; blas_int n = blas_int(X.n_rows); blas_int info = 0; - arma_extra_debug_print("lapack::potrf()"); + arma_debug_print("lapack::potrf()"); lapack::potrf(&uplo, &n, X.memptr(), &n, &info); if(info != 0) { return false; } @@ -2411,7 +2411,7 @@ inline bool auxlib::chol_band(Mat& X, const uword KD, const uword layout) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return auxlib::chol_band_common(X, KD, layout); } @@ -2423,11 +2423,11 @@ inline bool auxlib::chol_band(Mat< std::complex >& X, const uword KD, const uword layout) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_CRIPPLED_LAPACK) { - arma_extra_debug_print("auxlib::chol_band(): redirecting to auxlib::chol() due to crippled LAPACK"); + arma_debug_print("auxlib::chol_band(): redirecting to auxlib::chol() due to crippled LAPACK"); arma_ignore(KD); @@ -2447,7 +2447,7 @@ inline bool auxlib::chol_band_common(Mat& X, const uword KD, const uword layout) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -2459,7 +2459,7 @@ auxlib::chol_band_common(Mat& X, const uword KD, const uword layout) Mat AB; band_helper::compress(AB, X, KL, KU, false); - arma_debug_assert_blas_size(AB); + arma_conform_assert_blas_size(AB); char uplo = (layout == 0) ? 'U' : 'L'; blas_int n = blas_int(N); @@ -2467,7 +2467,7 @@ auxlib::chol_band_common(Mat& X, const uword KD, const uword layout) blas_int ldab = blas_int(AB.n_rows); blas_int info = 0; - arma_extra_debug_print("lapack::pbtrf()"); + arma_debug_print("lapack::pbtrf()"); lapack::pbtrf(&uplo, &n, &kd, AB.memptr(), &ldab, &info); if(info != 0) { return false; } @@ -2495,13 +2495,13 @@ inline bool auxlib::chol_pivot(Mat& X, Mat& P, const uword layout) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { typedef typename get_pod_type::result T; - arma_debug_assert_blas_size(X); + arma_conform_assert_blas_size(X); char uplo = (layout == 0) ? 'U' : 'L'; blas_int n = blas_int(X.n_rows); @@ -2514,7 +2514,7 @@ auxlib::chol_pivot(Mat& X, Mat& P, const uword layout) ipiv.zeros(); - arma_extra_debug_print("lapack::pstrf()"); + arma_debug_print("lapack::pstrf()"); lapack::pstrf(&uplo, &n, X.memptr(), &n, ipiv.memptr(), &rank, &tol, work.memptr(), &info); if(info != 0) { return false; } @@ -2551,17 +2551,17 @@ inline bool auxlib::hess(Mat& H, const Base& X, Col& tao) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { H = X.get_ref(); - arma_debug_check( (H.is_square() == false), "hess(): given matrix must be square sized" ); + arma_conform_check( (H.is_square() == false), "hess(): given matrix must be square sized" ); if(H.is_empty()) { return true; } - arma_debug_assert_blas_size(H); + arma_conform_assert_blas_size(H); if(H.n_rows > 2) { @@ -2576,7 +2576,7 @@ auxlib::hess(Mat& H, const Base& X, Col& tao) podarray work(static_cast(lwork)); - arma_extra_debug_print("lapack::gehrd()"); + arma_debug_print("lapack::gehrd()"); lapack::gehrd(&n, &ilo, &ihi, H.memptr(), &lda, tao.memptr(), work.memptr(), &lwork, &info); return (info == 0); @@ -2602,7 +2602,7 @@ inline bool auxlib::qr(Mat& Q, Mat& R, const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -2613,7 +2613,7 @@ auxlib::qr(Mat& Q, Mat& R, const Base& X) if(R.is_empty()) { Q.eye(R_n_rows, R_n_rows); return true; } - arma_debug_assert_blas_size(R); + arma_conform_assert_blas_size(R); blas_int m = static_cast(R_n_rows); blas_int n = static_cast(R_n_cols); @@ -2626,7 +2626,7 @@ auxlib::qr(Mat& Q, Mat& R, const Base& X) eT work_query[2] = {}; blas_int lwork_query = -1; - arma_extra_debug_print("lapack::geqrf()"); + arma_debug_print("lapack::geqrf()"); lapack::geqrf(&m, &n, R.memptr(), &m, tau.memptr(), &work_query[0], &lwork_query, &info); if(info != 0) { return false; } @@ -2636,7 +2636,7 @@ auxlib::qr(Mat& Q, Mat& R, const Base& X) podarray work( static_cast(lwork_final) ); - arma_extra_debug_print("lapack::geqrf()"); + arma_debug_print("lapack::geqrf()"); lapack::geqrf(&m, &n, R.memptr(), &m, tau.memptr(), work.memptr(), &lwork_final, &info); if(info != 0) { return false; } @@ -2659,13 +2659,13 @@ auxlib::qr(Mat& Q, Mat& R, const Base& X) if( (is_float::value) || (is_double::value) ) { - arma_extra_debug_print("lapack::orgqr()"); + arma_debug_print("lapack::orgqr()"); lapack::orgqr(&m, &m, &k, Q.memptr(), &m, tau.memptr(), work.memptr(), &lwork_final, &info); } else if( (is_cx_float::value) || (is_cx_double::value) ) { - arma_extra_debug_print("lapack::ungqr()"); + arma_debug_print("lapack::ungqr()"); lapack::ungqr(&m, &m, &k, Q.memptr(), &m, tau.memptr(), work.memptr(), &lwork_final, &info); } @@ -2689,7 +2689,7 @@ inline bool auxlib::qr_econ(Mat& Q, Mat& R, const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -2710,7 +2710,7 @@ auxlib::qr_econ(Mat& Q, Mat& R, const Base& X) if(Q.is_empty()) { Q.set_size(Q_n_rows, 0); R.set_size(0, Q_n_cols); return true; } - arma_debug_assert_blas_size(Q); + arma_conform_assert_blas_size(Q); blas_int m = static_cast(Q_n_rows); blas_int n = static_cast(Q_n_cols); @@ -2723,7 +2723,7 @@ auxlib::qr_econ(Mat& Q, Mat& R, const Base& X) eT work_query[2] = {}; blas_int lwork_query = -1; - arma_extra_debug_print("lapack::geqrf()"); + arma_debug_print("lapack::geqrf()"); lapack::geqrf(&m, &n, Q.memptr(), &m, tau.memptr(), &work_query[0], &lwork_query, &info); if(info != 0) { return false; } @@ -2733,7 +2733,7 @@ auxlib::qr_econ(Mat& Q, Mat& R, const Base& X) podarray work( static_cast(lwork_final) ); - arma_extra_debug_print("lapack::geqrf()"); + arma_debug_print("lapack::geqrf()"); lapack::geqrf(&m, &n, Q.memptr(), &m, tau.memptr(), work.memptr(), &lwork_final, &info); if(info != 0) { return false; } @@ -2753,13 +2753,13 @@ auxlib::qr_econ(Mat& Q, Mat& R, const Base& X) if( (is_float::value) || (is_double::value) ) { - arma_extra_debug_print("lapack::orgqr()"); + arma_debug_print("lapack::orgqr()"); lapack::orgqr(&m, &n, &k, Q.memptr(), &m, tau.memptr(), work.memptr(), &lwork_final, &info); } else if( (is_cx_float::value) || (is_cx_double::value) ) { - arma_extra_debug_print("lapack::ungqr()"); + arma_debug_print("lapack::ungqr()"); lapack::ungqr(&m, &n, &k, Q.memptr(), &m, tau.memptr(), work.memptr(), &lwork_final, &info); } @@ -2783,7 +2783,7 @@ inline bool auxlib::qr_pivot(Mat& Q, Mat& R, Mat& P, const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -2803,7 +2803,7 @@ auxlib::qr_pivot(Mat& Q, Mat& R, Mat& P, const Base& X) return true; } - arma_debug_assert_blas_size(R); + arma_conform_assert_blas_size(R); blas_int m = static_cast(R_n_rows); blas_int n = static_cast(R_n_cols); @@ -2819,7 +2819,7 @@ auxlib::qr_pivot(Mat& Q, Mat& R, Mat& P, const Base& X) eT work_query[2] = {}; blas_int lwork_query = -1; - arma_extra_debug_print("lapack::geqp3()"); + arma_debug_print("lapack::geqp3()"); lapack::geqp3(&m, &n, R.memptr(), &m, jpvt.memptr(), tau.memptr(), &work_query[0], &lwork_query, &info); if(info != 0) { return false; } @@ -2829,7 +2829,7 @@ auxlib::qr_pivot(Mat& Q, Mat& R, Mat& P, const Base& X) podarray work( static_cast(lwork_final) ); - arma_extra_debug_print("lapack::geqp3()"); + arma_debug_print("lapack::geqp3()"); lapack::geqp3(&m, &n, R.memptr(), &m, jpvt.memptr(), tau.memptr(), work.memptr(), &lwork_final, &info); if(info != 0) { return false; } @@ -2850,7 +2850,7 @@ auxlib::qr_pivot(Mat& Q, Mat& R, Mat& P, const Base& X) P.at(col) = jpvt[col] - 1; // take into account that Fortran counts from 1 } - arma_extra_debug_print("lapack::orgqr()"); + arma_debug_print("lapack::orgqr()"); lapack::orgqr(&m, &m, &k, Q.memptr(), &m, tau.memptr(), work.memptr(), &lwork_final, &info); return (info == 0); @@ -2874,7 +2874,7 @@ inline bool auxlib::qr_pivot(Mat< std::complex >& Q, Mat< std::complex >& R, Mat& P, const Base,T1>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -2896,7 +2896,7 @@ auxlib::qr_pivot(Mat< std::complex >& Q, Mat< std::complex >& R, Mat(R_n_rows); blas_int n = static_cast(R_n_cols); @@ -2913,7 +2913,7 @@ auxlib::qr_pivot(Mat< std::complex >& Q, Mat< std::complex >& R, Mat >& Q, Mat< std::complex >& R, Mat work( static_cast(lwork_final) ); - arma_extra_debug_print("lapack::geqp3()"); + arma_debug_print("lapack::geqp3()"); lapack::cx_geqp3(&m, &n, R.memptr(), &m, jpvt.memptr(), tau.memptr(), work.memptr(), &lwork_final, rwork.memptr(), &info); if(info != 0) { return false; } @@ -2944,7 +2944,7 @@ auxlib::qr_pivot(Mat< std::complex >& Q, Mat< std::complex >& R, Mat& S, Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -2976,7 +2976,7 @@ auxlib::svd(Col& S, Mat& A) if(arma_config::check_nonfinite && A.internal_has_nonfinite()) { return false; } - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); Mat U(1, 1, arma_nozeros_indicator()); Mat V(1, A.n_cols, arma_nozeros_indicator()); @@ -3002,7 +3002,7 @@ auxlib::svd(Col& S, Mat& A) eT work_query[2] = {}; blas_int lwork_query = -1; - arma_extra_debug_print("lapack::gesvd()"); + arma_debug_print("lapack::gesvd()"); lapack::gesvd(&jobu, &jobvt, &m, &n, A.memptr(), &lda, S.memptr(), U.memptr(), &ldu, V.memptr(), &ldvt, &work_query[0], &lwork_query, &info); if(info != 0) { return false; } @@ -3014,7 +3014,7 @@ auxlib::svd(Col& S, Mat& A) podarray work( static_cast(lwork_final) ); - arma_extra_debug_print("lapack::gesvd()"); + arma_debug_print("lapack::gesvd()"); lapack::gesvd(&jobu, &jobvt, &m, &n, A.memptr(), &lda, S.memptr(), U.memptr(), &ldu, V.memptr(), &ldvt, work.memptr(), &lwork_final, &info); return (info == 0); @@ -3036,7 +3036,7 @@ inline bool auxlib::svd(Col& S, Mat< std::complex >& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -3046,7 +3046,7 @@ auxlib::svd(Col& S, Mat< std::complex >& A) if(arma_config::check_nonfinite && A.internal_has_nonfinite()) { return false; } - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); Mat U(1, 1, arma_nozeros_indicator()); Mat V(1, A.n_cols, arma_nozeros_indicator()); @@ -3074,7 +3074,7 @@ auxlib::svd(Col& S, Mat< std::complex >& A) eT work_query[2] = {}; blas_int lwork_query = -1; // query to find optimum size of workspace - arma_extra_debug_print("lapack::cx_gesvd()"); + arma_debug_print("lapack::cx_gesvd()"); lapack::cx_gesvd(&jobu, &jobvt, &m, &n, A.memptr(), &lda, S.memptr(), U.memptr(), &ldu, V.memptr(), &ldvt, &work_query[0], &lwork_query, rwork.memptr(), &info); if(info != 0) { return false; } @@ -3086,7 +3086,7 @@ auxlib::svd(Col& S, Mat< std::complex >& A) podarray work( static_cast(lwork_final) ); - arma_extra_debug_print("lapack::cx_gesvd()"); + arma_debug_print("lapack::cx_gesvd()"); lapack::cx_gesvd(&jobu, &jobvt, &m, &n, A.memptr(), &lda, S.memptr(), U.memptr(), &ldu, V.memptr(), &ldvt, work.memptr(), &lwork_final, rwork.memptr(), &info); return (info == 0); @@ -3108,7 +3108,7 @@ inline bool auxlib::svd(Mat& U, Col& S, Mat& V, Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -3116,7 +3116,7 @@ auxlib::svd(Mat& U, Col& S, Mat& V, Mat& A) if(arma_config::check_nonfinite && A.internal_has_nonfinite()) { return false; } - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); U.set_size(A.n_rows, A.n_rows); V.set_size(A.n_cols, A.n_cols); @@ -3143,7 +3143,7 @@ auxlib::svd(Mat& U, Col& S, Mat& V, Mat& A) eT work_query[2] = {}; blas_int lwork_query = -1; - arma_extra_debug_print("lapack::gesvd()"); + arma_debug_print("lapack::gesvd()"); lapack::gesvd(&jobu, &jobvt, &m, &n, A.memptr(), &lda, S.memptr(), U.memptr(), &ldu, V.memptr(), &ldvt, &work_query[0], &lwork_query, &info); if(info != 0) { return false; } @@ -3155,7 +3155,7 @@ auxlib::svd(Mat& U, Col& S, Mat& V, Mat& A) podarray work( static_cast(lwork_final) ); - arma_extra_debug_print("lapack::gesvd()"); + arma_debug_print("lapack::gesvd()"); lapack::gesvd(&jobu, &jobvt, &m, &n, A.memptr(), &lda, S.memptr(), U.memptr(), &ldu, V.memptr(), &ldvt, work.memptr(), &lwork_final, &info); if(info != 0) { return false; } @@ -3183,7 +3183,7 @@ inline bool auxlib::svd(Mat< std::complex >& U, Col& S, Mat< std::complex >& V, Mat< std::complex >& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -3193,7 +3193,7 @@ auxlib::svd(Mat< std::complex >& U, Col& S, Mat< std::complex >& V, Mat if(arma_config::check_nonfinite && A.internal_has_nonfinite()) { return false; } - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); U.set_size(A.n_rows, A.n_rows); V.set_size(A.n_cols, A.n_cols); @@ -3221,7 +3221,7 @@ auxlib::svd(Mat< std::complex >& U, Col& S, Mat< std::complex >& V, Mat eT work_query[2] = {}; blas_int lwork_query = -1; // query to find optimum size of workspace - arma_extra_debug_print("lapack::cx_gesvd()"); + arma_debug_print("lapack::cx_gesvd()"); lapack::cx_gesvd(&jobu, &jobvt, &m, &n, A.memptr(), &lda, S.memptr(), U.memptr(), &ldu, V.memptr(), &ldvt, &work_query[0], &lwork_query, rwork.memptr(), &info); if(info != 0) { return false; } @@ -3233,7 +3233,7 @@ auxlib::svd(Mat< std::complex >& U, Col& S, Mat< std::complex >& V, Mat podarray work( static_cast(lwork_final) ); - arma_extra_debug_print("lapack::cx_gesvd()"); + arma_debug_print("lapack::cx_gesvd()"); lapack::cx_gesvd(&jobu, &jobvt, &m, &n, A.memptr(), &lda, S.memptr(), U.memptr(), &ldu, V.memptr(), &ldvt, work.memptr(), &lwork_final, rwork.memptr(), &info); if(info != 0) { return false; } @@ -3261,7 +3261,7 @@ inline bool auxlib::svd_econ(Mat& U, Col& S, Mat& V, Mat& A, const char mode) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -3269,7 +3269,7 @@ auxlib::svd_econ(Mat& U, Col& S, Mat& V, Mat& A, const char mode if(arma_config::check_nonfinite && A.internal_has_nonfinite()) { return false; } - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); blas_int m = blas_int(A.n_rows); blas_int n = blas_int(A.n_cols); @@ -3331,7 +3331,7 @@ auxlib::svd_econ(Mat& U, Col& S, Mat& V, Mat& A, const char mode eT work_query[2] = {}; blas_int lwork_query = -1; // query to find optimum size of workspace - arma_extra_debug_print("lapack::gesvd()"); + arma_debug_print("lapack::gesvd()"); lapack::gesvd(&jobu, &jobvt, &m, &n, A.memptr(), &lda, S.memptr(), U.memptr(), &ldu, V.memptr(), &ldvt, &work_query[0], &lwork_query, &info); if(info != 0) { return false; } @@ -3343,7 +3343,7 @@ auxlib::svd_econ(Mat& U, Col& S, Mat& V, Mat& A, const char mode podarray work( static_cast(lwork_final) ); - arma_extra_debug_print("lapack::gesvd()"); + arma_debug_print("lapack::gesvd()"); lapack::gesvd(&jobu, &jobvt, &m, &n, A.memptr(), &lda, S.memptr(), U.memptr(), &ldu, V.memptr(), &ldvt, work.memptr(), &lwork_final, &info); if(info != 0) { return false; } @@ -3372,7 +3372,7 @@ inline bool auxlib::svd_econ(Mat< std::complex >& U, Col& S, Mat< std::complex >& V, Mat< std::complex >& A, const char mode) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -3382,7 +3382,7 @@ auxlib::svd_econ(Mat< std::complex >& U, Col& S, Mat< std::complex >& V if(arma_config::check_nonfinite && A.internal_has_nonfinite()) { return false; } - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); blas_int m = blas_int(A.n_rows); blas_int n = blas_int(A.n_cols); @@ -3445,7 +3445,7 @@ auxlib::svd_econ(Mat< std::complex >& U, Col& S, Mat< std::complex >& V eT work_query[2] = {}; blas_int lwork_query = -1; // query to find optimum size of workspace - arma_extra_debug_print("lapack::cx_gesvd()"); + arma_debug_print("lapack::cx_gesvd()"); lapack::cx_gesvd(&jobu, &jobvt, &m, &n, A.memptr(), &lda, S.memptr(), U.memptr(), &ldu, V.memptr(), &ldvt, &work_query[0], &lwork_query, rwork.memptr(), &info); if(info != 0) { return false; } @@ -3457,7 +3457,7 @@ auxlib::svd_econ(Mat< std::complex >& U, Col& S, Mat< std::complex >& V podarray work( static_cast(lwork_final) ); - arma_extra_debug_print("lapack::cx_gesvd()"); + arma_debug_print("lapack::cx_gesvd()"); lapack::cx_gesvd(&jobu, &jobvt, &m, &n, A.memptr(), &lda, S.memptr(), U.memptr(), &ldu, V.memptr(), &ldvt, work.memptr(), &lwork_final, rwork.memptr(), &info); if(info != 0) { return false; } @@ -3486,7 +3486,7 @@ inline bool auxlib::svd_dc(Col& S, Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -3494,7 +3494,7 @@ auxlib::svd_dc(Col& S, Mat& A) if(arma_config::check_nonfinite && A.internal_has_nonfinite()) { return false; } - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); Mat U(1, 1, arma_nozeros_indicator()); Mat V(1, 1, arma_nozeros_indicator()); @@ -3522,7 +3522,7 @@ auxlib::svd_dc(Col& S, Mat& A) eT work_query[2] = {}; blas_int lwork_query = blas_int(-1); - arma_extra_debug_print("lapack::gesdd()"); + arma_debug_print("lapack::gesdd()"); lapack::gesdd(&jobz, &m, &n, A.memptr(), &lda, S.memptr(), U.memptr(), &ldu, V.memptr(), &ldvt, &work_query[0], &lwork_query, iwork.memptr(), &info); if(info != 0) { return false; } @@ -3534,7 +3534,7 @@ auxlib::svd_dc(Col& S, Mat& A) podarray work( static_cast(lwork_final) ); - arma_extra_debug_print("lapack::gesdd()"); + arma_debug_print("lapack::gesdd()"); lapack::gesdd(&jobz, &m, &n, A.memptr(), &lda, S.memptr(), U.memptr(), &ldu, V.memptr(), &ldvt, work.memptr(), &lwork_final, iwork.memptr(), &info); return (info == 0); @@ -3556,7 +3556,7 @@ inline bool auxlib::svd_dc(Col& S, Mat< std::complex >& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -3566,7 +3566,7 @@ auxlib::svd_dc(Col& S, Mat< std::complex >& A) if(arma_config::check_nonfinite && A.internal_has_nonfinite()) { return false; } - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); Mat U(1, 1, arma_nozeros_indicator()); Mat V(1, 1, arma_nozeros_indicator()); @@ -3595,7 +3595,7 @@ auxlib::svd_dc(Col& S, Mat< std::complex >& A) eT work_query[2] = {}; blas_int lwork_query = blas_int(-1); - arma_extra_debug_print("lapack::cx_gesdd()"); + arma_debug_print("lapack::cx_gesdd()"); lapack::cx_gesdd(&jobz, &m, &n, A.memptr(), &lda, S.memptr(), U.memptr(), &ldu, V.memptr(), &ldvt, &work_query[0], &lwork_query, rwork.memptr(), iwork.memptr(), &info); if(info != 0) { return false; } @@ -3607,7 +3607,7 @@ auxlib::svd_dc(Col& S, Mat< std::complex >& A) podarray work( static_cast(lwork_final) ); - arma_extra_debug_print("lapack::cx_gesdd()"); + arma_debug_print("lapack::cx_gesdd()"); lapack::cx_gesdd(&jobz, &m, &n, A.memptr(), &lda, S.memptr(), U.memptr(), &ldu, V.memptr(), &ldvt, work.memptr(), &lwork_final, rwork.memptr(), iwork.memptr(), &info); return (info == 0); @@ -3629,7 +3629,7 @@ inline bool auxlib::svd_dc(Mat& U, Col& S, Mat& V, Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -3637,7 +3637,7 @@ auxlib::svd_dc(Mat& U, Col& S, Mat& V, Mat& A) if(arma_config::check_nonfinite && A.internal_has_nonfinite()) { return false; } - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); U.set_size(A.n_rows, A.n_rows); V.set_size(A.n_cols, A.n_cols); @@ -3667,7 +3667,7 @@ auxlib::svd_dc(Mat& U, Col& S, Mat& V, Mat& A) eT work_query[2] = {}; blas_int lwork_query = blas_int(-1); - arma_extra_debug_print("lapack::gesdd()"); + arma_debug_print("lapack::gesdd()"); lapack::gesdd(&jobz, &m, &n, A.memptr(), &lda, S.memptr(), U.memptr(), &ldu, V.memptr(), &ldvt, &work_query[0], &lwork_query, iwork.memptr(), &info); if(info != 0) { return false; } @@ -3679,7 +3679,7 @@ auxlib::svd_dc(Mat& U, Col& S, Mat& V, Mat& A) podarray work( static_cast(lwork_final) ); - arma_extra_debug_print("lapack::gesdd()"); + arma_debug_print("lapack::gesdd()"); lapack::gesdd(&jobz, &m, &n, A.memptr(), &lda, S.memptr(), U.memptr(), &ldu, V.memptr(), &ldvt, work.memptr(), &lwork_final, iwork.memptr(), &info); if(info != 0) { return false; } @@ -3707,7 +3707,7 @@ inline bool auxlib::svd_dc(Mat< std::complex >& U, Col& S, Mat< std::complex >& V, Mat< std::complex >& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -3717,7 +3717,7 @@ auxlib::svd_dc(Mat< std::complex >& U, Col& S, Mat< std::complex >& V, if(arma_config::check_nonfinite && A.internal_has_nonfinite()) { return false; } - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); U.set_size(A.n_rows, A.n_rows); V.set_size(A.n_cols, A.n_cols); @@ -3747,7 +3747,7 @@ auxlib::svd_dc(Mat< std::complex >& U, Col& S, Mat< std::complex >& V, eT work_query[2] = {}; blas_int lwork_query = blas_int(-1); - arma_extra_debug_print("lapack::cx_gesdd()"); + arma_debug_print("lapack::cx_gesdd()"); lapack::cx_gesdd(&jobz, &m, &n, A.memptr(), &lda, S.memptr(), U.memptr(), &ldu, V.memptr(), &ldvt, &work_query[0], &lwork_query, rwork.memptr(), iwork.memptr(), &info); if(info != 0) { return false; } @@ -3759,7 +3759,7 @@ auxlib::svd_dc(Mat< std::complex >& U, Col& S, Mat< std::complex >& V, podarray work( static_cast(lwork_final) ); - arma_extra_debug_print("lapack::cx_gesdd()"); + arma_debug_print("lapack::cx_gesdd()"); lapack::cx_gesdd(&jobz, &m, &n, A.memptr(), &lda, S.memptr(), U.memptr(), &ldu, V.memptr(), &ldvt, work.memptr(), &lwork_final, rwork.memptr(), iwork.memptr(), &info); if(info != 0) { return false; } @@ -3787,13 +3787,13 @@ inline bool auxlib::svd_dc_econ(Mat& U, Col& S, Mat& V, Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { if(arma_config::check_nonfinite && A.internal_has_nonfinite()) { return false; } - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); char jobz = 'S'; @@ -3832,7 +3832,7 @@ auxlib::svd_dc_econ(Mat& U, Col& S, Mat& V, Mat& A) eT work_query[2] = {}; blas_int lwork_query = blas_int(-1); - arma_extra_debug_print("lapack::gesdd()"); + arma_debug_print("lapack::gesdd()"); lapack::gesdd(&jobz, &m, &n, A.memptr(), &lda, S.memptr(), U.memptr(), &ldu, V.memptr(), &ldvt, &work_query[0], &lwork_query, iwork.memptr(), &info); if(info != 0) { return false; } @@ -3844,7 +3844,7 @@ auxlib::svd_dc_econ(Mat& U, Col& S, Mat& V, Mat& A) podarray work( static_cast(lwork_final) ); - arma_extra_debug_print("lapack::gesdd()"); + arma_debug_print("lapack::gesdd()"); lapack::gesdd(&jobz, &m, &n, A.memptr(), &lda, S.memptr(), U.memptr(), &ldu, V.memptr(), &ldvt, work.memptr(), &lwork_final, iwork.memptr(), &info); if(info != 0) { return false; } @@ -3872,7 +3872,7 @@ inline bool auxlib::svd_dc_econ(Mat< std::complex >& U, Col& S, Mat< std::complex >& V, Mat< std::complex >& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -3880,7 +3880,7 @@ auxlib::svd_dc_econ(Mat< std::complex >& U, Col& S, Mat< std::complex > if(arma_config::check_nonfinite && A.internal_has_nonfinite()) { return false; } - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); char jobz = 'S'; @@ -3919,7 +3919,7 @@ auxlib::svd_dc_econ(Mat< std::complex >& U, Col& S, Mat< std::complex > eT work_query[2] = {}; blas_int lwork_query = blas_int(-1); - arma_extra_debug_print("lapack::cx_gesdd()"); + arma_debug_print("lapack::cx_gesdd()"); lapack::cx_gesdd(&jobz, &m, &n, A.memptr(), &lda, S.memptr(), U.memptr(), &ldu, V.memptr(), &ldvt, &work_query[0], &lwork_query, rwork.memptr(), iwork.memptr(), &info); if(info != 0) { return false; } @@ -3931,7 +3931,7 @@ auxlib::svd_dc_econ(Mat< std::complex >& U, Col& S, Mat< std::complex > podarray work( static_cast(lwork_final) ); - arma_extra_debug_print("lapack::cx_gesdd()"); + arma_debug_print("lapack::cx_gesdd()"); lapack::cx_gesdd(&jobz, &m, &n, A.memptr(), &lda, S.memptr(), U.memptr(), &ldu, V.memptr(), &ldvt, work.memptr(), &lwork_final, rwork.memptr(), iwork.memptr(), &info); if(info != 0) { return false; } @@ -3960,14 +3960,14 @@ inline bool auxlib::solve_square_fast(Mat& out, Mat& A, const Base& B_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out = B_expr.get_ref(); const uword B_n_rows = out.n_rows; const uword B_n_cols = out.n_cols; - arma_debug_check( (A.n_rows != B_n_rows), "solve(): number of rows in given matrices must be the same", [&](){ out.soft_reset(); } ); + arma_conform_check( (A.n_rows != B_n_rows), "solve(): number of rows in given matrices must be the same", [&](){ out.soft_reset(); } ); if(A.is_empty() || out.is_empty()) { out.zeros(A.n_cols, B_n_cols); return true; } @@ -3975,7 +3975,7 @@ auxlib::solve_square_fast(Mat& out, Mat& out, Mat ipiv(A.n_rows + 2); // +2 for paranoia: some versions of Lapack might be trashing memory - arma_extra_debug_print("lapack::gesv()"); + arma_debug_print("lapack::gesv()"); lapack::gesv(&n, &nrhs, A.memptr(), &lda, ipiv.memptr(), out.memptr(), &ldb, &info); return (info == 0); @@ -4006,7 +4006,7 @@ inline bool auxlib::solve_square_rcond(Mat& out, typename T1::pod_type& out_rcond, Mat& A, const Base& B_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -4020,11 +4020,11 @@ auxlib::solve_square_rcond(Mat& out, typename T1::pod_ty const uword B_n_rows = out.n_rows; const uword B_n_cols = out.n_cols; - arma_debug_check( (A.n_rows != B_n_rows), "solve(): number of rows in given matrices must be the same", [&](){ out.soft_reset(); } ); + arma_conform_check( (A.n_rows != B_n_rows), "solve(): number of rows in given matrices must be the same", [&](){ out.soft_reset(); } ); if(A.is_empty() || out.is_empty()) { out.zeros(A.n_cols, B_n_cols); return true; } - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); char norm_id = '1'; char trans = 'N'; @@ -4038,15 +4038,15 @@ auxlib::solve_square_rcond(Mat& out, typename T1::pod_ty podarray junk(1); podarray ipiv(A.n_rows + 2); // +2 for paranoia - arma_extra_debug_print("lapack::lange()"); + arma_debug_print("lapack::lange()"); norm_val = (has_blas_float_bug::value) ? auxlib::norm1_gen(A) : lapack::lange(&norm_id, &n, &n, A.memptr(), &lda, junk.memptr()); - arma_extra_debug_print("lapack::getrf()"); + arma_debug_print("lapack::getrf()"); lapack::getrf(&n, &n, A.memptr(), &n, ipiv.memptr(), &info); if(info != blas_int(0)) { return false; } - arma_extra_debug_print("lapack::getrs()"); + arma_debug_print("lapack::getrs()"); lapack::getrs(&trans, &n, &nrhs, A.memptr(), &lda, ipiv.memptr(), out.memptr(), &ldb, &info); if(info != blas_int(0)) { return false; } @@ -4075,7 +4075,7 @@ inline bool auxlib::solve_square_refine(Mat& out, typename T1::pod_type& out_rcond, Mat& A, const Base& B_expr, const bool equilibrate) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -4093,11 +4093,11 @@ auxlib::solve_square_refine(Mat& out, typename T1::pod_ty const Mat& B = (use_copy) ? B_tmp : UB_M_as_Mat; - arma_debug_check( (A.n_rows != B.n_rows), "solve(): number of rows in given matrices must be the same" ); + arma_conform_check( (A.n_rows != B.n_rows), "solve(): number of rows in given matrices must be the same" ); if(A.is_empty() || B.is_empty()) { out.zeros(A.n_rows, B.n_cols); return true; } - arma_debug_assert_blas_size(A,B); + arma_conform_assert_blas_size(A,B); out.set_size(A.n_rows, B.n_cols); @@ -4123,7 +4123,7 @@ auxlib::solve_square_refine(Mat& out, typename T1::pod_ty podarray WORK(4*A.n_rows); podarray IWORK( A.n_rows); - arma_extra_debug_print("lapack::gesvx()"); + arma_debug_print("lapack::gesvx()"); lapack::gesvx ( &fact, &trans, &n, &nrhs, @@ -4171,7 +4171,7 @@ inline bool auxlib::solve_square_refine(Mat< std::complex >& out, typename T1::pod_type& out_rcond, Mat< std::complex >& A, const Base,T1>& B_expr, const bool equilibrate) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -4190,11 +4190,11 @@ auxlib::solve_square_refine(Mat< std::complex >& out, typ const Mat& B = (use_copy) ? B_tmp : UB_M_as_Mat; - arma_debug_check( (A.n_rows != B.n_rows), "solve(): number of rows in given matrices must be the same" ); + arma_conform_check( (A.n_rows != B.n_rows), "solve(): number of rows in given matrices must be the same" ); if(A.is_empty() || B.is_empty()) { out.zeros(A.n_rows, B.n_cols); return true; } - arma_debug_assert_blas_size(A,B); + arma_conform_assert_blas_size(A,B); out.set_size(A.n_rows, B.n_cols); @@ -4220,7 +4220,7 @@ auxlib::solve_square_refine(Mat< std::complex >& out, typ podarray WORK(2*A.n_rows); podarray< T> RWORK(2*A.n_rows); - arma_extra_debug_print("lapack::cx_gesvx()"); + arma_debug_print("lapack::cx_gesvx()"); lapack::cx_gesvx ( &fact, &trans, &n, &nrhs, @@ -4267,11 +4267,11 @@ inline bool auxlib::solve_sympd_fast(Mat& out, Mat& A, const Base& B_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_CRIPPLED_LAPACK) { - arma_extra_debug_print("auxlib::solve_sympd_fast(): redirecting to auxlib::solve_square_fast() due to crippled LAPACK"); + arma_debug_print("auxlib::solve_sympd_fast(): redirecting to auxlib::solve_square_fast() due to crippled LAPACK"); return auxlib::solve_square_fast(out, A, B_expr); } @@ -4289,14 +4289,14 @@ inline bool auxlib::solve_sympd_fast_common(Mat& out, Mat& A, const Base& B_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out = B_expr.get_ref(); const uword B_n_rows = out.n_rows; const uword B_n_cols = out.n_cols; - arma_debug_check( (A.n_rows != B_n_rows), "solve(): number of rows in given matrices must be the same", [&](){ out.soft_reset(); } ); + arma_conform_check( (A.n_rows != B_n_rows), "solve(): number of rows in given matrices must be the same", [&](){ out.soft_reset(); } ); if(A.is_empty() || out.is_empty()) { out.zeros(A.n_cols, B_n_cols); return true; } @@ -4304,7 +4304,7 @@ auxlib::solve_sympd_fast_common(Mat& out, Mat& out, Mat(&uplo, &n, &nrhs, A.memptr(), &lda, out.memptr(), &ldb, &info); return (info == 0); @@ -4337,7 +4337,7 @@ inline bool auxlib::solve_sympd_rcond(Mat& out, bool& out_sympd_state, typename T1::pod_type& out_rcond, Mat& A, const Base& B_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -4352,11 +4352,11 @@ auxlib::solve_sympd_rcond(Mat& out, bool& out_sympd_state const uword B_n_rows = out.n_rows; const uword B_n_cols = out.n_cols; - arma_debug_check( (A.n_rows != B_n_rows), "solve(): number of rows in given matrices must be the same", [&](){ out.soft_reset(); } ); + arma_conform_check( (A.n_rows != B_n_rows), "solve(): number of rows in given matrices must be the same", [&](){ out.soft_reset(); } ); if(A.is_empty() || out.is_empty()) { out.zeros(A.n_cols, B_n_cols); return true; } - arma_debug_assert_blas_size(A, out); + arma_conform_assert_blas_size(A, out); char norm_id = '1'; char uplo = 'L'; @@ -4367,17 +4367,17 @@ auxlib::solve_sympd_rcond(Mat& out, bool& out_sympd_state podarray work(A.n_rows); - arma_extra_debug_print("lapack::lansy()"); + arma_debug_print("lapack::lansy()"); norm_val = (has_blas_float_bug::value) ? auxlib::norm1_sym(A) : lapack::lansy(&norm_id, &uplo, &n, A.memptr(), &n, work.memptr()); - arma_extra_debug_print("lapack::potrf()"); + arma_debug_print("lapack::potrf()"); lapack::potrf(&uplo, &n, A.memptr(), &n, &info); if(info != 0) { return false; } out_sympd_state = true; - arma_extra_debug_print("lapack::potrs()"); + arma_debug_print("lapack::potrs()"); lapack::potrs(&uplo, &n, &nrhs, A.memptr(), &n, out.memptr(), &n, &info); if(info != 0) { return false; } @@ -4407,11 +4407,11 @@ inline bool auxlib::solve_sympd_rcond(Mat< std::complex >& out, bool& out_sympd_state, typename T1::pod_type& out_rcond, Mat< std::complex >& A, const Base< std::complex,T1>& B_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_CRIPPLED_LAPACK) { - arma_extra_debug_print("auxlib::solve_sympd_rcond(): redirecting to auxlib::solve_square_rcond() due to crippled LAPACK"); + arma_debug_print("auxlib::solve_sympd_rcond(): redirecting to auxlib::solve_square_rcond() due to crippled LAPACK"); out_sympd_state = false; @@ -4430,11 +4430,11 @@ auxlib::solve_sympd_rcond(Mat< std::complex >& out, bool& const uword B_n_rows = out.n_rows; const uword B_n_cols = out.n_cols; - arma_debug_check( (A.n_rows != B_n_rows), "solve(): number of rows in given matrices must be the same", [&](){ out.soft_reset(); } ); + arma_conform_check( (A.n_rows != B_n_rows), "solve(): number of rows in given matrices must be the same", [&](){ out.soft_reset(); } ); if(A.is_empty() || out.is_empty()) { out.zeros(A.n_cols, B_n_cols); return true; } - arma_debug_assert_blas_size(A, out); + arma_conform_assert_blas_size(A, out); char norm_id = '1'; char uplo = 'L'; @@ -4445,17 +4445,17 @@ auxlib::solve_sympd_rcond(Mat< std::complex >& out, bool& podarray work(A.n_rows); - arma_extra_debug_print("lapack::lanhe()"); + arma_debug_print("lapack::lanhe()"); norm_val = (has_blas_float_bug::value) ? auxlib::norm1_sym(A) : lapack::lanhe(&norm_id, &uplo, &n, A.memptr(), &n, work.memptr()); - arma_extra_debug_print("lapack::potrf()"); + arma_debug_print("lapack::potrf()"); lapack::potrf(&uplo, &n, A.memptr(), &n, &info); if(info != 0) { return false; } out_sympd_state = true; - arma_extra_debug_print("lapack::potrs()"); + arma_debug_print("lapack::potrs()"); lapack::potrs(&uplo, &n, &nrhs, A.memptr(), &n, out.memptr(), &n, &info); if(info != 0) { return false; } @@ -4485,7 +4485,7 @@ inline bool auxlib::solve_sympd_refine(Mat& out, typename T1::pod_type& out_rcond, Mat& A, const Base& B_expr, const bool equilibrate) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -4503,11 +4503,11 @@ auxlib::solve_sympd_refine(Mat& out, typename T1::pod_typ const Mat& B = (use_copy) ? B_tmp : UB_M_as_Mat; - arma_debug_check( (A.n_rows != B.n_rows), "solve(): number of rows in given matrices must be the same" ); + arma_conform_check( (A.n_rows != B.n_rows), "solve(): number of rows in given matrices must be the same" ); if(A.is_empty() || B.is_empty()) { out.zeros(A.n_rows, B.n_cols); return true; } - arma_debug_assert_blas_size(A,B); + arma_conform_assert_blas_size(A,B); out.set_size(A.n_rows, B.n_cols); @@ -4531,7 +4531,7 @@ auxlib::solve_sympd_refine(Mat& out, typename T1::pod_typ podarray WORK(3*A.n_rows); podarray IWORK( A.n_rows); - arma_extra_debug_print("lapack::posvx()"); + arma_debug_print("lapack::posvx()"); lapack::posvx(&fact, &uplo, &n, &nrhs, A.memptr(), &lda, AF.memptr(), &ldaf, &equed, S.memptr(), const_cast(B.memptr()), &ldb, out.memptr(), &ldx, &rcond, FERR.memptr(), BERR.memptr(), WORK.memptr(), IWORK.memptr(), &info); // NOTE: using const_cast(B.memptr()) to allow B to be overwritten for equilibration; @@ -4563,11 +4563,11 @@ inline bool auxlib::solve_sympd_refine(Mat< std::complex >& out, typename T1::pod_type& out_rcond, Mat< std::complex >& A, const Base,T1>& B_expr, const bool equilibrate) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_CRIPPLED_LAPACK) { - arma_extra_debug_print("auxlib::solve_sympd_refine(): redirecting to auxlib::solve_square_refine() due to crippled LAPACK"); + arma_debug_print("auxlib::solve_sympd_refine(): redirecting to auxlib::solve_square_refine() due to crippled LAPACK"); return auxlib::solve_square_refine(out, out_rcond, A, B_expr, equilibrate); } @@ -4588,11 +4588,11 @@ auxlib::solve_sympd_refine(Mat< std::complex >& out, type const Mat& B = (use_copy) ? B_tmp : UB_M_as_Mat; - arma_debug_check( (A.n_rows != B.n_rows), "solve(): number of rows in given matrices must be the same" ); + arma_conform_check( (A.n_rows != B.n_rows), "solve(): number of rows in given matrices must be the same" ); if(A.is_empty() || B.is_empty()) { out.zeros(A.n_rows, B.n_cols); return true; } - arma_debug_assert_blas_size(A,B); + arma_conform_assert_blas_size(A,B); out.set_size(A.n_rows, B.n_cols); @@ -4616,7 +4616,7 @@ auxlib::solve_sympd_refine(Mat< std::complex >& out, type podarray WORK(2*A.n_rows); podarray< T> RWORK( A.n_rows); - arma_extra_debug_print("lapack::cx_posvx()"); + arma_debug_print("lapack::cx_posvx()"); lapack::cx_posvx(&fact, &uplo, &n, &nrhs, A.memptr(), &lda, AF.memptr(), &ldaf, &equed, S.memptr(), const_cast(B.memptr()), &ldb, out.memptr(), &ldx, &rcond, FERR.memptr(), BERR.memptr(), WORK.memptr(), RWORK.memptr(), &info); // NOTE: using const_cast(B.memptr()) to allow B to be overwritten for equilibration; @@ -4648,7 +4648,7 @@ inline bool auxlib::solve_rect_fast(Mat& out, Mat& A, const Base& B_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -4657,11 +4657,11 @@ auxlib::solve_rect_fast(Mat& out, Mat U(B_expr.get_ref()); const Mat& B = U.M; - arma_debug_check( (A.n_rows != B.n_rows), "solve(): number of rows in given matrices must be the same" ); + arma_conform_check( (A.n_rows != B.n_rows), "solve(): number of rows in given matrices must be the same" ); if(A.is_empty() || B.is_empty()) { out.zeros(A.n_cols, B.n_cols); return true; } - arma_debug_assert_blas_size(A,B); + arma_conform_assert_blas_size(A,B); Mat tmp( (std::max)(A.n_rows, A.n_cols), B.n_cols, arma_nozeros_indicator() ); @@ -4692,7 +4692,7 @@ auxlib::solve_rect_fast(Mat& out, Mat( &trans, &m, &n, &nrhs, A.memptr(), &lda, tmp.memptr(), &ldb, &work_query[0], &lwork_query, &info ); if(info != 0) { return false; } @@ -4704,7 +4704,7 @@ auxlib::solve_rect_fast(Mat& out, Mat work( static_cast(lwork_final) ); - arma_extra_debug_print("lapack::gels()"); + arma_debug_print("lapack::gels()"); lapack::gels( &trans, &m, &n, &nrhs, A.memptr(), &lda, tmp.memptr(), &ldb, work.memptr(), &lwork_final, &info ); if(info != 0) { return false; } @@ -4739,7 +4739,7 @@ inline bool auxlib::solve_rect_rcond(Mat& out, typename T1::pod_type& out_rcond, Mat& A, const Base& B_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -4751,11 +4751,11 @@ auxlib::solve_rect_rcond(Mat& out, typename T1::pod_type const unwrap U(B_expr.get_ref()); const Mat& B = U.M; - arma_debug_check( (A.n_rows != B.n_rows), "solve(): number of rows in given matrices must be the same" ); + arma_conform_check( (A.n_rows != B.n_rows), "solve(): number of rows in given matrices must be the same" ); if(A.is_empty() || B.is_empty()) { out.zeros(A.n_cols, B.n_cols); return true; } - arma_debug_assert_blas_size(A,B); + arma_conform_assert_blas_size(A,B); Mat tmp( (std::max)(A.n_rows, A.n_cols), B.n_cols, arma_nozeros_indicator() ); @@ -4786,7 +4786,7 @@ auxlib::solve_rect_rcond(Mat& out, typename T1::pod_type eT work_query[2] = {}; blas_int lwork_query = -1; - arma_extra_debug_print("lapack::gels()"); + arma_debug_print("lapack::gels()"); lapack::gels( &trans, &m, &n, &nrhs, A.memptr(), &lda, tmp.memptr(), &ldb, &work_query[0], &lwork_query, &info ); if(info != 0) { return false; } @@ -4798,14 +4798,14 @@ auxlib::solve_rect_rcond(Mat& out, typename T1::pod_type podarray work( static_cast(lwork_final) ); - arma_extra_debug_print("lapack::gels()"); + arma_debug_print("lapack::gels()"); lapack::gels( &trans, &m, &n, &nrhs, A.memptr(), &lda, tmp.memptr(), &ldb, work.memptr(), &lwork_final, &info ); if(info != 0) { return false; } if(A.n_rows >= A.n_cols) { - arma_extra_debug_print("estimating rcond via R"); + arma_debug_print("estimating rcond via R"); // xGELS docs: for M >= N, A contains details of its QR decomposition as returned by xGEQRF // xGEQRF docs: elements on and above the diagonal contain the min(M,N)-by-N upper trapezoidal matrix R @@ -4826,7 +4826,7 @@ auxlib::solve_rect_rcond(Mat& out, typename T1::pod_type else if(A.n_rows < A.n_cols) { - arma_extra_debug_print("estimating rcond via L"); + arma_debug_print("estimating rcond via L"); // xGELS docs: for M < N, A contains details of its LQ decomposition as returned by xGELQF // xGELQF docs: elements on and below the diagonal contain the M-by-min(M,N) lower trapezoidal matrix L @@ -4875,7 +4875,7 @@ inline bool auxlib::solve_approx_svd(Mat& out, Mat& A, const Base& B_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -4884,14 +4884,14 @@ auxlib::solve_approx_svd(Mat& out, Mat U(B_expr.get_ref()); const Mat& B = U.M; - arma_debug_check( (A.n_rows != B.n_rows), "solve(): number of rows in given matrices must be the same" ); + arma_conform_check( (A.n_rows != B.n_rows), "solve(): number of rows in given matrices must be the same" ); if(A.is_empty() || B.is_empty()) { out.zeros(A.n_cols, B.n_cols); return true; } if(arma_config::check_nonfinite && A.internal_has_nonfinite()) { return false; } if(arma_config::check_nonfinite && B.internal_has_nonfinite()) { return false; } - arma_debug_assert_blas_size(A,B); + arma_conform_assert_blas_size(A,B); Mat tmp( (std::max)(A.n_rows, A.n_cols), B.n_cols, arma_nozeros_indicator() ); @@ -4918,8 +4918,7 @@ auxlib::solve_approx_svd(Mat& out, Mat S( static_cast(min_mn) ); - // NOTE: with LAPACK 3.8, can use the workspace query to also obtain liwork, - // NOTE: which makes the call to lapack::laenv() redundant + // NOTE: assuming LAPACK 3.8+, where the workspace query also obtains liwork in addition to lwork blas_int ispec = blas_int(9); @@ -4939,29 +4938,31 @@ auxlib::solve_approx_svd(Mat& out, Mat iwork( static_cast(liwork) ); + blas_int nlvl = (std::max)( blas_int(0), blas_int(1) + blas_int( std::log2( double(min_mn)/double(smlsiz_p1) ) ) ); - blas_int lwork_min = blas_int(12)*min_mn + blas_int(2)*min_mn*smlsiz + blas_int(8)*min_mn*nlvl + min_mn*nrhs + smlsiz_p1*smlsiz_p1; + blas_int lwork_min = blas_int(12)*min_mn + blas_int(2)*min_mn*smlsiz + blas_int(8)*min_mn*nlvl + min_mn*nrhs + smlsiz_p1*smlsiz_p1; + blas_int liwork_min = (std::max)( blas_int(1), (blas_int(3)*min_mn*nlvl + blas_int(11)*min_mn) ); eT work_query[2] = {}; - blas_int lwork_query = blas_int(-1); + blas_int iwork_query[2] = {}; + + blas_int lwork_query = blas_int(-1); - arma_extra_debug_print("lapack::gelsd()"); - lapack::gelsd(&m, &n, &nrhs, A.memptr(), &lda, tmp.memptr(), &ldb, S.memptr(), &rcond, &rank, &work_query[0], &lwork_query, iwork.memptr(), &info); + arma_debug_print("lapack::gelsd()"); + lapack::gelsd(&m, &n, &nrhs, A.memptr(), &lda, tmp.memptr(), &ldb, S.memptr(), &rcond, &rank, &work_query[0], &lwork_query, &iwork_query[0], &info); if(info != 0) { return false; } - // NOTE: in LAPACK 3.8, iwork[0] returns the minimum liwork + blas_int lwork_proposed = static_cast( access::tmp_real(work_query[0]) ); + blas_int liwork_proposed = iwork_query[0]; - blas_int lwork_proposed = static_cast( access::tmp_real(work_query[0]) ); - blas_int lwork_final = (std::max)(lwork_proposed, lwork_min); + blas_int lwork_final = (std::max)( lwork_proposed, lwork_min); + blas_int liwork_final = (std::max)(liwork_proposed, liwork_min); - podarray work( static_cast(lwork_final) ); + podarray work( static_cast( lwork_final) ); + podarray iwork( static_cast(liwork_final) ); - arma_extra_debug_print("lapack::gelsd()"); + arma_debug_print("lapack::gelsd()"); lapack::gelsd(&m, &n, &nrhs, A.memptr(), &lda, tmp.memptr(), &ldb, S.memptr(), &rcond, &rank, work.memptr(), &lwork_final, iwork.memptr(), &info); if(info != 0) { return false; } @@ -4995,7 +4996,7 @@ inline bool auxlib::solve_approx_svd(Mat< std::complex >& out, Mat< std::complex >& A, const Base,T1>& B_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -5005,14 +5006,14 @@ auxlib::solve_approx_svd(Mat< std::complex >& out, Mat< s const unwrap U(B_expr.get_ref()); const Mat& B = U.M; - arma_debug_check( (A.n_rows != B.n_rows), "solve(): number of rows in given matrices must be the same" ); + arma_conform_check( (A.n_rows != B.n_rows), "solve(): number of rows in given matrices must be the same" ); if(A.is_empty() || B.is_empty()) { out.zeros(A.n_cols, B.n_cols); return true; } if(arma_config::check_nonfinite && A.internal_has_nonfinite()) { return false; } if(arma_config::check_nonfinite && B.internal_has_nonfinite()) { return false; } - arma_debug_assert_blas_size(A,B); + arma_conform_assert_blas_size(A,B); Mat tmp( (std::max)(A.n_rows, A.n_cols), B.n_cols, arma_nozeros_indicator() ); @@ -5039,6 +5040,8 @@ auxlib::solve_approx_svd(Mat< std::complex >& out, Mat< s podarray S( static_cast(min_mn) ); + // NOTE: assuming LAPACK 3.8+, where the workspace query also obtains lrwork and liwork in addition to lwork + blas_int ispec = blas_int(9); const char* const_name = (is_float::value) ? "CGELSD" : "ZGELSD"; @@ -5059,31 +5062,38 @@ auxlib::solve_approx_svd(Mat< std::complex >& out, Mat< s blas_int nlvl = (std::max)( blas_int(0), blas_int(1) + blas_int( std::log2( double(min_mn)/double(smlsiz_p1) ) ) ); - blas_int lrwork = (m >= n) + blas_int lwork_min = 2*min_mn + min_mn*nrhs; + + blas_int lrwork_min = (m >= n) ? blas_int(10)*n + blas_int(2)*n*smlsiz + blas_int(8)*n*nlvl + blas_int(3)*smlsiz*nrhs + (std::max)( (smlsiz_p1)*(smlsiz_p1), n*(blas_int(1)+nrhs) + blas_int(2)*nrhs ) : blas_int(10)*m + blas_int(2)*m*smlsiz + blas_int(8)*m*nlvl + blas_int(3)*smlsiz*nrhs + (std::max)( (smlsiz_p1)*(smlsiz_p1), n*(blas_int(1)+nrhs) + blas_int(2)*nrhs ); - blas_int liwork = (std::max)( blas_int(1), (blas_int(3)*blas_int(min_mn)*nlvl + blas_int(11)*blas_int(min_mn)) ); - - podarray rwork( static_cast(lrwork) ); - podarray iwork( static_cast(liwork) ); - - blas_int lwork_min = 2*min_mn + min_mn*nrhs; + blas_int liwork_min = (std::max)( blas_int(1), (blas_int(3)*blas_int(min_mn)*nlvl + blas_int(11)*blas_int(min_mn)) ); eT work_query[2] = {}; - blas_int lwork_query = blas_int(-1); + T rwork_query[2] = {}; + blas_int iwork_query[2] = {}; + + blas_int lwork_query = blas_int(-1); - arma_extra_debug_print("lapack::cx_gelsd()"); - lapack::cx_gelsd(&m, &n, &nrhs, A.memptr(), &lda, tmp.memptr(), &ldb, S.memptr(), &rcond, &rank, &work_query[0], &lwork_query, rwork.memptr(), iwork.memptr(), &info); + arma_debug_print("lapack::cx_gelsd()"); + lapack::cx_gelsd(&m, &n, &nrhs, A.memptr(), &lda, tmp.memptr(), &ldb, S.memptr(), &rcond, &rank, &work_query[0], &lwork_query, &rwork_query[0], &iwork_query[0], &info); if(info != 0) { return false; } - blas_int lwork_proposed = static_cast( access::tmp_real( work_query[0]) ); - blas_int lwork_final = (std::max)(lwork_proposed, lwork_min); + blas_int lwork_proposed = static_cast( access::tmp_real(work_query[0]) ); + blas_int lrwork_proposed = static_cast( rwork_query[0] ); + blas_int liwork_proposed = iwork_query[0]; - podarray work( static_cast(lwork_final) ); + blas_int lwork_final = (std::max)( lwork_proposed, lwork_min); + blas_int lrwork_final = (std::max)(lrwork_proposed, lrwork_min); + blas_int liwork_final = (std::max)(liwork_proposed, liwork_min); + + podarray work( static_cast( lwork_final) ); + podarray rwork( static_cast(lrwork_final) ); + podarray iwork( static_cast(liwork_final) ); - arma_extra_debug_print("lapack::cx_gelsd()"); + arma_debug_print("lapack::cx_gelsd()"); lapack::cx_gelsd(&m, &n, &nrhs, A.memptr(), &lda, tmp.memptr(), &ldb, S.memptr(), &rcond, &rank, work.memptr(), &lwork_final, rwork.memptr(), iwork.memptr(), &info); if(info != 0) { return false; } @@ -5117,7 +5127,7 @@ inline bool auxlib::solve_trimat_fast(Mat& out, const Mat& A, const Base& B_expr, const uword layout) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -5126,11 +5136,11 @@ auxlib::solve_trimat_fast(Mat& out, const Mat& out, const Mat& out, typename T1::pod_type& out_rcond, const Mat& A, const Base& B_expr, const uword layout) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -5176,11 +5186,11 @@ auxlib::solve_trimat_rcond(Mat& out, typename T1::pod_ty const uword B_n_rows = out.n_rows; const uword B_n_cols = out.n_cols; - arma_debug_check( (A.n_rows != B_n_rows), "solve(): number of rows in given matrices must be the same", [&](){ out.soft_reset(); } ); + arma_conform_check( (A.n_rows != B_n_rows), "solve(): number of rows in given matrices must be the same", [&](){ out.soft_reset(); } ); if(A.is_empty() || out.is_empty()) { out.zeros(A.n_cols, B_n_cols); return true; } - arma_debug_assert_blas_size(A,out); + arma_conform_assert_blas_size(A,out); char uplo = (layout == 0) ? 'U' : 'L'; char trans = 'N'; @@ -5189,7 +5199,7 @@ auxlib::solve_trimat_rcond(Mat& out, typename T1::pod_ty blas_int nrhs = blas_int(B_n_cols); blas_int info = 0; - arma_extra_debug_print("lapack::trtrs()"); + arma_debug_print("lapack::trtrs()"); lapack::trtrs(&uplo, &trans, &diag, &n, &nrhs, A.memptr(), &n, out.memptr(), &n, &info); if(info != 0) { return false; } @@ -5220,7 +5230,7 @@ inline bool auxlib::solve_band_fast(Mat& out, Mat& A, const uword KL, const uword KU, const Base& B_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return auxlib::solve_band_fast_common(out, A, KL, KU, B_expr); } @@ -5233,11 +5243,11 @@ inline bool auxlib::solve_band_fast(Mat< std::complex >& out, Mat< std::complex >& A, const uword KL, const uword KU, const Base< std::complex,T1>& B_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_CRIPPLED_LAPACK) { - arma_extra_debug_print("auxlib::solve_band_fast(): redirecting to auxlib::solve_square_fast() due to crippled LAPACK"); + arma_debug_print("auxlib::solve_band_fast(): redirecting to auxlib::solve_square_fast() due to crippled LAPACK"); arma_ignore(KL); arma_ignore(KU); @@ -5259,7 +5269,7 @@ inline bool auxlib::solve_band_fast_common(Mat& out, const Mat& A, const uword KL, const uword KU, const Base& B_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -5270,7 +5280,7 @@ auxlib::solve_band_fast_common(Mat& out, const Mat& out, const Mat& out, const Mat(&n, &kl, &ku, &nrhs, AB.memptr(), &ldab, ipiv.memptr(), out.memptr(), &ldb, &info); return (info == 0); @@ -5321,7 +5331,7 @@ inline bool auxlib::solve_band_rcond(Mat& out, typename T1::pod_type& out_rcond, Mat& A, const uword KL, const uword KU, const Base& B_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return auxlib::solve_band_rcond_common(out, out_rcond, A, KL, KU, B_expr); } @@ -5334,11 +5344,11 @@ inline bool auxlib::solve_band_rcond(Mat< std::complex >& out, typename T1::pod_type& out_rcond, Mat< std::complex >& A, const uword KL, const uword KU, const Base< std::complex,T1>& B_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_CRIPPLED_LAPACK) { - arma_extra_debug_print("auxlib::solve_band_rcond(): redirecting to auxlib::solve_square_rcond() due to crippled LAPACK"); + arma_debug_print("auxlib::solve_band_rcond(): redirecting to auxlib::solve_square_rcond() due to crippled LAPACK"); arma_ignore(KL); arma_ignore(KU); @@ -5360,7 +5370,7 @@ inline bool auxlib::solve_band_rcond_common(Mat& out, typename T1::pod_type& out_rcond, const Mat& A, const uword KL, const uword KU, const Base& B_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -5374,7 +5384,7 @@ auxlib::solve_band_rcond_common(Mat& out, typename T1::p const uword B_n_rows = out.n_rows; const uword B_n_cols = out.n_cols; - arma_debug_check( (A.n_rows != B_n_rows), "solve(): number of rows in given matrices must be the same", [&](){ out.soft_reset(); } ); + arma_conform_check( (A.n_rows != B_n_rows), "solve(): number of rows in given matrices must be the same", [&](){ out.soft_reset(); } ); if(A.is_empty() || out.is_empty()) { out.zeros(A.n_rows, B_n_cols); return true; } @@ -5385,7 +5395,7 @@ auxlib::solve_band_rcond_common(Mat& out, typename T1::p const uword N = AB.n_cols; // order of the original square matrix A - arma_debug_assert_blas_size(AB,out); + arma_conform_assert_blas_size(AB,out); //char norm_id = '1'; char trans = 'N'; @@ -5402,17 +5412,17 @@ auxlib::solve_band_rcond_common(Mat& out, typename T1::p podarray ipiv(N + 2); // +2 for paranoia // // NOTE: lapack::langb() and lapack::gbtrf() use incompatible storage formats for the band matrix - // arma_extra_debug_print("lapack::langb()"); + // arma_debug_print("lapack::langb()"); // norm_val = lapack::langb(&norm_id, &n, &kl, &ku, AB.memptr(), &ldab, junk.memptr()); norm_val = auxlib::norm1_band(A,KL,KU); - arma_extra_debug_print("lapack::gbtrf()"); + arma_debug_print("lapack::gbtrf()"); lapack::gbtrf(&n, &n, &kl, &ku, AB.memptr(), &ldab, ipiv.memptr(), &info); if(info != 0) { return false; } - arma_extra_debug_print("lapack::gbtrs()"); + arma_debug_print("lapack::gbtrs()"); lapack::gbtrs(&trans, &n, &kl, &ku, &nrhs, AB.memptr(), &ldab, ipiv.memptr(), out.memptr(), &ldb, &info); if(info != 0) { return false; } @@ -5443,7 +5453,7 @@ inline bool auxlib::solve_band_refine(Mat& out, typename T1::pod_type& out_rcond, Mat& A, const uword KL, const uword KU, const Base& B_expr, const bool equilibrate) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -5451,7 +5461,7 @@ auxlib::solve_band_refine(Mat& out, typename T1::pod_type Mat B = B_expr.get_ref(); // B is overwritten - arma_debug_check( (A.n_rows != B.n_rows), "solve(): number of rows in given matrices must be the same" ); + arma_conform_check( (A.n_rows != B.n_rows), "solve(): number of rows in given matrices must be the same" ); if(A.is_empty() || B.is_empty()) { out.zeros(A.n_rows, B.n_cols); return true; } @@ -5462,7 +5472,7 @@ auxlib::solve_band_refine(Mat& out, typename T1::pod_type const uword N = AB.n_cols; - arma_debug_assert_blas_size(AB,B); + arma_conform_assert_blas_size(AB,B); out.set_size(N, B.n_cols); @@ -5490,7 +5500,7 @@ auxlib::solve_band_refine(Mat& out, typename T1::pod_type podarray WORK(3*N); podarray IWORK( N); - arma_extra_debug_print("lapack::gbsvx()"); + arma_debug_print("lapack::gbsvx()"); lapack::gbsvx ( &fact, &trans, &n, &kl, &ku, &nrhs, @@ -5537,11 +5547,11 @@ inline bool auxlib::solve_band_refine(Mat< std::complex >& out, typename T1::pod_type& out_rcond, Mat< std::complex >& A, const uword KL, const uword KU, const Base,T1>& B_expr, const bool equilibrate) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_CRIPPLED_LAPACK) { - arma_extra_debug_print("auxlib::solve_band_refine(): redirecting to auxlib::solve_square_refine() due to crippled LAPACK"); + arma_debug_print("auxlib::solve_band_refine(): redirecting to auxlib::solve_square_refine() due to crippled LAPACK"); arma_ignore(KL); arma_ignore(KU); @@ -5555,7 +5565,7 @@ auxlib::solve_band_refine(Mat< std::complex >& out, typen Mat B = B_expr.get_ref(); // B is overwritten - arma_debug_check( (A.n_rows != B.n_rows), "solve(): number of rows in given matrices must be the same" ); + arma_conform_check( (A.n_rows != B.n_rows), "solve(): number of rows in given matrices must be the same" ); if(A.is_empty() || B.is_empty()) { out.zeros(A.n_rows, B.n_cols); return true; } @@ -5566,7 +5576,7 @@ auxlib::solve_band_refine(Mat< std::complex >& out, typen const uword N = AB.n_cols; - arma_debug_assert_blas_size(AB,B); + arma_conform_assert_blas_size(AB,B); out.set_size(N, B.n_cols); @@ -5594,7 +5604,7 @@ auxlib::solve_band_refine(Mat< std::complex >& out, typen podarray WORK(2*N); podarray< T> RWORK( N); // NOTE: according to lapack 3.6.1 docs, the size of RWORK in zgbsvx is different to RWORK in dgesvx - arma_extra_debug_print("lapack::cx_gbsvx()"); + arma_debug_print("lapack::cx_gbsvx()"); lapack::cx_gbsvx ( &fact, &trans, &n, &kl, &ku, &nrhs, @@ -5641,7 +5651,7 @@ inline bool auxlib::solve_tridiag_fast(Mat& out, Mat& A, const Base& B_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return auxlib::solve_tridiag_fast_common(out, A, B_expr); } @@ -5654,11 +5664,11 @@ inline bool auxlib::solve_tridiag_fast(Mat< std::complex >& out, Mat< std::complex >& A, const Base< std::complex,T1>& B_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_CRIPPLED_LAPACK) { - arma_extra_debug_print("auxlib::solve_tridiag_fast(): redirecting to auxlib::solve_square_fast() due to crippled LAPACK"); + arma_debug_print("auxlib::solve_tridiag_fast(): redirecting to auxlib::solve_square_fast() due to crippled LAPACK"); return auxlib::solve_square_fast(out, A, B_expr); } @@ -5677,7 +5687,7 @@ inline bool auxlib::solve_tridiag_fast_common(Mat& out, const Mat& A, const Base& B_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -5688,21 +5698,21 @@ auxlib::solve_tridiag_fast_common(Mat& out, const Mat tridiag; band_helper::extract_tridiag(tridiag, A); - arma_debug_assert_blas_size(tridiag, out); + arma_conform_assert_blas_size(tridiag, out); blas_int n = blas_int(A.n_rows); blas_int nrhs = blas_int(B_n_cols); blas_int ldb = blas_int(B_n_rows); blas_int info = blas_int(0); - arma_extra_debug_print("lapack::gtsv()"); + arma_debug_print("lapack::gtsv()"); lapack::gtsv(&n, &nrhs, tridiag.colptr(0), tridiag.colptr(1), tridiag.colptr(2), out.memptr(), &ldb, &info); return (info == 0); @@ -5728,17 +5738,17 @@ inline bool auxlib::schur(Mat& U, Mat& S, const Base& X, const bool calc_U) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { S = X.get_ref(); - arma_debug_check( (S.is_square() == false), "schur(): given matrix must be square sized" ); + arma_conform_check( (S.is_square() == false), "schur(): given matrix must be square sized" ); if(S.is_empty()) { U.reset(); S.reset(); return true; } - arma_debug_assert_blas_size(S); + arma_conform_assert_blas_size(S); const uword S_n_rows = S.n_rows; @@ -5759,7 +5769,7 @@ auxlib::schur(Mat& U, Mat& S, const Base& X, const bool calc_U) podarray work( static_cast(lwork) ); podarray bwork(S_n_rows); - arma_extra_debug_print("lapack::gees()"); + arma_debug_print("lapack::gees()"); lapack::gees(&jobvs, &sort, select, &n, S.memptr(), &n, &sdim, wr.memptr(), wi.memptr(), U.memptr(), &ldvs, work.memptr(), &lwork, bwork.memptr(), &info); return (info == 0); @@ -5783,11 +5793,11 @@ inline bool auxlib::schur(Mat< std::complex >& U, Mat< std::complex >& S, const Base,T1>& X, const bool calc_U) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); S = X.get_ref(); - arma_debug_check( (S.is_square() == false), "schur(): given matrix must be square sized" ); + arma_conform_check( (S.is_square() == false), "schur(): given matrix must be square sized" ); return auxlib::schur(U,S,calc_U); } @@ -5799,7 +5809,7 @@ inline bool auxlib::schur(Mat< std::complex >& U, Mat< std::complex >& S, const bool calc_U) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -5807,7 +5817,7 @@ auxlib::schur(Mat< std::complex >& U, Mat< std::complex >& S, const bool c if(S.is_empty()) { U.reset(); S.reset(); return true; } - arma_debug_assert_blas_size(S); + arma_conform_assert_blas_size(S); const uword S_n_rows = S.n_rows; @@ -5827,7 +5837,7 @@ auxlib::schur(Mat< std::complex >& U, Mat< std::complex >& S, const bool c podarray< T> rwork(S_n_rows); podarray bwork(S_n_rows); - arma_extra_debug_print("lapack::cx_gees()"); + arma_debug_print("lapack::cx_gees()"); lapack::cx_gees(&jobvs, &sort, select, &n, S.memptr(), &n, &sdim, w.memptr(), U.memptr(), &ldvs, work.memptr(), &lwork, rwork.memptr(), bwork.memptr(), &info); return (info == 0); @@ -5853,13 +5863,13 @@ inline bool auxlib::syl(Mat& X, const Mat& A, const Mat& B, const Mat& C) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { - arma_debug_check( (A.is_square() == false) || (B.is_square() == false), "syl(): given matrices must be square sized" ); + arma_conform_check( (A.is_square() == false) || (B.is_square() == false), "syl(): given matrices must be square sized" ); - arma_debug_check( (C.n_rows != A.n_rows) || (C.n_cols != B.n_cols), "syl(): matrices are not conformant" ); + arma_conform_check( (C.n_rows != A.n_rows) || (C.n_cols != B.n_cols), "syl(): matrices are not conformant" ); if(A.is_empty() || B.is_empty() || C.is_empty()) { X.reset(); return true; } @@ -5881,7 +5891,7 @@ auxlib::syl(Mat& X, const Mat& A, const Mat& B, const Mat& C) Mat Y = trans(Z1) * C * Z2; - arma_extra_debug_print("lapack::trsyl()"); + arma_debug_print("lapack::trsyl()"); lapack::trsyl(&trana, &tranb, &isgn, &m, &n, T1.memptr(), &m, T2.memptr(), &n, Y.memptr(), &m, &scale, &info); if(info < 0) { return false; } @@ -5915,23 +5925,23 @@ inline bool auxlib::qz(Mat& A, Mat& B, Mat& vsl, Mat& vsr, const Base& X_expr, const Base& Y_expr, const char mode) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { A = X_expr.get_ref(); B = Y_expr.get_ref(); - arma_debug_check( ((A.is_square() == false) || (B.is_square() == false)), "qz(): given matrices must be square sized", [&](){ A.soft_reset(); B.soft_reset(); } ); + arma_conform_check( ((A.is_square() == false) || (B.is_square() == false)), "qz(): given matrices must be square sized", [&](){ A.soft_reset(); B.soft_reset(); } ); - arma_debug_check( (A.n_rows != B.n_rows), "qz(): given matrices must have the same size" ); + arma_conform_check( (A.n_rows != B.n_rows), "qz(): given matrices must have the same size" ); if(A.is_empty()) { A.reset(); B.reset(); vsl.reset(); vsr.reset(); return true; } if(arma_config::check_nonfinite && A.internal_has_nonfinite()) { return false; } if(arma_config::check_nonfinite && B.internal_has_nonfinite()) { return false; } - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); vsl.set_size(A.n_rows, A.n_rows); vsr.set_size(A.n_rows, A.n_rows); @@ -5957,7 +5967,7 @@ auxlib::qz(Mat& A, Mat& B, Mat& vsl, Mat& vsr, const Base& X_e podarray work( static_cast(lwork) ); podarray bwork( static_cast(N) ); - arma_extra_debug_print("lapack::gges()"); + arma_debug_print("lapack::gges()"); lapack::gges ( @@ -6000,7 +6010,7 @@ inline bool auxlib::qz(Mat< std::complex >& A, Mat< std::complex >& B, Mat< std::complex >& vsl, Mat< std::complex >& vsr, const Base< std::complex, T1 >& X_expr, const Base< std::complex, T2 >& Y_expr, const char mode) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -6009,16 +6019,16 @@ auxlib::qz(Mat< std::complex >& A, Mat< std::complex >& B, Mat< std::compl A = X_expr.get_ref(); B = Y_expr.get_ref(); - arma_debug_check( ((A.is_square() == false) || (B.is_square() == false)), "qz(): given matrices must be square sized", [&](){ A.soft_reset(); B.soft_reset(); } ); + arma_conform_check( ((A.is_square() == false) || (B.is_square() == false)), "qz(): given matrices must be square sized", [&](){ A.soft_reset(); B.soft_reset(); } ); - arma_debug_check( (A.n_rows != B.n_rows), "qz(): given matrices must have the same size" ); + arma_conform_check( (A.n_rows != B.n_rows), "qz(): given matrices must have the same size" ); if(A.is_empty()) { A.reset(); B.reset(); vsl.reset(); vsr.reset(); return true; } if(arma_config::check_nonfinite && A.internal_has_nonfinite()) { return false; } if(arma_config::check_nonfinite && B.internal_has_nonfinite()) { return false; } - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); vsl.set_size(A.n_rows, A.n_rows); vsr.set_size(A.n_rows, A.n_rows); @@ -6044,7 +6054,7 @@ auxlib::qz(Mat< std::complex >& A, Mat< std::complex >& B, Mat< std::compl podarray< T> rwork( static_cast(8*N) ); podarray bwork( static_cast(N) ); - arma_extra_debug_print("lapack::cx_gges()"); + arma_debug_print("lapack::cx_gges()"); lapack::cx_gges ( @@ -6086,7 +6096,7 @@ auxlib::rcond(Mat& A) { #if defined(ARMA_USE_LAPACK) { - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); char norm_id = '1'; blas_int m = blas_int(A.n_rows); @@ -6100,15 +6110,15 @@ auxlib::rcond(Mat& A) podarray iwork( A.n_rows); podarray ipiv( (std::min)(A.n_rows, A.n_cols) ); - arma_extra_debug_print("lapack::lange()"); + arma_debug_print("lapack::lange()"); norm_val = (has_blas_float_bug::value) ? auxlib::norm1_gen(A) : lapack::lange(&norm_id, &m, &n, A.memptr(), &lda, work.memptr()); - arma_extra_debug_print("lapack::getrf()"); + arma_debug_print("lapack::getrf()"); lapack::getrf(&m, &n, A.memptr(), &lda, ipiv.memptr(), &info); if(info != blas_int(0)) { return eT(0); } - arma_extra_debug_print("lapack::gecon()"); + arma_debug_print("lapack::gecon()"); lapack::gecon(&norm_id, &n, A.memptr(), &lda, &norm_val, &rcond, work.memptr(), iwork.memptr(), &info); if(info != blas_int(0)) { return eT(0); } @@ -6135,7 +6145,7 @@ auxlib::rcond(Mat< std::complex >& A) { typedef typename std::complex eT; - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); char norm_id = '1'; blas_int m = blas_int(A.n_rows); @@ -6150,15 +6160,15 @@ auxlib::rcond(Mat< std::complex >& A) podarray< T> rwork(2*A.n_rows); podarray ipiv( (std::min)(A.n_rows, A.n_cols) ); - arma_extra_debug_print("lapack::lange()"); + arma_debug_print("lapack::lange()"); norm_val = (has_blas_float_bug::value) ? auxlib::norm1_gen(A) : lapack::lange(&norm_id, &m, &n, A.memptr(), &lda, junk.memptr()); - arma_extra_debug_print("lapack::getrf()"); + arma_debug_print("lapack::getrf()"); lapack::getrf(&m, &n, A.memptr(), &lda, ipiv.memptr(), &info); if(info != blas_int(0)) { return T(0); } - arma_extra_debug_print("lapack::cx_gecon()"); + arma_debug_print("lapack::cx_gecon()"); lapack::cx_gecon(&norm_id, &n, A.memptr(), &lda, &norm_val, &rcond, work.memptr(), rwork.memptr(), &info); if(info != blas_int(0)) { return T(0); } @@ -6183,7 +6193,7 @@ auxlib::rcond_sympd(Mat& A, bool& calc_ok) { #if defined(ARMA_USE_LAPACK) { - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); calc_ok = false; @@ -6198,15 +6208,15 @@ auxlib::rcond_sympd(Mat& A, bool& calc_ok) podarray work(3*A.n_rows); podarray iwork( A.n_rows); - arma_extra_debug_print("lapack::lansy()"); + arma_debug_print("lapack::lansy()"); norm_val = (has_blas_float_bug::value) ? auxlib::norm1_sym(A) : lapack::lansy(&norm_id, &uplo, &n, A.memptr(), &lda, work.memptr()); - arma_extra_debug_print("lapack::potrf()"); + arma_debug_print("lapack::potrf()"); lapack::potrf(&uplo, &n, A.memptr(), &lda, &info); if(info != blas_int(0)) { return eT(0); } - arma_extra_debug_print("lapack::pocon()"); + arma_debug_print("lapack::pocon()"); lapack::pocon(&uplo, &n, A.memptr(), &lda, &norm_val, &rcond, work.memptr(), iwork.memptr(), &info); if(info != blas_int(0)) { return eT(0); } @@ -6234,7 +6244,7 @@ auxlib::rcond_sympd(Mat< std::complex >& A, bool& calc_ok) { #if defined(ARMA_CRIPPLED_LAPACK) { - arma_extra_debug_print("auxlib::rcond_sympd(): redirecting to auxlib::rcond() due to crippled LAPACK"); + arma_debug_print("auxlib::rcond_sympd(): redirecting to auxlib::rcond() due to crippled LAPACK"); calc_ok = true; @@ -6244,7 +6254,7 @@ auxlib::rcond_sympd(Mat< std::complex >& A, bool& calc_ok) { typedef typename std::complex eT; - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); calc_ok = false; @@ -6259,15 +6269,15 @@ auxlib::rcond_sympd(Mat< std::complex >& A, bool& calc_ok) podarray work(2*A.n_rows); podarray< T> rwork( A.n_rows); - arma_extra_debug_print("lapack::lanhe()"); + arma_debug_print("lapack::lanhe()"); norm_val = (has_blas_float_bug::value) ? auxlib::norm1_sym(A) : lapack::lanhe(&norm_id, &uplo, &n, A.memptr(), &lda, rwork.memptr()); - arma_extra_debug_print("lapack::potrf()"); + arma_debug_print("lapack::potrf()"); lapack::potrf(&uplo, &n, A.memptr(), &lda, &info); if(info != blas_int(0)) { return T(0); } - arma_extra_debug_print("lapack::cx_pocon()"); + arma_debug_print("lapack::cx_pocon()"); lapack::cx_pocon(&uplo, &n, A.memptr(), &lda, &norm_val, &rcond, work.memptr(), rwork.memptr(), &info); if(info != blas_int(0)) { return T(0); } @@ -6295,7 +6305,7 @@ auxlib::rcond_trimat(const Mat& A, const uword layout) { #if defined(ARMA_USE_LAPACK) { - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); char norm_id = '1'; char uplo = (layout == 0) ? 'U' : 'L'; @@ -6307,7 +6317,7 @@ auxlib::rcond_trimat(const Mat& A, const uword layout) podarray work(3*A.n_rows); podarray iwork( A.n_rows); - arma_extra_debug_print("lapack::trcon()"); + arma_debug_print("lapack::trcon()"); lapack::trcon(&norm_id, &uplo, &diag, &n, A.memptr(), &n, &rcond, work.memptr(), iwork.memptr(), &info); if(info != blas_int(0)) { return eT(0); } @@ -6335,7 +6345,7 @@ auxlib::rcond_trimat(const Mat< std::complex >& A, const uword layout) { typedef typename std::complex eT; - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); char norm_id = '1'; char uplo = (layout == 0) ? 'U' : 'L'; @@ -6347,7 +6357,7 @@ auxlib::rcond_trimat(const Mat< std::complex >& A, const uword layout) podarray work(2*A.n_rows); podarray< T> rwork( A.n_rows); - arma_extra_debug_print("lapack::cx_trcon()"); + arma_debug_print("lapack::cx_trcon()"); lapack::cx_trcon(&norm_id, &uplo, &diag, &n, A.memptr(), &n, &rcond, work.memptr(), rwork.memptr(), &info); if(info != blas_int(0)) { return T(0); } @@ -6382,7 +6392,7 @@ auxlib::lu_rcond(const Mat& A, const eT norm_val) podarray work(4*A.n_rows); podarray iwork( A.n_rows); - arma_extra_debug_print("lapack::gecon()"); + arma_debug_print("lapack::gecon()"); lapack::gecon(&norm_id, &n, A.memptr(), &lda, &norm_val, &rcond, work.memptr(), iwork.memptr(), &info); if(info != blas_int(0)) { return eT(0); } @@ -6418,7 +6428,7 @@ auxlib::lu_rcond(const Mat< std::complex >& A, const T norm_val) podarray work(2*A.n_rows); podarray< T> rwork(2*A.n_rows); - arma_extra_debug_print("lapack::cx_gecon()"); + arma_debug_print("lapack::cx_gecon()"); lapack::cx_gecon(&norm_id, &n, A.memptr(), &lda, &norm_val, &rcond, work.memptr(), rwork.memptr(), &info); if(info != blas_int(0)) { return T(0); } @@ -6451,7 +6461,7 @@ auxlib::lu_rcond_sympd(const Mat& A, const eT norm_val) podarray work(3*A.n_rows); podarray iwork( A.n_rows); - arma_extra_debug_print("lapack::pocon()"); + arma_debug_print("lapack::pocon()"); lapack::pocon(&uplo, &n, A.memptr(), &n, &norm_val, &rcond, work.memptr(), iwork.memptr(), &info); if(info != blas_int(0)) { return eT(0); } @@ -6492,7 +6502,7 @@ auxlib::lu_rcond_sympd(const Mat< std::complex >& A, const T norm_val) podarray work(2*A.n_rows); podarray< T> rwork( A.n_rows); - arma_extra_debug_print("lapack::cx_pocon()"); + arma_debug_print("lapack::cx_pocon()"); lapack::cx_pocon(&uplo, &n, A.memptr(), &n, &norm_val, &rcond, work.memptr(), rwork.memptr(), &info); if(info != blas_int(0)) { return T(0); } @@ -6530,7 +6540,7 @@ auxlib::lu_rcond_band(const Mat& AB, const uword KL, const uword KU, const p podarray work(3*N); podarray iwork( N); - arma_extra_debug_print("lapack::gbcon()"); + arma_debug_print("lapack::gbcon()"); lapack::gbcon(&norm_id, &n, &kl, &ku, AB.memptr(), &ldab, ipiv.memptr(), &norm_val, &rcond, work.memptr(), iwork.memptr(), &info); if(info != blas_int(0)) { return eT(0); } @@ -6582,7 +6592,7 @@ auxlib::lu_rcond_band(const Mat< std::complex >& AB, const uword KL, const uw podarray work(2*N); podarray< T> rwork( N); - arma_extra_debug_print("lapack::cx_gbcon()"); + arma_debug_print("lapack::cx_gbcon()"); lapack::cx_gbcon(&norm_id, &n, &kl, &ku, AB.memptr(), &ldab, ipiv.memptr(), &norm_val, &rcond, work.memptr(), rwork.memptr(), &info); if(info != blas_int(0)) { return T(0); } @@ -6610,7 +6620,7 @@ auxlib::crippled_lapack(const Base&) { #if defined(ARMA_CRIPPLED_LAPACK) { - arma_extra_debug_print("auxlib::crippled_lapack(): true"); + arma_debug_print("auxlib::crippled_lapack(): true"); return (is_cx::yes); } @@ -6628,7 +6638,7 @@ inline bool auxlib::rudimentary_sym_check(const Mat& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N = X.n_rows; const uword Nm2 = N-2; @@ -6667,7 +6677,7 @@ inline bool auxlib::rudimentary_sym_check(const Mat< std::complex >& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: the function name is a misnomer, as it checks for hermitian complex matrices; // NOTE: for simplicity of use, the function name is the same as for real matrices @@ -6709,7 +6719,7 @@ inline typename get_pod_type::result auxlib::norm1_gen(const Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -6740,7 +6750,7 @@ inline typename get_pod_type::result auxlib::norm1_sym(const Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -6772,7 +6782,7 @@ inline typename get_pod_type::result auxlib::norm1_band(const Mat& A, const uword KL, const uword KU) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -6819,7 +6829,7 @@ inline blas_int select_lhp(const T* x_ptr, const T* y_ptr, const T* z_ptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // cout << "select_lhp(): (*x_ptr) = " << (*x_ptr) << endl; // cout << "select_lhp(): (*y_ptr) = " << (*y_ptr) << endl; @@ -6842,7 +6852,7 @@ inline blas_int select_rhp(const T* x_ptr, const T* y_ptr, const T* z_ptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // cout << "select_rhp(): (*x_ptr) = " << (*x_ptr) << endl; // cout << "select_rhp(): (*y_ptr) = " << (*y_ptr) << endl; @@ -6865,7 +6875,7 @@ inline blas_int select_iuc(const T* x_ptr, const T* y_ptr, const T* z_ptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // cout << "select_iuc(): (*x_ptr) = " << (*x_ptr) << endl; // cout << "select_iuc(): (*y_ptr) = " << (*y_ptr) << endl; @@ -6888,7 +6898,7 @@ inline blas_int select_ouc(const T* x_ptr, const T* y_ptr, const T* z_ptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // cout << "select_ouc(): (*x_ptr) = " << (*x_ptr) << endl; // cout << "select_ouc(): (*y_ptr) = " << (*y_ptr) << endl; @@ -6918,7 +6928,7 @@ inline blas_int cx_select_lhp(const std::complex* x_ptr, const std::complex* y_ptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // cout << "cx_select_lhp(): (*x_ptr) = " << (*x_ptr) << endl; // cout << "cx_select_lhp(): (*y_ptr) = " << (*y_ptr) << endl; @@ -6938,7 +6948,7 @@ inline blas_int cx_select_rhp(const std::complex* x_ptr, const std::complex* y_ptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // cout << "cx_select_rhp(): (*x_ptr) = " << (*x_ptr) << endl; // cout << "cx_select_rhp(): (*y_ptr) = " << (*y_ptr) << endl; @@ -6958,7 +6968,7 @@ inline blas_int cx_select_iuc(const std::complex* x_ptr, const std::complex* y_ptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // cout << "cx_select_iuc(): (*x_ptr) = " << (*x_ptr) << endl; // cout << "cx_select_iuc(): (*y_ptr) = " << (*y_ptr) << endl; @@ -6978,7 +6988,7 @@ inline blas_int cx_select_ouc(const std::complex* x_ptr, const std::complex* y_ptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // cout << "cx_select_ouc(): (*x_ptr) = " << (*x_ptr) << endl; // cout << "cx_select_ouc(): (*y_ptr) = " << (*y_ptr) << endl; diff --git a/inst/include/armadillo_bits/band_helper.hpp b/inst/include/armadillo_bits/band_helper.hpp index 4493c704..36a2ce38 100644 --- a/inst/include/armadillo_bits/band_helper.hpp +++ b/inst/include/armadillo_bits/band_helper.hpp @@ -30,7 +30,7 @@ inline bool is_band(uword& out_KL, uword& out_KU, const Mat& A, const uword N_min) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: assuming that A has a square size // NOTE: assuming that N_min is >= 4 @@ -108,7 +108,7 @@ inline bool is_band_lower(uword& out_KD, const Mat& A, const uword N_min) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: assuming that A has a square size // NOTE: assuming that N_min is >= 4 @@ -171,7 +171,7 @@ inline bool is_band_upper(uword& out_KD, const Mat& A, const uword N_min) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: assuming that A has a square size // NOTE: assuming that N_min is >= 4 @@ -234,7 +234,7 @@ inline void compress(Mat& AB, const Mat& A, const uword KL, const uword KU, const bool use_offset) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: assuming that A has a square size @@ -287,12 +287,12 @@ inline void uncompress(Mat& A, const Mat& AB, const uword KL, const uword KU, const bool use_offset) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword AB_n_rows = AB.n_rows; const uword N = AB.n_cols; - arma_debug_check( (AB_n_rows != ((use_offset) ? uword(2*KL + KU + 1) : uword(KL + KU + 1))), "band_helper::uncompress(): detected inconsistency" ); + arma_conform_check( (AB_n_rows != ((use_offset) ? uword(2*KL + KU + 1) : uword(KL + KU + 1))), "band_helper::uncompress(): detected inconsistency" ); A.zeros(N,N); // assuming there is no aliasing between A and AB @@ -328,7 +328,7 @@ inline void extract_tridiag(Mat& out, const Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: assuming that A has a square size and is at least 2x2 diff --git a/inst/include/armadillo_bits/compiler_check.hpp b/inst/include/armadillo_bits/compiler_check.hpp index b6fbd8a6..396efcde 100644 --- a/inst/include/armadillo_bits/compiler_check.hpp +++ b/inst/include/armadillo_bits/compiler_check.hpp @@ -16,16 +16,11 @@ // ------------------------------------------------------------------------ -#undef ARMA_HAVE_CXX11 #undef ARMA_HAVE_CXX14 #undef ARMA_HAVE_CXX17 #undef ARMA_HAVE_CXX20 #undef ARMA_HAVE_CXX23 -#if (__cplusplus >= 201103L) - #define ARMA_HAVE_CXX11 -#endif - #if (__cplusplus >= 201402L) #define ARMA_HAVE_CXX14 #endif @@ -47,9 +42,6 @@ #if defined(_MSVC_LANG) #if (_MSVC_LANG >= 201402L) - #undef ARMA_HAVE_CXX11 - #define ARMA_HAVE_CXX11 - #undef ARMA_HAVE_CXX14 #define ARMA_HAVE_CXX14 #endif @@ -78,8 +70,8 @@ #endif -#if !defined(ARMA_HAVE_CXX11) - #error "*** C++11 compiler required; enable C++11 mode in your compiler, or use an earlier version of Armadillo" +#if !defined(ARMA_HAVE_CXX14) + #error "*** C++14 compiler required; enable C++14 mode in your compiler, or use an earlier version of Armadillo" #endif diff --git a/inst/include/armadillo_bits/compiler_setup.hpp b/inst/include/armadillo_bits/compiler_setup.hpp index 29474aa9..43dce590 100644 --- a/inst/include/armadillo_bits/compiler_setup.hpp +++ b/inst/include/armadillo_bits/compiler_setup.hpp @@ -34,8 +34,8 @@ #define arma_aligned #define arma_align_mem #define arma_warn_unused -#define arma_deprecated -#define arma_frown(msg) +#define arma_deprecated [[deprecated]] +#define arma_frown(msg) [[deprecated(msg)]] #define arma_malloc #define arma_inline inline #define arma_noinline @@ -161,13 +161,12 @@ #undef ARMA_GCC_VERSION #define ARMA_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) - #if (ARMA_GCC_VERSION < 40803) - #error "*** newer compiler required; need gcc 4.8.3 or newer ***" + #if (ARMA_GCC_VERSION < 60100) + #error "*** newer compiler required; need gcc 6.1 or newer ***" #endif - // #if (ARMA_GCC_VERSION < 60100) - // #pragma message ("WARNING: support for gcc versions older than 6.1 is deprecated") - // #endif + // gcc 6.1 has proper C++14 support and fixes an OpenMP related bug: + // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57580 #define ARMA_GOOD_COMPILER @@ -176,8 +175,6 @@ #undef arma_aligned #undef arma_align_mem #undef arma_warn_unused - #undef arma_deprecated - #undef arma_frown #undef arma_malloc #undef arma_inline #undef arma_noinline @@ -187,8 +184,6 @@ #define arma_aligned __attribute__((__aligned__)) #define arma_align_mem __attribute__((__aligned__(16))) #define arma_warn_unused __attribute__((__warn_unused_result__)) - #define arma_deprecated __attribute__((__deprecated__)) - #define arma_frown(msg) __attribute__((__deprecated__(msg))) #define arma_malloc __attribute__((__malloc__)) #define arma_inline __attribute__((__always_inline__)) inline #define arma_noinline __attribute__((__noinline__)) @@ -248,16 +243,6 @@ #define arma_warn_unused __attribute__((__warn_unused_result__)) #endif - #if __has_attribute(__deprecated__) - #undef arma_deprecated - #define arma_deprecated __attribute__((__deprecated__)) - #endif - - #if __has_attribute(__deprecated__) - #undef arma_frown - #define arma_frown(msg) __attribute__((__deprecated__(msg))) - #endif - #if __has_attribute(__malloc__) #undef arma_malloc #define arma_malloc __attribute__((__malloc__)) @@ -300,7 +285,7 @@ #error "*** newer compiler required ***" #endif - #if (__INTEL_COMPILER < 1500) + #if (__INTEL_COMPILER < 1600) #error "*** newer compiler required ***" #endif @@ -317,8 +302,6 @@ #error "*** newer compiler required ***" #endif - #undef arma_deprecated - #define arma_deprecated __declspec(deprecated) // #undef arma_inline // #define arma_inline __forceinline inline @@ -376,24 +359,6 @@ #endif -#if defined(__SUNPRO_CC) - // http://www.oracle.com/technetwork/server-storage/solarisstudio/training/index-jsp-141991.html - // http://www.oracle.com/technetwork/server-storage/solarisstudio/documentation/cplusplus-faq-355066.html - #if (__SUNPRO_CC < 0x5140) - #error "*** newer compiler required ***" - #endif -#endif - - -#if defined(ARMA_HAVE_CXX14) - #undef arma_deprecated - #define arma_deprecated [[deprecated]] - - #undef arma_frown - #define arma_frown(msg) [[deprecated(msg)]] -#endif - - #if defined(ARMA_HAVE_CXX17) #undef arma_warn_unused #define arma_warn_unused [[nodiscard]] @@ -427,17 +392,6 @@ #endif -#if defined(ARMA_USE_OPENMP) - #if (defined(ARMA_GCC_VERSION) && (ARMA_GCC_VERSION < 50400)) - // due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57580 - #undef ARMA_USE_OPENMP - #if !defined(ARMA_DONT_PRINT_OPENMP_WARNING) - #pragma message ("WARNING: use of OpenMP disabled due to compiler bug in gcc <= 5.3") - #endif - #endif -#endif - - #if (defined(__FAST_MATH__) || (defined(__FINITE_MATH_ONLY__) && (__FINITE_MATH_ONLY__ > 0)) || defined(_M_FP_FAST)) #undef ARMA_FAST_MATH #define ARMA_FAST_MATH @@ -499,7 +453,7 @@ // NOTE: option 'ARMA_IGNORE_DEPRECATED_MARKER' will be removed // NOTE: disabling deprecation messages is counter-productive -#if defined(ARMA_IGNORE_DEPRECATED_MARKER) && (!defined(ARMA_DONT_IGNORE_DEPRECATED_MARKER)) && (!defined(ARMA_EXTRA_DEBUG)) +#if defined(ARMA_IGNORE_DEPRECATED_MARKER) && (!defined(ARMA_DONT_IGNORE_DEPRECATED_MARKER)) && (!defined(ARMA_DEBUG)) #undef arma_deprecated #define arma_deprecated diff --git a/inst/include/armadillo_bits/config.hpp b/inst/include/armadillo_bits/config.hpp index f1f3d3b9..33632e9e 100644 --- a/inst/include/armadillo_bits/config.hpp +++ b/inst/include/armadillo_bits/config.hpp @@ -139,6 +139,11 @@ //// Note that ARMA_USE_OPENMP is automatically enabled when a compiler supporting OpenMP 3.1 is detected. #endif +#if !defined(ARMA_USE_STD_MUTEX) + #define ARMA_USE_STD_MUTEX +//// Comment out the above line to disable use of std::mutex +#endif + #if !defined(ARMA_64BIT_WORD) // #define ARMA_64BIT_WORD //// Uncomment the above line if you require matrices/vectors capable of holding more than 4 billion elements. @@ -164,6 +169,14 @@ //// of inv() and inv_sympd() within compound expressions #endif +#if !defined(ARMA_CHECK_CONFORMANCE) + #define ARMA_CHECK_CONFORMANCE + //// Comment out the above line to disable conformance checks for bounds and size. + //// This is NOT RECOMMENDED. + //// It is strongly recommended that conformance checks are enabled during development, + //// as this greatly aids in finding mistakes in your code. +#endif + #if !defined(ARMA_CHECK_NONFINITE) #define ARMA_CHECK_NONFINITE //// Comment out the above line to disable checking for nonfinite matrices @@ -189,25 +202,14 @@ //// The maximum number of threads to use for OpenMP based parallelisation; //// it must be an integer that is at least 1. -// #define ARMA_NO_DEBUG -//// Uncomment the above line to disable all run-time checks. NOT RECOMMENDED. -//// It is strongly recommended that run-time checks are enabled during development, -//// as this greatly aids in finding mistakes in your code. - -// #define ARMA_EXTRA_DEBUG +// #define ARMA_DEBUG //// Uncomment the above line to see the function traces of how Armadillo evaluates expressions. //// This is mainly useful for debugging of the library. - #if defined(ARMA_EXTRA_DEBUG) - #undef ARMA_NO_DEBUG - #undef ARMA_DONT_CHECK_NONFINITE - - #undef ARMA_CHECK_NONFINITE - #define ARMA_CHECK_NONFINITE - - #undef ARMA_WARN_LEVEL - #define ARMA_WARN_LEVEL 3 + // for compatibility with earlier versions of Armadillo + #undef ARMA_DEBUG + #define ARMA_DEBUG #endif @@ -285,17 +287,15 @@ #undef ARMA_USE_FORTRAN_HIDDEN_ARGS #endif -#if !defined(ARMA_DONT_USE_STD_MUTEX) - // #define ARMA_DONT_USE_STD_MUTEX - //// Uncomment the above line to disable use of std::mutex +#if defined(ARMA_DONT_USE_STD_MUTEX) + #undef ARMA_USE_STD_MUTEX #endif // for compatibility with earlier versions of Armadillo #if defined(ARMA_DONT_USE_CXX11_MUTEX) #pragma message ("WARNING: support for ARMA_DONT_USE_CXX11_MUTEX is deprecated and will be removed;") #pragma message ("WARNING: use ARMA_DONT_USE_STD_MUTEX instead") - #undef ARMA_DONT_USE_STD_MUTEX - #define ARMA_DONT_USE_STD_MUTEX + #undef ARMA_USE_STD_MUTEX #endif #if defined(ARMA_DONT_USE_OPENMP) @@ -318,10 +318,33 @@ #undef ARMA_OPTIMISE_INVEXPR #endif +#if defined(ARMA_DONT_CHECK_CONFORMANCE) + #undef ARMA_CHECK_CONFORMANCE +#endif + #if defined(ARMA_DONT_CHECK_NONFINITE) #undef ARMA_CHECK_NONFINITE #endif +#if defined(ARMA_NO_DEBUG) + #undef ARMA_DEBUG + #undef ARMA_EXTRA_DEBUG +#endif + +#if defined(ARMA_DEBUG) + #undef ARMA_DONT_CHECK_CONFORMANCE + #undef ARMA_DONT_CHECK_NONFINITE + + #undef ARMA_CHECK_CONFORMANCE + #define ARMA_CHECK_CONFORMANCE + + #undef ARMA_CHECK_NONFINITE + #define ARMA_CHECK_NONFINITE + + #undef ARMA_WARN_LEVEL + #define ARMA_WARN_LEVEL 3 +#endif + #if defined(ARMA_DONT_PRINT_ERRORS) #pragma message ("INFO: support for ARMA_DONT_PRINT_ERRORS option has been removed") @@ -338,11 +361,6 @@ #undef ARMA_PRINT_EXCEPTIONS #endif -#if !defined(ARMA_DONT_ZERO_INIT) - // #define ARMA_DONT_ZERO_INIT - //// Uncomment the above line to disable initialising elements to zero during construction of dense matrices and cubes -#endif - #if defined(ARMA_NO_CRIPPLED_LAPACK) #undef ARMA_CRIPPLED_LAPACK #endif diff --git a/inst/include/armadillo_bits/constants.hpp b/inst/include/armadillo_bits/constants.hpp index 9adf9ea6..a4b67522 100644 --- a/inst/include/armadillo_bits/constants.hpp +++ b/inst/include/armadillo_bits/constants.hpp @@ -176,22 +176,22 @@ template const eT Datum::log_max = std::log(std::numeric_li template const eT Datum::nan = priv::Datum_helper::nan(); template const eT Datum::inf = priv::Datum_helper::inf(); -template const eT Datum::m_u = eT(1.66053906660e-27); +template const eT Datum::m_u = eT(1.66053906892e-27); template const eT Datum::N_A = eT(6.02214076e23); template const eT Datum::k = eT(1.380649e-23); template const eT Datum::k_evk = eT(8.617333262e-5); -template const eT Datum::a_0 = eT(5.29177210903e-11); -template const eT Datum::mu_B = eT(9.2740100783e-24); -template const eT Datum::Z_0 = eT(376.730313668); +template const eT Datum::a_0 = eT(5.29177210544e-11); +template const eT Datum::mu_B = eT(9.2740100657e-24); +template const eT Datum::Z_0 = eT(376.730313412); template const eT Datum::G_0 = eT(7.748091729e-5); template const eT Datum::k_e = eT(8.9875517923e9); template const eT Datum::eps_0 = eT(8.8541878128e-12); -template const eT Datum::m_e = eT(9.1093837015e-31); +template const eT Datum::m_e = eT(9.1093837139e-31); template const eT Datum::eV = eT(1.602176634e-19); template const eT Datum::ec = eT(1.602176634e-19); template const eT Datum::F = eT(96485.33212); -template const eT Datum::alpha = eT(7.2973525693e-3); -template const eT Datum::alpha_inv = eT(137.035999084); +template const eT Datum::alpha = eT(7.2973525643e-3); +template const eT Datum::alpha_inv = eT(137.035999177); template const eT Datum::K_J = eT(483597.8484e9); template const eT Datum::mu_0 = eT(1.25663706212e-6); template const eT Datum::phi_0 = eT(2.067833848e-15); @@ -199,8 +199,8 @@ template const eT Datum::R = eT(8.314462618); template const eT Datum::G = eT(6.67430e-11); template const eT Datum::h = eT(6.62607015e-34); template const eT Datum::h_bar = eT(1.054571817e-34); -template const eT Datum::m_p = eT(1.67262192369e-27); -template const eT Datum::R_inf = eT(10973731.568160); +template const eT Datum::m_p = eT(1.67262192595e-27); +template const eT Datum::R_inf = eT(10973731.568157); template const eT Datum::c_0 = eT(299792458.0); template const eT Datum::sigma = eT(5.670374419e-8); template const eT Datum::R_k = eT(25812.80745); diff --git a/inst/include/armadillo_bits/debug.hpp b/inst/include/armadillo_bits/debug.hpp index 02ad4bdd..89176fc3 100644 --- a/inst/include/armadillo_bits/debug.hpp +++ b/inst/include/armadillo_bits/debug.hpp @@ -265,7 +265,7 @@ arma_print(const T1& x, const T2& y, const T3& z) //! print a message to the cerr stream with a preceding @ character. //! used for printing the signature of a function -//! (see the arma_extra_debug_sigprint macro) +//! (see the arma_debug_sigprint macro) inline void arma_sigprint(const char* x) @@ -317,13 +317,13 @@ inline void arma_thisprint(const void* this_ptr) { - get_cerr_stream() << " [this = " << this_ptr << ']' << std::endl; + get_cerr_stream() << " [this: " << this_ptr << ']' << std::endl; } // -// arma_warn +// arma_plain_warn //! print a message to the warn stream @@ -332,7 +332,7 @@ arma_cold arma_noinline static void -arma_warn(const T1& arg1) +arma_plain_warn(const T1& arg1) { get_cerr_stream() << "\nwarning: " << arg1 << std::endl; } @@ -343,7 +343,7 @@ arma_cold arma_noinline static void -arma_warn(const T1& arg1, const T2& arg2) +arma_plain_warn(const T1& arg1, const T2& arg2) { get_cerr_stream() << "\nwarning: " << arg1 << arg2 << std::endl; } @@ -354,7 +354,7 @@ arma_cold arma_noinline static void -arma_warn(const T1& arg1, const T2& arg2, const T3& arg3) +arma_plain_warn(const T1& arg1, const T2& arg2, const T3& arg3) { get_cerr_stream() << "\nwarning: " << arg1 << arg2 << arg3 << std::endl; } @@ -365,7 +365,7 @@ arma_cold arma_noinline static void -arma_warn(const T1& arg1, const T2& arg2, const T3& arg3, const T4& arg4) +arma_plain_warn(const T1& arg1, const T2& arg2, const T3& arg3, const T4& arg4) { get_cerr_stream() << "\nwarning: " << arg1 << arg2 << arg3 << arg4 << std::endl; } @@ -373,50 +373,50 @@ arma_warn(const T1& arg1, const T2& arg2, const T3& arg3, const T4& arg4) // -// arma_warn_level +// arma_warn template inline void -arma_warn_level(const uword level, const T1& arg1) +arma_warn(const uword level, const T1& arg1) { constexpr uword config_level = (sword(ARMA_WARN_LEVEL) > 0) ? uword(ARMA_WARN_LEVEL) : uword(0); - if((config_level > 0) && (level <= config_level)) { arma_warn(arg1); } + if((config_level > 0) && (level <= config_level)) { arma_plain_warn(arg1); } } template inline void -arma_warn_level(const uword level, const T1& arg1, const T2& arg2) +arma_warn(const uword level, const T1& arg1, const T2& arg2) { constexpr uword config_level = (sword(ARMA_WARN_LEVEL) > 0) ? uword(ARMA_WARN_LEVEL) : uword(0); - if((config_level > 0) && (level <= config_level)) { arma_warn(arg1,arg2); } + if((config_level > 0) && (level <= config_level)) { arma_plain_warn(arg1,arg2); } } template inline void -arma_warn_level(const uword level, const T1& arg1, const T2& arg2, const T3& arg3) +arma_warn(const uword level, const T1& arg1, const T2& arg2, const T3& arg3) { constexpr uword config_level = (sword(ARMA_WARN_LEVEL) > 0) ? uword(ARMA_WARN_LEVEL) : uword(0); - if((config_level > 0) && (level <= config_level)) { arma_warn(arg1,arg2,arg3); } + if((config_level > 0) && (level <= config_level)) { arma_plain_warn(arg1,arg2,arg3); } } template inline void -arma_warn_level(const uword level, const T1& arg1, const T2& arg2, const T3& arg3, const T4& arg4) +arma_warn(const uword level, const T1& arg1, const T2& arg2, const T3& arg3, const T4& arg4) { constexpr uword config_level = (sword(ARMA_WARN_LEVEL) > 0) ? uword(ARMA_WARN_LEVEL) : uword(0); - if((config_level > 0) && (level <= config_level)) { arma_warn(arg1,arg2,arg3,arg4); } + if((config_level > 0) && (level <= config_level)) { arma_plain_warn(arg1,arg2,arg3,arg4); } } @@ -1339,48 +1339,54 @@ arma_assert_atlas_size(const T1& A, const T2& B) // #define ARMA_FILELINE __FILE__ ": " ARMA_STRING2(__LINE__) -#if defined(ARMA_NO_DEBUG) +#if defined(ARMA_CHECK_CONFORMANCE) - #define arma_debug_print true ? (void)0 : arma_print - #define arma_debug_warn true ? (void)0 : arma_warn - #define arma_debug_warn_level true ? (void)0 : arma_warn_level - #define arma_debug_check true ? (void)0 : arma_check - #define arma_debug_check_bounds true ? (void)0 : arma_check_bounds - #define arma_debug_set_error true ? (void)0 : arma_set_error - #define arma_debug_assert_same_size true ? (void)0 : arma_assert_same_size - #define arma_debug_assert_mul_size true ? (void)0 : arma_assert_mul_size - #define arma_debug_assert_trans_mul_size true ? (void)0 : arma_assert_trans_mul_size - #define arma_debug_assert_cube_as_mat true ? (void)0 : arma_assert_cube_as_mat - #define arma_debug_assert_blas_size true ? (void)0 : arma_assert_blas_size - #define arma_debug_assert_atlas_size true ? (void)0 : arma_assert_atlas_size + #define arma_conform_warn arma_warn + #define arma_conform_check arma_check + #define arma_conform_check_bounds arma_check_bounds + #define arma_conform_set_error arma_set_error + #define arma_conform_assert_same_size arma_assert_same_size + #define arma_conform_assert_mul_size arma_assert_mul_size + #define arma_conform_assert_trans_mul_size arma_assert_trans_mul_size + #define arma_conform_assert_cube_as_mat arma_assert_cube_as_mat + #define arma_conform_assert_blas_size arma_assert_blas_size + #define arma_conform_assert_atlas_size arma_assert_atlas_size #else - #define arma_debug_print arma_print - #define arma_debug_warn arma_warn - #define arma_debug_warn_level arma_warn_level - #define arma_debug_check arma_check - #define arma_debug_check_bounds arma_check_bounds - #define arma_debug_set_error arma_set_error - #define arma_debug_assert_same_size arma_assert_same_size - #define arma_debug_assert_mul_size arma_assert_mul_size - #define arma_debug_assert_trans_mul_size arma_assert_trans_mul_size - #define arma_debug_assert_cube_as_mat arma_assert_cube_as_mat - #define arma_debug_assert_blas_size arma_assert_blas_size - #define arma_debug_assert_atlas_size arma_assert_atlas_size + #define arma_conform_warn true ? (void)0 : arma_warn + #define arma_conform_check true ? (void)0 : arma_check + #define arma_conform_check_bounds true ? (void)0 : arma_check_bounds + #define arma_conform_set_error true ? (void)0 : arma_set_error + #define arma_conform_assert_same_size true ? (void)0 : arma_assert_same_size + #define arma_conform_assert_mul_size true ? (void)0 : arma_assert_mul_size + #define arma_conform_assert_trans_mul_size true ? (void)0 : arma_assert_trans_mul_size + #define arma_conform_assert_cube_as_mat true ? (void)0 : arma_assert_cube_as_mat + #define arma_conform_assert_blas_size true ? (void)0 : arma_assert_blas_size + #define arma_conform_assert_atlas_size true ? (void)0 : arma_assert_atlas_size #endif -#if defined(ARMA_EXTRA_DEBUG) +#if defined(ARMA_DEBUG) + #define arma_debug_sigprint arma_sigprint(ARMA_FNSIG); arma_bktprint + #define arma_debug_sigprint_this arma_sigprint(ARMA_FNSIG); arma_thisprint + #define arma_debug_print arma_print + + // for compatibility with earlier versions of Armadillo #define arma_extra_debug_sigprint arma_sigprint(ARMA_FNSIG); arma_bktprint #define arma_extra_debug_sigprint_this arma_sigprint(ARMA_FNSIG); arma_thisprint #define arma_extra_debug_print arma_print #else + #define arma_debug_sigprint true ? (void)0 : arma_bktprint + #define arma_debug_sigprint_this true ? (void)0 : arma_thisprint + #define arma_debug_print true ? (void)0 : arma_print + + // for compatibility with earlier versions of Armadillo #define arma_extra_debug_sigprint true ? (void)0 : arma_bktprint #define arma_extra_debug_sigprint_this true ? (void)0 : arma_thisprint #define arma_extra_debug_print true ? (void)0 : arma_print @@ -1388,76 +1394,67 @@ arma_assert_atlas_size(const T1& A, const T2& B) #endif +// for compatibility with earlier versions of Armadillo +arma_frown("use arma_conform_check() instead") +inline void arma_debug_check(bool state, const char* msg) { arma_conform_check(state, msg); } -#if defined(ARMA_EXTRA_DEBUG) +#if defined(ARMA_DEBUG) namespace junk { - class arma_first_extra_debug_message + class arma_first_debug_message { public: inline - arma_first_extra_debug_message() + arma_first_debug_message() { - union - { - unsigned short a; - unsigned char b[sizeof(unsigned short)]; - } endian_test; - - endian_test.a = 1; - - const bool little_endian = (endian_test.b[0] == 1); - const char* nickname = ARMA_VERSION_NAME; + const char* nickname = ARMA_VERSION_NAME; std::ostream& out = get_cerr_stream(); out << "@ ---" << '\n'; out << "@ Armadillo " << arma_version::major << '.' << arma_version::minor << '.' << arma_version::patch - << " (" << nickname << ")\n"; + << " (" << nickname << ')'; - out << "@ arma_config::wrapper = " << arma_config::wrapper << '\n'; - out << "@ arma_config::cxx14 = " << arma_config::cxx14 << '\n'; - out << "@ arma_config::cxx17 = " << arma_config::cxx17 << '\n'; - out << "@ arma_config::cxx20 = " << arma_config::cxx20 << '\n'; - out << "@ arma_config::cxx23 = " << arma_config::cxx23 << '\n'; - out << "@ arma_config::std_mutex = " << arma_config::std_mutex << '\n'; - out << "@ arma_config::posix = " << arma_config::posix << '\n'; - out << "@ arma_config::openmp = " << arma_config::openmp << '\n'; - out << "@ arma_config::lapack = " << arma_config::lapack << '\n'; - out << "@ arma_config::blas = " << arma_config::blas << '\n'; - out << "@ arma_config::newarp = " << arma_config::newarp << '\n'; - out << "@ arma_config::arpack = " << arma_config::arpack << '\n'; - out << "@ arma_config::superlu = " << arma_config::superlu << '\n'; - out << "@ arma_config::atlas = " << arma_config::atlas << '\n'; - out << "@ arma_config::hdf5 = " << arma_config::hdf5 << '\n'; - out << "@ arma_config::good_comp = " << arma_config::good_comp << '\n'; - out << "@ arma_config::extra_code = " << arma_config::extra_code << '\n'; - out << "@ arma_config::hidden_args = " << arma_config::hidden_args << '\n'; - out << "@ arma_config::mat_prealloc = " << arma_config::mat_prealloc << '\n'; - out << "@ arma_config::mp_threshold = " << arma_config::mp_threshold << '\n'; - out << "@ arma_config::mp_threads = " << arma_config::mp_threads << '\n'; - out << "@ arma_config::optimise_band = " << arma_config::optimise_band << '\n'; - out << "@ arma_config::optimise_sym = " << arma_config::optimise_sym << '\n'; - out << "@ arma_config::optimise_invexpr = " << arma_config::optimise_invexpr << '\n'; - out << "@ arma_config::check_nonfinite = " << arma_config::check_nonfinite << '\n'; - out << "@ arma_config::zero_init = " << arma_config::zero_init << '\n'; - out << "@ arma_config::fast_math = " << arma_config::fast_math << '\n'; - out << "@ sizeof(void*) = " << sizeof(void*) << '\n'; - out << "@ sizeof(int) = " << sizeof(int) << '\n'; - out << "@ sizeof(long) = " << sizeof(long) << '\n'; - out << "@ sizeof(uword) = " << sizeof(uword) << '\n'; - out << "@ sizeof(blas_int) = " << sizeof(blas_int) << '\n'; - out << "@ little_endian = " << little_endian << '\n'; - out << "@ ---" << std::endl; + out << "\n@ arma_config::wrapper = " << arma_config::wrapper; + out << "\n@ arma_config::cxx17 = " << arma_config::cxx17; + out << "\n@ arma_config::cxx20 = " << arma_config::cxx20; + out << "\n@ arma_config::cxx23 = " << arma_config::cxx23; + out << "\n@ arma_config::std_mutex = " << arma_config::std_mutex; + out << "\n@ arma_config::posix = " << arma_config::posix; + out << "\n@ arma_config::openmp = " << arma_config::openmp; + out << "\n@ arma_config::lapack = " << arma_config::lapack; + out << "\n@ arma_config::blas = " << arma_config::blas; + out << "\n@ arma_config::newarp = " << arma_config::newarp; + out << "\n@ arma_config::arpack = " << arma_config::arpack; + out << "\n@ arma_config::superlu = " << arma_config::superlu; + out << "\n@ arma_config::atlas = " << arma_config::atlas; + out << "\n@ arma_config::hdf5 = " << arma_config::hdf5; + out << "\n@ arma_config::good_comp = " << arma_config::good_comp; + out << "\n@ arma_config::extra_code = " << arma_config::extra_code; + out << "\n@ arma_config::hidden_args = " << arma_config::hidden_args; + out << "\n@ arma_config::mat_prealloc = " << arma_config::mat_prealloc; + out << "\n@ arma_config::mp_threshold = " << arma_config::mp_threshold; + out << "\n@ arma_config::mp_threads = " << arma_config::mp_threads; + out << "\n@ arma_config::optimise_band = " << arma_config::optimise_band; + out << "\n@ arma_config::optimise_sym = " << arma_config::optimise_sym; + out << "\n@ arma_config::optimise_invexpr = " << arma_config::optimise_invexpr; + out << "\n@ arma_config::check_conformance = " << arma_config::check_conformance; + out << "\n@ arma_config::check_nonfinite = " << arma_config::check_nonfinite; + out << "\n@ arma_config::fast_math = " << arma_config::fast_math; + out << "\n@ sizeof(void*) = " << sizeof(void*); + out << "\n@ sizeof(int) = " << sizeof(int); + out << "\n@ sizeof(long) = " << sizeof(long); + out << "\n@ sizeof(uword) = " << sizeof(uword); + out << "\n@ sizeof(blas_int) = " << sizeof(blas_int); + out << "\n@ ---" << std::endl; } - }; - static arma_first_extra_debug_message arma_first_extra_debug_message_run; + static arma_first_debug_message arma_first_debug_message_run; } #endif diff --git a/inst/include/armadillo_bits/diagmat_proxy.hpp b/inst/include/armadillo_bits/diagmat_proxy.hpp index 262dd958..6d8a727d 100644 --- a/inst/include/armadillo_bits/diagmat_proxy.hpp +++ b/inst/include/armadillo_bits/diagmat_proxy.hpp @@ -37,7 +37,7 @@ class diagmat_proxy_default , n_rows ( P_is_vec ? P.get_n_elem() : P.get_n_rows() ) , n_cols ( P_is_vec ? P.get_n_elem() : P.get_n_cols() ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -115,7 +115,7 @@ class diagmat_proxy_fixed diagmat_proxy_fixed(const T1& X) : P(X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -195,7 +195,7 @@ class diagmat_proxy< Mat > , n_rows ( P_is_vec ? X.n_elem : X.n_rows ) , n_cols ( P_is_vec ? X.n_elem : X.n_cols ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline elem_type operator[] (const uword i) const { return P_is_vec ? P[i] : P.at(i,i); } @@ -226,7 +226,7 @@ class diagmat_proxy< Row > , n_rows(X.n_elem) , n_cols(X.n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline elem_type operator[] (const uword i) const { return P[i]; } @@ -258,7 +258,7 @@ class diagmat_proxy< Col > , n_rows(X.n_elem) , n_cols(X.n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline elem_type operator[] (const uword i) const { return P[i]; } @@ -290,7 +290,7 @@ class diagmat_proxy< subview_row > , n_rows(X.n_elem) , n_cols(X.n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline elem_type operator[] (const uword i) const { return P[i]; } @@ -322,7 +322,7 @@ class diagmat_proxy< subview_col > , n_rows(X.n_elem) , n_cols(X.n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline elem_type operator[] (const uword i) const { return P[i]; } @@ -355,7 +355,7 @@ class diagmat_proxy< Glue > n_rows = P.n_rows; n_cols = P.n_cols; - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline elem_type operator[] (const uword i) const { return P.at(i,i); } diff --git a/inst/include/armadillo_bits/diagview_meat.hpp b/inst/include/armadillo_bits/diagview_meat.hpp index e35f8579..c8d741ab 100644 --- a/inst/include/armadillo_bits/diagview_meat.hpp +++ b/inst/include/armadillo_bits/diagview_meat.hpp @@ -24,7 +24,7 @@ template inline diagview::~diagview() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } @@ -38,7 +38,7 @@ diagview::diagview(const Mat& in_m, const uword in_row_offset, const uwo , n_rows (in_len ) , n_elem (in_len ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } @@ -52,7 +52,7 @@ diagview::diagview(const diagview& in) , n_rows (in.n_rows ) , n_elem (in.n_elem ) { - arma_extra_debug_sigprint(arma_str::format("this = %x in = %x") % this % &in); + arma_debug_sigprint(arma_str::format("this: %x; in: %x") % this % &in); } @@ -66,7 +66,7 @@ diagview::diagview(diagview&& in) , n_rows (in.n_rows ) , n_elem (in.n_elem ) { - arma_extra_debug_sigprint(arma_str::format("this = %x in = %x") % this % &in); + arma_debug_sigprint(arma_str::format("this: %x; in: %x") % this % &in); // for paranoia @@ -84,11 +84,11 @@ inline void diagview::operator= (const diagview& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); diagview& d = *this; - arma_debug_check( (d.n_elem != x.n_elem), "diagview: diagonals have incompatible lengths" ); + arma_conform_check( (d.n_elem != x.n_elem), "diagview: diagonals have incompatible lengths" ); Mat& d_m = const_cast< Mat& >(d.m); const Mat& x_m = x.m; @@ -132,7 +132,7 @@ inline void diagview::operator+=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat& t_m = const_cast< Mat& >(m); @@ -153,7 +153,7 @@ inline void diagview::operator-=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat& t_m = const_cast< Mat& >(m); @@ -174,7 +174,7 @@ inline void diagview::operator*=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat& t_m = const_cast< Mat& >(m); @@ -195,7 +195,7 @@ inline void diagview::operator/=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat& t_m = const_cast< Mat& >(m); @@ -218,7 +218,7 @@ inline void diagview::operator= (const Base& o) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); diagview& d = *this; @@ -230,7 +230,7 @@ diagview::operator= (const Base& o) const Proxy P( o.get_ref() ); - arma_debug_check + arma_conform_check ( ( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ), "diagview: given object has incompatible size" @@ -238,7 +238,7 @@ diagview::operator= (const Base& o) const bool is_alias = P.is_alias(d_m); - if(is_alias) { arma_extra_debug_print("aliasing detected"); } + if(is_alias) { arma_debug_print("aliasing detected"); } if( (is_Mat::stored_type>::value) || (Proxy::use_at) || (is_alias) ) { @@ -291,7 +291,7 @@ inline void diagview::operator+=(const Base& o) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); diagview& d = *this; @@ -303,7 +303,7 @@ diagview::operator+=(const Base& o) const Proxy P( o.get_ref() ); - arma_debug_check + arma_conform_check ( ( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ), "diagview: given object has incompatible size" @@ -311,7 +311,7 @@ diagview::operator+=(const Base& o) const bool is_alias = P.is_alias(d_m); - if(is_alias) { arma_extra_debug_print("aliasing detected"); } + if(is_alias) { arma_debug_print("aliasing detected"); } if( (is_Mat::stored_type>::value) || (Proxy::use_at) || (is_alias) ) { @@ -364,7 +364,7 @@ inline void diagview::operator-=(const Base& o) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); diagview& d = *this; @@ -376,7 +376,7 @@ diagview::operator-=(const Base& o) const Proxy P( o.get_ref() ); - arma_debug_check + arma_conform_check ( ( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ), "diagview: given object has incompatible size" @@ -384,7 +384,7 @@ diagview::operator-=(const Base& o) const bool is_alias = P.is_alias(d_m); - if(is_alias) { arma_extra_debug_print("aliasing detected"); } + if(is_alias) { arma_debug_print("aliasing detected"); } if( (is_Mat::stored_type>::value) || (Proxy::use_at) || (is_alias) ) { @@ -437,7 +437,7 @@ inline void diagview::operator%=(const Base& o) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); diagview& d = *this; @@ -449,7 +449,7 @@ diagview::operator%=(const Base& o) const Proxy P( o.get_ref() ); - arma_debug_check + arma_conform_check ( ( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ), "diagview: given object has incompatible size" @@ -457,7 +457,7 @@ diagview::operator%=(const Base& o) const bool is_alias = P.is_alias(d_m); - if(is_alias) { arma_extra_debug_print("aliasing detected"); } + if(is_alias) { arma_debug_print("aliasing detected"); } if( (is_Mat::stored_type>::value) || (Proxy::use_at) || (is_alias) ) { @@ -510,7 +510,7 @@ inline void diagview::operator/=(const Base& o) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); diagview& d = *this; @@ -522,7 +522,7 @@ diagview::operator/=(const Base& o) const Proxy P( o.get_ref() ); - arma_debug_check + arma_conform_check ( ( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ), "diagview: given object has incompatible size" @@ -530,7 +530,7 @@ diagview::operator/=(const Base& o) const bool is_alias = P.is_alias(d_m); - if(is_alias) { arma_extra_debug_print("aliasing detected"); } + if(is_alias) { arma_debug_print("aliasing detected"); } if( (is_Mat::stored_type>::value) || (Proxy::use_at) || (is_alias) ) { @@ -583,7 +583,7 @@ inline void diagview::extract(Mat& out, const diagview& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: we're assuming that the matrix has already been set to the correct size and there is no aliasing; // size setting and alias checking is done by either the Mat contructor or operator=() @@ -620,9 +620,9 @@ inline void diagview::plus_inplace(Mat& out, const diagview& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(out.n_rows, out.n_cols, in.n_rows, in.n_cols, "addition"); + arma_conform_assert_same_size(out.n_rows, out.n_cols, in.n_rows, in.n_cols, "addition"); const Mat& in_m = in.m; @@ -656,9 +656,9 @@ inline void diagview::minus_inplace(Mat& out, const diagview& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(out.n_rows, out.n_cols, in.n_rows, in.n_cols, "subtraction"); + arma_conform_assert_same_size(out.n_rows, out.n_cols, in.n_rows, in.n_cols, "subtraction"); const Mat& in_m = in.m; @@ -692,9 +692,9 @@ inline void diagview::schur_inplace(Mat& out, const diagview& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(out.n_rows, out.n_cols, in.n_rows, in.n_cols, "element-wise multiplication"); + arma_conform_assert_same_size(out.n_rows, out.n_cols, in.n_rows, in.n_cols, "element-wise multiplication"); const Mat& in_m = in.m; @@ -728,9 +728,9 @@ inline void diagview::div_inplace(Mat& out, const diagview& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(out.n_rows, out.n_cols, in.n_rows, in.n_cols, "element-wise division"); + arma_conform_assert_same_size(out.n_rows, out.n_cols, in.n_rows, in.n_cols, "element-wise division"); const Mat& in_m = in.m; @@ -813,7 +813,7 @@ arma_inline eT& diagview::operator()(const uword ii) { - arma_debug_check_bounds( (ii >= n_elem), "diagview::operator(): out of bounds" ); + arma_conform_check_bounds( (ii >= n_elem), "diagview::operator(): out of bounds" ); return (const_cast< Mat& >(m)).at(ii+row_offset, ii+col_offset); } @@ -825,7 +825,7 @@ arma_inline eT diagview::operator()(const uword ii) const { - arma_debug_check_bounds( (ii >= n_elem), "diagview::operator(): out of bounds" ); + arma_conform_check_bounds( (ii >= n_elem), "diagview::operator(): out of bounds" ); return m.at(ii+row_offset, ii+col_offset); } @@ -857,7 +857,7 @@ arma_inline eT& diagview::operator()(const uword row, const uword col) { - arma_debug_check_bounds( ((row >= n_elem) || (col > 0)), "diagview::operator(): out of bounds" ); + arma_conform_check_bounds( ((row >= n_elem) || (col > 0)), "diagview::operator(): out of bounds" ); return (const_cast< Mat& >(m)).at(row+row_offset, row+col_offset); } @@ -869,7 +869,7 @@ arma_inline eT diagview::operator()(const uword row, const uword col) const { - arma_debug_check_bounds( ((row >= n_elem) || (col > 0)), "diagview::operator(): out of bounds" ); + arma_conform_check_bounds( ((row >= n_elem) || (col > 0)), "diagview::operator(): out of bounds" ); return m.at(row+row_offset, row+col_offset); } @@ -881,7 +881,7 @@ inline void diagview::replace(const eT old_val, const eT new_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat& x = const_cast< Mat& >(m); @@ -914,7 +914,7 @@ inline void diagview::clean(const typename get_pod_type::result threshold) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat tmp(*this); @@ -930,7 +930,7 @@ inline void diagview::clamp(const eT min_val, const eT max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat tmp(*this); @@ -946,7 +946,7 @@ inline void diagview::fill(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat& x = const_cast< Mat& >(m); @@ -965,7 +965,7 @@ inline void diagview::zeros() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).fill(eT(0)); } @@ -977,7 +977,7 @@ inline void diagview::ones() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).fill(eT(1)); } @@ -989,7 +989,7 @@ inline void diagview::randu() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat& x = const_cast< Mat& >(m); @@ -1008,7 +1008,7 @@ inline void diagview::randn() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat& x = const_cast< Mat& >(m); diff --git a/inst/include/armadillo_bits/diskio_meat.hpp b/inst/include/armadillo_bits/diskio_meat.hpp index 1658e596..8ae7f2ec 100644 --- a/inst/include/armadillo_bits/diskio_meat.hpp +++ b/inst/include/armadillo_bits/diskio_meat.hpp @@ -268,7 +268,7 @@ inline file_type diskio::guess_file_type(std::istream& f) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return diskio::guess_file_type_internal(f); } @@ -279,7 +279,7 @@ inline file_type diskio::guess_file_type_internal(std::istream& f) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); f.clear(); const std::fstream::pos_type pos1 = f.tellg(); @@ -679,7 +679,7 @@ inline bool diskio::save_raw_ascii(const Mat& x, const std::string& final_name) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const std::string tmp_name = diskio::gen_tmp_name(final_name); @@ -711,7 +711,7 @@ inline bool diskio::save_raw_ascii(const Mat& x, std::ostream& f) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const arma_ostream_state stream_state(f); @@ -746,7 +746,7 @@ inline bool diskio::save_raw_binary(const Mat& x, const std::string& final_name) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const std::string tmp_name = diskio::gen_tmp_name(final_name); @@ -774,7 +774,7 @@ inline bool diskio::save_raw_binary(const Mat& x, std::ostream& f) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); f.write( reinterpret_cast(x.mem), std::streamsize(x.n_elem*sizeof(eT)) ); @@ -790,7 +790,7 @@ inline bool diskio::save_arma_ascii(const Mat& x, const std::string& final_name) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const std::string tmp_name = diskio::gen_tmp_name(final_name); @@ -822,7 +822,7 @@ inline bool diskio::save_arma_ascii(const Mat& x, std::ostream& f) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const arma_ostream_state stream_state(f); @@ -860,7 +860,7 @@ inline bool diskio::save_csv_ascii(const Mat& x, const std::string& final_name, const field& header, const bool with_header, const char separator) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const std::string tmp_name = diskio::gen_tmp_name(final_name); @@ -874,7 +874,7 @@ diskio::save_csv_ascii(const Mat& x, const std::string& final_name, const fi if(with_header) { - arma_extra_debug_print("diskio::save_csv_ascii(): writing header"); + arma_debug_print("diskio::save_csv_ascii(): writing header"); for(uword i=0; i < header.n_elem; ++i) { @@ -906,7 +906,7 @@ inline bool diskio::save_csv_ascii(const Mat& x, std::ostream& f, const char separator) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const arma_ostream_state stream_state(f); @@ -949,7 +949,7 @@ inline bool diskio::save_csv_ascii(const Mat< std::complex >& x, std::ostream& f, const char separator) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; @@ -1005,7 +1005,7 @@ inline bool diskio::save_coord_ascii(const Mat& x, const std::string& final_name) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const std::string tmp_name = diskio::gen_tmp_name(final_name); @@ -1035,7 +1035,7 @@ inline bool diskio::save_coord_ascii(const Mat& x, std::ostream& f) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const arma_ostream_state stream_state(f); @@ -1088,7 +1088,7 @@ inline bool diskio::save_coord_ascii(const Mat< std::complex >& x, std::ostream& f) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; @@ -1153,7 +1153,7 @@ inline bool diskio::save_arma_binary(const Mat& x, const std::string& final_name) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const std::string tmp_name = diskio::gen_tmp_name(final_name); @@ -1183,7 +1183,7 @@ inline bool diskio::save_arma_binary(const Mat& x, std::ostream& f) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); f << diskio::gen_bin_header(x) << '\n'; f << x.n_rows << ' ' << x.n_cols << '\n'; @@ -1201,7 +1201,7 @@ inline bool diskio::save_pgm_binary(const Mat& x, const std::string& final_name) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const std::string tmp_name = diskio::gen_tmp_name(final_name); @@ -1230,7 +1230,7 @@ inline bool diskio::save_pgm_binary(const Mat& x, std::ostream& f) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); f << "P5" << '\n'; f << x.n_cols << ' ' << x.n_rows << '\n'; @@ -1261,7 +1261,7 @@ inline bool diskio::save_pgm_binary(const Mat< std::complex >& x, const std::string& final_name) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uchar_mat tmp = conv_to::from(x); @@ -1276,7 +1276,7 @@ inline bool diskio::save_pgm_binary(const Mat< std::complex >& x, std::ostream& f) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uchar_mat tmp = conv_to::from(x); @@ -1291,7 +1291,7 @@ inline bool diskio::save_hdf5_binary(const Mat& x, const hdf5_name& spec, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_HDF5) { @@ -1407,7 +1407,7 @@ inline bool diskio::load_raw_ascii(Mat& x, const std::string& name, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); std::ifstream f; @@ -1434,7 +1434,7 @@ inline bool diskio::load_raw_ascii(Mat& x, std::istream& f, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); bool load_okay = f.good(); @@ -1525,7 +1525,7 @@ inline bool diskio::load_raw_binary(Mat& x, const std::string& name, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); std::ifstream f; f.open(name, std::fstream::binary); @@ -1548,7 +1548,7 @@ inline bool diskio::load_raw_binary(Mat& x, std::istream& f, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); f.clear(); const std::streampos pos1 = f.tellg(); @@ -1570,7 +1570,7 @@ diskio::load_raw_binary(Mat& x, std::istream& f, std::string& err_msg) try { x.set_size(N / uword(sizeof(eT)), 1); } catch(...) { err_msg = "not enough memory"; return false; } f.clear(); - f.read( reinterpret_cast(x.memptr()), std::streamsize(x.n_elem * uword(sizeof(eT))) ); + f.read( reinterpret_cast(x.memptr()), std::streamsize(x.n_elem * uword(sizeof(eT))) ); return f.good(); } @@ -1584,7 +1584,7 @@ inline bool diskio::load_arma_ascii(Mat& x, const std::string& name, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); std::ifstream f; @@ -1610,7 +1610,7 @@ inline bool diskio::load_arma_ascii(Mat& x, std::istream& f, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); std::streampos pos = f.tellg(); @@ -1689,7 +1689,7 @@ inline bool diskio::load_csv_ascii(Mat& x, const std::string& name, std::string& err_msg, field& header, const bool with_header, const char separator, const bool strict) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); std::ifstream f; @@ -1701,7 +1701,7 @@ diskio::load_csv_ascii(Mat& x, const std::string& name, std::string& err_msg if(with_header) { - arma_extra_debug_print("diskio::load_csv_ascii(): reading header"); + arma_debug_print("diskio::load_csv_ascii(): reading header"); std::string header_line; std::stringstream header_stream; @@ -1762,7 +1762,7 @@ inline bool diskio::load_csv_ascii(Mat& x, std::istream& f, std::string& err_msg, const char separator, const bool strict) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // TODO: replace with more efficient implementation @@ -1917,7 +1917,7 @@ inline bool diskio::load_csv_ascii(Mat< std::complex >& x, std::istream& f, std::string& err_msg, const char separator, const bool strict) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // TODO: replace with more efficient implementation @@ -2154,7 +2154,7 @@ inline bool diskio::load_coord_ascii(Mat& x, const std::string& name, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); std::ifstream f; @@ -2182,7 +2182,7 @@ inline bool diskio::load_coord_ascii(Mat& x, std::istream& f, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(f.good() == false) { return false; } @@ -2281,7 +2281,7 @@ inline bool diskio::load_coord_ascii(Mat< std::complex >& x, std::istream& f, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(f.good() == false) { return false; } @@ -2391,7 +2391,7 @@ inline bool diskio::load_arma_binary(Mat& x, const std::string& name, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); std::ifstream f; f.open(name, std::fstream::binary); @@ -2414,7 +2414,7 @@ inline bool diskio::load_arma_binary(Mat& x, std::istream& f, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); std::streampos pos = f.tellg(); @@ -2435,7 +2435,7 @@ diskio::load_arma_binary(Mat& x, std::istream& f, std::string& err_msg) try { x.set_size(f_n_rows,f_n_cols); } catch(...) { err_msg = "not enough memory"; return false; } - f.read( reinterpret_cast(x.memptr()), std::streamsize(x.n_elem*sizeof(eT)) ); + f.read( reinterpret_cast(x.memptr()), std::streamsize(x.n_elem*sizeof(eT)) ); load_okay = f.good(); } @@ -2505,7 +2505,7 @@ inline bool diskio::load_pgm_binary(Mat& x, const std::string& name, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); std::fstream f; f.open(name, std::fstream::in | std::fstream::binary); @@ -2580,7 +2580,7 @@ diskio::load_pgm_binary(Mat& x, std::istream& f, std::string& err_msg) const uword n_elem = f_n_cols*f_n_rows; podarray tmp(n_elem); - f.read( reinterpret_cast(tmp.memptr()), std::streamsize(n_elem*2) ); + f.read( reinterpret_cast(tmp.memptr()), std::streamsize(n_elem*2) ); uword i = 0; @@ -2617,7 +2617,7 @@ inline bool diskio::load_pgm_binary(Mat< std::complex >& x, const std::string& name, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uchar_mat tmp; const bool load_okay = diskio::load_pgm_binary(tmp, name, err_msg); @@ -2635,7 +2635,7 @@ inline bool diskio::load_pgm_binary(Mat< std::complex >& x, std::istream& is, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uchar_mat tmp; const bool load_okay = diskio::load_pgm_binary(tmp, is, err_msg); @@ -2653,7 +2653,7 @@ inline bool diskio::load_hdf5_binary(Mat& x, const hdf5_name& spec, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_HDF5) { @@ -2777,7 +2777,7 @@ inline bool diskio::load_auto_detect(Mat& x, const std::string& name, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(diskio::is_readable(name) == false) { return false; } @@ -2808,7 +2808,7 @@ inline bool diskio::load_auto_detect(Mat& x, std::istream& f, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const char* ARMA_MAT_TXT_str = "ARMA_MAT_TXT"; const char* ARMA_MAT_BIN_str = "ARMA_MAT_BIN"; @@ -2889,7 +2889,7 @@ inline bool diskio::save_csv_ascii(const SpMat& x, const std::string& final_name, const field& header, const bool with_header, const char separator) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const std::string tmp_name = diskio::gen_tmp_name(final_name); @@ -2903,7 +2903,7 @@ diskio::save_csv_ascii(const SpMat& x, const std::string& final_name, const if(with_header) { - arma_extra_debug_print("diskio::save_csv_ascii(): writing header"); + arma_debug_print("diskio::save_csv_ascii(): writing header"); for(uword i=0; i < header.n_elem; ++i) { @@ -2935,7 +2935,7 @@ inline bool diskio::save_csv_ascii(const SpMat& x, std::ostream& f, const char separator) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const arma_ostream_state stream_state(f); @@ -2988,13 +2988,13 @@ inline bool diskio::save_csv_ascii(const SpMat< std::complex >& x, std::ostream& f, const char separator) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(x); arma_ignore(f); arma_ignore(separator); - arma_debug_warn_level(1, "saving complex sparse matrices as csv_ascii not yet implemented"); + arma_conform_warn(1, "saving complex sparse matrices as csv_ascii not yet implemented"); return false; } @@ -3007,7 +3007,7 @@ inline bool diskio::save_coord_ascii(const SpMat& x, const std::string& final_name) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const std::string tmp_name = diskio::gen_tmp_name(final_name); @@ -3038,7 +3038,7 @@ inline bool diskio::save_coord_ascii(const SpMat& x, std::ostream& f) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const arma_ostream_state stream_state(f); @@ -3092,7 +3092,7 @@ inline bool diskio::save_coord_ascii(const SpMat< std::complex >& x, std::ostream& f) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; @@ -3156,7 +3156,7 @@ inline bool diskio::save_arma_binary(const SpMat& x, const std::string& final_name) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const std::string tmp_name = diskio::gen_tmp_name(final_name); @@ -3186,7 +3186,7 @@ inline bool diskio::save_arma_binary(const SpMat& x, std::ostream& f) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); f << diskio::gen_bin_header(x) << '\n'; f << x.n_rows << ' ' << x.n_cols << ' ' << x.n_nonzero << '\n'; @@ -3205,7 +3205,7 @@ inline bool diskio::load_csv_ascii(SpMat& x, const std::string& name, std::string& err_msg, field& header, const bool with_header, const char separator) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); std::ifstream f; @@ -3217,7 +3217,7 @@ diskio::load_csv_ascii(SpMat& x, const std::string& name, std::string& err_m if(with_header) { - arma_extra_debug_print("diskio::load_csv_ascii(): reading header"); + arma_debug_print("diskio::load_csv_ascii(): reading header"); std::string header_line; std::stringstream header_stream; @@ -3277,7 +3277,7 @@ inline bool diskio::load_csv_ascii(SpMat& x, std::istream& f, std::string& err_msg, const char separator) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // TODO: replace with more efficient implementation @@ -3375,14 +3375,14 @@ inline bool diskio::load_csv_ascii(SpMat< std::complex >& x, std::istream& f, std::string& err_msg, const char separator) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(x); arma_ignore(f); arma_ignore(err_msg); arma_ignore(separator); - arma_debug_warn_level(1, "loading complex sparse matrices as csv_ascii not yet implemented"); + arma_conform_warn(1, "loading complex sparse matrices as csv_ascii not yet implemented"); return false; } @@ -3394,7 +3394,7 @@ inline bool diskio::load_coord_ascii(SpMat& x, const std::string& name, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); std::ifstream f; @@ -3418,7 +3418,7 @@ inline bool diskio::load_coord_ascii(SpMat& x, std::istream& f, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(f.good() == false) { return false; } @@ -3517,7 +3517,7 @@ inline bool diskio::load_coord_ascii(SpMat< std::complex >& x, std::istream& f, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(f.good() == false) { return false; } @@ -3627,7 +3627,7 @@ inline bool diskio::load_arma_binary(SpMat& x, const std::string& name, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); std::ifstream f; f.open(name, std::fstream::binary); @@ -3650,7 +3650,7 @@ inline bool diskio::load_arma_binary(SpMat& x, std::istream& f, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); bool load_okay = true; @@ -3688,7 +3688,7 @@ diskio::load_arma_binary(SpMat& x, std::istream& f, std::string& err_msg) { if(sizeof(uword) == 8) { - arma_extra_debug_print("detected inconsistent data while loading; re-reading integer parts as u32"); + arma_debug_print("detected inconsistent data while loading; re-reading integer parts as u32"); // inconstency could be due to a different uword size used during saving, // so try loading the row_indices and col_ptrs under the assumption of 32 bit unsigned integers @@ -3709,14 +3709,14 @@ diskio::load_arma_binary(SpMat& x, std::istream& f, std::string& err_msg) if( load_okay && (check2 == true) && (check3 == true) ) { - arma_extra_debug_print("reading integer parts as u32 succeeded"); + arma_debug_print("reading integer parts as u32 succeeded"); arrayops::convert(access::rwp(x.row_indices), tmp_a.memptr(), x.n_nonzero ); arrayops::convert(access::rwp(x.col_ptrs), tmp_b.memptr(), x.n_cols + 1); } else { - arma_extra_debug_print("reading integer parts as u32 failed"); + arma_debug_print("reading integer parts as u32 failed"); } } } @@ -3752,7 +3752,7 @@ inline bool diskio::save_raw_ascii(const Cube& x, const std::string& final_name) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const std::string tmp_name = diskio::gen_tmp_name(final_name); @@ -3783,7 +3783,7 @@ inline bool diskio::save_raw_ascii(const Cube& x, std::ostream& f) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const arma_ostream_state stream_state(f); @@ -3821,7 +3821,7 @@ inline bool diskio::save_raw_binary(const Cube& x, const std::string& final_name) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const std::string tmp_name = diskio::gen_tmp_name(final_name); @@ -3849,7 +3849,7 @@ inline bool diskio::save_raw_binary(const Cube& x, std::ostream& f) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); f.write( reinterpret_cast(x.mem), std::streamsize(x.n_elem*sizeof(eT)) ); @@ -3865,7 +3865,7 @@ inline bool diskio::save_arma_ascii(const Cube& x, const std::string& final_name) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const std::string tmp_name = diskio::gen_tmp_name(final_name); @@ -3897,7 +3897,7 @@ inline bool diskio::save_arma_ascii(const Cube& x, std::ostream& f) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const arma_ostream_state stream_state(f); @@ -3939,7 +3939,7 @@ inline bool diskio::save_arma_binary(const Cube& x, const std::string& final_name) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const std::string tmp_name = diskio::gen_tmp_name(final_name); @@ -3969,7 +3969,7 @@ inline bool diskio::save_arma_binary(const Cube& x, std::ostream& f) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); f << diskio::gen_bin_header(x) << '\n'; f << x.n_rows << ' ' << x.n_cols << ' ' << x.n_slices << '\n'; @@ -3987,7 +3987,7 @@ inline bool diskio::save_hdf5_binary(const Cube& x, const hdf5_name& spec, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_HDF5) { @@ -4103,7 +4103,7 @@ inline bool diskio::load_raw_ascii(Cube& x, const std::string& name, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat tmp; const bool load_okay = diskio::load_raw_ascii(tmp, name, err_msg); @@ -4134,7 +4134,7 @@ inline bool diskio::load_raw_ascii(Cube& x, std::istream& f, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat tmp; const bool load_okay = diskio::load_raw_ascii(tmp, f, err_msg); @@ -4165,7 +4165,7 @@ inline bool diskio::load_raw_binary(Cube& x, const std::string& name, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); std::ifstream f; f.open(name, std::fstream::binary); @@ -4188,7 +4188,7 @@ inline bool diskio::load_raw_binary(Cube& x, std::istream& f, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); f.clear(); const std::streampos pos1 = f.tellg(); @@ -4208,7 +4208,7 @@ diskio::load_raw_binary(Cube& x, std::istream& f, std::string& err_msg) try { x.set_size(N / uword(sizeof(eT)), 1, 1); } catch(...) { err_msg = "not enough memory"; return false; } f.clear(); - f.read( reinterpret_cast(x.memptr()), std::streamsize(x.n_elem * uword(sizeof(eT))) ); + f.read( reinterpret_cast(x.memptr()), std::streamsize(x.n_elem * uword(sizeof(eT))) ); return f.good(); } @@ -4222,7 +4222,7 @@ inline bool diskio::load_arma_ascii(Cube& x, const std::string& name, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); std::ifstream f; @@ -4248,7 +4248,7 @@ inline bool diskio::load_arma_ascii(Cube& x, std::istream& f, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); std::streampos pos = f.tellg(); @@ -4327,7 +4327,7 @@ inline bool diskio::load_arma_binary(Cube& x, const std::string& name, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); std::ifstream f; f.open(name, std::fstream::binary); @@ -4350,7 +4350,7 @@ inline bool diskio::load_arma_binary(Cube& x, std::istream& f, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); std::streampos pos = f.tellg(); @@ -4373,7 +4373,7 @@ diskio::load_arma_binary(Cube& x, std::istream& f, std::string& err_msg) try { x.set_size(f_n_rows, f_n_cols, f_n_slices); } catch(...) { err_msg = "not enough memory"; return false; } - f.read( reinterpret_cast(x.memptr()), std::streamsize(x.n_elem*sizeof(eT)) ); + f.read( reinterpret_cast(x.memptr()), std::streamsize(x.n_elem*sizeof(eT)) ); load_okay = f.good(); } @@ -4426,7 +4426,7 @@ inline bool diskio::load_hdf5_binary(Cube& x, const hdf5_name& spec, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_HDF5) { @@ -4551,7 +4551,7 @@ inline bool diskio::load_auto_detect(Cube& x, const std::string& name, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(diskio::is_readable(name) == false) { return false; } @@ -4582,7 +4582,7 @@ inline bool diskio::load_auto_detect(Cube& x, std::istream& f, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const char* ARMA_CUB_TXT_str = "ARMA_CUB_TXT"; const char* ARMA_CUB_BIN_str = "ARMA_CUB_BIN"; @@ -4658,7 +4658,7 @@ inline bool diskio::save_arma_binary(const field& x, const std::string& final_name) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const std::string tmp_name = diskio::gen_tmp_name(final_name); @@ -4686,7 +4686,7 @@ inline bool diskio::save_arma_binary(const field& x, std::ostream& f) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( (is_Mat::value == false) && (is_Cube::value == false) )); @@ -4723,7 +4723,7 @@ inline bool diskio::load_arma_binary(field& x, const std::string& name, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); std::ifstream f( name, std::fstream::binary ); @@ -4745,7 +4745,7 @@ inline bool diskio::load_arma_binary(field& x, std::istream& f, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( (is_Mat::value == false) && (is_Cube::value == false) )); @@ -4810,7 +4810,7 @@ inline bool diskio::save_std_string(const field& x, const std::string& final_name) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const std::string tmp_name = diskio::gen_tmp_name(final_name); @@ -4837,7 +4837,7 @@ inline bool diskio::save_std_string(const field& x, std::ostream& f) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); for(uword row=0; row& x, const std::string& name, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); std::ifstream f(name); @@ -4884,7 +4884,7 @@ inline bool diskio::load_std_string(field& x, std::istream& f, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); bool load_okay = true; @@ -4956,7 +4956,7 @@ inline bool diskio::load_auto_detect(field& x, const std::string& name, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); std::fstream f; f.open(name, std::fstream::in | std::fstream::binary); @@ -4980,7 +4980,7 @@ inline bool diskio::load_auto_detect(field& x, std::istream& f, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_Mat::value == false )); @@ -5033,7 +5033,7 @@ inline bool diskio::load_ppm_binary(Cube& x, const std::string& name, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); std::fstream f; f.open(name, std::fstream::in | std::fstream::binary); @@ -5056,7 +5056,7 @@ inline bool diskio::load_ppm_binary(Cube& x, std::istream& f, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); bool load_okay = true; @@ -5111,7 +5111,7 @@ diskio::load_ppm_binary(Cube& x, std::istream& f, std::string& err_msg) const uword n_elem = 3*f_n_cols*f_n_rows; podarray tmp(n_elem); - f.read( reinterpret_cast(tmp.memptr()), std::streamsize(2*n_elem) ); + f.read( reinterpret_cast(tmp.memptr()), std::streamsize(2*n_elem) ); uword i = 0; @@ -5149,7 +5149,7 @@ inline bool diskio::save_ppm_binary(const Cube& x, const std::string& final_name) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const std::string tmp_name = diskio::gen_tmp_name(final_name); @@ -5177,9 +5177,9 @@ inline bool diskio::save_ppm_binary(const Cube& x, std::ostream& f) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (x.n_slices != 3), "diskio::save_ppm_binary(): given cube must have exactly 3 slices" ); + arma_conform_check( (x.n_slices != 3), "diskio::save_ppm_binary(): given cube must have exactly 3 slices" ); const uword n_elem = 3 * x.n_rows * x.n_cols; podarray tmp(n_elem); @@ -5219,7 +5219,7 @@ inline bool diskio::load_ppm_binary(field& x, const std::string& name, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); std::fstream f; f.open(name, std::fstream::in | std::fstream::binary); @@ -5242,7 +5242,7 @@ inline bool diskio::load_ppm_binary(field& x, std::istream& f, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_Mat::value == false )); typedef typename T1::elem_type eT; @@ -5311,7 +5311,7 @@ diskio::load_ppm_binary(field& x, std::istream& f, std::string& err_msg) const uword n_elem = 3*f_n_cols*f_n_rows; podarray tmp(n_elem); - f.read( reinterpret_cast(tmp.memptr()), std::streamsize(2*n_elem) ); + f.read( reinterpret_cast(tmp.memptr()), std::streamsize(2*n_elem) ); uword i = 0; @@ -5349,7 +5349,7 @@ inline bool diskio::save_ppm_binary(const field& x, const std::string& final_name) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const std::string tmp_name = diskio::gen_tmp_name(final_name); std::ofstream f( tmp_name, std::fstream::binary ); @@ -5376,13 +5376,13 @@ inline bool diskio::save_ppm_binary(const field& x, std::ostream& f) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_Mat::value == false )); typedef typename T1::elem_type eT; - arma_debug_check( (x.n_elem != 3), "diskio::save_ppm_binary(): given field must have exactly 3 matrices of equal size" ); + arma_conform_check( (x.n_elem != 3), "diskio::save_ppm_binary(): given field must have exactly 3 matrices of equal size" ); bool same_size = true; for(uword i=1; i<3; ++i) @@ -5394,7 +5394,7 @@ diskio::save_ppm_binary(const field& x, std::ostream& f) } } - arma_debug_check( (same_size != true), "diskio::save_ppm_binary(): given field must have exactly 3 matrices of equal size" ); + arma_conform_check( (same_size != true), "diskio::save_ppm_binary(): given field must have exactly 3 matrices of equal size" ); const Mat& R = x(0); const Mat& G = x(1); diff --git a/inst/include/armadillo_bits/eGlueCube_meat.hpp b/inst/include/armadillo_bits/eGlueCube_meat.hpp index 59b30d39..00a87439 100644 --- a/inst/include/armadillo_bits/eGlueCube_meat.hpp +++ b/inst/include/armadillo_bits/eGlueCube_meat.hpp @@ -25,7 +25,7 @@ template arma_inline eGlueCube::~eGlueCube() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -36,9 +36,9 @@ eGlueCube::eGlueCube(const T1& in_A, const T2& in_B) : P1(in_A) , P2(in_B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size + arma_conform_assert_same_size ( P1.get_n_rows(), P1.get_n_cols(), P1.get_n_slices(), P2.get_n_rows(), P2.get_n_cols(), P2.get_n_slices(), diff --git a/inst/include/armadillo_bits/eGlue_meat.hpp b/inst/include/armadillo_bits/eGlue_meat.hpp index 30fb5072..04eb6ba2 100644 --- a/inst/include/armadillo_bits/eGlue_meat.hpp +++ b/inst/include/armadillo_bits/eGlue_meat.hpp @@ -25,7 +25,7 @@ template arma_inline eGlue::~eGlue() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -36,10 +36,10 @@ eGlue::eGlue(const T1& in_A, const T2& in_B) : P1(in_A) , P2(in_B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - // arma_debug_assert_same_size( P1, P2, eglue_type::text() ); - arma_debug_assert_same_size + // arma_conform_assert_same_size( P1, P2, eglue_type::text() ); + arma_conform_assert_same_size ( P1.get_n_rows(), P1.get_n_cols(), P2.get_n_rows(), P2.get_n_cols(), diff --git a/inst/include/armadillo_bits/eOpCube_meat.hpp b/inst/include/armadillo_bits/eOpCube_meat.hpp index 6a165f44..22443c1c 100644 --- a/inst/include/armadillo_bits/eOpCube_meat.hpp +++ b/inst/include/armadillo_bits/eOpCube_meat.hpp @@ -26,7 +26,7 @@ inline eOpCube::eOpCube(const BaseCube& in_m) : P (in_m.get_ref()) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -37,7 +37,7 @@ eOpCube::eOpCube(const BaseCube& in_m, : P (in_m.get_ref()) , aux (in_aux) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -49,7 +49,7 @@ eOpCube::eOpCube(const BaseCube& in_m, , aux_uword_a (in_aux_uword_a) , aux_uword_b (in_aux_uword_b) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -62,7 +62,7 @@ eOpCube::eOpCube(const BaseCube& in_m, , aux_uword_b (in_aux_uword_b) , aux_uword_c (in_aux_uword_c) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -76,7 +76,7 @@ eOpCube::eOpCube(const BaseCube& in_m, , aux_uword_b (in_aux_uword_b) , aux_uword_c (in_aux_uword_c) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -85,7 +85,7 @@ template inline eOpCube::~eOpCube() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } diff --git a/inst/include/armadillo_bits/eOp_meat.hpp b/inst/include/armadillo_bits/eOp_meat.hpp index e087505c..75dfec02 100644 --- a/inst/include/armadillo_bits/eOp_meat.hpp +++ b/inst/include/armadillo_bits/eOp_meat.hpp @@ -26,7 +26,7 @@ inline eOp::eOp(const T1& in_m) : P(in_m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -37,7 +37,7 @@ eOp::eOp(const T1& in_m, const typename T1::elem_type in_aux) : P(in_m) , aux(in_aux) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -49,7 +49,7 @@ eOp::eOp(const T1& in_m, const uword in_aux_uword_a, const uword i , aux_uword_a(in_aux_uword_a) , aux_uword_b(in_aux_uword_b) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -62,7 +62,7 @@ eOp::eOp(const T1& in_m, const typename T1::elem_type in_aux, cons , aux_uword_a(in_aux_uword_a) , aux_uword_b(in_aux_uword_b) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -71,7 +71,7 @@ template inline eOp::~eOp() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } diff --git a/inst/include/armadillo_bits/eglue_core_meat.hpp b/inst/include/armadillo_bits/eglue_core_meat.hpp index a36f3895..bc81b85c 100644 --- a/inst/include/armadillo_bits/eglue_core_meat.hpp +++ b/inst/include/armadillo_bits/eglue_core_meat.hpp @@ -259,7 +259,7 @@ inline void eglue_core::apply(outT& out, const eGlue& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -358,12 +358,12 @@ inline void eglue_core::apply_inplace_plus(Mat& out, const eGlue& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_rows = x.get_n_rows(); const uword n_cols = x.get_n_cols(); - arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "addition"); + arma_conform_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "addition"); typedef typename T1::elem_type eT; @@ -455,12 +455,12 @@ inline void eglue_core::apply_inplace_minus(Mat& out, const eGlue& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_rows = x.get_n_rows(); const uword n_cols = x.get_n_cols(); - arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "subtraction"); + arma_conform_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "subtraction"); typedef typename T1::elem_type eT; @@ -552,12 +552,12 @@ inline void eglue_core::apply_inplace_schur(Mat& out, const eGlue& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_rows = x.get_n_rows(); const uword n_cols = x.get_n_cols(); - arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "element-wise multiplication"); + arma_conform_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "element-wise multiplication"); typedef typename T1::elem_type eT; @@ -649,12 +649,12 @@ inline void eglue_core::apply_inplace_div(Mat& out, const eGlue& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_rows = x.get_n_rows(); const uword n_cols = x.get_n_cols(); - arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "element-wise division"); + arma_conform_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "element-wise division"); typedef typename T1::elem_type eT; @@ -751,7 +751,7 @@ inline void eglue_core::apply(Cube& out, const eGlueCube& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -851,13 +851,13 @@ inline void eglue_core::apply_inplace_plus(Cube& out, const eGlueCube& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_rows = x.get_n_rows(); const uword n_cols = x.get_n_cols(); const uword n_slices = x.get_n_slices(); - arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "addition"); + arma_conform_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "addition"); typedef typename T1::elem_type eT; @@ -949,13 +949,13 @@ inline void eglue_core::apply_inplace_minus(Cube& out, const eGlueCube& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_rows = x.get_n_rows(); const uword n_cols = x.get_n_cols(); const uword n_slices = x.get_n_slices(); - arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "subtraction"); + arma_conform_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "subtraction"); typedef typename T1::elem_type eT; @@ -1047,13 +1047,13 @@ inline void eglue_core::apply_inplace_schur(Cube& out, const eGlueCube& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_rows = x.get_n_rows(); const uword n_cols = x.get_n_cols(); const uword n_slices = x.get_n_slices(); - arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "element-wise multiplication"); + arma_conform_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "element-wise multiplication"); typedef typename T1::elem_type eT; @@ -1145,13 +1145,13 @@ inline void eglue_core::apply_inplace_div(Cube& out, const eGlueCube& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_rows = x.get_n_rows(); const uword n_cols = x.get_n_cols(); const uword n_slices = x.get_n_slices(); - arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "element-wise division"); + arma_conform_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "element-wise division"); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/eop_aux.hpp b/inst/include/armadillo_bits/eop_aux.hpp index 107ff2ae..5b962379 100644 --- a/inst/include/armadillo_bits/eop_aux.hpp +++ b/inst/include/armadillo_bits/eop_aux.hpp @@ -156,7 +156,7 @@ class eop_aux typename arma_real_only::result direct_eps(const eT x) { - //arma_extra_debug_sigprint(); + //arma_debug_sigprint(); // acording to IEEE Standard for Floating-Point Arithmetic (IEEE 754) // the mantissa length for double is 53 bits = std::numeric_limits::digits @@ -178,7 +178,7 @@ class eop_aux typename arma_real_only::result direct_eps(const std::complex& x) { - //arma_extra_debug_sigprint(); + //arma_debug_sigprint(); //return std::pow( std::numeric_limits::radix, (std::floor(std::log10(std::abs(x))/std::log10(std::numeric_limits::radix))-(std::numeric_limits::digits-1)) ); diff --git a/inst/include/armadillo_bits/eop_core_meat.hpp b/inst/include/armadillo_bits/eop_core_meat.hpp index 330052f6..48c27a0c 100644 --- a/inst/include/armadillo_bits/eop_core_meat.hpp +++ b/inst/include/armadillo_bits/eop_core_meat.hpp @@ -245,7 +245,7 @@ inline void eop_core::apply(outT& out, const eOp& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -320,14 +320,14 @@ inline void eop_core::apply_inplace_plus(Mat& out, const eOp& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const uword n_rows = x.get_n_rows(); const uword n_cols = x.get_n_cols(); - arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "addition"); + arma_conform_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "addition"); const eT k = x.aux; eT* out_mem = out.memptr(); @@ -390,19 +390,18 @@ eop_core::apply_inplace_plus(Mat& out, const e template template - inline void eop_core::apply_inplace_minus(Mat& out, const eOp& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const uword n_rows = x.get_n_rows(); const uword n_cols = x.get_n_cols(); - arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "subtraction"); + arma_conform_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "subtraction"); const eT k = x.aux; eT* out_mem = out.memptr(); @@ -465,19 +464,18 @@ eop_core::apply_inplace_minus(Mat& out, const template template - inline void eop_core::apply_inplace_schur(Mat& out, const eOp& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const uword n_rows = x.get_n_rows(); const uword n_cols = x.get_n_cols(); - arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "element-wise multiplication"); + arma_conform_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "element-wise multiplication"); const eT k = x.aux; eT* out_mem = out.memptr(); @@ -540,19 +538,18 @@ eop_core::apply_inplace_schur(Mat& out, const template template - inline void eop_core::apply_inplace_div(Mat& out, const eOp& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const uword n_rows = x.get_n_rows(); const uword n_cols = x.get_n_cols(); - arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "element-wise division"); + arma_conform_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "element-wise division"); const eT k = x.aux; eT* out_mem = out.memptr(); @@ -620,12 +617,11 @@ eop_core::apply_inplace_div(Mat& out, const eO template template - inline void eop_core::apply(Cube& out, const eOpCube& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -697,12 +693,11 @@ eop_core::apply(Cube& out, const eOpCube template - inline void eop_core::apply_inplace_plus(Cube& out, const eOpCube& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -710,7 +705,7 @@ eop_core::apply_inplace_plus(Cube& out, const const uword n_cols = x.get_n_cols(); const uword n_slices = x.get_n_slices(); - arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "addition"); + arma_conform_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "addition"); const eT k = x.aux; eT* out_mem = out.memptr(); @@ -773,12 +768,11 @@ eop_core::apply_inplace_plus(Cube& out, const template template - inline void eop_core::apply_inplace_minus(Cube& out, const eOpCube& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -786,7 +780,7 @@ eop_core::apply_inplace_minus(Cube& out, const const uword n_cols = x.get_n_cols(); const uword n_slices = x.get_n_slices(); - arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "subtraction"); + arma_conform_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "subtraction"); const eT k = x.aux; eT* out_mem = out.memptr(); @@ -849,12 +843,11 @@ eop_core::apply_inplace_minus(Cube& out, const template template - inline void eop_core::apply_inplace_schur(Cube& out, const eOpCube& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -862,7 +855,7 @@ eop_core::apply_inplace_schur(Cube& out, const const uword n_cols = x.get_n_cols(); const uword n_slices = x.get_n_slices(); - arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "element-wise multiplication"); + arma_conform_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "element-wise multiplication"); const eT k = x.aux; eT* out_mem = out.memptr(); @@ -925,12 +918,11 @@ eop_core::apply_inplace_schur(Cube& out, const template template - inline void eop_core::apply_inplace_div(Cube& out, const eOpCube& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -938,7 +930,7 @@ eop_core::apply_inplace_div(Cube& out, const e const uword n_cols = x.get_n_cols(); const uword n_slices = x.get_n_slices(); - arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "element-wise division"); + arma_conform_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "element-wise division"); const eT k = x.aux; eT* out_mem = out.memptr(); diff --git a/inst/include/armadillo_bits/fft_engine_fftw3.hpp b/inst/include/armadillo_bits/fft_engine_fftw3.hpp index 9a560061..a5070648 100644 --- a/inst/include/armadillo_bits/fft_engine_fftw3.hpp +++ b/inst/include/armadillo_bits/fft_engine_fftw3.hpp @@ -25,7 +25,7 @@ struct fft_engine_fftw3_aux { - #if (!defined(ARMA_DONT_USE_STD_MUTEX)) + #if defined(ARMA_USE_STD_MUTEX) static inline std::mutex& get_plan_mutex() { static std::mutex plan_mutex; return plan_mutex; } #endif }; @@ -52,7 +52,7 @@ class fft_engine_fftw3 inline ~fft_engine_fftw3() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(fftw3_plan != nullptr) { fftw3::destroy_plan(fftw3_plan); } @@ -64,7 +64,7 @@ class fft_engine_fftw3 : N (in_N ) , fftw3_plan(nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(N == 0) { return; } @@ -73,14 +73,14 @@ class fft_engine_fftw3 arma_stop_runtime_error("integer overflow: FFT size too large for integer type used by FFTW3"); } - arma_extra_debug_print("fft_engine_fftw3::constructor: allocating work arrays"); + arma_debug_print("fft_engine_fftw3::constructor: allocating work arrays"); X_work.set_size(N); Y_work.set_size(N); const int fftw3_sign = (inverse) ? fftw3_sign_backward : fftw3_sign_forward; const int fftw3_flags = fftw3_flag_destroy | fftw3_flag_estimate; - arma_extra_debug_print("fft_engine_fftw3::constructor: generating 1D plan"); + arma_debug_print("fft_engine_fftw3::constructor: generating 1D plan"); // only fftw3::execute() is thread safe, as per FFTW docs: // https://www.fftw.org/fftw3_doc/Thread-safety.html @@ -92,7 +92,7 @@ class fft_engine_fftw3 fftw3_plan = fftw3::plan_dft_1d(N, X_work.memptr(), Y_work.memptr(), fftw3_sign, fftw3_flags); } } - #elif (!defined(ARMA_DONT_USE_STD_MUTEX)) + #elif defined(ARMA_USE_STD_MUTEX) { std::mutex& plan_mutex = fft_engine_fftw3_aux::get_plan_mutex(); @@ -113,17 +113,17 @@ class fft_engine_fftw3 void run(cx_type* Y, const cx_type* X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(fftw3_plan == nullptr) { return; } - arma_extra_debug_print("fft_engine_fftw3::run(): copying input array"); + arma_debug_print("fft_engine_fftw3::run(): copying input array"); arrayops::copy(X_work.memptr(), X, N); - arma_extra_debug_print("fft_engine_fftw3::run(): executing plan"); + arma_debug_print("fft_engine_fftw3::run(): executing plan"); fftw3::execute(fftw3_plan); - arma_extra_debug_print("fft_engine_fftw3::run(): copying output array"); + arma_debug_print("fft_engine_fftw3::run(): copying output array"); arrayops::copy(Y, Y_work.memptr(), N); } }; diff --git a/inst/include/armadillo_bits/fft_engine_kissfft.hpp b/inst/include/armadillo_bits/fft_engine_kissfft.hpp index 0c8c40c0..9d528ca2 100644 --- a/inst/include/armadillo_bits/fft_engine_kissfft.hpp +++ b/inst/include/armadillo_bits/fft_engine_kissfft.hpp @@ -110,7 +110,7 @@ class fft_engine_kissfft fft_engine_kissfft(const uword in_N) : N(in_N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword len = calc_radix(); @@ -138,7 +138,7 @@ class fft_engine_kissfft void butterfly_2(cx_type* Y, const uword stride, const uword m) const { - // arma_extra_debug_sigprint(); + // arma_debug_sigprint(); const cx_type* coeffs = coeffs_array.memptr(); @@ -158,7 +158,7 @@ class fft_engine_kissfft void butterfly_3(cx_type* Y, const uword stride, const uword m) const { - // arma_extra_debug_sigprint(); + // arma_debug_sigprint(); arma_aligned cx_type tmp[5]; @@ -204,7 +204,7 @@ class fft_engine_kissfft void butterfly_4(cx_type* Y, const uword stride, const uword m) const { - // arma_extra_debug_sigprint(); + // arma_debug_sigprint(); arma_aligned cx_type tmp[7]; @@ -247,7 +247,7 @@ class fft_engine_kissfft void butterfly_5(cx_type* Y, const uword stride, const uword m) const { - // arma_extra_debug_sigprint(); + // arma_debug_sigprint(); arma_aligned cx_type tmp[13]; @@ -311,7 +311,7 @@ class fft_engine_kissfft void butterfly_N(cx_type* Y, const uword stride, const uword m, const uword r) { - // arma_extra_debug_sigprint(); + // arma_debug_sigprint(); const cx_type* coeffs = coeffs_array.memptr(); @@ -356,7 +356,7 @@ class fft_engine_kissfft void run(cx_type* Y, const cx_type* X, const uword stage = 0, const uword stride = 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword m = residue[stage]; const uword r = radix[stage]; diff --git a/inst/include/armadillo_bits/field_meat.hpp b/inst/include/armadillo_bits/field_meat.hpp index b65bb84f..de75ac2a 100644 --- a/inst/include/armadillo_bits/field_meat.hpp +++ b/inst/include/armadillo_bits/field_meat.hpp @@ -24,14 +24,14 @@ template inline field::~field() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); delete_objects(); if(n_elem > field_prealloc_n_elem::val) { delete [] mem; } // try to expose buggy user code that accesses deleted objects - if(arma_config::debug) { mem = nullptr; } + mem = nullptr; } @@ -45,7 +45,7 @@ field::field() , n_elem(0) , mem(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } @@ -60,7 +60,7 @@ field::field(const field& x) , n_elem(0) , mem(nullptr) { - arma_extra_debug_sigprint(arma_str::format("this = %x x = %x") % this % &x); + arma_debug_sigprint(arma_str::format("this: %x; x: %x") % this % &x); init(x); } @@ -73,7 +73,7 @@ inline field& field::operator=(const field& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init(x); @@ -92,7 +92,7 @@ field::field(const subview_field& X) , n_elem(0) , mem(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); this->operator=(X); } @@ -105,7 +105,7 @@ inline field& field::operator=(const subview_field& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_field::extract(*this, X); @@ -125,7 +125,7 @@ field::field(const uword n_elem_in) , n_elem(0) , mem(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init(n_elem_in, 1); } @@ -142,7 +142,7 @@ field::field(const uword n_rows_in, const uword n_cols_in) , n_elem(0) , mem(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init(n_rows_in, n_cols_in); } @@ -159,7 +159,7 @@ field::field(const uword n_rows_in, const uword n_cols_in, const uword n_sli , n_elem(0) , mem(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init(n_rows_in, n_cols_in, n_slices_in); } @@ -175,7 +175,7 @@ field::field(const SizeMat& s) , n_elem(0) , mem(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init(s.n_rows, s.n_cols); } @@ -191,7 +191,7 @@ field::field(const SizeCube& s) , n_elem(0) , mem(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init(s.n_rows, s.n_cols, s.n_slices); } @@ -205,7 +205,7 @@ inline field& field::set_size(const uword n_elem_in) { - arma_extra_debug_sigprint(arma_str::format("n_elem_in = %u") % n_elem_in); + arma_debug_sigprint(arma_str::format("n_elem_in: %u") % n_elem_in); init(n_elem_in, 1); @@ -220,7 +220,7 @@ inline field& field::set_size(const uword n_rows_in, const uword n_cols_in) { - arma_extra_debug_sigprint(arma_str::format("n_rows_in = %u, n_cols_in = %u") % n_rows_in % n_cols_in); + arma_debug_sigprint(arma_str::format("n_rows_in: %u; n_cols_in: %u") % n_rows_in % n_cols_in); init(n_rows_in, n_cols_in); @@ -235,7 +235,7 @@ inline field& field::set_size(const uword n_rows_in, const uword n_cols_in, const uword n_slices_in) { - arma_extra_debug_sigprint(arma_str::format("n_rows_in = %u, n_cols_in = %u, n_slices_in = %u") % n_rows_in % n_cols_in % n_slices_in); + arma_debug_sigprint(arma_str::format("n_rows_in: %u; n_cols_in: %u; n_slices_in: %u") % n_rows_in % n_cols_in % n_slices_in); init(n_rows_in, n_cols_in, n_slices_in); @@ -249,7 +249,7 @@ inline field& field::set_size(const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init(s.n_rows, s.n_cols); @@ -263,7 +263,7 @@ inline field& field::set_size(const SizeCube& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init(s.n_rows, s.n_cols, s.n_slices); @@ -280,7 +280,7 @@ field::field(const std::vector& x) , n_slices(0) , n_elem (0) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); (*this).operator=(x); } @@ -292,7 +292,7 @@ inline field& field::operator=(const std::vector& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N = uword(x.size()); @@ -313,7 +313,7 @@ field::field(const std::initializer_list& list) , n_slices(0) , n_elem (0) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); (*this).operator=(list); } @@ -325,7 +325,7 @@ inline field& field::operator=(const std::initializer_list& list) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N = uword(list.size()); @@ -348,7 +348,7 @@ field::field(const std::initializer_list< std::initializer_list >& list) , n_slices(0) , n_elem (0) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); (*this).operator=(list); } @@ -360,7 +360,7 @@ inline field& field::operator=(const std::initializer_list< std::initializer_list >& list) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uword x_n_rows = uword(list.size()); uword x_n_cols = 0; @@ -413,7 +413,7 @@ field::field(field&& X) , n_slices(X.n_slices) , n_elem (X.n_elem ) { - arma_extra_debug_sigprint(arma_str::format("this = %x X = %x") % this % &X); + arma_debug_sigprint(arma_str::format("this: %x; X: %x") % this % &X); if(n_elem > field_prealloc_n_elem::val) { @@ -439,7 +439,7 @@ inline field& field::operator=(field&& X) { - arma_extra_debug_sigprint(arma_str::format("this = %x X = %x") % this % &X); + arma_debug_sigprint(arma_str::format("this: %x; X: %x") % this % &X); if(this == &X) { return *this; } @@ -478,7 +478,7 @@ inline field& field::copy_size(const field& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init(x.n_rows, x.n_cols, x.n_slices); @@ -537,7 +537,7 @@ arma_inline oT& field::operator() (const uword i) { - arma_debug_check_bounds( (i >= n_elem), "field::operator(): index out of bounds" ); + arma_conform_check_bounds( (i >= n_elem), "field::operator(): index out of bounds" ); return (*mem[i]); } @@ -550,7 +550,7 @@ arma_inline const oT& field::operator() (const uword i) const { - arma_debug_check_bounds( (i >= n_elem), "field::operator(): index out of bounds" ); + arma_conform_check_bounds( (i >= n_elem), "field::operator(): index out of bounds" ); return (*mem[i]); } @@ -563,7 +563,7 @@ arma_inline oT& field::operator() (const uword in_row, const uword in_col) { - arma_debug_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols) || (0 >= n_slices) ), "field::operator(): index out of bounds" ); + arma_conform_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols) || (0 >= n_slices) ), "field::operator(): index out of bounds" ); return (*mem[in_row + in_col*n_rows]); } @@ -576,7 +576,7 @@ arma_inline const oT& field::operator() (const uword in_row, const uword in_col) const { - arma_debug_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols) || (0 >= n_slices) ), "field::operator(): index out of bounds" ); + arma_conform_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols) || (0 >= n_slices) ), "field::operator(): index out of bounds" ); return (*mem[in_row + in_col*n_rows]); } @@ -589,7 +589,7 @@ arma_inline oT& field::operator() (const uword in_row, const uword in_col, const uword in_slice) { - arma_debug_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols) || (in_slice >= n_slices)), "field::operator(): index out of bounds" ); + arma_conform_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols) || (in_slice >= n_slices)), "field::operator(): index out of bounds" ); return (*mem[in_row + in_col*n_rows + in_slice*(n_rows*n_cols)]); } @@ -602,7 +602,7 @@ arma_inline const oT& field::operator() (const uword in_row, const uword in_col, const uword in_slice) const { - arma_debug_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols) || (in_slice >= n_slices)), "field::operator(): index out of bounds" ); + arma_conform_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols) || (in_slice >= n_slices)), "field::operator(): index out of bounds" ); return (*mem[in_row + in_col*n_rows + in_slice*(n_rows*n_cols)]); } @@ -710,7 +710,7 @@ arma_inline oT& field::front() { - arma_debug_check( (n_elem == 0), "field::front(): field is empty" ); + arma_conform_check( (n_elem == 0), "field::front(): field is empty" ); return (*mem[0]); } @@ -722,7 +722,7 @@ arma_inline const oT& field::front() const { - arma_debug_check( (n_elem == 0), "field::front(): field is empty" ); + arma_conform_check( (n_elem == 0), "field::front(): field is empty" ); return (*mem[0]); } @@ -734,7 +734,7 @@ arma_inline oT& field::back() { - arma_debug_check( (n_elem == 0), "field::back(): field is empty" ); + arma_conform_check( (n_elem == 0), "field::back(): field is empty" ); return (*mem[n_elem-1]); } @@ -746,7 +746,7 @@ arma_inline const oT& field::back() const { - arma_debug_check( (n_elem == 0), "field::back(): field is empty" ); + arma_conform_check( (n_elem == 0), "field::back(): field is empty" ); return (*mem[n_elem-1]); } @@ -779,11 +779,11 @@ inline subview_field field::row(const uword row_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (n_slices >= 2), "field::row(): field must be 2D" ); + arma_conform_check( (n_slices >= 2), "field::row(): field must be 2D" ); - arma_debug_check_bounds( (row_num >= n_rows), "field::row(): row out of bounds" ); + arma_conform_check_bounds( (row_num >= n_rows), "field::row(): row out of bounds" ); return subview_field(*this, row_num, 0, 1, n_cols); } @@ -796,11 +796,11 @@ inline const subview_field field::row(const uword row_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (n_slices >= 2), "field::row(): field must be 2D" ); + arma_conform_check( (n_slices >= 2), "field::row(): field must be 2D" ); - arma_debug_check_bounds( (row_num >= n_rows), "field::row(): row out of bounds" ); + arma_conform_check_bounds( (row_num >= n_rows), "field::row(): row out of bounds" ); return subview_field(*this, row_num, 0, 1, n_cols); } @@ -813,11 +813,11 @@ inline subview_field field::col(const uword col_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (n_slices >= 2), "field::col(): field must be 2D" ); + arma_conform_check( (n_slices >= 2), "field::col(): field must be 2D" ); - arma_debug_check_bounds( (col_num >= n_cols), "field::col(): out of bounds" ); + arma_conform_check_bounds( (col_num >= n_cols), "field::col(): out of bounds" ); return subview_field(*this, 0, col_num, n_rows, 1); } @@ -830,11 +830,11 @@ inline const subview_field field::col(const uword col_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (n_slices >= 2), "field::col(): field must be 2D" ); + arma_conform_check( (n_slices >= 2), "field::col(): field must be 2D" ); - arma_debug_check_bounds( (col_num >= n_cols), "field::col(): out of bounds" ); + arma_conform_check_bounds( (col_num >= n_cols), "field::col(): out of bounds" ); return subview_field(*this, 0, col_num, n_rows, 1); } @@ -847,9 +847,9 @@ inline subview_field field::slice(const uword slice_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (slice_num >= n_slices), "field::slice(): out of bounds" ); + arma_conform_check_bounds( (slice_num >= n_slices), "field::slice(): out of bounds" ); return subview_field(*this, 0, 0, slice_num, n_rows, n_cols, 1); } @@ -862,9 +862,9 @@ inline const subview_field field::slice(const uword slice_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (slice_num >= n_slices), "field::slice(): out of bounds" ); + arma_conform_check_bounds( (slice_num >= n_slices), "field::slice(): out of bounds" ); return subview_field(*this, 0, 0, slice_num, n_rows, n_cols, 1); } @@ -877,11 +877,11 @@ inline subview_field field::rows(const uword in_row1, const uword in_row2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (n_slices >= 2), "field::rows(): field must be 2D" ); + arma_conform_check( (n_slices >= 2), "field::rows(): field must be 2D" ); - arma_debug_check_bounds + arma_conform_check_bounds ( ( (in_row1 > in_row2) || (in_row2 >= n_rows) ), "field::rows(): indicies out of bounds or incorrectly used" @@ -900,11 +900,11 @@ inline const subview_field field::rows(const uword in_row1, const uword in_row2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (n_slices >= 2), "field::rows(): field must be 2D" ); + arma_conform_check( (n_slices >= 2), "field::rows(): field must be 2D" ); - arma_debug_check_bounds + arma_conform_check_bounds ( ( (in_row1 > in_row2) || (in_row2 >= n_rows) ), "field::rows(): indicies out of bounds or incorrectly used" @@ -923,11 +923,11 @@ inline subview_field field::cols(const uword in_col1, const uword in_col2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (n_slices >= 2), "field::cols(): field must be 2D" ); + arma_conform_check( (n_slices >= 2), "field::cols(): field must be 2D" ); - arma_debug_check_bounds + arma_conform_check_bounds ( ( (in_col1 > in_col2) || (in_col2 >= n_cols) ), "field::cols(): indicies out of bounds or incorrectly used" @@ -946,11 +946,11 @@ inline const subview_field field::cols(const uword in_col1, const uword in_col2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (n_slices >= 2), "field::cols(): field must be 2D" ); + arma_conform_check( (n_slices >= 2), "field::cols(): field must be 2D" ); - arma_debug_check_bounds + arma_conform_check_bounds ( ( (in_col1 > in_col2) || (in_col2 >= n_cols) ), "field::cols(): indicies out of bounds or incorrectly used" @@ -969,9 +969,9 @@ inline subview_field field::slices(const uword in_slice1, const uword in_slice2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( ( (in_slice1 > in_slice2) || (in_slice2 >= n_slices) ), "field::slices(): indicies out of bounds or incorrectly used" @@ -990,9 +990,9 @@ inline const subview_field field::slices(const uword in_slice1, const uword in_slice2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( ( (in_slice1 > in_slice2) || (in_slice2 >= n_slices) ), "field::slices(): indicies out of bounds or incorrectly used" @@ -1011,11 +1011,11 @@ inline subview_field field::subfield(const uword in_row1, const uword in_col1, const uword in_row2, const uword in_col2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (n_slices >= 2), "field::subfield(): field must be 2D" ); + arma_conform_check( (n_slices >= 2), "field::subfield(): field must be 2D" ); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols), "field::subfield(): indices out of bounds or incorrectly used" @@ -1035,11 +1035,11 @@ inline const subview_field field::subfield(const uword in_row1, const uword in_col1, const uword in_row2, const uword in_col2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (n_slices >= 2), "field::subfield(): field must be 2D" ); + arma_conform_check( (n_slices >= 2), "field::subfield(): field must be 2D" ); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols), "field::subfield(): indices out of bounds or incorrectly used" @@ -1059,9 +1059,9 @@ inline subview_field field::subfield(const uword in_row1, const uword in_col1, const uword in_slice1, const uword in_row2, const uword in_col2, const uword in_slice2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_col1 > in_col2) || (in_slice1 > in_slice2) || (in_row2 >= n_rows) || (in_col2 >= n_cols) || (in_slice2 >= n_slices), "field::subfield(): indices out of bounds or incorrectly used" @@ -1082,9 +1082,9 @@ inline const subview_field field::subfield(const uword in_row1, const uword in_col1, const uword in_slice1, const uword in_row2, const uword in_col2, const uword in_slice2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_col1 > in_col2) || (in_slice1 > in_slice2) || (in_row2 >= n_rows) || (in_col2 >= n_cols) || (in_slice2 >= n_slices), "field::subfield(): indices out of bounds or incorrectly used" @@ -1105,9 +1105,9 @@ inline subview_field field::subfield(const uword in_row1, const uword in_col1, const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (n_slices >= 2), "field::subfield(): field must be 2D" ); + arma_conform_check( (n_slices >= 2), "field::subfield(): field must be 2D" ); const uword l_n_rows = n_rows; const uword l_n_cols = n_cols; @@ -1115,7 +1115,7 @@ field::subfield(const uword in_row1, const uword in_col1, const SizeMat& s) const uword s_n_rows = s.n_rows; const uword s_n_cols = s.n_cols; - arma_debug_check_bounds + arma_conform_check_bounds ( ((in_row1 >= l_n_rows) || (in_col1 >= l_n_cols) || ((in_row1 + s_n_rows) > l_n_rows) || ((in_col1 + s_n_cols) > l_n_cols)), "field::subfield(): indices or size out of bounds" @@ -1132,9 +1132,9 @@ inline const subview_field field::subfield(const uword in_row1, const uword in_col1, const SizeMat& s) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (n_slices >= 2), "field::subfield(): field must be 2D" ); + arma_conform_check( (n_slices >= 2), "field::subfield(): field must be 2D" ); const uword l_n_rows = n_rows; const uword l_n_cols = n_cols; @@ -1142,7 +1142,7 @@ field::subfield(const uword in_row1, const uword in_col1, const SizeMat& s) const uword s_n_rows = s.n_rows; const uword s_n_cols = s.n_cols; - arma_debug_check_bounds + arma_conform_check_bounds ( ((in_row1 >= l_n_rows) || (in_col1 >= l_n_cols) || ((in_row1 + s_n_rows) > l_n_rows) || ((in_col1 + s_n_cols) > l_n_cols)), "field::subfield(): indices or size out of bounds" @@ -1159,7 +1159,7 @@ inline subview_field field::subfield(const uword in_row1, const uword in_col1, const uword in_slice1, const SizeCube& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword l_n_rows = n_rows; const uword l_n_cols = n_cols; @@ -1169,7 +1169,7 @@ field::subfield(const uword in_row1, const uword in_col1, const uword in_sli const uword s_n_cols = s.n_cols; const uword sub_n_slices = s.n_slices; - arma_debug_check_bounds + arma_conform_check_bounds ( ((in_row1 >= l_n_rows) || (in_col1 >= l_n_cols) || (in_slice1 >= l_n_slices) || ((in_row1 + s_n_rows) > l_n_rows) || ((in_col1 + s_n_cols) > l_n_cols) || ((in_slice1 + sub_n_slices) > l_n_slices)), "field::subfield(): indices or size out of bounds" @@ -1186,7 +1186,7 @@ inline const subview_field field::subfield(const uword in_row1, const uword in_col1, const uword in_slice1, const SizeCube& s) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword l_n_rows = n_rows; const uword l_n_cols = n_cols; @@ -1196,7 +1196,7 @@ field::subfield(const uword in_row1, const uword in_col1, const uword in_sli const uword s_n_cols = s.n_cols; const uword sub_n_slices = s.n_slices; - arma_debug_check_bounds + arma_conform_check_bounds ( ((in_row1 >= l_n_rows) || (in_col1 >= l_n_cols) || (in_slice1 >= l_n_slices) || ((in_row1 + s_n_rows) > l_n_rows) || ((in_col1 + s_n_cols) > l_n_cols) || ((in_slice1 + sub_n_slices) > l_n_slices)), "field::subfield(): indices or size out of bounds" @@ -1213,9 +1213,9 @@ inline subview_field field::subfield(const span& row_span, const span& col_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (n_slices >= 2), "field::subfield(): field must be 2D" ); + arma_conform_check( (n_slices >= 2), "field::subfield(): field must be 2D" ); const bool row_all = row_span.whole; const bool col_all = col_span.whole; @@ -1231,7 +1231,7 @@ field::subfield(const span& row_span, const span& col_span) const uword in_col2 = col_span.b; const uword sub_n_cols = col_all ? local_n_cols : in_col2 - in_col1 + 1; - arma_debug_check_bounds + arma_conform_check_bounds ( ( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= local_n_rows)) ) || @@ -1251,9 +1251,9 @@ inline const subview_field field::subfield(const span& row_span, const span& col_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (n_slices >= 2), "field::subfield(): field must be 2D" ); + arma_conform_check( (n_slices >= 2), "field::subfield(): field must be 2D" ); const bool row_all = row_span.whole; const bool col_all = col_span.whole; @@ -1269,7 +1269,7 @@ field::subfield(const span& row_span, const span& col_span) const const uword in_col2 = col_span.b; const uword sub_n_cols = col_all ? local_n_cols : in_col2 - in_col1 + 1; - arma_debug_check_bounds + arma_conform_check_bounds ( ( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= local_n_rows)) ) || @@ -1289,7 +1289,7 @@ inline subview_field field::subfield(const span& row_span, const span& col_span, const span& slice_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool row_all = row_span.whole; const bool col_all = col_span.whole; @@ -1311,7 +1311,7 @@ field::subfield(const span& row_span, const span& col_span, const span& slic const uword in_slice2 = slice_span.b; const uword sub_n_slices = slice_all ? local_n_slices : in_slice2 - in_slice1 + 1; - arma_debug_check_bounds + arma_conform_check_bounds ( ( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= local_n_rows)) ) || @@ -1333,7 +1333,7 @@ inline const subview_field field::subfield(const span& row_span, const span& col_span, const span& slice_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool row_all = row_span.whole; const bool col_all = col_span.whole; @@ -1355,7 +1355,7 @@ field::subfield(const span& row_span, const span& col_span, const span& slic const uword in_slice2 = slice_span.b; const uword sub_n_slices = slice_all ? local_n_slices : in_slice2 - in_slice1 + 1; - arma_debug_check_bounds + arma_conform_check_bounds ( ( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= local_n_rows)) ) || @@ -1376,7 +1376,7 @@ inline subview_field field::operator()(const span& row_span, const span& col_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).subfield(row_span, col_span); } @@ -1388,7 +1388,7 @@ inline const subview_field field::operator()(const span& row_span, const span& col_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).subfield(row_span, col_span); } @@ -1400,7 +1400,7 @@ inline subview_field field::operator()(const span& row_span, const span& col_span, const span& slice_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).subfield(row_span, col_span, slice_span); } @@ -1412,7 +1412,7 @@ inline const subview_field field::operator()(const span& row_span, const span& col_span, const span& slice_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).subfield(row_span, col_span, slice_span); } @@ -1424,7 +1424,7 @@ inline subview_field field::operator()(const uword in_row1, const uword in_col1, const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).subfield(in_row1, in_col1, s); } @@ -1436,7 +1436,7 @@ inline const subview_field field::operator()(const uword in_row1, const uword in_col1, const SizeMat& s) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).subfield(in_row1, in_col1, s); } @@ -1448,7 +1448,7 @@ inline subview_field field::operator()(const uword in_row1, const uword in_col1, const uword in_slice1, const SizeCube& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).subfield(in_row1, in_col1, in_slice1, s); } @@ -1460,7 +1460,7 @@ inline const subview_field field::operator()(const uword in_row1, const uword in_col1, const uword in_slice1, const SizeCube& s) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).subfield(in_row1, in_col1, in_slice1, s); } @@ -1481,7 +1481,7 @@ inline void field::print(const std::string extra_text) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(extra_text.length() != 0) { @@ -1511,7 +1511,7 @@ inline void field::print(std::ostream& user_stream, const std::string extra_text) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(extra_text.length() != 0) { @@ -1533,7 +1533,7 @@ inline field& field::for_each(const std::function< void(oT&) >& F) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); for(uword i=0; i < n_elem; ++i) { F(operator[](i)); } @@ -1547,7 +1547,7 @@ inline const field& field::for_each(const std::function< void(const oT&) >& F) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); for(uword i=0; i < n_elem; ++i) { F(operator[](i)); } @@ -1562,7 +1562,7 @@ inline field& field::fill(const oT& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); field& t = *this; @@ -1579,7 +1579,7 @@ inline void field::reset() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init(0,0,0); } @@ -1592,7 +1592,7 @@ inline void field::reset_objects() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); field_aux::reset_objects(*this); } @@ -1627,7 +1627,7 @@ arma_inline bool field::in_range(const span& x) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(x.whole) { @@ -1660,7 +1660,7 @@ arma_inline bool field::in_range(const span& row_span, const uword in_col) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(row_span.whole) { @@ -1682,7 +1682,7 @@ arma_inline bool field::in_range(const uword in_row, const span& col_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(col_span.whole) { @@ -1704,7 +1704,7 @@ arma_inline bool field::in_range(const span& row_span, const span& col_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword in_row1 = row_span.a; const uword in_row2 = row_span.b; @@ -1755,7 +1755,7 @@ arma_inline bool field::in_range(const span& row_span, const span& col_span, const span& slice_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword in_row1 = row_span.a; const uword in_row2 = row_span.b; @@ -1801,7 +1801,7 @@ inline bool field::save(const std::string name, const file_type type) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); std::string err_msg; @@ -1811,11 +1811,11 @@ field::save(const std::string name, const file_type type) const { if(err_msg.length() > 0) { - arma_debug_warn_level(3, "field::save(): ", err_msg, "; file: ", name); + arma_conform_warn(3, "field::save(): ", err_msg, "; file: ", name); } else { - arma_debug_warn_level(3, "field::save(): write failed; file: ", name); + arma_conform_warn(3, "field::save(): write failed; file: ", name); } } @@ -1829,7 +1829,7 @@ inline bool field::save(std::ostream& os, const file_type type) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); std::string err_msg; @@ -1839,11 +1839,11 @@ field::save(std::ostream& os, const file_type type) const { if(err_msg.length() > 0) { - arma_debug_warn_level(3, "field::save(): ", err_msg); + arma_conform_warn(3, "field::save(): ", err_msg); } else { - arma_debug_warn_level(3, "field::save(): stream write failed"); + arma_conform_warn(3, "field::save(): stream write failed"); } } @@ -1857,7 +1857,7 @@ inline bool field::load(const std::string name, const file_type type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); std::string err_msg; @@ -1867,11 +1867,11 @@ field::load(const std::string name, const file_type type) { if(err_msg.length() > 0) { - arma_debug_warn_level(3, "field::load(): ", err_msg, "; file: ", name); + arma_conform_warn(3, "field::load(): ", err_msg, "; file: ", name); } else { - arma_debug_warn_level(3, "field::load(): read failed; file: ", name); + arma_conform_warn(3, "field::load(): read failed; file: ", name); } } @@ -1887,7 +1887,7 @@ inline bool field::load(std::istream& is, const file_type type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); std::string err_msg; const bool load_okay = field_aux::load(*this, is, type, err_msg); @@ -1896,11 +1896,11 @@ field::load(std::istream& is, const file_type type) { if(err_msg.length() > 0) { - arma_debug_warn_level(3, "field::load(): ", err_msg); + arma_conform_warn(3, "field::load(): ", err_msg); } else { - arma_debug_warn_level(3, "field::load(): stream read failed"); + arma_conform_warn(3, "field::load(): stream read failed"); } } @@ -1916,7 +1916,7 @@ inline bool field::quiet_save(const std::string name, const file_type type) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).save(name, type); } @@ -1928,7 +1928,7 @@ inline bool field::quiet_save(std::ostream& os, const file_type type) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).save(os, type); } @@ -1940,7 +1940,7 @@ inline bool field::quiet_load(const std::string name, const file_type type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).load(name, type); } @@ -1952,7 +1952,7 @@ inline bool field::quiet_load(std::istream& is, const file_type type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).load(is, type); } @@ -1965,7 +1965,7 @@ inline void field::init(const field& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(this != &x) { @@ -2014,7 +2014,7 @@ inline void field::init(const uword n_rows_in, const uword n_cols_in, const uword n_slices_in) { - arma_extra_debug_sigprint( arma_str::format("n_rows_in = %u, n_cols_in = %u, n_slices_in = %u") % n_rows_in % n_cols_in % n_slices_in ); + arma_debug_sigprint( arma_str::format("n_rows_in: %u; n_cols_in: %u; n_slices_in: %u") % n_rows_in % n_cols_in % n_slices_in ); #if defined(ARMA_64BIT_WORD) const char* error_message = "field::init(): requested size is too large"; @@ -2022,7 +2022,7 @@ field::init(const uword n_rows_in, const uword n_cols_in, const uword n_slic const char* error_message = "field::init(): requested size is too large; suggest to enable ARMA_64BIT_WORD"; #endif - arma_debug_check + arma_conform_check ( ( ( (n_rows_in > 0x0FFF) || (n_cols_in > 0x0FFF) || (n_slices_in > 0xFF) ) @@ -2075,7 +2075,7 @@ inline void field::delete_objects() { - arma_extra_debug_sigprint( arma_str::format("n_elem = %u") % n_elem ); + arma_debug_sigprint( arma_str::format("n_elem: %u") % n_elem ); for(uword i=0; i::create_objects() { - arma_extra_debug_sigprint( arma_str::format("n_elem = %u") % n_elem ); + arma_debug_sigprint( arma_str::format("n_elem: %u") % n_elem ); for(uword i=0; i::iterator::iterator(field& in_M, const bool at_end) : M(in_M) , i( (at_end == false) ? 0 : in_M.n_elem ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -2192,7 +2192,7 @@ field::const_iterator::const_iterator(const field& in_M, const bool at_e : M(in_M) , i( (at_end == false) ? 0 : in_M.n_elem ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -2203,7 +2203,7 @@ field::const_iterator::const_iterator(const typename field::iterator& X) : M(X.M) , i(X.i) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -2287,7 +2287,7 @@ inline typename field::iterator field::begin() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return field::iterator(*this); } @@ -2299,7 +2299,7 @@ inline typename field::const_iterator field::begin() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return field::const_iterator(*this); } @@ -2311,7 +2311,7 @@ inline typename field::const_iterator field::cbegin() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return field::const_iterator(*this); } @@ -2323,7 +2323,7 @@ inline typename field::iterator field::end() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return field::iterator(*this, true); } @@ -2335,7 +2335,7 @@ inline typename field::const_iterator field::end() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return field::const_iterator(*this, true); } @@ -2347,7 +2347,7 @@ inline typename field::const_iterator field::cend() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return field::const_iterator(*this, true); } @@ -2395,7 +2395,7 @@ inline void field_aux::reset_objects(field& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); x.delete_objects(); x.create_objects(); @@ -2408,7 +2408,7 @@ inline void field_aux::reset_objects(field< Mat >& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); for(uword i=0; i < x.n_elem; ++i) { (*(x.mem[i])).reset(); } } @@ -2420,7 +2420,7 @@ inline void field_aux::reset_objects(field< Col >& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); for(uword i=0; i < x.n_elem; ++i) { (*(x.mem[i])).reset(); } } @@ -2432,7 +2432,7 @@ inline void field_aux::reset_objects(field< Row >& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); for(uword i=0; i < x.n_elem; ++i) { (*(x.mem[i])).reset(); } } @@ -2444,7 +2444,7 @@ inline void field_aux::reset_objects(field< Cube >& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); for(uword i=0; i < x.n_elem; ++i) { (*(x.mem[i])).reset(); } } @@ -2455,7 +2455,7 @@ inline void field_aux::reset_objects(field< std::string >& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); for(uword i=0; i < x.n_elem; ++i) { (*(x.mem[i])).clear(); } } @@ -2473,7 +2473,7 @@ inline bool field_aux::save(const field&, const std::string&, const file_type, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); err_msg = "saving/loading this type of field is currently not supported"; @@ -2487,7 +2487,7 @@ inline bool field_aux::save(const field&, std::ostream&, const file_type, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); err_msg = "saving/loading this type of field is currently not supported"; @@ -2501,7 +2501,7 @@ inline bool field_aux::load(field&, const std::string&, const file_type, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); err_msg = "saving/loading this type of field is currently not supported"; @@ -2515,7 +2515,7 @@ inline bool field_aux::load(field&, std::istream&, const file_type, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); err_msg = "saving/loading this type of field is currently not supported"; @@ -2529,7 +2529,7 @@ inline bool field_aux::save(const field< Mat >& x, const std::string& name, const file_type type, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); switch(type) { @@ -2554,7 +2554,7 @@ inline bool field_aux::save(const field< Mat >& x, std::ostream& os, const file_type type, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); switch(type) { @@ -2579,7 +2579,7 @@ inline bool field_aux::load(field< Mat >& x, const std::string& name, const file_type type, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); switch(type) { @@ -2608,7 +2608,7 @@ inline bool field_aux::load(field< Mat >& x, std::istream& is, const file_type type, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); switch(type) { @@ -2637,7 +2637,7 @@ inline bool field_aux::save(const field< Col >& x, const std::string& name, const file_type type, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); switch(type) { @@ -2662,7 +2662,7 @@ inline bool field_aux::save(const field< Col >& x, std::ostream& os, const file_type type, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); switch(type) { @@ -2687,7 +2687,7 @@ inline bool field_aux::load(field< Col >& x, const std::string& name, const file_type type, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); switch(type) { @@ -2716,7 +2716,7 @@ inline bool field_aux::load(field< Col >& x, std::istream& is, const file_type type, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); switch(type) { @@ -2745,7 +2745,7 @@ inline bool field_aux::save(const field< Row >& x, const std::string& name, const file_type type, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); switch(type) { @@ -2770,7 +2770,7 @@ inline bool field_aux::save(const field< Row >& x, std::ostream& os, const file_type type, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); switch(type) { @@ -2795,7 +2795,7 @@ inline bool field_aux::load(field< Row >& x, const std::string& name, const file_type type, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); switch(type) { @@ -2824,7 +2824,7 @@ inline bool field_aux::load(field< Row >& x, std::istream& is, const file_type type, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); switch(type) { @@ -2853,7 +2853,7 @@ inline bool field_aux::save(const field< Cube >& x, const std::string& name, const file_type type, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); switch(type) { @@ -2874,7 +2874,7 @@ inline bool field_aux::save(const field< Cube >& x, std::ostream& os, const file_type type, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); switch(type) { @@ -2895,7 +2895,7 @@ inline bool field_aux::load(field< Cube >& x, const std::string& name, const file_type type, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); switch(type) { @@ -2917,7 +2917,7 @@ inline bool field_aux::load(field< Cube >& x, std::istream& is, const file_type type, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); switch(type) { @@ -2938,7 +2938,7 @@ inline bool field_aux::save(const field< std::string >& x, const std::string& name, const file_type type, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(type); @@ -2953,7 +2953,7 @@ inline bool field_aux::save(const field< std::string >& x, std::ostream& os, const file_type type, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(type); @@ -2968,7 +2968,7 @@ inline bool field_aux::load(field< std::string >& x, const std::string& name, const file_type type, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(type); @@ -2981,7 +2981,7 @@ inline bool field_aux::load(field< std::string >& x, std::istream& is, const file_type type, std::string& err_msg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(type); diff --git a/inst/include/armadillo_bits/fn_accu.hpp b/inst/include/armadillo_bits/fn_accu.hpp index 957459cd..dc297c44 100644 --- a/inst/include/armadillo_bits/fn_accu.hpp +++ b/inst/include/armadillo_bits/fn_accu.hpp @@ -27,7 +27,7 @@ inline typename T1::elem_type accu_proxy_linear(const Proxy& P) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -109,7 +109,7 @@ inline typename T1::elem_type accu_proxy_at_mp(const Proxy& P) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -209,7 +209,7 @@ inline typename T1::elem_type accu_proxy_at(const Proxy& P) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -256,7 +256,7 @@ inline typename enable_if2< is_arma_type::value, typename T1::elem_type >::result accu(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Proxy P(X); @@ -272,6 +272,59 @@ accu(const T1& X) +//! explicit handling of dot product expressed as matrix multiplication +template +arma_warn_unused +inline +typename T1::elem_type +accu(const Glue& expr) + { + arma_debug_sigprint(); + + typedef typename T1::elem_type eT; + + if( (is_cx::no) && (resolves_to_rowvector::value && resolves_to_colvector::value) ) + { + arma_debug_print("accu(): dot product optimisation"); + + constexpr bool proxy_is_mat = (is_Mat::stored_type>::value && is_Mat::stored_type>::value); + + constexpr bool use_at = (Proxy::use_at) || (Proxy::use_at); + + constexpr bool fast_unwrap = (partial_unwrap::is_fast && partial_unwrap::is_fast); + + if(proxy_is_mat || use_at || fast_unwrap) + { + const partial_unwrap UA(expr.A); + const partial_unwrap UB(expr.B); + + const typename partial_unwrap::stored_type& A = UA.M; + const typename partial_unwrap::stored_type& B = UB.M; + + arma_conform_assert_mul_size(A, B, UA.do_trans, UB.do_trans, "matrix multiplication"); + + const eT val = op_dot::direct_dot(A.n_elem, A.memptr(), B.memptr()); + + return (UA.do_times || UB.do_times) ? (val * UA.get_val() * UB.get_val()) : val; + } + else + { + const Proxy PA(expr.A); + const Proxy PB(expr.B); + + arma_conform_assert_mul_size(PA.get_n_rows(), PA.get_n_cols(), PB.get_n_rows(), PB.get_n_cols(), "matrix multiplication"); + + return op_dot::apply_proxy(PA,PB); + } + } + + const Mat tmp(expr); + + return arrayops::accumulate( tmp.memptr(), tmp.n_elem ); + } + + + //! explicit handling of multiply-and-accumulate template arma_warn_unused @@ -279,15 +332,15 @@ inline typename T1::elem_type accu(const eGlue& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef eGlue expr_type; typedef typename expr_type::proxy1_type::stored_type P1_stored_type; typedef typename expr_type::proxy2_type::stored_type P2_stored_type; - const bool have_direct_mem_1 = (is_Mat::value) || (is_subview_col::value); - const bool have_direct_mem_2 = (is_Mat::value) || (is_subview_col::value); + constexpr bool have_direct_mem_1 = (is_Mat::value) || (is_subview_col::value); + constexpr bool have_direct_mem_2 = (is_Mat::value) || (is_subview_col::value); if(have_direct_mem_1 && have_direct_mem_2) { @@ -311,7 +364,7 @@ inline uword accu(const mtOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -366,7 +419,7 @@ inline uword accu(const mtOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -421,12 +474,12 @@ inline uword accu(const mtGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Proxy PA(X.A); const Proxy PB(X.B); - arma_debug_assert_same_size(PA, PB, "operator!="); + arma_conform_assert_same_size(PA, PB, "operator!="); uword n_nonzero = 0; @@ -477,12 +530,12 @@ inline uword accu(const mtGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Proxy PA(X.A); const Proxy PB(X.B); - arma_debug_assert_same_size(PA, PB, "operator=="); + arma_conform_assert_same_size(PA, PB, "operator=="); uword n_nonzero = 0; @@ -535,7 +588,7 @@ inline eT accu(const subview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword X_n_rows = X.n_rows; const uword X_n_cols = X.n_cols; @@ -583,7 +636,7 @@ inline eT accu(const subview_col& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return arrayops::accumulate( X.colmem, X.n_rows ); } @@ -600,7 +653,7 @@ inline typename T1::elem_type accu_cube_proxy_linear(const ProxyCube& P) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -682,7 +735,7 @@ inline typename T1::elem_type accu_cube_proxy_at_mp(const ProxyCube& P) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -734,7 +787,7 @@ inline typename T1::elem_type accu_cube_proxy_at(const ProxyCube& P) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -772,7 +825,7 @@ inline typename T1::elem_type accu(const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const ProxyCube P(X.get_ref()); @@ -795,7 +848,7 @@ inline typename T1::elem_type accu(const eGlueCube& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef eGlueCube expr_type; @@ -839,7 +892,7 @@ inline typename T1::elem_type accu(const SpBase& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -886,12 +939,12 @@ inline typename T1::elem_type accu(const SpGlue& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat UA(expr.A); const unwrap_spmat UB(expr.B); - arma_debug_assert_same_size(UA.M.n_rows, UA.M.n_cols, UB.M.n_rows, UB.M.n_cols, "addition"); + arma_conform_assert_same_size(UA.M.n_rows, UA.M.n_cols, UB.M.n_rows, UB.M.n_cols, "addition"); return (accu(UA.M) + accu(UB.M)); } @@ -905,12 +958,12 @@ inline typename T1::elem_type accu(const SpGlue& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat UA(expr.A); const unwrap_spmat UB(expr.B); - arma_debug_assert_same_size(UA.M.n_rows, UA.M.n_cols, UB.M.n_rows, UB.M.n_cols, "subtraction"); + arma_conform_assert_same_size(UA.M.n_rows, UA.M.n_cols, UB.M.n_rows, UB.M.n_cols, "subtraction"); return (accu(UA.M) - accu(UB.M)); } @@ -924,7 +977,7 @@ inline typename T1::elem_type accu(const SpGlue& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -978,19 +1031,16 @@ inline typename T1::elem_type accu(const SpOp& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; - const bool is_vectorise = \ + constexpr bool is_vectorise = \ (is_same_type::yes) || (is_same_type::yes) || (is_same_type::yes); - if(is_vectorise) - { - return accu(expr.m); - } + if(is_vectorise) { return accu(expr.m); } const SpMat tmp = expr; diff --git a/inst/include/armadillo_bits/fn_all.hpp b/inst/include/armadillo_bits/fn_all.hpp index c69095d0..5263e60e 100644 --- a/inst/include/armadillo_bits/fn_all.hpp +++ b/inst/include/armadillo_bits/fn_all.hpp @@ -32,7 +32,7 @@ enable_if2 >::result all(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return op_all::all_vec(X); } @@ -50,7 +50,7 @@ enable_if2 >::result all(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X, 0, 0); } @@ -68,7 +68,7 @@ enable_if2 >::result all(const T1& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X, dim, 0); } diff --git a/inst/include/armadillo_bits/fn_any.hpp b/inst/include/armadillo_bits/fn_any.hpp index 9038059d..3685b480 100644 --- a/inst/include/armadillo_bits/fn_any.hpp +++ b/inst/include/armadillo_bits/fn_any.hpp @@ -32,7 +32,7 @@ enable_if2 >::result any(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return op_any::any_vec(X); } @@ -50,7 +50,7 @@ enable_if2 >::result any(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X, 0, 0); } @@ -68,7 +68,7 @@ enable_if2 >::result any(const T1& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X, dim, 0); } diff --git a/inst/include/armadillo_bits/fn_approx_equal.hpp b/inst/include/armadillo_bits/fn_approx_equal.hpp index e92b94fd..91f23948 100644 --- a/inst/include/armadillo_bits/fn_approx_equal.hpp +++ b/inst/include/armadillo_bits/fn_approx_equal.hpp @@ -103,15 +103,15 @@ internal_approx_equal_worker const typename T1::pod_type rel_tol ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; - arma_debug_check( ((use_abs_diff == false) && (use_rel_diff == false)), "internal_approx_equal_worker(): both 'use_abs_diff' and 'use_rel_diff' are false" ); + arma_conform_check( ((use_abs_diff == false) && (use_rel_diff == false)), "internal_approx_equal_worker(): both 'use_abs_diff' and 'use_rel_diff' are false" ); - if(use_abs_diff) { arma_debug_check( cond_rel< is_signed::value >::lt(abs_tol, T(0)), "approx_equal(): argument 'abs_tol' must be >= 0" ); } - if(use_rel_diff) { arma_debug_check( cond_rel< is_signed::value >::lt(rel_tol, T(0)), "approx_equal(): argument 'rel_tol' must be >= 0" ); } + if(use_abs_diff) { arma_conform_check( cond_rel< is_signed::value >::lt(abs_tol, T(0)), "approx_equal(): argument 'abs_tol' must be >= 0" ); } + if(use_rel_diff) { arma_conform_check( cond_rel< is_signed::value >::lt(rel_tol, T(0)), "approx_equal(): argument 'rel_tol' must be >= 0" ); } const Proxy PA(A.get_ref()); const Proxy PB(B.get_ref()); @@ -196,15 +196,15 @@ internal_approx_equal_worker const typename T1::pod_type rel_tol ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; - arma_debug_check( ((use_abs_diff == false) && (use_rel_diff == false)), "internal_approx_equal_worker(): both 'use_abs_diff' and 'use_rel_diff' are false" ); + arma_conform_check( ((use_abs_diff == false) && (use_rel_diff == false)), "internal_approx_equal_worker(): both 'use_abs_diff' and 'use_rel_diff' are false" ); - if(use_abs_diff) { arma_debug_check( cond_rel< is_signed::value >::lt(abs_tol, T(0)), "approx_equal(): argument 'abs_tol' must be >= 0" ); } - if(use_rel_diff) { arma_debug_check( cond_rel< is_signed::value >::lt(rel_tol, T(0)), "approx_equal(): argument 'rel_tol' must be >= 0" ); } + if(use_abs_diff) { arma_conform_check( cond_rel< is_signed::value >::lt(abs_tol, T(0)), "approx_equal(): argument 'abs_tol' must be >= 0" ); } + if(use_rel_diff) { arma_conform_check( cond_rel< is_signed::value >::lt(rel_tol, T(0)), "approx_equal(): argument 'rel_tol' must be >= 0" ); } const ProxyCube PA(A.get_ref()); const ProxyCube PB(B.get_ref()); @@ -285,13 +285,13 @@ inline bool internal_approx_equal_handler(const T1& A, const T2& B, const char* method, const typename T1::pod_type abs_tol, const typename T1::pod_type rel_tol) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; const char sig = (method != nullptr) ? method[0] : char(0); - arma_debug_check( ((sig != 'a') && (sig != 'r') && (sig != 'b')), "approx_equal(): argument 'method' must be \"absdiff\" or \"reldiff\" or \"both\"" ); + arma_conform_check( ((sig != 'a') && (sig != 'r') && (sig != 'b')), "approx_equal(): argument 'method' must be \"absdiff\" or \"reldiff\" or \"both\"" ); bool status = false; @@ -320,15 +320,15 @@ inline bool internal_approx_equal_handler(const T1& A, const T2& B, const char* method, const typename T1::pod_type tol) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; const char sig = (method != nullptr) ? method[0] : char(0); - arma_debug_check( ((sig != 'a') && (sig != 'r') && (sig != 'b')), "approx_equal(): argument 'method' must be \"absdiff\" or \"reldiff\" or \"both\"" ); + arma_conform_check( ((sig != 'a') && (sig != 'r') && (sig != 'b')), "approx_equal(): argument 'method' must be \"absdiff\" or \"reldiff\" or \"both\"" ); - arma_debug_check( (sig == 'b'), "approx_equal(): argument 'method' is \"both\", but only one 'tol' argument has been given" ); + arma_conform_check( (sig == 'b'), "approx_equal(): argument 'method' is \"both\", but only one 'tol' argument has been given" ); bool status = false; @@ -353,7 +353,7 @@ inline bool approx_equal(const Base& A, const Base& B, const char* method, const typename T1::pod_type tol) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return internal_approx_equal_handler(A.get_ref(), B.get_ref(), method, tol); } @@ -366,7 +366,7 @@ inline bool approx_equal(const BaseCube& A, const BaseCube& B, const char* method, const typename T1::pod_type tol) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return internal_approx_equal_handler(A.get_ref(), B.get_ref(), method, tol); } @@ -379,7 +379,7 @@ inline bool approx_equal(const Base& A, const Base& B, const char* method, const typename T1::pod_type abs_tol, const typename T1::pod_type rel_tol) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return internal_approx_equal_handler(A.get_ref(), B.get_ref(), method, abs_tol, rel_tol); } @@ -392,7 +392,7 @@ inline bool approx_equal(const BaseCube& A, const BaseCube& B, const char* method, const typename T1::pod_type abs_tol, const typename T1::pod_type rel_tol) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return internal_approx_equal_handler(A.get_ref(), B.get_ref(), method, abs_tol, rel_tol); } @@ -405,20 +405,20 @@ inline bool approx_equal(const SpBase& A, const SpBase& B, const char* method, const typename T1::pod_type tol) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; const char sig = (method != nullptr) ? method[0] : char(0); - arma_debug_check( ((sig != 'a') && (sig != 'r') && (sig != 'b')), "approx_equal(): argument 'method' must be \"absdiff\" or \"reldiff\" or \"both\"" ); + arma_conform_check( ((sig != 'a') && (sig != 'r') && (sig != 'b')), "approx_equal(): argument 'method' must be \"absdiff\" or \"reldiff\" or \"both\"" ); - arma_debug_check( (sig == 'b'), "approx_equal(): argument 'method' is \"both\", but only one 'tol' argument has been given" ); + arma_conform_check( (sig == 'b'), "approx_equal(): argument 'method' is \"both\", but only one 'tol' argument has been given" ); - arma_debug_check( (sig == 'r'), "approx_equal(): only the \"absdiff\" method is currently implemented for sparse matrices" ); + arma_conform_check( (sig == 'r'), "approx_equal(): only the \"absdiff\" method is currently implemented for sparse matrices" ); - arma_debug_check( cond_rel< is_signed::value >::lt(tol, T(0)), "approx_equal(): argument 'tol' must be >= 0" ); + arma_conform_check( cond_rel< is_signed::value >::lt(tol, T(0)), "approx_equal(): argument 'tol' must be >= 0" ); const unwrap_spmat UA(A.get_ref()); const unwrap_spmat UB(B.get_ref()); @@ -450,18 +450,18 @@ inline bool approx_equal(const SpBase& A, const SpBase& B, const char* method, const typename T1::pod_type abs_tol, const typename T1::pod_type rel_tol) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; const char sig = (method != nullptr) ? method[0] : char(0); - arma_debug_check( ((sig != 'a') && (sig != 'r') && (sig != 'b')), "approx_equal(): argument 'method' must be \"absdiff\" or \"reldiff\" or \"both\"" ); + arma_conform_check( ((sig != 'a') && (sig != 'r') && (sig != 'b')), "approx_equal(): argument 'method' must be \"absdiff\" or \"reldiff\" or \"both\"" ); - arma_debug_check( ((sig == 'r') || (sig == 'b')), "approx_equal(): only the \"absdiff\" method is currently implemented for sparse matrices" ); + arma_conform_check( ((sig == 'r') || (sig == 'b')), "approx_equal(): only the \"absdiff\" method is currently implemented for sparse matrices" ); - arma_debug_check( cond_rel< is_signed::value >::lt(abs_tol, T(0)), "approx_equal(): argument 'abs_tol' must be >= 0" ); - arma_debug_check( cond_rel< is_signed::value >::lt(rel_tol, T(0)), "approx_equal(): argument 'rel_tol' must be >= 0" ); + arma_conform_check( cond_rel< is_signed::value >::lt(abs_tol, T(0)), "approx_equal(): argument 'abs_tol' must be >= 0" ); + arma_conform_check( cond_rel< is_signed::value >::lt(rel_tol, T(0)), "approx_equal(): argument 'rel_tol' must be >= 0" ); return approx_equal(A.get_ref(), B.get_ref(), "abs", abs_tol); } diff --git a/inst/include/armadillo_bits/fn_as_scalar.hpp b/inst/include/armadillo_bits/fn_as_scalar.hpp index b59dbfd1..e2ae69cf 100644 --- a/inst/include/armadillo_bits/fn_as_scalar.hpp +++ b/inst/include/armadillo_bits/fn_as_scalar.hpp @@ -53,11 +53,11 @@ inline typename T1::elem_type as_scalar_redirect::apply(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Proxy P(X); - arma_debug_check( (P.get_n_elem() != 1), "as_scalar(): expression must evaluate to exactly one element" ); + arma_conform_check( (P.get_n_elem() != 1), "as_scalar(): expression must evaluate to exactly one element" ); return (Proxy::use_at) ? P.at(0,0) : P[0]; } @@ -69,20 +69,21 @@ inline typename T1::elem_type as_scalar_redirect<2>::apply(const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; // T1 must result in a matrix with one row // T2 must result in a matrix with one column + // element type must non-complex - const bool has_all_mat = (is_Mat::value || is_Mat_trans::value) && (is_Mat::value || is_Mat_trans::value); + constexpr bool proxy_is_mat = (is_Mat::stored_type>::value && is_Mat::stored_type>::value); - const bool use_at = (Proxy::use_at || Proxy::use_at); + constexpr bool use_at = (Proxy::use_at) || (Proxy::use_at); - const bool do_partial_unwrap = (has_all_mat || use_at); + constexpr bool fast_unwrap = (partial_unwrap::is_fast && partial_unwrap::is_fast); - if(do_partial_unwrap) + if(proxy_is_mat || use_at || fast_unwrap) { const partial_unwrap tmp1(X.A); const partial_unwrap tmp2(X.B); @@ -99,7 +100,7 @@ as_scalar_redirect<2>::apply(const Glue& X) const uword B_n_rows = (tmp2.do_trans == false) ? (TB::is_row ? 1 : B.n_rows) : (TB::is_col ? 1 : B.n_cols); const uword B_n_cols = (tmp2.do_trans == false) ? (TB::is_col ? 1 : B.n_cols) : (TB::is_row ? 1 : B.n_rows); - arma_debug_check( (A_n_rows != 1) || (B_n_cols != 1) || (A_n_cols != B_n_rows), "as_scalar(): incompatible dimensions" ); + arma_conform_check( (A_n_rows != 1) || (B_n_cols != 1) || (A_n_cols != B_n_rows), "as_scalar(): incompatible dimensions" ); const eT val = op_dot::direct_dot(A.n_elem, A.memptr(), B.memptr()); @@ -110,7 +111,7 @@ as_scalar_redirect<2>::apply(const Glue& X) const Proxy PA(X.A); const Proxy PB(X.B); - arma_debug_check + arma_conform_check ( (PA.get_n_rows() != 1) || (PB.get_n_cols() != 1) || (PA.get_n_cols() != PB.get_n_rows()), "as_scalar(): incompatible dimensions" @@ -127,12 +128,13 @@ inline typename T1::elem_type as_scalar_redirect<3>::apply(const Glue< Glue, T3, glue_times >& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; // T1 * T2 must result in a matrix with one row // T3 must result in a matrix with one column + // element type must non-complex typedef typename strip_inv ::stored_type T2_stripped_1; typedef typename strip_diagmat::stored_type T2_stripped_2; @@ -140,14 +142,14 @@ 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_gen = strip1.do_inv_gen && arma_config::optimise_invexpr; - const bool tmp2_do_diagmat = strip2.do_diagmat; + constexpr bool tmp2_do_inv_gen = strip1.do_inv_gen && arma_config::optimise_invexpr; + constexpr bool tmp2_do_diagmat = strip2.do_diagmat; if(tmp2_do_diagmat == false) { const Mat tmp(X); - arma_debug_check( (tmp.n_elem != 1), "as_scalar(): expression must evaluate to exactly one element" ); + arma_conform_check( (tmp.n_elem != 1), "as_scalar(): expression must evaluate to exactly one element" ); return tmp[0]; } @@ -174,7 +176,7 @@ as_scalar_redirect<3>::apply(const Glue< Glue, T3, glue_time const eT val = tmp1.get_val() * tmp2.get_val() * tmp3.get_val(); - arma_debug_check + arma_conform_check ( (A_n_rows != 1) || (C_n_cols != 1) || @@ -217,14 +219,14 @@ inline typename T1::elem_type as_scalar_diag(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const unwrap tmp(X.get_ref()); const Mat& A = tmp.M; - arma_debug_check( (A.n_elem != 1), "as_scalar(): expression must evaluate to exactly one element" ); + arma_conform_check( (A.n_elem != 1), "as_scalar(): expression must evaluate to exactly one element" ); return A.mem[0]; } @@ -236,7 +238,7 @@ inline typename T1::elem_type as_scalar_diag(const Glue< Glue, T3, glue_times >& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -269,7 +271,7 @@ as_scalar_diag(const Glue< Glue, T3, glue_times >& X) const eT val = tmp1.get_val() * tmp2.get_val() * tmp3.get_val(); - arma_debug_check + arma_conform_check ( (A_n_rows != 1) || (C_n_cols != 1) || @@ -298,14 +300,14 @@ inline typename T1::elem_type as_scalar(const Glue& X, const typename arma_not_cx::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); if(is_glue_times_diag::value) { return as_scalar_diag(X); } constexpr uword N_mat = 1 + depth_lhs< glue_times, Glue >::num; - arma_extra_debug_print(arma_str::format("N_mat = %u") % N_mat); + arma_debug_print(arma_str::format("N_mat: %u") % N_mat); return as_scalar_redirect::apply(X); } @@ -318,11 +320,11 @@ inline typename T1::elem_type as_scalar(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Proxy P(X.get_ref()); - arma_debug_check( (P.get_n_elem() != 1), "as_scalar(): expression must evaluate to exactly one element" ); + arma_conform_check( (P.get_n_elem() != 1), "as_scalar(): expression must evaluate to exactly one element" ); return (Proxy::use_at) ? P.at(0,0) : P[0]; } @@ -334,11 +336,11 @@ inline typename T1::elem_type as_scalar(const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const ProxyCube P(X.get_ref()); - arma_debug_check( (P.get_n_elem() != 1), "as_scalar(): expression must evaluate to exactly one element" ); + arma_conform_check( (P.get_n_elem() != 1), "as_scalar(): expression must evaluate to exactly one element" ); return (ProxyCube::use_at) ? P.at(0,0,0) : P[0]; } @@ -362,14 +364,14 @@ inline typename T1::elem_type as_scalar(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const unwrap_spmat tmp(X.get_ref()); const SpMat& A = tmp.M; - arma_debug_check( (A.n_elem != 1), "as_scalar(): expression must evaluate to exactly one element" ); + arma_conform_check( (A.n_elem != 1), "as_scalar(): expression must evaluate to exactly one element" ); return A.at(0,0); } diff --git a/inst/include/armadillo_bits/fn_chi2rnd.hpp b/inst/include/armadillo_bits/fn_chi2rnd.hpp index 9da08f44..4e185785 100644 --- a/inst/include/armadillo_bits/fn_chi2rnd.hpp +++ b/inst/include/armadillo_bits/fn_chi2rnd.hpp @@ -26,7 +26,7 @@ inline double chi2rnd(const double df) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); op_chi2rnd_varying_df generator; @@ -41,7 +41,7 @@ inline typename arma_real_only::result chi2rnd(const eT df) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); op_chi2rnd_varying_df generator; @@ -61,7 +61,7 @@ enable_if2 >::result chi2rnd(const T1& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(expr); } @@ -79,16 +79,16 @@ enable_if2 >::result chi2rnd(const typename obj_type::elem_type df, const uword n_rows, const uword n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(is_Col::value) { - arma_debug_check( (n_cols != 1), "chi2rnd(): incompatible size" ); + arma_conform_check( (n_cols != 1), "chi2rnd(): incompatible size" ); } else if(is_Row::value) { - arma_debug_check( (n_rows != 1), "chi2rnd(): incompatible size" ); + arma_conform_check( (n_rows != 1), "chi2rnd(): incompatible size" ); } obj_type out(n_rows, n_cols, arma_nozeros_indicator()); @@ -111,7 +111,7 @@ enable_if2 >::result chi2rnd(const typename obj_type::elem_type df, const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return chi2rnd(df, s.n_rows, s.n_cols); } @@ -129,7 +129,7 @@ enable_if2 >::result chi2rnd(const typename obj_type::elem_type df, const uword n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(is_Row::value) { @@ -148,7 +148,7 @@ inline mat chi2rnd(const double df, const uword n_rows, const uword n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return chi2rnd(df, n_rows, n_cols); } @@ -160,7 +160,7 @@ inline mat chi2rnd(const double df, const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return chi2rnd(df, s.n_rows, s.n_cols); } @@ -172,7 +172,7 @@ inline vec chi2rnd(const double df, const uword n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return chi2rnd(df, n_elem, 1); } diff --git a/inst/include/armadillo_bits/fn_chol.hpp b/inst/include/armadillo_bits/fn_chol.hpp index dfd9e6e4..bd4e26b8 100644 --- a/inst/include/armadillo_bits/fn_chol.hpp +++ b/inst/include/armadillo_bits/fn_chol.hpp @@ -31,11 +31,11 @@ chol const char* layout = "upper" ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const char sig = (layout != nullptr) ? layout[0] : char(0); - arma_debug_check( ((sig != 'u') && (sig != 'l')), "chol(): layout must be \"upper\" or \"lower\"" ); + arma_conform_check( ((sig != 'u') && (sig != 'l')), "chol(): layout must be \"upper\" or \"lower\"" ); return Op(X.get_ref(), ((sig == 'u') ? 0 : 1), 0 ); } @@ -52,18 +52,18 @@ chol const char* layout = "upper" ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const char sig = (layout != nullptr) ? layout[0] : char(0); - arma_debug_check( ((sig != 'u') && (sig != 'l')), "chol(): layout must be \"upper\" or \"lower\"" ); + arma_conform_check( ((sig != 'u') && (sig != 'l')), "chol(): layout must be \"upper\" or \"lower\"" ); const bool status = op_chol::apply_direct(out, X.get_ref(), ((sig == 'u') ? 0 : 1)); if(status == false) { out.soft_reset(); - arma_debug_warn_level(3, "chol(): decomposition failed"); + arma_conform_warn(3, "chol(): decomposition failed"); } return status; @@ -83,19 +83,19 @@ chol const char* P_mode = "matrix" ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const char sig_layout = (layout != nullptr) ? layout[0] : char(0); const char sig_P_mode = (P_mode != nullptr) ? P_mode[0] : char(0); - arma_debug_check( ((sig_layout != 'u') && (sig_layout != 'l')), "chol(): argument 'layout' must be \"upper\" or \"lower\"" ); - arma_debug_check( ((sig_P_mode != 'm') && (sig_P_mode != 'v')), "chol(): argument 'P_mode' must be \"vector\" or \"matrix\"" ); + arma_conform_check( ((sig_layout != 'u') && (sig_layout != 'l')), "chol(): argument 'layout' must be \"upper\" or \"lower\"" ); + arma_conform_check( ((sig_P_mode != 'm') && (sig_P_mode != 'v')), "chol(): argument 'P_mode' must be \"vector\" or \"matrix\"" ); out = X.get_ref(); - arma_debug_check( (out.is_square() == false), "chol(): given matrix must be square sized", [&](){ out.soft_reset(); } ); + arma_conform_check( (out.is_square() == false), "chol(): given matrix must be square sized", [&](){ out.soft_reset(); } ); if(out.is_empty()) { @@ -103,10 +103,10 @@ chol return true; } - if((arma_config::debug) && (auxlib::rudimentary_sym_check(out) == false)) + if((arma_config::check_conformance) && (auxlib::rudimentary_sym_check(out) == false)) { - if(is_cx::no ) { arma_debug_warn_level(1, "chol(): given matrix is not symmetric"); } - if(is_cx::yes) { arma_debug_warn_level(1, "chol(): given matrix is not hermitian"); } + if(is_cx::no ) { arma_conform_warn(1, "chol(): given matrix is not symmetric"); } + if(is_cx::yes) { arma_conform_warn(1, "chol(): given matrix is not hermitian"); } } bool status = false; @@ -138,7 +138,7 @@ chol { out.soft_reset(); P.soft_reset(); - arma_debug_warn_level(3, "chol(): decomposition failed"); + arma_conform_warn(3, "chol(): decomposition failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_clamp.hpp b/inst/include/armadillo_bits/fn_clamp.hpp index a7da6d48..f7c53c70 100644 --- a/inst/include/armadillo_bits/fn_clamp.hpp +++ b/inst/include/armadillo_bits/fn_clamp.hpp @@ -32,7 +32,7 @@ enable_if2 >::result clamp(const T1& X, const typename T1::elem_type min_val, const typename T1::elem_type max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(mtOp_dual_aux_indicator(), X, min_val, max_val); } @@ -50,7 +50,7 @@ enable_if2 >::result clamp(const T1& X, const typename T1::elem_type min_val, const typename T1::elem_type max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(mtOp_dual_aux_indicator(), X, min_val, max_val); } @@ -63,7 +63,7 @@ inline const mtOpCube clamp(const BaseCube& X, const typename T1::elem_type min_val, const typename T1::elem_type max_val, typename arma_not_cx::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return mtOpCube(mtOpCube_dual_aux_indicator(), X.get_ref(), min_val, max_val); @@ -77,7 +77,7 @@ inline const mtOpCube clamp(const BaseCube& X, const typename T1::elem_type min_val, const typename T1::elem_type max_val, typename arma_cx_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return mtOpCube(mtOpCube_dual_aux_indicator(), X.get_ref(), min_val, max_val); @@ -91,18 +91,18 @@ inline SpMat clamp(const SpBase& X, const typename T1::elem_type min_val, const typename T1::elem_type max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; if(is_cx::no) { - arma_debug_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "clamp(): min_val must be less than max_val" ); + arma_conform_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "clamp(): min_val must be less than max_val" ); } else { - arma_debug_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "clamp(): real(min_val) must be less than real(max_val)" ); - arma_debug_check( (access::tmp_imag(min_val) > access::tmp_imag(max_val)), "clamp(): imag(min_val) must be less than imag(max_val)" ); + arma_conform_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "clamp(): real(min_val) must be less than real(max_val)" ); + arma_conform_check( (access::tmp_imag(min_val) > access::tmp_imag(max_val)), "clamp(): imag(min_val) must be less than imag(max_val)" ); } SpMat out = X.get_ref(); diff --git a/inst/include/armadillo_bits/fn_cond_rcond.hpp b/inst/include/armadillo_bits/fn_cond_rcond.hpp index fae0a06a..2d7c1d8d 100644 --- a/inst/include/armadillo_bits/fn_cond_rcond.hpp +++ b/inst/include/armadillo_bits/fn_cond_rcond.hpp @@ -27,7 +27,7 @@ inline typename enable_if2::value, typename T1::pod_type>::result cond(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return op_cond::apply(X.get_ref()); } @@ -40,7 +40,7 @@ inline typename enable_if2::value, typename T1::pod_type>::result rcond(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return op_rcond::apply(X.get_ref()); } @@ -53,7 +53,7 @@ rcond(const Base& X) // typename enable_if2::value, typename T1::pod_type>::result // rcond(const SpBase& X) // { -// arma_extra_debug_sigprint(); +// arma_debug_sigprint(); // // return sp_auxlib::rcond(X.get_ref()); // } diff --git a/inst/include/armadillo_bits/fn_conv.hpp b/inst/include/armadillo_bits/fn_conv.hpp index 44b7a0e0..cc47e2db 100644 --- a/inst/include/armadillo_bits/fn_conv.hpp +++ b/inst/include/armadillo_bits/fn_conv.hpp @@ -34,11 +34,11 @@ enable_if2 >::result conv(const T1& A, const T2& B, const char* shape = "full") { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const char sig = (shape != nullptr) ? shape[0] : char(0); - arma_debug_check( ((sig != 'f') && (sig != 's')), "conv(): unsupported value of 'shape' parameter" ); + arma_conform_check( ((sig != 'f') && (sig != 's')), "conv(): unsupported value of 'shape' parameter" ); const uword mode = (sig == 's') ? uword(1) : uword(0); @@ -58,11 +58,11 @@ enable_if2 >::result conv2(const T1& A, const T2& B, const char* shape = "full") { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const char sig = (shape != nullptr) ? shape[0] : char(0); - arma_debug_check( ((sig != 'f') && (sig != 's')), "conv2(): unsupported value of 'shape' parameter" ); + arma_conform_check( ((sig != 'f') && (sig != 's')), "conv2(): unsupported value of 'shape' parameter" ); const uword mode = (sig == 's') ? uword(1) : uword(0); diff --git a/inst/include/armadillo_bits/fn_conv_to.hpp b/inst/include/armadillo_bits/fn_conv_to.hpp index d59f1846..29a291ca 100644 --- a/inst/include/armadillo_bits/fn_conv_to.hpp +++ b/inst/include/armadillo_bits/fn_conv_to.hpp @@ -29,16 +29,16 @@ class conv_to public: template - inline static out_eT from(const Base& in, const typename arma_not_cx::result* junk = nullptr); + arma_frown("use as_scalar() instead") inline static out_eT from(const Base& in, const typename arma_not_cx::result* junk = nullptr); template - inline static out_eT from(const Base& in, const typename arma_cx_only::result* junk = nullptr); + arma_frown("use as_scalar() instead") inline static out_eT from(const Base& in, const typename arma_cx_only::result* junk = nullptr); template - inline static out_eT from(const BaseCube& in, const typename arma_not_cx::result* junk = nullptr); + arma_frown("use as_scalar() instead") inline static out_eT from(const BaseCube& in, const typename arma_not_cx::result* junk = nullptr); template - inline static out_eT from(const BaseCube& in, const typename arma_cx_only::result* junk = nullptr); + arma_frown("use as_scalar() instead") inline static out_eT from(const BaseCube& in, const typename arma_cx_only::result* junk = nullptr); }; @@ -50,14 +50,14 @@ inline out_eT conv_to::from(const Base& in, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); arma_type_check(( is_supported_elem_type::value == false )); const Proxy P(in.get_ref()); - arma_debug_check( (P.get_n_elem() != 1), "conv_to(): given object does not have exactly one element" ); + arma_conform_check( (P.get_n_elem() != 1), "conv_to(): given object does not have exactly one element" ); return out_eT(Proxy::use_at ? P.at(0,0) : P[0]); } @@ -71,14 +71,14 @@ inline out_eT conv_to::from(const Base& in, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); arma_type_check(( is_supported_elem_type::value == false )); const Proxy P(in.get_ref()); - arma_debug_check( (P.get_n_elem() != 1), "conv_to(): given object does not have exactly one element" ); + arma_conform_check( (P.get_n_elem() != 1), "conv_to(): given object does not have exactly one element" ); out_eT out; @@ -96,14 +96,14 @@ inline out_eT conv_to::from(const BaseCube& in, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); arma_type_check(( is_supported_elem_type::value == false )); const ProxyCube P(in.get_ref()); - arma_debug_check( (P.get_n_elem() != 1), "conv_to(): given object does not have exactly one element" ); + arma_conform_check( (P.get_n_elem() != 1), "conv_to(): given object does not have exactly one element" ); return out_eT(ProxyCube::use_at ? P.at(0,0,0) : P[0]); } @@ -117,14 +117,14 @@ inline out_eT conv_to::from(const BaseCube& in, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); arma_type_check(( is_supported_elem_type::value == false )); const ProxyCube P(in.get_ref()); - arma_debug_check( (P.get_n_elem() != 1), "conv_to(): given object does not have exactly one element" ); + arma_conform_check( (P.get_n_elem() != 1), "conv_to(): given object does not have exactly one element" ); out_eT out; @@ -173,7 +173,7 @@ inline Mat conv_to< Mat >::from(const Base& in, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const quasi_unwrap tmp(in.get_ref()); @@ -195,7 +195,7 @@ inline Mat conv_to< Mat >::from(const Base& in, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const quasi_unwrap tmp(in.get_ref()); @@ -217,7 +217,7 @@ inline Mat conv_to< Mat >::from(const SpBase& in, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const unwrap_spmat U(in.get_ref()); @@ -246,7 +246,7 @@ inline Mat conv_to< Mat >::from(const SpBase& in, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const unwrap_spmat U(in.get_ref()); @@ -275,7 +275,7 @@ inline Mat conv_to< Mat >::from(const std::vector& in, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const uword N = uword( in.size() ); @@ -299,7 +299,7 @@ inline Mat conv_to< Mat >::from(const std::vector& in, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const uword N = uword( in.size() ); @@ -346,13 +346,13 @@ inline Row conv_to< Row >::from(const Base& in, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const quasi_unwrap tmp(in.get_ref()); const Mat& X = tmp.M; - arma_debug_check( ( (X.is_vec() == false) && (X.is_empty() == false) ), "conv_to(): given object cannot be interpreted as a vector" ); + arma_conform_check( ( (X.is_vec() == false) && (X.is_empty() == false) ), "conv_to(): given object cannot be interpreted as a vector" ); Row out(X.n_elem, arma_nozeros_indicator()); @@ -370,13 +370,13 @@ inline Row conv_to< Row >::from(const Base& in, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const quasi_unwrap tmp(in.get_ref()); const Mat& X = tmp.M; - arma_debug_check( ( (X.is_vec() == false) && (X.is_empty() == false) ), "conv_to(): given object cannot be interpreted as a vector" ); + arma_conform_check( ( (X.is_vec() == false) && (X.is_empty() == false) ), "conv_to(): given object cannot be interpreted as a vector" ); Row out(X.n_rows, X.n_cols, arma_nozeros_indicator()); @@ -394,7 +394,7 @@ inline Row conv_to< Row >::from(const std::vector& in, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const uword N = uword( in.size() ); @@ -418,7 +418,7 @@ inline Row conv_to< Row >::from(const std::vector& in, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const uword N = uword( in.size() ); @@ -465,13 +465,13 @@ inline Col conv_to< Col >::from(const Base& in, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const quasi_unwrap tmp(in.get_ref()); const Mat& X = tmp.M; - arma_debug_check( ( (X.is_vec() == false) && (X.is_empty() == false) ), "conv_to(): given object cannot be interpreted as a vector" ); + arma_conform_check( ( (X.is_vec() == false) && (X.is_empty() == false) ), "conv_to(): given object cannot be interpreted as a vector" ); Col out(X.n_elem, arma_nozeros_indicator()); @@ -489,13 +489,13 @@ inline Col conv_to< Col >::from(const Base& in, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const quasi_unwrap tmp(in.get_ref()); const Mat& X = tmp.M; - arma_debug_check( ( (X.is_vec() == false) && (X.is_empty() == false) ), "conv_to(): given object cannot be interpreted as a vector" ); + arma_conform_check( ( (X.is_vec() == false) && (X.is_empty() == false) ), "conv_to(): given object cannot be interpreted as a vector" ); Col out(X.n_rows, X.n_cols, arma_nozeros_indicator()); @@ -513,7 +513,7 @@ inline Col conv_to< Col >::from(const std::vector& in, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const uword N = uword( in.size() ); @@ -537,7 +537,7 @@ inline Col conv_to< Col >::from(const std::vector& in, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const uword N = uword( in.size() ); @@ -584,7 +584,7 @@ inline SpMat conv_to< SpMat >::from(const SpBase& in, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const unwrap_spmat tmp(in.get_ref()); @@ -608,7 +608,7 @@ inline SpMat conv_to< SpMat >::from(const SpBase& in, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const unwrap_spmat tmp(in.get_ref()); @@ -632,7 +632,7 @@ inline SpMat conv_to< SpMat >::from(const Base& in, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); SpMat out; @@ -653,7 +653,7 @@ conv_to< SpMat >::from(const Base& in, const typename arma_no const uword X_n_rows = X.n_rows; const uword X_n_cols = X.n_cols; const uword X_n_elem = X.n_elem; - + const in_eT* X_mem = X.memptr(); uword X_nnz = 0; @@ -720,7 +720,7 @@ inline SpMat conv_to< SpMat >::from(const Base& in, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); SpMat out; @@ -741,7 +741,7 @@ conv_to< SpMat >::from(const Base& in, const typename arma_cx const uword X_n_rows = X.n_rows; const uword X_n_cols = X.n_cols; const uword X_n_elem = X.n_elem; - + const in_eT* X_mem = X.memptr(); uword X_nnz = 0; @@ -823,7 +823,7 @@ inline Cube conv_to< Cube >::from(const BaseCube& in, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const unwrap_cube tmp( in.get_ref() ); @@ -845,7 +845,7 @@ inline Cube conv_to< Cube >::from(const BaseCube& in, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const unwrap_cube tmp( in.get_ref() ); @@ -882,13 +882,13 @@ inline std::vector conv_to< std::vector >::from(const Base& in, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const quasi_unwrap tmp(in.get_ref()); const Mat& X = tmp.M; - arma_debug_check( ( (X.is_vec() == false) && (X.is_empty() == false) ), "conv_to(): given object cannot be interpreted as a vector" ); + arma_conform_check( ( (X.is_vec() == false) && (X.is_empty() == false) ), "conv_to(): given object cannot be interpreted as a vector" ); const uword N = X.n_elem; @@ -911,13 +911,13 @@ inline std::vector conv_to< std::vector >::from(const Base& in, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const quasi_unwrap tmp(in.get_ref()); const Mat& X = tmp.M; - arma_debug_check( ( (X.is_vec() == false) && (X.is_empty() == false) ), "conv_to(): given object cannot be interpreted as a vector" ); + arma_conform_check( ( (X.is_vec() == false) && (X.is_empty() == false) ), "conv_to(): given object cannot be interpreted as a vector" ); const uword N = X.n_elem; diff --git a/inst/include/armadillo_bits/fn_cor.hpp b/inst/include/armadillo_bits/fn_cor.hpp index 18cd2fa7..5b33e406 100644 --- a/inst/include/armadillo_bits/fn_cor.hpp +++ b/inst/include/armadillo_bits/fn_cor.hpp @@ -27,9 +27,9 @@ inline const Op cor(const Base& X, const uword norm_type = 0) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (norm_type > 1), "cor(): parameter 'norm_type' must be 0 or 1" ); + arma_conform_check( (norm_type > 1), "cor(): parameter 'norm_type' must be 0 or 1" ); return Op(X.get_ref(), norm_type, 0); } @@ -42,9 +42,9 @@ inline const Glue cor(const Base& A, const Base& B, const uword norm_type = 0) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (norm_type > 1), "cor(): parameter 'norm_type' must be 0 or 1" ); + arma_conform_check( (norm_type > 1), "cor(): parameter 'norm_type' must be 0 or 1" ); return Glue(A.get_ref(), B.get_ref(), norm_type); } diff --git a/inst/include/armadillo_bits/fn_cov.hpp b/inst/include/armadillo_bits/fn_cov.hpp index ee61c005..c8596bcb 100644 --- a/inst/include/armadillo_bits/fn_cov.hpp +++ b/inst/include/armadillo_bits/fn_cov.hpp @@ -27,9 +27,9 @@ inline const Op cov(const Base& X, const uword norm_type = 0) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (norm_type > 1), "cov(): parameter 'norm_type' must be 0 or 1" ); + arma_conform_check( (norm_type > 1), "cov(): parameter 'norm_type' must be 0 or 1" ); return Op(X.get_ref(), norm_type, 0); } @@ -42,9 +42,9 @@ inline const Glue cov(const Base& A, const Base& B, const uword norm_type = 0) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (norm_type > 1), "cov(): parameter 'norm_type' must be 0 or 1" ); + arma_conform_check( (norm_type > 1), "cov(): parameter 'norm_type' must be 0 or 1" ); return Glue(A.get_ref(), B.get_ref(), norm_type); } diff --git a/inst/include/armadillo_bits/fn_cross.hpp b/inst/include/armadillo_bits/fn_cross.hpp index bb08e179..4c15b2bd 100644 --- a/inst/include/armadillo_bits/fn_cross.hpp +++ b/inst/include/armadillo_bits/fn_cross.hpp @@ -33,7 +33,7 @@ enable_if2 >::result cross(const T1& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Glue(X, Y); } diff --git a/inst/include/armadillo_bits/fn_cumprod.hpp b/inst/include/armadillo_bits/fn_cumprod.hpp index f6cd1e17..adbcbadf 100644 --- a/inst/include/armadillo_bits/fn_cumprod.hpp +++ b/inst/include/armadillo_bits/fn_cumprod.hpp @@ -32,7 +32,7 @@ enable_if2 >::result cumprod(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X); } @@ -50,7 +50,7 @@ enable_if2 >::result cumprod(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, 0, 0); } @@ -68,7 +68,7 @@ enable_if2 >::result cumprod(const T1& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, dim, 0); } diff --git a/inst/include/armadillo_bits/fn_cumsum.hpp b/inst/include/armadillo_bits/fn_cumsum.hpp index ad6c6375..8c825338 100644 --- a/inst/include/armadillo_bits/fn_cumsum.hpp +++ b/inst/include/armadillo_bits/fn_cumsum.hpp @@ -32,7 +32,7 @@ enable_if2 >::result cumsum(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X); } @@ -50,7 +50,7 @@ enable_if2 >::result cumsum(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, 0, 0); } @@ -68,7 +68,7 @@ enable_if2 >::result cumsum(const T1& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, dim, 0); } diff --git a/inst/include/armadillo_bits/fn_det.hpp b/inst/include/armadillo_bits/fn_det.hpp index 3941a85a..4ea0b5e6 100644 --- a/inst/include/armadillo_bits/fn_det.hpp +++ b/inst/include/armadillo_bits/fn_det.hpp @@ -27,7 +27,7 @@ inline typename enable_if2< is_supported_blas_type::value, typename T1::elem_type >::result det(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -51,7 +51,7 @@ inline typename enable_if2< is_supported_blas_type::value, bool >::result det(typename T1::elem_type& out_val, const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -60,7 +60,7 @@ det(typename T1::elem_type& out_val, const Base& X) if(status == false) { out_val = eT(0); - arma_debug_warn_level(3, "det(): failed to find determinant"); + arma_conform_warn(3, "det(): failed to find determinant"); } return status; diff --git a/inst/include/armadillo_bits/fn_diagmat.hpp b/inst/include/armadillo_bits/fn_diagmat.hpp index 7d6c5b0d..1d8ce09b 100644 --- a/inst/include/armadillo_bits/fn_diagmat.hpp +++ b/inst/include/armadillo_bits/fn_diagmat.hpp @@ -32,7 +32,7 @@ enable_if2 >::result diagmat(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X); } @@ -51,7 +51,7 @@ enable_if2 >::result diagmat(const T1& X, const sword k) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword row_offset = (k < 0) ? uword(-k) : uword(0); const uword col_offset = (k > 0) ? uword( k) : uword(0); @@ -67,7 +67,7 @@ inline const SpOp diagmat(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpOp(X.get_ref()); } @@ -80,7 +80,7 @@ inline const SpOp diagmat(const SpBase& X, const sword k) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword row_offset = (k < 0) ? uword(-k) : uword(0); const uword col_offset = (k > 0) ? uword( k) : uword(0); diff --git a/inst/include/armadillo_bits/fn_diags_spdiags.hpp b/inst/include/armadillo_bits/fn_diags_spdiags.hpp index ceb8fd0f..36b94e85 100644 --- a/inst/include/armadillo_bits/fn_diags_spdiags.hpp +++ b/inst/include/armadillo_bits/fn_diags_spdiags.hpp @@ -26,7 +26,7 @@ inline Mat diags(const Base& V_expr, const Base& D_expr, const uword n_rows, const uword n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -36,9 +36,9 @@ diags(const Base& V_expr, const Base& D_ex const quasi_unwrap UD(D_expr.get_ref()); const Mat& D = UD.M; - arma_debug_check( ((D.is_vec() == false) && (D.is_empty() == false)), "D must be a vector" ); + arma_conform_check( ((D.is_vec() == false) && (D.is_empty() == false)), "D must be a vector" ); - arma_debug_check( (V.n_cols != D.n_elem), "number of colums in matrix V must match the length of vector D" ); + arma_conform_check( (V.n_cols != D.n_elem), "number of colums in matrix V must match the length of vector D" ); Mat out(n_rows, n_cols, fill::zeros); @@ -49,7 +49,7 @@ diags(const Base& V_expr, const Base& D_ex const uword row_offset = (diag_id < 0) ? uword(-diag_id) : 0; const uword col_offset = (diag_id > 0) ? uword( diag_id) : 0; - arma_debug_check_bounds + arma_conform_check_bounds ( ((row_offset > 0) && (row_offset >= n_rows)) || ((col_offset > 0) && (col_offset >= n_cols)), "diags(): requested diagonal out of bounds" @@ -81,7 +81,7 @@ inline SpMat spdiags(const Base& V_expr, const Base& D_expr, const uword n_rows, const uword n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -91,9 +91,9 @@ spdiags(const Base& V_expr, const Base& D_ const quasi_unwrap UD(D_expr.get_ref()); const Mat& D = UD.M; - arma_debug_check( ((D.is_vec() == false) && (D.is_empty() == false)), "D must be a vector" ); + arma_conform_check( ((D.is_vec() == false) && (D.is_empty() == false)), "D must be a vector" ); - arma_debug_check( (V.n_cols != D.n_elem), "number of colums in matrix V must match the length of vector D" ); + arma_conform_check( (V.n_cols != D.n_elem), "number of colums in matrix V must match the length of vector D" ); MapMat tmp(n_rows, n_cols); @@ -104,7 +104,7 @@ spdiags(const Base& V_expr, const Base& D_ const uword row_offset = (diag_id < 0) ? uword(-diag_id) : 0; const uword col_offset = (diag_id > 0) ? uword( diag_id) : 0; - arma_debug_check_bounds + arma_conform_check_bounds ( ((row_offset > 0) && (row_offset >= n_rows)) || ((col_offset > 0) && (col_offset >= n_cols)), "diags(): requested diagonal out of bounds" diff --git a/inst/include/armadillo_bits/fn_diagvec.hpp b/inst/include/armadillo_bits/fn_diagvec.hpp index 873c3506..a96a8200 100644 --- a/inst/include/armadillo_bits/fn_diagvec.hpp +++ b/inst/include/armadillo_bits/fn_diagvec.hpp @@ -27,7 +27,7 @@ arma_inline const Op diagvec(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X.get_ref()); } @@ -41,7 +41,7 @@ arma_inline const Op diagvec(const Base& X, const sword diag_id) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X.get_ref(), ((diag_id < 0) ? -diag_id : diag_id), ((diag_id < 0) ? 1 : 0) ); } @@ -51,12 +51,12 @@ diagvec(const Base& X, const sword diag_id) template arma_warn_unused arma_inline -const SpOp +const SpToDOp diagvec(const SpBase& X, const sword diag_id = 0) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - return SpOp(X.get_ref(), ((diag_id < 0) ? -diag_id : diag_id), ((diag_id < 0) ? 1 : 0) ); + return SpToDOp(X.get_ref(), ((diag_id < 0) ? -diag_id : diag_id), ((diag_id < 0) ? 1 : 0) ); } diff --git a/inst/include/armadillo_bits/fn_diff.hpp b/inst/include/armadillo_bits/fn_diff.hpp index 2d7e8d3a..9c538363 100644 --- a/inst/include/armadillo_bits/fn_diff.hpp +++ b/inst/include/armadillo_bits/fn_diff.hpp @@ -36,7 +36,7 @@ diff const uword k = 1 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, k, 0); } @@ -58,7 +58,7 @@ diff const uword k = 1 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, k, 0); } @@ -81,7 +81,7 @@ diff const uword dim ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, k, dim); } diff --git a/inst/include/armadillo_bits/fn_dot.hpp b/inst/include/armadillo_bits/fn_dot.hpp index 55bd05d4..a9c26ca5 100644 --- a/inst/include/armadillo_bits/fn_dot.hpp +++ b/inst/include/armadillo_bits/fn_dot.hpp @@ -35,7 +35,7 @@ dot const T2& B ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return op_dot::apply(A,B); } @@ -57,7 +57,7 @@ dot const T2& B ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return op_dot_mixed::apply(A,B); } @@ -79,7 +79,7 @@ norm_dot const T2& B ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return op_norm_dot::apply(A,B); } @@ -106,7 +106,7 @@ cdot const T2& B ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return op_dot::apply(A,B); } @@ -129,7 +129,7 @@ cdot const T2& B ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return op_cdot::apply(A,B); } @@ -153,7 +153,7 @@ dot const T2& B ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return cdot(A.m, B); } @@ -230,12 +230,12 @@ dot const T2& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy pa(x); const SpProxy pb(y); - arma_debug_assert_same_size(pa.get_n_rows(), pa.get_n_cols(), pb.get_n_rows(), pb.get_n_cols(), "dot()"); + arma_conform_assert_same_size(pa.get_n_rows(), pa.get_n_cols(), pb.get_n_rows(), pb.get_n_cols(), "dot()"); typedef typename T1::elem_type eT; @@ -287,7 +287,7 @@ dot const T2& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -299,11 +299,11 @@ dot if(yy.n_rows == yy.m.n_rows) { - arma_extra_debug_print("using sparse column vector specialisation"); + arma_debug_print("using sparse column vector specialisation"); const quasi_unwrap U(x); - arma_debug_assert_same_size(U.M.n_elem, uword(1), yy.n_elem, uword(1), "dot()"); + arma_conform_assert_same_size(U.M.n_elem, uword(1), yy.n_elem, uword(1), "dot()"); yy.m.sync(); @@ -314,7 +314,7 @@ dot const Proxy pa(x); const SpProxy pb(y); - arma_debug_assert_same_size(pa.get_n_rows(), pa.get_n_cols(), pb.get_n_rows(), pb.get_n_cols(), "dot()"); + arma_conform_assert_same_size(pa.get_n_rows(), pa.get_n_cols(), pb.get_n_rows(), pb.get_n_cols(), "dot()"); eT result = eT(0); @@ -349,7 +349,7 @@ dot const T2& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // this is commutative return dot(y, x); diff --git a/inst/include/armadillo_bits/fn_eig_gen.hpp b/inst/include/armadillo_bits/fn_eig_gen.hpp index ad228217..23bdeb83 100644 --- a/inst/include/armadillo_bits/fn_eig_gen.hpp +++ b/inst/include/armadillo_bits/fn_eig_gen.hpp @@ -30,16 +30,16 @@ eig_gen const char* option = "nobalance" ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; typedef typename std::complex eT; const char sig = (option != nullptr) ? option[0] : char(0); - arma_debug_check( ((sig != 'n') && (sig != 'b')), "eig_gen(): unknown option" ); + arma_conform_check( ((sig != 'n') && (sig != 'b')), "eig_gen(): unknown option" ); - if( auxlib::crippled_lapack(expr) && (sig == 'b') ) { arma_debug_warn_level(1, "eig_gen(): 'balance' option ignored due to linking with crippled lapack"); } + if( auxlib::crippled_lapack(expr) && (sig == 'b') ) { arma_conform_warn(1, "eig_gen(): 'balance' option ignored due to linking with crippled lapack"); } Col eigvals; Mat eigvecs; @@ -67,16 +67,16 @@ eig_gen const char* option = "nobalance" ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; typedef typename std::complex eT; const char sig = (option != nullptr) ? option[0] : char(0); - arma_debug_check( ((sig != 'n') && (sig != 'b')), "eig_gen(): unknown option" ); + arma_conform_check( ((sig != 'n') && (sig != 'b')), "eig_gen(): unknown option" ); - if( auxlib::crippled_lapack(expr) && (sig == 'b') ) { arma_debug_warn_level(1, "eig_gen(): 'balance' option ignored due to linking with crippled lapack"); } + if( auxlib::crippled_lapack(expr) && (sig == 'b') ) { arma_conform_warn(1, "eig_gen(): 'balance' option ignored due to linking with crippled lapack"); } Mat eigvecs; @@ -85,7 +85,7 @@ eig_gen if(status == false) { eigvals.soft_reset(); - arma_debug_warn_level(3, "eig_gen(): decomposition failed"); + arma_conform_warn(3, "eig_gen(): decomposition failed"); } return status; @@ -104,15 +104,15 @@ eig_gen const char* option = "nobalance" ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (void_ptr(&eigvals) == void_ptr(&eigvecs)), "eig_gen(): parameter 'eigval' is an alias of parameter 'eigvec'" ); + arma_conform_check( (void_ptr(&eigvals) == void_ptr(&eigvecs)), "eig_gen(): parameter 'eigval' is an alias of parameter 'eigvec'" ); const char sig = (option != nullptr) ? option[0] : char(0); - arma_debug_check( ((sig != 'n') && (sig != 'b')), "eig_gen(): unknown option" ); + arma_conform_check( ((sig != 'n') && (sig != 'b')), "eig_gen(): unknown option" ); - if( auxlib::crippled_lapack(expr) && (sig == 'b') ) { arma_debug_warn_level(1, "eig_gen(): 'balance' option ignored due to linking with crippled lapack"); } + if( auxlib::crippled_lapack(expr) && (sig == 'b') ) { arma_conform_warn(1, "eig_gen(): 'balance' option ignored due to linking with crippled lapack"); } const bool status = (sig == 'b') ? auxlib::eig_gen_balance(eigvals, eigvecs, true, expr.get_ref()) : auxlib::eig_gen(eigvals, eigvecs, true, expr.get_ref()); @@ -120,7 +120,7 @@ eig_gen { eigvals.soft_reset(); eigvecs.soft_reset(); - arma_debug_warn_level(3, "eig_gen(): decomposition failed"); + arma_conform_warn(3, "eig_gen(): decomposition failed"); } return status; @@ -140,17 +140,17 @@ eig_gen const char* option = "nobalance" ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (void_ptr(&eigvals) == void_ptr(&leigvecs)), "eig_gen(): parameter 'eigval' is an alias of parameter 'leigvec'" ); - arma_debug_check( (void_ptr(&eigvals) == void_ptr(&reigvecs)), "eig_gen(): parameter 'eigval' is an alias of parameter 'reigvec'" ); - arma_debug_check( (void_ptr(&leigvecs) == void_ptr(&reigvecs)), "eig_gen(): parameter 'leigvec' is an alias of parameter 'reigvec'" ); + arma_conform_check( (void_ptr(&eigvals) == void_ptr(&leigvecs)), "eig_gen(): parameter 'eigval' is an alias of parameter 'leigvec'" ); + arma_conform_check( (void_ptr(&eigvals) == void_ptr(&reigvecs)), "eig_gen(): parameter 'eigval' is an alias of parameter 'reigvec'" ); + arma_conform_check( (void_ptr(&leigvecs) == void_ptr(&reigvecs)), "eig_gen(): parameter 'leigvec' is an alias of parameter 'reigvec'" ); const char sig = (option != nullptr) ? option[0] : char(0); - arma_debug_check( ((sig != 'n') && (sig != 'b')), "eig_gen(): unknown option" ); + arma_conform_check( ((sig != 'n') && (sig != 'b')), "eig_gen(): unknown option" ); - if( auxlib::crippled_lapack(expr) && (sig == 'b') ) { arma_debug_warn_level(1, "eig_gen(): 'balance' option ignored due to linking with crippled lapack"); } + if( auxlib::crippled_lapack(expr) && (sig == 'b') ) { arma_conform_warn(1, "eig_gen(): 'balance' option ignored due to linking with crippled lapack"); } const bool status = (sig == 'b') ? auxlib::eig_gen_twosided_balance(eigvals, leigvecs, reigvecs, expr.get_ref()) : auxlib::eig_gen_twosided(eigvals, leigvecs, reigvecs, expr.get_ref()); @@ -159,7 +159,7 @@ eig_gen eigvals.soft_reset(); leigvecs.soft_reset(); reigvecs.soft_reset(); - arma_debug_warn_level(3, "eig_gen(): decomposition failed"); + arma_conform_warn(3, "eig_gen(): decomposition failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_eig_pair.hpp b/inst/include/armadillo_bits/fn_eig_pair.hpp index cef13894..c3ed9866 100644 --- a/inst/include/armadillo_bits/fn_eig_pair.hpp +++ b/inst/include/armadillo_bits/fn_eig_pair.hpp @@ -30,7 +30,7 @@ eig_pair const Base& B_expr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; @@ -60,7 +60,7 @@ eig_pair const Base< typename T1::elem_type, T2 >& B_expr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; @@ -71,7 +71,7 @@ eig_pair if(status == false) { eigvals.soft_reset(); - arma_debug_warn_level(3, "eig_pair(): decomposition failed"); + arma_conform_warn(3, "eig_pair(): decomposition failed"); } return status; @@ -90,9 +90,9 @@ eig_pair const Base< typename T1::elem_type, T2 >& B_expr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (void_ptr(&eigvals) == void_ptr(&eigvecs)), "eig_pair(): parameter 'eigval' is an alias of parameter 'eigvec'" ); + arma_conform_check( (void_ptr(&eigvals) == void_ptr(&eigvecs)), "eig_pair(): parameter 'eigval' is an alias of parameter 'eigvec'" ); const bool status = auxlib::eig_pair(eigvals, eigvecs, true, A_expr.get_ref(), B_expr.get_ref()); @@ -100,7 +100,7 @@ eig_pair { eigvals.soft_reset(); eigvecs.soft_reset(); - arma_debug_warn_level(3, "eig_pair(): decomposition failed"); + arma_conform_warn(3, "eig_pair(): decomposition failed"); } return status; @@ -120,11 +120,11 @@ eig_pair const Base< typename T1::elem_type, T2 >& B_expr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (void_ptr(&eigvals) == void_ptr(&leigvecs)), "eig_pair(): parameter 'eigval' is an alias of parameter 'leigvec'" ); - arma_debug_check( (void_ptr(&eigvals) == void_ptr(&reigvecs)), "eig_pair(): parameter 'eigval' is an alias of parameter 'reigvec'" ); - arma_debug_check( (void_ptr(&leigvecs) == void_ptr(&reigvecs)), "eig_pair(): parameter 'leigvec' is an alias of parameter 'reigvec'" ); + arma_conform_check( (void_ptr(&eigvals) == void_ptr(&leigvecs)), "eig_pair(): parameter 'eigval' is an alias of parameter 'leigvec'" ); + arma_conform_check( (void_ptr(&eigvals) == void_ptr(&reigvecs)), "eig_pair(): parameter 'eigval' is an alias of parameter 'reigvec'" ); + arma_conform_check( (void_ptr(&leigvecs) == void_ptr(&reigvecs)), "eig_pair(): parameter 'leigvec' is an alias of parameter 'reigvec'" ); const bool status = auxlib::eig_pair_twosided(eigvals, leigvecs, reigvecs, A_expr.get_ref(), B_expr.get_ref()); @@ -133,7 +133,7 @@ eig_pair eigvals.soft_reset(); leigvecs.soft_reset(); reigvecs.soft_reset(); - arma_debug_warn_level(3, "eig_pair(): decomposition failed"); + arma_conform_warn(3, "eig_pair(): decomposition failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_eig_sym.hpp b/inst/include/armadillo_bits/fn_eig_sym.hpp index 12043b6f..5061cf54 100644 --- a/inst/include/armadillo_bits/fn_eig_sym.hpp +++ b/inst/include/armadillo_bits/fn_eig_sym.hpp @@ -30,7 +30,7 @@ eig_sym const Base& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -41,7 +41,7 @@ eig_sym if(status == false) { eigval.soft_reset(); - arma_debug_warn_level(3, "eig_sym(): decomposition failed"); + arma_conform_warn(3, "eig_sym(): decomposition failed"); } return status; @@ -59,7 +59,7 @@ eig_sym const Base& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; @@ -93,12 +93,12 @@ eig_sym_helper const char* caller_sig ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - if((arma_config::debug) && (auxlib::rudimentary_sym_check(X) == false)) + if((arma_config::check_conformance) && (auxlib::rudimentary_sym_check(X) == false)) { - if(is_cx::no ) { arma_debug_warn_level(1, caller_sig, ": given matrix is not symmetric"); } - if(is_cx::yes) { arma_debug_warn_level(1, caller_sig, ": given matrix is not hermitian"); } + if(is_cx::no ) { arma_conform_warn(1, caller_sig, ": given matrix is not symmetric"); } + if(is_cx::yes) { arma_conform_warn(1, caller_sig, ": given matrix is not hermitian"); } } bool status = false; @@ -124,14 +124,14 @@ eig_sym const char* method = "dc" ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const char sig = (method != nullptr) ? method[0] : char(0); - arma_debug_check( ((sig != 's') && (sig != 'd')), "eig_sym(): unknown method specified" ); - arma_debug_check( void_ptr(&eigval) == void_ptr(&eigvec), "eig_sym(): parameter 'eigval' is an alias of parameter 'eigvec'" ); + arma_conform_check( ((sig != 's') && (sig != 'd')), "eig_sym(): unknown method specified" ); + arma_conform_check( void_ptr(&eigval) == void_ptr(&eigvec), "eig_sym(): parameter 'eigval' is an alias of parameter 'eigvec'" ); const quasi_unwrap U(expr.get_ref()); @@ -146,7 +146,7 @@ eig_sym { eigval.soft_reset(); eigvec.soft_reset(); - arma_debug_warn_level(3, "eig_sym(): decomposition failed"); + arma_conform_warn(3, "eig_sym(): decomposition failed"); } else { diff --git a/inst/include/armadillo_bits/fn_eigs_gen.hpp b/inst/include/armadillo_bits/fn_eigs_gen.hpp index 6f1a617c..4b22abce 100644 --- a/inst/include/armadillo_bits/fn_eigs_gen.hpp +++ b/inst/include/armadillo_bits/fn_eigs_gen.hpp @@ -33,7 +33,7 @@ eigs_gen const eigs_opts opts = eigs_opts() ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; @@ -68,7 +68,7 @@ eigs_gen const typename T1::pod_type tol ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eigs_opts opts; opts.tol = tol; @@ -90,7 +90,7 @@ eigs_gen const eigs_opts opts = eigs_opts() ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; @@ -133,7 +133,7 @@ eigs_gen const eigs_opts opts = eigs_opts() ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; @@ -166,7 +166,7 @@ eigs_gen const eigs_opts opts = eigs_opts() ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; @@ -179,7 +179,7 @@ eigs_gen if(status == false) { eigval.soft_reset(); - arma_debug_warn_level(3, "eigs_gen(): decomposition failed"); + arma_conform_warn(3, "eigs_gen(): decomposition failed"); } return status; @@ -201,7 +201,7 @@ eigs_gen const typename T1::pod_type tol ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eigs_opts opts; opts.tol = tol; @@ -223,7 +223,7 @@ eigs_gen const eigs_opts opts = eigs_opts() ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; @@ -245,7 +245,7 @@ eigs_gen if(status == false) { eigval.soft_reset(); - arma_debug_warn_level(3, "eigs_gen(): decomposition failed"); + arma_conform_warn(3, "eigs_gen(): decomposition failed"); } return status; @@ -265,7 +265,7 @@ eigs_gen const eigs_opts opts = eigs_opts() ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; @@ -276,7 +276,7 @@ eigs_gen if(status == false) { eigval.soft_reset(); - arma_debug_warn_level(3, "eigs_gen(): decomposition failed"); + arma_conform_warn(3, "eigs_gen(): decomposition failed"); } return status; @@ -298,11 +298,11 @@ eigs_gen const eigs_opts opts = eigs_opts() ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // typedef typename T1::pod_type T; - arma_debug_check( void_ptr(&eigval) == void_ptr(&eigvec), "eigs_gen(): parameter 'eigval' is an alias of parameter 'eigvec'" ); + arma_conform_check( void_ptr(&eigval) == void_ptr(&eigvec), "eigs_gen(): parameter 'eigval' is an alias of parameter 'eigvec'" ); sp_auxlib::form_type form_val = sp_auxlib::interpret_form_str(form); @@ -312,7 +312,7 @@ eigs_gen { eigval.soft_reset(); eigvec.soft_reset(); - arma_debug_warn_level(3, "eigs_gen(): decomposition failed"); + arma_conform_warn(3, "eigs_gen(): decomposition failed"); } return status; @@ -335,7 +335,7 @@ eigs_gen const typename T1::pod_type tol ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eigs_opts opts; opts.tol = tol; @@ -358,11 +358,11 @@ eigs_gen const eigs_opts opts = eigs_opts() ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; - arma_debug_check( void_ptr(&eigval) == void_ptr(&eigvec), "eigs_gen(): parameter 'eigval' is an alias of parameter 'eigvec'" ); + arma_conform_check( void_ptr(&eigval) == void_ptr(&eigvec), "eigs_gen(): parameter 'eigval' is an alias of parameter 'eigvec'" ); bool status = false; @@ -381,7 +381,7 @@ eigs_gen { eigval.soft_reset(); eigvec.soft_reset(); - arma_debug_warn_level(3, "eigs_gen(): decomposition failed"); + arma_conform_warn(3, "eigs_gen(): decomposition failed"); } return status; @@ -402,11 +402,11 @@ eigs_gen const eigs_opts opts = eigs_opts() ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; - arma_debug_check( void_ptr(&eigval) == void_ptr(&eigvec), "eigs_gen(): parameter 'eigval' is an alias of parameter 'eigvec'" ); + arma_conform_check( void_ptr(&eigval) == void_ptr(&eigvec), "eigs_gen(): parameter 'eigval' is an alias of parameter 'eigvec'" ); const bool status = sp_auxlib::eigs_gen(eigval, eigvec, X, n_eigvals, std::complex(T(sigma)), opts); @@ -414,7 +414,7 @@ eigs_gen { eigval.soft_reset(); eigvec.soft_reset(); - arma_debug_warn_level(3, "eigs_gen(): decomposition failed"); + arma_conform_warn(3, "eigs_gen(): decomposition failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_eigs_sym.hpp b/inst/include/armadillo_bits/fn_eigs_sym.hpp index 935aab92..e3f4d5c6 100644 --- a/inst/include/armadillo_bits/fn_eigs_sym.hpp +++ b/inst/include/armadillo_bits/fn_eigs_sym.hpp @@ -33,7 +33,7 @@ eigs_sym const eigs_opts opts = eigs_opts() ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat eigvec; Col eigval; @@ -66,7 +66,7 @@ eigs_sym const typename T1::elem_type tol ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eigs_opts opts; opts.tol = tol; @@ -88,7 +88,7 @@ eigs_sym const eigs_opts opts = eigs_opts() ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; @@ -121,7 +121,7 @@ eigs_sym const eigs_opts opts = eigs_opts() ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat eigvec; @@ -132,7 +132,7 @@ eigs_sym if(status == false) { eigval.soft_reset(); - arma_debug_warn_level(3, "eigs_sym(): decomposition failed"); + arma_conform_warn(3, "eigs_sym(): decomposition failed"); } return status; @@ -154,7 +154,7 @@ eigs_sym const typename T1::elem_type tol ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eigs_opts opts; opts.tol = tol; @@ -176,7 +176,7 @@ eigs_sym const eigs_opts opts = eigs_opts() ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; @@ -187,7 +187,7 @@ eigs_sym if(status == false) { eigval.soft_reset(); - arma_debug_warn_level(3, "eigs_sym(): decomposition failed"); + arma_conform_warn(3, "eigs_sym(): decomposition failed"); } return status; @@ -209,9 +209,9 @@ eigs_sym const eigs_opts opts = eigs_opts() ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( void_ptr(&eigval) == void_ptr(&eigvec), "eigs_sym(): parameter 'eigval' is an alias of parameter 'eigvec'" ); + arma_conform_check( void_ptr(&eigval) == void_ptr(&eigvec), "eigs_sym(): parameter 'eigval' is an alias of parameter 'eigvec'" ); sp_auxlib::form_type form_val = sp_auxlib::interpret_form_str(form); @@ -221,7 +221,7 @@ eigs_sym { eigval.soft_reset(); eigvec.soft_reset(); - arma_debug_warn_level(3, "eigs_sym(): decomposition failed"); + arma_conform_warn(3, "eigs_sym(): decomposition failed"); } return status; @@ -244,7 +244,7 @@ eigs_sym const typename T1::elem_type tol ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eigs_opts opts; opts.tol = tol; @@ -267,11 +267,11 @@ eigs_sym const eigs_opts opts = eigs_opts() ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; - arma_debug_check( void_ptr(&eigval) == void_ptr(&eigvec), "eigs_sym(): parameter 'eigval' is an alias of parameter 'eigvec'" ); + arma_conform_check( void_ptr(&eigval) == void_ptr(&eigvec), "eigs_sym(): parameter 'eigval' is an alias of parameter 'eigvec'" ); const bool status = sp_auxlib::eigs_sym(eigval, eigvec, X, n_eigvals, T(sigma), opts); @@ -279,7 +279,7 @@ eigs_sym { eigval.soft_reset(); eigvec.soft_reset(); - arma_debug_warn_level(3, "eigs_sym(): decomposition failed"); + arma_conform_warn(3, "eigs_sym(): decomposition failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_elem.hpp b/inst/include/armadillo_bits/fn_elem.hpp index f00f4fdb..0a9649f6 100644 --- a/inst/include/armadillo_bits/fn_elem.hpp +++ b/inst/include/armadillo_bits/fn_elem.hpp @@ -29,7 +29,7 @@ arma_inline typename enable_if2< (is_arma_type::value && is_cx::no), const T1& >::result real(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return X; } @@ -42,7 +42,7 @@ arma_inline const T1& real(const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return X.get_ref(); } @@ -55,7 +55,7 @@ arma_inline const T1& real(const SpBase& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return A.get_ref(); } @@ -68,7 +68,7 @@ inline typename enable_if2< (is_arma_type::value && is_cx::yes), const mtOp >::result real(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp( X ); } @@ -81,7 +81,7 @@ inline const mtOpCube real(const BaseCube, T1>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOpCube( X.get_ref() ); } @@ -94,7 +94,7 @@ arma_inline const mtSpOp real(const SpBase,T1>& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtSpOp(A.get_ref()); } @@ -110,7 +110,7 @@ inline const Gen< Mat, gen_zeros > imag(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Proxy A(X.get_ref()); @@ -125,7 +125,7 @@ inline const GenCube imag(const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const ProxyCube A(X.get_ref()); @@ -140,7 +140,7 @@ inline SpMat imag(const SpBase& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy P(A.get_ref()); @@ -155,7 +155,7 @@ inline typename enable_if2< (is_arma_type::value && is_cx::yes), const mtOp >::result imag(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp( X ); } @@ -168,7 +168,7 @@ inline const mtOpCube imag(const BaseCube,T1>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOpCube( X.get_ref() ); } @@ -181,7 +181,7 @@ arma_inline const mtSpOp imag(const SpBase,T1>& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtSpOp(A.get_ref()); } @@ -197,7 +197,7 @@ arma_inline typename enable_if2< is_arma_type::value, const eOp >::result log(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -210,7 +210,7 @@ arma_inline const eOpCube log(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -226,7 +226,7 @@ arma_inline typename enable_if2< is_arma_type::value, const eOp >::result log2(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -239,7 +239,7 @@ arma_inline const eOpCube log2(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -255,7 +255,7 @@ arma_inline typename enable_if2< is_arma_type::value, const eOp >::result log10(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -268,7 +268,7 @@ arma_inline const eOpCube log10(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -284,7 +284,7 @@ arma_inline typename enable_if2< (is_arma_type::value && is_cx::no), const eOp >::result log1p(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -297,7 +297,7 @@ arma_inline typename enable_if2< is_cx::no, const eOpCube >::result log1p(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -313,7 +313,7 @@ arma_inline typename enable_if2< is_arma_type::value, const eOp >::result exp(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -326,7 +326,7 @@ arma_inline const eOpCube exp(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -341,7 +341,7 @@ arma_inline typename enable_if2< is_arma_type::value, const eOp >::result exp2(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -354,7 +354,7 @@ arma_inline const eOpCube exp2(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -369,7 +369,7 @@ arma_inline typename enable_if2< is_arma_type::value, const eOp >::result exp10(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -382,7 +382,7 @@ arma_inline const eOpCube exp10(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -397,7 +397,7 @@ arma_inline typename enable_if2< (is_arma_type::value && is_cx::no), const eOp >::result expm1(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -410,7 +410,7 @@ arma_inline typename enable_if2< is_cx::no, const eOpCube >::result expm1(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -427,7 +427,7 @@ arma_inline typename enable_if2< (is_arma_type::value && is_cx::no), const eOp >::result abs(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(X); } @@ -440,7 +440,7 @@ arma_inline const eOpCube abs(const BaseCube& X, const typename arma_not_cx::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); @@ -455,7 +455,7 @@ inline typename enable_if2< (is_arma_type::value && is_cx::yes), const mtOp >::result abs(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X); } @@ -468,7 +468,7 @@ inline const mtOpCube abs(const BaseCube< std::complex,T1>& X, const typename arma_cx_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); @@ -483,7 +483,7 @@ arma_inline const SpOp abs(const SpBase& X, const typename arma_not_cx::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return SpOp(X.get_ref()); @@ -497,7 +497,7 @@ arma_inline const mtSpOp abs(const SpBase< std::complex, T1>& X, const typename arma_cx_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return mtSpOp(X.get_ref()); @@ -515,7 +515,7 @@ arma_inline typename enable_if2< (is_arma_type::value && is_cx::no), const eOp >::result arg(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(X); } @@ -528,7 +528,7 @@ arma_inline const eOpCube arg(const BaseCube& X, const typename arma_not_cx::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); @@ -543,7 +543,7 @@ inline typename enable_if2< (is_arma_type::value && is_cx::yes), const mtOp >::result arg(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X); } @@ -556,7 +556,7 @@ inline const mtOpCube arg(const BaseCube< std::complex,T1>& X, const typename arma_cx_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); @@ -571,7 +571,7 @@ arma_inline const SpOp arg(const SpBase& X, const typename arma_not_cx::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return SpOp(X.get_ref()); @@ -585,7 +585,7 @@ arma_inline const mtSpOp arg(const SpBase< std::complex, T1>& X, const typename arma_cx_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return mtSpOp(X.get_ref()); @@ -602,7 +602,7 @@ arma_inline typename enable_if2< is_arma_type::value, const eOp >::result square(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -615,7 +615,7 @@ arma_inline const eOpCube square(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -628,7 +628,7 @@ arma_inline const SpOp square(const SpBase& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpOp(A.get_ref()); } @@ -644,7 +644,7 @@ arma_inline typename enable_if2< is_arma_type::value, const eOp >::result sqrt(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -657,7 +657,7 @@ arma_inline const eOpCube sqrt(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -670,7 +670,7 @@ arma_inline const SpOp sqrt(const SpBase& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpOp(A.get_ref()); } @@ -686,7 +686,7 @@ arma_inline typename enable_if2< (is_arma_type::value && is_cx::no), const eOp >::result cbrt(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -699,7 +699,7 @@ arma_inline typename enable_if2< is_cx::no, const eOpCube >::result cbrt(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -712,7 +712,7 @@ arma_inline typename enable_if2< is_cx::no, const SpOp >::result cbrt(const SpBase& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpOp(A.get_ref()); } @@ -728,7 +728,7 @@ arma_inline const T1& conj(const Base& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return A.get_ref(); } @@ -741,7 +741,7 @@ arma_inline const T1& conj(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return A.get_ref(); } @@ -754,7 +754,7 @@ arma_inline const T1& conj(const SpBase& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return A.get_ref(); } @@ -767,7 +767,7 @@ arma_inline const eOp conj(const Base,T1>& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A.get_ref()); } @@ -780,7 +780,7 @@ arma_inline const eOpCube conj(const BaseCube,T1>& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -793,7 +793,7 @@ arma_inline const SpOp conj(const SpBase,T1>& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpOp(A.get_ref()); } @@ -808,7 +808,7 @@ arma_inline const eOp pow(const Base& A, const typename T1::elem_type exponent) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A.get_ref(), exponent); } @@ -821,7 +821,7 @@ arma_inline const eOpCube pow(const BaseCube& A, const typename T1::elem_type exponent) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref(), exponent); } @@ -836,7 +836,7 @@ arma_inline const eOp pow(const Base& A, const typename T1::elem_type::value_type exponent) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -851,7 +851,7 @@ arma_inline const eOpCube pow(const BaseCube& A, const typename T1::elem_type::value_type exponent) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -869,7 +869,7 @@ arma_inline typename enable_if2< is_arma_type::value, const eOp >::result floor(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -882,7 +882,7 @@ arma_inline const eOpCube floor(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -895,7 +895,7 @@ arma_inline const SpOp floor(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpOp(X.get_ref()); } @@ -911,7 +911,7 @@ arma_inline typename enable_if2< is_arma_type::value, const eOp >::result ceil(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -924,7 +924,7 @@ arma_inline const eOpCube ceil(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -937,7 +937,7 @@ arma_inline const SpOp ceil(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpOp(X.get_ref()); } @@ -953,7 +953,7 @@ arma_inline typename enable_if2< is_arma_type::value, const eOp >::result round(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -966,7 +966,7 @@ arma_inline const eOpCube round(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -979,7 +979,7 @@ arma_inline const SpOp round(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpOp(X.get_ref()); } @@ -995,7 +995,7 @@ arma_inline typename enable_if2< is_arma_type::value, const eOp >::result trunc(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -1008,7 +1008,7 @@ arma_inline const eOpCube trunc(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -1021,7 +1021,7 @@ arma_inline const SpOp trunc(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpOp(X.get_ref()); } @@ -1037,7 +1037,7 @@ arma_inline typename arma_scalar_only::result sign(const eT x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return arma_sign(x); } @@ -1050,7 +1050,7 @@ arma_inline typename enable_if2< is_arma_type::value, const eOp >::result sign(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -1063,7 +1063,7 @@ arma_inline const eOpCube sign(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -1076,7 +1076,7 @@ arma_inline const SpOp sign(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpOp(X.get_ref()); } @@ -1092,7 +1092,7 @@ arma_inline typename enable_if2< (is_arma_type::value && is_cx::no), const eOp >::result erf(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -1105,7 +1105,7 @@ arma_inline typename enable_if2< is_cx::no, const eOpCube >::result erf(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -1121,7 +1121,7 @@ arma_inline typename enable_if2< (is_arma_type::value && is_cx::no), const eOp >::result erfc(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -1134,7 +1134,7 @@ arma_inline typename enable_if2< is_cx::no, const eOpCube >::result erfc(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -1150,7 +1150,7 @@ arma_inline typename enable_if2< (is_arma_type::value && is_cx::no), const eOp >::result lgamma(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -1163,7 +1163,7 @@ arma_inline typename enable_if2< is_cx::no, const eOpCube >::result lgamma(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -1179,7 +1179,7 @@ arma_inline typename enable_if2< (is_arma_type::value && is_cx::no), const eOp >::result tgamma(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -1192,7 +1192,7 @@ arma_inline typename enable_if2< is_cx::no, const eOpCube >::result tgamma(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } diff --git a/inst/include/armadillo_bits/fn_eps.hpp b/inst/include/armadillo_bits/fn_eps.hpp index f68ba5d4..09bd034b 100644 --- a/inst/include/armadillo_bits/fn_eps.hpp +++ b/inst/include/armadillo_bits/fn_eps.hpp @@ -28,7 +28,7 @@ inline const eOp eps(const Base& X, const typename arma_not_cx::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return eOp(X.get_ref()); @@ -42,7 +42,7 @@ inline Mat< typename T1::pod_type > eps(const Base< std::complex, T1>& X, const typename arma_cx_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::pod_type T; diff --git a/inst/include/armadillo_bits/fn_expmat.hpp b/inst/include/armadillo_bits/fn_expmat.hpp index 5e5909b8..62babb2f 100644 --- a/inst/include/armadillo_bits/fn_expmat.hpp +++ b/inst/include/armadillo_bits/fn_expmat.hpp @@ -31,7 +31,7 @@ enable_if2 >::result expmat(const Base& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(A.get_ref()); } @@ -48,14 +48,14 @@ enable_if2 >::result expmat(Mat& B, const Base& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_expmat::apply_direct(B, A); if(status == false) { B.soft_reset(); - arma_debug_warn_level(3, "expmat(): given matrix appears ill-conditioned"); + arma_conform_warn(3, "expmat(): given matrix appears ill-conditioned"); } return status; @@ -73,7 +73,7 @@ arma_inline typename enable_if2< is_supported_blas_type::value, const Op >::result expmat_sym(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X.get_ref()); } @@ -85,14 +85,14 @@ inline typename enable_if2< is_supported_blas_type::value, bool >::result expmat_sym(Mat& Y, const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_expmat_sym::apply_direct(Y, X.get_ref()); if(status == false) { Y.soft_reset(); - arma_debug_warn_level(3, "expmat_sym(): transformation failed"); + arma_conform_warn(3, "expmat_sym(): transformation failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_eye.hpp b/inst/include/armadillo_bits/fn_eye.hpp index 4252ffaa..87f9ffef 100644 --- a/inst/include/armadillo_bits/fn_eye.hpp +++ b/inst/include/armadillo_bits/fn_eye.hpp @@ -26,7 +26,7 @@ arma_inline const Gen eye(const uword n_rows, const uword n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Gen(n_rows, n_cols); } @@ -38,7 +38,7 @@ arma_inline const Gen eye(const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Gen(s.n_rows, s.n_cols); } @@ -51,11 +51,11 @@ arma_inline const Gen eye(const uword n_rows, const uword n_cols, const typename arma_Mat_Col_Row_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); - if(is_Col::value) { arma_debug_check( (n_cols != 1), "eye(): incompatible size" ); } - if(is_Row::value) { arma_debug_check( (n_rows != 1), "eye(): incompatible size" ); } + if(is_Col::value) { arma_conform_check( (n_cols != 1), "eye(): incompatible size" ); } + if(is_Row::value) { arma_conform_check( (n_rows != 1), "eye(): incompatible size" ); } return Gen(n_rows, n_cols); } @@ -68,7 +68,7 @@ arma_inline const Gen eye(const SizeMat& s, const typename arma_Mat_Col_Row_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return eye(s.n_rows, s.n_cols); @@ -82,11 +82,11 @@ inline obj_type eye(const uword n_rows, const uword n_cols, const typename arma_SpMat_SpCol_SpRow_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); - if(is_SpCol::value) { arma_debug_check( (n_cols != 1), "eye(): incompatible size" ); } - if(is_SpRow::value) { arma_debug_check( (n_rows != 1), "eye(): incompatible size" ); } + if(is_SpCol::value) { arma_conform_check( (n_cols != 1), "eye(): incompatible size" ); } + if(is_SpRow::value) { arma_conform_check( (n_rows != 1), "eye(): incompatible size" ); } obj_type out; @@ -103,7 +103,7 @@ inline obj_type eye(const SizeMat& s, const typename arma_SpMat_SpCol_SpRow_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return eye(s.n_rows, s.n_cols); diff --git a/inst/include/armadillo_bits/fn_fft.hpp b/inst/include/armadillo_bits/fn_fft.hpp index d2d11fbf..16420f2a 100644 --- a/inst/include/armadillo_bits/fn_fft.hpp +++ b/inst/include/armadillo_bits/fn_fft.hpp @@ -36,7 +36,7 @@ enable_if2 >::result fft(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp, T1, op_fft_real>(A, uword(0), uword(1)); } @@ -54,7 +54,7 @@ enable_if2 >::result fft(const T1& A, const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp, T1, op_fft_real>(A, N, uword(0)); } @@ -72,7 +72,7 @@ enable_if2 >::result fft(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(A, uword(0), uword(1)); } @@ -90,7 +90,7 @@ enable_if2 >::result fft(const T1& A, const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(A, N, uword(0)); } @@ -108,7 +108,7 @@ enable_if2 >::result ifft(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(A, uword(0), uword(1)); } @@ -126,7 +126,7 @@ enable_if2 >::result ifft(const T1& A, const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(A, N, uword(0)); } diff --git a/inst/include/armadillo_bits/fn_fft2.hpp b/inst/include/armadillo_bits/fn_fft2.hpp index 51ea0daf..1927029d 100644 --- a/inst/include/armadillo_bits/fn_fft2.hpp +++ b/inst/include/armadillo_bits/fn_fft2.hpp @@ -36,7 +36,7 @@ enable_if2 >::result fft2(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // not exactly efficient, but "better-than-nothing" implementation @@ -65,7 +65,7 @@ enable_if2 >::result fft2(const T1& A, const uword n_rows, const uword n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -90,7 +90,7 @@ enable_if2 >::result ifft2(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // not exactly efficient, but "better-than-nothing" implementation @@ -119,7 +119,7 @@ enable_if2 >::result ifft2(const T1& A, const uword n_rows, const uword n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/fn_find.hpp b/inst/include/armadillo_bits/fn_find.hpp index 5efb254b..5d5d46be 100644 --- a/inst/include/armadillo_bits/fn_find.hpp +++ b/inst/include/armadillo_bits/fn_find.hpp @@ -32,7 +32,7 @@ enable_if2 >::result find(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X); } @@ -45,11 +45,11 @@ inline const mtOp find(const Base& X, const uword k, const char* direction = "first") { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const char sig = (direction != nullptr) ? direction[0] : char(0); - arma_debug_check + arma_conform_check ( ( (sig != 'f') && (sig != 'F') && (sig != 'l') && (sig != 'L') ), "find(): direction must be \"first\" or \"last\"" @@ -72,7 +72,7 @@ inline uvec find(const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -91,7 +91,7 @@ inline uvec find(const BaseCube& X, const uword k, const char* direction = "first") { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -110,7 +110,7 @@ inline uvec find(const mtOpCube& X, const uword k = 0, const char* direction = "first") { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -129,7 +129,7 @@ inline uvec find(const mtGlueCube& X, const uword k = 0, const char* direction = "first") { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -137,7 +137,7 @@ find(const mtGlueCube& X, const uword k = 0, const const unwrap_cube tmp1(X.A); const unwrap_cube tmp2(X.B); - arma_debug_assert_same_size( tmp1.M, tmp2.M, "relational operator" ); + arma_conform_assert_same_size( tmp1.M, tmp2.M, "relational operator" ); const Mat R1( const_cast< eT1* >(tmp1.M.memptr()), tmp1.M.n_elem, 1, false ); const Mat R2( const_cast< eT2* >(tmp2.M.memptr()), tmp2.M.n_elem, 1, false ); @@ -157,7 +157,7 @@ inline Col find(const SpBase& X, const uword k = 0) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy P(X.get_ref()); @@ -196,7 +196,7 @@ inline Col find(const SpBase& X, const uword k, const char* direction) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(X); arma_ignore(k); @@ -226,7 +226,7 @@ enable_if2 >::result find_finite(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X); } @@ -244,7 +244,7 @@ enable_if2 >::result find_nonfinite(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X); } @@ -262,7 +262,7 @@ enable_if2 >::result find_nan(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X); } @@ -279,7 +279,7 @@ inline uvec find_finite(const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -298,7 +298,7 @@ inline uvec find_nonfinite(const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -317,7 +317,7 @@ inline uvec find_nan(const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -340,7 +340,7 @@ inline Col find_finite(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy P(X.get_ref()); @@ -384,7 +384,7 @@ inline Col find_nonfinite(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy P(X.get_ref()); @@ -428,7 +428,7 @@ inline Col find_nan(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy P(X.get_ref()); diff --git a/inst/include/armadillo_bits/fn_find_unique.hpp b/inst/include/armadillo_bits/fn_find_unique.hpp index 4d90ca15..646b7b27 100644 --- a/inst/include/armadillo_bits/fn_find_unique.hpp +++ b/inst/include/armadillo_bits/fn_find_unique.hpp @@ -36,7 +36,7 @@ find_unique const bool ascending_indices = true ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X, ((ascending_indices) ? uword(1) : uword(0)), uword(0)); } @@ -53,7 +53,7 @@ find_unique const bool ascending_indices = true ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/fn_flip.hpp b/inst/include/armadillo_bits/fn_flip.hpp index 811a5e02..7b39a013 100644 --- a/inst/include/armadillo_bits/fn_flip.hpp +++ b/inst/include/armadillo_bits/fn_flip.hpp @@ -27,7 +27,7 @@ arma_inline typename enable_if2< is_arma_type::value, const Op >::result flipud(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X); } @@ -40,7 +40,7 @@ arma_inline typename enable_if2< is_arma_type::value, const Op >::result fliplr(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X); } @@ -53,7 +53,7 @@ arma_inline const SpOp flipud(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpOp(X.get_ref()); } @@ -66,7 +66,7 @@ arma_inline const SpOp fliplr(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpOp(X.get_ref()); } diff --git a/inst/include/armadillo_bits/fn_hess.hpp b/inst/include/armadillo_bits/fn_hess.hpp index adf31d69..aec91a01 100644 --- a/inst/include/armadillo_bits/fn_hess.hpp +++ b/inst/include/armadillo_bits/fn_hess.hpp @@ -30,7 +30,7 @@ hess const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; @@ -50,7 +50,7 @@ hess if(status == false) { H.soft_reset(); - arma_debug_warn_level(3, "hess(): decomposition failed"); + arma_conform_warn(3, "hess(): decomposition failed"); } return status; @@ -68,7 +68,7 @@ hess const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; @@ -108,10 +108,10 @@ hess const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); - arma_debug_check( void_ptr(&U) == void_ptr(&H), "hess(): 'U' is an alias of 'H'" ); + arma_conform_check( void_ptr(&U) == void_ptr(&H), "hess(): 'U' is an alias of 'H'" ); typedef typename T1::elem_type eT; @@ -163,7 +163,7 @@ hess { U.soft_reset(); H.soft_reset(); - arma_debug_warn_level(3, "hess(): decomposition failed"); + arma_conform_warn(3, "hess(): decomposition failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_hist.hpp b/inst/include/armadillo_bits/fn_hist.hpp index 018de947..1924d37c 100644 --- a/inst/include/armadillo_bits/fn_hist.hpp +++ b/inst/include/armadillo_bits/fn_hist.hpp @@ -31,7 +31,7 @@ enable_if2 >::result hist(const T1& A, const uword n_bins = 10) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(A, n_bins, 0); } @@ -49,7 +49,7 @@ enable_if2 >::result hist(const T1& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtGlue(X, Y); } @@ -67,7 +67,7 @@ enable_if2 >::result hist(const T1& X, const T2& Y, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtGlue(X, Y, dim); } diff --git a/inst/include/armadillo_bits/fn_histc.hpp b/inst/include/armadillo_bits/fn_histc.hpp index e99f8969..c5f81222 100644 --- a/inst/include/armadillo_bits/fn_histc.hpp +++ b/inst/include/armadillo_bits/fn_histc.hpp @@ -31,7 +31,7 @@ enable_if2 >::result histc(const T1& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtGlue(X, Y); } @@ -49,7 +49,7 @@ enable_if2 >::result histc(const T1& X, const T2& Y, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtGlue(X, Y, dim); } diff --git a/inst/include/armadillo_bits/fn_index_max.hpp b/inst/include/armadillo_bits/fn_index_max.hpp index aad33f84..86c12f54 100644 --- a/inst/include/armadillo_bits/fn_index_max.hpp +++ b/inst/include/armadillo_bits/fn_index_max.hpp @@ -26,7 +26,7 @@ inline typename enable_if2< is_arma_type::value && resolves_to_vector::yes, uword>::result index_max(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return X.index_max(); } @@ -39,7 +39,7 @@ arma_inline typename enable_if2< is_arma_type::value && resolves_to_vector::no, const mtOp >::result index_max(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X, 0, 0); } @@ -52,7 +52,7 @@ arma_inline typename enable_if2< is_arma_type::value, const mtOp >::result index_max(const T1& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X, dim, 0); } @@ -69,7 +69,7 @@ index_max const uword dim = 0 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOpCube(X.get_ref(), dim, 0, 0); } @@ -87,7 +87,7 @@ enable_if2 >::result index_max(const T1& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return x.index_max(); } @@ -105,7 +105,7 @@ enable_if2 >::result index_max(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat out; @@ -127,7 +127,7 @@ enable_if2 >::result index_max(const T1& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat out; diff --git a/inst/include/armadillo_bits/fn_index_min.hpp b/inst/include/armadillo_bits/fn_index_min.hpp index e1b3ce21..b8522250 100644 --- a/inst/include/armadillo_bits/fn_index_min.hpp +++ b/inst/include/armadillo_bits/fn_index_min.hpp @@ -26,7 +26,7 @@ inline typename enable_if2< is_arma_type::value && resolves_to_vector::yes, uword>::result index_min(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return X.index_min(); } @@ -39,7 +39,7 @@ arma_inline typename enable_if2< is_arma_type::value && resolves_to_vector::no, const mtOp >::result index_min(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X, 0, 0); } @@ -52,7 +52,7 @@ arma_inline typename enable_if2< is_arma_type::value, const mtOp >::result index_min(const T1& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X, dim, 0); } @@ -69,7 +69,7 @@ index_min const uword dim = 0 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOpCube(X.get_ref(), dim, 0, 0); } @@ -87,7 +87,7 @@ enable_if2 >::result index_min(const T1& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return x.index_min(); } @@ -105,7 +105,7 @@ enable_if2 >::result index_min(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat out; @@ -127,7 +127,7 @@ enable_if2 >::result index_min(const T1& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat out; diff --git a/inst/include/armadillo_bits/fn_inplace_strans.hpp b/inst/include/armadillo_bits/fn_inplace_strans.hpp index ad09cf26..22ead93b 100644 --- a/inst/include/armadillo_bits/fn_inplace_strans.hpp +++ b/inst/include/armadillo_bits/fn_inplace_strans.hpp @@ -30,11 +30,11 @@ inplace_strans const char* method = "std" ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const char sig = (method != nullptr) ? method[0] : char(0); - arma_debug_check( ((sig != 's') && (sig != 'l')), "inplace_strans(): unknown method specified" ); + arma_conform_check( ((sig != 's') && (sig != 'l')), "inplace_strans(): unknown method specified" ); const bool low_memory = (sig == 'l'); diff --git a/inst/include/armadillo_bits/fn_inplace_trans.hpp b/inst/include/armadillo_bits/fn_inplace_trans.hpp index 0e238481..53d180a0 100644 --- a/inst/include/armadillo_bits/fn_inplace_trans.hpp +++ b/inst/include/armadillo_bits/fn_inplace_trans.hpp @@ -35,7 +35,7 @@ inplace_htrans const char* method = "std" ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_strans(X, method); } @@ -56,11 +56,11 @@ inplace_htrans const char* method = "std" ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const char sig = (method != nullptr) ? method[0] : char(0); - arma_debug_check( ((sig != 's') && (sig != 'l')), "inplace_htrans(): unknown method specified" ); + arma_conform_check( ((sig != 's') && (sig != 'l')), "inplace_htrans(): unknown method specified" ); const bool low_memory = (sig == 'l'); @@ -92,11 +92,11 @@ inplace_trans const char* method = "std" ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const char sig = (method != nullptr) ? method[0] : char(0); - arma_debug_check( ((sig != 's') && (sig != 'l')), "inplace_trans(): unknown method specified" ); + arma_conform_check( ((sig != 's') && (sig != 'l')), "inplace_trans(): unknown method specified" ); inplace_strans(X, method); } @@ -117,11 +117,11 @@ inplace_trans const char* method = "std" ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const char sig = (method != nullptr) ? method[0] : char(0); - arma_debug_check( ((sig != 's') && (sig != 'l')), "inplace_trans(): unknown method specified" ); + arma_conform_check( ((sig != 's') && (sig != 'l')), "inplace_trans(): unknown method specified" ); inplace_htrans(X, method); } diff --git a/inst/include/armadillo_bits/fn_interp1.hpp b/inst/include/armadillo_bits/fn_interp1.hpp index d1154230..a7e37076 100644 --- a/inst/include/armadillo_bits/fn_interp1.hpp +++ b/inst/include/armadillo_bits/fn_interp1.hpp @@ -26,7 +26,7 @@ inline void interp1_helper_nearest(const Mat& XG, const Mat& YG, const Mat& XI, Mat& YI, const eT extrap_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const eT XG_min = XG.min(); const eT XG_max = XG.max(); @@ -92,7 +92,7 @@ inline void interp1_helper_linear(const Mat& XG, const Mat& YG, const Mat& XI, Mat& YI, const eT extrap_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const eT XG_min = XG.min(); const eT XG_max = XG.max(); @@ -182,13 +182,13 @@ inline void interp1_helper(const Mat& X, const Mat& Y, const Mat& XI, Mat& YI, const uword sig, const eT extrap_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( ((X.is_vec() == false) || (Y.is_vec() == false) || (XI.is_vec() == false)), "interp1(): currently only vectors are supported" ); + arma_conform_check( ((X.is_vec() == false) || (Y.is_vec() == false) || (XI.is_vec() == false)), "interp1(): currently only vectors are supported" ); - arma_debug_check( (X.n_elem != Y.n_elem), "interp1(): X and Y must have the same number of elements" ); + arma_conform_check( (X.n_elem != Y.n_elem), "interp1(): X and Y must have the same number of elements" ); - arma_debug_check( (X.n_elem < 2), "interp1(): X must have at least two unique elements" ); + arma_conform_check( (X.n_elem < 2), "interp1(): X must have at least two unique elements" ); // sig = 10: nearest neighbour // sig = 11: nearest neighbour, assume monotonic increase in X and XI @@ -208,7 +208,7 @@ interp1_helper(const Mat& X, const Mat& Y, const Mat& XI, Mat& Y const uword N_subset = X_indices.n_elem; - arma_debug_check( (N_subset < 2), "interp1(): X must have at least two unique elements" ); + arma_conform_check( (N_subset < 2), "interp1(): X must have at least two unique elements" ); Mat X_sanitised(N_subset, 1, arma_nozeros_indicator()); Mat Y_sanitised(N_subset, 1, arma_nozeros_indicator()); @@ -304,7 +304,7 @@ interp1 const typename T1::elem_type extrap_val = Datum::nan ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -326,7 +326,7 @@ interp1 } } - arma_debug_check( (sig == 0), "interp1(): unsupported interpolation type" ); + arma_conform_check( (sig == 0), "interp1(): unsupported interpolation type" ); const quasi_unwrap X_tmp( X.get_ref()); const quasi_unwrap Y_tmp( Y.get_ref()); diff --git a/inst/include/armadillo_bits/fn_interp2.hpp b/inst/include/armadillo_bits/fn_interp2.hpp index b9b6127c..90521a84 100644 --- a/inst/include/armadillo_bits/fn_interp2.hpp +++ b/inst/include/armadillo_bits/fn_interp2.hpp @@ -26,7 +26,7 @@ inline void interp2_helper_nearest(const Mat& XG, const Mat& ZG, const Mat& XI, Mat& ZI, const eT extrap_val, const uword mode) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const eT XG_min = XG.min(); const eT XG_max = XG.max(); @@ -91,7 +91,7 @@ inline void interp2_helper_linear(const Mat& XG, const Mat& ZG, const Mat& XI, Mat& ZI, const eT extrap_val, const uword mode) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const eT XG_min = XG.min(); const eT XG_max = XG.max(); @@ -191,13 +191,13 @@ interp2 const typename T1::elem_type extrap_val = Datum::nan ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const char sig = (method != nullptr) ? method[0] : char(0); - arma_debug_check( ((sig != 'n') && (sig != 'l')), "interp2(): unsupported interpolation type" ); + arma_conform_check( ((sig != 'n') && (sig != 'l')), "interp2(): unsupported interpolation type" ); const quasi_unwrap UXG( X.get_ref() ); const quasi_unwrap UYG( Y.get_ref() ); @@ -205,23 +205,23 @@ interp2 const quasi_unwrap UXI( XI.get_ref() ); const quasi_unwrap UYI( YI.get_ref() ); - arma_debug_check( (UXG.M.is_vec() == false), "interp2(): X must resolve to a vector" ); - arma_debug_check( (UYG.M.is_vec() == false), "interp2(): Y must resolve to a vector" ); + arma_conform_check( (UXG.M.is_vec() == false), "interp2(): X must resolve to a vector" ); + arma_conform_check( (UYG.M.is_vec() == false), "interp2(): Y must resolve to a vector" ); - arma_debug_check( (UXI.M.is_vec() == false), "interp2(): XI must resolve to a vector" ); - arma_debug_check( (UYI.M.is_vec() == false), "interp2(): YI must resolve to a vector" ); + arma_conform_check( (UXI.M.is_vec() == false), "interp2(): XI must resolve to a vector" ); + arma_conform_check( (UYI.M.is_vec() == false), "interp2(): YI must resolve to a vector" ); - arma_debug_check( (UXG.M.n_elem < 2), "interp2(): X must have at least two unique elements" ); - arma_debug_check( (UYG.M.n_elem < 2), "interp2(): Y must have at least two unique elements" ); + arma_conform_check( (UXG.M.n_elem < 2), "interp2(): X must have at least two unique elements" ); + arma_conform_check( (UYG.M.n_elem < 2), "interp2(): Y must have at least two unique elements" ); - arma_debug_check( (UXG.M.n_elem != UZG.M.n_cols), "interp2(): number of elements in X must equal the number of columns in Z" ); - arma_debug_check( (UYG.M.n_elem != UZG.M.n_rows), "interp2(): number of elements in Y must equal the number of rows in Z" ); + arma_conform_check( (UXG.M.n_elem != UZG.M.n_cols), "interp2(): number of elements in X must equal the number of columns in Z" ); + arma_conform_check( (UYG.M.n_elem != UZG.M.n_rows), "interp2(): number of elements in Y must equal the number of rows in Z" ); - arma_debug_check( (UXG.M.is_sorted("strictascend") == false), "interp2(): X must be monotonically increasing" ); - arma_debug_check( (UYG.M.is_sorted("strictascend") == false), "interp2(): Y must be monotonically increasing" ); + arma_conform_check( (UXG.M.is_sorted("strictascend") == false), "interp2(): X must be monotonically increasing" ); + arma_conform_check( (UYG.M.is_sorted("strictascend") == false), "interp2(): Y must be monotonically increasing" ); - arma_debug_check( (UXI.M.is_sorted("strictascend") == false), "interp2(): XI must be monotonically increasing" ); - arma_debug_check( (UYI.M.is_sorted("strictascend") == false), "interp2(): YI must be monotonically increasing" ); + arma_conform_check( (UXI.M.is_sorted("strictascend") == false), "interp2(): XI must be monotonically increasing" ); + arma_conform_check( (UYI.M.is_sorted("strictascend") == false), "interp2(): YI must be monotonically increasing" ); Mat tmp; diff --git a/inst/include/armadillo_bits/fn_intersect.hpp b/inst/include/armadillo_bits/fn_intersect.hpp index 37afa52a..6d8141c4 100644 --- a/inst/include/armadillo_bits/fn_intersect.hpp +++ b/inst/include/armadillo_bits/fn_intersect.hpp @@ -36,7 +36,7 @@ intersect const T2& B ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Glue(A, B); } @@ -55,7 +55,7 @@ intersect const Base& B ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); glue_intersect::apply(C, iA, iB, A.get_ref(), B.get_ref(), true); } diff --git a/inst/include/armadillo_bits/fn_inv.hpp b/inst/include/armadillo_bits/fn_inv.hpp index 65589f74..e3f4e149 100644 --- a/inst/include/armadillo_bits/fn_inv.hpp +++ b/inst/include/armadillo_bits/fn_inv.hpp @@ -30,7 +30,7 @@ inv const Base& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X.get_ref()); } @@ -46,14 +46,14 @@ inv const Base& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_inv_gen_default::apply_direct(out, X.get_ref(), "inv()"); if(status == false) { out.soft_reset(); - arma_debug_warn_level(3, "inv(): matrix is singular"); + arma_conform_warn(3, "inv(): matrix is singular"); } return status; @@ -71,7 +71,7 @@ inv const inv_opts::opts& opts ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X.get_ref(), opts.flags, uword(0)); } @@ -88,14 +88,14 @@ inv const inv_opts::opts& opts ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_inv_gen_full::apply_direct(out, X.get_ref(), "inv()", opts.flags); if(status == false) { out.soft_reset(); - arma_debug_warn_level(3, "inv(): matrix is singular"); + arma_conform_warn(3, "inv(): matrix is singular"); } return status; @@ -113,7 +113,7 @@ inv const Base& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; @@ -127,7 +127,7 @@ inv { out_rcond = T(0); out_inv.soft_reset(); - arma_debug_warn_level(3, "inv(): matrix is singular"); + arma_conform_warn(3, "inv(): matrix is singular"); } return status; diff --git a/inst/include/armadillo_bits/fn_inv_sympd.hpp b/inst/include/armadillo_bits/fn_inv_sympd.hpp index ffd1d0d8..21712735 100644 --- a/inst/include/armadillo_bits/fn_inv_sympd.hpp +++ b/inst/include/armadillo_bits/fn_inv_sympd.hpp @@ -30,7 +30,7 @@ inv_sympd const Base& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X.get_ref()); } @@ -46,14 +46,14 @@ inv_sympd const Base& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_inv_spd_default::apply_direct(out, X.get_ref()); if(status == false) { out.soft_reset(); - arma_debug_warn_level(3, "inv_sympd(): matrix is singular or not positive definite"); + arma_conform_warn(3, "inv_sympd(): matrix is singular or not positive definite"); } return status; @@ -71,7 +71,7 @@ inv_sympd const inv_opts::opts& opts ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X.get_ref(), opts.flags, uword(0)); } @@ -88,14 +88,14 @@ inv_sympd const inv_opts::opts& opts ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_inv_spd_full::apply_direct(out, X.get_ref(), opts.flags); if(status == false) { out.soft_reset(); - arma_debug_warn_level(3, "inv_sympd(): matrix is singular or not positive definite"); + arma_conform_warn(3, "inv_sympd(): matrix is singular or not positive definite"); } return status; @@ -113,7 +113,7 @@ inv_sympd const Base& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; @@ -127,7 +127,7 @@ inv_sympd { out_rcond = T(0); out_inv.soft_reset(); - arma_debug_warn_level(3, "inv_sympd(): matrix is singular or not positive definite"); + arma_conform_warn(3, "inv_sympd(): matrix is singular or not positive definite"); } return status; diff --git a/inst/include/armadillo_bits/fn_join.hpp b/inst/include/armadillo_bits/fn_join.hpp index 6d3ed07d..ac521bac 100644 --- a/inst/include/armadillo_bits/fn_join.hpp +++ b/inst/include/armadillo_bits/fn_join.hpp @@ -32,7 +32,7 @@ enable_if2 >::result join_cols(const T1& A, const T2& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Glue(A, B); } @@ -45,7 +45,7 @@ inline Mat join_cols(const Base& A, const Base& B, const Base& C) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat out; @@ -62,7 +62,7 @@ inline Mat join_cols(const Base& A, const Base& B, const Base& C, const Base& D) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat out; @@ -84,7 +84,7 @@ enable_if2 >::result join_vert(const T1& A, const T2& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Glue(A, B); } @@ -97,7 +97,7 @@ inline Mat join_vert(const Base& A, const Base& B, const Base& C) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat out; @@ -114,7 +114,7 @@ inline Mat join_vert(const Base& A, const Base& B, const Base& C, const Base& D) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat out; @@ -136,7 +136,7 @@ enable_if2 >::result join_rows(const T1& A, const T2& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Glue(A, B); } @@ -149,7 +149,7 @@ inline Mat join_rows(const Base& A, const Base& B, const Base& C) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat out; @@ -166,7 +166,7 @@ inline Mat join_rows(const Base& A, const Base& B, const Base& C, const Base& D) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat out; @@ -188,7 +188,7 @@ enable_if2 >::result join_horiz(const T1& A, const T2& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Glue(A, B); } @@ -201,7 +201,7 @@ inline Mat join_horiz(const Base& A, const Base& B, const Base& C) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat out; @@ -218,7 +218,7 @@ inline Mat join_horiz(const Base& A, const Base& B, const Base& C, const Base& D) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat out; @@ -238,7 +238,7 @@ inline const GlueCube join_slices(const BaseCube& A, const BaseCube& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return GlueCube(A.get_ref(), B.get_ref()); } @@ -251,14 +251,14 @@ inline Cube join_slices(const Base& A, const Base& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const quasi_unwrap UA(A.get_ref()); const quasi_unwrap UB(B.get_ref()); - arma_debug_assert_same_size(UA.M.n_rows, UA.M.n_cols, UB.M.n_rows, UB.M.n_cols, "join_slices(): incompatible dimensions"); + arma_conform_assert_same_size(UA.M.n_rows, UA.M.n_cols, UB.M.n_rows, UB.M.n_cols, "join_slices(): incompatible dimensions"); Cube out(UA.M.n_rows, UA.M.n_cols, 2, arma_nozeros_indicator()); @@ -276,7 +276,7 @@ inline Cube join_slices(const Base& A, const BaseCube& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -295,7 +295,7 @@ inline Cube join_slices(const BaseCube& A, const Base& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -317,7 +317,7 @@ inline const SpGlue join_cols(const SpBase& A, const SpBase& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpGlue(A.get_ref(), B.get_ref()); } @@ -330,7 +330,7 @@ inline SpMat join_cols(const SpBase& A, const SpBase& B, const SpBase& C) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat out; @@ -347,7 +347,7 @@ inline SpMat join_cols(const SpBase& A, const SpBase& B, const SpBase& C, const SpBase& D) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat out; @@ -364,7 +364,7 @@ inline const SpGlue join_vert(const SpBase& A, const SpBase& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpGlue(A.get_ref(), B.get_ref()); } @@ -377,7 +377,7 @@ inline SpMat join_vert(const SpBase& A, const SpBase& B, const SpBase& C) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat out; @@ -394,7 +394,7 @@ inline SpMat join_vert(const SpBase& A, const SpBase& B, const SpBase& C, const SpBase& D) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat out; @@ -411,7 +411,7 @@ inline const SpGlue join_rows(const SpBase& A, const SpBase& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpGlue(A.get_ref(), B.get_ref()); } @@ -424,7 +424,7 @@ inline SpMat join_rows(const SpBase& A, const SpBase& B, const SpBase& C) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat out; @@ -441,7 +441,7 @@ inline SpMat join_rows(const SpBase& A, const SpBase& B, const SpBase& C, const SpBase& D) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat out; @@ -458,7 +458,7 @@ inline const SpGlue join_horiz(const SpBase& A, const SpBase& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpGlue(A.get_ref(), B.get_ref()); } @@ -471,7 +471,7 @@ inline SpMat join_horiz(const SpBase& A, const SpBase& B, const SpBase& C) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat out; @@ -488,7 +488,7 @@ inline SpMat join_horiz(const SpBase& A, const SpBase& B, const SpBase& C, const SpBase& D) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat out; diff --git a/inst/include/armadillo_bits/fn_kmeans.hpp b/inst/include/armadillo_bits/fn_kmeans.hpp index 87074352..56fb5c36 100644 --- a/inst/include/armadillo_bits/fn_kmeans.hpp +++ b/inst/include/armadillo_bits/fn_kmeans.hpp @@ -34,7 +34,7 @@ kmeans const bool print_mode ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/fn_kron.hpp b/inst/include/armadillo_bits/fn_kron.hpp index 61b5be2a..4e495610 100644 --- a/inst/include/armadillo_bits/fn_kron.hpp +++ b/inst/include/armadillo_bits/fn_kron.hpp @@ -27,7 +27,7 @@ arma_inline const Glue kron(const Base& A, const Base& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Glue(A.get_ref(), B.get_ref()); } @@ -40,7 +40,7 @@ inline Mat::eT> kron(const Base,T1>& X, const Base& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT1; @@ -67,7 +67,7 @@ inline Mat::eT> kron(const Base& X, const Base,T2>& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT2; @@ -94,7 +94,7 @@ arma_inline const SpGlue kron(const SpBase& A, const SpBase& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpGlue(A.get_ref(), B.get_ref()); } diff --git a/inst/include/armadillo_bits/fn_log_det.hpp b/inst/include/armadillo_bits/fn_log_det.hpp index 3ea463ec..b8acc704 100644 --- a/inst/include/armadillo_bits/fn_log_det.hpp +++ b/inst/include/armadillo_bits/fn_log_det.hpp @@ -33,7 +33,7 @@ log_det const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; @@ -46,7 +46,7 @@ log_det out_val = eT(Datum::nan); out_sign = T(0); - arma_debug_warn_level(3, "log_det(): failed to find determinant"); + arma_conform_warn(3, "log_det(): failed to find determinant"); } return status; @@ -64,7 +64,7 @@ log_det const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; @@ -102,7 +102,7 @@ log_det_sympd const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::pod_type T; @@ -115,7 +115,7 @@ log_det_sympd { out_val = Datum::nan; - arma_debug_warn_level(3, "log_det_sympd(): given matrix is not symmetric positive definite"); + arma_conform_warn(3, "log_det_sympd(): given matrix is not symmetric positive definite"); } return status; @@ -133,7 +133,7 @@ log_det_sympd const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::pod_type T; diff --git a/inst/include/armadillo_bits/fn_log_normpdf.hpp b/inst/include/armadillo_bits/fn_log_normpdf.hpp index cb404db6..651846e6 100644 --- a/inst/include/armadillo_bits/fn_log_normpdf.hpp +++ b/inst/include/armadillo_bits/fn_log_normpdf.hpp @@ -26,7 +26,7 @@ inline typename enable_if2< (is_real::value), void >::result log_normpdf_helper(Mat& out, const Base& X_expr, const Base& M_expr, const Base& S_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -45,7 +45,7 @@ log_normpdf_helper(Mat& out, const Base PM(M_expr.get_ref()); const Proxy PS(S_expr.get_ref()); - arma_debug_check( ( (PX.get_n_rows() != PM.get_n_rows()) || (PX.get_n_cols() != PM.get_n_cols()) || (PM.get_n_rows() != PS.get_n_rows()) || (PM.get_n_cols() != PS.get_n_cols()) ), "log_normpdf(): size mismatch" ); + arma_conform_check( ( (PX.get_n_rows() != PM.get_n_rows()) || (PX.get_n_cols() != PM.get_n_cols()) || (PM.get_n_rows() != PS.get_n_rows()) || (PM.get_n_cols() != PS.get_n_cols()) ), "log_normpdf(): size mismatch" ); out.set_size(PX.get_n_rows(), PX.get_n_cols()); @@ -125,7 +125,7 @@ inline typename enable_if2< (is_real::value), Mat >::result log_normpdf(const eT x, const Base& M_expr, const Base& S_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap UM(M_expr.get_ref()); const Mat& M = UM.M; @@ -145,7 +145,7 @@ inline typename enable_if2< (is_real::value), Mat >::result log_normpdf(const Base& X_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -167,7 +167,7 @@ inline typename enable_if2< (is_real::value), Mat >::result log_normpdf(const Base& X_expr, const typename T1::elem_type mu, const typename T1::elem_type sigma) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -189,7 +189,7 @@ inline typename enable_if2< (is_real::value), Mat >::result log_normpdf(const Base& X_expr, const Base& M_expr, const Base& S_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/fn_logmat.hpp b/inst/include/armadillo_bits/fn_logmat.hpp index e169987a..af52f41f 100644 --- a/inst/include/armadillo_bits/fn_logmat.hpp +++ b/inst/include/armadillo_bits/fn_logmat.hpp @@ -27,7 +27,7 @@ arma_inline typename enable_if2< (is_supported_blas_type::value && is_cx::no), const mtOp, T1, op_logmat> >::result logmat(const Base& X, const uword n_iters = 100u) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp, T1, op_logmat>(X.get_ref(), n_iters, uword(0)); } @@ -40,7 +40,7 @@ arma_inline typename enable_if2< (is_supported_blas_type::value && is_cx::yes), const Op >::result logmat(const Base& X, const uword n_iters = 100u) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X.get_ref(), n_iters, uword(0)); } @@ -52,14 +52,14 @@ inline typename enable_if2< (is_supported_blas_type::value && is_cx::no), bool >::result logmat(Mat< std::complex >& Y, const Base& X, const uword n_iters = 100u) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_logmat::apply_direct(Y, X.get_ref(), n_iters); if(status == false) { Y.soft_reset(); - arma_debug_warn_level(3, "logmat(): transformation failed"); + arma_conform_warn(3, "logmat(): transformation failed"); } return status; @@ -72,14 +72,14 @@ inline typename enable_if2< (is_supported_blas_type::value && is_cx::yes), bool >::result logmat(Mat& Y, const Base& X, const uword n_iters = 100u) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_logmat_cx::apply_direct(Y, X.get_ref(), n_iters); if(status == false) { Y.soft_reset(); - arma_debug_warn_level(3, "logmat(): transformation failed"); + arma_conform_warn(3, "logmat(): transformation failed"); } return status; @@ -97,7 +97,7 @@ arma_inline typename enable_if2< is_supported_blas_type::value, const Op >::result logmat_sympd(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X.get_ref()); } @@ -109,14 +109,14 @@ inline typename enable_if2< is_supported_blas_type::value, bool >::result logmat_sympd(Mat& Y, const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_logmat_sympd::apply_direct(Y, X.get_ref()); if(status == false) { Y.soft_reset(); - arma_debug_warn_level(3, "logmat_sympd(): transformation failed"); + arma_conform_warn(3, "logmat_sympd(): transformation failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_lu.hpp b/inst/include/armadillo_bits/fn_lu.hpp index 60c52b88..8164a70d 100644 --- a/inst/include/armadillo_bits/fn_lu.hpp +++ b/inst/include/armadillo_bits/fn_lu.hpp @@ -33,10 +33,10 @@ lu const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); - arma_debug_check( (&L == &U), "lu(): L and U are the same object" ); + arma_conform_check( (&L == &U), "lu(): L and U are the same object" ); const bool status = auxlib::lu(L, U, X); @@ -44,7 +44,7 @@ lu { L.soft_reset(); U.soft_reset(); - arma_debug_warn_level(3, "lu(): decomposition failed"); + arma_conform_warn(3, "lu(): decomposition failed"); } return status; @@ -65,10 +65,10 @@ lu const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); - arma_debug_check( ( (&L == &U) || (&L == &P) || (&U == &P) ), "lu(): two or more output objects are the same object" ); + arma_conform_check( ( (&L == &U) || (&L == &P) || (&U == &P) ), "lu(): two or more output objects are the same object" ); const bool status = auxlib::lu(L, U, P, X); @@ -77,7 +77,7 @@ lu L.soft_reset(); U.soft_reset(); P.soft_reset(); - arma_debug_warn_level(3, "lu(): decomposition failed"); + arma_conform_warn(3, "lu(): decomposition failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_max.hpp b/inst/include/armadillo_bits/fn_max.hpp index dcbf1cee..a6f28752 100644 --- a/inst/include/armadillo_bits/fn_max.hpp +++ b/inst/include/armadillo_bits/fn_max.hpp @@ -26,7 +26,7 @@ inline typename enable_if2< is_arma_type::value && resolves_to_vector::yes, typename T1::elem_type >::result max(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return op_max::max(X); } @@ -39,7 +39,7 @@ arma_inline typename enable_if2< is_arma_type::value && resolves_to_vector::no, const Op >::result max(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, 0, 0); } @@ -52,7 +52,7 @@ arma_inline typename enable_if2< is_arma_type::value, const Op >::result max(const T1& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, dim, 0); } @@ -86,7 +86,7 @@ max const T2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Glue(X, Y); } @@ -103,7 +103,7 @@ max const uword dim = 0 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return OpCube(X.get_ref(), dim, 0); } @@ -120,7 +120,7 @@ max const BaseCube& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return GlueCube(X.get_ref(), Y.get_ref()); } @@ -138,9 +138,9 @@ enable_if2 >::result max(const T1& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - return spop_max::vector_max(x); + return op_sp_max::vector_max(x); } @@ -152,13 +152,13 @@ typename enable_if2 < is_arma_sparse_type::value && resolves_to_sparse_vector::no, - const SpOp + const SpToDOp >::result max(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - return SpOp(X, 0, 0); + return SpToDOp(X, 0, 0); } @@ -170,13 +170,13 @@ typename enable_if2 < is_arma_sparse_type::value, - const SpOp + const SpToDOp >::result max(const T1& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - return SpOp(X, dim, 0); + return SpToDOp(X, dim, 0); } @@ -193,7 +193,7 @@ enable_if2 >::result max(const T1& x, const T2& y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpGlue(x, y); } @@ -215,7 +215,7 @@ max const T2& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat out; @@ -241,7 +241,7 @@ max const T2& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat out; diff --git a/inst/include/armadillo_bits/fn_mean.hpp b/inst/include/armadillo_bits/fn_mean.hpp index b1400c19..26515ca2 100644 --- a/inst/include/armadillo_bits/fn_mean.hpp +++ b/inst/include/armadillo_bits/fn_mean.hpp @@ -27,7 +27,7 @@ inline typename enable_if2< is_arma_type::value && resolves_to_vector::yes, typename T1::elem_type >::result mean(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return op_mean::mean_all(X); } @@ -40,7 +40,7 @@ arma_inline typename enable_if2< is_arma_type::value && resolves_to_vector::no, const Op >::result mean(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, 0, 0); } @@ -53,7 +53,7 @@ arma_inline typename enable_if2< is_arma_type::value, const Op >::result mean(const T1& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, dim, 0); } @@ -81,7 +81,7 @@ mean const uword dim = 0 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return OpCube(X.get_ref(), dim, 0); } @@ -99,9 +99,9 @@ enable_if2 >::result mean(const T1& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - return spop_mean::mean_all(x); + return op_sp_mean::mean_all(x); } @@ -113,13 +113,13 @@ typename enable_if2 < is_arma_sparse_type::value && resolves_to_sparse_vector::no, - const SpOp + const SpToDOp >::result mean(const T1& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - return SpOp(x, 0, 0); + return SpToDOp(x, 0, 0); } @@ -131,13 +131,13 @@ typename enable_if2 < is_arma_sparse_type::value, - const SpOp + const SpToDOp >::result mean(const T1& x, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - return SpOp(x, dim, 0); + return SpToDOp(x, dim, 0); } diff --git a/inst/include/armadillo_bits/fn_median.hpp b/inst/include/armadillo_bits/fn_median.hpp index 48ff7565..80a7d7ae 100644 --- a/inst/include/armadillo_bits/fn_median.hpp +++ b/inst/include/armadillo_bits/fn_median.hpp @@ -26,7 +26,7 @@ inline typename enable_if2< is_arma_type::value && resolves_to_vector::yes, typename T1::elem_type >::result median(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return op_median::median_vec(X); } @@ -39,7 +39,7 @@ arma_inline typename enable_if2< is_arma_type::value && resolves_to_vector::no, const Op >::result median(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, 0, 0); } @@ -52,7 +52,7 @@ arma_inline typename enable_if2< is_arma_type::value, const Op >::result median(const T1& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, dim, 0); } diff --git a/inst/include/armadillo_bits/fn_min.hpp b/inst/include/armadillo_bits/fn_min.hpp index 3baa1283..433da86d 100644 --- a/inst/include/armadillo_bits/fn_min.hpp +++ b/inst/include/armadillo_bits/fn_min.hpp @@ -26,7 +26,7 @@ inline typename enable_if2< is_arma_type::value && resolves_to_vector::yes, typename T1::elem_type >::result min(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return op_min::min(X); } @@ -39,7 +39,7 @@ arma_inline typename enable_if2< is_arma_type::value && resolves_to_vector::no, const Op >::result min(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, 0, 0); } @@ -52,7 +52,7 @@ arma_inline typename enable_if2< is_arma_type::value, const Op >::result min(const T1& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, dim, 0); } @@ -86,7 +86,7 @@ min const T2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Glue(X, Y); } @@ -103,7 +103,7 @@ min const uword dim = 0 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return OpCube(X.get_ref(), dim, 0); } @@ -120,7 +120,7 @@ min const BaseCube& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return GlueCube(X.get_ref(), Y.get_ref()); } @@ -138,9 +138,9 @@ enable_if2 >::result min(const T1& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - return spop_min::vector_min(x); + return op_sp_min::vector_min(x); } @@ -152,13 +152,13 @@ typename enable_if2 < is_arma_sparse_type::value && resolves_to_sparse_vector::no, - const SpOp + const SpToDOp >::result min(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - return SpOp(X, 0, 0); + return SpToDOp(X, 0, 0); } @@ -170,13 +170,13 @@ typename enable_if2 < is_arma_sparse_type::value, - const SpOp + const SpToDOp >::result min(const T1& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - return SpOp(X, dim, 0); + return SpToDOp(X, dim, 0); } @@ -193,7 +193,7 @@ enable_if2 >::result min(const T1& x, const T2& y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpGlue(x, y); } @@ -215,7 +215,7 @@ min const T2& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat out; @@ -241,7 +241,7 @@ min const T2& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat out; diff --git a/inst/include/armadillo_bits/fn_misc.hpp b/inst/include/armadillo_bits/fn_misc.hpp index 51930e4d..d441b26d 100644 --- a/inst/include/armadillo_bits/fn_misc.hpp +++ b/inst/include/armadillo_bits/fn_misc.hpp @@ -37,7 +37,7 @@ linspace const uword num = 100u ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename out_type::elem_type eT; typedef typename out_type::pod_type T; @@ -93,7 +93,7 @@ inline vec linspace(const double start, const double end, const uword num = 100u) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return linspace(start, end, num); } @@ -115,7 +115,7 @@ logspace const uword N = 50u ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename out_type::elem_type eT; typedef typename out_type::pod_type T; @@ -141,7 +141,7 @@ inline vec logspace(const double A, const double B, const uword N = 50u) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return logspace(A, B, N); } @@ -208,7 +208,7 @@ inline bool is_finite(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return X.is_finite(); } @@ -222,7 +222,7 @@ inline bool is_finite(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return X.is_finite(); } @@ -236,7 +236,7 @@ inline bool is_finite(const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return X.is_finite(); } @@ -248,7 +248,7 @@ inline void swap(Mat& A, Mat& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); A.swap(B); } @@ -260,7 +260,7 @@ inline void swap(Cube& A, Cube& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); A.swap(B); } @@ -272,11 +272,11 @@ inline uvec ind2sub(const SizeMat& s, const uword i) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword s_n_rows = s.n_rows; - arma_debug_check( (i >= (s_n_rows * s.n_cols) ), "ind2sub(): index out of range" ); + arma_conform_check( (i >= (s_n_rows * s.n_cols) ), "ind2sub(): index out of range" ); const uword row = i % s_n_rows; const uword col = i / s_n_rows; @@ -299,7 +299,7 @@ inline typename enable_if2< (is_arma_type::value && is_same_type::yes), umat >::result ind2sub(const SizeMat& s, const T1& indices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword s_n_rows = s.n_rows; const uword s_n_elem = s_n_rows * s.n_cols; @@ -313,7 +313,7 @@ ind2sub(const SizeMat& s, const T1& indices) const bool P_is_empty = (P_n_elem == 0); const bool P_is_vec = ((P_n_rows == 1) || (P_n_cols == 1)); - arma_debug_check( ((P_is_empty == false) && (P_is_vec == false)), "ind2sub(): parameter 'indices' must be a vector" ); + arma_conform_check( ((P_is_empty == false) && (P_is_vec == false)), "ind2sub(): parameter 'indices' must be a vector" ); umat out(2, P_n_elem, arma_nozeros_indicator()); @@ -325,7 +325,7 @@ ind2sub(const SizeMat& s, const T1& indices) { const uword i = Pea[count]; - arma_debug_check( (i >= s_n_elem), "ind2sub(): index out of range" ); + arma_conform_check( (i >= s_n_elem), "ind2sub(): index out of range" ); const uword row = i % s_n_rows; const uword col = i / s_n_rows; @@ -344,7 +344,7 @@ ind2sub(const SizeMat& s, const T1& indices) { const uword i = P.at(0,count); - arma_debug_check( (i >= s_n_elem), "ind2sub(): index out of range" ); + arma_conform_check( (i >= s_n_elem), "ind2sub(): index out of range" ); const uword row = i % s_n_rows; const uword col = i / s_n_rows; @@ -362,7 +362,7 @@ ind2sub(const SizeMat& s, const T1& indices) { const uword i = P.at(count,0); - arma_debug_check( (i >= s_n_elem), "ind2sub(): index out of range" ); + arma_conform_check( (i >= s_n_elem), "ind2sub(): index out of range" ); const uword row = i % s_n_rows; const uword col = i / s_n_rows; @@ -385,12 +385,12 @@ inline uvec ind2sub(const SizeCube& s, const uword i) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword s_n_rows = s.n_rows; const uword s_n_elem_slice = s_n_rows * s.n_cols; - arma_debug_check( (i >= (s_n_elem_slice * s.n_slices) ), "ind2sub(): index out of range" ); + arma_conform_check( (i >= (s_n_elem_slice * s.n_slices) ), "ind2sub(): index out of range" ); const uword slice = i / s_n_elem_slice; const uword j = i - (slice * s_n_elem_slice); @@ -416,7 +416,7 @@ inline typename enable_if2< (is_arma_type::value && is_same_type::yes), umat >::result ind2sub(const SizeCube& s, const T1& indices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword s_n_rows = s.n_rows; const uword s_n_elem_slice = s_n_rows * s.n_cols; @@ -424,7 +424,7 @@ ind2sub(const SizeCube& s, const T1& indices) const quasi_unwrap U(indices); - arma_debug_check( ((U.M.is_empty() == false) && (U.M.is_vec() == false)), "ind2sub(): parameter 'indices' must be a vector" ); + arma_conform_check( ((U.M.is_empty() == false) && (U.M.is_vec() == false)), "ind2sub(): parameter 'indices' must be a vector" ); const uword U_n_elem = U.M.n_elem; const uword* U_mem = U.M.memptr(); @@ -435,7 +435,7 @@ ind2sub(const SizeCube& s, const T1& indices) { const uword i = U_mem[count]; - arma_debug_check( (i >= s_n_elem), "ind2sub(): index out of range" ); + arma_conform_check( (i >= s_n_elem), "ind2sub(): index out of range" ); const uword slice = i / s_n_elem_slice; const uword j = i - (slice * s_n_elem_slice); @@ -459,11 +459,11 @@ arma_inline uword sub2ind(const SizeMat& s, const uword row, const uword col) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword s_n_rows = s.n_rows; - arma_debug_check( ((row >= s_n_rows) || (col >= s.n_cols)), "sub2ind(): subscript out of range" ); + arma_conform_check( ((row >= s_n_rows) || (col >= s.n_cols)), "sub2ind(): subscript out of range" ); return uword(row + col*s_n_rows); } @@ -476,14 +476,14 @@ inline uvec sub2ind(const SizeMat& s, const Base& subscripts) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword s_n_rows = s.n_rows; const uword s_n_cols = s.n_cols; const quasi_unwrap U(subscripts.get_ref()); - arma_debug_check( (U.M.n_rows != 2), "sub2ind(): matrix of subscripts must have 2 rows" ); + arma_conform_check( (U.M.n_rows != 2), "sub2ind(): matrix of subscripts must have 2 rows" ); const uword U_M_n_cols = U.M.n_cols; @@ -499,7 +499,7 @@ sub2ind(const SizeMat& s, const Base& subscripts) U_M_mem += 2; // next column - arma_debug_check( ((row >= s_n_rows) || (col >= s_n_cols)), "sub2ind(): subscript out of range" ); + arma_conform_check( ((row >= s_n_rows) || (col >= s_n_cols)), "sub2ind(): subscript out of range" ); out_mem[count] = uword(row + col*s_n_rows); } @@ -514,12 +514,12 @@ arma_inline uword sub2ind(const SizeCube& s, const uword row, const uword col, const uword slice) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword s_n_rows = s.n_rows; const uword s_n_cols = s.n_cols; - arma_debug_check( ((row >= s_n_rows) || (col >= s_n_cols) || (slice >= s.n_slices)), "sub2ind(): subscript out of range" ); + arma_conform_check( ((row >= s_n_rows) || (col >= s_n_cols) || (slice >= s.n_slices)), "sub2ind(): subscript out of range" ); return uword( (slice * s_n_rows * s_n_cols) + (col * s_n_rows) + row ); } @@ -532,7 +532,7 @@ inline uvec sub2ind(const SizeCube& s, const Base& subscripts) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword s_n_rows = s.n_rows; const uword s_n_cols = s.n_cols; @@ -540,7 +540,7 @@ sub2ind(const SizeCube& s, const Base& subscripts) const quasi_unwrap U(subscripts.get_ref()); - arma_debug_check( (U.M.n_rows != 3), "sub2ind(): matrix of subscripts must have 3 rows" ); + arma_conform_check( (U.M.n_rows != 3), "sub2ind(): matrix of subscripts must have 3 rows" ); const uword U_M_n_cols = U.M.n_cols; @@ -557,7 +557,7 @@ sub2ind(const SizeCube& s, const Base& subscripts) U_M_mem += 3; // next column - arma_debug_check( ((row >= s_n_rows) || (col >= s_n_cols) || (slice >= s_n_slices)), "sub2ind(): subscript out of range" ); + arma_conform_check( ((row >= s_n_rows) || (col >= s_n_cols) || (slice >= s_n_slices)), "sub2ind(): subscript out of range" ); out_mem[count] = uword( (slice * s_n_rows * s_n_cols) + (col * s_n_rows) + row ); } @@ -577,7 +577,7 @@ enable_if2 >::result affmul(const T1& A, const T2& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Glue(A,B); } diff --git a/inst/include/armadillo_bits/fn_mvnrnd.hpp b/inst/include/armadillo_bits/fn_mvnrnd.hpp index dd873d0a..363d8298 100644 --- a/inst/include/armadillo_bits/fn_mvnrnd.hpp +++ b/inst/include/armadillo_bits/fn_mvnrnd.hpp @@ -32,7 +32,7 @@ enable_if2 >::result mvnrnd(const Base& M, const Base& C) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Glue(M.get_ref(), C.get_ref()); } @@ -50,7 +50,7 @@ enable_if2 >::result mvnrnd(const Base& M, const Base& C, const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Glue(M.get_ref(), C.get_ref(), N); } @@ -67,14 +67,14 @@ enable_if2 >::result mvnrnd(Mat& out, const Base& M, const Base& C) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = glue_mvnrnd::apply_direct(out, M.get_ref(), C.get_ref(), uword(1)); if(status == false) { out.soft_reset(); - arma_debug_warn_level(3, "mvnrnd(): given covariance matrix is not symmetric positive semi-definite"); + arma_conform_warn(3, "mvnrnd(): given covariance matrix is not symmetric positive semi-definite"); } return status; @@ -92,14 +92,14 @@ enable_if2 >::result mvnrnd(Mat& out, const Base& M, const Base& C, const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = glue_mvnrnd::apply_direct(out, M.get_ref(), C.get_ref(), N); if(status == false) { out.soft_reset(); - arma_debug_warn_level(3, "mvnrnd(): given covariance matrix is not symmetric positive semi-definite"); + arma_conform_warn(3, "mvnrnd(): given covariance matrix is not symmetric positive semi-definite"); } return status; diff --git a/inst/include/armadillo_bits/fn_n_unique.hpp b/inst/include/armadillo_bits/fn_n_unique.hpp index 2f00b72a..a7e5de6d 100644 --- a/inst/include/armadillo_bits/fn_n_unique.hpp +++ b/inst/include/armadillo_bits/fn_n_unique.hpp @@ -35,7 +35,7 @@ n_unique const op_n_unique_type junk ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy pa(x.get_ref()); const SpProxy pb(y.get_ref()); @@ -56,7 +56,7 @@ n_unique const op_n_unique_type junk ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typename SpProxy::const_iterator_type x_it = pa.begin(); diff --git a/inst/include/armadillo_bits/fn_nonzeros.hpp b/inst/include/armadillo_bits/fn_nonzeros.hpp index 202efe17..cc621f9b 100644 --- a/inst/include/armadillo_bits/fn_nonzeros.hpp +++ b/inst/include/armadillo_bits/fn_nonzeros.hpp @@ -26,7 +26,7 @@ inline const Op nonzeros(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X.get_ref()); } @@ -39,7 +39,7 @@ inline const SpToDOp nonzeros(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpToDOp(X.get_ref()); } diff --git a/inst/include/armadillo_bits/fn_norm.hpp b/inst/include/armadillo_bits/fn_norm.hpp index a8f05f0f..bf17bafa 100644 --- a/inst/include/armadillo_bits/fn_norm.hpp +++ b/inst/include/armadillo_bits/fn_norm.hpp @@ -32,7 +32,7 @@ norm const typename arma_real_or_cx_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::pod_type T; @@ -48,7 +48,7 @@ norm if(k == uword(1)) { return op_norm::vec_norm_1(P); } if(k == uword(2)) { return op_norm::vec_norm_2(P); } - arma_debug_check( (k == 0), "norm(): unsupported vector norm type" ); + arma_conform_check( (k == 0), "norm(): unsupported vector norm type" ); return op_norm::vec_norm_k(P, int(k)); } @@ -78,7 +78,7 @@ norm const typename arma_real_or_cx_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::pod_type T; @@ -131,7 +131,7 @@ norm const typename arma_integral_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); if(resolves_to_colvector::value) { return norm(conv_to< Col >::from(X), k); } @@ -153,7 +153,7 @@ norm const typename arma_integral_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); if(resolves_to_colvector::value) { return norm(conv_to< Col >::from(X), method); } @@ -179,7 +179,7 @@ norm const typename arma_real_or_cx_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; @@ -234,7 +234,7 @@ norm const typename arma_real_or_cx_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; @@ -311,7 +311,7 @@ norm2est const typename arma_real_or_cx_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return op_norm2est::norm2est(X.get_ref(), tolerance, max_iter); @@ -331,7 +331,7 @@ norm2est const typename arma_real_or_cx_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return op_norm2est::norm2est(X.get_ref(), tolerance, max_iter); diff --git a/inst/include/armadillo_bits/fn_normalise.hpp b/inst/include/armadillo_bits/fn_normalise.hpp index ae074300..38295de2 100644 --- a/inst/include/armadillo_bits/fn_normalise.hpp +++ b/inst/include/armadillo_bits/fn_normalise.hpp @@ -38,7 +38,7 @@ normalise const typename arma_real_or_cx_only::result* junk2 = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); @@ -64,7 +64,7 @@ normalise const typename arma_real_or_cx_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return Op(X, p, dim); @@ -84,7 +84,7 @@ normalise const typename arma_real_or_cx_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return SpOp(expr.get_ref(), p, dim); diff --git a/inst/include/armadillo_bits/fn_normcdf.hpp b/inst/include/armadillo_bits/fn_normcdf.hpp index 06ed5cb8..d2d4e557 100644 --- a/inst/include/armadillo_bits/fn_normcdf.hpp +++ b/inst/include/armadillo_bits/fn_normcdf.hpp @@ -26,7 +26,7 @@ inline typename enable_if2< (is_real::value), void >::result normcdf_helper(Mat& out, const Base& X_expr, const Base& M_expr, const Base& S_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -45,7 +45,7 @@ normcdf_helper(Mat& out, const Base PM(M_expr.get_ref()); const Proxy PS(S_expr.get_ref()); - arma_debug_check( ( (PX.get_n_rows() != PM.get_n_rows()) || (PX.get_n_cols() != PM.get_n_cols()) || (PM.get_n_rows() != PS.get_n_rows()) || (PM.get_n_cols() != PS.get_n_cols()) ), "normcdf(): size mismatch" ); + arma_conform_check( ( (PX.get_n_rows() != PM.get_n_rows()) || (PX.get_n_cols() != PM.get_n_cols()) || (PM.get_n_rows() != PS.get_n_rows()) || (PM.get_n_cols() != PS.get_n_cols()) ), "normcdf(): size mismatch" ); out.set_size(PX.get_n_rows(), PX.get_n_cols()); @@ -121,7 +121,7 @@ inline typename enable_if2< (is_real::value), Mat >::result normcdf(const eT x, const Base& M_expr, const Base& S_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap UM(M_expr.get_ref()); const Mat& M = UM.M; @@ -141,7 +141,7 @@ inline typename enable_if2< (is_real::value), Mat >::result normcdf(const Base& X_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -163,7 +163,7 @@ inline typename enable_if2< (is_real::value), Mat >::result normcdf(const Base& X_expr, const typename T1::elem_type mu, const typename T1::elem_type sigma) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -185,7 +185,7 @@ inline typename enable_if2< (is_real::value), Mat >::result normcdf(const Base& X_expr, const Base& M_expr, const Base& S_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/fn_normpdf.hpp b/inst/include/armadillo_bits/fn_normpdf.hpp index e05af41b..a3edf390 100644 --- a/inst/include/armadillo_bits/fn_normpdf.hpp +++ b/inst/include/armadillo_bits/fn_normpdf.hpp @@ -26,7 +26,7 @@ inline typename enable_if2< (is_real::value), void >::result normpdf_helper(Mat& out, const Base& X_expr, const Base& M_expr, const Base& S_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -45,7 +45,7 @@ normpdf_helper(Mat& out, const Base PM(M_expr.get_ref()); const Proxy PS(S_expr.get_ref()); - arma_debug_check( ( (PX.get_n_rows() != PM.get_n_rows()) || (PX.get_n_cols() != PM.get_n_cols()) || (PM.get_n_rows() != PS.get_n_rows()) || (PM.get_n_cols() != PS.get_n_cols()) ), "normpdf(): size mismatch" ); + arma_conform_check( ( (PX.get_n_rows() != PM.get_n_rows()) || (PX.get_n_cols() != PM.get_n_cols()) || (PM.get_n_rows() != PS.get_n_rows()) || (PM.get_n_cols() != PS.get_n_cols()) ), "normpdf(): size mismatch" ); out.set_size(PX.get_n_rows(), PX.get_n_cols()); @@ -125,7 +125,7 @@ inline typename enable_if2< (is_real::value), Mat >::result normpdf(const eT x, const Base& M_expr, const Base& S_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap UM(M_expr.get_ref()); const Mat& M = UM.M; @@ -145,7 +145,7 @@ inline typename enable_if2< (is_real::value), Mat >::result normpdf(const Base& X_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -167,7 +167,7 @@ inline typename enable_if2< (is_real::value), Mat >::result normpdf(const Base& X_expr, const typename T1::elem_type mu, const typename T1::elem_type sigma) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -189,7 +189,7 @@ inline typename enable_if2< (is_real::value), Mat >::result normpdf(const Base& X_expr, const Base& M_expr, const Base& S_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/fn_numel.hpp b/inst/include/armadillo_bits/fn_numel.hpp index fe5c1915..6006402b 100644 --- a/inst/include/armadillo_bits/fn_numel.hpp +++ b/inst/include/armadillo_bits/fn_numel.hpp @@ -27,7 +27,7 @@ inline typename enable_if2< is_arma_type::value, uword >::result numel(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Proxy P(X); @@ -42,7 +42,7 @@ inline typename enable_if2< is_arma_cube_type::value, uword >::result numel(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const ProxyCube P(X); @@ -57,7 +57,7 @@ inline typename enable_if2< is_arma_sparse_type::value, uword >::result numel(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy P(X); @@ -72,7 +72,7 @@ inline uword numel(const field& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return X.n_elem; } @@ -85,7 +85,7 @@ inline uword numel(const subview_field& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return X.n_elem; } diff --git a/inst/include/armadillo_bits/fn_ones.hpp b/inst/include/armadillo_bits/fn_ones.hpp index ae8b6220..4fd9d828 100644 --- a/inst/include/armadillo_bits/fn_ones.hpp +++ b/inst/include/armadillo_bits/fn_ones.hpp @@ -26,7 +26,7 @@ arma_inline const Gen ones(const uword n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Gen(n_elem, 1); } @@ -39,7 +39,7 @@ arma_inline const Gen ones(const uword n_elem, const arma_empty_class junk1 = arma_empty_class(), const typename arma_Mat_Col_Row_only::result* junk2 = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); @@ -56,7 +56,7 @@ arma_inline const Gen ones(const uword n_rows, const uword n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Gen(n_rows, n_cols); } @@ -68,7 +68,7 @@ arma_inline const Gen ones(const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Gen(s.n_rows, s.n_cols); } @@ -81,11 +81,11 @@ inline const Gen ones(const uword n_rows, const uword n_cols, const typename arma_Mat_Col_Row_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); - if(is_Col::value) { arma_debug_check( (n_cols != 1), "ones(): incompatible size" ); } - if(is_Row::value) { arma_debug_check( (n_rows != 1), "ones(): incompatible size" ); } + if(is_Col::value) { arma_conform_check( (n_cols != 1), "ones(): incompatible size" ); } + if(is_Row::value) { arma_conform_check( (n_rows != 1), "ones(): incompatible size" ); } return Gen(n_rows, n_cols); } @@ -98,7 +98,7 @@ inline const Gen ones(const SizeMat& s, const typename arma_Mat_Col_Row_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return ones(s.n_rows, s.n_cols); @@ -111,7 +111,7 @@ arma_inline const GenCube ones(const uword n_rows, const uword n_cols, const uword n_slices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return GenCube(n_rows, n_cols, n_slices); } @@ -123,7 +123,7 @@ arma_inline const GenCube ones(const SizeCube& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return GenCube(s.n_rows, s.n_cols, s.n_slices); } @@ -136,7 +136,7 @@ arma_inline const GenCube ones(const uword n_rows, const uword n_cols, const uword n_slices, const typename arma_Cube_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return GenCube(n_rows, n_cols, n_slices); @@ -150,7 +150,7 @@ arma_inline const GenCube ones(const SizeCube& s, const typename arma_Cube_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return GenCube(s.n_rows, s.n_cols, s.n_slices); diff --git a/inst/include/armadillo_bits/fn_orth_null.hpp b/inst/include/armadillo_bits/fn_orth_null.hpp index fe689065..5f9f449c 100644 --- a/inst/include/armadillo_bits/fn_orth_null.hpp +++ b/inst/include/armadillo_bits/fn_orth_null.hpp @@ -27,7 +27,7 @@ arma_inline typename enable_if2< is_real::value, const Op >::result orth(const Base& X, const typename T1::pod_type tol = 0.0) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -41,14 +41,14 @@ inline typename enable_if2< is_real::value, bool >::result orth(Mat& out, const Base& X, const typename T1::pod_type tol = 0.0) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_orth::apply_direct(out, X.get_ref(), tol); if(status == false) { out.soft_reset(); - arma_debug_warn_level(3, "orth(): svd failed"); + arma_conform_warn(3, "orth(): svd failed"); } return status; @@ -66,7 +66,7 @@ arma_inline typename enable_if2< is_real::value, const Op >::result null(const Base& X, const typename T1::pod_type tol = 0.0) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -80,14 +80,14 @@ inline typename enable_if2< is_real::value, bool >::result null(Mat& out, const Base& X, const typename T1::pod_type tol = 0.0) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_null::apply_direct(out, X.get_ref(), tol); if(status == false) { out.soft_reset(); - arma_debug_warn_level(3, "null(): svd failed"); + arma_conform_warn(3, "null(): svd failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_pinv.hpp b/inst/include/armadillo_bits/fn_pinv.hpp index 6a873227..f88cde5c 100644 --- a/inst/include/armadillo_bits/fn_pinv.hpp +++ b/inst/include/armadillo_bits/fn_pinv.hpp @@ -30,7 +30,7 @@ pinv const Base& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X.get_ref()); } @@ -48,7 +48,7 @@ pinv const char* method = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -58,7 +58,7 @@ pinv { const char sig = method[0]; - arma_debug_check( ((sig != 's') && (sig != 'd')), "pinv(): unknown method specified" ); + arma_conform_check( ((sig != 's') && (sig != 'd')), "pinv(): unknown method specified" ); if(sig == 's') { method_id = 1; } if(sig == 'd') { method_id = 2; } @@ -80,7 +80,7 @@ pinv const char* method = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uword method_id = 0; // default setting @@ -88,7 +88,7 @@ pinv { const char sig = method[0]; - arma_debug_check( ((sig != 's') && (sig != 'd')), "pinv(): unknown method specified" ); + arma_conform_check( ((sig != 's') && (sig != 'd')), "pinv(): unknown method specified" ); if(sig == 's') { method_id = 1; } if(sig == 'd') { method_id = 2; } @@ -99,7 +99,7 @@ pinv if(status == false) { out.soft_reset(); - arma_debug_warn_level(3, "pinv(): svd failed"); + arma_conform_warn(3, "pinv(): svd failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_polyfit.hpp b/inst/include/armadillo_bits/fn_polyfit.hpp index e51e37bc..77a1a234 100644 --- a/inst/include/armadillo_bits/fn_polyfit.hpp +++ b/inst/include/armadillo_bits/fn_polyfit.hpp @@ -31,14 +31,14 @@ enable_if2 >::result polyfit(Mat& out, const Base& X, const Base& Y, const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = glue_polyfit::apply_direct(out, X.get_ref(), Y.get_ref(), N); if(status == false) { out.soft_reset(); - arma_debug_warn_level(3, "polyfit(): failed"); + arma_conform_warn(3, "polyfit(): failed"); } return status; @@ -57,7 +57,7 @@ enable_if2 >::result polyfit(const Base& X, const Base& Y, const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Glue(X.get_ref(), Y.get_ref(), N); } diff --git a/inst/include/armadillo_bits/fn_polyval.hpp b/inst/include/armadillo_bits/fn_polyval.hpp index f22c7280..0b333968 100644 --- a/inst/include/armadillo_bits/fn_polyval.hpp +++ b/inst/include/armadillo_bits/fn_polyval.hpp @@ -32,7 +32,7 @@ enable_if2 >::result polyval(const Base& P, const T2& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Glue(P.get_ref(), X); } diff --git a/inst/include/armadillo_bits/fn_powext.hpp b/inst/include/armadillo_bits/fn_powext.hpp index a971219d..5223004b 100644 --- a/inst/include/armadillo_bits/fn_powext.hpp +++ b/inst/include/armadillo_bits/fn_powext.hpp @@ -36,7 +36,7 @@ pow const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Glue(X, Y.get_ref()); } @@ -53,7 +53,7 @@ pow const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return glue_powext::apply(X,Y); } @@ -70,7 +70,7 @@ pow const BaseCube& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return GlueCube(X.get_ref(), Y.get_ref()); } @@ -87,7 +87,7 @@ pow const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return glue_powext::apply(X,Y); } @@ -113,7 +113,7 @@ pow const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtGlue(X, Y.get_ref()); } @@ -135,7 +135,7 @@ pow const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return glue_powext_cx::apply(X,Y); } @@ -152,7 +152,7 @@ pow const BaseCube< typename T1::pod_type , T2>& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtGlueCube(X.get_ref(), Y.get_ref()); } @@ -169,7 +169,7 @@ pow const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return glue_powext_cx::apply(X,Y); } diff --git a/inst/include/armadillo_bits/fn_powmat.hpp b/inst/include/armadillo_bits/fn_powmat.hpp index 17d0293a..69cf925e 100644 --- a/inst/include/armadillo_bits/fn_powmat.hpp +++ b/inst/include/armadillo_bits/fn_powmat.hpp @@ -26,7 +26,7 @@ inline typename enable_if2< is_supported_blas_type::value, const Op >::result powmat(const Base& X, const int y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword aux_a = (y < int(0)) ? uword(-y) : uword(y); const uword aux_b = (y < int(0)) ? uword(1) : uword(0); @@ -46,7 +46,7 @@ powmat const int y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword y_val = (y < int(0)) ? uword(-y) : uword(y); const bool y_neg = (y < int(0)); @@ -56,7 +56,7 @@ powmat if(status == false) { out.soft_reset(); - arma_debug_warn_level(3, "powmat(): transformation failed"); + arma_conform_warn(3, "powmat(): transformation failed"); } return status; @@ -70,7 +70,7 @@ inline typename enable_if2< is_supported_blas_type::value, const mtOp,T1,op_powmat_cx> >::result powmat(const Base& X, const double y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef std::complex out_eT; @@ -89,7 +89,7 @@ powmat const double y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; @@ -98,7 +98,7 @@ powmat if(status == false) { out.soft_reset(); - arma_debug_warn_level(3, "powmat(): transformation failed"); + arma_conform_warn(3, "powmat(): transformation failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_princomp.hpp b/inst/include/armadillo_bits/fn_princomp.hpp index 0a251b51..9f2e1f94 100644 --- a/inst/include/armadillo_bits/fn_princomp.hpp +++ b/inst/include/armadillo_bits/fn_princomp.hpp @@ -40,7 +40,7 @@ princomp const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const bool status = op_princomp::direct_princomp(coeff_out, score_out, latent_out, tsquared_out, X); @@ -52,7 +52,7 @@ princomp latent_out.soft_reset(); tsquared_out.soft_reset(); - arma_debug_warn_level(3, "princomp(): decomposition failed"); + arma_conform_warn(3, "princomp(): decomposition failed"); } return status; @@ -77,7 +77,7 @@ princomp const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const bool status = op_princomp::direct_princomp(coeff_out, score_out, latent_out, X); @@ -88,7 +88,7 @@ princomp score_out.soft_reset(); latent_out.soft_reset(); - arma_debug_warn_level(3, "princomp(): decomposition failed"); + arma_conform_warn(3, "princomp(): decomposition failed"); } return status; @@ -111,7 +111,7 @@ princomp const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const bool status = op_princomp::direct_princomp(coeff_out, score_out, X); @@ -121,7 +121,7 @@ princomp coeff_out.soft_reset(); score_out.soft_reset(); - arma_debug_warn_level(3, "princomp(): decomposition failed"); + arma_conform_warn(3, "princomp(): decomposition failed"); } return status; @@ -142,7 +142,7 @@ princomp const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const bool status = op_princomp::direct_princomp(coeff_out, X); @@ -151,7 +151,7 @@ princomp { coeff_out.soft_reset(); - arma_debug_warn_level(3, "princomp(): decomposition failed"); + arma_conform_warn(3, "princomp(): decomposition failed"); } return status; @@ -169,7 +169,7 @@ princomp const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return Op(X.get_ref()); diff --git a/inst/include/armadillo_bits/fn_prod.hpp b/inst/include/armadillo_bits/fn_prod.hpp index c15110ff..18977dcd 100644 --- a/inst/include/armadillo_bits/fn_prod.hpp +++ b/inst/include/armadillo_bits/fn_prod.hpp @@ -34,7 +34,7 @@ inline typename enable_if2< is_arma_type::value && resolves_to_vector::yes, typename T1::elem_type >::result prod(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return op_prod::prod(X); } @@ -47,7 +47,7 @@ arma_inline typename enable_if2< is_arma_type::value && resolves_to_vector::no, const Op >::result prod(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, 0, 0); } @@ -60,7 +60,7 @@ arma_inline typename enable_if2< is_arma_type::value, const Op >::result prod(const T1& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, dim, 0); } diff --git a/inst/include/armadillo_bits/fn_qr.hpp b/inst/include/armadillo_bits/fn_qr.hpp index 3d49a1b3..e257281c 100644 --- a/inst/include/armadillo_bits/fn_qr.hpp +++ b/inst/include/armadillo_bits/fn_qr.hpp @@ -33,10 +33,10 @@ qr const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); - arma_debug_check( (&Q == &R), "qr(): Q and R are the same object" ); + arma_conform_check( (&Q == &R), "qr(): Q and R are the same object" ); const bool status = auxlib::qr(Q, R, X); @@ -44,7 +44,7 @@ qr { Q.soft_reset(); R.soft_reset(); - arma_debug_warn_level(3, "qr(): decomposition failed"); + arma_conform_warn(3, "qr(): decomposition failed"); } return status; @@ -64,10 +64,10 @@ qr_econ const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); - arma_debug_check( (&Q == &R), "qr_econ(): Q and R are the same object" ); + arma_conform_check( (&Q == &R), "qr_econ(): Q and R are the same object" ); const bool status = auxlib::qr_econ(Q, R, X); @@ -75,7 +75,7 @@ qr_econ { Q.soft_reset(); R.soft_reset(); - arma_debug_warn_level(3, "qr_econ(): decomposition failed"); + arma_conform_warn(3, "qr_econ(): decomposition failed"); } return status; @@ -96,13 +96,13 @@ qr const char* P_mode = "matrix" ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (&Q == &R), "qr(): Q and R are the same object" ); + arma_conform_check( (&Q == &R), "qr(): Q and R are the same object" ); const char sig = (P_mode != nullptr) ? P_mode[0] : char(0); - arma_debug_check( ((sig != 'm') && (sig != 'v')), "qr(): argument 'P_mode' must be \"vector\" or \"matrix\"" ); + arma_conform_check( ((sig != 'm') && (sig != 'v')), "qr(): argument 'P_mode' must be \"vector\" or \"matrix\"" ); bool status = false; @@ -134,7 +134,7 @@ qr Q.soft_reset(); R.soft_reset(); P.soft_reset(); - arma_debug_warn_level(3, "qr(): decomposition failed"); + arma_conform_warn(3, "qr(): decomposition failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_quantile.hpp b/inst/include/armadillo_bits/fn_quantile.hpp index 6c1ea2b0..7ac59fa0 100644 --- a/inst/include/armadillo_bits/fn_quantile.hpp +++ b/inst/include/armadillo_bits/fn_quantile.hpp @@ -31,7 +31,7 @@ enable_if2 >::result quantile(const T1& X, const Base& P) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtGlue(X, P.get_ref()); } @@ -49,7 +49,7 @@ enable_if2 >::result quantile(const T1& X, const Base& P, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtGlue(X, P.get_ref(), dim); } diff --git a/inst/include/armadillo_bits/fn_qz.hpp b/inst/include/armadillo_bits/fn_qz.hpp index 9979dfad..081ece87 100644 --- a/inst/include/armadillo_bits/fn_qz.hpp +++ b/inst/include/armadillo_bits/fn_qz.hpp @@ -41,11 +41,11 @@ qz const char* select = "none" ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const char sig = (select != nullptr) ? select[0] : char(0); - arma_debug_check( ( (sig != 'n') && (sig != 'l') && (sig != 'r') && (sig != 'i') && (sig != 'o') ), "qz(): unknown select form" ); + arma_conform_check( ( (sig != 'n') && (sig != 'l') && (sig != 'r') && (sig != 'i') && (sig != 'o') ), "qz(): unknown select form" ); const bool status = auxlib::qz(AA, BB, Q, Z, A_expr.get_ref(), B_expr.get_ref(), sig); @@ -55,7 +55,7 @@ qz BB.soft_reset(); Q.soft_reset(); Z.soft_reset(); - arma_debug_warn_level(3, "qz(): decomposition failed"); + arma_conform_warn(3, "qz(): decomposition failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_randg.hpp b/inst/include/armadillo_bits/fn_randg.hpp index a0e998a8..551af345 100644 --- a/inst/include/armadillo_bits/fn_randg.hpp +++ b/inst/include/armadillo_bits/fn_randg.hpp @@ -27,19 +27,19 @@ inline obj_type randg(const uword n_rows, const uword n_cols, const distr_param& param = distr_param(), const typename arma_Mat_Col_Row_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename obj_type::elem_type eT; if(is_Col::value) { - arma_debug_check( (n_cols != 1), "randg(): incompatible size" ); + arma_conform_check( (n_cols != 1), "randg(): incompatible size" ); } else if(is_Row::value) { - arma_debug_check( (n_rows != 1), "randg(): incompatible size" ); + arma_conform_check( (n_rows != 1), "randg(): incompatible size" ); } double a = double(1); @@ -47,7 +47,7 @@ randg(const uword n_rows, const uword n_cols, const distr_param& param = distr_p param.get_double_vals(a,b); - arma_debug_check( ((a <= double(0)) || (b <= double(0))), "randg(): incorrect distribution parameters; a and b must be greater than zero" ); + arma_conform_check( ((a <= double(0)) || (b <= double(0))), "randg(): incorrect distribution parameters; a and b must be greater than zero" ); obj_type out(n_rows, n_cols, arma_nozeros_indicator()); @@ -64,7 +64,7 @@ inline obj_type randg(const SizeMat& s, const distr_param& param = distr_param(), const typename arma_Mat_Col_Row_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return randg(s.n_rows, s.n_cols, param); @@ -78,7 +78,7 @@ inline obj_type randg(const uword n_elem, const distr_param& param = distr_param(), const arma_empty_class junk1 = arma_empty_class(), const typename arma_Mat_Col_Row_only::result* junk2 = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); @@ -95,7 +95,7 @@ inline mat randg(const uword n_rows, const uword n_cols, const distr_param& param = distr_param()) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return randg(n_rows, n_cols, param); } @@ -107,7 +107,7 @@ inline mat randg(const SizeMat& s, const distr_param& param = distr_param()) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return randg(s.n_rows, s.n_cols, param); } @@ -119,7 +119,7 @@ inline vec randg(const uword n_elem, const distr_param& param = distr_param()) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return randg(n_elem, uword(1), param); } @@ -131,14 +131,14 @@ inline double randg(const distr_param& param = distr_param()) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); double a = double(1); double b = double(1); param.get_double_vals(a,b); - arma_debug_check( ((a <= double(0)) || (b <= double(0))), "randg(): incorrect distribution parameters; a and b must be greater than zero" ); + arma_conform_check( ((a <= double(0)) || (b <= double(0))), "randg(): incorrect distribution parameters; a and b must be greater than zero" ); double out_val = double(0); @@ -155,14 +155,14 @@ inline typename arma_real_or_cx_only::result randg(const distr_param& param = distr_param()) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); double a = double(1); double b = double(1); param.get_double_vals(a,b); - arma_debug_check( ((a <= double(0)) || (b <= double(0))), "randg(): incorrect distribution parameters; a and b must be greater than zero" ); + arma_conform_check( ((a <= double(0)) || (b <= double(0))), "randg(): incorrect distribution parameters; a and b must be greater than zero" ); eT out_val = eT(0); @@ -179,7 +179,7 @@ inline cube_type randg(const uword n_rows, const uword n_cols, const uword n_slices, const distr_param& param = distr_param(), const typename arma_Cube_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename cube_type::elem_type eT; @@ -189,7 +189,7 @@ randg(const uword n_rows, const uword n_cols, const uword n_slices, const distr_ param.get_double_vals(a,b); - arma_debug_check( ((a <= double(0)) || (b <= double(0))), "randg(): incorrect distribution parameters; a and b must be greater than zero" ); + arma_conform_check( ((a <= double(0)) || (b <= double(0))), "randg(): incorrect distribution parameters; a and b must be greater than zero" ); cube_type out(n_rows, n_cols, n_slices, arma_nozeros_indicator()); @@ -206,7 +206,7 @@ inline cube_type randg(const SizeCube& s, const distr_param& param = distr_param(), const typename arma_Cube_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return randg(s.n_rows, s.n_cols, s.n_slices, param); @@ -219,7 +219,7 @@ inline cube randg(const uword n_rows, const uword n_cols, const uword n_slices, const distr_param& param = distr_param()) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return randg(n_rows, n_cols, n_slices, param); } @@ -231,7 +231,7 @@ inline cube randg(const SizeCube& s, const distr_param& param = distr_param()) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return randg(s.n_rows, s.n_cols, s.n_slices, param); } diff --git a/inst/include/armadillo_bits/fn_randi.hpp b/inst/include/armadillo_bits/fn_randi.hpp index 2aae9b5e..706851ba 100644 --- a/inst/include/armadillo_bits/fn_randi.hpp +++ b/inst/include/armadillo_bits/fn_randi.hpp @@ -27,19 +27,19 @@ inline obj_type randi(const uword n_rows, const uword n_cols, const distr_param& param = distr_param(), const typename arma_Mat_Col_Row_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename obj_type::elem_type eT; if(is_Col::value) { - arma_debug_check( (n_cols != 1), "randi(): incompatible size" ); + arma_conform_check( (n_cols != 1), "randi(): incompatible size" ); } else if(is_Row::value) { - arma_debug_check( (n_rows != 1), "randi(): incompatible size" ); + arma_conform_check( (n_rows != 1), "randi(): incompatible size" ); } int a = 0; @@ -47,7 +47,7 @@ randi(const uword n_rows, const uword n_cols, const distr_param& param = distr_p param.get_int_vals(a,b); - arma_debug_check( (a > b), "randi(): incorrect distribution parameters; a must be less than b" ); + arma_conform_check( (a > b), "randi(): incorrect distribution parameters; a must be less than b" ); obj_type out(n_rows, n_cols, arma_nozeros_indicator()); @@ -64,7 +64,7 @@ inline obj_type randi(const SizeMat& s, const distr_param& param = distr_param(), const typename arma_Mat_Col_Row_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return randi(s.n_rows, s.n_cols, param); @@ -78,7 +78,7 @@ inline obj_type randi(const uword n_elem, const distr_param& param = distr_param(), const arma_empty_class junk1 = arma_empty_class(), const typename arma_Mat_Col_Row_only::result* junk2 = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); @@ -99,7 +99,7 @@ inline imat randi(const uword n_rows, const uword n_cols, const distr_param& param = distr_param()) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return randi(n_rows, n_cols, param); } @@ -111,7 +111,7 @@ inline imat randi(const SizeMat& s, const distr_param& param = distr_param()) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return randi(s.n_rows, s.n_cols, param); } @@ -123,7 +123,7 @@ inline ivec randi(const uword n_elem, const distr_param& param = distr_param()) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return randi(n_elem, uword(1), param); } @@ -135,14 +135,14 @@ inline sword randi(const distr_param& param) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); int a = 0; int b = arma_rng::randi::max_val(); param.get_int_vals(a,b); - arma_debug_check( (a > b), "randi(): incorrect distribution parameters; a must be less than b" ); + arma_conform_check( (a > b), "randi(): incorrect distribution parameters; a must be less than b" ); sword out_val = sword(0); @@ -159,14 +159,14 @@ inline typename arma_scalar_only::result randi(const distr_param& param) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); int a = 0; int b = arma_rng::randi::max_val(); param.get_int_vals(a,b); - arma_debug_check( (a > b), "randi(): incorrect distribution parameters; a must be less than b" ); + arma_conform_check( (a > b), "randi(): incorrect distribution parameters; a must be less than b" ); eT out_val = eT(0); @@ -182,7 +182,7 @@ inline sword randi() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return sword( arma_rng::randi() ); } @@ -195,7 +195,7 @@ inline typename arma_scalar_only::result randi() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eT( arma_rng::randi() ); } @@ -208,7 +208,7 @@ inline cube_type randi(const uword n_rows, const uword n_cols, const uword n_slices, const distr_param& param = distr_param(), const typename arma_Cube_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename cube_type::elem_type eT; @@ -218,7 +218,7 @@ randi(const uword n_rows, const uword n_cols, const uword n_slices, const distr_ param.get_int_vals(a,b); - arma_debug_check( (a > b), "randi(): incorrect distribution parameters; a must be less than b" ); + arma_conform_check( (a > b), "randi(): incorrect distribution parameters; a must be less than b" ); cube_type out(n_rows, n_cols, n_slices, arma_nozeros_indicator()); @@ -235,7 +235,7 @@ inline cube_type randi(const SizeCube& s, const distr_param& param = distr_param(), const typename arma_Cube_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return randi(s.n_rows, s.n_cols, s.n_slices, param); @@ -248,7 +248,7 @@ inline icube randi(const uword n_rows, const uword n_cols, const uword n_slices, const distr_param& param = distr_param()) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return randi(n_rows, n_cols, n_slices, param); } @@ -260,7 +260,7 @@ inline icube randi(const SizeCube& s, const distr_param& param = distr_param()) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return randi(s.n_rows, s.n_cols, s.n_slices, param); } diff --git a/inst/include/armadillo_bits/fn_randn.hpp b/inst/include/armadillo_bits/fn_randn.hpp index 37cb3db9..ad1733ab 100644 --- a/inst/include/armadillo_bits/fn_randn.hpp +++ b/inst/include/armadillo_bits/fn_randn.hpp @@ -28,7 +28,7 @@ inline double randn() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return double(arma_rng::randn()); } @@ -41,7 +41,7 @@ inline typename arma_real_or_cx_only::result randn() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eT(arma_rng::randn()); } @@ -53,7 +53,7 @@ inline double randn(const distr_param& param) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(param.state == 0) { return double(arma_rng::randn()); } @@ -62,7 +62,7 @@ randn(const distr_param& param) param.get_double_vals(mu,sd); - arma_debug_check( (sd <= double(0)), "randn(): incorrect distribution parameters; standard deviation must be > 0" ); + arma_conform_check( (sd <= double(0)), "randn(): incorrect distribution parameters; standard deviation must be > 0" ); const double val = double(arma_rng::randn()); @@ -77,7 +77,7 @@ inline typename arma_real_or_cx_only::result randn(const distr_param& param) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(param.state == 0) { return eT(arma_rng::randn()); } @@ -86,7 +86,7 @@ randn(const distr_param& param) param.get_double_vals(mu,sd); - arma_debug_check( (sd <= double(0)), "randn(): incorrect distribution parameters; standard deviation must be > 0" ); + arma_conform_check( (sd <= double(0)), "randn(): incorrect distribution parameters; standard deviation must be > 0" ); eT val = eT(0); @@ -104,7 +104,7 @@ inline vec randn(const uword n_elem, const distr_param& param = distr_param()) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); vec out(n_elem, arma_nozeros_indicator()); @@ -119,7 +119,7 @@ randn(const uword n_elem, const distr_param& param = distr_param()) param.get_double_vals(mu,sd); - arma_debug_check( (sd <= double(0)), "randn(): incorrect distribution parameters; standard deviation must be > 0" ); + arma_conform_check( (sd <= double(0)), "randn(): incorrect distribution parameters; standard deviation must be > 0" ); arma_rng::randn::fill(out.memptr(), n_elem, mu, sd); } @@ -135,7 +135,7 @@ inline obj_type randn(const uword n_elem, const distr_param& param = distr_param(), const typename arma_Mat_Col_Row_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename obj_type::elem_type eT; @@ -156,7 +156,7 @@ randn(const uword n_elem, const distr_param& param = distr_param(), const typena param.get_double_vals(mu,sd); - arma_debug_check( (sd <= double(0)), "randn(): incorrect distribution parameters; standard deviation must be > 0" ); + arma_conform_check( (sd <= double(0)), "randn(): incorrect distribution parameters; standard deviation must be > 0" ); arma_rng::randn::fill(out.memptr(), out.n_elem, mu, sd); } @@ -173,7 +173,7 @@ inline mat randn(const uword n_rows, const uword n_cols, const distr_param& param = distr_param()) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); mat out(n_rows, n_cols, arma_nozeros_indicator()); @@ -188,7 +188,7 @@ randn(const uword n_rows, const uword n_cols, const distr_param& param = distr_p param.get_double_vals(mu,sd); - arma_debug_check( (sd <= double(0)), "randn(): incorrect distribution parameters; standard deviation must be > 0" ); + arma_conform_check( (sd <= double(0)), "randn(): incorrect distribution parameters; standard deviation must be > 0" ); arma_rng::randn::fill(out.memptr(), out.n_elem, mu, sd); } @@ -203,7 +203,7 @@ inline mat randn(const SizeMat& s, const distr_param& param = distr_param()) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return randn(s.n_rows, s.n_cols, param); } @@ -216,13 +216,13 @@ inline obj_type randn(const uword n_rows, const uword n_cols, const distr_param& param = distr_param(), const typename arma_Mat_Col_Row_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename obj_type::elem_type eT; - if(is_Col::value) { arma_debug_check( (n_cols != 1), "randn(): incompatible size" ); } - if(is_Row::value) { arma_debug_check( (n_rows != 1), "randn(): incompatible size" ); } + if(is_Col::value) { arma_conform_check( (n_cols != 1), "randn(): incompatible size" ); } + if(is_Row::value) { arma_conform_check( (n_rows != 1), "randn(): incompatible size" ); } obj_type out(n_rows, n_cols, arma_nozeros_indicator()); @@ -237,7 +237,7 @@ randn(const uword n_rows, const uword n_cols, const distr_param& param = distr_p param.get_double_vals(mu,sd); - arma_debug_check( (sd <= double(0)), "randn(): incorrect distribution parameters; standard deviation must be > 0" ); + arma_conform_check( (sd <= double(0)), "randn(): incorrect distribution parameters; standard deviation must be > 0" ); arma_rng::randn::fill(out.memptr(), out.n_elem, mu, sd); } @@ -253,7 +253,7 @@ inline obj_type randn(const SizeMat& s, const distr_param& param = distr_param(), const typename arma_Mat_Col_Row_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return randn(s.n_rows, s.n_cols, param); @@ -269,7 +269,7 @@ inline cube randn(const uword n_rows, const uword n_cols, const uword n_slices, const distr_param& param = distr_param()) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); cube out(n_rows, n_cols, n_slices, arma_nozeros_indicator()); @@ -284,7 +284,7 @@ randn(const uword n_rows, const uword n_cols, const uword n_slices, const distr_ param.get_double_vals(mu,sd); - arma_debug_check( (sd <= double(0)), "randn(): incorrect distribution parameters; standard deviation must be > 0" ); + arma_conform_check( (sd <= double(0)), "randn(): incorrect distribution parameters; standard deviation must be > 0" ); arma_rng::randn::fill(out.memptr(), out.n_elem, mu, sd); } @@ -299,7 +299,7 @@ inline cube randn(const SizeCube& s, const distr_param& param = distr_param()) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return randn(s.n_rows, s.n_cols, s.n_slices, param); } @@ -312,7 +312,7 @@ inline cube_type randn(const uword n_rows, const uword n_cols, const uword n_slices, const distr_param& param = distr_param(), const typename arma_Cube_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename cube_type::elem_type eT; @@ -330,7 +330,7 @@ randn(const uword n_rows, const uword n_cols, const uword n_slices, const distr_ param.get_double_vals(mu,sd); - arma_debug_check( (sd <= double(0)), "randn(): incorrect distribution parameters; standard deviation must be > 0" ); + arma_conform_check( (sd <= double(0)), "randn(): incorrect distribution parameters; standard deviation must be > 0" ); arma_rng::randn::fill(out.memptr(), out.n_elem, mu, sd); } @@ -346,7 +346,7 @@ inline cube_type randn(const SizeCube& s, const distr_param& param = distr_param(), const typename arma_Cube_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return randn(s.n_rows, s.n_cols, s.n_slices, param); diff --git a/inst/include/armadillo_bits/fn_randperm.hpp b/inst/include/armadillo_bits/fn_randperm.hpp index 19623a75..5fb55bb7 100644 --- a/inst/include/armadillo_bits/fn_randperm.hpp +++ b/inst/include/armadillo_bits/fn_randperm.hpp @@ -26,7 +26,7 @@ inline void internal_randperm_helper(obj_type& x, const uword N, const uword N_keep) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename obj_type::elem_type eT; @@ -86,7 +86,7 @@ inline typename enable_if2< is_Mat::value, obj_type >::result randperm(const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); obj_type x; @@ -102,7 +102,7 @@ inline uvec randperm(const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uvec x; @@ -119,9 +119,9 @@ inline typename enable_if2< is_Mat::value, obj_type >::result randperm(const uword N, const uword M) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (M > N), "randperm(): 'M' must be less than or equal to 'N'" ); + arma_conform_check( (M > N), "randperm(): 'M' must be less than or equal to 'N'" ); obj_type x; @@ -137,9 +137,9 @@ inline uvec randperm(const uword N, const uword M) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (M > N), "randperm(): 'M' must be less than or equal to 'N'" ); + arma_conform_check( (M > N), "randperm(): 'M' must be less than or equal to 'N'" ); uvec x; diff --git a/inst/include/armadillo_bits/fn_randu.hpp b/inst/include/armadillo_bits/fn_randu.hpp index 432c1716..14518100 100644 --- a/inst/include/armadillo_bits/fn_randu.hpp +++ b/inst/include/armadillo_bits/fn_randu.hpp @@ -28,7 +28,7 @@ inline double randu() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return double(arma_rng::randu()); } @@ -41,7 +41,7 @@ inline typename arma_real_or_cx_only::result randu() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eT(arma_rng::randu()); } @@ -53,7 +53,7 @@ inline double randu(const distr_param& param) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(param.state == 0) { return double(arma_rng::randu()); } @@ -62,7 +62,7 @@ randu(const distr_param& param) param.get_double_vals(a,b); - arma_debug_check( (a >= b), "randu(): incorrect distribution parameters; a must be less than b" ); + arma_conform_check( (a >= b), "randu(): incorrect distribution parameters; a must be less than b" ); const double val = double(arma_rng::randu()); @@ -77,7 +77,7 @@ inline typename arma_real_or_cx_only::result randu(const distr_param& param) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(param.state == 0) { return eT(arma_rng::randu()); } @@ -86,7 +86,7 @@ randu(const distr_param& param) param.get_double_vals(a,b); - arma_debug_check( (a >= b), "randu(): incorrect distribution parameters; a must be less than b" ); + arma_conform_check( (a >= b), "randu(): incorrect distribution parameters; a must be less than b" ); eT val = eT(0); @@ -104,7 +104,7 @@ inline vec randu(const uword n_elem, const distr_param& param = distr_param()) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); vec out(n_elem, arma_nozeros_indicator()); @@ -119,7 +119,7 @@ randu(const uword n_elem, const distr_param& param = distr_param()) param.get_double_vals(a,b); - arma_debug_check( (a >= b), "randu(): incorrect distribution parameters; a must be less than b" ); + arma_conform_check( (a >= b), "randu(): incorrect distribution parameters; a must be less than b" ); arma_rng::randu::fill(out.memptr(), n_elem, a, b); } @@ -135,7 +135,7 @@ inline obj_type randu(const uword n_elem, const distr_param& param = distr_param(), const typename arma_Mat_Col_Row_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename obj_type::elem_type eT; @@ -156,7 +156,7 @@ randu(const uword n_elem, const distr_param& param = distr_param(), const typena param.get_double_vals(a,b); - arma_debug_check( (a >= b), "randu(): incorrect distribution parameters; a must be less than b" ); + arma_conform_check( (a >= b), "randu(): incorrect distribution parameters; a must be less than b" ); arma_rng::randu::fill(out.memptr(), out.n_elem, a, b); } @@ -173,7 +173,7 @@ inline mat randu(const uword n_rows, const uword n_cols, const distr_param& param = distr_param()) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); mat out(n_rows, n_cols, arma_nozeros_indicator()); @@ -188,7 +188,7 @@ randu(const uword n_rows, const uword n_cols, const distr_param& param = distr_p param.get_double_vals(a,b); - arma_debug_check( (a >= b), "randu(): incorrect distribution parameters; a must be less than b" ); + arma_conform_check( (a >= b), "randu(): incorrect distribution parameters; a must be less than b" ); arma_rng::randu::fill(out.memptr(), out.n_elem, a, b); } @@ -203,7 +203,7 @@ inline mat randu(const SizeMat& s, const distr_param& param = distr_param()) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return randu(s.n_rows, s.n_cols, param); } @@ -216,13 +216,13 @@ inline obj_type randu(const uword n_rows, const uword n_cols, const distr_param& param = distr_param(), const typename arma_Mat_Col_Row_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename obj_type::elem_type eT; - if(is_Col::value) { arma_debug_check( (n_cols != 1), "randu(): incompatible size" ); } - if(is_Row::value) { arma_debug_check( (n_rows != 1), "randu(): incompatible size" ); } + if(is_Col::value) { arma_conform_check( (n_cols != 1), "randu(): incompatible size" ); } + if(is_Row::value) { arma_conform_check( (n_rows != 1), "randu(): incompatible size" ); } obj_type out(n_rows, n_cols, arma_nozeros_indicator()); @@ -237,7 +237,7 @@ randu(const uword n_rows, const uword n_cols, const distr_param& param = distr_p param.get_double_vals(a,b); - arma_debug_check( (a >= b), "randu(): incorrect distribution parameters; a must be less than b" ); + arma_conform_check( (a >= b), "randu(): incorrect distribution parameters; a must be less than b" ); arma_rng::randu::fill(out.memptr(), out.n_elem, a, b); } @@ -253,7 +253,7 @@ inline obj_type randu(const SizeMat& s, const distr_param& param = distr_param(), const typename arma_Mat_Col_Row_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return randu(s.n_rows, s.n_cols, param); @@ -269,7 +269,7 @@ inline cube randu(const uword n_rows, const uword n_cols, const uword n_slices, const distr_param& param = distr_param()) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); cube out(n_rows, n_cols, n_slices, arma_nozeros_indicator()); @@ -284,7 +284,7 @@ randu(const uword n_rows, const uword n_cols, const uword n_slices, const distr_ param.get_double_vals(a,b); - arma_debug_check( (a >= b), "randu(): incorrect distribution parameters; a must be less than b" ); + arma_conform_check( (a >= b), "randu(): incorrect distribution parameters; a must be less than b" ); arma_rng::randu::fill(out.memptr(), out.n_elem, a, b); } @@ -299,7 +299,7 @@ inline cube randu(const SizeCube& s, const distr_param& param = distr_param()) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return randu(s.n_rows, s.n_cols, s.n_slices, param); } @@ -312,7 +312,7 @@ inline cube_type randu(const uword n_rows, const uword n_cols, const uword n_slices, const distr_param& param = distr_param(), const typename arma_Cube_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename cube_type::elem_type eT; @@ -330,7 +330,7 @@ randu(const uword n_rows, const uword n_cols, const uword n_slices, const distr_ param.get_double_vals(a,b); - arma_debug_check( (a >= b), "randu(): incorrect distribution parameters; a must be less than b" ); + arma_conform_check( (a >= b), "randu(): incorrect distribution parameters; a must be less than b" ); arma_rng::randu::fill(out.memptr(), out.n_elem, a, b); } @@ -346,7 +346,7 @@ inline cube_type randu(const SizeCube& s, const distr_param& param = distr_param(), const typename arma_Cube_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return randu(s.n_rows, s.n_cols, s.n_slices, param); diff --git a/inst/include/armadillo_bits/fn_range.hpp b/inst/include/armadillo_bits/fn_range.hpp index 3a280945..3d4171ad 100644 --- a/inst/include/armadillo_bits/fn_range.hpp +++ b/inst/include/armadillo_bits/fn_range.hpp @@ -26,7 +26,7 @@ inline typename enable_if2< is_arma_type::value && resolves_to_vector::yes, typename T1::elem_type >::result range(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return op_range::vector_range(X); } @@ -39,7 +39,7 @@ arma_inline typename enable_if2< is_arma_type::value && resolves_to_vector::no, const Op >::result range(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, 0, 0); } @@ -52,7 +52,7 @@ arma_inline typename enable_if2< is_arma_type::value, const Op >::result range(const T1& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, dim, 0); } diff --git a/inst/include/armadillo_bits/fn_rank.hpp b/inst/include/armadillo_bits/fn_rank.hpp index 7701a049..a90bfbdf 100644 --- a/inst/include/armadillo_bits/fn_rank.hpp +++ b/inst/include/armadillo_bits/fn_rank.hpp @@ -27,7 +27,7 @@ inline typename enable_if2< is_supported_blas_type::value, uword >::result rank(const Base& expr, const typename T1::pod_type tol = 0) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uword out = uword(0); @@ -45,7 +45,7 @@ inline typename enable_if2< is_supported_blas_type::value, bool >::result rank(uword& out, const Base& expr, const typename T1::pod_type tol = 0) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out = uword(0); diff --git a/inst/include/armadillo_bits/fn_regspace.hpp b/inst/include/armadillo_bits/fn_regspace.hpp index 83e7de2c..e91d1030 100644 --- a/inst/include/armadillo_bits/fn_regspace.hpp +++ b/inst/include/armadillo_bits/fn_regspace.hpp @@ -31,7 +31,7 @@ internal_regspace_default_delta const typename Mat::pod_type end ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename Mat::pod_type T; @@ -66,8 +66,8 @@ internal_regspace_var_delta const typename Mat::pod_type end ) { - arma_extra_debug_sigprint(); - arma_extra_debug_print("internal_regspace_var_delta(): signed version"); + arma_debug_sigprint(); + arma_debug_print("internal_regspace_var_delta(): signed version"); typedef typename Mat::pod_type T; @@ -108,8 +108,8 @@ internal_regspace_var_delta const typename Mat::pod_type end ) { - arma_extra_debug_sigprint(); - arma_extra_debug_print("internal_regspace_var_delta(): unsigned version"); + arma_debug_sigprint(); + arma_debug_print("internal_regspace_var_delta(): unsigned version"); typedef typename Mat::pod_type T; @@ -149,8 +149,8 @@ regspace const typename vec_type::pod_type end ) { - arma_extra_debug_sigprint(); - arma_extra_debug_print("regspace(): signed version"); + arma_debug_sigprint(); + arma_debug_print("regspace(): signed version"); vec_type x; @@ -183,8 +183,8 @@ regspace const typename vec_type::pod_type end ) { - arma_extra_debug_sigprint(); - arma_extra_debug_print("regspace(): unsigned version"); + arma_debug_sigprint(); + arma_debug_print("regspace(): unsigned version"); vec_type x; @@ -222,7 +222,7 @@ regspace const typename vec_type::pod_type end ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); vec_type x; @@ -243,7 +243,7 @@ inline vec regspace(const double start, const double delta, const double end) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return regspace(start, delta, end); } @@ -255,7 +255,7 @@ inline vec regspace(const double start, const double end) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return regspace(start, end); } diff --git a/inst/include/armadillo_bits/fn_repelem.hpp b/inst/include/armadillo_bits/fn_repelem.hpp index 5d1e8177..d2429272 100644 --- a/inst/include/armadillo_bits/fn_repelem.hpp +++ b/inst/include/armadillo_bits/fn_repelem.hpp @@ -32,7 +32,7 @@ enable_if2 >::result repelem(const T1& A, const uword r, const uword c) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(A, r, c); } @@ -45,7 +45,7 @@ arma_inline const SpOp repelem(const SpBase& A, const uword r, const uword c) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpOp(A.get_ref(), r, c); } diff --git a/inst/include/armadillo_bits/fn_repmat.hpp b/inst/include/armadillo_bits/fn_repmat.hpp index 113bfb39..c662be13 100644 --- a/inst/include/armadillo_bits/fn_repmat.hpp +++ b/inst/include/armadillo_bits/fn_repmat.hpp @@ -32,7 +32,7 @@ enable_if2 >::result repmat(const T1& A, const uword r, const uword c) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(A, r, c); } @@ -45,7 +45,7 @@ arma_inline const SpOp repmat(const SpBase& A, const uword r, const uword c) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpOp(A.get_ref(), r, c); } diff --git a/inst/include/armadillo_bits/fn_reshape.hpp b/inst/include/armadillo_bits/fn_reshape.hpp index 35bef091..d64603f3 100644 --- a/inst/include/armadillo_bits/fn_reshape.hpp +++ b/inst/include/armadillo_bits/fn_reshape.hpp @@ -27,7 +27,7 @@ inline typename enable_if2< is_arma_type::value, const Op >::result reshape(const T1& X, const uword new_n_rows, const uword new_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, new_n_rows, new_n_cols); } @@ -40,7 +40,7 @@ inline typename enable_if2< is_arma_type::value, const Op >::result reshape(const T1& X, const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, s.n_rows, s.n_cols); } @@ -53,11 +53,11 @@ inline Mat reshape(const Base& X, const uword new_n_rows, const uword new_n_cols, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; - arma_debug_check( (dim > 1), "reshape(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "reshape(): parameter 'dim' must be 0 or 1" ); const quasi_unwrap U(X.get_ref()); const Mat& A = U.M; @@ -89,7 +89,7 @@ inline const OpCube reshape(const BaseCube& X, const uword new_n_rows, const uword new_n_cols, const uword new_n_slices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return OpCube(X.get_ref(), new_n_rows, new_n_cols, new_n_slices); } @@ -102,7 +102,7 @@ inline const OpCube reshape(const BaseCube& X, const SizeCube& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return OpCube(X.get_ref(), s.n_rows, s.n_cols, s.n_slices); } @@ -115,7 +115,7 @@ inline const SpOp reshape(const SpBase& X, const uword new_n_rows, const uword new_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpOp(X.get_ref(), new_n_rows, new_n_cols); } @@ -128,7 +128,7 @@ inline const SpOp reshape(const SpBase& X, const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpOp(X.get_ref(), s.n_rows, s.n_cols); } diff --git a/inst/include/armadillo_bits/fn_resize.hpp b/inst/include/armadillo_bits/fn_resize.hpp index 7088290d..c61bd268 100644 --- a/inst/include/armadillo_bits/fn_resize.hpp +++ b/inst/include/armadillo_bits/fn_resize.hpp @@ -27,7 +27,7 @@ inline const Op resize(const Base& X, const uword in_n_rows, const uword in_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X.get_ref(), in_n_rows, in_n_cols); } @@ -40,7 +40,7 @@ inline const Op resize(const Base& X, const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X.get_ref(), s.n_rows, s.n_cols); } @@ -53,7 +53,7 @@ inline const OpCube resize(const BaseCube& X, const uword in_n_rows, const uword in_n_cols, const uword in_n_slices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return OpCube(X.get_ref(), in_n_rows, in_n_cols, in_n_slices); } @@ -66,7 +66,7 @@ inline const OpCube resize(const BaseCube& X, const SizeCube& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return OpCube(X.get_ref(), s.n_rows, s.n_cols, s.n_slices); } @@ -79,7 +79,7 @@ inline const SpOp resize(const SpBase& X, const uword in_n_rows, const uword in_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpOp(X.get_ref(), in_n_rows, in_n_cols); } @@ -92,7 +92,7 @@ inline const SpOp resize(const SpBase& X, const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpOp(X.get_ref(), s.n_rows, s.n_cols); } diff --git a/inst/include/armadillo_bits/fn_reverse.hpp b/inst/include/armadillo_bits/fn_reverse.hpp index 284c80dd..46d50bea 100644 --- a/inst/include/armadillo_bits/fn_reverse.hpp +++ b/inst/include/armadillo_bits/fn_reverse.hpp @@ -35,7 +35,7 @@ reverse const T1& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X); } @@ -56,7 +56,7 @@ reverse const T1& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, 0, 0); } @@ -73,7 +73,7 @@ reverse const uword dim ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, dim, 0); } @@ -90,7 +90,7 @@ reverse const uword dim = 0 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpOp(X.get_ref(), dim, 0); } diff --git a/inst/include/armadillo_bits/fn_roots.hpp b/inst/include/armadillo_bits/fn_roots.hpp index 80fe240c..137adcf7 100644 --- a/inst/include/armadillo_bits/fn_roots.hpp +++ b/inst/include/armadillo_bits/fn_roots.hpp @@ -32,7 +32,7 @@ enable_if2 >::result roots(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp, T1, op_roots>(X.get_ref()); } @@ -49,14 +49,14 @@ enable_if2 >::result roots(Mat< std::complex >& out, const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_roots::apply_direct(out, X.get_ref()); if(status == false) { out.soft_reset(); - arma_debug_warn_level(3, "roots(): eigen decomposition failed"); + arma_conform_warn(3, "roots(): eigen decomposition failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_schur.hpp b/inst/include/armadillo_bits/fn_schur.hpp index f9f277c8..62f2dbc7 100644 --- a/inst/include/armadillo_bits/fn_schur.hpp +++ b/inst/include/armadillo_bits/fn_schur.hpp @@ -30,7 +30,7 @@ schur const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; @@ -42,7 +42,7 @@ schur if(status == false) { S.soft_reset(); - arma_debug_warn_level(3, "schur(): decomposition failed"); + arma_conform_warn(3, "schur(): decomposition failed"); } return status; @@ -60,7 +60,7 @@ schur const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; @@ -92,10 +92,10 @@ schur const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); - arma_debug_check( void_ptr(&U) == void_ptr(&S), "schur(): 'U' is an alias of 'S'" ); + arma_conform_check( void_ptr(&U) == void_ptr(&S), "schur(): 'U' is an alias of 'S'" ); const bool status = auxlib::schur(U, S, X.get_ref(), true); @@ -103,7 +103,7 @@ schur { U.soft_reset(); S.soft_reset(); - arma_debug_warn_level(3, "schur(): decomposition failed"); + arma_conform_warn(3, "schur(): decomposition failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_shift.hpp b/inst/include/armadillo_bits/fn_shift.hpp index 879f5dca..3ee13a21 100644 --- a/inst/include/armadillo_bits/fn_shift.hpp +++ b/inst/include/armadillo_bits/fn_shift.hpp @@ -36,7 +36,7 @@ shift const sword N ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword len = (N < 0) ? uword(-N) : uword(N); const uword neg = (N < 0) ? uword( 1) : uword(0); @@ -61,7 +61,7 @@ shift const sword N ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -95,11 +95,11 @@ shift const uword dim ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; - arma_debug_check( (dim > 1), "shift(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "shift(): parameter 'dim' must be 0 or 1" ); const uword len = (N < 0) ? uword(-N) : uword(N); const uword neg = (N < 0) ? uword( 1) : uword(0); @@ -130,11 +130,11 @@ shift const uword dim = 0 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; - arma_debug_check( (dim > 1), "shift(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "shift(): parameter 'dim' must be 0 or 1" ); const uword len = (N < 0) ? uword(-N) : uword(N); const uword neg = (N < 0) ? uword( 1) : uword(0); diff --git a/inst/include/armadillo_bits/fn_shuffle.hpp b/inst/include/armadillo_bits/fn_shuffle.hpp index a0e0f652..2cd46314 100644 --- a/inst/include/armadillo_bits/fn_shuffle.hpp +++ b/inst/include/armadillo_bits/fn_shuffle.hpp @@ -35,7 +35,7 @@ shuffle const T1& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X); } @@ -56,7 +56,7 @@ shuffle const T1& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, 0, 0); } @@ -78,7 +78,7 @@ shuffle const uword dim ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, dim, 0); } diff --git a/inst/include/armadillo_bits/fn_size.hpp b/inst/include/armadillo_bits/fn_size.hpp index b6ac80ec..50258d2c 100644 --- a/inst/include/armadillo_bits/fn_size.hpp +++ b/inst/include/armadillo_bits/fn_size.hpp @@ -26,7 +26,7 @@ inline const SizeMat size(const uword n_rows, const uword n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SizeMat(n_rows, n_cols); } @@ -39,7 +39,7 @@ inline const SizeMat size(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Proxy P(X.get_ref()); @@ -55,7 +55,7 @@ inline const SizeMat size(const Mat& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SizeMat( X.n_rows, X.n_cols ); } @@ -69,7 +69,7 @@ inline const SizeMat size(const Row& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SizeMat( X.n_rows, X.n_cols ); } @@ -83,7 +83,7 @@ inline const SizeMat size(const Col& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SizeMat( X.n_rows, X.n_cols ); } @@ -95,20 +95,20 @@ inline const SizeMat size(const arma::span& row_span, const arma::span& col_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uword n_rows = 0; uword n_cols = 0; if(row_span.whole || col_span.whole) { - arma_debug_check(true, "size(): span::all not supported"); + arma_conform_check(true, "size(): span::all not supported"); } else { if((row_span.a > row_span.b) || (col_span.a > col_span.b)) { - arma_debug_check_bounds(true, "size(): span indices incorrectly used"); + arma_conform_check_bounds(true, "size(): span indices incorrectly used"); } else { @@ -128,7 +128,7 @@ inline uword size(const Base& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Proxy P(X.get_ref()); @@ -142,7 +142,7 @@ inline const SizeCube size(const uword n_rows, const uword n_cols, const uword n_slices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SizeCube(n_rows, n_cols, n_slices); } @@ -155,7 +155,7 @@ inline const SizeCube size(const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const ProxyCube P(X.get_ref()); @@ -171,7 +171,7 @@ inline const SizeCube size(const Cube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SizeCube( X.n_rows, X.n_cols, X.n_slices ); } @@ -184,7 +184,7 @@ inline uword size(const BaseCube& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const ProxyCube P(X.get_ref()); @@ -198,7 +198,7 @@ inline const SizeCube size(const arma::span& row_span, const arma::span& col_span, const arma::span& slice_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uword n_rows = 0; uword n_cols = 0; @@ -206,13 +206,13 @@ size(const arma::span& row_span, const arma::span& col_span, const arma::span& s if(row_span.whole || col_span.whole || slice_span.whole) { - arma_debug_check(true, "size(): span::all not supported"); + arma_conform_check(true, "size(): span::all not supported"); } else { if((row_span.a > row_span.b) || (col_span.a > col_span.b) || (slice_span.a > slice_span.b)) { - arma_debug_check_bounds(true, "size(): span indices incorrectly used"); + arma_conform_check_bounds(true, "size(): span indices incorrectly used"); } else { @@ -233,7 +233,7 @@ inline const SizeMat size(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy P(X.get_ref()); @@ -249,7 +249,7 @@ inline const SizeMat size(const SpMat& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SizeMat( X.n_rows, X.n_cols ); } @@ -262,7 +262,7 @@ inline uword size(const SpBase& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy P(X.get_ref()); @@ -278,7 +278,7 @@ inline const SizeCube size(const field& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SizeCube( X.n_rows, X.n_cols, X.n_slices ); } @@ -291,7 +291,7 @@ inline uword size(const field& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SizeCube( X.n_rows, X.n_cols, X.n_slices )( dim ); } @@ -304,7 +304,7 @@ inline const SizeCube size(const subview_field& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SizeCube( X.n_rows, X.n_cols, X.n_slices ); } @@ -317,7 +317,7 @@ inline uword size(const subview_field& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SizeCube( X.n_rows, X.n_cols, X.n_slices )( dim ); } diff --git a/inst/include/armadillo_bits/fn_solve.hpp b/inst/include/armadillo_bits/fn_solve.hpp index 12ca693b..ea52bb78 100644 --- a/inst/include/armadillo_bits/fn_solve.hpp +++ b/inst/include/armadillo_bits/fn_solve.hpp @@ -35,7 +35,7 @@ solve const Base& B ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Glue(A.get_ref(), B.get_ref()); } @@ -52,14 +52,14 @@ solve const Base& B ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = glue_solve_gen_default::apply(out, A.get_ref(), B.get_ref()); if(status == false) { out.soft_reset(); - arma_debug_warn_level(3, "solve(): solution not found"); + arma_conform_warn(3, "solve(): solution not found"); } return status; @@ -78,7 +78,7 @@ solve const solve_opts::opts& opts ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Glue(A.get_ref(), B.get_ref(), opts.flags); } @@ -96,14 +96,14 @@ solve const solve_opts::opts& opts ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = glue_solve_gen_full::apply(out, A.get_ref(), B.get_ref(), opts.flags); if(status == false) { out.soft_reset(); - arma_debug_warn_level(3, "solve(): solution not found"); + arma_conform_warn(3, "solve(): solution not found"); } return status; @@ -125,7 +125,7 @@ solve const Base& B ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uword flags = uword(0); @@ -148,7 +148,7 @@ solve const solve_opts::opts& opts ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uword flags = opts.flags; @@ -170,7 +170,7 @@ solve const Base& B ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uword flags = uword(0); @@ -182,7 +182,7 @@ solve if(status == false) { out.soft_reset(); - arma_debug_warn_level(3, "solve(): solution not found"); + arma_conform_warn(3, "solve(): solution not found"); } return status; @@ -201,7 +201,7 @@ solve const solve_opts::opts& opts ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uword flags = opts.flags; @@ -213,7 +213,7 @@ solve if(status == false) { out.soft_reset(); - arma_debug_warn_level(3, "solve(): solution not found"); + arma_conform_warn(3, "solve(): solution not found"); } return status; diff --git a/inst/include/armadillo_bits/fn_sort.hpp b/inst/include/armadillo_bits/fn_sort.hpp index 01b45f2b..f773223e 100644 --- a/inst/include/armadillo_bits/fn_sort.hpp +++ b/inst/include/armadillo_bits/fn_sort.hpp @@ -35,7 +35,7 @@ sort const T1& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, 0, 0); } @@ -56,7 +56,7 @@ sort const T1& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, 0, 0); } @@ -78,11 +78,11 @@ sort const T2* sort_direction ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const char sig = (sort_direction != nullptr) ? sort_direction[0] : char(0); - arma_debug_check( (sig != 'a') && (sig != 'd'), "sort(): unknown sort direction" ); + arma_conform_check( (sig != 'a') && (sig != 'd'), "sort(): unknown sort direction" ); const uword sort_type = (sig == 'a') ? 0 : 1; @@ -106,11 +106,11 @@ sort const T2* sort_direction ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const char sig = (sort_direction != nullptr) ? sort_direction[0] : char(0); - arma_debug_check( (sig != 'a') && (sig != 'd'), "sort(): unknown sort direction" ); + arma_conform_check( (sig != 'a') && (sig != 'd'), "sort(): unknown sort direction" ); const uword sort_type = (sig == 'a') ? 0 : 1; @@ -135,11 +135,11 @@ sort const uword dim ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const char sig = (sort_direction != nullptr) ? sort_direction[0] : char(0); - arma_debug_check( (sig != 'a') && (sig != 'd'), "sort(): unknown sort direction" ); + arma_conform_check( (sig != 'a') && (sig != 'd'), "sort(): unknown sort direction" ); const uword sort_type = (sig == 'a') ? 0 : 1; diff --git a/inst/include/armadillo_bits/fn_sort_index.hpp b/inst/include/armadillo_bits/fn_sort_index.hpp index 1df3693c..6796a9b6 100644 --- a/inst/include/armadillo_bits/fn_sort_index.hpp +++ b/inst/include/armadillo_bits/fn_sort_index.hpp @@ -30,7 +30,7 @@ sort_index const Base& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X.get_ref(), uword(0), uword(0)); } @@ -52,11 +52,11 @@ sort_index const T2* sort_direction ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const char sig = (sort_direction != nullptr) ? sort_direction[0] : char(0); - arma_debug_check( ((sig != 'a') && (sig != 'd')), "sort_index(): unknown sort direction" ); + arma_conform_check( ((sig != 'a') && (sig != 'd')), "sort_index(): unknown sort direction" ); return mtOp(X, ((sig == 'a') ? uword(0) : uword(1)), uword(0)); } @@ -76,7 +76,7 @@ stable_sort_index const Base& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X.get_ref(), uword(0), uword(0)); } @@ -98,11 +98,11 @@ stable_sort_index const T2* sort_direction ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const char sig = (sort_direction != nullptr) ? sort_direction[0] : char(0); - arma_debug_check( ((sig != 'a') && (sig != 'd')), "stable_sort_index(): unknown sort direction" ); + arma_conform_check( ((sig != 'a') && (sig != 'd')), "stable_sort_index(): unknown sort direction" ); return mtOp(X, ((sig == 'a') ? uword(0) : uword(1)), uword(0)); } diff --git a/inst/include/armadillo_bits/fn_speye.hpp b/inst/include/armadillo_bits/fn_speye.hpp index 48570be2..680d361b 100644 --- a/inst/include/armadillo_bits/fn_speye.hpp +++ b/inst/include/armadillo_bits/fn_speye.hpp @@ -28,11 +28,11 @@ inline obj_type speye(const uword n_rows, const uword n_cols, const typename arma_SpMat_SpCol_SpRow_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); - if(is_SpCol::value) { arma_debug_check( (n_cols != 1), "speye(): incompatible size" ); } - if(is_SpRow::value) { arma_debug_check( (n_rows != 1), "speye(): incompatible size" ); } + if(is_SpCol::value) { arma_conform_check( (n_cols != 1), "speye(): incompatible size" ); } + if(is_SpRow::value) { arma_conform_check( (n_rows != 1), "speye(): incompatible size" ); } obj_type out; @@ -49,7 +49,7 @@ inline obj_type speye(const SizeMat& s, const typename arma_SpMat_SpCol_SpRow_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return speye(s.n_rows, s.n_cols); @@ -63,7 +63,7 @@ inline sp_mat speye(const uword n_rows, const uword n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sp_mat out; @@ -79,7 +79,7 @@ inline sp_mat speye(const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sp_mat out; diff --git a/inst/include/armadillo_bits/fn_spones.hpp b/inst/include/armadillo_bits/fn_spones.hpp index ff45b218..e3f4ac48 100644 --- a/inst/include/armadillo_bits/fn_spones.hpp +++ b/inst/include/armadillo_bits/fn_spones.hpp @@ -29,7 +29,7 @@ inline SpMat spones(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/fn_sprandn.hpp b/inst/include/armadillo_bits/fn_sprandn.hpp index 1798224a..4e39278d 100644 --- a/inst/include/armadillo_bits/fn_sprandn.hpp +++ b/inst/include/armadillo_bits/fn_sprandn.hpp @@ -35,17 +35,17 @@ sprandn const typename arma_SpMat_SpCol_SpRow_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); if(is_SpCol::value) { - arma_debug_check( (n_cols != 1), "sprandn(): incompatible size" ); + arma_conform_check( (n_cols != 1), "sprandn(): incompatible size" ); } else if(is_SpRow::value) { - arma_debug_check( (n_rows != 1), "sprandn(): incompatible size" ); + arma_conform_check( (n_rows != 1), "sprandn(): incompatible size" ); } obj_type out; @@ -63,7 +63,7 @@ inline obj_type sprandn(const SizeMat& s, const double density, const typename arma_SpMat_SpCol_SpRow_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return sprandn(s.n_rows, s.n_cols, density); @@ -76,7 +76,7 @@ inline sp_mat sprandn(const uword n_rows, const uword n_cols, const double density) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sp_mat out; @@ -92,7 +92,7 @@ inline sp_mat sprandn(const SizeMat& s, const double density) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sp_mat out; @@ -111,7 +111,7 @@ inline SpMat sprandn(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/fn_sprandu.hpp b/inst/include/armadillo_bits/fn_sprandu.hpp index 846e75b0..7540d562 100644 --- a/inst/include/armadillo_bits/fn_sprandu.hpp +++ b/inst/include/armadillo_bits/fn_sprandu.hpp @@ -35,17 +35,17 @@ sprandu const typename arma_SpMat_SpCol_SpRow_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); if(is_SpCol::value) { - arma_debug_check( (n_cols != 1), "sprandu(): incompatible size" ); + arma_conform_check( (n_cols != 1), "sprandu(): incompatible size" ); } else if(is_SpRow::value) { - arma_debug_check( (n_rows != 1), "sprandu(): incompatible size" ); + arma_conform_check( (n_rows != 1), "sprandu(): incompatible size" ); } obj_type out; @@ -63,7 +63,7 @@ inline obj_type sprandu(const SizeMat& s, const double density, const typename arma_SpMat_SpCol_SpRow_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return sprandu(s.n_rows, s.n_cols, density); @@ -76,7 +76,7 @@ inline sp_mat sprandu(const uword n_rows, const uword n_cols, const double density) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sp_mat out; @@ -92,7 +92,7 @@ inline sp_mat sprandu(const SizeMat& s, const double density) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); sp_mat out; @@ -111,7 +111,7 @@ inline SpMat sprandu(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/fn_spsolve.hpp b/inst/include/armadillo_bits/fn_spsolve.hpp index 3eaf333b..499598b6 100644 --- a/inst/include/armadillo_bits/fn_spsolve.hpp +++ b/inst/include/armadillo_bits/fn_spsolve.hpp @@ -34,7 +34,7 @@ spsolve_helper const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::pod_type T; @@ -42,7 +42,7 @@ spsolve_helper const char sig = (solver != nullptr) ? solver[0] : char(0); - arma_debug_check( ((sig != 'l') && (sig != 's')), "spsolve(): unknown solver" ); + arma_conform_check( ((sig != 'l') && (sig != 's')), "spsolve(): unknown solver" ); T rcond = T(0); @@ -55,7 +55,7 @@ spsolve_helper const superlu_opts& opts = (settings.id == 1) ? static_cast(settings) : superlu_opts_default; - arma_debug_check( ( (opts.pivot_thresh < double(0)) || (opts.pivot_thresh > double(1)) ), "spsolve(): pivot_thresh must be in the [0,1] interval" ); + arma_conform_check( ( (opts.pivot_thresh < double(0)) || (opts.pivot_thresh > double(1)) ), "spsolve(): pivot_thresh must be in the [0,1] interval" ); if(sig == 's') // SuperLU solver { @@ -73,7 +73,7 @@ spsolve_helper { if( (settings.id != 0) && ((opts.symmetric) || (opts.pivot_thresh != double(1))) ) { - arma_debug_warn_level(1, "spsolve(): ignoring settings not applicable to LAPACK based solver"); + arma_conform_warn(1, "spsolve(): ignoring settings not applicable to LAPACK based solver"); } Mat AA; @@ -90,12 +90,12 @@ spsolve_helper } catch(...) { - arma_debug_warn_level(1, "spsolve(): not enough memory to use LAPACK based solver"); + arma_conform_warn(1, "spsolve(): not enough memory to use LAPACK based solver"); } if(conversion_ok) { - arma_debug_check( (AA.n_rows != AA.n_cols), "spsolve(): matrix A must be square sized" ); + arma_conform_check( (AA.n_rows != AA.n_cols), "spsolve(): matrix A must be square sized" ); uword flags = solve_opts::flag_none; @@ -110,12 +110,12 @@ spsolve_helper if( (status == false) && (rcond > T(0)) ) { - arma_debug_warn_level(2, "spsolve(): system is singular (rcond: ", rcond, ")"); + arma_conform_warn(2, "spsolve(): system is singular (rcond: ", rcond, ")"); } if( (status == true) && (rcond > T(0)) && (rcond < std::numeric_limits::epsilon()) ) { - arma_debug_warn_level(2, "solve(): solution computed, but system is singular to working precision (rcond: ", rcond, ")"); + arma_conform_warn(2, "solve(): solution computed, but system is singular to working precision (rcond: ", rcond, ")"); } return status; @@ -140,7 +140,7 @@ spsolve const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const bool status = spsolve_helper(out, A.get_ref(), B.get_ref(), solver, settings); @@ -148,7 +148,7 @@ spsolve if(status == false) { out.soft_reset(); - arma_debug_warn_level(3, "spsolve(): solution not found"); + arma_conform_warn(3, "spsolve(): solution not found"); } return status; @@ -169,7 +169,7 @@ spsolve const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/fn_sqrtmat.hpp b/inst/include/armadillo_bits/fn_sqrtmat.hpp index 882aa15c..9bf029d0 100644 --- a/inst/include/armadillo_bits/fn_sqrtmat.hpp +++ b/inst/include/armadillo_bits/fn_sqrtmat.hpp @@ -27,7 +27,7 @@ arma_inline typename enable_if2< (is_supported_blas_type::value && is_cx::no), const mtOp, T1, op_sqrtmat> >::result sqrtmat(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp, T1, op_sqrtmat>(X.get_ref()); } @@ -40,7 +40,7 @@ arma_inline typename enable_if2< (is_supported_blas_type::value && is_cx::yes), const Op >::result sqrtmat(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X.get_ref()); } @@ -52,13 +52,13 @@ inline typename enable_if2< (is_supported_blas_type::value && is_cx::no), bool >::result sqrtmat(Mat< std::complex >& Y, const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_sqrtmat::apply_direct(Y, X.get_ref()); if(status == false) { - arma_debug_warn_level(3, "sqrtmat(): given matrix is singular; may not have a square root"); + arma_conform_warn(3, "sqrtmat(): given matrix is singular; may not have a square root"); } return status; @@ -71,13 +71,13 @@ inline typename enable_if2< (is_supported_blas_type::value && is_cx::yes), bool >::result sqrtmat(Mat& Y, const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_sqrtmat_cx::apply_direct(Y, X.get_ref()); if(status == false) { - arma_debug_warn_level(3, "sqrtmat(): given matrix is singular; may not have a square root"); + arma_conform_warn(3, "sqrtmat(): given matrix is singular; may not have a square root"); } return status; @@ -95,7 +95,7 @@ arma_inline typename enable_if2< is_supported_blas_type::value, const Op >::result sqrtmat_sympd(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X.get_ref()); } @@ -107,14 +107,14 @@ inline typename enable_if2< is_supported_blas_type::value, bool >::result sqrtmat_sympd(Mat& Y, const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_sqrtmat_sympd::apply_direct(Y, X.get_ref()); if(status == false) { Y.soft_reset(); - arma_debug_warn_level(3, "sqrtmat_sympd(): transformation failed"); + arma_conform_warn(3, "sqrtmat_sympd(): transformation failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_stddev.hpp b/inst/include/armadillo_bits/fn_stddev.hpp index 7544280c..fe60a2f8 100644 --- a/inst/include/armadillo_bits/fn_stddev.hpp +++ b/inst/include/armadillo_bits/fn_stddev.hpp @@ -32,9 +32,9 @@ enable_if2 >::result stddev(const T1& X, const uword norm_type = 0) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - return std::sqrt( op_var::var_vec(X, norm_type) ); + return op_stddev::stddev_vec(X, norm_type); } @@ -50,7 +50,7 @@ enable_if2 >::result stddev(const T1& X, const uword norm_type = 0) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X, norm_type, 0); } @@ -68,7 +68,7 @@ enable_if2 >::result stddev(const T1& X, const uword norm_type, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X, norm_type, dim); } @@ -86,4 +86,58 @@ stddev(const T&) +template +arma_warn_unused +inline +typename +enable_if2 + < + is_arma_sparse_type::value && resolves_to_sparse_vector::yes, + typename T1::pod_type + >::result +stddev(const T1& X, const uword norm_type = 0) + { + arma_debug_sigprint(); + + return op_sp_stddev::stddev_vec(X, norm_type); + } + + + +template +arma_warn_unused +inline +typename +enable_if2 + < + is_arma_sparse_type::value && resolves_to_sparse_vector::no, + const mtSpToDOp + >::result +stddev(const T1& X, const uword norm_type = 0) + { + arma_debug_sigprint(); + + return mtSpToDOp(X, norm_type, 0); + } + + + +template +arma_warn_unused +inline +typename +enable_if2 + < + is_arma_sparse_type::value, + const mtSpToDOp + >::result +stddev(const T1& X, const uword norm_type, const uword dim) + { + arma_debug_sigprint(); + + return mtSpToDOp(X, norm_type, dim); + } + + + //! @} diff --git a/inst/include/armadillo_bits/fn_strans.hpp b/inst/include/armadillo_bits/fn_strans.hpp index de81e198..9ce812f7 100644 --- a/inst/include/armadillo_bits/fn_strans.hpp +++ b/inst/include/armadillo_bits/fn_strans.hpp @@ -32,7 +32,7 @@ strans const typename arma_cx_only::result* junk2 = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); @@ -54,7 +54,7 @@ strans const typename arma_not_cx::result* junk2 = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); @@ -78,7 +78,7 @@ strans const typename arma_cx_only::result* junk2 = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); @@ -98,7 +98,7 @@ strans const typename arma_not_cx::result* junk2 = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); diff --git a/inst/include/armadillo_bits/fn_sum.hpp b/inst/include/armadillo_bits/fn_sum.hpp index 0fa89369..2ae47d24 100644 --- a/inst/include/armadillo_bits/fn_sum.hpp +++ b/inst/include/armadillo_bits/fn_sum.hpp @@ -26,7 +26,7 @@ inline typename enable_if2< is_arma_type::value && resolves_to_vector::yes, typename T1::elem_type >::result sum(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return accu(X); } @@ -39,7 +39,7 @@ arma_inline typename enable_if2< is_arma_type::value && resolves_to_vector::no, const Op >::result sum(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, 0, 0); } @@ -52,7 +52,7 @@ arma_inline typename enable_if2< is_arma_type::value, const Op >::result sum(const T1& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X, dim, 0); } @@ -81,7 +81,7 @@ sum const uword dim = 0 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return OpCube(X.get_ref(), dim, 0); } @@ -100,7 +100,7 @@ enable_if2 >::result sum(const T1& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // sum elements return accu(x); @@ -115,13 +115,13 @@ typename enable_if2 < is_arma_sparse_type::value && resolves_to_sparse_vector::no, - const SpOp + const SpToDOp >::result sum(const T1& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - return SpOp(x, 0, 0); + return SpToDOp(x, 0, 0); } @@ -133,13 +133,13 @@ typename enable_if2 < is_arma_sparse_type::value, - const SpOp + const SpToDOp >::result sum(const T1& x, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - return SpOp(x, dim, 0); + return SpToDOp(x, dim, 0); } diff --git a/inst/include/armadillo_bits/fn_svd.hpp b/inst/include/armadillo_bits/fn_svd.hpp index ff987bb1..961e1a2e 100644 --- a/inst/include/armadillo_bits/fn_svd.hpp +++ b/inst/include/armadillo_bits/fn_svd.hpp @@ -31,7 +31,7 @@ svd const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; @@ -43,7 +43,7 @@ svd if(status == false) { S.soft_reset(); - arma_debug_warn_level(3, "svd(): decomposition failed"); + arma_conform_warn(3, "svd(): decomposition failed"); } return status; @@ -61,7 +61,7 @@ svd const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; @@ -97,12 +97,12 @@ svd const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; - arma_debug_check + arma_conform_check ( ( ((void*)(&U) == (void*)(&S)) || (&U == &V) || ((void*)(&S) == (void*)(&V)) ), "svd(): two or more output objects are the same object" @@ -110,7 +110,7 @@ svd const char sig = (method != nullptr) ? method[0] : char(0); - arma_debug_check( ((sig != 's') && (sig != 'd')), "svd(): unknown method specified" ); + arma_conform_check( ((sig != 's') && (sig != 'd')), "svd(): unknown method specified" ); Mat A(X.get_ref()); @@ -121,7 +121,7 @@ svd U.soft_reset(); S.soft_reset(); V.soft_reset(); - arma_debug_warn_level(3, "svd(): decomposition failed"); + arma_conform_warn(3, "svd(): decomposition failed"); } return status; @@ -143,18 +143,18 @@ svd_econ const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; - arma_debug_check + arma_conform_check ( ( ((void*)(&U) == (void*)(&S)) || (&U == &V) || ((void*)(&S) == (void*)(&V)) ), "svd_econ(): two or more output objects are the same object" ); - arma_debug_check + arma_conform_check ( ( (mode != 'l') && (mode != 'r') && (mode != 'b') ), "svd_econ(): parameter 'mode' is incorrect" @@ -162,7 +162,7 @@ svd_econ const char sig = (method != nullptr) ? method[0] : char(0); - arma_debug_check( ((sig != 's') && (sig != 'd')), "svd_econ(): unknown method specified" ); + arma_conform_check( ((sig != 's') && (sig != 'd')), "svd_econ(): unknown method specified" ); Mat A(X.get_ref()); @@ -173,7 +173,7 @@ svd_econ U.soft_reset(); S.soft_reset(); V.soft_reset(); - arma_debug_warn_level(3, "svd_econ(): decomposition failed"); + arma_conform_warn(3, "svd_econ(): decomposition failed"); } return status; @@ -195,7 +195,7 @@ svd_econ const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return svd_econ(U, S, V, X, ((mode != nullptr) ? mode[0] : char(0)), method); diff --git a/inst/include/armadillo_bits/fn_svds.hpp b/inst/include/armadillo_bits/fn_svds.hpp index 26c8c50e..7984c0b8 100644 --- a/inst/include/armadillo_bits/fn_svds.hpp +++ b/inst/include/armadillo_bits/fn_svds.hpp @@ -35,19 +35,19 @@ svds_helper const typename arma_real_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; - arma_debug_check + arma_conform_check ( ( ((void*)(&U) == (void*)(&S)) || (&U == &V) || ((void*)(&S) == (void*)(&V)) ), "svds(): two or more output objects are the same object" ); - arma_debug_check( (tol < T(0)), "svds(): tol must be >= 0" ); + arma_conform_check( (tol < T(0)), "svds(): tol must be >= 0" ); const unwrap_spmat tmp(X.get_ref()); const SpMat& A = tmp.M; @@ -131,7 +131,7 @@ svds_helper } } - if(S.n_elem < k) { arma_debug_warn_level(1, "svds(): found fewer singular values than specified"); } + if(S.n_elem < k) { arma_conform_warn(1, "svds(): found fewer singular values than specified"); } return true; } @@ -153,7 +153,7 @@ svds_helper const typename arma_cx_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; @@ -165,13 +165,13 @@ svds_helper return false; } - arma_debug_check + arma_conform_check ( ( ((void*)(&U) == (void*)(&S)) || (&U == &V) || ((void*)(&S) == (void*)(&V)) ), "svds(): two or more output objects are the same object" ); - arma_debug_check( (tol < T(0)), "svds(): tol must be >= 0" ); + arma_conform_check( (tol < T(0)), "svds(): tol must be >= 0" ); const unwrap_spmat tmp(X.get_ref()); const SpMat& A = tmp.M; @@ -257,7 +257,7 @@ svds_helper } } - if(S.n_elem < k) { arma_debug_warn_level(1, "svds(): found fewer singular values than specified"); } + if(S.n_elem < k) { arma_conform_warn(1, "svds(): found fewer singular values than specified"); } return true; } @@ -279,12 +279,12 @@ svds const typename arma_real_or_cx_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const bool status = svds_helper(U, S, V, X.get_ref(), k, tol, true); - if(status == false) { arma_debug_warn_level(3, "svds(): decomposition failed"); } + if(status == false) { arma_conform_warn(3, "svds(): decomposition failed"); } return status; } @@ -304,7 +304,7 @@ svds const typename arma_real_or_cx_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); Mat U; @@ -312,7 +312,7 @@ svds const bool status = svds_helper(U, S, V, X.get_ref(), k, tol, false); - if(status == false) { arma_debug_warn_level(3, "svds(): decomposition failed"); } + if(status == false) { arma_conform_warn(3, "svds(): decomposition failed"); } return status; } @@ -332,7 +332,7 @@ svds const typename arma_real_or_cx_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); Col S; diff --git a/inst/include/armadillo_bits/fn_sylvester.hpp b/inst/include/armadillo_bits/fn_sylvester.hpp index a5b81654..a971721b 100644 --- a/inst/include/armadillo_bits/fn_sylvester.hpp +++ b/inst/include/armadillo_bits/fn_sylvester.hpp @@ -33,7 +33,7 @@ syl const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; @@ -51,7 +51,7 @@ syl if(status == false) { out.soft_reset(); - arma_debug_warn_level(3, "syl(): solution not found"); + arma_conform_warn(3, "syl(): solution not found"); } return status; @@ -89,7 +89,7 @@ syl const typename arma_blas_type_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/fn_symmat.hpp b/inst/include/armadillo_bits/fn_symmat.hpp index 4bee64df..54b7cb63 100644 --- a/inst/include/armadillo_bits/fn_symmat.hpp +++ b/inst/include/armadillo_bits/fn_symmat.hpp @@ -26,7 +26,7 @@ arma_inline typename enable_if2< is_cx::no, const Op >::result symmatu(const Base& X, const bool do_conj = false) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(do_conj); return Op(X.get_ref()); @@ -40,7 +40,7 @@ arma_inline typename enable_if2< is_cx::no, const Op >::result symmatl(const Base& X, const bool do_conj = false) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(do_conj); return Op(X.get_ref()); @@ -54,7 +54,7 @@ arma_inline typename enable_if2< is_cx::yes, const Op >::result symmatu(const Base& X, const bool do_conj = true) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X.get_ref(), 0, (do_conj ? 1 : 0)); } @@ -67,7 +67,7 @@ arma_inline typename enable_if2< is_cx::yes, const Op >::result symmatl(const Base& X, const bool do_conj = true) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X.get_ref(), 0, (do_conj ? 1 : 0)); } @@ -84,7 +84,7 @@ arma_inline typename enable_if2< is_cx::no, const SpOp >::result symmatu(const SpBase& X, const bool do_conj = false) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(do_conj); return SpOp(X.get_ref(), 0, 0); @@ -98,7 +98,7 @@ arma_inline typename enable_if2< is_cx::no, const SpOp >::result symmatl(const SpBase& X, const bool do_conj = false) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(do_conj); return SpOp(X.get_ref(), 1, 0); @@ -112,7 +112,7 @@ arma_inline typename enable_if2< is_cx::yes, const SpOp >::result symmatu(const SpBase& X, const bool do_conj = true) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpOp(X.get_ref(), 0, (do_conj ? 1 : 0)); } @@ -125,7 +125,7 @@ arma_inline typename enable_if2< is_cx::yes, const SpOp >::result symmatl(const SpBase& X, const bool do_conj = true) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpOp(X.get_ref(), 1, (do_conj ? 1 : 0)); } diff --git a/inst/include/armadillo_bits/fn_toeplitz.hpp b/inst/include/armadillo_bits/fn_toeplitz.hpp index 660541b5..66c921b3 100644 --- a/inst/include/armadillo_bits/fn_toeplitz.hpp +++ b/inst/include/armadillo_bits/fn_toeplitz.hpp @@ -27,7 +27,7 @@ inline const Op toeplitz(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op( X.get_ref() ); } @@ -40,7 +40,7 @@ inline const Op circ_toeplitz(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op( X.get_ref() ); } @@ -53,7 +53,7 @@ inline const Glue toeplitz(const Base& X, const Base& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Glue( X.get_ref(), Y.get_ref() ); } diff --git a/inst/include/armadillo_bits/fn_trace.hpp b/inst/include/armadillo_bits/fn_trace.hpp index 8a15bac2..4ec04f2c 100644 --- a/inst/include/armadillo_bits/fn_trace.hpp +++ b/inst/include/armadillo_bits/fn_trace.hpp @@ -26,7 +26,7 @@ inline typename T1::elem_type trace(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -60,7 +60,7 @@ inline typename T1::elem_type trace(const Op& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -87,7 +87,7 @@ inline typename enable_if2< is_cx::no, typename T1::elem_type>::result trace(const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -100,7 +100,7 @@ trace(const Glue& X) const bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val()) : eT(0); - arma_debug_assert_trans_mul_size< partial_unwrap::do_trans, partial_unwrap::do_trans >(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication"); + arma_conform_assert_trans_mul_size< partial_unwrap::do_trans, partial_unwrap::do_trans >(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication"); if( (A.n_elem == 0) || (B.n_elem == 0) ) { return eT(0); } @@ -205,7 +205,7 @@ inline typename enable_if2< is_cx::yes, typename T1::elem_type>::result trace(const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; typedef typename T1::elem_type eT; @@ -219,7 +219,7 @@ trace(const Glue& X) const bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val()) : eT(0); - arma_debug_assert_trans_mul_size< partial_unwrap::do_trans, partial_unwrap::do_trans >(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication"); + arma_conform_assert_trans_mul_size< partial_unwrap::do_trans, partial_unwrap::do_trans >(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication"); if( (A.n_elem == 0) || (B.n_elem == 0) ) { return eT(0); } @@ -378,7 +378,7 @@ inline typename T1::elem_type trace(const SpBase& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -425,12 +425,12 @@ inline typename T1::elem_type trace(const SpGlue& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat UA(expr.A); const unwrap_spmat UB(expr.B); - arma_debug_assert_same_size(UA.M.n_rows, UA.M.n_cols, UB.M.n_rows, UB.M.n_cols, "addition"); + arma_conform_assert_same_size(UA.M.n_rows, UA.M.n_cols, UB.M.n_rows, UB.M.n_cols, "addition"); return (trace(UA.M) + trace(UB.M)); } @@ -444,12 +444,12 @@ inline typename T1::elem_type trace(const SpGlue& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat UA(expr.A); const unwrap_spmat UB(expr.B); - arma_debug_assert_same_size(UA.M.n_rows, UA.M.n_cols, UB.M.n_rows, UB.M.n_cols, "subtraction"); + arma_conform_assert_same_size(UA.M.n_rows, UA.M.n_cols, UB.M.n_rows, UB.M.n_cols, "subtraction"); return (trace(UA.M) - trace(UB.M)); } @@ -463,7 +463,7 @@ inline typename T1::elem_type trace(const SpGlue& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -473,7 +473,7 @@ trace(const SpGlue& expr) const SpMat& A = UA.M; const SpMat& B = UB.M; - arma_debug_assert_same_size(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "element-wise multiplication"); + arma_conform_assert_same_size(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "element-wise multiplication"); const uword N = (std::min)(A.n_rows, A.n_cols); @@ -496,7 +496,7 @@ inline typename T1::elem_type trace(const SpGlue& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -508,7 +508,7 @@ trace(const SpGlue& expr) const SpMat& A = UA.M; const SpMat& B = UB.M; - arma_debug_assert_mul_size(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication"); + arma_conform_assert_mul_size(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication"); if( (A.n_nonzero == 0) || (B.n_nonzero == 0) ) { return eT(0); } @@ -554,7 +554,7 @@ inline typename enable_if2< is_cx::no, typename T1::elem_type>::result trace(const SpGlue, T2, spglue_times>& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -565,7 +565,7 @@ trace(const SpGlue, T2, spglue_times>& expr) const SpMat& B = UB.M; // NOTE: deliberately swapped A.n_rows and A.n_cols to take into account the requested transpose operation - arma_debug_assert_mul_size(A.n_cols, A.n_rows, B.n_rows, B.n_cols, "matrix multiplication"); + arma_conform_assert_mul_size(A.n_cols, A.n_rows, B.n_rows, B.n_cols, "matrix multiplication"); if( (A.n_nonzero == 0) || (B.n_nonzero == 0) ) { return eT(0); } @@ -610,7 +610,7 @@ inline typename enable_if2< is_cx::yes, typename T1::elem_type>::result trace(const SpGlue, T2, spglue_times>& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -621,7 +621,7 @@ trace(const SpGlue, T2, spglue_times>& expr) const SpMat& B = UB.M; // NOTE: deliberately swapped A.n_rows and A.n_cols to take into account the requested transpose operation - arma_debug_assert_mul_size(A.n_cols, A.n_rows, B.n_rows, B.n_cols, "matrix multiplication"); + arma_conform_assert_mul_size(A.n_cols, A.n_rows, B.n_rows, B.n_cols, "matrix multiplication"); if( (A.n_nonzero == 0) || (B.n_nonzero == 0) ) { return eT(0); } diff --git a/inst/include/armadillo_bits/fn_trans.hpp b/inst/include/armadillo_bits/fn_trans.hpp index f558e106..b3d1993b 100644 --- a/inst/include/armadillo_bits/fn_trans.hpp +++ b/inst/include/armadillo_bits/fn_trans.hpp @@ -30,7 +30,7 @@ trans const typename enable_if< is_arma_type::value >::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return Op(X); @@ -48,7 +48,7 @@ htrans const typename enable_if< is_arma_type::value >::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return Op(X); @@ -70,7 +70,7 @@ trans const typename enable_if< is_arma_sparse_type::value >::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return SpOp(X); @@ -88,7 +88,7 @@ htrans const typename enable_if< is_arma_sparse_type::value >::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return SpOp(X); diff --git a/inst/include/armadillo_bits/fn_trapz.hpp b/inst/include/armadillo_bits/fn_trapz.hpp index 72646b78..964b09de 100644 --- a/inst/include/armadillo_bits/fn_trapz.hpp +++ b/inst/include/armadillo_bits/fn_trapz.hpp @@ -32,7 +32,7 @@ trapz const uword dim = 0 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Glue(X.get_ref(), Y.get_ref(), dim); } @@ -49,7 +49,7 @@ trapz const uword dim = 0 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(Y.get_ref(), dim, uword(0)); } diff --git a/inst/include/armadillo_bits/fn_trig.hpp b/inst/include/armadillo_bits/fn_trig.hpp index d73947b6..4227df7a 100644 --- a/inst/include/armadillo_bits/fn_trig.hpp +++ b/inst/include/armadillo_bits/fn_trig.hpp @@ -43,7 +43,7 @@ arma_inline typename enable_if2< is_arma_type::value, const eOp >::result cos(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -56,7 +56,7 @@ arma_inline const eOpCube cos(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -72,7 +72,7 @@ arma_inline typename enable_if2< is_arma_type::value, const eOp >::result acos(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -85,7 +85,7 @@ arma_inline const eOpCube acos(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -101,7 +101,7 @@ arma_inline typename enable_if2< is_arma_type::value, const eOp >::result cosh(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -114,7 +114,7 @@ arma_inline const eOpCube cosh(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -130,7 +130,7 @@ arma_inline typename enable_if2< is_arma_type::value, const eOp >::result acosh(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -143,7 +143,7 @@ arma_inline const eOpCube acosh(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -159,7 +159,7 @@ arma_inline typename enable_if2< is_arma_type::value, const eOp >::result sin(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -172,7 +172,7 @@ arma_inline const eOpCube sin(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -188,7 +188,7 @@ arma_inline typename enable_if2< is_arma_type::value, const eOp >::result asin(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -201,7 +201,7 @@ arma_inline const eOpCube asin(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -217,7 +217,7 @@ arma_inline typename enable_if2< is_arma_type::value, const eOp >::result sinh(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -230,7 +230,7 @@ arma_inline const eOpCube sinh(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -246,7 +246,7 @@ arma_inline typename enable_if2< is_arma_type::value, const eOp >::result asinh(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -259,7 +259,7 @@ arma_inline const eOpCube asinh(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -275,7 +275,7 @@ arma_inline typename enable_if2< is_arma_type::value, const eOp >::result tan(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -288,7 +288,7 @@ arma_inline const eOpCube tan(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -304,7 +304,7 @@ arma_inline typename enable_if2< is_arma_type::value, const eOp >::result atan(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -317,7 +317,7 @@ arma_inline const eOpCube atan(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -333,7 +333,7 @@ arma_inline typename enable_if2< is_arma_type::value, const eOp >::result tanh(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -346,7 +346,7 @@ arma_inline const eOpCube tanh(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -362,7 +362,7 @@ arma_inline typename enable_if2< is_arma_type::value, const eOp >::result atanh(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -375,7 +375,7 @@ arma_inline const eOpCube atanh(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -402,7 +402,7 @@ arma_inline typename enable_if2< is_arma_type::value, const eOp >::result sinc(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -415,7 +415,7 @@ arma_inline const eOpCube sinc(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } @@ -436,7 +436,7 @@ enable_if2 >::result atan2(const T1& Y, const T2& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Glue(Y, X); } @@ -449,7 +449,7 @@ arma_inline typename enable_if2< is_real::value, const GlueCube >::result atan2(const BaseCube& Y, const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return GlueCube(Y.get_ref(), X.get_ref()); } @@ -470,7 +470,7 @@ enable_if2 >::result hypot(const T1& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Glue(X, Y); } @@ -483,7 +483,7 @@ arma_inline typename enable_if2< is_real::value, const GlueCube >::result hypot(const BaseCube& X, const BaseCube& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return GlueCube(X.get_ref(), Y.get_ref()); } diff --git a/inst/include/armadillo_bits/fn_trimat.hpp b/inst/include/armadillo_bits/fn_trimat.hpp index 24c95f20..ec409a0f 100644 --- a/inst/include/armadillo_bits/fn_trimat.hpp +++ b/inst/include/armadillo_bits/fn_trimat.hpp @@ -26,7 +26,7 @@ arma_inline const Op trimatu(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X.get_ref(), 0, 0); } @@ -39,7 +39,7 @@ arma_inline const Op trimatl(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X.get_ref(), 1, 0); } @@ -52,7 +52,7 @@ arma_inline const SpOp trimatu(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpOp(X.get_ref(), 0, 0); } @@ -65,7 +65,7 @@ arma_inline const SpOp trimatl(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpOp(X.get_ref(), 1, 0); } @@ -82,7 +82,7 @@ arma_inline const Op trimatl(const Base& X, const sword k) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword row_offset = (k < 0) ? uword(-k) : uword(0); const uword col_offset = (k > 0) ? uword( k) : uword(0); @@ -98,7 +98,7 @@ arma_inline const Op trimatu(const Base& X, const sword k) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword row_offset = (k < 0) ? uword(-k) : uword(0); const uword col_offset = (k > 0) ? uword( k) : uword(0); @@ -114,7 +114,7 @@ arma_inline const SpOp trimatu(const SpBase& X, const sword k) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword row_offset = (k < 0) ? uword(-k) : uword(0); const uword col_offset = (k > 0) ? uword( k) : uword(0); @@ -130,7 +130,7 @@ arma_inline const SpOp trimatl(const SpBase& X, const sword k) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword row_offset = (k < 0) ? uword(-k) : uword(0); const uword col_offset = (k > 0) ? uword( k) : uword(0); diff --git a/inst/include/armadillo_bits/fn_trimat_ind.hpp b/inst/include/armadillo_bits/fn_trimat_ind.hpp index 4e657052..e83c0889 100644 --- a/inst/include/armadillo_bits/fn_trimat_ind.hpp +++ b/inst/include/armadillo_bits/fn_trimat_ind.hpp @@ -25,7 +25,7 @@ inline uvec trimatu_ind(const SizeMat& s, const sword k = 0) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_rows = s.n_rows; const uword n_cols = s.n_cols; @@ -33,7 +33,7 @@ trimatu_ind(const SizeMat& s, const sword k = 0) const uword row_offset = (k < 0) ? uword(-k) : uword(0); const uword col_offset = (k > 0) ? uword( k) : uword(0); - arma_debug_check_bounds( ((row_offset > 0) && (row_offset >= n_rows)) || ((col_offset > 0) && (col_offset >= n_cols)), "trimatu_ind(): requested diagonal is out of bounds" ); + arma_conform_check_bounds( ((row_offset > 0) && (row_offset >= n_rows)) || ((col_offset > 0) && (col_offset >= n_cols)), "trimatu_ind(): requested diagonal is out of bounds" ); const uword N = (std::min)(n_rows - row_offset, n_cols - col_offset); @@ -86,7 +86,7 @@ inline uvec trimatl_ind(const SizeMat& s, const sword k = 0) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_rows = s.n_rows; const uword n_cols = s.n_cols; @@ -94,7 +94,7 @@ trimatl_ind(const SizeMat& s, const sword k = 0) const uword row_offset = (k < 0) ? uword(-k) : uword(0); const uword col_offset = (k > 0) ? uword( k) : uword(0); - arma_debug_check_bounds( ((row_offset > 0) && (row_offset >= n_rows)) || ((col_offset > 0) && (col_offset >= n_cols)), "trimatl_ind(): requested diagonal is out of bounds" ); + arma_conform_check_bounds( ((row_offset > 0) && (row_offset >= n_rows)) || ((col_offset > 0) && (col_offset >= n_cols)), "trimatl_ind(): requested diagonal is out of bounds" ); const uword N = (std::min)(n_rows - row_offset, n_cols - col_offset); diff --git a/inst/include/armadillo_bits/fn_trunc_exp.hpp b/inst/include/armadillo_bits/fn_trunc_exp.hpp index 17a4f2d3..8ceabccc 100644 --- a/inst/include/armadillo_bits/fn_trunc_exp.hpp +++ b/inst/include/armadillo_bits/fn_trunc_exp.hpp @@ -70,7 +70,7 @@ arma_inline typename enable_if2< is_arma_type::value, const eOp >::result trunc_exp(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -83,7 +83,7 @@ arma_inline const eOpCube trunc_exp(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } diff --git a/inst/include/armadillo_bits/fn_trunc_log.hpp b/inst/include/armadillo_bits/fn_trunc_log.hpp index 9cbf826a..de02b978 100644 --- a/inst/include/armadillo_bits/fn_trunc_log.hpp +++ b/inst/include/armadillo_bits/fn_trunc_log.hpp @@ -77,7 +77,7 @@ arma_inline typename enable_if2< is_arma_type::value, const eOp >::result trunc_log(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(A); } @@ -90,7 +90,7 @@ arma_inline const eOpCube trunc_log(const BaseCube& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(A.get_ref()); } diff --git a/inst/include/armadillo_bits/fn_unique.hpp b/inst/include/armadillo_bits/fn_unique.hpp index 99861a5c..7bfaa7d8 100644 --- a/inst/include/armadillo_bits/fn_unique.hpp +++ b/inst/include/armadillo_bits/fn_unique.hpp @@ -31,7 +31,7 @@ enable_if2 >::result unique(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(A); } @@ -48,7 +48,7 @@ enable_if2 >::result unique(const T1& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(A); } diff --git a/inst/include/armadillo_bits/fn_var.hpp b/inst/include/armadillo_bits/fn_var.hpp index 090f4ce1..0ec5b8fd 100644 --- a/inst/include/armadillo_bits/fn_var.hpp +++ b/inst/include/armadillo_bits/fn_var.hpp @@ -32,7 +32,7 @@ enable_if2 >::result var(const T1& X, const uword norm_type = 0) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return op_var::var_vec(X, norm_type); } @@ -50,7 +50,7 @@ enable_if2 >::result var(const T1& X, const uword norm_type = 0) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X, norm_type, 0); } @@ -68,7 +68,7 @@ enable_if2 >::result var(const T1& X, const uword norm_type, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X, norm_type, dim); } @@ -97,9 +97,9 @@ enable_if2 >::result var(const T1& X, const uword norm_type = 0) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - return spop_var::var_vec(X, norm_type); + return op_sp_var::var_vec(X, norm_type); } @@ -111,13 +111,13 @@ typename enable_if2 < is_arma_sparse_type::value && resolves_to_sparse_vector::no, - const mtSpOp + const mtSpToDOp >::result var(const T1& X, const uword norm_type = 0) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - return mtSpOp(X, norm_type, 0); + return mtSpToDOp(X, norm_type, 0); } @@ -129,13 +129,13 @@ typename enable_if2 < is_arma_sparse_type::value, - const mtSpOp + const mtSpToDOp >::result var(const T1& X, const uword norm_type, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - return mtSpOp(X, norm_type, dim); + return mtSpToDOp(X, norm_type, dim); } diff --git a/inst/include/armadillo_bits/fn_vecnorm.hpp b/inst/include/armadillo_bits/fn_vecnorm.hpp index 0fa88aa9..ff0c5635 100644 --- a/inst/include/armadillo_bits/fn_vecnorm.hpp +++ b/inst/include/armadillo_bits/fn_vecnorm.hpp @@ -38,7 +38,7 @@ vecnorm const typename arma_real_or_cx_only::result* junk2 = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); @@ -51,7 +51,7 @@ vecnorm if(k == uword(1)) { return op_norm::vec_norm_1(P); } if(k == uword(2)) { return op_norm::vec_norm_2(P); } - arma_debug_check( (k == 0), "vecnorm(): unsupported vector norm type" ); + arma_conform_check( (k == 0), "vecnorm(): unsupported vector norm type" ); return op_norm::vec_norm_k(P, int(k)); } @@ -75,7 +75,7 @@ vecnorm const typename arma_real_or_cx_only::result* junk2 = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); @@ -98,7 +98,7 @@ vecnorm const typename arma_real_or_cx_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return mtOp(X.get_ref(), k, dim); @@ -127,7 +127,7 @@ vecnorm const typename arma_real_or_cx_only::result* junk2 = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); @@ -166,7 +166,7 @@ vecnorm const typename arma_real_or_cx_only::result* junk2 = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); @@ -196,7 +196,7 @@ vecnorm const typename arma_real_or_cx_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const char sig = (method != nullptr) ? method[0] : char(0); @@ -233,7 +233,7 @@ vecnorm const typename arma_real_or_cx_only::result* junk2 = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); @@ -249,7 +249,7 @@ typename enable_if2 < is_arma_sparse_type::value && resolves_to_sparse_vector::no, - const mtSpOp + const mtSpToDOp >::result vecnorm ( @@ -259,13 +259,13 @@ vecnorm const typename arma_real_or_cx_only::result* junk2 = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); const uword dim = 0; - return mtSpOp(X, k, dim); + return mtSpToDOp(X, k, dim); } @@ -273,7 +273,7 @@ vecnorm template arma_warn_unused inline -const mtSpOp +const mtSpToDOp vecnorm ( const SpBase& X, @@ -282,10 +282,10 @@ vecnorm const typename arma_real_or_cx_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); - return mtSpOp(X.get_ref(), k, dim); + return mtSpToDOp(X.get_ref(), k, dim); } @@ -311,7 +311,7 @@ vecnorm const typename arma_real_or_cx_only::result* junk2 = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); @@ -327,7 +327,7 @@ typename enable_if2 < is_arma_sparse_type::value && resolves_to_sparse_vector::no, - const mtSpOp + const mtSpToDOp >::result vecnorm ( @@ -337,7 +337,7 @@ vecnorm const typename arma_real_or_cx_only::result* junk2 = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); @@ -350,7 +350,7 @@ vecnorm const uword dim = 0; - return mtSpOp(X, method_id, dim); + return mtSpToDOp(X, method_id, dim); } @@ -358,7 +358,7 @@ vecnorm template arma_warn_unused inline -const mtSpOp +const mtSpToDOp vecnorm ( const SpBase& X, @@ -367,7 +367,7 @@ vecnorm const typename arma_real_or_cx_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const char sig = (method != nullptr) ? method[0] : char(0); @@ -377,7 +377,7 @@ vecnorm if( (sig == 'i') || (sig == 'I') || (sig == '+') ) { method_id = 1; } if( (sig == '-') ) { method_id = 2; } - return mtSpOp(X.get_ref(), method_id, dim); + return mtSpToDOp(X.get_ref(), method_id, dim); } diff --git a/inst/include/armadillo_bits/fn_vectorise.hpp b/inst/include/armadillo_bits/fn_vectorise.hpp index ff210069..78cd1b46 100644 --- a/inst/include/armadillo_bits/fn_vectorise.hpp +++ b/inst/include/armadillo_bits/fn_vectorise.hpp @@ -32,7 +32,7 @@ enable_if2 >::result vectorise(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X); } @@ -50,9 +50,9 @@ enable_if2 >::result vectorise(const T1& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (dim > 1), "vectorise(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "vectorise(): parameter 'dim' must be 0 or 1" ); return Op(X, dim, 0); } @@ -65,7 +65,7 @@ inline CubeToMatOp vectorise(const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return CubeToMatOp(X.get_ref()); } @@ -84,7 +84,7 @@ enable_if2 >::result vectorise(const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpOp(X); } @@ -103,9 +103,9 @@ enable_if2 >::result vectorise(const T1& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (dim > 1), "vectorise(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "vectorise(): parameter 'dim' must be 0 or 1" ); return SpOp(X, dim, 0); } diff --git a/inst/include/armadillo_bits/fn_wishrnd.hpp b/inst/include/armadillo_bits/fn_wishrnd.hpp index 3f05b77b..7641c6d4 100644 --- a/inst/include/armadillo_bits/fn_wishrnd.hpp +++ b/inst/include/armadillo_bits/fn_wishrnd.hpp @@ -32,7 +32,7 @@ enable_if2 >::result wishrnd(const Base& S, typename T1::elem_type df) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(S.get_ref(), df, uword(1), uword(0)); } @@ -50,7 +50,7 @@ enable_if2 >::result wishrnd(const Base& S, typename T1::elem_type df, const Base& D) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(S); return Op(D.get_ref(), df, uword(2), uword(0)); @@ -68,14 +68,14 @@ enable_if2 >::result wishrnd(Mat& W, const Base& S, typename T1::elem_type df) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_wishrnd::apply_direct(W, S.get_ref(), df, uword(1)); if(status == false) { W.soft_reset(); - arma_debug_warn_level(3, "wishrnd(): given matrix is not symmetric positive definite"); + arma_conform_warn(3, "wishrnd(): given matrix is not symmetric positive definite"); } return status; @@ -93,7 +93,7 @@ enable_if2 >::result wishrnd(Mat& W, const Base& S, typename T1::elem_type df, const Base& D) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(S); const bool status = op_wishrnd::apply_direct(W, D.get_ref(), df, uword(2)); @@ -101,7 +101,7 @@ wishrnd(Mat& W, const Base& if(status == false) { W.soft_reset(); - arma_debug_warn_level(3, "wishrnd(): problem with given 'D' matrix"); + arma_conform_warn(3, "wishrnd(): problem with given 'D' matrix"); } return status; @@ -124,7 +124,7 @@ enable_if2 >::result iwishrnd(const Base& T, typename T1::elem_type df) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(T.get_ref(), df, uword(1), uword(0)); } @@ -142,7 +142,7 @@ enable_if2 >::result iwishrnd(const Base& T, typename T1::elem_type df, const Base& Dinv) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(T); return Op(Dinv.get_ref(), df, uword(2), uword(0)); @@ -160,14 +160,14 @@ enable_if2 >::result iwishrnd(Mat& W, const Base& T, typename T1::elem_type df) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_iwishrnd::apply_direct(W, T.get_ref(), df, uword(1)); if(status == false) { W.soft_reset(); - arma_debug_warn_level(3, "iwishrnd(): given matrix is not symmetric positive definite and/or df is too low"); + arma_conform_warn(3, "iwishrnd(): given matrix is not symmetric positive definite and/or df is too low"); } return status; @@ -185,7 +185,7 @@ enable_if2 >::result iwishrnd(Mat& W, const Base& T, typename T1::elem_type df, const Base& Dinv) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(T); const bool status = op_iwishrnd::apply_direct(W, Dinv.get_ref(), df, uword(2)); @@ -193,7 +193,7 @@ iwishrnd(Mat& W, const Base& if(status == false) { W.soft_reset(); - arma_debug_warn_level(3, "wishrnd(): problem with given 'Dinv' matrix and/or df is too low"); + arma_conform_warn(3, "wishrnd(): problem with given 'Dinv' matrix and/or df is too low"); } return status; diff --git a/inst/include/armadillo_bits/fn_zeros.hpp b/inst/include/armadillo_bits/fn_zeros.hpp index 5f069223..d6f8d868 100644 --- a/inst/include/armadillo_bits/fn_zeros.hpp +++ b/inst/include/armadillo_bits/fn_zeros.hpp @@ -26,7 +26,7 @@ arma_inline const Gen zeros(const uword n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Gen(n_elem, 1); } @@ -39,7 +39,7 @@ arma_inline const Gen zeros(const uword n_elem, const arma_empty_class junk1 = arma_empty_class(), const typename arma_Mat_Col_Row_only::result* junk2 = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); @@ -56,7 +56,7 @@ arma_inline const Gen zeros(const uword n_rows, const uword n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Gen(n_rows, n_cols); } @@ -68,7 +68,7 @@ arma_inline const Gen zeros(const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Gen(s.n_rows, s.n_cols); } @@ -81,11 +81,11 @@ arma_inline const Gen zeros(const uword n_rows, const uword n_cols, const typename arma_Mat_Col_Row_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); - if(is_Col::value) { arma_debug_check( (n_cols != 1), "zeros(): incompatible size" ); } - if(is_Row::value) { arma_debug_check( (n_rows != 1), "zeros(): incompatible size" ); } + if(is_Col::value) { arma_conform_check( (n_cols != 1), "zeros(): incompatible size" ); } + if(is_Row::value) { arma_conform_check( (n_rows != 1), "zeros(): incompatible size" ); } return Gen(n_rows, n_cols); } @@ -98,7 +98,7 @@ arma_inline const Gen zeros(const SizeMat& s, const typename arma_Mat_Col_Row_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return zeros(s.n_rows, s.n_cols); @@ -111,7 +111,7 @@ arma_inline const GenCube zeros(const uword n_rows, const uword n_cols, const uword n_slices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return GenCube(n_rows, n_cols, n_slices); } @@ -123,7 +123,7 @@ arma_inline const GenCube zeros(const SizeCube& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return GenCube(s.n_rows, s.n_cols, s.n_slices); } @@ -136,7 +136,7 @@ arma_inline const GenCube zeros(const uword n_rows, const uword n_cols, const uword n_slices, const typename arma_Cube_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return GenCube(n_rows, n_cols, n_slices); @@ -150,7 +150,7 @@ arma_inline const GenCube zeros(const SizeCube& s, const typename arma_Cube_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return GenCube(s.n_rows, s.n_cols, s.n_slices); @@ -164,11 +164,11 @@ inline sp_obj_type zeros(const uword n_rows, const uword n_cols, const typename arma_SpMat_SpCol_SpRow_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); - if(is_SpCol::value) { arma_debug_check( (n_cols != 1), "zeros(): incompatible size" ); } - if(is_SpRow::value) { arma_debug_check( (n_rows != 1), "zeros(): incompatible size" ); } + if(is_SpCol::value) { arma_conform_check( (n_cols != 1), "zeros(): incompatible size" ); } + if(is_SpRow::value) { arma_conform_check( (n_rows != 1), "zeros(): incompatible size" ); } return sp_obj_type(n_rows, n_cols); } @@ -181,7 +181,7 @@ inline sp_obj_type zeros(const SizeMat& s, const typename arma_SpMat_SpCol_SpRow_only::result* junk = nullptr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); return zeros(s.n_rows, s.n_cols); diff --git a/inst/include/armadillo_bits/glue_affmul_meat.hpp b/inst/include/armadillo_bits/glue_affmul_meat.hpp index 19c3799a..9549aec2 100644 --- a/inst/include/armadillo_bits/glue_affmul_meat.hpp +++ b/inst/include/armadillo_bits/glue_affmul_meat.hpp @@ -26,7 +26,7 @@ inline void glue_affmul::apply(Mat& out, const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -56,13 +56,13 @@ inline void glue_affmul::apply_noalias(Mat& out, const T1& A, const T2& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword A_n_cols = A.n_cols; const uword A_n_rows = A.n_rows; const uword B_n_rows = B.n_rows; - arma_debug_check( (A_n_cols != B_n_rows+1), "affmul(): size mismatch" ); + arma_conform_check( (A_n_cols != B_n_rows+1), "affmul(): size mismatch" ); if(A_n_rows == A_n_cols) { @@ -86,7 +86,7 @@ inline void glue_affmul::apply_noalias_square(Mat& out, const T1& A, const T2& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -278,7 +278,7 @@ inline void glue_affmul::apply_noalias_rectangle(Mat& out, const T1& A, const T2& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -461,7 +461,7 @@ inline void glue_affmul::apply_noalias_generic(Mat& out, const T1& A, const T2& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/glue_atan2_meat.hpp b/inst/include/armadillo_bits/glue_atan2_meat.hpp index 38469ed8..9408e0e4 100644 --- a/inst/include/armadillo_bits/glue_atan2_meat.hpp +++ b/inst/include/armadillo_bits/glue_atan2_meat.hpp @@ -26,7 +26,7 @@ inline void glue_atan2::apply(Mat& out, const Glue& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -58,7 +58,7 @@ inline void glue_atan2::apply_noalias(Mat& out, const Proxy& P1, const Proxy& P2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -70,8 +70,8 @@ glue_atan2::apply_noalias(Mat& out, const Proxy& P1, eT* out_mem = out.memptr(); - const bool use_mp = arma_config::openmp && mp_gate::use_mp || Proxy::use_mp)>::eval(n_elem); - const bool use_at = Proxy::use_at || Proxy::use_at; + const bool use_mp = arma_config::openmp && mp_gate::use_mp || Proxy::use_mp)>::eval(n_elem); + constexpr bool use_at = Proxy::use_at || Proxy::use_at; if(use_at == false) { @@ -127,7 +127,7 @@ inline void glue_atan2::apply(Cube& out, const GlueCube& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -159,7 +159,7 @@ inline void glue_atan2::apply_noalias(Cube& out, const ProxyCube& P1, const ProxyCube& P2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -172,8 +172,8 @@ glue_atan2::apply_noalias(Cube& out, const ProxyCube eT* out_mem = out.memptr(); - const bool use_mp = arma_config::openmp && mp_gate::use_mp || ProxyCube::use_mp)>::eval(n_elem); - const bool use_at = ProxyCube::use_at || ProxyCube::use_at; + const bool use_mp = arma_config::openmp && mp_gate::use_mp || ProxyCube::use_mp)>::eval(n_elem); + constexpr bool use_at = ProxyCube::use_at || ProxyCube::use_at; if(use_at == false) { diff --git a/inst/include/armadillo_bits/glue_conv_meat.hpp b/inst/include/armadillo_bits/glue_conv_meat.hpp index e722ff48..86726422 100644 --- a/inst/include/armadillo_bits/glue_conv_meat.hpp +++ b/inst/include/armadillo_bits/glue_conv_meat.hpp @@ -27,7 +27,7 @@ inline void glue_conv::apply(Mat& out, const Mat& A, const Mat& B, const bool A_is_col) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat& h = (A.n_elem <= B.n_elem) ? A : B; const Mat& x = (A.n_elem <= B.n_elem) ? B : A; @@ -96,7 +96,7 @@ glue_conv::apply(Mat& out, const Mat& A, const Mat& B, const bool A_ // void // glue_conv::apply(Mat& out, const Mat& A, const Mat& B, const bool A_is_col) // { -// arma_extra_debug_sigprint(); +// arma_debug_sigprint(); // // const Mat& h = (A.n_elem <= B.n_elem) ? A : B; // const Mat& x = (A.n_elem <= B.n_elem) ? B : A; @@ -187,7 +187,7 @@ inline void glue_conv::apply(Mat& out, const Glue& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -197,7 +197,7 @@ glue_conv::apply(Mat& out, const Glue& const Mat& A = UA.M; const Mat& B = UB.M; - arma_debug_check + arma_conform_check ( ( ((A.is_vec() == false) && (A.is_empty() == false)) || ((B.is_vec() == false) && (B.is_empty() == false)) ), "conv(): given object must be a vector" @@ -243,7 +243,7 @@ inline void glue_conv2::apply(Mat& out, const Mat& A, const Mat& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat& G = (A.n_elem <= B.n_elem) ? A : B; // unflipped filter coefficients const Mat& W = (A.n_elem <= B.n_elem) ? B : A; // original 2D image @@ -343,7 +343,7 @@ inline void glue_conv2::apply(Mat& out, const Glue& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/glue_cor_meat.hpp b/inst/include/armadillo_bits/glue_cor_meat.hpp index 8f937975..7bc30ca7 100644 --- a/inst/include/armadillo_bits/glue_cor_meat.hpp +++ b/inst/include/armadillo_bits/glue_cor_meat.hpp @@ -26,7 +26,7 @@ inline void glue_cor::apply(Mat& out, const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -46,7 +46,7 @@ glue_cor::apply(Mat& out, const Glue& X) ? Mat(const_cast(B.memptr()), B.n_cols, B.n_rows, false, false) : Mat(const_cast(B.memptr()), B.n_rows, B.n_cols, false, false); - arma_debug_assert_mul_size(AA, BB, true, false, "cor()"); + arma_conform_assert_mul_size(AA, BB, true, false, "cor()"); if( (AA.n_elem == 0) || (BB.n_elem == 0) ) { diff --git a/inst/include/armadillo_bits/glue_cov_meat.hpp b/inst/include/armadillo_bits/glue_cov_meat.hpp index d5768e2d..17f5e750 100644 --- a/inst/include/armadillo_bits/glue_cov_meat.hpp +++ b/inst/include/armadillo_bits/glue_cov_meat.hpp @@ -26,7 +26,7 @@ inline void glue_cov::apply(Mat& out, const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -46,7 +46,7 @@ glue_cov::apply(Mat& out, const Glue& X) ? Mat(const_cast(B.memptr()), B.n_cols, B.n_rows, false, false) : Mat(const_cast(B.memptr()), B.n_rows, B.n_cols, false, false); - arma_debug_assert_mul_size(AA, BB, true, false, "cov()"); + arma_conform_assert_mul_size(AA, BB, true, false, "cov()"); if( (A.n_elem == 0) || (B.n_elem == 0) ) { diff --git a/inst/include/armadillo_bits/glue_cross_meat.hpp b/inst/include/armadillo_bits/glue_cross_meat.hpp index bdf38d1b..c2d266e2 100644 --- a/inst/include/armadillo_bits/glue_cross_meat.hpp +++ b/inst/include/armadillo_bits/glue_cross_meat.hpp @@ -27,14 +27,14 @@ inline void glue_cross::apply(Mat& out, const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const Proxy PA(X.A); const Proxy PB(X.B); - arma_debug_check( ((PA.get_n_elem() != 3) || (PB.get_n_elem() != 3)), "cross(): each vector must have 3 elements" ); + arma_conform_check( ((PA.get_n_elem() != 3) || (PB.get_n_elem() != 3)), "cross(): each vector must have 3 elements" ); out.set_size(PA.get_n_rows(), PA.get_n_cols()); diff --git a/inst/include/armadillo_bits/glue_hist_meat.hpp b/inst/include/armadillo_bits/glue_hist_meat.hpp index ec5b4a32..9984f9bd 100644 --- a/inst/include/armadillo_bits/glue_hist_meat.hpp +++ b/inst/include/armadillo_bits/glue_hist_meat.hpp @@ -25,9 +25,9 @@ inline void glue_hist::apply_noalias(Mat& out, const Mat& X, const Mat& C, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( ((C.is_vec() == false) && (C.is_empty() == false)), "hist(): parameter 'centers' must be a vector" ); + arma_conform_check( ((C.is_vec() == false) && (C.is_empty() == false)), "hist(): parameter 'centers' must be a vector" ); const uword X_n_rows = X.n_rows; const uword X_n_cols = X.n_cols; @@ -36,7 +36,7 @@ glue_hist::apply_noalias(Mat& out, const Mat& X, const Mat& C, co if( C_n_elem == 0 ) { out.reset(); return; } - arma_debug_check + arma_conform_check ( ((Col(const_cast(C.memptr()), C_n_elem, false, false)).is_sorted("strictascend") == false), "hist(): given 'centers' vector does not contain monotonically increasing values" @@ -198,11 +198,11 @@ inline void glue_hist::apply(Mat& out, const mtGlue& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword dim = expr.aux_uword; - arma_debug_check( (dim > 1), "hist(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "hist(): parameter 'dim' must be 0 or 1" ); const quasi_unwrap UA(expr.A); const quasi_unwrap UB(expr.B); @@ -228,7 +228,7 @@ inline void glue_hist_default::apply(Mat& out, const mtGlue& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap UA(expr.A); const quasi_unwrap UB(expr.B); diff --git a/inst/include/armadillo_bits/glue_histc_meat.hpp b/inst/include/armadillo_bits/glue_histc_meat.hpp index 6e79175b..79d9ebfd 100644 --- a/inst/include/armadillo_bits/glue_histc_meat.hpp +++ b/inst/include/armadillo_bits/glue_histc_meat.hpp @@ -25,9 +25,9 @@ inline void glue_histc::apply_noalias(Mat& C, const Mat& A, const Mat& B, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( ((B.is_vec() == false) && (B.is_empty() == false)), "histc(): parameter 'edges' must be a vector" ); + arma_conform_check( ((B.is_vec() == false) && (B.is_empty() == false)), "histc(): parameter 'edges' must be a vector" ); const uword A_n_rows = A.n_rows; const uword A_n_cols = A.n_cols; @@ -36,7 +36,7 @@ glue_histc::apply_noalias(Mat& C, const Mat& A, const Mat& B, con if( B_n_elem == uword(0) ) { C.reset(); return; } - arma_debug_check + arma_conform_check ( ((Col(const_cast(B.memptr()), B_n_elem, false, false)).is_sorted("strictascend") == false), "hist(): given 'edges' vector does not contain monotonically increasing values" @@ -112,11 +112,11 @@ inline void glue_histc::apply(Mat& C, const mtGlue& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword dim = expr.aux_uword; - arma_debug_check( (dim > 1), "histc(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "histc(): parameter 'dim' must be 0 or 1" ); const quasi_unwrap UA(expr.A); const quasi_unwrap UB(expr.B); @@ -142,7 +142,7 @@ inline void glue_histc_default::apply(Mat& C, const mtGlue& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap UA(expr.A); const quasi_unwrap UB(expr.B); diff --git a/inst/include/armadillo_bits/glue_hypot_meat.hpp b/inst/include/armadillo_bits/glue_hypot_meat.hpp index f773b333..193f83a1 100644 --- a/inst/include/armadillo_bits/glue_hypot_meat.hpp +++ b/inst/include/armadillo_bits/glue_hypot_meat.hpp @@ -26,7 +26,7 @@ inline void glue_hypot::apply(Mat& out, const Glue& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -58,7 +58,7 @@ inline void glue_hypot::apply_noalias(Mat& out, const Proxy& P1, const Proxy& P2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -99,7 +99,7 @@ inline void glue_hypot::apply(Cube& out, const GlueCube& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -131,7 +131,7 @@ inline void glue_hypot::apply_noalias(Cube& out, const ProxyCube& P1, const ProxyCube& P2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/glue_intersect_meat.hpp b/inst/include/armadillo_bits/glue_intersect_meat.hpp index 21a2b6d6..16952058 100644 --- a/inst/include/armadillo_bits/glue_intersect_meat.hpp +++ b/inst/include/armadillo_bits/glue_intersect_meat.hpp @@ -26,7 +26,7 @@ inline void glue_intersect::apply(Mat& out, const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uvec iA; uvec iB; @@ -41,7 +41,7 @@ inline void glue_intersect::apply(Mat& out, uvec& iA, uvec& iB, const Base& A_expr, const Base& B_expr, const bool calc_indx) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/glue_join_meat.hpp b/inst/include/armadillo_bits/glue_join_meat.hpp index 1ffd3b1e..ede0be90 100644 --- a/inst/include/armadillo_bits/glue_join_meat.hpp +++ b/inst/include/armadillo_bits/glue_join_meat.hpp @@ -26,7 +26,7 @@ inline void glue_join_cols::apply_noalias(Mat& out, const Proxy& A, const Proxy& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword A_n_rows = A.get_n_rows(); const uword A_n_cols = A.get_n_cols(); @@ -34,7 +34,7 @@ glue_join_cols::apply_noalias(Mat& out, const Proxy& const uword B_n_rows = B.get_n_rows(); const uword B_n_cols = B.get_n_cols(); - arma_debug_check + arma_conform_check ( ( (A_n_cols != B_n_cols) && ( (A_n_rows > 0) || (A_n_cols > 0) ) && ( (B_n_rows > 0) || (B_n_cols > 0) ) ), "join_cols() / join_vert(): number of columns must be the same" @@ -64,7 +64,7 @@ inline void glue_join_cols::apply(Mat& out, const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -92,7 +92,7 @@ inline void glue_join_cols::apply(Mat& out, const Base& A_expr, const Base& B_expr, const Base& C_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap UA(A_expr.get_ref()); const quasi_unwrap UB(B_expr.get_ref()); @@ -105,9 +105,9 @@ glue_join_cols::apply(Mat& out, const Base& A_expr, const Base const uword out_n_rows = A.n_rows + B.n_rows + C.n_rows; const uword out_n_cols = (std::max)((std::max)(A.n_cols, B.n_cols), C.n_cols); - arma_debug_check( ((A.n_cols != out_n_cols) && ((A.n_rows > 0) || (A.n_cols > 0))), "join_cols() / join_vert(): number of columns must be the same" ); - arma_debug_check( ((B.n_cols != out_n_cols) && ((B.n_rows > 0) || (B.n_cols > 0))), "join_cols() / join_vert(): number of columns must be the same" ); - arma_debug_check( ((C.n_cols != out_n_cols) && ((C.n_rows > 0) || (C.n_cols > 0))), "join_cols() / join_vert(): number of columns must be the same" ); + arma_conform_check( ((A.n_cols != out_n_cols) && ((A.n_rows > 0) || (A.n_cols > 0))), "join_cols() / join_vert(): number of columns must be the same" ); + arma_conform_check( ((B.n_cols != out_n_cols) && ((B.n_rows > 0) || (B.n_cols > 0))), "join_cols() / join_vert(): number of columns must be the same" ); + arma_conform_check( ((C.n_cols != out_n_cols) && ((C.n_rows > 0) || (C.n_cols > 0))), "join_cols() / join_vert(): number of columns must be the same" ); out.set_size(out_n_rows, out_n_cols); @@ -134,7 +134,7 @@ inline void glue_join_cols::apply(Mat& out, const Base& A_expr, const Base& B_expr, const Base& C_expr, const Base& D_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap UA(A_expr.get_ref()); const quasi_unwrap UB(B_expr.get_ref()); @@ -149,10 +149,10 @@ glue_join_cols::apply(Mat& out, const Base& A_expr, const Base const uword out_n_rows = A.n_rows + B.n_rows + C.n_rows + D.n_rows; const uword out_n_cols = (std::max)(((std::max)((std::max)(A.n_cols, B.n_cols), C.n_cols)), D.n_cols); - arma_debug_check( ((A.n_cols != out_n_cols) && ((A.n_rows > 0) || (A.n_cols > 0))), "join_cols() / join_vert(): number of columns must be the same" ); - arma_debug_check( ((B.n_cols != out_n_cols) && ((B.n_rows > 0) || (B.n_cols > 0))), "join_cols() / join_vert(): number of columns must be the same" ); - arma_debug_check( ((C.n_cols != out_n_cols) && ((C.n_rows > 0) || (C.n_cols > 0))), "join_cols() / join_vert(): number of columns must be the same" ); - arma_debug_check( ((D.n_cols != out_n_cols) && ((D.n_rows > 0) || (D.n_cols > 0))), "join_cols() / join_vert(): number of columns must be the same" ); + arma_conform_check( ((A.n_cols != out_n_cols) && ((A.n_rows > 0) || (A.n_cols > 0))), "join_cols() / join_vert(): number of columns must be the same" ); + arma_conform_check( ((B.n_cols != out_n_cols) && ((B.n_rows > 0) || (B.n_cols > 0))), "join_cols() / join_vert(): number of columns must be the same" ); + arma_conform_check( ((C.n_cols != out_n_cols) && ((C.n_rows > 0) || (C.n_cols > 0))), "join_cols() / join_vert(): number of columns must be the same" ); + arma_conform_check( ((D.n_cols != out_n_cols) && ((D.n_rows > 0) || (D.n_cols > 0))), "join_cols() / join_vert(): number of columns must be the same" ); out.set_size(out_n_rows, out_n_cols); @@ -183,7 +183,7 @@ inline void glue_join_rows::apply_noalias(Mat& out, const Proxy& A, const Proxy& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword A_n_rows = A.get_n_rows(); const uword A_n_cols = A.get_n_cols(); @@ -191,7 +191,7 @@ glue_join_rows::apply_noalias(Mat& out, const Proxy& const uword B_n_rows = B.get_n_rows(); const uword B_n_cols = B.get_n_cols(); - arma_debug_check + arma_conform_check ( ( (A_n_rows != B_n_rows) && ( (A_n_rows > 0) || (A_n_cols > 0) ) && ( (B_n_rows > 0) || (B_n_cols > 0) ) ), "join_rows() / join_horiz(): number of rows must be the same" @@ -221,7 +221,7 @@ inline void glue_join_rows::apply(Mat& out, const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -249,7 +249,7 @@ inline void glue_join_rows::apply(Mat& out, const Base& A_expr, const Base& B_expr, const Base& C_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap UA(A_expr.get_ref()); const quasi_unwrap UB(B_expr.get_ref()); @@ -262,9 +262,9 @@ glue_join_rows::apply(Mat& out, const Base& A_expr, const Base const uword out_n_rows = (std::max)((std::max)(A.n_rows, B.n_rows), C.n_rows); const uword out_n_cols = A.n_cols + B.n_cols + C.n_cols; - arma_debug_check( ((A.n_rows != out_n_rows) && ((A.n_rows > 0) || (A.n_cols > 0))), "join_rows() / join_horiz(): number of rows must be the same" ); - arma_debug_check( ((B.n_rows != out_n_rows) && ((B.n_rows > 0) || (B.n_cols > 0))), "join_rows() / join_horiz(): number of rows must be the same" ); - arma_debug_check( ((C.n_rows != out_n_rows) && ((C.n_rows > 0) || (C.n_cols > 0))), "join_rows() / join_horiz(): number of rows must be the same" ); + arma_conform_check( ((A.n_rows != out_n_rows) && ((A.n_rows > 0) || (A.n_cols > 0))), "join_rows() / join_horiz(): number of rows must be the same" ); + arma_conform_check( ((B.n_rows != out_n_rows) && ((B.n_rows > 0) || (B.n_cols > 0))), "join_rows() / join_horiz(): number of rows must be the same" ); + arma_conform_check( ((C.n_rows != out_n_rows) && ((C.n_rows > 0) || (C.n_cols > 0))), "join_rows() / join_horiz(): number of rows must be the same" ); out.set_size(out_n_rows, out_n_cols); @@ -291,7 +291,7 @@ inline void glue_join_rows::apply(Mat& out, const Base& A_expr, const Base& B_expr, const Base& C_expr, const Base& D_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap UA(A_expr.get_ref()); const quasi_unwrap UB(B_expr.get_ref()); @@ -306,10 +306,10 @@ glue_join_rows::apply(Mat& out, const Base& A_expr, const Base const uword out_n_rows = (std::max)(((std::max)((std::max)(A.n_rows, B.n_rows), C.n_rows)), D.n_rows); const uword out_n_cols = A.n_cols + B.n_cols + C.n_cols + D.n_cols; - arma_debug_check( ((A.n_rows != out_n_rows) && ((A.n_rows > 0) || (A.n_cols > 0))), "join_rows() / join_horiz(): number of rows must be the same" ); - arma_debug_check( ((B.n_rows != out_n_rows) && ((B.n_rows > 0) || (B.n_cols > 0))), "join_rows() / join_horiz(): number of rows must be the same" ); - arma_debug_check( ((C.n_rows != out_n_rows) && ((C.n_rows > 0) || (C.n_cols > 0))), "join_rows() / join_horiz(): number of rows must be the same" ); - arma_debug_check( ((D.n_rows != out_n_rows) && ((D.n_rows > 0) || (D.n_cols > 0))), "join_rows() / join_horiz(): number of rows must be the same" ); + arma_conform_check( ((A.n_rows != out_n_rows) && ((A.n_rows > 0) || (A.n_cols > 0))), "join_rows() / join_horiz(): number of rows must be the same" ); + arma_conform_check( ((B.n_rows != out_n_rows) && ((B.n_rows > 0) || (B.n_cols > 0))), "join_rows() / join_horiz(): number of rows must be the same" ); + arma_conform_check( ((C.n_rows != out_n_rows) && ((C.n_rows > 0) || (C.n_cols > 0))), "join_rows() / join_horiz(): number of rows must be the same" ); + arma_conform_check( ((D.n_rows != out_n_rows) && ((D.n_rows > 0) || (D.n_cols > 0))), "join_rows() / join_horiz(): number of rows must be the same" ); out.set_size(out_n_rows, out_n_cols); @@ -340,7 +340,7 @@ inline void glue_join_slices::apply(Cube& out, const GlueCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -353,7 +353,7 @@ glue_join_slices::apply(Cube& out, const GlueCube& out, const Mat& A, const Mat& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword A_rows = A.n_rows; const uword A_cols = A.n_cols; @@ -58,7 +58,7 @@ inline void glue_kron::direct_kron(Mat< std::complex >& out, const Mat< std::complex >& A, const Mat& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; @@ -92,7 +92,7 @@ inline void glue_kron::direct_kron(Mat< std::complex >& out, const Mat& A, const Mat< std::complex >& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword A_rows = A.n_rows; const uword A_cols = A.n_cols; @@ -121,7 +121,7 @@ inline void glue_kron::apply(Mat& out, const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/glue_max_meat.hpp b/inst/include/armadillo_bits/glue_max_meat.hpp index b1e52c28..fe8d3885 100644 --- a/inst/include/armadillo_bits/glue_max_meat.hpp +++ b/inst/include/armadillo_bits/glue_max_meat.hpp @@ -27,7 +27,7 @@ inline void glue_max::apply(Mat& out, const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -55,12 +55,12 @@ inline void glue_max::apply(Mat& out, const Proxy& PA, const Proxy& PB) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_rows = PA.get_n_rows(); const uword n_cols = PA.get_n_cols(); - arma_debug_assert_same_size(n_rows, n_cols, PB.get_n_rows(), PB.get_n_cols(), "element-wise max()"); + arma_conform_assert_same_size(n_rows, n_cols, PB.get_n_rows(), PB.get_n_cols(), "element-wise max()"); const arma_gt_comparator comparator; @@ -105,7 +105,7 @@ inline void glue_max::apply(Cube& out, const GlueCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -133,13 +133,13 @@ inline void glue_max::apply(Cube& out, const ProxyCube& PA, const ProxyCube& PB) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_rows = PA.get_n_rows(); const uword n_cols = PA.get_n_cols(); const uword n_slices = PA.get_n_slices(); - arma_debug_assert_same_size(n_rows, n_cols, n_slices, PB.get_n_rows(), PB.get_n_cols(), PB.get_n_slices(), "element-wise max()"); + arma_conform_assert_same_size(n_rows, n_cols, n_slices, PB.get_n_rows(), PB.get_n_cols(), PB.get_n_slices(), "element-wise max()"); const arma_gt_comparator comparator; diff --git a/inst/include/armadillo_bits/glue_min_meat.hpp b/inst/include/armadillo_bits/glue_min_meat.hpp index 0fc6e3f0..d6bce26f 100644 --- a/inst/include/armadillo_bits/glue_min_meat.hpp +++ b/inst/include/armadillo_bits/glue_min_meat.hpp @@ -27,7 +27,7 @@ inline void glue_min::apply(Mat& out, const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -55,12 +55,12 @@ inline void glue_min::apply(Mat& out, const Proxy& PA, const Proxy& PB) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_rows = PA.get_n_rows(); const uword n_cols = PA.get_n_cols(); - arma_debug_assert_same_size(n_rows, n_cols, PB.get_n_rows(), PB.get_n_cols(), "element-wise min()"); + arma_conform_assert_same_size(n_rows, n_cols, PB.get_n_rows(), PB.get_n_cols(), "element-wise min()"); const arma_lt_comparator comparator; @@ -105,7 +105,7 @@ inline void glue_min::apply(Cube& out, const GlueCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -133,13 +133,13 @@ inline void glue_min::apply(Cube& out, const ProxyCube& PA, const ProxyCube& PB) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_rows = PA.get_n_rows(); const uword n_cols = PA.get_n_cols(); const uword n_slices = PA.get_n_slices(); - arma_debug_assert_same_size(n_rows, n_cols, n_slices, PB.get_n_rows(), PB.get_n_cols(), PB.get_n_slices(), "element-wise min()"); + arma_conform_assert_same_size(n_rows, n_cols, n_slices, PB.get_n_rows(), PB.get_n_cols(), PB.get_n_slices(), "element-wise min()"); const arma_lt_comparator comparator; diff --git a/inst/include/armadillo_bits/glue_mixed_meat.hpp b/inst/include/armadillo_bits/glue_mixed_meat.hpp index 21b6dc4b..d7c28df3 100644 --- a/inst/include/armadillo_bits/glue_mixed_meat.hpp +++ b/inst/include/armadillo_bits/glue_mixed_meat.hpp @@ -27,7 +27,7 @@ inline void glue_mixed_times::apply(Mat::eT>& out, const mtGlue::eT, T1, T2, glue_mixed_times>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type in_eT1; typedef typename T2::elem_type in_eT2; @@ -40,13 +40,13 @@ glue_mixed_times::apply(Mat::eT>& out, const mtGlue< const typename partial_unwrap::stored_type& A = tmp1.M; const typename partial_unwrap::stored_type& B = tmp2.M; - const bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; - const out_eT alpha = use_alpha ? (upgrade_val::apply(tmp1.get_val()) * upgrade_val::apply(tmp2.get_val())) : out_eT(0); + constexpr bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; + const out_eT alpha = use_alpha ? (upgrade_val::apply(tmp1.get_val()) * upgrade_val::apply(tmp2.get_val())) : out_eT(0); const bool do_trans_A = partial_unwrap::do_trans; const bool do_trans_B = partial_unwrap::do_trans; - arma_debug_assert_trans_mul_size(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication"); + arma_conform_assert_trans_mul_size(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication"); const uword out_n_rows = (do_trans_A == false) ? A.n_rows : A.n_cols; const uword out_n_cols = (do_trans_B == false) ? B.n_cols : B.n_rows; @@ -77,7 +77,7 @@ inline void glue_mixed_plus::apply(Mat::eT>& out, const mtGlue::eT, T1, T2, glue_mixed_plus>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -89,7 +89,7 @@ glue_mixed_plus::apply(Mat::eT>& out, const mtGlue A(X.A); const Proxy B(X.B); - arma_debug_assert_same_size(A, B, "addition"); + arma_conform_assert_same_size(A, B, "addition"); const uword n_rows = A.get_n_rows(); const uword n_cols = A.get_n_cols(); @@ -99,7 +99,7 @@ glue_mixed_plus::apply(Mat::eT>& out, const mtGlue::use_at || Proxy::use_at); + constexpr bool use_at = (Proxy::use_at || Proxy::use_at); if(use_at == false) { @@ -142,7 +142,7 @@ inline void glue_mixed_minus::apply(Mat::eT>& out, const mtGlue::eT, T1, T2, glue_mixed_minus>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -154,7 +154,7 @@ glue_mixed_minus::apply(Mat::eT>& out, const mtGlue< const Proxy A(X.A); const Proxy B(X.B); - arma_debug_assert_same_size(A, B, "subtraction"); + arma_conform_assert_same_size(A, B, "subtraction"); const uword n_rows = A.get_n_rows(); const uword n_cols = A.get_n_cols(); @@ -164,7 +164,7 @@ glue_mixed_minus::apply(Mat::eT>& out, const mtGlue< out_eT* out_mem = out.memptr(); const uword n_elem = out.n_elem; - const bool use_at = (Proxy::use_at || Proxy::use_at); + constexpr bool use_at = (Proxy::use_at || Proxy::use_at); if(use_at == false) { @@ -207,7 +207,7 @@ inline void glue_mixed_div::apply(Mat::eT>& out, const mtGlue::eT, T1, T2, glue_mixed_div>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -219,7 +219,7 @@ glue_mixed_div::apply(Mat::eT>& out, const mtGlue A(X.A); const Proxy B(X.B); - arma_debug_assert_same_size(A, B, "element-wise division"); + arma_conform_assert_same_size(A, B, "element-wise division"); const uword n_rows = A.get_n_rows(); const uword n_cols = A.get_n_cols(); @@ -229,7 +229,7 @@ glue_mixed_div::apply(Mat::eT>& out, const mtGlue::use_at || Proxy::use_at); + constexpr bool use_at = (Proxy::use_at || Proxy::use_at); if(use_at == false) { @@ -272,7 +272,7 @@ inline void glue_mixed_schur::apply(Mat::eT>& out, const mtGlue::eT, T1, T2, glue_mixed_schur>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -284,7 +284,7 @@ glue_mixed_schur::apply(Mat::eT>& out, const mtGlue< const Proxy A(X.A); const Proxy B(X.B); - arma_debug_assert_same_size(A, B, "element-wise multiplication"); + arma_conform_assert_same_size(A, B, "element-wise multiplication"); const uword n_rows = A.get_n_rows(); const uword n_cols = A.get_n_cols(); @@ -294,7 +294,7 @@ glue_mixed_schur::apply(Mat::eT>& out, const mtGlue< out_eT* out_mem = out.memptr(); const uword n_elem = out.n_elem; - const bool use_at = (Proxy::use_at || Proxy::use_at); + constexpr bool use_at = (Proxy::use_at || Proxy::use_at); if(use_at == false) { @@ -343,7 +343,7 @@ inline void glue_mixed_plus::apply(Cube::eT>& out, const mtGlueCube::eT, T1, T2, glue_mixed_plus>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -355,7 +355,7 @@ glue_mixed_plus::apply(Cube::eT>& out, const mtGlueC const ProxyCube A(X.A); const ProxyCube B(X.B); - arma_debug_assert_same_size(A, B, "addition"); + arma_conform_assert_same_size(A, B, "addition"); const uword n_rows = A.get_n_rows(); const uword n_cols = A.get_n_cols(); @@ -366,7 +366,7 @@ glue_mixed_plus::apply(Cube::eT>& out, const mtGlueC out_eT* out_mem = out.memptr(); const uword n_elem = out.n_elem; - const bool use_at = (ProxyCube::use_at || ProxyCube::use_at); + constexpr bool use_at = (ProxyCube::use_at || ProxyCube::use_at); if(use_at == false) { @@ -398,7 +398,7 @@ inline void glue_mixed_minus::apply(Cube::eT>& out, const mtGlueCube::eT, T1, T2, glue_mixed_minus>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -410,7 +410,7 @@ glue_mixed_minus::apply(Cube::eT>& out, const mtGlue const ProxyCube A(X.A); const ProxyCube B(X.B); - arma_debug_assert_same_size(A, B, "subtraction"); + arma_conform_assert_same_size(A, B, "subtraction"); const uword n_rows = A.get_n_rows(); const uword n_cols = A.get_n_cols(); @@ -421,7 +421,7 @@ glue_mixed_minus::apply(Cube::eT>& out, const mtGlue out_eT* out_mem = out.memptr(); const uword n_elem = out.n_elem; - const bool use_at = (ProxyCube::use_at || ProxyCube::use_at); + constexpr bool use_at = (ProxyCube::use_at || ProxyCube::use_at); if(use_at == false) { @@ -453,7 +453,7 @@ inline void glue_mixed_div::apply(Cube::eT>& out, const mtGlueCube::eT, T1, T2, glue_mixed_div>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -465,7 +465,7 @@ glue_mixed_div::apply(Cube::eT>& out, const mtGlueCu const ProxyCube A(X.A); const ProxyCube B(X.B); - arma_debug_assert_same_size(A, B, "element-wise division"); + arma_conform_assert_same_size(A, B, "element-wise division"); const uword n_rows = A.get_n_rows(); const uword n_cols = A.get_n_cols(); @@ -476,7 +476,7 @@ glue_mixed_div::apply(Cube::eT>& out, const mtGlueCu out_eT* out_mem = out.memptr(); const uword n_elem = out.n_elem; - const bool use_at = (ProxyCube::use_at || ProxyCube::use_at); + constexpr bool use_at = (ProxyCube::use_at || ProxyCube::use_at); if(use_at == false) { @@ -508,7 +508,7 @@ inline void glue_mixed_schur::apply(Cube::eT>& out, const mtGlueCube::eT, T1, T2, glue_mixed_schur>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -520,7 +520,7 @@ glue_mixed_schur::apply(Cube::eT>& out, const mtGlue const ProxyCube A(X.A); const ProxyCube B(X.B); - arma_debug_assert_same_size(A, B, "element-wise multiplication"); + arma_conform_assert_same_size(A, B, "element-wise multiplication"); const uword n_rows = A.get_n_rows(); const uword n_cols = A.get_n_cols(); @@ -531,7 +531,7 @@ glue_mixed_schur::apply(Cube::eT>& out, const mtGlue out_eT* out_mem = out.memptr(); const uword n_elem = out.n_elem; - const bool use_at = (ProxyCube::use_at || ProxyCube::use_at); + constexpr bool use_at = (ProxyCube::use_at || ProxyCube::use_at); if(use_at == false) { diff --git a/inst/include/armadillo_bits/glue_mvnrnd_meat.hpp b/inst/include/armadillo_bits/glue_mvnrnd_meat.hpp index 3c3019fb..8f770365 100644 --- a/inst/include/armadillo_bits/glue_mvnrnd_meat.hpp +++ b/inst/include/armadillo_bits/glue_mvnrnd_meat.hpp @@ -32,7 +32,7 @@ inline void glue_mvnrnd_vec::apply(Mat& out, const Glue& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = glue_mvnrnd::apply_direct(out, expr.A, expr.B, uword(1)); @@ -50,7 +50,7 @@ inline void glue_mvnrnd::apply(Mat& out, const Glue& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = glue_mvnrnd::apply_direct(out, expr.A, expr.B, expr.aux_uword); @@ -68,16 +68,16 @@ inline bool glue_mvnrnd::apply_direct(Mat& out, const Base& M, const Base& C, const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const quasi_unwrap UM(M.get_ref()); const quasi_unwrap UC(C.get_ref()); - arma_debug_check( (UM.M.is_colvec() == false) && (UM.M.is_empty() == false), "mvnrnd(): given mean must be a column vector" ); - arma_debug_check( (UC.M.is_square() == false), "mvnrnd(): given covariance matrix must be square sized" ); - arma_debug_check( (UM.M.n_rows != UC.M.n_rows), "mvnrnd(): number of rows in given mean vector and covariance matrix must match" ); + arma_conform_check( (UM.M.is_colvec() == false) && (UM.M.is_empty() == false), "mvnrnd(): given mean must be a column vector" ); + arma_conform_check( (UC.M.is_square() == false), "mvnrnd(): given covariance matrix must be square sized" ); + arma_conform_check( (UM.M.n_rows != UC.M.n_rows), "mvnrnd(): number of rows in given mean vector and covariance matrix must match" ); if( UM.M.is_empty() || UC.M.is_empty() ) { @@ -85,9 +85,9 @@ glue_mvnrnd::apply_direct(Mat& out, const Base& out, const Mat& M, const Mat& C, const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat D; diff --git a/inst/include/armadillo_bits/glue_polyfit_meat.hpp b/inst/include/armadillo_bits/glue_polyfit_meat.hpp index 3969c75f..a809685e 100644 --- a/inst/include/armadillo_bits/glue_polyfit_meat.hpp +++ b/inst/include/armadillo_bits/glue_polyfit_meat.hpp @@ -26,7 +26,7 @@ inline bool glue_polyfit::apply_noalias(Mat& out, const Col& X, const Col& Y, const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // create Vandermonde matrix @@ -65,7 +65,7 @@ inline bool glue_polyfit::apply_direct(Mat& out, const Base& X_expr, const Base& Y_expr, const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -75,13 +75,13 @@ glue_polyfit::apply_direct(Mat& out, const Base& X = UX.M; const Mat& Y = UY.M; - arma_debug_check + arma_conform_check ( ( ((X.is_vec() == false) && (X.is_empty() == false)) || ((Y.is_vec() == false) && (Y.is_empty() == false)) ), "polyfit(): given object must be a vector" ); - arma_debug_check( (X.n_elem != Y.n_elem), "polyfit(): given vectors must have the same number of elements" ); + arma_conform_check( (X.n_elem != Y.n_elem), "polyfit(): given vectors must have the same number of elements" ); if(X.n_elem == 0) { @@ -89,7 +89,7 @@ glue_polyfit::apply_direct(Mat& out, const Base= X.n_elem), "polyfit(): N must be less than the number of elements in X" ); + arma_conform_check( (N >= X.n_elem), "polyfit(): N must be less than the number of elements in X" ); const Col X_as_colvec( const_cast(X.memptr()), X.n_elem, false, false); const Col Y_as_colvec( const_cast(Y.memptr()), Y.n_elem, false, false); @@ -117,7 +117,7 @@ inline void glue_polyfit::apply(Mat& out, const Glue& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = glue_polyfit::apply_direct(out, expr.A, expr.B, expr.aux_uword); diff --git a/inst/include/armadillo_bits/glue_polyval_meat.hpp b/inst/include/armadillo_bits/glue_polyval_meat.hpp index 2c2a59cb..ed305526 100644 --- a/inst/include/armadillo_bits/glue_polyval_meat.hpp +++ b/inst/include/armadillo_bits/glue_polyval_meat.hpp @@ -26,7 +26,7 @@ inline void glue_polyval::apply_noalias(Mat& out, const Mat& P, const Mat& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out.set_size(X.n_rows, X.n_cols); @@ -48,7 +48,7 @@ inline void glue_polyval::apply(Mat& out, const Glue& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -58,7 +58,7 @@ glue_polyval::apply(Mat& out, const Glue& P = UP.M; const Mat& X = UX.M; - arma_debug_check( ((P.is_vec() == false) && (P.is_empty() == false)), "polyval(): argument P must be a vector" ); + arma_conform_check( ((P.is_vec() == false) && (P.is_empty() == false)), "polyval(): argument P must be a vector" ); if(P.is_empty() || X.is_empty()) { diff --git a/inst/include/armadillo_bits/glue_powext_meat.hpp b/inst/include/armadillo_bits/glue_powext_meat.hpp index 700a2cfd..927ead6c 100644 --- a/inst/include/armadillo_bits/glue_powext_meat.hpp +++ b/inst/include/armadillo_bits/glue_powext_meat.hpp @@ -26,7 +26,7 @@ inline void glue_powext::apply(Mat& out, const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -36,7 +36,7 @@ glue_powext::apply(Mat& out, const Glue& A = UA.M; const Mat& B = UB.M; - arma_debug_assert_same_size(A, B, "element-wise pow()"); + arma_conform_assert_same_size(A, B, "element-wise pow()"); const bool UA_bad_alias = UA.is_alias(out) && (UA.has_subview); // allow inplace operation const bool UB_bad_alias = UB.is_alias(out); @@ -62,7 +62,7 @@ inline void glue_powext::apply(Mat& out, const Mat& A, const Mat& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out.set_size(A.n_rows, A.n_cols); @@ -106,7 +106,7 @@ glue_powext::apply const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename parent::elem_type eT; @@ -212,7 +212,7 @@ inline void glue_powext::apply(Cube& out, const GlueCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -222,7 +222,7 @@ glue_powext::apply(Cube& out, const GlueCube& A = UA.M; const Cube& B = UB.M; - arma_debug_assert_same_size(A, B, "element-wise pow()"); + arma_conform_assert_same_size(A, B, "element-wise pow()"); if(UB.is_alias(out)) { @@ -245,7 +245,7 @@ inline void glue_powext::apply(Cube& out, const Cube& A, const Cube& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out.set_size(A.n_rows, A.n_cols, A.n_slices); @@ -289,7 +289,7 @@ glue_powext::apply const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Cube& A = X.P; @@ -355,7 +355,7 @@ inline void glue_powext_cx::apply(Mat& out, const mtGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; @@ -366,7 +366,7 @@ glue_powext_cx::apply(Mat& out, const mtGlue& A = UA.M; const Mat< T>& B = UB.M; - arma_debug_assert_same_size(A, B, "element-wise pow()"); + arma_conform_assert_same_size(A, B, "element-wise pow()"); if(UA.is_alias(out) && (UA.has_subview)) { @@ -389,7 +389,7 @@ inline void glue_powext_cx::apply(Mat< std::complex >& out, const Mat< std::complex >& A, const Mat& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; @@ -435,7 +435,7 @@ glue_powext_cx::apply const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename parent::elem_type eT; typedef typename parent::pod_type T; @@ -542,7 +542,7 @@ inline void glue_powext_cx::apply(Cube& out, const mtGlueCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -554,7 +554,7 @@ glue_powext_cx::apply(Cube& out, const mtGlueCube& A = UA.M; const Cube< T>& B = UB.M; - arma_debug_assert_same_size(A, B, "element-wise pow()"); + arma_conform_assert_same_size(A, B, "element-wise pow()"); glue_powext_cx::apply(out, A, B); } @@ -566,7 +566,7 @@ inline void glue_powext_cx::apply(Cube< std::complex >& out, const Cube< std::complex >& A, const Cube& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; @@ -612,7 +612,7 @@ glue_powext_cx::apply const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; diff --git a/inst/include/armadillo_bits/glue_quantile_meat.hpp b/inst/include/armadillo_bits/glue_quantile_meat.hpp index 370e432a..726faeb1 100644 --- a/inst/include/armadillo_bits/glue_quantile_meat.hpp +++ b/inst/include/armadillo_bits/glue_quantile_meat.hpp @@ -25,7 +25,7 @@ inline void glue_quantile::worker(eTb* out_mem, Col& Y, const Mat& P) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: assuming out_mem is an array with P.n_elem elements @@ -90,9 +90,9 @@ inline void glue_quantile::apply_noalias(Mat& out, const Mat& X, const Mat& P, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( ((P.is_vec() == false) && (P.is_empty() == false)), "quantile(): parameter 'P' must be a vector" ); + arma_conform_check( ((P.is_vec() == false) && (P.is_empty() == false)), "quantile(): parameter 'P' must be a vector" ); if(X.is_empty()) { out.reset(); return; } @@ -167,18 +167,18 @@ inline void glue_quantile::apply(Mat& out, const mtGlue& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T2::elem_type eTb; const uword dim = expr.aux_uword; - arma_debug_check( (dim > 1), "quantile(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "quantile(): parameter 'dim' must be 0 or 1" ); const quasi_unwrap UA(expr.A); const quasi_unwrap UB(expr.B); - arma_debug_check((UA.M.internal_has_nan() || UB.M.internal_has_nan()), "quantile(): detected NaN"); + arma_conform_check((UA.M.internal_has_nan() || UB.M.internal_has_nan()), "quantile(): detected NaN"); if(UA.is_alias(out) || UB.is_alias(out)) { @@ -201,7 +201,7 @@ inline void glue_quantile_default::apply(Mat& out, const mtGlue& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T2::elem_type eTb; @@ -210,7 +210,7 @@ glue_quantile_default::apply(Mat& out, const mtGlue P1(X.A);\ const Proxy P2(X.B);\ \ - arma_debug_assert_same_size(P1, P2, operator_str);\ + arma_conform_assert_same_size(P1, P2, operator_str);\ \ const bool bad_alias = (Proxy::has_subview && P1.is_alias(out)) || (Proxy::has_subview && P2.is_alias(out));\ \ @@ -47,7 +47,7 @@ \ uword* out_mem = out.memptr();\ \ - const bool use_at = (Proxy::use_at || Proxy::use_at);\ + constexpr bool use_at = (Proxy::use_at || Proxy::use_at);\ \ if(use_at == false)\ {\ @@ -98,7 +98,7 @@ const ProxyCube P1(X.A);\ const ProxyCube P2(X.B);\ \ - arma_debug_assert_same_size(P1, P2, operator_str);\ + arma_conform_assert_same_size(P1, P2, operator_str);\ \ const bool bad_alias = (ProxyCube::has_subview && P1.is_alias(out)) || (ProxyCube::has_subview && P2.is_alias(out));\ \ @@ -113,7 +113,7 @@ \ uword* out_mem = out.memptr();\ \ - const bool use_at = (ProxyCube::use_at || ProxyCube::use_at);\ + constexpr bool use_at = (ProxyCube::use_at || ProxyCube::use_at);\ \ if(use_at == false)\ {\ @@ -158,7 +158,7 @@ glue_rel_lt::apply const mtGlue& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_mat(<, "operator<"); } @@ -174,7 +174,7 @@ glue_rel_gt::apply const mtGlue& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_mat(>, "operator>"); } @@ -190,7 +190,7 @@ glue_rel_lteq::apply const mtGlue& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_mat(<=, "operator<="); } @@ -206,7 +206,7 @@ glue_rel_gteq::apply const mtGlue& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_mat(>=, "operator>="); } @@ -222,7 +222,7 @@ glue_rel_eq::apply const mtGlue& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_mat(==, "operator=="); } @@ -238,7 +238,7 @@ glue_rel_noteq::apply const mtGlue& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_mat(!=, "operator!="); } @@ -254,7 +254,7 @@ glue_rel_and::apply const mtGlue& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_mat(&&, "operator&&"); } @@ -270,7 +270,7 @@ glue_rel_or::apply const mtGlue& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_mat(||, "operator||"); } @@ -292,7 +292,7 @@ glue_rel_lt::apply const mtGlueCube& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_cube(<, "operator<"); } @@ -308,7 +308,7 @@ glue_rel_gt::apply const mtGlueCube& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_cube(>, "operator>"); } @@ -324,7 +324,7 @@ glue_rel_lteq::apply const mtGlueCube& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_cube(<=, "operator<="); } @@ -340,7 +340,7 @@ glue_rel_gteq::apply const mtGlueCube& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_cube(>=, "operator>="); } @@ -356,7 +356,7 @@ glue_rel_eq::apply const mtGlueCube& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_cube(==, "operator=="); } @@ -372,7 +372,7 @@ glue_rel_noteq::apply const mtGlueCube& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_cube(!=, "operator!="); } @@ -388,7 +388,7 @@ glue_rel_and::apply const mtGlueCube& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_cube(&&, "operator&&"); } @@ -404,7 +404,7 @@ glue_rel_or::apply const mtGlueCube& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_cube(||, "operator||"); } diff --git a/inst/include/armadillo_bits/glue_solve_meat.hpp b/inst/include/armadillo_bits/glue_solve_meat.hpp index 1c3bbf0c..81d1a355 100644 --- a/inst/include/armadillo_bits/glue_solve_meat.hpp +++ b/inst/include/armadillo_bits/glue_solve_meat.hpp @@ -30,7 +30,7 @@ inline void glue_solve_gen_default::apply(Mat& out, const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = glue_solve_gen_default::apply(out, X.A, X.B); @@ -48,7 +48,7 @@ inline bool glue_solve_gen_default::apply(Mat& out, const Base& A_expr, const Base& B_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return glue_solve_gen_full::apply( out, A_expr, B_expr, uword(0)); } @@ -64,7 +64,7 @@ inline void glue_solve_gen_full::apply(Mat& out, const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = glue_solve_gen_full::apply( out, X.A, X.B, X.aux_uword ); @@ -82,12 +82,12 @@ inline bool glue_solve_gen_full::apply(Mat& actual_out, const Base& A_expr, const Base& B_expr, const uword flags) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; - if(has_user_flags == true ) { arma_extra_debug_print("glue_solve_gen_full::apply(): has_user_flags = true" ); } - if(has_user_flags == false) { arma_extra_debug_print("glue_solve_gen_full::apply(): has_user_flags = false"); } + if(has_user_flags == true ) { arma_debug_print("glue_solve_gen_full::apply(): has_user_flags = true" ); } + if(has_user_flags == false) { arma_debug_print("glue_solve_gen_full::apply(): has_user_flags = false"); } const bool fast = has_user_flags && bool(flags & solve_opts::flag_fast ); const bool equilibrate = has_user_flags && bool(flags & solve_opts::flag_equilibrate ); @@ -102,36 +102,36 @@ glue_solve_gen_full::apply(Mat& actual_out, const Base& A_expr, const if(has_user_flags) { - arma_extra_debug_print("glue_solve_gen_full::apply(): enabled flags:"); + arma_debug_print("glue_solve_gen_full::apply(): enabled flags:"); - if(fast ) { arma_extra_debug_print("fast"); } - if(equilibrate ) { arma_extra_debug_print("equilibrate"); } - if(no_approx ) { arma_extra_debug_print("no_approx"); } - if(no_band ) { arma_extra_debug_print("no_band"); } - if(no_sympd ) { arma_extra_debug_print("no_sympd"); } - if(allow_ugly ) { arma_extra_debug_print("allow_ugly"); } - if(likely_sympd) { arma_extra_debug_print("likely_sympd"); } - if(refine ) { arma_extra_debug_print("refine"); } - if(no_trimat ) { arma_extra_debug_print("no_trimat"); } - if(force_approx) { arma_extra_debug_print("force_approx"); } + if(fast ) { arma_debug_print("fast"); } + if(equilibrate ) { arma_debug_print("equilibrate"); } + if(no_approx ) { arma_debug_print("no_approx"); } + if(no_band ) { arma_debug_print("no_band"); } + if(no_sympd ) { arma_debug_print("no_sympd"); } + if(allow_ugly ) { arma_debug_print("allow_ugly"); } + if(likely_sympd) { arma_debug_print("likely_sympd"); } + if(refine ) { arma_debug_print("refine"); } + if(no_trimat ) { arma_debug_print("no_trimat"); } + if(force_approx) { arma_debug_print("force_approx"); } - arma_debug_check( (fast && equilibrate ), "solve(): options 'fast' and 'equilibrate' are mutually exclusive" ); - arma_debug_check( (fast && refine ), "solve(): options 'fast' and 'refine' are mutually exclusive" ); - arma_debug_check( (no_sympd && likely_sympd), "solve(): options 'no_sympd' and 'likely_sympd' are mutually exclusive" ); + arma_conform_check( (fast && equilibrate ), "solve(): options 'fast' and 'equilibrate' are mutually exclusive" ); + arma_conform_check( (fast && refine ), "solve(): options 'fast' and 'refine' are mutually exclusive" ); + arma_conform_check( (no_sympd && likely_sympd), "solve(): options 'no_sympd' and 'likely_sympd' are mutually exclusive" ); } Mat A = A_expr.get_ref(); if(force_approx) { - arma_extra_debug_print("glue_solve_gen_full::apply(): forced approximate solution"); + arma_debug_print("glue_solve_gen_full::apply(): forced approximate solution"); - arma_debug_check( no_approx, "solve(): options 'no_approx' and 'force_approx' are mutually exclusive" ); + arma_conform_check( no_approx, "solve(): options 'no_approx' and 'force_approx' are mutually exclusive" ); - if(fast) { arma_debug_warn_level(2, "solve(): option 'fast' ignored for forced approximate solution" ); } - if(equilibrate) { arma_debug_warn_level(2, "solve(): option 'equilibrate' ignored for forced approximate solution" ); } - if(refine) { arma_debug_warn_level(2, "solve(): option 'refine' ignored for forced approximate solution" ); } - if(likely_sympd) { arma_debug_warn_level(2, "solve(): option 'likely_sympd' ignored for forced approximate solution" ); } + if(fast) { arma_conform_warn(2, "solve(): option 'fast' ignored for forced approximate solution" ); } + if(equilibrate) { arma_conform_warn(2, "solve(): option 'equilibrate' ignored for forced approximate solution" ); } + if(refine) { arma_conform_warn(2, "solve(): option 'refine' ignored for forced approximate solution" ); } + if(likely_sympd) { arma_conform_warn(2, "solve(): option 'likely_sympd' ignored for forced approximate solution" ); } return auxlib::solve_approx_svd(actual_out, A, B_expr.get_ref()); // A is overwritten } @@ -157,7 +157,7 @@ glue_solve_gen_full::apply(Mat& actual_out, const Base& A_expr, const if(A.n_rows == A.n_cols) { - arma_extra_debug_print("glue_solve_gen_full::apply(): detected square system"); + arma_debug_print("glue_solve_gen_full::apply(): detected square system"); uword KL = 0; uword KU = 0; @@ -173,19 +173,19 @@ glue_solve_gen_full::apply(Mat& actual_out, const Base& A_expr, const { // fast mode: solvers without refinement and without rcond estimate - arma_extra_debug_print("glue_solve_gen_full::apply(): fast mode"); + arma_debug_print("glue_solve_gen_full::apply(): fast mode"); if(is_band) { if( (KL == 1) && (KU == 1) ) { - arma_extra_debug_print("glue_solve_gen_full::apply(): fast + tridiagonal"); + arma_debug_print("glue_solve_gen_full::apply(): fast + tridiagonal"); status = auxlib::solve_tridiag_fast(out, A, B_expr.get_ref()); } else { - arma_extra_debug_print("glue_solve_gen_full::apply(): fast + band"); + arma_debug_print("glue_solve_gen_full::apply(): fast + band"); status = auxlib::solve_band_fast(out, A, KL, KU, B_expr.get_ref()); } @@ -193,8 +193,8 @@ glue_solve_gen_full::apply(Mat& actual_out, const Base& A_expr, const else if(is_triu || is_tril) { - if(is_triu) { arma_extra_debug_print("glue_solve_gen_full::apply(): fast + upper triangular matrix"); } - if(is_tril) { arma_extra_debug_print("glue_solve_gen_full::apply(): fast + lower triangular matrix"); } + if(is_triu) { arma_debug_print("glue_solve_gen_full::apply(): fast + upper triangular matrix"); } + if(is_tril) { arma_debug_print("glue_solve_gen_full::apply(): fast + lower triangular matrix"); } const uword layout = (is_triu) ? uword(0) : uword(1); @@ -203,7 +203,7 @@ glue_solve_gen_full::apply(Mat& actual_out, const Base& A_expr, const else if(try_sympd) { - arma_extra_debug_print("glue_solve_gen_full::apply(): fast + try_sympd"); + arma_debug_print("glue_solve_gen_full::apply(): fast + try_sympd"); status = auxlib::solve_sympd_fast(out, A, B_expr.get_ref()); // A is overwritten @@ -211,7 +211,7 @@ glue_solve_gen_full::apply(Mat& actual_out, const Base& A_expr, const { // auxlib::solve_sympd_fast() may have failed because A isn't really sympd - arma_extra_debug_print("glue_solve_gen_full::apply(): auxlib::solve_sympd_fast() failed; retrying"); + arma_debug_print("glue_solve_gen_full::apply(): auxlib::solve_sympd_fast() failed; retrying"); A = A_expr.get_ref(); @@ -220,7 +220,7 @@ glue_solve_gen_full::apply(Mat& actual_out, const Base& A_expr, const } else { - arma_extra_debug_print("glue_solve_gen_full::apply(): fast + dense"); + arma_debug_print("glue_solve_gen_full::apply(): fast + dense"); status = auxlib::solve_square_fast(out, A, B_expr.get_ref()); // A is overwritten } @@ -230,18 +230,18 @@ glue_solve_gen_full::apply(Mat& actual_out, const Base& A_expr, const { // refine mode: solvers with refinement and with rcond estimate - arma_extra_debug_print("glue_solve_gen_full::apply(): refine mode"); + arma_debug_print("glue_solve_gen_full::apply(): refine mode"); if(is_band) { - arma_extra_debug_print("glue_solve_gen_full::apply(): refine + band"); + arma_debug_print("glue_solve_gen_full::apply(): refine + band"); status = auxlib::solve_band_refine(out, rcond, A, KL, KU, B_expr, equilibrate); } else if(try_sympd) { - arma_extra_debug_print("glue_solve_gen_full::apply(): refine + try_sympd"); + arma_debug_print("glue_solve_gen_full::apply(): refine + try_sympd"); status = auxlib::solve_sympd_refine(out, rcond, A, B_expr.get_ref(), equilibrate); // A is overwritten @@ -250,7 +250,7 @@ glue_solve_gen_full::apply(Mat& actual_out, const Base& A_expr, const // auxlib::solve_sympd_refine() may have failed because A isn't really sympd; // in that case rcond is set to zero - arma_extra_debug_print("glue_solve_gen_full::apply(): auxlib::solve_sympd_refine() failed; retrying"); + arma_debug_print("glue_solve_gen_full::apply(): auxlib::solve_sympd_refine() failed; retrying"); A = A_expr.get_ref(); @@ -259,7 +259,7 @@ glue_solve_gen_full::apply(Mat& actual_out, const Base& A_expr, const } else { - arma_extra_debug_print("glue_solve_gen_full::apply(): refine + dense"); + arma_debug_print("glue_solve_gen_full::apply(): refine + dense"); status = auxlib::solve_square_refine(out, rcond, A, B_expr, equilibrate); // A is overwritten } @@ -268,19 +268,19 @@ glue_solve_gen_full::apply(Mat& actual_out, const Base& A_expr, const { // default mode: solvers without refinement but with rcond estimate - arma_extra_debug_print("glue_solve_gen_full::apply(): default mode"); + arma_debug_print("glue_solve_gen_full::apply(): default mode"); if(is_band) { - arma_extra_debug_print("glue_solve_gen_full::apply(): rcond + band"); + arma_debug_print("glue_solve_gen_full::apply(): rcond + band"); status = auxlib::solve_band_rcond(out, rcond, A, KL, KU, B_expr.get_ref()); } else if(is_triu || is_tril) { - if(is_triu) { arma_extra_debug_print("glue_solve_gen_full::apply(): rcond + upper triangular matrix"); } - if(is_tril) { arma_extra_debug_print("glue_solve_gen_full::apply(): rcond + lower triangular matrix"); } + if(is_triu) { arma_debug_print("glue_solve_gen_full::apply(): rcond + upper triangular matrix"); } + if(is_tril) { arma_debug_print("glue_solve_gen_full::apply(): rcond + lower triangular matrix"); } const uword layout = (is_triu) ? uword(0) : uword(1); @@ -295,7 +295,7 @@ glue_solve_gen_full::apply(Mat& actual_out, const Base& A_expr, const if( (status == false) && (sympd_state == false) ) { - arma_extra_debug_print("glue_solve_gen_full::apply(): auxlib::solve_sympd_rcond() failed; retrying"); + arma_debug_print("glue_solve_gen_full::apply(): auxlib::solve_sympd_rcond() failed; retrying"); A = A_expr.get_ref(); @@ -310,11 +310,11 @@ glue_solve_gen_full::apply(Mat& actual_out, const Base& A_expr, const } else { - arma_extra_debug_print("glue_solve_gen_full::apply(): detected non-square system"); + arma_debug_print("glue_solve_gen_full::apply(): detected non-square system"); - if(equilibrate) { arma_debug_warn_level(2, "solve(): option 'equilibrate' ignored for non-square matrix" ); } - if(refine) { arma_debug_warn_level(2, "solve(): option 'refine' ignored for non-square matrix" ); } - if(likely_sympd) { arma_debug_warn_level(2, "solve(): option 'likely_sympd' ignored for non-square matrix" ); } + if(equilibrate) { arma_conform_warn(2, "solve(): option 'equilibrate' ignored for non-square matrix" ); } + if(refine) { arma_conform_warn(2, "solve(): option 'refine' ignored for non-square matrix" ); } + if(likely_sympd) { arma_conform_warn(2, "solve(): option 'likely_sympd' ignored for non-square matrix" ); } if(fast) { @@ -335,15 +335,15 @@ glue_solve_gen_full::apply(Mat& actual_out, const Base& A_expr, const if( (status == false) && (no_approx == false) ) { - arma_extra_debug_print("glue_solve_gen_full::apply(): solving rank deficient system"); + arma_debug_print("glue_solve_gen_full::apply(): solving rank deficient system"); if(rcond == T(0)) { - arma_debug_warn_level(2, "solve(): system is singular; attempting approx solution"); + arma_conform_warn(2, "solve(): system is singular; attempting approx solution"); } else { - arma_debug_warn_level(2, "solve(): system is singular (rcond: ", rcond, "); attempting approx solution"); + arma_conform_warn(2, "solve(): system is singular (rcond: ", rcond, "); attempting approx solution"); } // TODO: conditionally recreate A: have a separate state flag which indicates whether A was previously overwritten @@ -369,7 +369,7 @@ inline void glue_solve_tri_default::apply(Mat& out, const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = glue_solve_tri_default::apply( out, X.A, X.B, X.aux_uword ); @@ -387,22 +387,22 @@ inline bool glue_solve_tri_default::apply(Mat& actual_out, const Base& A_expr, const Base& B_expr, const uword flags) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; const bool triu = bool(flags & solve_opts::flag_triu); const bool tril = bool(flags & solve_opts::flag_tril); - arma_extra_debug_print("glue_solve_tri_default::apply(): enabled flags:"); + arma_debug_print("glue_solve_tri_default::apply(): enabled flags:"); - if(triu) { arma_extra_debug_print("triu"); } - if(tril) { arma_extra_debug_print("tril"); } + if(triu) { arma_debug_print("triu"); } + if(tril) { arma_debug_print("tril"); } const quasi_unwrap UA(A_expr.get_ref()); const Mat& A = UA.M; - arma_debug_check( (A.is_square() == false), "solve(): matrix marked as triangular must be square sized" ); + arma_conform_check( (A.is_square() == false), "solve(): matrix marked as triangular must be square sized" ); const uword layout = (triu) ? uword(0) : uword(1); @@ -432,15 +432,15 @@ glue_solve_tri_default::apply(Mat& actual_out, const Base& A_expr, co if(status == false) { - arma_extra_debug_print("glue_solve_tri_default::apply(): solving rank deficient system"); + arma_debug_print("glue_solve_tri_default::apply(): solving rank deficient system"); if(rcond == T(0)) { - arma_debug_warn_level(2, "solve(): system is singular; attempting approx solution"); + arma_conform_warn(2, "solve(): system is singular; attempting approx solution"); } else { - arma_debug_warn_level(2, "solve(): system is singular (rcond: ", rcond, "); attempting approx solution"); + arma_conform_warn(2, "solve(): system is singular (rcond: ", rcond, "); attempting approx solution"); } Mat triA = (triu) ? trimatu(A) : trimatl(A); // trimatu() and trimatl() return the same type @@ -465,7 +465,7 @@ inline void glue_solve_tri_full::apply(Mat& out, const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = glue_solve_tri_full::apply( out, X.A, X.B, X.aux_uword ); @@ -483,7 +483,7 @@ inline bool glue_solve_tri_full::apply(Mat& actual_out, const Base& A_expr, const Base& B_expr, const uword flags) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -498,18 +498,18 @@ glue_solve_tri_full::apply(Mat& actual_out, const Base& A_expr, const const bool no_trimat = bool(flags & solve_opts::flag_no_trimat ); const bool force_approx = bool(flags & solve_opts::flag_force_approx); - arma_extra_debug_print("glue_solve_tri_full::apply(): enabled flags:"); + arma_debug_print("glue_solve_tri_full::apply(): enabled flags:"); - if(fast ) { arma_extra_debug_print("fast"); } - if(equilibrate ) { arma_extra_debug_print("equilibrate"); } - if(no_approx ) { arma_extra_debug_print("no_approx"); } - if(triu ) { arma_extra_debug_print("triu"); } - if(tril ) { arma_extra_debug_print("tril"); } - if(allow_ugly ) { arma_extra_debug_print("allow_ugly"); } - if(likely_sympd) { arma_extra_debug_print("likely_sympd"); } - if(refine ) { arma_extra_debug_print("refine"); } - if(no_trimat ) { arma_extra_debug_print("no_trimat"); } - if(force_approx) { arma_extra_debug_print("force_approx"); } + if(fast ) { arma_debug_print("fast"); } + if(equilibrate ) { arma_debug_print("equilibrate"); } + if(no_approx ) { arma_debug_print("no_approx"); } + if(triu ) { arma_debug_print("triu"); } + if(tril ) { arma_debug_print("tril"); } + if(allow_ugly ) { arma_debug_print("allow_ugly"); } + if(likely_sympd) { arma_debug_print("likely_sympd"); } + if(refine ) { arma_debug_print("refine"); } + if(no_trimat ) { arma_debug_print("no_trimat"); } + if(force_approx) { arma_debug_print("force_approx"); } if(no_trimat || equilibrate || refine || force_approx) { @@ -518,12 +518,12 @@ glue_solve_tri_full::apply(Mat& actual_out, const Base& A_expr, const return glue_solve_gen_full::apply(actual_out, ((triu) ? trimatu(A_expr.get_ref()) : trimatl(A_expr.get_ref())), B_expr, (flags & mask)); } - if(likely_sympd) { arma_debug_warn_level(2, "solve(): option 'likely_sympd' ignored for triangular matrix"); } + if(likely_sympd) { arma_conform_warn(2, "solve(): option 'likely_sympd' ignored for triangular matrix"); } const quasi_unwrap UA(A_expr.get_ref()); const Mat& A = UA.M; - arma_debug_check( (A.is_square() == false), "solve(): matrix marked as triangular must be square sized" ); + arma_conform_check( (A.is_square() == false), "solve(): matrix marked as triangular must be square sized" ); const uword layout = (triu) ? uword(0) : uword(1); @@ -560,15 +560,15 @@ glue_solve_tri_full::apply(Mat& actual_out, const Base& A_expr, const if( (status == false) && (no_approx == false) ) { - arma_extra_debug_print("glue_solve_tri_full::apply(): solving rank deficient system"); + arma_debug_print("glue_solve_tri_full::apply(): solving rank deficient system"); if(rcond == T(0)) { - arma_debug_warn_level(2, "solve(): system is singular; attempting approx solution"); + arma_conform_warn(2, "solve(): system is singular; attempting approx solution"); } else { - arma_debug_warn_level(2, "solve(): system is singular (rcond: ", rcond, "); attempting approx solution"); + arma_conform_warn(2, "solve(): system is singular (rcond: ", rcond, "); attempting approx solution"); } Mat triA = (triu) ? trimatu(A) : trimatl(A); // trimatu() and trimatl() return the same type diff --git a/inst/include/armadillo_bits/glue_times_meat.hpp b/inst/include/armadillo_bits/glue_times_meat.hpp index 0dc8a02e..73a3dfcc 100644 --- a/inst/include/armadillo_bits/glue_times_meat.hpp +++ b/inst/include/armadillo_bits/glue_times_meat.hpp @@ -27,7 +27,7 @@ inline void glue_times_redirect2_helper::apply(Mat& out, const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -37,8 +37,23 @@ glue_times_redirect2_helper::apply(Mat& o const typename partial_unwrap::stored_type& A = tmp1.M; const typename partial_unwrap::stored_type& B = tmp2.M; - const bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; - const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val()) : eT(0); + constexpr bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; + const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val()) : eT(0); + + if( (is_cx::no) && (resolves_to_rowvector::value && resolves_to_colvector::value) ) + { + arma_debug_print("glue_times: dot product optimisation"); + + arma_conform_assert_mul_size(A, B, tmp1.do_trans, tmp2.do_trans, "matrix multiplication"); + + const eT val = op_dot::direct_dot(A.n_elem, A.memptr(), B.memptr()); + + out.set_size(1,1); + + out[0] = (use_alpha) ? (val * alpha) : (val); + + return; + } const bool alias = tmp1.is_alias(out) || tmp2.is_alias(out); @@ -77,7 +92,7 @@ inline void glue_times_redirect2_helper::apply(Mat& out, const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -85,24 +100,24 @@ glue_times_redirect2_helper::apply(Mat& out, const { // replace inv(A)*B with solve(A,B) - arma_extra_debug_print("glue_times_redirect<2>::apply(): detected inv(A)*B"); + arma_debug_print("glue_times_redirect<2>::apply(): detected inv(A)*B"); const strip_inv A_strip(X.A); Mat A = A_strip.M; - arma_debug_check( (A.is_square() == false), "inv(): given matrix must be square sized" ); + arma_conform_check( (A.is_square() == false), "inv(): given matrix must be square sized" ); - if( (strip_inv::do_inv_spd) && (arma_config::debug) && (auxlib::rudimentary_sym_check(A) == false) ) + if( (strip_inv::do_inv_spd) && (arma_config::check_conformance) && (auxlib::rudimentary_sym_check(A) == false) ) { - if(is_cx::no ) { arma_debug_warn_level(1, "inv_sympd(): given matrix is not symmetric"); } - if(is_cx::yes) { arma_debug_warn_level(1, "inv_sympd(): given matrix is not hermitian"); } + if(is_cx::no ) { arma_conform_warn(1, "inv_sympd(): given matrix is not symmetric"); } + if(is_cx::yes) { arma_conform_warn(1, "inv_sympd(): given matrix is not hermitian"); } } const unwrap_check B_tmp(X.B, out); const Mat& B = B_tmp.M; - arma_debug_assert_mul_size(A, B, "matrix multiplication"); + arma_conform_assert_mul_size(A, B, "matrix multiplication"); const bool status = (strip_inv::do_inv_spd) ? auxlib::solve_sympd_fast(out, A, B) : auxlib::solve_square_fast(out, A, B); @@ -120,7 +135,7 @@ glue_times_redirect2_helper::apply(Mat& out, const // replace A*inv_sympd(B) with trans( solve(trans(B),trans(A)) ) // transpose of B is avoided as B is explicitly marked as symmetric - arma_extra_debug_print("glue_times_redirect<2>::apply(): detected A*inv_sympd(B)"); + arma_debug_print("glue_times_redirect<2>::apply(): detected A*inv_sympd(B)"); const Mat At = trans(X.A); @@ -128,15 +143,15 @@ glue_times_redirect2_helper::apply(Mat& out, const Mat B = B_strip.M; - arma_debug_check( (B.is_square() == false), "inv_sympd(): given matrix must be square sized" ); + arma_conform_check( (B.is_square() == false), "inv_sympd(): given matrix must be square sized" ); - if( (arma_config::debug) && (auxlib::rudimentary_sym_check(B) == false) ) + if( (arma_config::check_conformance) && (auxlib::rudimentary_sym_check(B) == false) ) { - if(is_cx::no ) { arma_debug_warn_level(1, "inv_sympd(): given matrix is not symmetric"); } - if(is_cx::yes) { arma_debug_warn_level(1, "inv_sympd(): given matrix is not hermitian"); } + if(is_cx::no ) { arma_conform_warn(1, "inv_sympd(): given matrix is not symmetric"); } + if(is_cx::yes) { arma_conform_warn(1, "inv_sympd(): given matrix is not hermitian"); } } - arma_debug_assert_mul_size(At.n_cols, At.n_rows, B.n_rows, B.n_cols, "matrix multiplication"); + arma_conform_assert_mul_size(At.n_cols, At.n_rows, B.n_rows, B.n_cols, "matrix multiplication"); const bool status = auxlib::solve_sympd_fast(out, B, At); @@ -162,7 +177,7 @@ inline void glue_times_redirect3_helper::apply(Mat& out, const Glue< Glue, T3, glue_times>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -177,8 +192,8 @@ glue_times_redirect3_helper::apply(Mat& o const typename partial_unwrap::stored_type& B = tmp2.M; const typename partial_unwrap::stored_type& C = tmp3.M; - const bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times || partial_unwrap::do_times; - const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val() * tmp3.get_val()) : eT(0); + constexpr bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times || partial_unwrap::do_times; + const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val() * tmp3.get_val()) : eT(0); const bool alias = tmp1.is_alias(out) || tmp2.is_alias(out) || tmp3.is_alias(out); @@ -219,7 +234,7 @@ inline void glue_times_redirect3_helper::apply(Mat& out, const Glue< Glue, T3, glue_times>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -227,13 +242,13 @@ glue_times_redirect3_helper::apply(Mat& out, const { // replace inv(A)*B*C with solve(A,B*C); - arma_extra_debug_print("glue_times_redirect<3>::apply(): detected inv(A)*B*C"); + arma_debug_print("glue_times_redirect<3>::apply(): detected inv(A)*B*C"); const strip_inv A_strip(X.A.A); Mat A = A_strip.M; - arma_debug_check( (A.is_square() == false), "inv(): given matrix must be square sized" ); + arma_conform_check( (A.is_square() == false), "inv(): given matrix must be square sized" ); const partial_unwrap tmp2(X.A.B); const partial_unwrap tmp3(X.B ); @@ -241,8 +256,8 @@ glue_times_redirect3_helper::apply(Mat& out, const const typename partial_unwrap::stored_type& B = tmp2.M; const typename partial_unwrap::stored_type& C = tmp3.M; - const bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; - const eT alpha = use_alpha ? (tmp2.get_val() * tmp3.get_val()) : eT(0); + constexpr bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; + const eT alpha = use_alpha ? (tmp2.get_val() * tmp3.get_val()) : eT(0); Mat BC; @@ -255,12 +270,12 @@ glue_times_redirect3_helper::apply(Mat& out, const > (BC, B, C, alpha); - arma_debug_assert_mul_size(A, BC, "matrix multiplication"); + arma_conform_assert_mul_size(A, BC, "matrix multiplication"); - if( (strip_inv::do_inv_spd) && (arma_config::debug) && (auxlib::rudimentary_sym_check(A) == false) ) + if( (strip_inv::do_inv_spd) && (arma_config::check_conformance) && (auxlib::rudimentary_sym_check(A) == false) ) { - if(is_cx::no ) { arma_debug_warn_level(1, "inv_sympd(): given matrix is not symmetric"); } - if(is_cx::yes) { arma_debug_warn_level(1, "inv_sympd(): given matrix is not hermitian"); } + if(is_cx::no ) { arma_conform_warn(1, "inv_sympd(): given matrix is not symmetric"); } + if(is_cx::yes) { arma_conform_warn(1, "inv_sympd(): given matrix is not hermitian"); } } const bool status = (strip_inv::do_inv_spd) ? auxlib::solve_sympd_fast(out, A, BC) : auxlib::solve_square_fast(out, A, BC); @@ -279,23 +294,23 @@ glue_times_redirect3_helper::apply(Mat& out, const { // replace A*inv(B)*C with A*solve(B,C) - arma_extra_debug_print("glue_times_redirect<3>::apply(): detected A*inv(B)*C"); + arma_debug_print("glue_times_redirect<3>::apply(): detected A*inv(B)*C"); const strip_inv B_strip(X.A.B); Mat B = B_strip.M; - arma_debug_check( (B.is_square() == false), "inv(): given matrix must be square sized" ); + arma_conform_check( (B.is_square() == false), "inv(): given matrix must be square sized" ); const unwrap C_tmp(X.B); const Mat& C = C_tmp.M; - arma_debug_assert_mul_size(B, C, "matrix multiplication"); + arma_conform_assert_mul_size(B, C, "matrix multiplication"); - if( (strip_inv::do_inv_spd) && (arma_config::debug) && (auxlib::rudimentary_sym_check(B) == false) ) + if( (strip_inv::do_inv_spd) && (arma_config::check_conformance) && (auxlib::rudimentary_sym_check(B) == false) ) { - if(is_cx::no ) { arma_debug_warn_level(1, "inv_sympd(): given matrix is not symmetric"); } - if(is_cx::yes) { arma_debug_warn_level(1, "inv_sympd(): given matrix is not hermitian"); } + if(is_cx::no ) { arma_conform_warn(1, "inv_sympd(): given matrix is not symmetric"); } + if(is_cx::yes) { arma_conform_warn(1, "inv_sympd(): given matrix is not hermitian"); } } Mat solve_result; @@ -313,8 +328,8 @@ glue_times_redirect3_helper::apply(Mat& out, const const typename partial_unwrap_check::stored_type& A = tmp1.M; - const bool use_alpha = partial_unwrap_check::do_times; - const eT alpha = use_alpha ? tmp1.get_val() : eT(0); + constexpr bool use_alpha = partial_unwrap_check::do_times; + const eT alpha = use_alpha ? tmp1.get_val() : eT(0); glue_times::apply < @@ -340,7 +355,7 @@ inline void glue_times_redirect::apply(Mat& out, const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -350,8 +365,8 @@ glue_times_redirect::apply(Mat& out, const Glue::stored_type& A = tmp1.M; const typename partial_unwrap::stored_type& B = tmp2.M; - const bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; - const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val()) : eT(0); + constexpr bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; + const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val()) : eT(0); const bool alias = tmp1.is_alias(out) || tmp2.is_alias(out); @@ -390,7 +405,7 @@ inline void glue_times_redirect<2>::apply(Mat& out, const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -404,7 +419,7 @@ inline void glue_times_redirect<3>::apply(Mat& out, const Glue< Glue, T3, glue_times>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -418,7 +433,7 @@ inline void glue_times_redirect<4>::apply(Mat& out, const Glue< Glue< Glue, T3, glue_times>, T4, glue_times>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -435,8 +450,8 @@ glue_times_redirect<4>::apply(Mat& out, const Glue< Glue const typename partial_unwrap::stored_type& C = tmp3.M; const typename partial_unwrap::stored_type& D = tmp4.M; - const bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times || partial_unwrap::do_times || partial_unwrap::do_times; - const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val() * tmp3.get_val() * tmp4.get_val()) : eT(0); + constexpr bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times || partial_unwrap::do_times || partial_unwrap::do_times; + const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val() * tmp3.get_val() * tmp4.get_val()) : eT(0); const bool alias = tmp1.is_alias(out) || tmp2.is_alias(out) || tmp3.is_alias(out) || tmp4.is_alias(out); @@ -479,11 +494,11 @@ inline void glue_times::apply(Mat& out, const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); constexpr uword N_mat = 1 + depth_lhs< glue_times, Glue >::num; - arma_extra_debug_print(arma_str::format("N_mat = %u") % N_mat); + arma_debug_print(arma_str::format("N_mat: %u") % N_mat); glue_times_redirect::apply(out, X); } @@ -495,7 +510,7 @@ inline void glue_times::apply_inplace(Mat& out, const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out = out * X; } @@ -507,7 +522,7 @@ inline void glue_times::apply_inplace_plus(Mat& out, const Glue& X, const sword sign) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename get_pod_type::result T; @@ -532,19 +547,19 @@ glue_times::apply_inplace_plus(Mat& out, const Glue::do_trans; - const bool do_trans_B = partial_unwrap_check::do_trans; + constexpr bool do_trans_A = partial_unwrap_check::do_trans; + constexpr bool do_trans_B = partial_unwrap_check::do_trans; const bool use_alpha = partial_unwrap_check::do_times || partial_unwrap_check::do_times || (sign < sword(0)); - const eT alpha = use_alpha ? ( tmp1.get_val() * tmp2.get_val() * ( (sign > sword(0)) ? eT(1) : eT(-1) ) ) : eT(0); + const eT alpha = use_alpha ? ( tmp1.get_val() * tmp2.get_val() * ( (sign > sword(0)) ? eT(1) : eT(-1) ) ) : eT(0); - arma_debug_assert_mul_size(A, B, do_trans_A, do_trans_B, "matrix multiplication"); + arma_conform_assert_mul_size(A, B, do_trans_A, do_trans_B, "matrix multiplication"); const uword result_n_rows = (do_trans_A == false) ? (TA::is_row ? 1 : A.n_rows) : (TA::is_col ? 1 : A.n_cols); const uword result_n_cols = (do_trans_B == false) ? (TB::is_col ? 1 : B.n_cols) : (TB::is_row ? 1 : B.n_rows); - arma_debug_assert_same_size(out.n_rows, out.n_cols, result_n_rows, result_n_cols, ( (sign > sword(0)) ? "addition" : "subtraction" ) ); + arma_conform_assert_same_size(out.n_rows, out.n_cols, result_n_rows, result_n_cols, ( (sign > sword(0)) ? "addition" : "subtraction" ) ); if(out.n_elem == 0) { return; } @@ -645,10 +660,10 @@ glue_times::apply const eT alpha ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - //arma_debug_assert_mul_size(A, B, do_trans_A, do_trans_B, "matrix multiplication"); - arma_debug_assert_trans_mul_size(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication"); + //arma_conform_assert_mul_size(A, B, do_trans_A, do_trans_B, "matrix multiplication"); + arma_conform_assert_trans_mul_size(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication"); const uword final_n_rows = (do_trans_A == false) ? (TA::is_row ? 1 : A.n_rows) : (TA::is_col ? 1 : A.n_cols); const uword final_n_cols = (do_trans_B == false) ? (TB::is_col ? 1 : B.n_cols) : (TB::is_row ? 1 : B.n_rows); @@ -744,7 +759,7 @@ glue_times::apply const eT alpha ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat tmp; @@ -794,7 +809,7 @@ glue_times::apply const eT alpha ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat tmp; @@ -830,7 +845,7 @@ inline void glue_times_diag::apply(Mat& actual_out, const Glue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -842,7 +857,7 @@ glue_times_diag::apply(Mat& actual_out, const Glue::do_diagmat == true) && (strip_diagmat::do_diagmat == false) ) { - arma_extra_debug_print("glue_times_diag::apply(): diagmat(A) * B"); + arma_debug_print("glue_times_diag::apply(): diagmat(A) * B"); const diagmat_proxy A(S1.M); @@ -856,11 +871,11 @@ glue_times_diag::apply(Mat& actual_out, const Glue tmp; Mat& out = (is_alias) ? tmp : actual_out; @@ -880,7 +895,7 @@ glue_times_diag::apply(Mat& actual_out, const Glue::do_diagmat == false) && (strip_diagmat::do_diagmat == true) ) { - arma_extra_debug_print("glue_times_diag::apply(): A * diagmat(B)"); + arma_debug_print("glue_times_diag::apply(): A * diagmat(B)"); const quasi_unwrap UA(X.A); const Mat& A = UA.M; @@ -894,11 +909,11 @@ glue_times_diag::apply(Mat& actual_out, const Glue tmp; Mat& out = (is_alias) ? tmp : actual_out; @@ -920,16 +935,16 @@ glue_times_diag::apply(Mat& actual_out, const Glue::do_diagmat == true) && (strip_diagmat::do_diagmat == true) ) { - arma_extra_debug_print("glue_times_diag::apply(): diagmat(A) * diagmat(B)"); + arma_debug_print("glue_times_diag::apply(): diagmat(A) * diagmat(B)"); const diagmat_proxy A(S1.M); const diagmat_proxy B(S2.M); - arma_debug_assert_mul_size(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication"); + arma_conform_assert_mul_size(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication"); const bool is_alias = (A.is_alias(actual_out) || B.is_alias(actual_out)); - if(is_alias) { arma_extra_debug_print("glue_times_diag::apply(): aliasing detected"); } + if(is_alias) { arma_debug_print("glue_times_diag::apply(): aliasing detected"); } Mat tmp; Mat& out = (is_alias) ? tmp : actual_out; diff --git a/inst/include/armadillo_bits/glue_times_misc_meat.hpp b/inst/include/armadillo_bits/glue_times_misc_meat.hpp index cafbb98a..cca3b310 100644 --- a/inst/include/armadillo_bits/glue_times_misc_meat.hpp +++ b/inst/include/armadillo_bits/glue_times_misc_meat.hpp @@ -26,7 +26,7 @@ arma_inline typename arma_not_cx::result dense_sparse_helper::dot(const eT* A_mem, const SpMat& B, const uword col) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uword col_offset = B.col_ptrs[col ]; const uword next_col_offset = B.col_ptrs[col + 1]; @@ -57,7 +57,7 @@ arma_inline typename arma_cx_only::result dense_sparse_helper::dot(const eT* A_mem, const SpMat& B, const uword col) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -101,7 +101,7 @@ inline void glue_times_dense_sparse::apply(Mat& out, const SpToDGlue& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -130,7 +130,7 @@ inline void glue_times_dense_sparse::apply_noalias(Mat& out, const T1& x, const T2& y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -140,7 +140,7 @@ glue_times_dense_sparse::apply_noalias(Mat& out, const T const unwrap_spmat UB(y); const SpMat& B = UB.M; - arma_debug_assert_mul_size(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication"); + arma_conform_assert_mul_size(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication"); out.set_size(A.n_rows, B.n_cols); @@ -148,13 +148,13 @@ glue_times_dense_sparse::apply_noalias(Mat& out, const T if((resolves_to_rowvector::value) || (A.n_rows == 1)) { - arma_extra_debug_print("using row vector specialisation"); + arma_debug_print("using row vector specialisation"); if( (arma_config::openmp) && (mp_thread_limit::in_parallel() == false) && (B.n_cols >= 2) && mp_gate::eval(B.n_nonzero) ) { #if defined(ARMA_USE_OPENMP) { - arma_extra_debug_print("openmp implementation"); + arma_debug_print("openmp implementation"); eT* out_mem = out.memptr(); const eT* A_mem = A.memptr(); @@ -172,7 +172,7 @@ glue_times_dense_sparse::apply_noalias(Mat& out, const T } else { - arma_extra_debug_print("serial implementation"); + arma_debug_print("serial implementation"); eT* out_mem = out.memptr(); const eT* A_mem = A.memptr(); @@ -190,7 +190,7 @@ glue_times_dense_sparse::apply_noalias(Mat& out, const T { #if defined(ARMA_USE_OPENMP) { - arma_extra_debug_print("using parallelised multiplication"); + arma_debug_print("using parallelised multiplication"); const uword B_n_cols = B.n_cols; const int n_threads = mp_thread_limit::get(); @@ -213,7 +213,7 @@ glue_times_dense_sparse::apply_noalias(Mat& out, const T } else { - arma_extra_debug_print("using standard multiplication"); + arma_debug_print("using standard multiplication"); out.zeros(); @@ -246,7 +246,7 @@ inline void glue_times_dense_sparse::apply_mixed(Mat< typename promote_type::result >& out, const T1& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -321,7 +321,7 @@ inline void glue_times_sparse_dense::apply(Mat& out, const SpToDGlue& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -331,7 +331,7 @@ glue_times_sparse_dense::apply(Mat& out, const SpToDGlue if((sp_strip_trans::do_htrans && is_cx::no) || (sp_strip_trans::do_strans)) { - arma_extra_debug_print("detected non-conjugate transpose of A"); + arma_debug_print("detected non-conjugate transpose of A"); const sp_strip_trans x_strip(expr.A); @@ -372,7 +372,7 @@ inline void glue_times_sparse_dense::apply_noalias(Mat& out, const T1& x, const T2& y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -388,11 +388,11 @@ glue_times_sparse_dense::apply_noalias(Mat& out, const T const uword B_n_rows = B.n_rows; const uword B_n_cols = B.n_cols; - arma_debug_assert_mul_size(A_n_rows, A_n_cols, B_n_rows, B_n_cols, "matrix multiplication"); + arma_conform_assert_mul_size(A_n_rows, A_n_cols, B_n_rows, B_n_cols, "matrix multiplication"); if((resolves_to_colvector::value) || (B_n_cols == 1)) { - arma_extra_debug_print("using column vector specialisation"); + arma_debug_print("using column vector specialisation"); out.zeros(A_n_rows, 1); @@ -415,7 +415,7 @@ glue_times_sparse_dense::apply_noalias(Mat& out, const T else if(B_n_cols >= (B_n_rows / uword(100))) { - arma_extra_debug_print("using transpose-based multiplication"); + arma_debug_print("using transpose-based multiplication"); const SpMat At = A.st(); const Mat Bt = B.st(); @@ -437,7 +437,7 @@ glue_times_sparse_dense::apply_noalias(Mat& out, const T } else { - arma_extra_debug_print("using standard multiplication"); + arma_debug_print("using standard multiplication"); out.zeros(A_n_rows, B_n_cols); @@ -466,7 +466,7 @@ inline void glue_times_sparse_dense::apply_noalias_trans(Mat& out, const T1& x, const T2& y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -482,15 +482,15 @@ glue_times_sparse_dense::apply_noalias_trans(Mat& out, c const uword B_n_rows = B.n_rows; const uword B_n_cols = B.n_cols; - arma_debug_assert_mul_size(A_n_cols, A_n_rows, B_n_rows, B_n_cols, "matrix multiplication"); + arma_conform_assert_mul_size(A_n_cols, A_n_rows, B_n_rows, B_n_cols, "matrix multiplication"); if((resolves_to_colvector::value) || (B_n_cols == 1)) { - arma_extra_debug_print("using column vector specialisation (avoiding transpose of A)"); + arma_debug_print("using column vector specialisation (avoiding transpose of A)"); if( (arma_config::openmp) && (mp_thread_limit::in_parallel() == false) && (A_n_cols >= 2) && mp_gate::eval(A.n_nonzero) ) { - arma_extra_debug_print("opemp implementation"); + arma_debug_print("opemp implementation"); #if defined(ARMA_USE_OPENMP) { @@ -511,7 +511,7 @@ glue_times_sparse_dense::apply_noalias_trans(Mat& out, c } else { - arma_extra_debug_print("serial implementation"); + arma_debug_print("serial implementation"); out.zeros(A_n_cols, 1); @@ -527,7 +527,7 @@ glue_times_sparse_dense::apply_noalias_trans(Mat& out, c else if(B_n_cols >= (B_n_rows / uword(100))) { - arma_extra_debug_print("using transpose-based multiplication (avoiding transpose of A)"); + arma_debug_print("using transpose-based multiplication (avoiding transpose of A)"); const Mat Bt = B.st(); @@ -548,7 +548,7 @@ glue_times_sparse_dense::apply_noalias_trans(Mat& out, c } else { - arma_extra_debug_print("using standard multiplication (avoiding transpose of A)"); + arma_debug_print("using standard multiplication (avoiding transpose of A)"); out.zeros(A_n_cols, B_n_cols); @@ -577,7 +577,7 @@ inline void glue_times_sparse_dense::apply_mixed(Mat< typename promote_type::result >& out, const T1& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; diff --git a/inst/include/armadillo_bits/glue_toeplitz_meat.hpp b/inst/include/armadillo_bits/glue_toeplitz_meat.hpp index 77f9a090..6b9df968 100644 --- a/inst/include/armadillo_bits/glue_toeplitz_meat.hpp +++ b/inst/include/armadillo_bits/glue_toeplitz_meat.hpp @@ -27,7 +27,7 @@ inline void glue_toeplitz::apply(Mat& out, const Glue& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -37,7 +37,7 @@ glue_toeplitz::apply(Mat& out, const Glue& A = tmp1.M; const Mat& B = tmp2.M; - arma_debug_check + arma_conform_check ( ( ((A.is_vec() == false) && (A.is_empty() == false)) || ((B.is_vec() == false) && (B.is_empty() == false)) ), "toeplitz(): given object must be a vector" diff --git a/inst/include/armadillo_bits/glue_trapz_meat.hpp b/inst/include/armadillo_bits/glue_trapz_meat.hpp index ed7b577d..de35f0ea 100644 --- a/inst/include/armadillo_bits/glue_trapz_meat.hpp +++ b/inst/include/armadillo_bits/glue_trapz_meat.hpp @@ -26,7 +26,7 @@ inline void glue_trapz::apply(Mat& out, const Glue& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -56,22 +56,22 @@ inline void glue_trapz::apply_noalias(Mat& out, const Mat& X, const Mat& Y, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (dim > 1), "trapz(): argument 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "trapz(): argument 'dim' must be 0 or 1" ); - arma_debug_check( ((X.is_vec() == false) && (X.is_empty() == false)), "trapz(): argument 'X' must be a vector" ); + arma_conform_check( ((X.is_vec() == false) && (X.is_empty() == false)), "trapz(): argument 'X' must be a vector" ); const uword N = X.n_elem; if(dim == 0) { - arma_debug_check( (N != Y.n_rows), "trapz(): length of X must equal the number of rows in Y when dim=0" ); + arma_conform_check( (N != Y.n_rows), "trapz(): length of X must equal the number of rows in Y when dim=0" ); } else if(dim == 1) { - arma_debug_check( (N != Y.n_cols), "trapz(): length of X must equal the number of columns in Y when dim=1" ); + arma_conform_check( (N != Y.n_cols), "trapz(): length of X must equal the number of columns in Y when dim=1" ); } if(N <= 1) @@ -106,7 +106,7 @@ inline void op_trapz::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -135,9 +135,9 @@ inline void op_trapz::apply_noalias(Mat& out, const Mat& Y, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (dim > 1), "trapz(): argument 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "trapz(): argument 'dim' must be 0 or 1" ); uword N = 0; diff --git a/inst/include/armadillo_bits/gmm_diag_meat.hpp b/inst/include/armadillo_bits/gmm_diag_meat.hpp index 1b6681ed..6eaa8230 100644 --- a/inst/include/armadillo_bits/gmm_diag_meat.hpp +++ b/inst/include/armadillo_bits/gmm_diag_meat.hpp @@ -28,7 +28,7 @@ template inline gmm_diag::~gmm_diag() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); arma_type_check(( (is_same_type::value == false) && (is_same_type::value == false) )); } @@ -39,7 +39,7 @@ template inline gmm_diag::gmm_diag() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } @@ -48,7 +48,7 @@ template inline gmm_diag::gmm_diag(const gmm_diag& x) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init(x); } @@ -60,7 +60,7 @@ inline gmm_diag& gmm_diag::operator=(const gmm_diag& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init(x); @@ -73,7 +73,7 @@ template inline gmm_diag::gmm_diag(const gmm_full& x) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init(x); } @@ -85,7 +85,7 @@ inline gmm_diag& gmm_diag::operator=(const gmm_full& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init(x); @@ -98,7 +98,7 @@ template inline gmm_diag::gmm_diag(const uword in_n_dims, const uword in_n_gaus) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init(in_n_dims, in_n_gaus); } @@ -110,7 +110,7 @@ inline void gmm_diag::reset() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init(0, 0); } @@ -122,7 +122,7 @@ inline void gmm_diag::reset(const uword in_n_dims, const uword in_n_gaus) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init(in_n_dims, in_n_gaus); } @@ -135,7 +135,7 @@ inline void gmm_diag::set_params(const Base& in_means_expr, const Base& in_dcovs_expr, const Base& in_hefts_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap tmp1(in_means_expr.get_ref()); const unwrap tmp2(in_dcovs_expr.get_ref()); @@ -145,22 +145,22 @@ gmm_diag::set_params(const Base& in_means_expr, const Base& in const Mat& in_dcovs = tmp2.M; const Mat& in_hefts = tmp3.M; - arma_debug_check + arma_conform_check ( (arma::size(in_means) != arma::size(in_dcovs)) || (in_hefts.n_cols != in_means.n_cols) || (in_hefts.n_rows != 1), "gmm_diag::set_params(): given parameters have inconsistent and/or wrong sizes" ); - arma_debug_check( (in_means.internal_has_nonfinite()), "gmm_diag::set_params(): given means have non-finite values" ); - arma_debug_check( (in_dcovs.internal_has_nonfinite()), "gmm_diag::set_params(): given dcovs have non-finite values" ); - arma_debug_check( (in_hefts.internal_has_nonfinite()), "gmm_diag::set_params(): given hefts have non-finite values" ); + arma_conform_check( (in_means.internal_has_nonfinite()), "gmm_diag::set_params(): given means have non-finite values" ); + arma_conform_check( (in_dcovs.internal_has_nonfinite()), "gmm_diag::set_params(): given dcovs have non-finite values" ); + arma_conform_check( (in_hefts.internal_has_nonfinite()), "gmm_diag::set_params(): given hefts have non-finite values" ); - arma_debug_check( (any(vectorise(in_dcovs) <= eT(0))), "gmm_diag::set_params(): given dcovs have negative or zero values" ); - arma_debug_check( (any(vectorise(in_hefts) < eT(0))), "gmm_diag::set_params(): given hefts have negative values" ); + arma_conform_check( (any(vectorise(in_dcovs) <= eT(0))), "gmm_diag::set_params(): given dcovs have negative or zero values" ); + arma_conform_check( (any(vectorise(in_hefts) < eT(0))), "gmm_diag::set_params(): given hefts have negative values" ); const eT s = accu(in_hefts); - arma_debug_check( ((s < (eT(1) - eT(0.001))) || (s > (eT(1) + eT(0.001)))), "gmm_diag::set_params(): sum of given hefts is not 1" ); + arma_conform_check( ((s < (eT(1) - eT(0.001))) || (s > (eT(1) + eT(0.001)))), "gmm_diag::set_params(): sum of given hefts is not 1" ); access::rw(means) = in_means; access::rw(dcovs) = in_dcovs; @@ -177,14 +177,14 @@ inline void gmm_diag::set_means(const Base& in_means_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap tmp(in_means_expr.get_ref()); const Mat& in_means = tmp.M; - arma_debug_check( (arma::size(in_means) != arma::size(means)), "gmm_diag::set_means(): given means have incompatible size" ); - arma_debug_check( (in_means.internal_has_nonfinite()), "gmm_diag::set_means(): given means have non-finite values" ); + arma_conform_check( (arma::size(in_means) != arma::size(means)), "gmm_diag::set_means(): given means have incompatible size" ); + arma_conform_check( (in_means.internal_has_nonfinite()), "gmm_diag::set_means(): given means have non-finite values" ); access::rw(means) = in_means; } @@ -197,15 +197,15 @@ inline void gmm_diag::set_dcovs(const Base& in_dcovs_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap tmp(in_dcovs_expr.get_ref()); const Mat& in_dcovs = tmp.M; - arma_debug_check( (arma::size(in_dcovs) != arma::size(dcovs)), "gmm_diag::set_dcovs(): given dcovs have incompatible size" ); - arma_debug_check( (in_dcovs.internal_has_nonfinite()), "gmm_diag::set_dcovs(): given dcovs have non-finite values" ); - arma_debug_check( (any(vectorise(in_dcovs) <= eT(0))), "gmm_diag::set_dcovs(): given dcovs have negative or zero values" ); + arma_conform_check( (arma::size(in_dcovs) != arma::size(dcovs)), "gmm_diag::set_dcovs(): given dcovs have incompatible size" ); + arma_conform_check( (in_dcovs.internal_has_nonfinite()), "gmm_diag::set_dcovs(): given dcovs have non-finite values" ); + arma_conform_check( (any(vectorise(in_dcovs) <= eT(0))), "gmm_diag::set_dcovs(): given dcovs have negative or zero values" ); access::rw(dcovs) = in_dcovs; @@ -220,19 +220,19 @@ inline void gmm_diag::set_hefts(const Base& in_hefts_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap tmp(in_hefts_expr.get_ref()); const Mat& in_hefts = tmp.M; - arma_debug_check( (arma::size(in_hefts) != arma::size(hefts)), "gmm_diag::set_hefts(): given hefts have incompatible size" ); - arma_debug_check( (in_hefts.internal_has_nonfinite()), "gmm_diag::set_hefts(): given hefts have non-finite values" ); - arma_debug_check( (any(vectorise(in_hefts) < eT(0))), "gmm_diag::set_hefts(): given hefts have negative values" ); + arma_conform_check( (arma::size(in_hefts) != arma::size(hefts)), "gmm_diag::set_hefts(): given hefts have incompatible size" ); + arma_conform_check( (in_hefts.internal_has_nonfinite()), "gmm_diag::set_hefts(): given hefts have non-finite values" ); + arma_conform_check( (any(vectorise(in_hefts) < eT(0))), "gmm_diag::set_hefts(): given hefts have negative values" ); const eT s = accu(in_hefts); - arma_debug_check( ((s < (eT(1) - eT(0.001))) || (s > (eT(1) + eT(0.001)))), "gmm_diag::set_hefts(): sum of given hefts is not 1" ); + arma_conform_check( ((s < (eT(1) - eT(0.001))) || (s > (eT(1) + eT(0.001)))), "gmm_diag::set_hefts(): sum of given hefts is not 1" ); // make sure all hefts are positive and non-zero @@ -276,7 +276,7 @@ inline bool gmm_diag::load(const std::string name) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Cube Q; @@ -285,7 +285,7 @@ gmm_diag::load(const std::string name) if( (status == false) || (Q.n_slices != 2) ) { reset(); - arma_debug_warn_level(3, "gmm_diag::load(): problem with loading or incompatible format"); + arma_conform_warn(3, "gmm_diag::load(): problem with loading or incompatible format"); return false; } @@ -311,7 +311,7 @@ inline bool gmm_diag::save(const std::string name) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Cube Q(means.n_rows + 1, means.n_cols, 2, arma_nozeros_indicator()); @@ -336,7 +336,7 @@ inline Col gmm_diag::generate() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N_dims = means.n_rows; const uword N_gaus = means.n_cols; @@ -371,7 +371,7 @@ inline Mat gmm_diag::generate(const uword N_vec) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N_dims = means.n_rows; const uword N_gaus = means.n_cols; @@ -416,13 +416,13 @@ inline eT gmm_diag::log_p(const T1& expr, const gmm_empty_arg& junk1, typename enable_if<((is_arma_type::value) && (resolves_to_colvector::value == true))>::result* junk2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); const quasi_unwrap tmp(expr); - arma_debug_check( (tmp.M.n_rows != means.n_rows), "gmm_diag::log_p(): incompatible dimensions" ); + arma_conform_check( (tmp.M.n_rows != means.n_rows), "gmm_diag::log_p(): incompatible dimensions" ); return internal_scalar_log_p( tmp.M.memptr() ); } @@ -435,14 +435,14 @@ inline eT gmm_diag::log_p(const T1& expr, const uword gaus_id, typename enable_if<((is_arma_type::value) && (resolves_to_colvector::value == true))>::result* junk2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk2); const quasi_unwrap tmp(expr); - arma_debug_check( (tmp.M.n_rows != means.n_rows), "gmm_diag::log_p(): incompatible dimensions" ); + arma_conform_check( (tmp.M.n_rows != means.n_rows), "gmm_diag::log_p(): incompatible dimensions" ); - arma_debug_check( (gaus_id >= means.n_cols), "gmm_diag::log_p(): specified gaussian is out of range" ); + arma_conform_check( (gaus_id >= means.n_cols), "gmm_diag::log_p(): specified gaussian is out of range" ); return internal_scalar_log_p( tmp.M.memptr(), gaus_id ); } @@ -455,7 +455,7 @@ inline Row gmm_diag::log_p(const T1& expr, const gmm_empty_arg& junk1, typename enable_if<((is_arma_type::value) && (resolves_to_colvector::value == false))>::result* junk2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); @@ -474,7 +474,7 @@ inline Row gmm_diag::log_p(const T1& expr, const uword gaus_id, typename enable_if<((is_arma_type::value) && (resolves_to_colvector::value == false))>::result* junk2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk2); const quasi_unwrap tmp(expr); @@ -492,7 +492,7 @@ inline eT gmm_diag::sum_log_p(const Base& expr) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap tmp(expr.get_ref()); @@ -509,7 +509,7 @@ inline eT gmm_diag::sum_log_p(const Base& expr, const uword gaus_id) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap tmp(expr.get_ref()); @@ -526,7 +526,7 @@ inline eT gmm_diag::avg_log_p(const Base& expr) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap tmp(expr.get_ref()); @@ -543,7 +543,7 @@ inline eT gmm_diag::avg_log_p(const Base& expr, const uword gaus_id) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap tmp(expr.get_ref()); @@ -560,7 +560,7 @@ inline uword gmm_diag::assign(const T1& expr, const gmm_dist_mode& dist, typename enable_if<((is_arma_type::value) && (resolves_to_colvector::value == true))>::result* junk) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const quasi_unwrap tmp(expr); @@ -578,7 +578,7 @@ inline urowvec gmm_diag::assign(const T1& expr, const gmm_dist_mode& dist, typename enable_if<((is_arma_type::value) && (resolves_to_colvector::value == false))>::result* junk) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); urowvec out; @@ -600,14 +600,14 @@ inline urowvec gmm_diag::raw_hist(const Base& expr, const gmm_dist_mode& dist_mode) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap tmp(expr.get_ref()); const Mat& X = tmp.M; - arma_debug_check( (X.n_rows != means.n_rows), "gmm_diag::raw_hist(): incompatible dimensions" ); + arma_conform_check( (X.n_rows != means.n_rows), "gmm_diag::raw_hist(): incompatible dimensions" ); - arma_debug_check( ((dist_mode != eucl_dist) && (dist_mode != prob_dist)), "gmm_diag::raw_hist(): unsupported distance mode" ); + arma_conform_check( ((dist_mode != eucl_dist) && (dist_mode != prob_dist)), "gmm_diag::raw_hist(): unsupported distance mode" ); urowvec hist; @@ -624,14 +624,14 @@ inline Row gmm_diag::norm_hist(const Base& expr, const gmm_dist_mode& dist_mode) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap tmp(expr.get_ref()); const Mat& X = tmp.M; - arma_debug_check( (X.n_rows != means.n_rows), "gmm_diag::norm_hist(): incompatible dimensions" ); + arma_conform_check( (X.n_rows != means.n_rows), "gmm_diag::norm_hist(): incompatible dimensions" ); - arma_debug_check( ((dist_mode != eucl_dist) && (dist_mode != prob_dist)), "gmm_diag::norm_hist(): unsupported distance mode" ); + arma_conform_check( ((dist_mode != eucl_dist) && (dist_mode != prob_dist)), "gmm_diag::norm_hist(): unsupported distance mode" ); urowvec hist; @@ -672,7 +672,7 @@ gmm_diag::learn const bool print_mode ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool dist_mode_ok = (dist_mode == eucl_dist) || (dist_mode == maha_dist); @@ -683,15 +683,15 @@ gmm_diag::learn || (seed_mode == random_subset) || (seed_mode == random_spread); - arma_debug_check( (dist_mode_ok == false), "gmm_diag::learn(): dist_mode must be eucl_dist or maha_dist" ); - arma_debug_check( (seed_mode_ok == false), "gmm_diag::learn(): unknown seed_mode" ); - arma_debug_check( (var_floor < eT(0) ), "gmm_diag::learn(): variance floor is negative" ); + arma_conform_check( (dist_mode_ok == false), "gmm_diag::learn(): dist_mode must be eucl_dist or maha_dist" ); + arma_conform_check( (seed_mode_ok == false), "gmm_diag::learn(): unknown seed_mode" ); + arma_conform_check( (var_floor < eT(0) ), "gmm_diag::learn(): variance floor is negative" ); const unwrap tmp_X(data.get_ref()); const Mat& X = tmp_X.M; - if(X.is_empty() ) { arma_debug_warn_level(3, "gmm_diag::learn(): given matrix is empty" ); return false; } - if(X.internal_has_nonfinite()) { arma_debug_warn_level(3, "gmm_diag::learn(): given matrix has non-finite values"); return false; } + if(X.is_empty() ) { arma_conform_warn(3, "gmm_diag::learn(): given matrix is empty" ); return false; } + if(X.internal_has_nonfinite()) { arma_conform_warn(3, "gmm_diag::learn(): given matrix has non-finite values"); return false; } if(N_gaus == 0) { reset(); return true; } @@ -720,14 +720,14 @@ gmm_diag::learn if(seed_mode == keep_existing) { - if(means.is_empty() ) { arma_debug_warn_level(3, "gmm_diag::learn(): no existing means" ); return false; } - if(X.n_rows != means.n_rows) { arma_debug_warn_level(3, "gmm_diag::learn(): dimensionality mismatch"); return false; } + if(means.is_empty() ) { arma_conform_warn(3, "gmm_diag::learn(): no existing means" ); return false; } + if(X.n_rows != means.n_rows) { arma_conform_warn(3, "gmm_diag::learn(): dimensionality mismatch"); return false; } // TODO: also check for number of vectors? } else { - if(X.n_cols < N_gaus) { arma_debug_warn_level(3, "gmm_diag::learn(): number of vectors is less than number of gaussians"); return false; } + if(X.n_cols < N_gaus) { arma_conform_warn(3, "gmm_diag::learn(): number of vectors is less than number of gaussians"); return false; } reset(X.n_rows, N_gaus); @@ -751,7 +751,7 @@ gmm_diag::learn stream_state.restore(get_cout_stream()); - if(status == false) { arma_debug_warn_level(3, "gmm_diag::learn(): k-means algorithm failed; not enough data, or too many gaussians requested"); init(orig); return false; } + if(status == false) { arma_conform_warn(3, "gmm_diag::learn(): k-means algorithm failed; not enough data, or too many gaussians requested"); init(orig); return false; } } @@ -778,7 +778,7 @@ gmm_diag::learn stream_state.restore(get_cout_stream()); - if(status == false) { arma_debug_warn_level(3, "gmm_diag::learn(): EM algorithm failed"); init(orig); return false; } + if(status == false) { arma_conform_warn(3, "gmm_diag::learn(): EM algorithm failed"); init(orig); return false; } } mah_aux.reset(); @@ -804,7 +804,7 @@ gmm_diag::kmeans_wrapper const bool print_mode ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool seed_mode_ok = \ (seed_mode == keep_existing) @@ -813,13 +813,13 @@ gmm_diag::kmeans_wrapper || (seed_mode == random_subset) || (seed_mode == random_spread); - arma_debug_check( (seed_mode_ok == false), "kmeans(): unknown seed_mode" ); + arma_conform_check( (seed_mode_ok == false), "kmeans(): unknown seed_mode" ); const unwrap tmp_X(data.get_ref()); const Mat& X = tmp_X.M; - if(X.is_empty() ) { arma_debug_warn_level(3, "kmeans(): given matrix is empty" ); return false; } - if(X.internal_has_nonfinite()) { arma_debug_warn_level(3, "kmeans(): given matrix has non-finite values"); return false; } + if(X.is_empty() ) { arma_conform_warn(3, "kmeans(): given matrix is empty" ); return false; } + if(X.internal_has_nonfinite()) { arma_conform_warn(3, "kmeans(): given matrix has non-finite values"); return false; } if(N_gaus == 0) { reset(); return true; } @@ -830,14 +830,14 @@ gmm_diag::kmeans_wrapper { access::rw(means) = user_means; - if(means.is_empty() ) { arma_debug_warn_level(3, "kmeans(): no existing means" ); return false; } - if(X.n_rows != means.n_rows) { arma_debug_warn_level(3, "kmeans(): dimensionality mismatch"); return false; } + if(means.is_empty() ) { arma_conform_warn(3, "kmeans(): no existing means" ); return false; } + if(X.n_rows != means.n_rows) { arma_conform_warn(3, "kmeans(): dimensionality mismatch"); return false; } // TODO: also check for number of vectors? } else { - if(X.n_cols < N_gaus) { arma_debug_warn_level(3, "kmeans(): number of vectors is less than number of means"); return false; } + if(X.n_cols < N_gaus) { arma_conform_warn(3, "kmeans(): number of vectors is less than number of means"); return false; } access::rw(means).zeros(X.n_rows, N_gaus); @@ -859,7 +859,7 @@ gmm_diag::kmeans_wrapper stream_state.restore(get_cout_stream()); - if(status == false) { arma_debug_warn_level(3, "kmeans(): clustering failed; not enough data, or too many means requested"); return false; } + if(status == false) { arma_conform_warn(3, "kmeans(): clustering failed; not enough data, or too many means requested"); return false; } } return true; @@ -878,7 +878,7 @@ inline void gmm_diag::init(const gmm_diag& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); gmm_diag& t = *this; @@ -899,7 +899,7 @@ inline void gmm_diag::init(const gmm_full& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); access::rw(hefts) = x.hefts; access::rw(means) = x.means; @@ -931,7 +931,7 @@ inline void gmm_diag::init(const uword in_n_dims, const uword in_n_gaus) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); access::rw(means).zeros(in_n_dims, in_n_gaus); @@ -951,7 +951,7 @@ inline void gmm_diag::init_constants() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N_dims = means.n_rows; const uword N_gaus = means.n_cols; @@ -1009,7 +1009,7 @@ inline umat gmm_diag::internal_gen_boundaries(const uword N) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_OPENMP) const uword n_threads_avail = (omp_in_parallel()) ? uword(1) : uword(omp_get_max_threads()); @@ -1056,7 +1056,7 @@ inline eT gmm_diag::internal_scalar_log_p(const eT* x) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const eT* log_hefts_mem = log_hefts.mem; @@ -1088,7 +1088,7 @@ inline eT gmm_diag::internal_scalar_log_p(const eT* x, const uword g) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const eT* mean = means.colptr(g); const eT* inv_dcov = inv_dcovs.colptr(g); @@ -1129,9 +1129,9 @@ inline Row gmm_diag::internal_vec_log_p(const Mat& X) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (X.n_rows != means.n_rows), "gmm_diag::log_p(): incompatible dimensions" ); + arma_conform_check( (X.n_rows != means.n_rows), "gmm_diag::log_p(): incompatible dimensions" ); const uword N = X.n_cols; @@ -1181,10 +1181,10 @@ inline Row gmm_diag::internal_vec_log_p(const Mat& X, const uword gaus_id) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (X.n_rows != means.n_rows), "gmm_diag::log_p(): incompatible dimensions" ); - arma_debug_check( (gaus_id >= means.n_cols), "gmm_diag::log_p(): specified gaussian is out of range" ); + arma_conform_check( (X.n_rows != means.n_rows), "gmm_diag::log_p(): incompatible dimensions" ); + arma_conform_check( (gaus_id >= means.n_cols), "gmm_diag::log_p(): specified gaussian is out of range" ); const uword N = X.n_cols; @@ -1234,9 +1234,9 @@ inline eT gmm_diag::internal_sum_log_p(const Mat& X) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (X.n_rows != means.n_rows), "gmm_diag::sum_log_p(): incompatible dimensions" ); + arma_conform_check( (X.n_rows != means.n_rows), "gmm_diag::sum_log_p(): incompatible dimensions" ); const uword N = X.n_cols; @@ -1290,10 +1290,10 @@ inline eT gmm_diag::internal_sum_log_p(const Mat& X, const uword gaus_id) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (X.n_rows != means.n_rows), "gmm_diag::sum_log_p(): incompatible dimensions" ); - arma_debug_check( (gaus_id >= means.n_cols), "gmm_diag::sum_log_p(): specified gaussian is out of range" ); + arma_conform_check( (X.n_rows != means.n_rows), "gmm_diag::sum_log_p(): incompatible dimensions" ); + arma_conform_check( (gaus_id >= means.n_cols), "gmm_diag::sum_log_p(): specified gaussian is out of range" ); const uword N = X.n_cols; @@ -1347,9 +1347,9 @@ inline eT gmm_diag::internal_avg_log_p(const Mat& X) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (X.n_rows != means.n_rows), "gmm_diag::avg_log_p(): incompatible dimensions" ); + arma_conform_check( (X.n_rows != means.n_rows), "gmm_diag::avg_log_p(): incompatible dimensions" ); const uword N = X.n_cols; @@ -1414,10 +1414,10 @@ inline eT gmm_diag::internal_avg_log_p(const Mat& X, const uword gaus_id) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (X.n_rows != means.n_rows), "gmm_diag::avg_log_p(): incompatible dimensions" ); - arma_debug_check( (gaus_id >= means.n_cols), "gmm_diag::avg_log_p(): specified gaussian is out of range" ); + arma_conform_check( (X.n_rows != means.n_rows), "gmm_diag::avg_log_p(): incompatible dimensions" ); + arma_conform_check( (gaus_id >= means.n_cols), "gmm_diag::avg_log_p(): specified gaussian is out of range" ); const uword N = X.n_cols; @@ -1482,13 +1482,13 @@ inline uword gmm_diag::internal_scalar_assign(const Mat& X, const gmm_dist_mode& dist_mode) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N_dims = means.n_rows; const uword N_gaus = means.n_cols; - arma_debug_check( (X.n_rows != N_dims), "gmm_diag::assign(): incompatible dimensions" ); - arma_debug_check( (N_gaus == 0), "gmm_diag::assign(): model has no means" ); + arma_conform_check( (X.n_rows != N_dims), "gmm_diag::assign(): incompatible dimensions" ); + arma_conform_check( (N_gaus == 0), "gmm_diag::assign(): model has no means" ); const eT* X_mem = X.colptr(0); @@ -1525,7 +1525,7 @@ gmm_diag::internal_scalar_assign(const Mat& X, const gmm_dist_mode& dist } else { - arma_debug_check(true, "gmm_diag::assign(): unsupported distance mode"); + arma_conform_check(true, "gmm_diag::assign(): unsupported distance mode"); } return uword(0); @@ -1538,12 +1538,12 @@ inline void gmm_diag::internal_vec_assign(urowvec& out, const Mat& X, const gmm_dist_mode& dist_mode) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N_dims = means.n_rows; const uword N_gaus = means.n_cols; - arma_debug_check( (X.n_rows != N_dims), "gmm_diag::assign(): incompatible dimensions" ); + arma_conform_check( (X.n_rows != N_dims), "gmm_diag::assign(): incompatible dimensions" ); const uword X_n_cols = (N_gaus > 0) ? X.n_cols : 0; @@ -1644,7 +1644,7 @@ gmm_diag::internal_vec_assign(urowvec& out, const Mat& X, const gmm_dist } else { - arma_debug_check(true, "gmm_diag::assign(): unsupported distance mode"); + arma_conform_check(true, "gmm_diag::assign(): unsupported distance mode"); } } @@ -1656,7 +1656,7 @@ inline void gmm_diag::internal_raw_hist(urowvec& hist, const Mat& X, const gmm_dist_mode& dist_mode) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N_dims = means.n_rows; const uword N_gaus = means.n_cols; @@ -1803,7 +1803,7 @@ inline void gmm_diag::generate_initial_means(const Mat& X, const gmm_seed_mode& seed_mode) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N_dims = means.n_rows; const uword N_gaus = means.n_cols; @@ -1897,7 +1897,7 @@ inline void gmm_diag::generate_initial_params(const Mat& X, const eT var_floor) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N_dims = means.n_rows; const uword N_gaus = means.n_cols; @@ -2050,7 +2050,7 @@ inline bool gmm_diag::km_iterate(const Mat& X, const uword max_iter, const bool verbose, const char* signature) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(verbose) { @@ -2290,7 +2290,7 @@ inline bool gmm_diag::em_iterate(const Mat& X, const uword max_iter, const eT var_floor, const bool verbose) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(X.n_cols == 0) { return true; } @@ -2395,7 +2395,7 @@ gmm_diag::em_update_params Col& t_progress_log_lhood ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_threads = boundaries.n_cols; @@ -2526,7 +2526,7 @@ gmm_diag::em_generate_acc ) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); progress_log_lhood = eT(0); @@ -2591,7 +2591,7 @@ inline void gmm_diag::em_fix_params(const eT var_floor) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N_dims = means.n_rows; const uword N_gaus = means.n_cols; diff --git a/inst/include/armadillo_bits/gmm_full_meat.hpp b/inst/include/armadillo_bits/gmm_full_meat.hpp index 5bbcce06..8b8d3d02 100644 --- a/inst/include/armadillo_bits/gmm_full_meat.hpp +++ b/inst/include/armadillo_bits/gmm_full_meat.hpp @@ -28,7 +28,7 @@ template inline gmm_full::~gmm_full() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); arma_type_check(( (is_same_type::value == false) && (is_same_type::value == false) )); } @@ -39,7 +39,7 @@ template inline gmm_full::gmm_full() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } @@ -48,7 +48,7 @@ template inline gmm_full::gmm_full(const gmm_full& x) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init(x); } @@ -60,7 +60,7 @@ inline gmm_full& gmm_full::operator=(const gmm_full& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init(x); @@ -73,7 +73,7 @@ template inline gmm_full::gmm_full(const gmm_diag& x) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init(x); } @@ -85,7 +85,7 @@ inline gmm_full& gmm_full::operator=(const gmm_diag& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init(x); @@ -98,7 +98,7 @@ template inline gmm_full::gmm_full(const uword in_n_dims, const uword in_n_gaus) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init(in_n_dims, in_n_gaus); } @@ -110,7 +110,7 @@ inline void gmm_full::reset() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init(0, 0); } @@ -122,7 +122,7 @@ inline void gmm_full::reset(const uword in_n_dims, const uword in_n_gaus) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init(in_n_dims, in_n_gaus); } @@ -135,7 +135,7 @@ inline void gmm_full::set_params(const Base& in_means_expr, const BaseCube& in_fcovs_expr, const Base& in_hefts_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap tmp1(in_means_expr.get_ref()); const unwrap_cube tmp2(in_fcovs_expr.get_ref()); @@ -145,26 +145,26 @@ gmm_full::set_params(const Base& in_means_expr, const BaseCube const Cube& in_fcovs = tmp2.M; const Mat & in_hefts = tmp3.M; - arma_debug_check + arma_conform_check ( (in_means.n_cols != in_fcovs.n_slices) || (in_means.n_rows != in_fcovs.n_rows) || (in_fcovs.n_rows != in_fcovs.n_cols) || (in_hefts.n_cols != in_means.n_cols) || (in_hefts.n_rows != 1), "gmm_full::set_params(): given parameters have inconsistent and/or wrong sizes" ); - arma_debug_check( (in_means.internal_has_nonfinite()), "gmm_full::set_params(): given means have non-finite values" ); - arma_debug_check( (in_fcovs.internal_has_nonfinite()), "gmm_full::set_params(): given fcovs have non-finite values" ); - arma_debug_check( (in_hefts.internal_has_nonfinite()), "gmm_full::set_params(): given hefts have non-finite values" ); + arma_conform_check( (in_means.internal_has_nonfinite()), "gmm_full::set_params(): given means have non-finite values" ); + arma_conform_check( (in_fcovs.internal_has_nonfinite()), "gmm_full::set_params(): given fcovs have non-finite values" ); + arma_conform_check( (in_hefts.internal_has_nonfinite()), "gmm_full::set_params(): given hefts have non-finite values" ); for(uword g=0; g < in_fcovs.n_slices; ++g) { - arma_debug_check( (any(diagvec(in_fcovs.slice(g)) <= eT(0))), "gmm_full::set_params(): given fcovs have negative or zero values on diagonals" ); + arma_conform_check( (any(diagvec(in_fcovs.slice(g)) <= eT(0))), "gmm_full::set_params(): given fcovs have negative or zero values on diagonals" ); } - arma_debug_check( (any(vectorise(in_hefts) < eT(0))), "gmm_full::set_params(): given hefts have negative values" ); + arma_conform_check( (any(vectorise(in_hefts) < eT(0))), "gmm_full::set_params(): given hefts have negative values" ); const eT s = accu(in_hefts); - arma_debug_check( ((s < (eT(1) - eT(0.001))) || (s > (eT(1) + eT(0.001)))), "gmm_full::set_params(): sum of given hefts is not 1" ); + arma_conform_check( ((s < (eT(1) - eT(0.001))) || (s > (eT(1) + eT(0.001)))), "gmm_full::set_params(): sum of given hefts is not 1" ); access::rw(means) = in_means; access::rw(fcovs) = in_fcovs; @@ -181,14 +181,14 @@ inline void gmm_full::set_means(const Base& in_means_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap tmp(in_means_expr.get_ref()); const Mat& in_means = tmp.M; - arma_debug_check( (arma::size(in_means) != arma::size(means)), "gmm_full::set_means(): given means have incompatible size" ); - arma_debug_check( (in_means.internal_has_nonfinite()), "gmm_full::set_means(): given means have non-finite values" ); + arma_conform_check( (arma::size(in_means) != arma::size(means)), "gmm_full::set_means(): given means have incompatible size" ); + arma_conform_check( (in_means.internal_has_nonfinite()), "gmm_full::set_means(): given means have non-finite values" ); access::rw(means) = in_means; } @@ -201,18 +201,18 @@ inline void gmm_full::set_fcovs(const BaseCube& in_fcovs_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_cube tmp(in_fcovs_expr.get_ref()); const Cube& in_fcovs = tmp.M; - arma_debug_check( (arma::size(in_fcovs) != arma::size(fcovs)), "gmm_full::set_fcovs(): given fcovs have incompatible size" ); - arma_debug_check( (in_fcovs.internal_has_nonfinite()), "gmm_full::set_fcovs(): given fcovs have non-finite values" ); + arma_conform_check( (arma::size(in_fcovs) != arma::size(fcovs)), "gmm_full::set_fcovs(): given fcovs have incompatible size" ); + arma_conform_check( (in_fcovs.internal_has_nonfinite()), "gmm_full::set_fcovs(): given fcovs have non-finite values" ); for(uword i=0; i < in_fcovs.n_slices; ++i) { - arma_debug_check( (any(diagvec(in_fcovs.slice(i)) <= eT(0))), "gmm_full::set_fcovs(): given fcovs have negative or zero values on diagonals" ); + arma_conform_check( (any(diagvec(in_fcovs.slice(i)) <= eT(0))), "gmm_full::set_fcovs(): given fcovs have negative or zero values on diagonals" ); } access::rw(fcovs) = in_fcovs; @@ -228,19 +228,19 @@ inline void gmm_full::set_hefts(const Base& in_hefts_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap tmp(in_hefts_expr.get_ref()); const Mat& in_hefts = tmp.M; - arma_debug_check( (arma::size(in_hefts) != arma::size(hefts)), "gmm_full::set_hefts(): given hefts have incompatible size" ); - arma_debug_check( (in_hefts.internal_has_nonfinite()), "gmm_full::set_hefts(): given hefts have non-finite values" ); - arma_debug_check( (any(vectorise(in_hefts) < eT(0))), "gmm_full::set_hefts(): given hefts have negative values" ); + arma_conform_check( (arma::size(in_hefts) != arma::size(hefts)), "gmm_full::set_hefts(): given hefts have incompatible size" ); + arma_conform_check( (in_hefts.internal_has_nonfinite()), "gmm_full::set_hefts(): given hefts have non-finite values" ); + arma_conform_check( (any(vectorise(in_hefts) < eT(0))), "gmm_full::set_hefts(): given hefts have negative values" ); const eT s = accu(in_hefts); - arma_debug_check( ((s < (eT(1) - eT(0.001))) || (s > (eT(1) + eT(0.001)))), "gmm_full::set_hefts(): sum of given hefts is not 1" ); + arma_conform_check( ((s < (eT(1) - eT(0.001))) || (s > (eT(1) + eT(0.001)))), "gmm_full::set_hefts(): sum of given hefts is not 1" ); // make sure all hefts are positive and non-zero @@ -284,7 +284,7 @@ inline bool gmm_full::load(const std::string name) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); field< Mat > storage; @@ -293,7 +293,7 @@ gmm_full::load(const std::string name) if( (status == false) || (storage.n_elem < 2) ) { reset(); - arma_debug_warn_level(3, "gmm_full::load(): problem with loading or incompatible format"); + arma_conform_warn(3, "gmm_full::load(): problem with loading or incompatible format"); return false; } @@ -308,7 +308,7 @@ gmm_full::load(const std::string name) if( (storage.n_elem != (N_gaus + 2)) || (storage_hefts.n_rows != 1) || (storage_hefts.n_cols != N_gaus) ) { reset(); - arma_debug_warn_level(3, "gmm_full::load(): incompatible format"); + arma_conform_warn(3, "gmm_full::load(): incompatible format"); return false; } @@ -324,7 +324,7 @@ gmm_full::load(const std::string name) if( (storage_fcov.n_rows != N_dims) || (storage_fcov.n_cols != N_dims) ) { reset(); - arma_debug_warn_level(3, "gmm_full::load(): incompatible format"); + arma_conform_warn(3, "gmm_full::load(): incompatible format"); return false; } @@ -343,7 +343,7 @@ inline bool gmm_full::save(const std::string name) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N_gaus = means.n_cols; @@ -371,7 +371,7 @@ inline Col gmm_full::generate() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N_dims = means.n_rows; const uword N_gaus = means.n_cols; @@ -407,7 +407,7 @@ inline Mat gmm_full::generate(const uword N_vec) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N_dims = means.n_rows; const uword N_gaus = means.n_cols; @@ -452,7 +452,7 @@ inline eT gmm_full::log_p(const T1& expr, const gmm_empty_arg& junk1, typename enable_if<((is_arma_type::value) && (resolves_to_colvector::value == true))>::result* junk2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); @@ -460,7 +460,7 @@ gmm_full::log_p(const T1& expr, const gmm_empty_arg& junk1, typename enable_ const quasi_unwrap U(expr); - arma_debug_check( (U.M.n_rows != N_dims), "gmm_full::log_p(): incompatible dimensions" ); + arma_conform_check( (U.M.n_rows != N_dims), "gmm_full::log_p(): incompatible dimensions" ); return internal_scalar_log_p( U.M.memptr() ); } @@ -473,15 +473,15 @@ inline eT gmm_full::log_p(const T1& expr, const uword gaus_id, typename enable_if<((is_arma_type::value) && (resolves_to_colvector::value == true))>::result* junk2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk2); const uword N_dims = means.n_rows; const quasi_unwrap U(expr); - arma_debug_check( (U.M.n_rows != N_dims), "gmm_full::log_p(): incompatible dimensions" ); - arma_debug_check( (gaus_id >= means.n_cols), "gmm_full::log_p(): specified gaussian is out of range" ); + arma_conform_check( (U.M.n_rows != N_dims), "gmm_full::log_p(): incompatible dimensions" ); + arma_conform_check( (gaus_id >= means.n_cols), "gmm_full::log_p(): specified gaussian is out of range" ); return internal_scalar_log_p( U.M.memptr(), gaus_id ); } @@ -494,7 +494,7 @@ inline Row gmm_full::log_p(const T1& expr, const gmm_empty_arg& junk1, typename enable_if<((is_arma_type::value) && (resolves_to_colvector::value == false))>::result* junk2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); @@ -513,7 +513,7 @@ inline Row gmm_full::log_p(const T1& expr, const uword gaus_id, typename enable_if<((is_arma_type::value) && (resolves_to_colvector::value == false))>::result* junk2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk2); const quasi_unwrap tmp(expr); @@ -531,7 +531,7 @@ inline eT gmm_full::sum_log_p(const Base& expr) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap tmp(expr.get_ref()); @@ -548,7 +548,7 @@ inline eT gmm_full::sum_log_p(const Base& expr, const uword gaus_id) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap tmp(expr.get_ref()); @@ -565,7 +565,7 @@ inline eT gmm_full::avg_log_p(const Base& expr) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap tmp(expr.get_ref()); @@ -582,7 +582,7 @@ inline eT gmm_full::avg_log_p(const Base& expr, const uword gaus_id) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap tmp(expr.get_ref()); @@ -599,7 +599,7 @@ inline uword gmm_full::assign(const T1& expr, const gmm_dist_mode& dist, typename enable_if<((is_arma_type::value) && (resolves_to_colvector::value == true))>::result* junk) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const quasi_unwrap tmp(expr); @@ -617,7 +617,7 @@ inline urowvec gmm_full::assign(const T1& expr, const gmm_dist_mode& dist, typename enable_if<((is_arma_type::value) && (resolves_to_colvector::value == false))>::result* junk) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); urowvec out; @@ -639,14 +639,14 @@ inline urowvec gmm_full::raw_hist(const Base& expr, const gmm_dist_mode& dist_mode) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap tmp(expr.get_ref()); const Mat& X = tmp.M; - arma_debug_check( (X.n_rows != means.n_rows), "gmm_full::raw_hist(): incompatible dimensions" ); + arma_conform_check( (X.n_rows != means.n_rows), "gmm_full::raw_hist(): incompatible dimensions" ); - arma_debug_check( ((dist_mode != eucl_dist) && (dist_mode != prob_dist)), "gmm_full::raw_hist(): unsupported distance mode" ); + arma_conform_check( ((dist_mode != eucl_dist) && (dist_mode != prob_dist)), "gmm_full::raw_hist(): unsupported distance mode" ); urowvec hist; @@ -663,14 +663,14 @@ inline Row gmm_full::norm_hist(const Base& expr, const gmm_dist_mode& dist_mode) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap tmp(expr.get_ref()); const Mat& X = tmp.M; - arma_debug_check( (X.n_rows != means.n_rows), "gmm_full::norm_hist(): incompatible dimensions" ); + arma_conform_check( (X.n_rows != means.n_rows), "gmm_full::norm_hist(): incompatible dimensions" ); - arma_debug_check( ((dist_mode != eucl_dist) && (dist_mode != prob_dist)), "gmm_full::norm_hist(): unsupported distance mode" ); + arma_conform_check( ((dist_mode != eucl_dist) && (dist_mode != prob_dist)), "gmm_full::norm_hist(): unsupported distance mode" ); urowvec hist; @@ -711,7 +711,7 @@ gmm_full::learn const bool print_mode ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool dist_mode_ok = (dist_mode == eucl_dist) || (dist_mode == maha_dist); @@ -722,15 +722,15 @@ gmm_full::learn || (seed_mode == random_subset) || (seed_mode == random_spread); - arma_debug_check( (dist_mode_ok == false), "gmm_full::learn(): dist_mode must be eucl_dist or maha_dist" ); - arma_debug_check( (seed_mode_ok == false), "gmm_full::learn(): unknown seed_mode" ); - arma_debug_check( (var_floor < eT(0) ), "gmm_full::learn(): variance floor is negative" ); + arma_conform_check( (dist_mode_ok == false), "gmm_full::learn(): dist_mode must be eucl_dist or maha_dist" ); + arma_conform_check( (seed_mode_ok == false), "gmm_full::learn(): unknown seed_mode" ); + arma_conform_check( (var_floor < eT(0) ), "gmm_full::learn(): variance floor is negative" ); const unwrap tmp_X(data.get_ref()); const Mat& X = tmp_X.M; - if(X.is_empty() ) { arma_debug_warn_level(3, "gmm_full::learn(): given matrix is empty" ); return false; } - if(X.internal_has_nonfinite()) { arma_debug_warn_level(3, "gmm_full::learn(): given matrix has non-finite values"); return false; } + if(X.is_empty() ) { arma_conform_warn(3, "gmm_full::learn(): given matrix is empty" ); return false; } + if(X.internal_has_nonfinite()) { arma_conform_warn(3, "gmm_full::learn(): given matrix has non-finite values"); return false; } if(N_gaus == 0) { reset(); return true; } @@ -759,14 +759,14 @@ gmm_full::learn if(seed_mode == keep_existing) { - if(means.is_empty() ) { arma_debug_warn_level(3, "gmm_full::learn(): no existing means" ); return false; } - if(X.n_rows != means.n_rows) { arma_debug_warn_level(3, "gmm_full::learn(): dimensionality mismatch"); return false; } + if(means.is_empty() ) { arma_conform_warn(3, "gmm_full::learn(): no existing means" ); return false; } + if(X.n_rows != means.n_rows) { arma_conform_warn(3, "gmm_full::learn(): dimensionality mismatch"); return false; } // TODO: also check for number of vectors? } else { - if(X.n_cols < N_gaus) { arma_debug_warn_level(3, "gmm_full::learn(): number of vectors is less than number of gaussians"); return false; } + if(X.n_cols < N_gaus) { arma_conform_warn(3, "gmm_full::learn(): number of vectors is less than number of gaussians"); return false; } reset(X.n_rows, N_gaus); @@ -790,7 +790,7 @@ gmm_full::learn stream_state.restore(get_cout_stream()); - if(status == false) { arma_debug_warn_level(3, "gmm_full::learn(): k-means algorithm failed; not enough data, or too many gaussians requested"); init(orig); return false; } + if(status == false) { arma_conform_warn(3, "gmm_full::learn(): k-means algorithm failed; not enough data, or too many gaussians requested"); init(orig); return false; } } @@ -817,7 +817,7 @@ gmm_full::learn stream_state.restore(get_cout_stream()); - if(status == false) { arma_debug_warn_level(3, "gmm_full::learn(): EM algorithm failed"); init(orig); return false; } + if(status == false) { arma_conform_warn(3, "gmm_full::learn(): EM algorithm failed"); init(orig); return false; } } mah_aux.reset(); @@ -840,7 +840,7 @@ inline void gmm_full::init(const gmm_full& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); gmm_full& t = *this; @@ -861,7 +861,7 @@ inline void gmm_full::init(const gmm_diag& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); access::rw(hefts) = x.hefts; access::rw(means) = x.means; @@ -893,7 +893,7 @@ inline void gmm_full::init(const uword in_n_dims, const uword in_n_gaus) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); access::rw(means).zeros(in_n_dims, in_n_gaus); @@ -917,7 +917,7 @@ inline void gmm_full::init_constants(const bool calc_chol) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N_dims = means.n_rows; const uword N_gaus = means.n_cols; @@ -1026,7 +1026,7 @@ inline umat gmm_full::internal_gen_boundaries(const uword N) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_OPENMP) const uword n_threads_avail = uword(omp_get_max_threads()); @@ -1073,7 +1073,7 @@ inline eT gmm_full::internal_scalar_log_p(const eT* x) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const eT* log_hefts_mem = log_hefts.mem; @@ -1105,7 +1105,7 @@ inline eT gmm_full::internal_scalar_log_p(const eT* x, const uword g) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N_dims = means.n_rows; const eT* mean_mem = means.colptr(g); @@ -1138,12 +1138,12 @@ inline Row gmm_full::internal_vec_log_p(const Mat& X) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N_dims = means.n_rows; const uword N_samples = X.n_cols; - arma_debug_check( (X.n_rows != N_dims), "gmm_full::log_p(): incompatible dimensions" ); + arma_conform_check( (X.n_rows != N_dims), "gmm_full::log_p(): incompatible dimensions" ); Row out(N_samples, arma_nozeros_indicator()); @@ -1191,13 +1191,13 @@ inline Row gmm_full::internal_vec_log_p(const Mat& X, const uword gaus_id) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N_dims = means.n_rows; const uword N_samples = X.n_cols; - arma_debug_check( (X.n_rows != N_dims), "gmm_full::log_p(): incompatible dimensions" ); - arma_debug_check( (gaus_id >= means.n_cols), "gmm_full::log_p(): specified gaussian is out of range" ); + arma_conform_check( (X.n_rows != N_dims), "gmm_full::log_p(): incompatible dimensions" ); + arma_conform_check( (gaus_id >= means.n_cols), "gmm_full::log_p(): specified gaussian is out of range" ); Row out(N_samples, arma_nozeros_indicator()); @@ -1245,9 +1245,9 @@ inline eT gmm_full::internal_sum_log_p(const Mat& X) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (X.n_rows != means.n_rows), "gmm_full::sum_log_p(): incompatible dimensions" ); + arma_conform_check( (X.n_rows != means.n_rows), "gmm_full::sum_log_p(): incompatible dimensions" ); const uword N = X.n_cols; @@ -1301,10 +1301,10 @@ inline eT gmm_full::internal_sum_log_p(const Mat& X, const uword gaus_id) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (X.n_rows != means.n_rows), "gmm_full::sum_log_p(): incompatible dimensions" ); - arma_debug_check( (gaus_id >= means.n_cols), "gmm_full::sum_log_p(): specified gaussian is out of range" ); + arma_conform_check( (X.n_rows != means.n_rows), "gmm_full::sum_log_p(): incompatible dimensions" ); + arma_conform_check( (gaus_id >= means.n_cols), "gmm_full::sum_log_p(): specified gaussian is out of range" ); const uword N = X.n_cols; @@ -1358,12 +1358,12 @@ inline eT gmm_full::internal_avg_log_p(const Mat& X) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N_dims = means.n_rows; const uword N_samples = X.n_cols; - arma_debug_check( (X.n_rows != N_dims), "gmm_full::avg_log_p(): incompatible dimensions" ); + arma_conform_check( (X.n_rows != N_dims), "gmm_full::avg_log_p(): incompatible dimensions" ); if(N_samples == 0) { return (-Datum::inf); } @@ -1426,13 +1426,13 @@ inline eT gmm_full::internal_avg_log_p(const Mat& X, const uword gaus_id) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N_dims = means.n_rows; const uword N_samples = X.n_cols; - arma_debug_check( (X.n_rows != N_dims), "gmm_full::avg_log_p(): incompatible dimensions" ); - arma_debug_check( (gaus_id >= means.n_cols), "gmm_full::avg_log_p(): specified gaussian is out of range" ); + arma_conform_check( (X.n_rows != N_dims), "gmm_full::avg_log_p(): incompatible dimensions" ); + arma_conform_check( (gaus_id >= means.n_cols), "gmm_full::avg_log_p(): specified gaussian is out of range" ); if(N_samples == 0) { return (-Datum::inf); } @@ -1495,13 +1495,13 @@ inline uword gmm_full::internal_scalar_assign(const Mat& X, const gmm_dist_mode& dist_mode) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N_dims = means.n_rows; const uword N_gaus = means.n_cols; - arma_debug_check( (X.n_rows != N_dims), "gmm_full::assign(): incompatible dimensions" ); - arma_debug_check( (N_gaus == 0), "gmm_full::assign(): model has no means" ); + arma_conform_check( (X.n_rows != N_dims), "gmm_full::assign(): incompatible dimensions" ); + arma_conform_check( (N_gaus == 0), "gmm_full::assign(): model has no means" ); const eT* X_mem = X.colptr(0); @@ -1546,7 +1546,7 @@ gmm_full::internal_scalar_assign(const Mat& X, const gmm_dist_mode& dist } else { - arma_debug_check(true, "gmm_full::assign(): unsupported distance mode"); + arma_conform_check(true, "gmm_full::assign(): unsupported distance mode"); } return uword(0); @@ -1559,12 +1559,12 @@ inline void gmm_full::internal_vec_assign(urowvec& out, const Mat& X, const gmm_dist_mode& dist_mode) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N_dims = means.n_rows; const uword N_gaus = means.n_cols; - arma_debug_check( (X.n_rows != N_dims), "gmm_full::assign(): incompatible dimensions" ); + arma_conform_check( (X.n_rows != N_dims), "gmm_full::assign(): incompatible dimensions" ); const uword X_n_cols = (N_gaus > 0) ? X.n_cols : 0; @@ -1675,7 +1675,7 @@ gmm_full::internal_vec_assign(urowvec& out, const Mat& X, const gmm_dist } else { - arma_debug_check(true, "gmm_full::assign(): unsupported distance mode"); + arma_conform_check(true, "gmm_full::assign(): unsupported distance mode"); } } @@ -1687,7 +1687,7 @@ inline void gmm_full::internal_raw_hist(urowvec& hist, const Mat& X, const gmm_dist_mode& dist_mode) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N_dims = means.n_rows; const uword N_gaus = means.n_cols; @@ -1832,7 +1832,7 @@ inline void gmm_full::generate_initial_means(const Mat& X, const gmm_seed_mode& seed_mode) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N_dims = means.n_rows; const uword N_gaus = means.n_cols; @@ -1926,7 +1926,7 @@ inline void gmm_full::generate_initial_params(const Mat& X, const eT var_floor) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N_dims = means.n_rows; const uword N_gaus = means.n_cols; @@ -2081,7 +2081,7 @@ inline bool gmm_full::km_iterate(const Mat& X, const uword max_iter, const bool verbose) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(verbose) { @@ -2321,7 +2321,7 @@ inline bool gmm_full::em_iterate(const Mat& X, const uword max_iter, const eT var_floor, const bool verbose) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N_dims = means.n_rows; const uword N_gaus = means.n_cols; @@ -2433,7 +2433,7 @@ gmm_full::em_update_params const eT var_floor ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_threads = boundaries.n_cols; @@ -2588,7 +2588,7 @@ gmm_full::em_generate_acc ) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); progress_log_lhood = eT(0); @@ -2672,7 +2672,7 @@ inline void gmm_full::em_fix_params(const eT var_floor) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N_dims = means.n_rows; const uword N_gaus = means.n_cols; diff --git a/inst/include/armadillo_bits/gmm_misc_meat.hpp b/inst/include/armadillo_bits/gmm_misc_meat.hpp index 3276b46f..d512eb19 100644 --- a/inst/include/armadillo_bits/gmm_misc_meat.hpp +++ b/inst/include/armadillo_bits/gmm_misc_meat.hpp @@ -30,7 +30,7 @@ running_mean_scalar::running_mean_scalar() : counter(uword(0)) , r_mean ( eT(0)) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } @@ -41,7 +41,7 @@ running_mean_scalar::running_mean_scalar(const running_mean_scalar& in) : counter(in.counter) , r_mean (in.r_mean ) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } @@ -51,7 +51,7 @@ inline const running_mean_scalar& running_mean_scalar::operator=(const running_mean_scalar& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); counter = in.counter; r_mean = in.r_mean; @@ -66,7 +66,7 @@ inline void running_mean_scalar::operator() (const eT X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); counter++; @@ -89,7 +89,7 @@ inline void running_mean_scalar::reset() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); counter = 0; r_mean = eT(0); diff --git a/inst/include/armadillo_bits/injector_meat.hpp b/inst/include/armadillo_bits/injector_meat.hpp index 81962c06..0c07d727 100644 --- a/inst/include/armadillo_bits/injector_meat.hpp +++ b/inst/include/armadillo_bits/injector_meat.hpp @@ -26,7 +26,7 @@ inline mat_injector::mat_injector(T1& in_parent, const typename mat_injector::elem_type val) : parent(in_parent) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); values.reserve(16); rowend.reserve(16); @@ -41,7 +41,7 @@ inline mat_injector::mat_injector(T1& in_parent, const injector_end_of_row<>&) : parent(in_parent) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); values.reserve(16); rowend.reserve(16); @@ -55,7 +55,7 @@ template inline mat_injector::~mat_injector() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N = values.size(); @@ -86,7 +86,7 @@ mat_injector::~mat_injector() if(is_Row::value) { - arma_debug_check( (n_rows > 1), "matrix initialisation: incompatible dimensions" ); + arma_conform_check( (n_rows > 1), "matrix initialisation: incompatible dimensions" ); parent.zeros(1,n_cols); @@ -110,7 +110,7 @@ mat_injector::~mat_injector() { const bool is_vec = ((n_cols == 1) || (n_rows == 1)); - arma_debug_check( (is_vec == false), "matrix initialisation: incompatible dimensions" ); + arma_conform_check( (is_vec == false), "matrix initialisation: incompatible dimensions" ); if(n_cols == 1) { @@ -182,7 +182,7 @@ inline void mat_injector::insert(const typename mat_injector::elem_type val) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); values.push_back(val ); rowend.push_back(char(0)); @@ -196,7 +196,7 @@ inline void mat_injector::end_of_row() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename mat_injector::elem_type eT; @@ -211,7 +211,7 @@ inline const mat_injector& operator<<(const mat_injector& ref, const typename mat_injector::elem_type val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); ref.insert(val); @@ -225,7 +225,7 @@ inline const mat_injector& operator<<(const mat_injector& ref, const injector_end_of_row<>&) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); ref.end_of_row(); @@ -245,7 +245,7 @@ inline field_injector::field_injector(T1& in_parent, const typename field_injector::object_type& val) : parent(in_parent) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); insert(val); } @@ -257,7 +257,7 @@ inline field_injector::field_injector(T1& in_parent, const injector_end_of_row<>&) : parent(in_parent) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); end_of_row(); } @@ -268,7 +268,7 @@ template inline field_injector::~field_injector() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N = values.size(); @@ -324,7 +324,7 @@ inline void field_injector::insert(const typename field_injector::object_type& val) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); values.push_back(val ); rowend.push_back(char(0)); @@ -338,7 +338,7 @@ inline void field_injector::end_of_row() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename field_injector::object_type oT; @@ -353,7 +353,7 @@ inline const field_injector& operator<<(const field_injector& ref, const typename field_injector::object_type& val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); ref.insert(val); @@ -367,7 +367,7 @@ inline const field_injector& operator<<(const field_injector& ref, const injector_end_of_row<>&) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); ref.end_of_row(); diff --git a/inst/include/armadillo_bits/memory.hpp b/inst/include/armadillo_bits/memory.hpp index ffa4d2c8..70de279e 100644 --- a/inst/include/armadillo_bits/memory.hpp +++ b/inst/include/armadillo_bits/memory.hpp @@ -43,7 +43,7 @@ memory::acquire(const uword n_elem) { if(n_elem == 0) { return nullptr; } - arma_debug_check + arma_conform_check ( ( size_t(n_elem) > (std::numeric_limits::max() / sizeof(eT)) ), "arma::memory::acquire(): requested size is too large" diff --git a/inst/include/armadillo_bits/mtGlueCube_meat.hpp b/inst/include/armadillo_bits/mtGlueCube_meat.hpp index dd27ecd4..c5e91e12 100644 --- a/inst/include/armadillo_bits/mtGlueCube_meat.hpp +++ b/inst/include/armadillo_bits/mtGlueCube_meat.hpp @@ -27,7 +27,7 @@ mtGlueCube::mtGlueCube(const T1& in_A, const T2& in_B) : A(in_A) , B(in_B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -39,7 +39,7 @@ mtGlueCube::mtGlueCube(const T1& in_A, const T2& in_B, c , B(in_B) , aux_uword(in_aux_uword) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -48,7 +48,7 @@ template inline mtGlueCube::~mtGlueCube() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } diff --git a/inst/include/armadillo_bits/mtGlue_meat.hpp b/inst/include/armadillo_bits/mtGlue_meat.hpp index cf3afccc..85cc9a21 100644 --- a/inst/include/armadillo_bits/mtGlue_meat.hpp +++ b/inst/include/armadillo_bits/mtGlue_meat.hpp @@ -27,7 +27,7 @@ mtGlue::mtGlue(const T1& in_A, const T2& in_B) : A(in_A) , B(in_B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -39,7 +39,7 @@ mtGlue::mtGlue(const T1& in_A, const T2& in_B, const uwo , B(in_B) , aux_uword(in_aux_uword) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -48,7 +48,7 @@ template inline mtGlue::~mtGlue() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } diff --git a/inst/include/armadillo_bits/mtOpCube_meat.hpp b/inst/include/armadillo_bits/mtOpCube_meat.hpp index 9ce8b176..611cd9e9 100644 --- a/inst/include/armadillo_bits/mtOpCube_meat.hpp +++ b/inst/include/armadillo_bits/mtOpCube_meat.hpp @@ -26,7 +26,7 @@ inline mtOpCube::mtOpCube(const T1& in_m) : m(in_m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -37,7 +37,7 @@ mtOpCube::mtOpCube(const T1& in_m, const typename T1::elem_ : m(in_m) , aux(in_aux) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -50,7 +50,7 @@ mtOpCube::mtOpCube(const T1& in_m, const uword in_aux_uword , aux_uword_b(in_aux_uword_b) , aux_uword_c(in_aux_uword_c) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -64,7 +64,7 @@ mtOpCube::mtOpCube(const T1& in_m, const typename T1::elem_ , aux_uword_b(in_aux_uword_b) , aux_uword_c(in_aux_uword_c) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -75,7 +75,7 @@ mtOpCube::mtOpCube(const char junk, const T1& in_m, const o : m(in_m) , aux_out_eT(in_aux) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); } @@ -88,7 +88,7 @@ mtOpCube::mtOpCube(const mtOpCube_dual_aux_indicator&, cons , aux (in_aux_a) , aux_out_eT(in_aux_b) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -97,7 +97,7 @@ template inline mtOpCube::~mtOpCube() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } diff --git a/inst/include/armadillo_bits/mtOp_meat.hpp b/inst/include/armadillo_bits/mtOp_meat.hpp index c5b53b8a..623660c4 100644 --- a/inst/include/armadillo_bits/mtOp_meat.hpp +++ b/inst/include/armadillo_bits/mtOp_meat.hpp @@ -26,7 +26,7 @@ inline mtOp::mtOp(const T1& in_m) : m(in_m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -37,7 +37,7 @@ mtOp::mtOp(const T1& in_m, const typename T1::elem_type in_ : m(in_m) , aux(in_aux) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -49,7 +49,7 @@ mtOp::mtOp(const T1& in_m, const uword in_aux_uword_a, cons , aux_uword_a(in_aux_uword_a) , aux_uword_b(in_aux_uword_b) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -62,7 +62,7 @@ mtOp::mtOp(const T1& in_m, const typename T1::elem_type in_ , aux_uword_a(in_aux_uword_a) , aux_uword_b(in_aux_uword_b) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -75,7 +75,7 @@ mtOp::mtOp(const char junk, const T1& in_m, const out_eT in { arma_ignore(junk); - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -87,7 +87,7 @@ mtOp::mtOp(const mtOp_dual_aux_indicator&, const T1& in_m, , aux (in_aux_a) , aux_out_eT(in_aux_b) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -96,7 +96,7 @@ template inline mtOp::~mtOp() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } diff --git a/inst/include/armadillo_bits/mtSpGlue_meat.hpp b/inst/include/armadillo_bits/mtSpGlue_meat.hpp index 41ede458..ee1bf3cd 100644 --- a/inst/include/armadillo_bits/mtSpGlue_meat.hpp +++ b/inst/include/armadillo_bits/mtSpGlue_meat.hpp @@ -27,7 +27,7 @@ mtSpGlue::mtSpGlue(const T1& in_A, const T2& in_B) : A(in_A) , B(in_B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -36,7 +36,7 @@ template inline mtSpGlue::~mtSpGlue() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } diff --git a/inst/include/armadillo_bits/mtSpOp_bones.hpp b/inst/include/armadillo_bits/mtSpOp_bones.hpp index 9c73727b..8a07d176 100644 --- a/inst/include/armadillo_bits/mtSpOp_bones.hpp +++ b/inst/include/armadillo_bits/mtSpOp_bones.hpp @@ -19,9 +19,6 @@ //! \addtogroup mtSpOp //! @{ -// Class for delayed multi-type sparse operations. These are operations where -// the resulting type is different than the stored type. - template diff --git a/inst/include/armadillo_bits/mtSpOp_meat.hpp b/inst/include/armadillo_bits/mtSpOp_meat.hpp index 2273f088..525851b5 100644 --- a/inst/include/armadillo_bits/mtSpOp_meat.hpp +++ b/inst/include/armadillo_bits/mtSpOp_meat.hpp @@ -26,7 +26,7 @@ inline mtSpOp::mtSpOp(const T1& in_m) : m(in_m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -38,7 +38,7 @@ mtSpOp::mtSpOp(const T1& in_m, const uword in_aux_uword_a, , aux_uword_a(in_aux_uword_a) , aux_uword_b(in_aux_uword_b) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -51,7 +51,7 @@ mtSpOp::mtSpOp(const char junk, const T1& in_m, const out_e { arma_ignore(junk); - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -60,7 +60,7 @@ template inline mtSpOp::~mtSpOp() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } diff --git a/inst/include/armadillo_bits/mtSpToDOp_bones.hpp b/inst/include/armadillo_bits/mtSpToDOp_bones.hpp new file mode 100644 index 00000000..83aae4d0 --- /dev/null +++ b/inst/include/armadillo_bits/mtSpToDOp_bones.hpp @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + + +//! \addtogroup mtSpToDOp +//! @{ + + + +template +class mtSpToDOp : public Base< out_eT, mtSpToDOp > + { + public: + + typedef out_eT elem_type; + typedef typename get_pod_type::result pod_type; + + typedef typename T1::elem_type in_eT; + + static constexpr bool is_row = op_type::template traits::is_row; + static constexpr bool is_col = op_type::template traits::is_col; + static constexpr bool is_xvec = op_type::template traits::is_xvec; + + inline explicit mtSpToDOp(const T1& in_m); + inline mtSpToDOp(const T1& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b); + inline ~mtSpToDOp(); + + arma_aligned const T1& m; //!< the operand; must be derived from SpBase + arma_aligned uword aux_uword_a; //!< auxiliary data, uword format + arma_aligned uword aux_uword_b; //!< auxiliary data, uword format + }; + + + +//! @} diff --git a/inst/include/armadillo_bits/mtSpToDOp_meat.hpp b/inst/include/armadillo_bits/mtSpToDOp_meat.hpp new file mode 100644 index 00000000..7065490d --- /dev/null +++ b/inst/include/armadillo_bits/mtSpToDOp_meat.hpp @@ -0,0 +1,55 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + + +//! \addtogroup mtSpToDOp +//! @{ + + + +template +inline +mtSpToDOp::mtSpToDOp(const T1& in_m) + : m(in_m) + { + arma_debug_sigprint(); + } + + + +template +inline +mtSpToDOp::mtSpToDOp(const T1& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b) + : m(in_m) + , aux_uword_a(in_aux_uword_a) + , aux_uword_b(in_aux_uword_b) + { + arma_debug_sigprint(); + } + + + +template +inline +mtSpToDOp::~mtSpToDOp() + { + arma_debug_sigprint(); + } + + + +//! @} diff --git a/inst/include/armadillo_bits/mul_gemm.hpp b/inst/include/armadillo_bits/mul_gemm.hpp index 27e31832..71ac1687 100644 --- a/inst/include/armadillo_bits/mul_gemm.hpp +++ b/inst/include/armadillo_bits/mul_gemm.hpp @@ -42,7 +42,7 @@ class gemm_emul_tinysq const eT beta = eT(0) ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); switch(A.n_rows) { @@ -82,7 +82,7 @@ class gemm_emul_large const eT beta = eT(0) ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword A_n_rows = A.n_rows; const uword A_n_cols = A.n_cols; @@ -194,7 +194,7 @@ class gemm_emul const typename arma_not_cx::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); gemm_emul_large::apply(C, A, B, alpha, beta); @@ -217,7 +217,7 @@ class gemm_emul const typename arma_cx_only::result* junk = nullptr ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); // "better than nothing" handling of hermitian transposes for complex number matrices @@ -253,7 +253,7 @@ class gemm void apply_blas_type( Mat& C, const TA& A, const TB& B, const eT alpha = eT(1), const eT beta = eT(0) ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if( (A.n_rows <= 4) && (A.n_rows == A.n_cols) && (A.n_rows == B.n_rows) && (B.n_rows == B.n_cols) && (is_cx::no) ) { @@ -274,9 +274,9 @@ class gemm { #if defined(ARMA_USE_ATLAS) { - arma_extra_debug_print("atlas::cblas_gemm()"); + arma_debug_print("atlas::cblas_gemm()"); - arma_debug_assert_atlas_size(A,B); + arma_conform_assert_atlas_size(A,B); atlas::cblas_gemm ( @@ -298,9 +298,9 @@ class gemm } #elif defined(ARMA_USE_BLAS) { - arma_extra_debug_print("blas::gemm()"); + arma_debug_print("blas::gemm()"); - arma_debug_assert_blas_size(A,B); + arma_conform_assert_blas_size(A,B); const char trans_A = (do_trans_A) ? ( is_cx::yes ? 'C' : 'T' ) : 'N'; const char trans_B = (do_trans_B) ? ( is_cx::yes ? 'C' : 'T' ) : 'N'; @@ -316,8 +316,8 @@ class gemm const eT local_beta = (use_beta) ? beta : eT(0); - arma_extra_debug_print( arma_str::format("blas::gemm(): trans_A = %c") % trans_A ); - arma_extra_debug_print( arma_str::format("blas::gemm(): trans_B = %c") % trans_B ); + arma_debug_print( arma_str::format("blas::gemm(): trans_A = %c") % trans_A ); + arma_debug_print( arma_str::format("blas::gemm(): trans_B = %c") % trans_B ); blas::gemm ( diff --git a/inst/include/armadillo_bits/mul_gemm_mixed.hpp b/inst/include/armadillo_bits/mul_gemm_mixed.hpp index 749cdb17..158a9191 100644 --- a/inst/include/armadillo_bits/mul_gemm_mixed.hpp +++ b/inst/include/armadillo_bits/mul_gemm_mixed.hpp @@ -45,7 +45,7 @@ class gemm_mixed_large const out_eT beta = out_eT(0) ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword A_n_rows = A.n_rows; const uword A_n_cols = A.n_cols; @@ -257,7 +257,7 @@ class gemm_mixed const out_eT beta = out_eT(0) ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if((is_cx::yes && do_trans_A) || (is_cx::yes && do_trans_B)) { diff --git a/inst/include/armadillo_bits/mul_gemv.hpp b/inst/include/armadillo_bits/mul_gemv.hpp index 2580e4ab..c4e19a6c 100644 --- a/inst/include/armadillo_bits/mul_gemv.hpp +++ b/inst/include/armadillo_bits/mul_gemv.hpp @@ -65,7 +65,7 @@ class gemv_emul_tinysq void apply( eT* y, const TA& A, const eT* x, const eT alpha = eT(1), const eT beta = eT(0) ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const eT* Am = A.memptr(); @@ -224,7 +224,7 @@ class gemv_emul void apply( eT* y, const TA& A, const eT* x, const eT alpha = eT(1), const eT beta = eT(0) ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword A_n_rows = A.n_rows; const uword A_n_cols = A.n_cols; @@ -307,7 +307,7 @@ class gemv void apply_blas_type( eT* y, const TA& A, const eT* x, const eT alpha = eT(1), const eT beta = eT(0) ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if( (A.n_rows <= 4) && (A.n_rows == A.n_cols) && (is_cx::no) ) { @@ -317,13 +317,13 @@ class gemv { #if defined(ARMA_USE_ATLAS) { - arma_debug_assert_atlas_size(A); + arma_conform_assert_atlas_size(A); if(is_cx::no) { // use gemm() instead of gemv() to work around a speed issue in Atlas 3.8.4 - arma_extra_debug_print("atlas::cblas_gemm()"); + arma_debug_print("atlas::cblas_gemm()"); atlas::cblas_gemm ( @@ -345,7 +345,7 @@ class gemv } else { - arma_extra_debug_print("atlas::cblas_gemv()"); + arma_debug_print("atlas::cblas_gemv()"); atlas::cblas_gemv ( @@ -366,9 +366,9 @@ class gemv } #elif defined(ARMA_USE_BLAS) { - arma_extra_debug_print("blas::gemv()"); + arma_debug_print("blas::gemv()"); - arma_debug_assert_blas_size(A); + arma_conform_assert_blas_size(A); const char trans_A = (do_trans_A) ? ( is_cx::yes ? 'C' : 'T' ) : 'N'; const blas_int m = blas_int(A.n_rows); @@ -378,7 +378,7 @@ class gemv const blas_int inc = blas_int(1); const eT local_beta = (use_beta) ? beta : eT(0); - arma_extra_debug_print( arma_str::format("blas::gemv(): trans_A = %c") % trans_A ); + arma_debug_print( arma_str::format("blas::gemv(): trans_A = %c") % trans_A ); blas::gemv ( diff --git a/inst/include/armadillo_bits/mul_herk.hpp b/inst/include/armadillo_bits/mul_herk.hpp index e6b13b2b..09fdd02a 100644 --- a/inst/include/armadillo_bits/mul_herk.hpp +++ b/inst/include/armadillo_bits/mul_herk.hpp @@ -54,7 +54,7 @@ class herk_helper eT dot_conj_row(const uword n_elem, const eT* const A, const Mat& B, const uword row) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -101,7 +101,7 @@ class herk_vec const T beta = T(0) ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef std::complex eT; @@ -242,7 +242,7 @@ class herk_emul const T beta = T(0) ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef std::complex eT; @@ -320,7 +320,7 @@ class herk void apply_blas_type( Mat>& C, const TA& A, const T alpha = T(1), const T beta = T(0) ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword threshold = 16; @@ -391,7 +391,7 @@ class herk return; } - arma_extra_debug_print("blas::herk()"); + arma_debug_print("blas::herk()"); const char uplo = 'U'; @@ -405,7 +405,7 @@ class herk const blas_int lda = (do_trans_A) ? k : n; - arma_extra_debug_print( arma_str::format("blas::herk(): trans_A = %c") % trans_A ); + arma_debug_print( arma_str::format("blas::herk(): trans_A = %c") % trans_A ); blas::herk ( diff --git a/inst/include/armadillo_bits/mul_syrk.hpp b/inst/include/armadillo_bits/mul_syrk.hpp index c2da3a27..f1369393 100644 --- a/inst/include/armadillo_bits/mul_syrk.hpp +++ b/inst/include/armadillo_bits/mul_syrk.hpp @@ -78,7 +78,7 @@ class syrk_vec const eT beta = eT(0) ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword A_n1 = (do_trans_A == false) ? A.n_rows : A.n_cols; const uword A_n2 = (do_trans_A == false) ? A.n_cols : A.n_rows; @@ -206,7 +206,7 @@ class syrk_emul const eT beta = eT(0) ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // do_trans_A == false -> C = alpha * A * A^T + beta*C // do_trans_A == true -> C = alpha * A^T * A + beta*C @@ -282,7 +282,7 @@ class syrk void apply_blas_type( Mat& C, const TA& A, const eT alpha = eT(1), const eT beta = eT(0) ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(A.is_vec()) { @@ -348,7 +348,7 @@ class syrk return; } - arma_extra_debug_print("blas::syrk()"); + arma_debug_print("blas::syrk()"); const char uplo = 'U'; @@ -362,7 +362,7 @@ class syrk const blas_int lda = (do_trans_A) ? k : n; - arma_extra_debug_print( arma_str::format("blas::syrk(): trans_A = %c") % trans_A ); + arma_debug_print( arma_str::format("blas::syrk(): trans_A = %c") % trans_A ); blas::syrk ( diff --git a/inst/include/armadillo_bits/newarp_DenseGenMatProd_meat.hpp b/inst/include/armadillo_bits/newarp_DenseGenMatProd_meat.hpp index 89092452..c80b1d2c 100644 --- a/inst/include/armadillo_bits/newarp_DenseGenMatProd_meat.hpp +++ b/inst/include/armadillo_bits/newarp_DenseGenMatProd_meat.hpp @@ -27,7 +27,7 @@ DenseGenMatProd::DenseGenMatProd(const Mat& mat_obj) , n_rows(mat_obj.n_rows) , n_cols(mat_obj.n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -39,7 +39,7 @@ inline void DenseGenMatProd::perform_op(eT* x_in, eT* y_out) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Col x(x_in , n_cols, false, true); Col y(y_out, n_rows, false, true); diff --git a/inst/include/armadillo_bits/newarp_DoubleShiftQR_meat.hpp b/inst/include/armadillo_bits/newarp_DoubleShiftQR_meat.hpp index 1c7497d0..ca29693f 100644 --- a/inst/include/armadillo_bits/newarp_DoubleShiftQR_meat.hpp +++ b/inst/include/armadillo_bits/newarp_DoubleShiftQR_meat.hpp @@ -25,7 +25,7 @@ inline void DoubleShiftQR::compute_reflector(const eT& x1, const eT& x2, const eT& x3, uword ind) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // In general case the reflector affects 3 rows ref_nr(ind) = 3; @@ -71,7 +71,7 @@ arma_inline void DoubleShiftQR::compute_reflector(const eT* x, uword ind) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); compute_reflector(x[0], x[1], x[2], ind); } @@ -83,7 +83,7 @@ inline void DoubleShiftQR::update_block(uword il, uword iu) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // Block size uword bsize = iu - il + 1; @@ -154,7 +154,7 @@ inline void DoubleShiftQR::apply_PX(Mat& X, uword oi, uword oj, uword nrow, uword ncol, uword u_ind) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(ref_nr(u_ind) == 1) { return; } @@ -195,7 +195,7 @@ inline void DoubleShiftQR::apply_PX(eT* x, uword u_ind) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(ref_nr(u_ind) == 1) { return; } @@ -219,7 +219,7 @@ inline void DoubleShiftQR::apply_XP(Mat& X, uword oi, uword oj, uword nrow, uword ncol, uword u_ind) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(ref_nr(u_ind) == 1) { return; } @@ -268,7 +268,7 @@ DoubleShiftQR::DoubleShiftQR(uword size) , eps_abs(prec) , computed(false) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -287,7 +287,7 @@ DoubleShiftQR::DoubleShiftQR(const Mat& mat_obj, eT s, eT t) , eps_abs(prec) , computed(false) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); compute(mat_obj, s, t); } @@ -298,9 +298,9 @@ template void DoubleShiftQR::compute(const Mat& mat_obj, eT s, eT t) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (mat_obj.is_square() == false), "newarp::DoubleShiftQR::compute(): matrix must be square" ); + arma_conform_check( (mat_obj.is_square() == false), "newarp::DoubleShiftQR::compute(): matrix must be square" ); n = mat_obj.n_rows; mat_H.set_size(n, n); @@ -350,9 +350,9 @@ template Mat DoubleShiftQR::matrix_QtHQ() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (computed == false), "newarp::DoubleShiftQR::matrix_QtHQ(): need to call compute() first" ); + arma_conform_check( (computed == false), "newarp::DoubleShiftQR::matrix_QtHQ(): need to call compute() first" ); return mat_H; } @@ -364,9 +364,9 @@ inline void DoubleShiftQR::apply_QtY(Col& y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (computed == false), "newarp::DoubleShiftQR::apply_QtY(): need to call compute() first" ); + arma_conform_check( (computed == false), "newarp::DoubleShiftQR::apply_QtY(): need to call compute() first" ); eT* y_ptr = y.memptr(); for(uword i = 0; i < n - 1; i++, y_ptr++) @@ -382,9 +382,9 @@ inline void DoubleShiftQR::apply_YQ(Mat& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (computed == false), "newarp::DoubleShiftQR::apply_YQ(): need to call compute() first" ); + arma_conform_check( (computed == false), "newarp::DoubleShiftQR::apply_YQ(): need to call compute() first" ); uword nrow = Y.n_rows; for(uword i = 0; i < n - 2; i++) diff --git a/inst/include/armadillo_bits/newarp_GenEigsSolver_meat.hpp b/inst/include/armadillo_bits/newarp_GenEigsSolver_meat.hpp index 290fa4f2..7965415f 100644 --- a/inst/include/armadillo_bits/newarp_GenEigsSolver_meat.hpp +++ b/inst/include/armadillo_bits/newarp_GenEigsSolver_meat.hpp @@ -25,7 +25,7 @@ inline void GenEigsSolver::fill_rand(eT* dest, const uword N, const uword seed_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::mt19937_64::result_type seed_type; @@ -43,7 +43,7 @@ inline void GenEigsSolver::factorise_from(uword from_k, uword to_m, const Col& fk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(to_m <= from_k) { return; } @@ -132,7 +132,7 @@ inline void GenEigsSolver::restart(uword k) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(k >= ncv) { return; } @@ -205,7 +205,7 @@ inline uword GenEigsSolver::num_converged(eT tol) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // thresh = tol * max(prec, abs(theta)), theta for ritz value const eT f_norm = arma::norm(fac_f); @@ -226,7 +226,7 @@ inline uword GenEigsSolver::nev_adjusted(uword nconv) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uword nev_new = nev; @@ -265,7 +265,7 @@ inline void GenEigsSolver::retrieve_ritzpair() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); UpperHessenbergEigen decomp(fac_H); @@ -294,7 +294,7 @@ inline void GenEigsSolver::sort_ritzpair() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // SortEigenvalue< std::complex, EigsSelect::LARGEST_MAGN > sorting(ritz_val.memptr(), nev); @@ -333,10 +333,10 @@ GenEigsSolver::GenEigsSolver(const OpType& op_, uword , eps(std::numeric_limits::epsilon()) , approx0(std::pow(eps, eT(2.0) / 3)) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (nev_ < 1 || nev_ > dim_n - 2), "newarp::GenEigsSolver: nev must satisfy 1 <= nev <= n - 2, n is the size of matrix" ); - arma_debug_check( (ncv_ < nev_ + 2 || ncv_ > dim_n), "newarp::GenEigsSolver: ncv must satisfy nev + 2 <= ncv <= n, n is the size of matrix" ); + arma_conform_check( (nev_ < 1 || nev_ > dim_n - 2), "newarp::GenEigsSolver: nev must satisfy 1 <= nev <= n - 2, n is the size of matrix" ); + arma_conform_check( (ncv_ < nev_ + 2 || ncv_ > dim_n), "newarp::GenEigsSolver: ncv must satisfy nev + 2 <= ncv <= n, n is the size of matrix" ); } @@ -346,7 +346,7 @@ inline void GenEigsSolver::init(eT* init_resid) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // Reset all matrices/vectors to zero fac_V.zeros(dim_n, ncv); @@ -382,7 +382,7 @@ inline void GenEigsSolver::init() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // podarray init_resid(dim_n); // blas_int idist = 2; // Uniform(-1, 1) @@ -405,7 +405,7 @@ inline uword GenEigsSolver::compute(uword maxit, eT tol) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // The m-step Arnoldi factorisation factorise_from(1, ncv, fac_f); @@ -435,7 +435,7 @@ inline Col< std::complex > GenEigsSolver::eigenvalues() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uword nconv = std::count(ritz_conv.begin(), ritz_conv.end(), true); Col< std::complex > res(nconv, arma_zeros_indicator()); @@ -463,7 +463,7 @@ inline Mat< std::complex > GenEigsSolver::eigenvectors(uword nvec) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uword nconv = std::count(ritz_conv.begin(), ritz_conv.end(), true); nvec = (std::min)(nvec, nconv); diff --git a/inst/include/armadillo_bits/newarp_SortEigenvalue.hpp b/inst/include/armadillo_bits/newarp_SortEigenvalue.hpp index 5f2c357e..4df115ef 100644 --- a/inst/include/armadillo_bits/newarp_SortEigenvalue.hpp +++ b/inst/include/armadillo_bits/newarp_SortEigenvalue.hpp @@ -169,7 +169,7 @@ class SortEigenvalue SortEigenvalue(const eT* start, const uword size) : pair_sort(size) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); for(uword i = 0; i < size; i++) { @@ -187,7 +187,7 @@ class SortEigenvalue std::vector index() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword len = pair_sort.size(); diff --git a/inst/include/armadillo_bits/newarp_SparseGenMatProd_meat.hpp b/inst/include/armadillo_bits/newarp_SparseGenMatProd_meat.hpp index bbe539a1..f9c66f83 100644 --- a/inst/include/armadillo_bits/newarp_SparseGenMatProd_meat.hpp +++ b/inst/include/armadillo_bits/newarp_SparseGenMatProd_meat.hpp @@ -27,7 +27,7 @@ SparseGenMatProd::SparseGenMatProd(const SpMat& mat_obj) , n_rows(mat_obj.n_rows) , n_cols(mat_obj.n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); op_mat_st = op_mat.st(); // pre-calculate transpose } @@ -41,7 +41,7 @@ inline void SparseGenMatProd::perform_op(eT* x_in, eT* y_out) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // // OLD METHOD // diff --git a/inst/include/armadillo_bits/newarp_SparseGenRealShiftSolve_meat.hpp b/inst/include/armadillo_bits/newarp_SparseGenRealShiftSolve_meat.hpp index ea206186..0d2cab20 100644 --- a/inst/include/armadillo_bits/newarp_SparseGenRealShiftSolve_meat.hpp +++ b/inst/include/armadillo_bits/newarp_SparseGenRealShiftSolve_meat.hpp @@ -33,7 +33,7 @@ SparseGenRealShiftSolve::SparseGenRealShiftSolve(const SpMat& mat_obj, c , n_cols(0) #endif { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_SUPERLU) { @@ -61,14 +61,14 @@ SparseGenRealShiftSolve::SparseGenRealShiftSolve(const SpMat& mat_obj, c superlu_stat_wrangler stat; - arma_extra_debug_print("superlu::gstrf()"); + arma_debug_print("superlu::gstrf()"); superlu::get_permutation_c(options.ColPerm, x.get_ptr(), perm_c.get_ptr()); superlu::sp_preorder_mat(&options, x.get_ptr(), perm_c.get_ptr(), etree.get_ptr(), xC.get_ptr()); superlu::gstrf(&options, xC.get_ptr(), relax, panel_size, etree.get_ptr(), NULL, lwork, perm_c.get_ptr(), perm_r.get_ptr(), l.get_ptr(), u.get_ptr(), &Glu, stat.get_ptr(), &slu_info); if(slu_info != 0) { - arma_debug_warn_level(2, "matrix is singular to working precision"); + arma_conform_warn(2, "matrix is singular to working precision"); return; } @@ -77,8 +77,8 @@ SparseGenRealShiftSolve::SparseGenRealShiftSolve(const SpMat& mat_obj, c if( (x_rcond < std::numeric_limits::epsilon()) || arma_isnan(x_rcond) ) { - if(x_rcond == eT(0)) { arma_debug_warn_level(2, "matrix is singular to working precision"); } - else { arma_debug_warn_level(2, "matrix is singular to working precision (rcond: ", x_rcond, ")"); } + if(x_rcond == eT(0)) { arma_conform_warn(2, "matrix is singular to working precision"); } + else { arma_conform_warn(2, "matrix is singular to working precision (rcond: ", x_rcond, ")"); } return; } @@ -101,7 +101,7 @@ inline void SparseGenRealShiftSolve::perform_op(eT* x_in, eT* y_out) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_SUPERLU) { @@ -119,7 +119,7 @@ SparseGenRealShiftSolve::perform_op(eT* x_in, eT* y_out) const superlu_stat_wrangler stat; int info = 0; - arma_extra_debug_print("superlu::gstrs()"); + arma_debug_print("superlu::gstrs()"); superlu::gstrs(superlu::NOTRANS, l.get_ptr(), u.get_ptr(), perm_c.get_ptr(), perm_r.get_ptr(), out_slu.get_ptr(), stat.get_ptr(), &info); if(info != 0) { arma_stop_runtime_error("newarp::SparseGenRealShiftSolve::perform_op(): could not solve linear equation"); return; } diff --git a/inst/include/armadillo_bits/newarp_SymEigsShiftSolver_meat.hpp b/inst/include/armadillo_bits/newarp_SymEigsShiftSolver_meat.hpp index bfb29132..a2a6309d 100644 --- a/inst/include/armadillo_bits/newarp_SymEigsShiftSolver_meat.hpp +++ b/inst/include/armadillo_bits/newarp_SymEigsShiftSolver_meat.hpp @@ -25,7 +25,7 @@ inline void SymEigsShiftSolver::sort_ritzpair() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // First transform back the Ritz values, and then sort for(uword i = 0; i < this->nev; i++) @@ -43,7 +43,7 @@ SymEigsShiftSolver::SymEigsShiftSolver(const OpType& : SymEigsSolver::SymEigsSolver(op_, nev_, ncv_) , sigma(sigma_) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } diff --git a/inst/include/armadillo_bits/newarp_SymEigsSolver_meat.hpp b/inst/include/armadillo_bits/newarp_SymEigsSolver_meat.hpp index 2223328c..595b314b 100644 --- a/inst/include/armadillo_bits/newarp_SymEigsSolver_meat.hpp +++ b/inst/include/armadillo_bits/newarp_SymEigsSolver_meat.hpp @@ -25,7 +25,7 @@ inline void SymEigsSolver::fill_rand(eT* dest, const uword N, const uword seed_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::mt19937_64::result_type seed_type; @@ -43,7 +43,7 @@ inline void SymEigsSolver::factorise_from(uword from_k, uword to_m, const Col& fk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(to_m <= from_k) { return; } @@ -157,7 +157,7 @@ inline void SymEigsSolver::restart(uword k) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(k >= ncv) { return; } @@ -212,7 +212,7 @@ inline uword SymEigsSolver::num_converged(eT tol) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // thresh = tol * max(approx0, abs(theta)), theta for ritz value const eT f_norm = norm(fac_f); @@ -233,7 +233,7 @@ inline uword SymEigsSolver::nev_adjusted(uword nconv) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uword nev_new = nev; for(uword i = nev; i < ncv; i++) @@ -262,7 +262,7 @@ inline void SymEigsSolver::retrieve_ritzpair() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); TridiagEigen decomp(fac_H); Col evals = decomp.eigenvalues(); @@ -310,7 +310,7 @@ inline void SymEigsSolver::sort_ritzpair() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // SortEigenvalue sorting(ritz_val.memptr(), nev); @@ -350,10 +350,10 @@ SymEigsSolver::SymEigsSolver(const OpType& op_, uword , eps23(std::pow(eps, eT(2.0) / 3)) , near0(std::numeric_limits::min() * eT(10)) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (nev_ < 1 || nev_ > dim_n - 1), "newarp::SymEigsSolver: nev must satisfy 1 <= nev <= n - 1, n is the size of matrix" ); - arma_debug_check( (ncv_ <= nev_ || ncv_ > dim_n), "newarp::SymEigsSolver: ncv must satisfy nev < ncv <= n, n is the size of matrix" ); + arma_conform_check( (nev_ < 1 || nev_ > dim_n - 1), "newarp::SymEigsSolver: nev must satisfy 1 <= nev <= n - 1, n is the size of matrix" ); + arma_conform_check( (ncv_ <= nev_ || ncv_ > dim_n), "newarp::SymEigsSolver: ncv must satisfy nev < ncv <= n, n is the size of matrix" ); } @@ -363,7 +363,7 @@ inline void SymEigsSolver::init(eT* init_resid) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // Reset all matrices/vectors to zero fac_V.zeros(dim_n, ncv); @@ -403,7 +403,7 @@ inline void SymEigsSolver::init() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // podarray init_resid(dim_n); // blas_int idist = 2; // Uniform(-1, 1) @@ -426,7 +426,7 @@ inline uword SymEigsSolver::compute(uword maxit, eT tol) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // The m-step Arnoldi factorisation factorise_from(1, ncv, fac_f); @@ -456,7 +456,7 @@ inline Col SymEigsSolver::eigenvalues() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uword nconv = std::count(ritz_conv.begin(), ritz_conv.end(), true); Col res(nconv, arma_zeros_indicator()); @@ -481,7 +481,7 @@ inline Mat SymEigsSolver::eigenvectors(uword nvec) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uword nconv = std::count(ritz_conv.begin(), ritz_conv.end(), true); nvec = (std::min)(nvec, nconv); diff --git a/inst/include/armadillo_bits/newarp_TridiagEigen_meat.hpp b/inst/include/armadillo_bits/newarp_TridiagEigen_meat.hpp index b11cfec4..65de5090 100644 --- a/inst/include/armadillo_bits/newarp_TridiagEigen_meat.hpp +++ b/inst/include/armadillo_bits/newarp_TridiagEigen_meat.hpp @@ -26,7 +26,7 @@ TridiagEigen::TridiagEigen() : n(0) , computed(false) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -37,7 +37,7 @@ TridiagEigen::TridiagEigen(const Mat& mat_obj) : n(mat_obj.n_rows) , computed(false) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); compute(mat_obj); } @@ -49,9 +49,9 @@ inline void TridiagEigen::compute(const Mat& mat_obj) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (mat_obj.is_square() == false), "newarp::TridiagEigen::compute(): matrix must be square" ); + arma_conform_check( (mat_obj.is_square() == false), "newarp::TridiagEigen::compute(): matrix must be square" ); n = blas_int(mat_obj.n_rows); @@ -76,7 +76,7 @@ TridiagEigen::compute(const Mat& mat_obj) blas_int iwork_query[2] = {}; blas_int liwork_query = blas_int(-1); - arma_extra_debug_print("lapack::stedc()"); + arma_debug_print("lapack::stedc()"); lapack::stedc(&compz, &n, main_diag.memptr(), sub_diag.memptr(), evecs.memptr(), &n, &work_query[0], &lwork_query, &iwork_query[0], &liwork_query, &info); if(info != 0) { arma_stop_runtime_error("lapack::stedc(): couldn't get size of work arrays"); return; } @@ -91,7 +91,7 @@ TridiagEigen::compute(const Mat& mat_obj) podarray work( static_cast( lwork) ); podarray iwork( static_cast(liwork) ); - arma_extra_debug_print("lapack::stedc()"); + arma_debug_print("lapack::stedc()"); lapack::stedc(&compz, &n, main_diag.memptr(), sub_diag.memptr(), evecs.memptr(), &n, work.memptr(), &lwork, iwork.memptr(), &liwork, &info); if(info != 0) { arma_stop_runtime_error("lapack::stedc(): failed to compute all eigenvalues"); return; } @@ -106,9 +106,9 @@ inline Col TridiagEigen::eigenvalues() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (computed == false), "newarp::TridiagEigen::eigenvalues(): need to call compute() first" ); + arma_conform_check( (computed == false), "newarp::TridiagEigen::eigenvalues(): need to call compute() first" ); // After calling compute(), main_diag will contain the eigenvalues. return main_diag; @@ -121,9 +121,9 @@ inline Mat TridiagEigen::eigenvectors() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (computed == false), "newarp::TridiagEigen::eigenvectors(): need to call compute() first" ); + arma_conform_check( (computed == false), "newarp::TridiagEigen::eigenvectors(): need to call compute() first" ); return evecs; } diff --git a/inst/include/armadillo_bits/newarp_UpperHessenbergEigen_meat.hpp b/inst/include/armadillo_bits/newarp_UpperHessenbergEigen_meat.hpp index a7582059..11c2b598 100644 --- a/inst/include/armadillo_bits/newarp_UpperHessenbergEigen_meat.hpp +++ b/inst/include/armadillo_bits/newarp_UpperHessenbergEigen_meat.hpp @@ -26,7 +26,7 @@ UpperHessenbergEigen::UpperHessenbergEigen() : n_rows(0) , computed(false) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -37,7 +37,7 @@ UpperHessenbergEigen::UpperHessenbergEigen(const Mat& mat_obj) : n_rows(mat_obj.n_rows) , computed(false) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); compute(mat_obj); } @@ -49,9 +49,9 @@ inline void UpperHessenbergEigen::compute(const Mat& mat_obj) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (mat_obj.is_square() == false), "newarp::UpperHessenbergEigen::compute(): matrix must be square" ); + arma_conform_check( (mat_obj.is_square() == false), "newarp::UpperHessenbergEigen::compute(): matrix must be square" ); n_rows = mat_obj.n_rows; @@ -76,7 +76,7 @@ UpperHessenbergEigen::compute(const Mat& mat_obj) podarray wr(n_rows); podarray wi(n_rows); - arma_extra_debug_print("lapack::lahqr()"); + arma_debug_print("lapack::lahqr()"); lapack::lahqr(&want_T, &want_Z, &n, &ilo, &ihi, mat_T.memptr(), &n, wr.memptr(), wi.memptr(), &iloz, &ihiz, mat_Z.memptr(), &n, &info); if(info != 0) { arma_stop_runtime_error("lapack::lahqr(): failed to compute all eigenvalues"); return; } @@ -89,7 +89,7 @@ UpperHessenbergEigen::compute(const Mat& mat_obj) podarray work(3*n); - arma_extra_debug_print("lapack::trevc()"); + arma_debug_print("lapack::trevc()"); lapack::trevc(&side, &howmny, (blas_int*) NULL, &n, mat_T.memptr(), &n, (eT*) NULL, &n, mat_Z.memptr(), &n, &n, &m, work.memptr(), &info); if(info != 0) { arma_stop_runtime_error("lapack::trevc(): illegal value"); return; } @@ -104,9 +104,9 @@ inline Col< std::complex > UpperHessenbergEigen::eigenvalues() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (computed == false), "newarp::UpperHessenbergEigen::eigenvalues(): need to call compute() first" ); + arma_conform_check( (computed == false), "newarp::UpperHessenbergEigen::eigenvalues(): need to call compute() first" ); return evals; } @@ -118,9 +118,9 @@ inline Mat< std::complex > UpperHessenbergEigen::eigenvectors() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (computed == false), "newarp::UpperHessenbergEigen::eigenvectors(): need to call compute() first" ); + arma_conform_check( (computed == false), "newarp::UpperHessenbergEigen::eigenvectors(): need to call compute() first" ); // Lapack will set the imaginary parts of real eigenvalues to be exact zero Mat< std::complex > evecs(n_rows, n_rows, arma_zeros_indicator()); diff --git a/inst/include/armadillo_bits/newarp_UpperHessenbergQR_meat.hpp b/inst/include/armadillo_bits/newarp_UpperHessenbergQR_meat.hpp index c3a6fa8c..e62ffc3b 100644 --- a/inst/include/armadillo_bits/newarp_UpperHessenbergQR_meat.hpp +++ b/inst/include/armadillo_bits/newarp_UpperHessenbergQR_meat.hpp @@ -26,7 +26,7 @@ UpperHessenbergQR::UpperHessenbergQR() : n(0) , computed(false) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -40,7 +40,7 @@ UpperHessenbergQR::UpperHessenbergQR(const Mat& mat_obj) , rot_sin(n - 1) , computed(false) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); compute(mat_obj); } @@ -51,7 +51,7 @@ template void UpperHessenbergQR::compute(const Mat& mat_obj) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); n = mat_obj.n_rows; mat_T.set_size(n, n); @@ -111,9 +111,9 @@ template Mat UpperHessenbergQR::matrix_RQ() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (computed == false), "newarp::UpperHessenbergQR::matrix_RQ(): need to call compute() first" ); + arma_conform_check( (computed == false), "newarp::UpperHessenbergQR::matrix_RQ(): need to call compute() first" ); // Make a copy of the R matrix Mat RQ = trimatu(mat_T); @@ -150,9 +150,9 @@ inline void UpperHessenbergQR::apply_YQ(Mat& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (computed == false), "newarp::UpperHessenbergQR::apply_YQ(): need to call compute() first" ); + arma_conform_check( (computed == false), "newarp::UpperHessenbergQR::apply_YQ(): need to call compute() first" ); eT *Y_col_i, *Y_col_i1; uword nrow = Y.n_rows; @@ -178,7 +178,7 @@ inline TridiagQR::TridiagQR() : UpperHessenbergQR() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -188,7 +188,7 @@ inline TridiagQR::TridiagQR(const Mat& mat_obj) : UpperHessenbergQR() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); this->compute(mat_obj); } @@ -200,7 +200,7 @@ inline void TridiagQR::compute(const Mat& mat_obj) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); this->n = mat_obj.n_rows; this->mat_T.set_size(this->n, this->n); @@ -270,9 +270,9 @@ template Mat TridiagQR::matrix_RQ() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (this->computed == false), "newarp::TridiagQR::matrix_RQ(): need to call compute() first" ); + arma_conform_check( (this->computed == false), "newarp::TridiagQR::matrix_RQ(): need to call compute() first" ); // Make a copy of the R matrix Mat RQ(this->n, this->n, arma_zeros_indicator()); diff --git a/inst/include/armadillo_bits/op_all_meat.hpp b/inst/include/armadillo_bits/op_all_meat.hpp index 5dff3eca..185d4eec 100644 --- a/inst/include/armadillo_bits/op_all_meat.hpp +++ b/inst/include/armadillo_bits/op_all_meat.hpp @@ -27,7 +27,7 @@ inline bool op_all::all_vec_helper(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -69,7 +69,7 @@ inline bool op_all::all_vec_helper(const subview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword X_n_rows = X.n_rows; const uword X_n_cols = X.n_cols; @@ -106,7 +106,7 @@ inline bool op_all::all_vec_helper(const Op& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return op_all::all_vec_helper(X.m); } @@ -123,7 +123,7 @@ op_all::all_vec_helper const typename arma_not_cx::result* junk2 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); @@ -196,7 +196,7 @@ op_all::all_vec_helper const typename arma_not_cx::result* junk3 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); arma_ignore(junk3); @@ -210,13 +210,13 @@ op_all::all_vec_helper const Proxy A(X.A); const Proxy B(X.B); - arma_debug_assert_same_size(A, B, "relational operator"); + arma_conform_assert_same_size(A, B, "relational operator"); const uword n_elem = A.get_n_elem(); uword count = 0; - const bool use_at = (Proxy::use_at || Proxy::use_at); + constexpr bool use_at = (Proxy::use_at || Proxy::use_at); if(use_at == false) { @@ -270,7 +270,7 @@ inline bool op_all::all_vec(T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return op_all::all_vec_helper(X); } @@ -282,7 +282,7 @@ inline void op_all::apply_helper(Mat& out, const Proxy& P, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_rows = P.get_n_rows(); const uword n_cols = P.get_n_cols(); @@ -381,7 +381,7 @@ inline void op_all::apply(Mat& out, const mtOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword dim = X.aux_uword_a; diff --git a/inst/include/armadillo_bits/op_any_meat.hpp b/inst/include/armadillo_bits/op_any_meat.hpp index 3356ec7c..3d5ff8aa 100644 --- a/inst/include/armadillo_bits/op_any_meat.hpp +++ b/inst/include/armadillo_bits/op_any_meat.hpp @@ -27,7 +27,7 @@ inline bool op_any::any_vec_helper(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -66,7 +66,7 @@ inline bool op_any::any_vec_helper(const subview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword X_n_rows = X.n_rows; const uword X_n_cols = X.n_cols; @@ -101,7 +101,7 @@ inline bool op_any::any_vec_helper(const Op& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return op_any::any_vec_helper(X.m); } @@ -118,7 +118,7 @@ op_any::any_vec_helper const typename arma_not_cx::result* junk2 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); @@ -190,7 +190,7 @@ op_any::any_vec_helper const typename arma_not_cx::result* junk3 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); arma_ignore(junk3); @@ -204,9 +204,9 @@ op_any::any_vec_helper const Proxy A(X.A); const Proxy B(X.B); - arma_debug_assert_same_size(A, B, "relational operator"); + arma_conform_assert_same_size(A, B, "relational operator"); - const bool use_at = (Proxy::use_at || Proxy::use_at); + constexpr bool use_at = (Proxy::use_at || Proxy::use_at); if(use_at == false) { @@ -262,7 +262,7 @@ inline bool op_any::any_vec(T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return op_any::any_vec_helper(X); } @@ -274,7 +274,7 @@ inline void op_any::apply_helper(Mat& out, const Proxy& P, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_rows = P.get_n_rows(); const uword n_cols = P.get_n_cols(); @@ -352,7 +352,7 @@ inline void op_any::apply(Mat& out, const mtOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword dim = X.aux_uword_a; diff --git a/inst/include/armadillo_bits/op_chi2rnd_meat.hpp b/inst/include/armadillo_bits/op_chi2rnd_meat.hpp index 1b681ae8..93925832 100644 --- a/inst/include/armadillo_bits/op_chi2rnd_meat.hpp +++ b/inst/include/armadillo_bits/op_chi2rnd_meat.hpp @@ -26,7 +26,7 @@ inline void op_chi2rnd::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -53,7 +53,7 @@ inline void op_chi2rnd::apply_noalias(Mat& out, const Proxy& P) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -94,7 +94,7 @@ inline void op_chi2rnd::fill_constant_df(Mat& out, const eT df) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(df > eT(0)) { @@ -130,7 +130,7 @@ template inline op_chi2rnd_varying_df::~op_chi2rnd_varying_df() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -139,7 +139,7 @@ template inline op_chi2rnd_varying_df::op_chi2rnd_varying_df() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef std::mt19937_64::result_type seed_type; @@ -153,7 +153,7 @@ inline eT op_chi2rnd_varying_df::operator()(const eT df) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // as C++11 doesn't seem to provide a way to explicitly set the parameter // of an existing chi_squared_distribution object, diff --git a/inst/include/armadillo_bits/op_chol_meat.hpp b/inst/include/armadillo_bits/op_chol_meat.hpp index ebc6448b..d565d198 100644 --- a/inst/include/armadillo_bits/op_chol_meat.hpp +++ b/inst/include/armadillo_bits/op_chol_meat.hpp @@ -26,7 +26,7 @@ inline void op_chol::apply(Mat& out, const Op& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_chol::apply_direct(out, X.m, X.aux_uword_a); @@ -44,20 +44,20 @@ inline bool op_chol::apply_direct(Mat& out, const Base& A_expr, const uword layout) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; out = A_expr.get_ref(); - arma_debug_check( (out.is_square() == false), "chol(): given matrix must be square sized", [&](){ out.soft_reset(); } ); + arma_conform_check( (out.is_square() == false), "chol(): given matrix must be square sized", [&](){ out.soft_reset(); } ); if(out.is_empty()) { return true; } - if((arma_config::debug) && (auxlib::rudimentary_sym_check(out) == false)) + if((arma_config::check_conformance) && (auxlib::rudimentary_sym_check(out) == false)) { - if(is_cx::no ) { arma_debug_warn_level(1, "chol(): given matrix is not symmetric"); } - if(is_cx::yes) { arma_debug_warn_level(1, "chol(): given matrix is not hermitian"); } + if(is_cx::no ) { arma_conform_warn(1, "chol(): given matrix is not symmetric"); } + if(is_cx::yes) { arma_conform_warn(1, "chol(): given matrix is not hermitian"); } } uword KD = 0; diff --git a/inst/include/armadillo_bits/op_clamp_meat.hpp b/inst/include/armadillo_bits/op_clamp_meat.hpp index a14cd788..d479e4eb 100644 --- a/inst/include/armadillo_bits/op_clamp_meat.hpp +++ b/inst/include/armadillo_bits/op_clamp_meat.hpp @@ -27,14 +27,14 @@ inline void op_clamp::apply(Mat& out, const mtOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const eT min_val = in.aux; const eT max_val = in.aux_out_eT; - arma_debug_check( (min_val > max_val), "clamp(): min_val must be less than max_val" ); + arma_conform_check( (min_val > max_val), "clamp(): min_val must be less than max_val" ); if(is_Mat::value) { @@ -68,7 +68,7 @@ inline void op_clamp::apply_direct(Mat& out, const Mat& X, const eT min_val, const eT max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(&out != &X) { @@ -88,7 +88,7 @@ op_clamp::apply_direct(Mat& out, const Mat& X, const eT min_val, const e } else { - arma_extra_debug_print("op_clamp::apply_direct(): inplace operation"); + arma_debug_print("op_clamp::apply_direct(): inplace operation"); arrayops::clamp(out.memptr(), out.n_elem, min_val, max_val); } @@ -101,7 +101,7 @@ inline void op_clamp::apply_proxy_noalias(Mat& out, const Proxy& P, const typename T1::elem_type min_val, const typename T1::elem_type max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -150,14 +150,14 @@ inline void op_clamp::apply(Cube& out, const mtOpCube& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const eT min_val = in.aux; const eT max_val = in.aux_out_eT; - arma_debug_check( (min_val > max_val), "clamp(): min_val must be less than max_val" ); + arma_conform_check( (min_val > max_val), "clamp(): min_val must be less than max_val" ); if(is_Cube::value) { @@ -191,7 +191,7 @@ inline void op_clamp::apply_direct(Cube& out, const Cube& X, const eT min_val, const eT max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(&out != &X) { @@ -211,7 +211,7 @@ op_clamp::apply_direct(Cube& out, const Cube& X, const eT min_val, const } else { - arma_extra_debug_print("op_clamp::apply_direct(): inplace operation"); + arma_debug_print("op_clamp::apply_direct(): inplace operation"); arrayops::clamp(out.memptr(), out.n_elem, min_val, max_val); } @@ -224,7 +224,7 @@ inline void op_clamp::apply_proxy_noalias(Cube& out, const ProxyCube& P, const typename T1::elem_type min_val, const typename T1::elem_type max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -275,7 +275,7 @@ inline void op_clamp_cx::apply(Mat& out, const mtOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -311,7 +311,7 @@ inline void op_clamp_cx::apply_direct(Mat& out, const Mat& X, const eT min_val, const eT max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -321,8 +321,8 @@ op_clamp_cx::apply_direct(Mat& out, const Mat& X, const eT min_val, cons const T max_val_real = std::real(max_val); const T max_val_imag = std::imag(max_val); - arma_debug_check( (min_val_real > max_val_real), "clamp(): real(min_val) must be less than real(max_val)" ); - arma_debug_check( (min_val_imag > max_val_imag), "clamp(): imag(min_val) must be less than imag(max_val)" ); + arma_conform_check( (min_val_real > max_val_real), "clamp(): real(min_val) must be less than real(max_val)" ); + arma_conform_check( (min_val_imag > max_val_imag), "clamp(): imag(min_val) must be less than imag(max_val)" ); if(&out != &X) { @@ -348,7 +348,7 @@ op_clamp_cx::apply_direct(Mat& out, const Mat& X, const eT min_val, cons } else { - arma_extra_debug_print("op_clamp_cx::apply_direct(): inplace operation"); + arma_debug_print("op_clamp_cx::apply_direct(): inplace operation"); arrayops::clamp(out.memptr(), out.n_elem, min_val, max_val); } @@ -361,7 +361,7 @@ inline void op_clamp_cx::apply_proxy_noalias(Mat& out, const Proxy& P, const typename T1::elem_type min_val, const typename T1::elem_type max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; @@ -372,8 +372,8 @@ op_clamp_cx::apply_proxy_noalias(Mat& out, const Proxy max_val_real), "clamp(): real(min_val) must be less than real(max_val)" ); - arma_debug_check( (min_val_imag > max_val_imag), "clamp(): imag(min_val) must be less than imag(max_val)" ); + arma_conform_check( (min_val_real > max_val_real), "clamp(): real(min_val) must be less than real(max_val)" ); + arma_conform_check( (min_val_imag > max_val_imag), "clamp(): imag(min_val) must be less than imag(max_val)" ); const uword n_rows = P.get_n_rows(); const uword n_cols = P.get_n_cols(); @@ -428,7 +428,7 @@ inline void op_clamp_cx::apply(Cube& out, const mtOpCube& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -464,7 +464,7 @@ inline void op_clamp_cx::apply_direct(Cube& out, const Cube& X, const eT min_val, const eT max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -474,8 +474,8 @@ op_clamp_cx::apply_direct(Cube& out, const Cube& X, const eT min_val, co const T max_val_real = std::real(max_val); const T max_val_imag = std::imag(max_val); - arma_debug_check( (min_val_real > max_val_real), "clamp(): real(min_val) must be less than real(max_val)" ); - arma_debug_check( (min_val_imag > max_val_imag), "clamp(): imag(min_val) must be less than imag(max_val)" ); + arma_conform_check( (min_val_real > max_val_real), "clamp(): real(min_val) must be less than real(max_val)" ); + arma_conform_check( (min_val_imag > max_val_imag), "clamp(): imag(min_val) must be less than imag(max_val)" ); if(&out != &X) { @@ -501,7 +501,7 @@ op_clamp_cx::apply_direct(Cube& out, const Cube& X, const eT min_val, co } else { - arma_extra_debug_print("op_clamp_cx::apply_direct(): inplace operation"); + arma_debug_print("op_clamp_cx::apply_direct(): inplace operation"); arrayops::clamp(out.memptr(), out.n_elem, min_val, max_val); } @@ -514,7 +514,7 @@ inline void op_clamp_cx::apply_proxy_noalias(Cube& out, const ProxyCube& P, const typename T1::elem_type min_val, const typename T1::elem_type max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; @@ -525,8 +525,8 @@ op_clamp_cx::apply_proxy_noalias(Cube& out, const ProxyC const T max_val_real = std::real(max_val); const T max_val_imag = std::imag(max_val); - arma_debug_check( (min_val_real > max_val_real), "clamp(): real(min_val) must be less than real(max_val)" ); - arma_debug_check( (min_val_imag > max_val_imag), "clamp(): imag(min_val) must be less than imag(max_val)" ); + arma_conform_check( (min_val_real > max_val_real), "clamp(): real(min_val) must be less than real(max_val)" ); + arma_conform_check( (min_val_imag > max_val_imag), "clamp(): imag(min_val) must be less than imag(max_val)" ); const uword n_rows = P.get_n_rows(); const uword n_cols = P.get_n_cols(); diff --git a/inst/include/armadillo_bits/op_col_as_mat_meat.hpp b/inst/include/armadillo_bits/op_col_as_mat_meat.hpp index 2e0f0cdf..403191ed 100644 --- a/inst/include/armadillo_bits/op_col_as_mat_meat.hpp +++ b/inst/include/armadillo_bits/op_col_as_mat_meat.hpp @@ -26,7 +26,7 @@ inline void op_col_as_mat::apply(Mat& out, const CubeToMatOp& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -35,7 +35,7 @@ op_col_as_mat::apply(Mat& out, const CubeToMatOp= A.n_cols), "Cube::col_as_mat(): index out of bounds" ); + arma_conform_check_bounds( (in_col >= A.n_cols), "Cube::col_as_mat(): index out of bounds" ); const uword A_n_rows = A.n_rows; const uword A_n_slices = A.n_slices; diff --git a/inst/include/armadillo_bits/op_cond_meat.hpp b/inst/include/armadillo_bits/op_cond_meat.hpp index f73ef9a3..295f2121 100644 --- a/inst/include/armadillo_bits/op_cond_meat.hpp +++ b/inst/include/armadillo_bits/op_cond_meat.hpp @@ -26,7 +26,7 @@ inline typename T1::pod_type op_cond::apply(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; @@ -37,7 +37,7 @@ op_cond::apply(const Base& X) if(is_op_diagmat::value || A.is_diagmat()) { - arma_extra_debug_print("op_cond::apply(): detected diagonal matrix"); + arma_debug_print("op_cond::apply(): detected diagonal matrix"); return op_cond::apply_diag(A); } @@ -51,7 +51,7 @@ op_cond::apply(const Base& X) if(do_sym) { - arma_extra_debug_print("op_cond: symmetric/hermitian optimisation"); + arma_debug_print("op_cond: symmetric/hermitian optimisation"); return op_cond::apply_sym(A); } @@ -66,7 +66,7 @@ inline typename get_pod_type::result op_cond::apply_diag(const Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -81,7 +81,7 @@ op_cond::apply_diag(const Mat& A) if(arma_isnan(abs_val)) { - arma_debug_warn_level(3, "cond(): failed"); + arma_conform_warn(3, "cond(): failed"); return Datum::nan; } @@ -102,7 +102,7 @@ inline typename get_pod_type::result op_cond::apply_sym(Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -112,7 +112,7 @@ op_cond::apply_sym(Mat& A) if(status == false) { - arma_debug_warn_level(3, "cond(): failed"); + arma_conform_warn(3, "cond(): failed"); return Datum::nan; } @@ -144,7 +144,7 @@ inline typename get_pod_type::result op_cond::apply_gen(Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -154,7 +154,7 @@ op_cond::apply_gen(Mat& A) if(status == false) { - arma_debug_warn_level(3, "cond(): failed"); + arma_conform_warn(3, "cond(): failed"); return Datum::nan; } diff --git a/inst/include/armadillo_bits/op_cor_meat.hpp b/inst/include/armadillo_bits/op_cor_meat.hpp index 6763964d..e9b9cdbe 100644 --- a/inst/include/armadillo_bits/op_cor_meat.hpp +++ b/inst/include/armadillo_bits/op_cor_meat.hpp @@ -27,7 +27,7 @@ inline void op_cor::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -73,7 +73,7 @@ inline void op_cor::apply(Mat& out, const Op< Op, op_cor>& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/op_cov_meat.hpp b/inst/include/armadillo_bits/op_cov_meat.hpp index 30944b75..08afb822 100644 --- a/inst/include/armadillo_bits/op_cov_meat.hpp +++ b/inst/include/armadillo_bits/op_cov_meat.hpp @@ -27,7 +27,7 @@ inline void op_cov::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -62,7 +62,7 @@ inline void op_cov::apply(Mat& out, const Op< Op, op_cov>& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/op_cumprod_meat.hpp b/inst/include/armadillo_bits/op_cumprod_meat.hpp index 14dc2245..fa49b243 100644 --- a/inst/include/armadillo_bits/op_cumprod_meat.hpp +++ b/inst/include/armadillo_bits/op_cumprod_meat.hpp @@ -26,7 +26,7 @@ inline void op_cumprod::apply_noalias(Mat& out, const Mat& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uword n_rows = X.n_rows; uword n_cols = X.n_cols; @@ -115,13 +115,13 @@ inline void op_cumprod::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const uword dim = in.aux_uword_a; - arma_debug_check( (dim > 1), "cumprod(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "cumprod(): parameter 'dim' must be 0 or 1" ); const quasi_unwrap U(in.m); @@ -146,7 +146,7 @@ inline void op_cumprod_vec::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/op_cumsum_meat.hpp b/inst/include/armadillo_bits/op_cumsum_meat.hpp index d46eda2b..8552ae18 100644 --- a/inst/include/armadillo_bits/op_cumsum_meat.hpp +++ b/inst/include/armadillo_bits/op_cumsum_meat.hpp @@ -26,7 +26,7 @@ inline void op_cumsum::apply_noalias(Mat& out, const Mat& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uword n_rows = X.n_rows; uword n_cols = X.n_cols; @@ -115,13 +115,13 @@ inline void op_cumsum::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const uword dim = in.aux_uword_a; - arma_debug_check( (dim > 1), "cumsum(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "cumsum(): parameter 'dim' must be 0 or 1" ); const quasi_unwrap U(in.m); @@ -146,7 +146,7 @@ inline void op_cumsum_vec::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/op_cx_scalar_meat.hpp b/inst/include/armadillo_bits/op_cx_scalar_meat.hpp index 9552c01a..5b56cc1d 100644 --- a/inst/include/armadillo_bits/op_cx_scalar_meat.hpp +++ b/inst/include/armadillo_bits/op_cx_scalar_meat.hpp @@ -30,7 +30,7 @@ op_cx_scalar_times::apply const mtOp, T1, op_cx_scalar_times>& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; @@ -74,7 +74,7 @@ op_cx_scalar_plus::apply const mtOp, T1, op_cx_scalar_plus>& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; @@ -118,7 +118,7 @@ op_cx_scalar_minus_pre::apply const mtOp, T1, op_cx_scalar_minus_pre>& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; @@ -162,7 +162,7 @@ op_cx_scalar_minus_post::apply const mtOp, T1, op_cx_scalar_minus_post>& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; @@ -206,7 +206,7 @@ op_cx_scalar_div_pre::apply const mtOp, T1, op_cx_scalar_div_pre>& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; @@ -250,7 +250,7 @@ op_cx_scalar_div_post::apply const mtOp, T1, op_cx_scalar_div_post>& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; @@ -300,7 +300,7 @@ op_cx_scalar_times::apply const mtOpCube, T1, op_cx_scalar_times>& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; @@ -345,7 +345,7 @@ op_cx_scalar_plus::apply const mtOpCube, T1, op_cx_scalar_plus>& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; @@ -390,7 +390,7 @@ op_cx_scalar_minus_pre::apply const mtOpCube, T1, op_cx_scalar_minus_pre>& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; @@ -435,7 +435,7 @@ op_cx_scalar_minus_post::apply const mtOpCube, T1, op_cx_scalar_minus_post>& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; @@ -480,7 +480,7 @@ op_cx_scalar_div_pre::apply const mtOpCube, T1, op_cx_scalar_div_pre>& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; @@ -525,7 +525,7 @@ op_cx_scalar_div_post::apply const mtOpCube, T1, op_cx_scalar_div_post>& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; diff --git a/inst/include/armadillo_bits/op_det_meat.hpp b/inst/include/armadillo_bits/op_det_meat.hpp index 81c9b399..a69cd59a 100644 --- a/inst/include/armadillo_bits/op_det_meat.hpp +++ b/inst/include/armadillo_bits/op_det_meat.hpp @@ -26,7 +26,7 @@ inline bool op_det::apply_direct(typename T1::elem_type& out_val, const Base& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; @@ -51,7 +51,7 @@ op_det::apply_direct(typename T1::elem_type& out_val, const Base A(expr.get_ref()); - arma_debug_check( (A.is_square() == false), "det(): given matrix must be square sized" ); + arma_conform_check( (A.is_square() == false), "det(): given matrix must be square sized" ); const uword N = A.n_rows; @@ -92,13 +92,13 @@ inline typename T1::elem_type op_det::apply_diagmat(const Base& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const diagmat_proxy A(expr.get_ref()); - arma_debug_check( (A.n_rows != A.n_cols), "det(): given matrix must be square sized" ); + arma_conform_check( (A.n_rows != A.n_cols), "det(): given matrix must be square sized" ); const uword N = (std::min)(A.n_rows, A.n_cols); @@ -116,7 +116,7 @@ inline typename T1::elem_type op_det::apply_trimat(const Base& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -124,7 +124,7 @@ op_det::apply_trimat(const Base& expr) const uword N = P.get_n_rows(); - arma_debug_check( (N != P.get_n_cols()), "det(): given matrix must be square sized" ); + arma_conform_check( (N != P.get_n_cols()), "det(): given matrix must be square sized" ); eT val = eT(1); @@ -140,7 +140,7 @@ inline eT op_det::apply_tiny_2x2(const Mat& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const eT* Xm = X.memptr(); @@ -154,7 +154,7 @@ inline eT op_det::apply_tiny_3x3(const Mat& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const eT* Xm = X.memptr(); diff --git a/inst/include/armadillo_bits/op_diagmat_meat.hpp b/inst/include/armadillo_bits/op_diagmat_meat.hpp index 727da7bb..93f865ea 100644 --- a/inst/include/armadillo_bits/op_diagmat_meat.hpp +++ b/inst/include/armadillo_bits/op_diagmat_meat.hpp @@ -26,7 +26,7 @@ inline void op_diagmat::apply(Mat& out, const Op& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -109,7 +109,7 @@ inline void op_diagmat::apply(Mat& out, const Proxy& P) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_rows = P.get_n_rows(); const uword n_cols = P.get_n_cols(); @@ -158,7 +158,7 @@ inline void op_diagmat::apply(Mat& out, const Op< Glue, op_diagmat>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); op_diagmat::apply_times(out, X.m.A, X.m.B); } @@ -170,7 +170,7 @@ inline void op_diagmat::apply_times(Mat& actual_out, const T1& X, const T2& Y, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; @@ -181,10 +181,10 @@ op_diagmat::apply_times(Mat& actual_out, const T1& X, co const typename partial_unwrap::stored_type& A = UA.M; const typename partial_unwrap::stored_type& B = UB.M; - arma_debug_assert_trans_mul_size< partial_unwrap::do_trans, partial_unwrap::do_trans >(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication"); + arma_conform_assert_trans_mul_size< partial_unwrap::do_trans, partial_unwrap::do_trans >(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication"); - const bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; - const eT alpha = use_alpha ? (UA.get_val() * UB.get_val()) : eT(0); + constexpr bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; + const eT alpha = use_alpha ? (UA.get_val() * UB.get_val()) : eT(0); const uword A_n_rows = A.n_rows; const uword A_n_cols = A.n_cols; @@ -198,7 +198,7 @@ op_diagmat::apply_times(Mat& actual_out, const T1& X, co { if((A_n_rows == 1) || (B_n_cols == 1)) { - arma_extra_debug_print("trans_A = false; trans_B = false; vector result"); + arma_debug_print("trans_A = false; trans_B = false; vector result"); const Mat C = A*B; const eT* C_mem = C.memptr(); @@ -216,7 +216,7 @@ op_diagmat::apply_times(Mat& actual_out, const T1& X, co { if((A_n_cols == 1) || (B_n_cols == 1)) { - arma_extra_debug_print("trans_A = true; trans_B = false; vector result"); + arma_debug_print("trans_A = true; trans_B = false; vector result"); const Mat C = trans(A)*B; const eT* C_mem = C.memptr(); @@ -234,7 +234,7 @@ op_diagmat::apply_times(Mat& actual_out, const T1& X, co { if((A_n_rows == 1) || (B_n_rows == 1)) { - arma_extra_debug_print("trans_A = false; trans_B = true; vector result"); + arma_debug_print("trans_A = false; trans_B = true; vector result"); const Mat C = A*trans(B); const eT* C_mem = C.memptr(); @@ -252,7 +252,7 @@ op_diagmat::apply_times(Mat& actual_out, const T1& X, co { if((A_n_cols == 1) || (B_n_rows == 1)) { - arma_extra_debug_print("trans_A = true; trans_B = true; vector result"); + arma_debug_print("trans_A = true; trans_B = true; vector result"); const Mat C = trans(A)*trans(B); const eT* C_mem = C.memptr(); @@ -275,7 +275,7 @@ op_diagmat::apply_times(Mat& actual_out, const T1& X, co if( (partial_unwrap::do_trans == false) && (partial_unwrap::do_trans == false) ) { - arma_extra_debug_print("trans_A = false; trans_B = false; matrix result"); + arma_debug_print("trans_A = false; trans_B = false; matrix result"); out.zeros(A_n_rows, B_n_cols); @@ -318,7 +318,7 @@ op_diagmat::apply_times(Mat& actual_out, const T1& X, co else if( (partial_unwrap::do_trans == true ) && (partial_unwrap::do_trans == false) ) { - arma_extra_debug_print("trans_A = true; trans_B = false; matrix result"); + arma_debug_print("trans_A = true; trans_B = false; matrix result"); out.zeros(A_n_cols, B_n_cols); @@ -339,7 +339,7 @@ op_diagmat::apply_times(Mat& actual_out, const T1& X, co else if( (partial_unwrap::do_trans == false) && (partial_unwrap::do_trans == true ) ) { - arma_extra_debug_print("trans_A = false; trans_B = true; matrix result"); + arma_debug_print("trans_A = false; trans_B = true; matrix result"); out.zeros(A_n_rows, B_n_rows); @@ -362,7 +362,7 @@ op_diagmat::apply_times(Mat& actual_out, const T1& X, co else if( (partial_unwrap::do_trans == true ) && (partial_unwrap::do_trans == true ) ) { - arma_extra_debug_print("trans_A = true; trans_B = true; matrix result"); + arma_debug_print("trans_A = true; trans_B = true; matrix result"); out.zeros(A_n_cols, B_n_rows); @@ -395,7 +395,7 @@ inline void op_diagmat::apply_times(Mat& actual_out, const T1& X, const T2& Y, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::pod_type T; @@ -407,10 +407,10 @@ op_diagmat::apply_times(Mat& actual_out, const T1& X, co const typename partial_unwrap::stored_type& A = UA.M; const typename partial_unwrap::stored_type& B = UB.M; - arma_debug_assert_trans_mul_size< partial_unwrap::do_trans, partial_unwrap::do_trans >(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication"); + arma_conform_assert_trans_mul_size< partial_unwrap::do_trans, partial_unwrap::do_trans >(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication"); - const bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; - const eT alpha = use_alpha ? (UA.get_val() * UB.get_val()) : eT(0); + constexpr bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; + const eT alpha = use_alpha ? (UA.get_val() * UB.get_val()) : eT(0); const uword A_n_rows = A.n_rows; const uword A_n_cols = A.n_cols; @@ -424,7 +424,7 @@ op_diagmat::apply_times(Mat& actual_out, const T1& X, co { if((A_n_rows == 1) || (B_n_cols == 1)) { - arma_extra_debug_print("trans_A = false; trans_B = false; vector result"); + arma_debug_print("trans_A = false; trans_B = false; vector result"); const Mat C = A*B; const eT* C_mem = C.memptr(); @@ -442,7 +442,7 @@ op_diagmat::apply_times(Mat& actual_out, const T1& X, co { if((A_n_cols == 1) || (B_n_cols == 1)) { - arma_extra_debug_print("trans_A = true; trans_B = false; vector result"); + arma_debug_print("trans_A = true; trans_B = false; vector result"); const Mat C = trans(A)*B; const eT* C_mem = C.memptr(); @@ -460,7 +460,7 @@ op_diagmat::apply_times(Mat& actual_out, const T1& X, co { if((A_n_rows == 1) || (B_n_rows == 1)) { - arma_extra_debug_print("trans_A = false; trans_B = true; vector result"); + arma_debug_print("trans_A = false; trans_B = true; vector result"); const Mat C = A*trans(B); const eT* C_mem = C.memptr(); @@ -478,7 +478,7 @@ op_diagmat::apply_times(Mat& actual_out, const T1& X, co { if((A_n_cols == 1) || (B_n_rows == 1)) { - arma_extra_debug_print("trans_A = true; trans_B = true; vector result"); + arma_debug_print("trans_A = true; trans_B = true; vector result"); const Mat C = trans(A)*trans(B); const eT* C_mem = C.memptr(); @@ -501,7 +501,7 @@ op_diagmat::apply_times(Mat& actual_out, const T1& X, co if( (partial_unwrap::do_trans == false) && (partial_unwrap::do_trans == false) ) { - arma_extra_debug_print("trans_A = false; trans_B = false; matrix result"); + arma_debug_print("trans_A = false; trans_B = false; matrix result"); out.zeros(A_n_rows, B_n_cols); @@ -541,7 +541,7 @@ op_diagmat::apply_times(Mat& actual_out, const T1& X, co else if( (partial_unwrap::do_trans == true) && (partial_unwrap::do_trans == false) ) { - arma_extra_debug_print("trans_A = true; trans_B = false; matrix result"); + arma_debug_print("trans_A = true; trans_B = false; matrix result"); out.zeros(A_n_cols, B_n_cols); @@ -584,7 +584,7 @@ op_diagmat::apply_times(Mat& actual_out, const T1& X, co else if( (partial_unwrap::do_trans == false) && (partial_unwrap::do_trans == true) ) { - arma_extra_debug_print("trans_A = false; trans_B = true; matrix result"); + arma_debug_print("trans_A = false; trans_B = true; matrix result"); out.zeros(A_n_rows, B_n_rows); @@ -622,7 +622,7 @@ op_diagmat::apply_times(Mat& actual_out, const T1& X, co else if( (partial_unwrap::do_trans == true) && (partial_unwrap::do_trans == true) ) { - arma_extra_debug_print("trans_A = true; trans_B = true; matrix result"); + arma_debug_print("trans_A = true; trans_B = true; matrix result"); out.zeros(A_n_cols, B_n_rows); @@ -676,7 +676,7 @@ inline void op_diagmat2::apply(Mat& out, const Op& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -706,7 +706,7 @@ inline void op_diagmat2::apply(Mat& out, const Proxy& P, const uword row_offset, const uword col_offset) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_rows = P.get_n_rows(); const uword n_cols = P.get_n_cols(); @@ -742,7 +742,7 @@ op_diagmat2::apply(Mat& out, const Proxy& P, const u } else // P represents a matrix { - arma_debug_check_bounds + arma_conform_check_bounds ( ((row_offset > 0) && (row_offset >= n_rows)) || ((col_offset > 0) && (col_offset >= n_cols)), "diagmat(): requested diagonal out of bounds" diff --git a/inst/include/armadillo_bits/op_diagvec_meat.hpp b/inst/include/armadillo_bits/op_diagvec_meat.hpp index f3371928..5312e55a 100644 --- a/inst/include/armadillo_bits/op_diagvec_meat.hpp +++ b/inst/include/armadillo_bits/op_diagvec_meat.hpp @@ -26,7 +26,7 @@ inline void op_diagvec::apply(Mat& out, const Op& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -53,7 +53,7 @@ inline void op_diagvec::apply_proxy(Mat& out, const Proxy& P) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -89,7 +89,7 @@ inline void op_diagvec::apply(Mat& actual_out, const Op< Glue, op_diagvec>& X, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; @@ -100,12 +100,12 @@ op_diagvec::apply(Mat& actual_out, const Op< Glue::stored_type& A = UA.M; const typename partial_unwrap::stored_type& B = UB.M; - arma_debug_assert_trans_mul_size< partial_unwrap::do_trans, partial_unwrap::do_trans >(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication"); + arma_conform_assert_trans_mul_size< partial_unwrap::do_trans, partial_unwrap::do_trans >(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication"); if( (A.n_elem == 0) || (B.n_elem == 0) ) { actual_out.reset(); return; } - const bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; - const eT alpha = use_alpha ? (UA.get_val() * UB.get_val()) : eT(0); + constexpr bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; + const eT alpha = use_alpha ? (UA.get_val() * UB.get_val()) : eT(0); const bool is_alias = (UA.is_alias(actual_out) || UB.is_alias(actual_out)); @@ -120,7 +120,7 @@ op_diagvec::apply(Mat& actual_out, const Op< Glue::do_trans == false) && (partial_unwrap::do_trans == false) ) { - arma_extra_debug_print("trans_A = false; trans_B = false;"); + arma_debug_print("trans_A = false; trans_B = false;"); const uword N = (std::min)(A_n_rows, B_n_cols); @@ -165,7 +165,7 @@ op_diagvec::apply(Mat& actual_out, const Op< Glue::do_trans == true ) && (partial_unwrap::do_trans == false) ) { - arma_extra_debug_print("trans_A = true; trans_B = false;"); + arma_debug_print("trans_A = true; trans_B = false;"); const uword N = (std::min)(A_n_cols, B_n_cols); @@ -188,7 +188,7 @@ op_diagvec::apply(Mat& actual_out, const Op< Glue::do_trans == false) && (partial_unwrap::do_trans == true ) ) { - arma_extra_debug_print("trans_A = false; trans_B = true;"); + arma_debug_print("trans_A = false; trans_B = true;"); const uword N = (std::min)(A_n_rows, B_n_rows); @@ -213,7 +213,7 @@ op_diagvec::apply(Mat& actual_out, const Op< Glue::do_trans == true ) && (partial_unwrap::do_trans == true ) ) { - arma_extra_debug_print("trans_A = true; trans_B = true;"); + arma_debug_print("trans_A = true; trans_B = true;"); const uword N = (std::min)(A_n_cols, B_n_rows); @@ -248,7 +248,7 @@ inline void op_diagvec::apply(Mat& actual_out, const Op< Glue, op_diagvec>& X, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::pod_type T; @@ -260,12 +260,12 @@ op_diagvec::apply(Mat& actual_out, const Op< Glue::stored_type& A = UA.M; const typename partial_unwrap::stored_type& B = UB.M; - arma_debug_assert_trans_mul_size< partial_unwrap::do_trans, partial_unwrap::do_trans >(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication"); + arma_conform_assert_trans_mul_size< partial_unwrap::do_trans, partial_unwrap::do_trans >(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication"); if( (A.n_elem == 0) || (B.n_elem == 0) ) { actual_out.reset(); return; } - const bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; - const eT alpha = use_alpha ? (UA.get_val() * UB.get_val()) : eT(0); + constexpr bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; + const eT alpha = use_alpha ? (UA.get_val() * UB.get_val()) : eT(0); const bool is_alias = (UA.is_alias(actual_out) || UB.is_alias(actual_out)); @@ -280,7 +280,7 @@ op_diagvec::apply(Mat& actual_out, const Op< Glue::do_trans == false) && (partial_unwrap::do_trans == false) ) { - arma_extra_debug_print("trans_A = false; trans_B = false;"); + arma_debug_print("trans_A = false; trans_B = false;"); const uword N = (std::min)(A_n_rows, B_n_cols); @@ -322,7 +322,7 @@ op_diagvec::apply(Mat& actual_out, const Op< Glue::do_trans == true) && (partial_unwrap::do_trans == false) ) { - arma_extra_debug_print("trans_A = true; trans_B = false;"); + arma_debug_print("trans_A = true; trans_B = false;"); const uword N = (std::min)(A_n_cols, B_n_cols); @@ -367,7 +367,7 @@ op_diagvec::apply(Mat& actual_out, const Op< Glue::do_trans == false) && (partial_unwrap::do_trans == true) ) { - arma_extra_debug_print("trans_A = false; trans_B = true;"); + arma_debug_print("trans_A = false; trans_B = true;"); const uword N = (std::min)(A_n_rows, B_n_rows); @@ -407,7 +407,7 @@ op_diagvec::apply(Mat& actual_out, const Op< Glue::do_trans == true) && (partial_unwrap::do_trans == true) ) { - arma_extra_debug_print("trans_A = true; trans_B = true;"); + arma_debug_print("trans_A = true; trans_B = true;"); const uword N = (std::min)(A_n_cols, B_n_rows); @@ -463,7 +463,7 @@ inline void op_diagvec2::apply(Mat& out, const Op& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -496,14 +496,14 @@ inline void op_diagvec2::apply_proxy(Mat& out, const Proxy& P, const uword row_offset, const uword col_offset) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const uword n_rows = P.get_n_rows(); const uword n_cols = P.get_n_cols(); - arma_debug_check_bounds + arma_conform_check_bounds ( ((row_offset > 0) && (row_offset >= n_rows)) || ((col_offset > 0) && (col_offset >= n_cols)), "diagvec(): requested diagonal is out of bounds" diff --git a/inst/include/armadillo_bits/op_diff_meat.hpp b/inst/include/armadillo_bits/op_diff_meat.hpp index a5b309b6..8baff88b 100644 --- a/inst/include/armadillo_bits/op_diff_meat.hpp +++ b/inst/include/armadillo_bits/op_diff_meat.hpp @@ -25,7 +25,7 @@ inline void op_diff::apply_noalias(Mat& out, const Mat& X, const uword k, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uword n_rows = X.n_rows; uword n_cols = X.n_cols; @@ -158,14 +158,14 @@ inline void op_diff::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const uword k = in.aux_uword_a; const uword dim = in.aux_uword_b; - arma_debug_check( (dim > 1), "diff(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "diff(): parameter 'dim' must be 0 or 1" ); if(k == 0) { out = in.m; return; } @@ -192,7 +192,7 @@ inline void op_diff_vec::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/op_dot_meat.hpp b/inst/include/armadillo_bits/op_dot_meat.hpp index e94c76d8..ec462cbe 100644 --- a/inst/include/armadillo_bits/op_dot_meat.hpp +++ b/inst/include/armadillo_bits/op_dot_meat.hpp @@ -27,7 +27,7 @@ arma_inline typename arma_not_cx::result op_dot::direct_dot_arma(const uword n_elem, const eT* const A, const eT* const B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(__FAST_MATH__) { @@ -71,7 +71,7 @@ inline typename arma_cx_only::result op_dot::direct_dot_arma(const uword n_elem, const eT* const A, const eT* const B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -104,7 +104,7 @@ inline typename arma_real_only::result op_dot::direct_dot(const uword n_elem, const eT* const A, const eT* const B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if( n_elem <= 32u ) { @@ -114,13 +114,13 @@ op_dot::direct_dot(const uword n_elem, const eT* const A, const eT* const B) { #if defined(ARMA_USE_ATLAS) { - arma_extra_debug_print("atlas::cblas_dot()"); + arma_debug_print("atlas::cblas_dot()"); return atlas::cblas_dot(n_elem, A, B); } #elif defined(ARMA_USE_BLAS) { - arma_extra_debug_print("blas::dot()"); + arma_debug_print("blas::dot()"); return blas::dot(n_elem, A, B); } @@ -148,13 +148,13 @@ op_dot::direct_dot(const uword n_elem, const eT* const A, const eT* const B) { #if defined(ARMA_USE_ATLAS) { - arma_extra_debug_print("atlas::cblas_cx_dot()"); + arma_debug_print("atlas::cblas_cx_dot()"); return atlas::cblas_cx_dot(n_elem, A, B); } #elif defined(ARMA_USE_BLAS) { - arma_extra_debug_print("blas::dot()"); + arma_debug_print("blas::dot()"); return blas::dot(n_elem, A, B); } @@ -186,7 +186,7 @@ inline eT op_dot::direct_dot(const uword n_elem, const eT* const A, const eT* const B, const eT* C) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eT val = eT(0); @@ -205,56 +205,65 @@ inline typename T1::elem_type op_dot::apply(const T1& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - const bool use_at = (Proxy::use_at) || (Proxy::use_at); - - const bool have_direct_mem = (quasi_unwrap::has_orig_mem) && (quasi_unwrap::has_orig_mem); + typedef typename T1::elem_type eT; - if(use_at || have_direct_mem) + if(is_subview_row::value && is_subview_row::value) { - const quasi_unwrap A(X); - const quasi_unwrap B(Y); + const subview_row& A = reinterpret_cast< const subview_row& >(X); + const subview_row& B = reinterpret_cast< const subview_row& >(Y); - arma_debug_check( (A.M.n_elem != B.M.n_elem), "dot(): objects must have the same number of elements" ); - - return op_dot::direct_dot(A.M.n_elem, A.M.memptr(), B.M.memptr()); - } - else - { - if(is_subview_row::value && is_subview_row::value) + if( (A.m.n_rows == 1) && (B.m.n_rows == 1) ) { - typedef typename T1::elem_type eT; + arma_conform_check( (A.n_elem != B.n_elem), "dot(): objects must have the same number of elements" ); - const subview_row& A = reinterpret_cast< const subview_row& >(X); - const subview_row& B = reinterpret_cast< const subview_row& >(Y); + const eT* A_mem = A.m.memptr(); + const eT* B_mem = B.m.memptr(); - if( (A.m.n_rows == 1) && (B.m.n_rows == 1) ) - { - arma_debug_check( (A.n_elem != B.n_elem), "dot(): objects must have the same number of elements" ); - - const eT* A_mem = A.m.memptr(); - const eT* B_mem = B.m.memptr(); - - return op_dot::direct_dot(A.n_elem, &A_mem[A.aux_col1], &B_mem[B.aux_col1]); - } + return op_dot::direct_dot(A.n_elem, &A_mem[A.aux_col1], &B_mem[B.aux_col1]); } + } + + // if possible, bypass transposes of non-complex vectors + + if( (is_cx::no) && (resolves_to_vector::value) && (resolves_to_vector::value) && (partial_unwrap::is_fast) && (partial_unwrap::is_fast) ) + { + const partial_unwrap UA(X); + const partial_unwrap UB(Y); - const Proxy PA(X); - const Proxy PB(Y); + const typename partial_unwrap::stored_type& A = UA.M; + const typename partial_unwrap::stored_type& B = UB.M; - arma_debug_check( (PA.get_n_elem() != PB.get_n_elem()), "dot(): objects must have the same number of elements" ); + arma_conform_check( (A.n_elem != B.n_elem), "dot(): objects must have the same number of elements" ); - if(is_Mat::stored_type>::value && is_Mat::stored_type>::value) - { - const quasi_unwrap::stored_type> A(PA.Q); - const quasi_unwrap::stored_type> B(PB.Q); - - return op_dot::direct_dot(A.M.n_elem, A.M.memptr(), B.M.memptr()); - } + const eT val = op_dot::direct_dot(A.n_elem, A.memptr(), B.memptr()); + + return (UA.do_times || UB.do_times) ? (val * UA.get_val() * UB.get_val()) : val; + } + + constexpr bool proxy_is_mat = (is_Mat::stored_type>::value && is_Mat::stored_type>::value); + + constexpr bool use_at = (Proxy::use_at) || (Proxy::use_at); + + constexpr bool have_direct_mem = (quasi_unwrap::has_orig_mem) && (quasi_unwrap::has_orig_mem); + + if(proxy_is_mat || use_at || have_direct_mem) + { + const quasi_unwrap A(X); + const quasi_unwrap B(Y); + + arma_conform_check( (A.M.n_elem != B.M.n_elem), "dot(): objects must have the same number of elements" ); - return op_dot::apply_proxy(PA,PB); + return op_dot::direct_dot(A.M.n_elem, A.M.memptr(), B.M.memptr()); } + + const Proxy PA(X); + const Proxy PB(Y); + + arma_conform_check( (PA.get_n_elem() != PB.get_n_elem()), "dot(): objects must have the same number of elements" ); + + return op_dot::apply_proxy(PA,PB); } @@ -264,7 +273,7 @@ inline typename arma_not_cx::result op_dot::apply_proxy(const Proxy& PA, const Proxy& PB) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename Proxy::ea_type ea_type1; @@ -301,7 +310,7 @@ inline typename arma_cx_only::result op_dot::apply_proxy(const Proxy& PA, const Proxy& PB) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename get_pod_type::result T; @@ -347,7 +356,7 @@ inline typename T1::elem_type op_norm_dot::apply(const T1& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; @@ -358,7 +367,7 @@ op_norm_dot::apply(const T1& X, const T2& Y) const Col A( const_cast(tmp1.M.memptr()), tmp1.M.n_elem, false ); const Col B( const_cast(tmp2.M.memptr()), tmp2.M.n_elem, false ); - arma_debug_check( (A.n_elem != B.n_elem), "norm_dot(): objects must have the same number of elements" ); + arma_conform_check( (A.n_elem != B.n_elem), "norm_dot(): objects must have the same number of elements" ); const T denom = norm(A,2) * norm(B,2); @@ -377,7 +386,7 @@ inline eT op_cdot::direct_cdot_arma(const uword n_elem, const eT* const A, const eT* const B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -409,7 +418,7 @@ inline eT op_cdot::direct_cdot(const uword n_elem, const eT* const A, const eT* const B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if( n_elem <= 32u ) { @@ -419,7 +428,7 @@ op_cdot::direct_cdot(const uword n_elem, const eT* const A, const eT* const B) { #if defined(ARMA_USE_BLAS) { - arma_extra_debug_print("blas::gemv()"); + arma_debug_print("blas::gemv()"); // using gemv() workaround due to compatibility issues with cdotc() and zdotc() @@ -455,7 +464,7 @@ inline typename T1::elem_type op_cdot::apply(const T1& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(is_Mat::value && is_Mat::value) { @@ -474,7 +483,7 @@ inline typename T1::elem_type op_cdot::apply_unwrap(const T1& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -484,7 +493,7 @@ op_cdot::apply_unwrap(const T1& X, const T2& Y) const Mat& A = tmp1.M; const Mat& B = tmp2.M; - arma_debug_check( (A.n_elem != B.n_elem), "cdot(): objects must have the same number of elements" ); + arma_conform_check( (A.n_elem != B.n_elem), "cdot(): objects must have the same number of elements" ); return op_cdot::direct_cdot( A.n_elem, A.mem, B.mem ); } @@ -496,7 +505,7 @@ inline typename T1::elem_type op_cdot::apply_proxy(const T1& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename get_pod_type::result T; @@ -504,7 +513,7 @@ op_cdot::apply_proxy(const T1& X, const T2& Y) typedef typename Proxy::ea_type ea_type1; typedef typename Proxy::ea_type ea_type2; - const bool use_at = (Proxy::use_at) || (Proxy::use_at); + constexpr bool use_at = (Proxy::use_at) || (Proxy::use_at); if(use_at == false) { @@ -513,7 +522,7 @@ op_cdot::apply_proxy(const T1& X, const T2& Y) const uword N = PA.get_n_elem(); - arma_debug_check( (N != PB.get_n_elem()), "cdot(): objects must have the same number of elements" ); + arma_conform_check( (N != PB.get_n_elem()), "cdot(): objects must have the same number of elements" ); ea_type1 A = PA.get_ea(); ea_type2 B = PB.get_ea(); @@ -551,7 +560,7 @@ inline typename promote_type::result op_dot_mixed::apply(const T1& A, const T2& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type in_eT1; typedef typename T2::elem_type in_eT2; @@ -563,7 +572,7 @@ op_dot_mixed::apply(const T1& A, const T2& B) const uword N = PA.get_n_elem(); - arma_debug_check( (N != PB.get_n_elem()), "dot(): objects must have the same number of elements" ); + arma_conform_check( (N != PB.get_n_elem()), "dot(): objects must have the same number of elements" ); out_eT acc = out_eT(0); diff --git a/inst/include/armadillo_bits/op_dotext_meat.hpp b/inst/include/armadillo_bits/op_dotext_meat.hpp index c190b2cb..a5c46203 100644 --- a/inst/include/armadillo_bits/op_dotext_meat.hpp +++ b/inst/include/armadillo_bits/op_dotext_meat.hpp @@ -31,7 +31,7 @@ op_dotext::direct_rowvec_mat_colvec const eT* C_mem ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword cost_AB = B.n_cols; const uword cost_BC = B.n_rows; @@ -88,7 +88,7 @@ op_dotext::direct_rowvec_transmat_colvec const eT* C_mem ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword cost_AB = B.n_rows; const uword cost_BC = B.n_cols; @@ -147,7 +147,7 @@ op_dotext::direct_rowvec_diagmat_colvec const eT* C_mem ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eT val = eT(0); @@ -171,7 +171,7 @@ op_dotext::direct_rowvec_invdiagmat_colvec const eT* C_mem ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eT val = eT(0); @@ -195,7 +195,7 @@ op_dotext::direct_rowvec_invdiagvec_colvec const eT* C_mem ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const eT* B_mem = B.mem; diff --git a/inst/include/armadillo_bits/op_expmat_meat.hpp b/inst/include/armadillo_bits/op_expmat_meat.hpp index d45fb36d..0fdcf768 100644 --- a/inst/include/armadillo_bits/op_expmat_meat.hpp +++ b/inst/include/armadillo_bits/op_expmat_meat.hpp @@ -33,7 +33,7 @@ inline void op_expmat::apply(Mat& out, const Op& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_expmat::apply_direct(out, expr.m); @@ -51,7 +51,7 @@ inline bool op_expmat::apply_direct(Mat& out, const Base& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; @@ -60,7 +60,7 @@ op_expmat::apply_direct(Mat& out, const Base& out, const Base A = expr.get_ref(); - arma_debug_check( (A.is_square() == false), "expmat(): given matrix must be square sized" ); + arma_conform_check( (A.is_square() == false), "expmat(): given matrix must be square sized" ); if(A.is_diagmat()) { - arma_extra_debug_print("op_expmat: detected diagonal matrix"); + arma_debug_print("op_expmat: detected diagonal matrix"); const uword N = (std::min)(A.n_rows, A.n_cols); @@ -100,7 +100,7 @@ op_expmat::apply_direct(Mat& out, const Base eigval; Mat eigvec; @@ -170,7 +170,7 @@ inline void op_expmat_sym::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_expmat_sym::apply_direct(out, in.m); @@ -188,7 +188,7 @@ inline bool op_expmat_sym::apply_direct(Mat& out, const Base& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -198,16 +198,16 @@ op_expmat_sym::apply_direct(Mat& out, const Base U(expr.get_ref()); const Mat& X = U.M; - arma_debug_check( (X.is_square() == false), "expmat_sym(): given matrix must be square sized" ); + arma_conform_check( (X.is_square() == false), "expmat_sym(): given matrix must be square sized" ); - if((arma_config::debug) && (arma_config::warn_level > 0) && (is_cx::yes) && (sym_helper::check_diag_imag(X) == false)) + if((arma_config::check_conformance) && (arma_config::warn_level > 0) && (is_cx::yes) && (sym_helper::check_diag_imag(X) == false)) { - arma_debug_warn_level(1, "inv_sympd(): imaginary components on diagonal are non-zero"); + arma_conform_warn(1, "inv_sympd(): imaginary components on diagonal are non-zero"); } if(is_op_diagmat::value || X.is_diagmat()) { - arma_extra_debug_print("op_expmat_sym: detected diagonal matrix"); + arma_debug_print("op_expmat_sym: detected diagonal matrix"); out = X; diff --git a/inst/include/armadillo_bits/op_fft_meat.hpp b/inst/include/armadillo_bits/op_fft_meat.hpp index 4f5d93af..daf7aff4 100644 --- a/inst/include/armadillo_bits/op_fft_meat.hpp +++ b/inst/include/armadillo_bits/op_fft_meat.hpp @@ -36,7 +36,7 @@ class fft_engine_wrapper inline ~fft_engine_wrapper() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(worker_kissfft != nullptr) { delete worker_kissfft; } if(worker_fftw3 != nullptr) { delete worker_fftw3; } @@ -45,7 +45,7 @@ class fft_engine_wrapper inline fft_engine_wrapper(const uword N_samples, const uword N_exec) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool use_fftw3 = N_samples >= (threshold / N_exec); @@ -57,7 +57,7 @@ class fft_engine_wrapper void run(cx_type* Y, const cx_type* X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(worker_kissfft != nullptr) { (*worker_kissfft).run(Y,X); } else if(worker_fftw3 != nullptr) { (*worker_fftw3).run(Y,X); } @@ -76,7 +76,7 @@ inline void op_fft_real::apply( Mat< std::complex >& out, const mtOp,T1,op_fft_real>& in ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type in_eT; typedef typename std::complex out_eT; @@ -162,7 +162,7 @@ inline void op_fft_cx::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -189,7 +189,7 @@ inline void op_fft_cx::apply_noalias(Mat& out, const Mat& X, const uword a, const uword b) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_rows = X.n_rows; const uword n_cols = X.n_cols; @@ -300,7 +300,7 @@ inline void op_ifft_cx::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/op_find_meat.hpp b/inst/include/armadillo_bits/op_find_meat.hpp index b2fd6dde..5b851ef2 100644 --- a/inst/include/armadillo_bits/op_find_meat.hpp +++ b/inst/include/armadillo_bits/op_find_meat.hpp @@ -31,7 +31,7 @@ op_find::helper const Base& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -85,7 +85,7 @@ op_find::helper const typename arma_not_cx::result* junk2 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); @@ -93,9 +93,9 @@ op_find::helper const eT val = X.aux; - if((is_same_type::yes || is_same_type::yes) && arma_config::debug && arma_isnan(val)) + if((is_same_type::yes || is_same_type::yes) && arma_config::check_conformance && arma_isnan(val)) { - arma_debug_warn_level(1, "find(): NaN is not equal to anything; suggest to use find_nonfinite() instead"); + arma_conform_warn(1, "find(): NaN is not equal to anything; suggest to use find_nonfinite() instead"); } const Proxy A(X.m); @@ -217,7 +217,7 @@ op_find::helper const typename arma_cx_only::result* junk2 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); @@ -226,9 +226,9 @@ op_find::helper const eT val = X.aux; - if((is_same_type::yes || is_same_type::yes) && arma_config::debug && arma_isnan(val)) + if((is_same_type::yes || is_same_type::yes) && arma_config::check_conformance && arma_isnan(val)) { - arma_debug_warn_level(1, "find(): NaN is not equal to anything; suggest to use find_nonfinite() instead"); + arma_conform_warn(1, "find(): NaN is not equal to anything; suggest to use find_nonfinite() instead"); } const Proxy A(X.m); @@ -299,7 +299,7 @@ op_find::helper const typename arma_not_cx::result* junk3 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); arma_ignore(junk3); @@ -313,7 +313,7 @@ op_find::helper const Proxy A(X.A); const Proxy B(X.B); - arma_debug_assert_same_size(A, B, "relational operator"); + arma_conform_assert_same_size(A, B, "relational operator"); const uword n_elem = A.get_n_elem(); @@ -395,7 +395,7 @@ op_find::helper const typename arma_cx_only::result* junk3 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); arma_ignore(junk3); @@ -406,7 +406,7 @@ op_find::helper const Proxy A(X.A); const Proxy B(X.B); - arma_debug_assert_same_size(A, B, "relational operator"); + arma_conform_assert_same_size(A, B, "relational operator"); const uword n_elem = A.get_n_elem(); @@ -463,7 +463,7 @@ inline void op_find::apply(Mat& out, const mtOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword k = X.aux_uword_a; const uword type = X.aux_uword_b; @@ -499,7 +499,7 @@ inline void op_find_simple::apply(Mat& out, const mtOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat indices; const uword n_nz = op_find::helper(indices, X.m); @@ -518,9 +518,9 @@ inline void op_find_finite::apply(Mat& out, const mtOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "find_finite(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_conform_warn(1, "find_finite(): detection of non-finite values is not reliable in fast math mode"); } const Proxy P(X.m); @@ -566,9 +566,9 @@ inline void op_find_nonfinite::apply(Mat& out, const mtOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "find_nonfinite(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_conform_warn(1, "find_nonfinite(): detection of non-finite values is not reliable in fast math mode"); } const Proxy P(X.m); @@ -614,9 +614,9 @@ inline void op_find_nan::apply(Mat& out, const mtOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "find_nan(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_conform_warn(1, "find_nan(): detection of non-finite values is not reliable in fast math mode"); } const Proxy P(X.m); diff --git a/inst/include/armadillo_bits/op_find_unique_meat.hpp b/inst/include/armadillo_bits/op_find_unique_meat.hpp index 92ee3227..63084c97 100644 --- a/inst/include/armadillo_bits/op_find_unique_meat.hpp +++ b/inst/include/armadillo_bits/op_find_unique_meat.hpp @@ -26,7 +26,7 @@ inline bool op_find_unique::apply_helper(Mat& out, const Proxy& P, const bool ascending_indices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -109,7 +109,7 @@ inline void op_find_unique::apply(Mat& out, const mtOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Proxy P(in.m); @@ -119,7 +119,7 @@ op_find_unique::apply(Mat& out, const mtOp& in) if(all_non_nan == false) { - arma_debug_check( true, "find_unique(): detected NaN" ); + arma_conform_check( true, "find_unique(): detected NaN" ); out.reset(); } diff --git a/inst/include/armadillo_bits/op_flip_meat.hpp b/inst/include/armadillo_bits/op_flip_meat.hpp index 470ae923..253a1fd7 100644 --- a/inst/include/armadillo_bits/op_flip_meat.hpp +++ b/inst/include/armadillo_bits/op_flip_meat.hpp @@ -26,7 +26,7 @@ inline void op_flipud::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -64,7 +64,7 @@ inline void op_flipud::apply_direct(Mat& out, const Mat& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword X_n_rows = X.n_rows; const uword X_n_cols = X.n_cols; @@ -134,7 +134,7 @@ inline void op_flipud::apply_proxy_noalias(Mat& out, const Proxy& P) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -192,7 +192,7 @@ inline void op_fliplr::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -230,7 +230,7 @@ inline void op_fliplr::apply_direct(Mat& out, const Mat& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword X_n_rows = X.n_rows; const uword X_n_cols = X.n_cols; @@ -289,7 +289,7 @@ inline void op_fliplr::apply_proxy_noalias(Mat& out, const Proxy& P) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/op_hist_meat.hpp b/inst/include/armadillo_bits/op_hist_meat.hpp index 04c5ed8f..27cffa83 100644 --- a/inst/include/armadillo_bits/op_hist_meat.hpp +++ b/inst/include/armadillo_bits/op_hist_meat.hpp @@ -27,9 +27,9 @@ inline void op_hist::apply_noalias(Mat& out, const Mat& A, const uword n_bins, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( ((A.is_vec() == false) && (A.is_empty() == false)), "hist(): only vectors are supported when automatically determining bin centers" ); + arma_conform_check( ((A.is_vec() == false) && (A.is_empty() == false)), "hist(): only vectors are supported when automatically determining bin centers" ); if(n_bins == 0) { out.reset(); return; } @@ -89,7 +89,7 @@ inline void op_hist::apply(Mat& out, const mtOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_bins = X.aux_uword_a; diff --git a/inst/include/armadillo_bits/op_htrans_meat.hpp b/inst/include/armadillo_bits/op_htrans_meat.hpp index e03893c8..0968a50b 100644 --- a/inst/include/armadillo_bits/op_htrans_meat.hpp +++ b/inst/include/armadillo_bits/op_htrans_meat.hpp @@ -26,7 +26,7 @@ inline void op_htrans::apply_mat_noalias(Mat& out, const Mat& A, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); op_strans::apply_mat_noalias(out, A); @@ -39,7 +39,7 @@ inline void op_htrans::apply_mat_noalias(Mat& out, const Mat& A, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const uword A_n_rows = A.n_rows; @@ -110,7 +110,7 @@ inline void op_htrans::apply_mat_noalias_large(Mat< std::complex >& out, const Mat< std::complex >& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_rows = A.n_rows; const uword n_cols = A.n_cols; @@ -165,7 +165,7 @@ inline void op_htrans::apply_mat_inplace(Mat& out, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); op_strans::apply_mat_inplace(out); @@ -178,7 +178,7 @@ inline void op_htrans::apply_mat_inplace(Mat& out, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const uword n_rows = out.n_rows; @@ -186,7 +186,7 @@ op_htrans::apply_mat_inplace(Mat& out, const typename arma_cx_only::resu if(n_rows == n_cols) { - arma_extra_debug_print("doing in-place hermitian transpose of a square matrix"); + arma_debug_print("doing in-place hermitian transpose of a square matrix"); for(uword col=0; col < n_cols; ++col) { @@ -221,7 +221,7 @@ inline void op_htrans::apply_mat(Mat& out, const Mat& A, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); op_strans::apply_mat(out, A); @@ -234,7 +234,7 @@ inline void op_htrans::apply_mat(Mat& out, const Mat& A, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); if(&out != &A) @@ -254,7 +254,7 @@ inline void op_htrans::apply_proxy(Mat& out, const Proxy& P) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -301,7 +301,7 @@ inline void op_htrans::apply_direct(Mat& out, const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -360,7 +360,7 @@ inline void op_htrans::apply(Mat& out, const Op& in, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); op_strans::apply_direct(out, in.m); @@ -373,7 +373,7 @@ inline void op_htrans::apply(Mat& out, const Op& in, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); op_htrans::apply_direct(out, in.m); @@ -391,7 +391,7 @@ inline void op_htrans2::apply(Mat& out, const Op& in, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); op_strans::apply_direct(out, in.m); @@ -406,7 +406,7 @@ inline void op_htrans2::apply(Mat& out, const Op& in, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); op_htrans::apply_direct(out, in.m); diff --git a/inst/include/armadillo_bits/op_index_max_meat.hpp b/inst/include/armadillo_bits/op_index_max_meat.hpp index 5034921f..6aed272b 100644 --- a/inst/include/armadillo_bits/op_index_max_meat.hpp +++ b/inst/include/armadillo_bits/op_index_max_meat.hpp @@ -26,12 +26,12 @@ inline void op_index_max::apply(Mat& out, const mtOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const uword dim = in.aux_uword_a; - arma_debug_check( (dim > 1), "index_max(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "index_max(): parameter 'dim' must be 0 or 1" ); const quasi_unwrap U(in.m); const Mat& X = U.M; @@ -57,7 +57,7 @@ inline void op_index_max::apply_noalias(Mat& out, const Mat& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -66,7 +66,7 @@ op_index_max::apply_noalias(Mat& out, const Mat& X, const uword dim) if(dim == 0) { - arma_extra_debug_print("op_index_max::apply(): dim = 0"); + arma_debug_print("op_index_max::apply(): dim = 0"); out.set_size((X_n_rows > 0) ? 1 : 0, X_n_cols); @@ -82,7 +82,7 @@ op_index_max::apply_noalias(Mat& out, const Mat& X, const uword dim) else if(dim == 1) { - arma_extra_debug_print("op_index_max::apply(): dim = 1"); + arma_debug_print("op_index_max::apply(): dim = 1"); out.zeros(X_n_rows, (X_n_cols > 0) ? 1 : 0); @@ -135,10 +135,10 @@ inline void op_index_max::apply(Cube& out, const mtOpCube& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword dim = in.aux_uword_a; - arma_debug_check( (dim > 2), "index_max(): parameter 'dim' must be 0 or 1 or 2" ); + arma_conform_check( (dim > 2), "index_max(): parameter 'dim' must be 0 or 1 or 2" ); const unwrap_cube U(in.m); @@ -163,7 +163,7 @@ inline void op_index_max::apply_noalias(Cube& out, const Cube& X, const uword dim, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const uword X_n_rows = X.n_rows; @@ -172,7 +172,7 @@ op_index_max::apply_noalias(Cube& out, const Cube& X, const uword dim if(dim == 0) { - arma_extra_debug_print("op_index_max::apply(): dim = 0"); + arma_debug_print("op_index_max::apply(): dim = 0"); out.set_size((X_n_rows > 0) ? 1 : 0, X_n_cols, X_n_slices); @@ -191,7 +191,7 @@ op_index_max::apply_noalias(Cube& out, const Cube& X, const uword dim else if(dim == 1) { - arma_extra_debug_print("op_index_max::apply(): dim = 1"); + arma_debug_print("op_index_max::apply(): dim = 1"); out.zeros(X_n_rows, (X_n_cols > 0) ? 1 : 0, X_n_slices); @@ -227,7 +227,7 @@ op_index_max::apply_noalias(Cube& out, const Cube& X, const uword dim else if(dim == 2) { - arma_extra_debug_print("op_index_max::apply(): dim = 2"); + arma_debug_print("op_index_max::apply(): dim = 2"); out.zeros(X_n_rows, X_n_cols, (X_n_slices > 0) ? 1 : 0); @@ -265,7 +265,7 @@ inline void op_index_max::apply_noalias(Cube& out, const Cube& X, const uword dim, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename get_pod_type::result T; @@ -276,7 +276,7 @@ op_index_max::apply_noalias(Cube& out, const Cube& X, const uword dim if(dim == 0) { - arma_extra_debug_print("op_index_max::apply(): dim = 0"); + arma_debug_print("op_index_max::apply(): dim = 0"); out.set_size((X_n_rows > 0) ? 1 : 0, X_n_cols, X_n_slices); @@ -295,7 +295,7 @@ op_index_max::apply_noalias(Cube& out, const Cube& X, const uword dim else if(dim == 1) { - arma_extra_debug_print("op_index_max::apply(): dim = 1"); + arma_debug_print("op_index_max::apply(): dim = 1"); out.zeros(X_n_rows, (X_n_cols > 0) ? 1 : 0, X_n_slices); @@ -336,7 +336,7 @@ op_index_max::apply_noalias(Cube& out, const Cube& X, const uword dim else if(dim == 2) { - arma_extra_debug_print("op_index_max::apply(): dim = 2"); + arma_debug_print("op_index_max::apply(): dim = 2"); out.zeros(X_n_rows, X_n_cols, (X_n_slices > 0) ? 1 : 0); @@ -381,11 +381,11 @@ inline void op_index_max::apply(Mat& out, const SpBase& expr, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; - arma_debug_check( (dim > 1), "index_max(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "index_max(): parameter 'dim' must be 0 or 1" ); const unwrap_spmat U(expr.get_ref()); const SpMat& X = U.M; @@ -395,7 +395,7 @@ op_index_max::apply(Mat& out, const SpBase& ex if(dim == 0) { - arma_extra_debug_print("op_index_max::apply(): dim = 0"); + arma_debug_print("op_index_max::apply(): dim = 0"); out.set_size((X_n_rows > 0) ? 1 : 0, X_n_cols); @@ -411,7 +411,7 @@ op_index_max::apply(Mat& out, const SpBase& ex else if(dim == 1) { - arma_extra_debug_print("op_index_max::apply(): dim = 1"); + arma_debug_print("op_index_max::apply(): dim = 1"); out.set_size(X_n_rows, (X_n_cols > 0) ? 1 : 0); diff --git a/inst/include/armadillo_bits/op_index_min_meat.hpp b/inst/include/armadillo_bits/op_index_min_meat.hpp index 13162ab5..c0ca9269 100644 --- a/inst/include/armadillo_bits/op_index_min_meat.hpp +++ b/inst/include/armadillo_bits/op_index_min_meat.hpp @@ -26,12 +26,12 @@ inline void op_index_min::apply(Mat& out, const mtOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const uword dim = in.aux_uword_a; - arma_debug_check( (dim > 1), "index_min(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "index_min(): parameter 'dim' must be 0 or 1" ); const quasi_unwrap U(in.m); const Mat& X = U.M; @@ -57,7 +57,7 @@ inline void op_index_min::apply_noalias(Mat& out, const Mat& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -66,7 +66,7 @@ op_index_min::apply_noalias(Mat& out, const Mat& X, const uword dim) if(dim == 0) { - arma_extra_debug_print("op_index_min::apply(): dim = 0"); + arma_debug_print("op_index_min::apply(): dim = 0"); out.set_size((X_n_rows > 0) ? 1 : 0, X_n_cols); @@ -82,7 +82,7 @@ op_index_min::apply_noalias(Mat& out, const Mat& X, const uword dim) else if(dim == 1) { - arma_extra_debug_print("op_index_min::apply(): dim = 1"); + arma_debug_print("op_index_min::apply(): dim = 1"); out.zeros(X_n_rows, (X_n_cols > 0) ? 1 : 0); @@ -135,10 +135,10 @@ inline void op_index_min::apply(Cube& out, const mtOpCube& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword dim = in.aux_uword_a; - arma_debug_check( (dim > 2), "index_min(): parameter 'dim' must be 0 or 1 or 2" ); + arma_conform_check( (dim > 2), "index_min(): parameter 'dim' must be 0 or 1 or 2" ); const unwrap_cube U(in.m); @@ -163,7 +163,7 @@ inline void op_index_min::apply_noalias(Cube& out, const Cube& X, const uword dim, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const uword X_n_rows = X.n_rows; @@ -172,7 +172,7 @@ op_index_min::apply_noalias(Cube& out, const Cube& X, const uword dim if(dim == 0) { - arma_extra_debug_print("op_index_min::apply(): dim = 0"); + arma_debug_print("op_index_min::apply(): dim = 0"); out.set_size((X_n_rows > 0) ? 1 : 0, X_n_cols, X_n_slices); @@ -191,7 +191,7 @@ op_index_min::apply_noalias(Cube& out, const Cube& X, const uword dim else if(dim == 1) { - arma_extra_debug_print("op_index_min::apply(): dim = 1"); + arma_debug_print("op_index_min::apply(): dim = 1"); out.zeros(X_n_rows, (X_n_cols > 0) ? 1 : 0, X_n_slices); @@ -227,7 +227,7 @@ op_index_min::apply_noalias(Cube& out, const Cube& X, const uword dim else if(dim == 2) { - arma_extra_debug_print("op_index_min::apply(): dim = 2"); + arma_debug_print("op_index_min::apply(): dim = 2"); out.zeros(X_n_rows, X_n_cols, (X_n_slices > 0) ? 1 : 0); @@ -265,7 +265,7 @@ inline void op_index_min::apply_noalias(Cube& out, const Cube& X, const uword dim, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename get_pod_type::result T; @@ -276,7 +276,7 @@ op_index_min::apply_noalias(Cube& out, const Cube& X, const uword dim if(dim == 0) { - arma_extra_debug_print("op_index_min::apply(): dim = 0"); + arma_debug_print("op_index_min::apply(): dim = 0"); out.set_size((X_n_rows > 0) ? 1 : 0, X_n_cols, X_n_slices); @@ -295,7 +295,7 @@ op_index_min::apply_noalias(Cube& out, const Cube& X, const uword dim else if(dim == 1) { - arma_extra_debug_print("op_index_min::apply(): dim = 1"); + arma_debug_print("op_index_min::apply(): dim = 1"); out.zeros(X_n_rows, (X_n_cols > 0) ? 1 : 0, X_n_slices); @@ -336,7 +336,7 @@ op_index_min::apply_noalias(Cube& out, const Cube& X, const uword dim else if(dim == 2) { - arma_extra_debug_print("op_index_min::apply(): dim = 2"); + arma_debug_print("op_index_min::apply(): dim = 2"); out.zeros(X_n_rows, X_n_cols, (X_n_slices > 0) ? 1 : 0); @@ -381,11 +381,11 @@ inline void op_index_min::apply(Mat& out, const SpBase& expr, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; - arma_debug_check( (dim > 1), "index_min(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "index_min(): parameter 'dim' must be 0 or 1" ); const unwrap_spmat U(expr.get_ref()); const SpMat& X = U.M; @@ -395,7 +395,7 @@ op_index_min::apply(Mat& out, const SpBase& ex if(dim == 0) { - arma_extra_debug_print("op_index_min::apply(): dim = 0"); + arma_debug_print("op_index_min::apply(): dim = 0"); out.set_size((X_n_rows > 0) ? 1 : 0, X_n_cols); @@ -411,7 +411,7 @@ op_index_min::apply(Mat& out, const SpBase& ex else if(dim == 1) { - arma_extra_debug_print("op_index_min::apply(): dim = 1"); + arma_debug_print("op_index_min::apply(): dim = 1"); out.set_size(X_n_rows, (X_n_cols > 0) ? 1 : 0); diff --git a/inst/include/armadillo_bits/op_inv_gen_meat.hpp b/inst/include/armadillo_bits/op_inv_gen_meat.hpp index a7585d71..c08ed33e 100644 --- a/inst/include/armadillo_bits/op_inv_gen_meat.hpp +++ b/inst/include/armadillo_bits/op_inv_gen_meat.hpp @@ -26,7 +26,7 @@ inline void op_inv_gen_default::apply(Mat& out, const Op& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_inv_gen_default::apply_direct(out, X.m, "inv()"); @@ -44,7 +44,7 @@ inline bool op_inv_gen_default::apply_direct(Mat& out, const Base& expr, const char* caller_sig) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return op_inv_gen_full::apply_direct(out, expr, caller_sig, uword(0)); } @@ -60,7 +60,7 @@ inline void op_inv_gen_full::apply(Mat& out, const Op& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword flags = X.aux_uword_a; @@ -80,13 +80,13 @@ inline bool op_inv_gen_full::apply_direct(Mat& out, const Base& expr, const char* caller_sig, const uword flags) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; - if(has_user_flags == true ) { arma_extra_debug_print("op_inv_gen_full: has_user_flags = true"); } - if(has_user_flags == false) { arma_extra_debug_print("op_inv_gen_full: has_user_flags = false"); } + if(has_user_flags == true ) { arma_debug_print("op_inv_gen_full: has_user_flags = true"); } + if(has_user_flags == false) { arma_debug_print("op_inv_gen_full: has_user_flags = false"); } const bool fast = has_user_flags && bool(flags & inv_opts::flag_fast ); const bool allow_approx = has_user_flags && bool(flags & inv_opts::flag_allow_approx); @@ -94,15 +94,15 @@ op_inv_gen_full::apply_direct(Mat& out, const Base& out, const Base& out, const Base::value || out.is_diagmat()) { - arma_extra_debug_print("op_inv_gen_full: detected diagonal matrix"); + arma_debug_print("op_inv_gen_full: detected diagonal matrix"); eT* colmem = out.memptr(); @@ -223,7 +223,7 @@ op_inv_gen_full::apply_direct(Mat& out, const Base tmp = out; @@ -235,7 +235,7 @@ op_inv_gen_full::apply_direct(Mat& out, const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -286,7 +286,7 @@ inline bool op_inv_gen_full::apply_tiny_3x3(Mat& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -335,7 +335,7 @@ inline bool op_inv_gen_rcond::apply_direct(Mat& out, op_inv_gen_state& out_state, const Base& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; @@ -344,11 +344,11 @@ op_inv_gen_rcond::apply_direct(Mat& out, op_inv_gen_stat out_state.size = out.n_rows; out_state.rcond = T(0); - arma_debug_check( (out.is_square() == false), "inv(): given matrix must be square sized", [&](){ out.soft_reset(); } ); + arma_conform_check( (out.is_square() == false), "inv(): given matrix must be square sized", [&](){ out.soft_reset(); } ); if(is_op_diagmat::value || out.is_diagmat()) { - arma_extra_debug_print("op_inv_gen_rcond: detected diagonal matrix"); + arma_debug_print("op_inv_gen_rcond: detected diagonal matrix"); out_state.is_diag = true; @@ -401,7 +401,7 @@ op_inv_gen_rcond::apply_direct(Mat& out, op_inv_gen_stat if(try_sympd) { - arma_extra_debug_print("op_inv_gen_rcond: attempting sympd optimisation"); + arma_debug_print("op_inv_gen_rcond: attempting sympd optimisation"); out_state.is_sym = true; @@ -415,7 +415,7 @@ op_inv_gen_rcond::apply_direct(Mat& out, op_inv_gen_stat if((status == false) && (sympd_state == true)) { return false; } - arma_extra_debug_print("op_inv_gen_rcond: sympd optimisation failed"); + arma_debug_print("op_inv_gen_rcond: sympd optimisation failed"); // fallthrough if optimisation failed } diff --git a/inst/include/armadillo_bits/op_inv_spd_meat.hpp b/inst/include/armadillo_bits/op_inv_spd_meat.hpp index 0c609745..36f8a80f 100644 --- a/inst/include/armadillo_bits/op_inv_spd_meat.hpp +++ b/inst/include/armadillo_bits/op_inv_spd_meat.hpp @@ -26,7 +26,7 @@ inline void op_inv_spd_default::apply(Mat& out, const Op& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_inv_spd_default::apply_direct(out, X.m); @@ -44,7 +44,7 @@ inline bool op_inv_spd_default::apply_direct(Mat& out, const Base& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return op_inv_spd_full::apply_direct(out, expr, uword(0)); } @@ -60,7 +60,7 @@ inline void op_inv_spd_full::apply(Mat& out, const Op& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword flags = X.aux_uword_a; @@ -80,13 +80,13 @@ inline bool op_inv_spd_full::apply_direct(Mat& out, const Base& expr, const uword flags) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; - if(has_user_flags == true ) { arma_extra_debug_print("op_inv_spd_full: has_user_flags = true"); } - if(has_user_flags == false) { arma_extra_debug_print("op_inv_spd_full: has_user_flags = false"); } + if(has_user_flags == true ) { arma_debug_print("op_inv_spd_full: has_user_flags = true"); } + if(has_user_flags == false) { arma_debug_print("op_inv_spd_full: has_user_flags = false"); } const bool fast = has_user_flags && bool(flags & inv_opts::flag_fast ); const bool allow_approx = has_user_flags && bool(flags & inv_opts::flag_allow_approx); @@ -94,15 +94,15 @@ op_inv_spd_full::apply_direct(Mat& out, const Base& out, const Base 0)) + if((arma_config::check_conformance) && (arma_config::warn_level > 0)) { if(auxlib::rudimentary_sym_check(out) == false) { - if(is_cx::no ) { arma_debug_warn_level(1, "inv_sympd(): given matrix is not symmetric"); } - if(is_cx::yes) { arma_debug_warn_level(1, "inv_sympd(): given matrix is not hermitian"); } + if(is_cx::no ) { arma_conform_warn(1, "inv_sympd(): given matrix is not symmetric"); } + if(is_cx::yes) { arma_conform_warn(1, "inv_sympd(): given matrix is not hermitian"); } } else if((is_cx::yes) && (sym_helper::check_diag_imag(out) == false)) { - arma_debug_warn_level(1, "inv_sympd(): imaginary components on diagonal are non-zero"); + arma_conform_warn(1, "inv_sympd(): imaginary components on diagonal are non-zero"); } } @@ -191,7 +191,7 @@ op_inv_spd_full::apply_direct(Mat& out, const Base::value || out.is_diagmat()) { - arma_extra_debug_print("op_inv_spd_full: detected diagonal matrix"); + arma_debug_print("op_inv_spd_full: detected diagonal matrix"); eT* colmem = out.memptr(); @@ -222,7 +222,7 @@ inline bool op_inv_spd_full::apply_tiny_2x2(Mat& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -273,7 +273,7 @@ inline bool op_inv_spd_rcond::apply_direct(Mat& out, op_inv_spd_state& out_state, const Base& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; @@ -282,25 +282,25 @@ op_inv_spd_rcond::apply_direct(Mat& out, op_inv_spd_stat out_state.size = out.n_rows; out_state.rcond = T(0); - arma_debug_check( (out.is_square() == false), "inv_sympd(): given matrix must be square sized", [&](){ out.soft_reset(); } ); + arma_conform_check( (out.is_square() == false), "inv_sympd(): given matrix must be square sized", [&](){ out.soft_reset(); } ); - if((arma_config::debug) && (arma_config::warn_level > 0)) + if((arma_config::check_conformance) && (arma_config::warn_level > 0)) { if(auxlib::rudimentary_sym_check(out) == false) { - if(is_cx::no ) { arma_debug_warn_level(1, "inv_sympd(): given matrix is not symmetric"); } - if(is_cx::yes) { arma_debug_warn_level(1, "inv_sympd(): given matrix is not hermitian"); } + if(is_cx::no ) { arma_conform_warn(1, "inv_sympd(): given matrix is not symmetric"); } + if(is_cx::yes) { arma_conform_warn(1, "inv_sympd(): given matrix is not hermitian"); } } else if((is_cx::yes) && (sym_helper::check_diag_imag(out) == false)) { - arma_debug_warn_level(1, "inv_sympd(): imaginary components on diagonal are non-zero"); + arma_conform_warn(1, "inv_sympd(): imaginary components on diagonal are non-zero"); } } if(is_op_diagmat::value || out.is_diagmat()) { - arma_extra_debug_print("op_inv_spd_rcond: detected diagonal matrix"); + arma_debug_print("op_inv_spd_rcond: detected diagonal matrix"); out_state.is_diag = true; @@ -338,7 +338,7 @@ op_inv_spd_rcond::apply_direct(Mat& out, op_inv_spd_stat if(auxlib::crippled_lapack(out)) { - arma_extra_debug_print("op_inv_spd_rcond: workaround for crippled lapack"); + arma_debug_print("op_inv_spd_rcond: workaround for crippled lapack"); Mat tmp = out; diff --git a/inst/include/armadillo_bits/op_log_det_meat.hpp b/inst/include/armadillo_bits/op_log_det_meat.hpp index 7b888592..91983df7 100644 --- a/inst/include/armadillo_bits/op_log_det_meat.hpp +++ b/inst/include/armadillo_bits/op_log_det_meat.hpp @@ -26,7 +26,7 @@ inline bool op_log_det::apply_direct(typename T1::elem_type& out_val, typename T1::pod_type& out_sign, const Base& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; // typedef typename T1::pod_type T; @@ -47,7 +47,7 @@ op_log_det::apply_direct(typename T1::elem_type& out_val, typename T1::pod_type& Mat A(expr.get_ref()); - arma_debug_check( (A.is_square() == false), "log_det(): given matrix must be square sized" ); + arma_conform_check( (A.is_square() == false), "log_det(): given matrix must be square sized" ); if(A.is_diagmat()) { return op_log_det::apply_diagmat(out_val, out_sign, A); } @@ -60,7 +60,7 @@ op_log_det::apply_direct(typename T1::elem_type& out_val, typename T1::pod_type& // // if(try_sympd) // { - // arma_extra_debug_print("op_log_det: attempting sympd optimisation"); + // arma_debug_print("op_log_det: attempting sympd optimisation"); // // T out_val_real = T(0); // @@ -74,7 +74,7 @@ op_log_det::apply_direct(typename T1::elem_type& out_val, typename T1::pod_type& // return true; // } // - // arma_extra_debug_print("op_log_det: sympd optimisation failed"); + // arma_debug_print("op_log_det: sympd optimisation failed"); // // // restore A as it's destroyed by auxlib::log_det_sympd() // A = expr.get_ref(); @@ -92,14 +92,14 @@ inline bool op_log_det::apply_diagmat(typename T1::elem_type& out_val, typename T1::pod_type& out_sign, const Base& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; const diagmat_proxy A(expr.get_ref()); - arma_debug_check( (A.n_rows != A.n_cols), "log_det(): given matrix must be square sized" ); + arma_conform_check( (A.n_rows != A.n_cols), "log_det(): given matrix must be square sized" ); const uword N = (std::min)(A.n_rows, A.n_cols); @@ -137,7 +137,7 @@ inline bool op_log_det::apply_trimat(typename T1::elem_type& out_val, typename T1::pod_type& out_sign, const Base& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; @@ -146,7 +146,7 @@ op_log_det::apply_trimat(typename T1::elem_type& out_val, typename T1::pod_type& const uword N = P.get_n_rows(); - arma_debug_check( (N != P.get_n_cols()), "log_det(): given matrix must be square sized" ); + arma_conform_check( (N != P.get_n_cols()), "log_det(): given matrix must be square sized" ); if(N == 0) { @@ -186,23 +186,23 @@ inline bool op_log_det_sympd::apply_direct(typename T1::pod_type& out_val, const Base& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; Mat A(expr.get_ref()); - arma_debug_check( (A.is_square() == false), "log_det_sympd(): given matrix must be square sized" ); + arma_conform_check( (A.is_square() == false), "log_det_sympd(): given matrix must be square sized" ); - if((arma_config::debug) && (arma_config::warn_level > 0) && (is_cx::yes) && (sym_helper::check_diag_imag(A) == false)) + if((arma_config::check_conformance) && (arma_config::warn_level > 0) && (is_cx::yes) && (sym_helper::check_diag_imag(A) == false)) { - arma_debug_warn_level(1, "log_det_sympd(): imaginary components on diagonal are non-zero"); + arma_conform_warn(1, "log_det_sympd(): imaginary components on diagonal are non-zero"); } if(is_op_diagmat::value || A.is_diagmat()) { - arma_extra_debug_print("op_log_det_sympd: detected diagonal matrix"); + arma_debug_print("op_log_det_sympd: detected diagonal matrix"); eT* colmem = A.memptr(); @@ -225,10 +225,10 @@ op_log_det_sympd::apply_direct(typename T1::pod_type& out_val, const Base::no ) { arma_debug_warn_level(1, "log_det_sympd(): given matrix is not symmetric"); } - if(is_cx::yes) { arma_debug_warn_level(1, "log_det_sympd(): given matrix is not hermitian"); } + if(is_cx::no ) { arma_conform_warn(1, "log_det_sympd(): given matrix is not symmetric"); } + if(is_cx::yes) { arma_conform_warn(1, "log_det_sympd(): given matrix is not hermitian"); } } return auxlib::log_det_sympd(out_val, A); diff --git a/inst/include/armadillo_bits/op_logmat_meat.hpp b/inst/include/armadillo_bits/op_logmat_meat.hpp index 494f747a..45ed5fec 100644 --- a/inst/include/armadillo_bits/op_logmat_meat.hpp +++ b/inst/include/armadillo_bits/op_logmat_meat.hpp @@ -32,7 +32,7 @@ inline void op_logmat::apply(Mat< std::complex >& out, const mtOp,T1,op_logmat>& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_logmat::apply_direct(out, in.m, in.aux_uword_a); @@ -50,13 +50,13 @@ inline bool op_logmat::apply_direct(Mat< std::complex >& out, const Op& expr, const uword) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type T; const diagmat_proxy P(expr.m); - arma_debug_check( (P.n_rows != P.n_cols), "logmat(): given matrix must be square sized" ); + arma_conform_check( (P.n_rows != P.n_cols), "logmat(): given matrix must be square sized" ); const uword N = P.n_rows; @@ -86,7 +86,7 @@ inline bool op_logmat::apply_direct(Mat< std::complex >& out, const Base& expr, const uword n_iters) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type in_T; typedef typename std::complex out_T; @@ -94,7 +94,7 @@ op_logmat::apply_direct(Mat< std::complex >& out, const const quasi_unwrap expr_unwrap(expr.get_ref()); const Mat& A = expr_unwrap.M; - arma_debug_check( (A.is_square() == false), "logmat(): given matrix must be square sized" ); + arma_conform_check( (A.is_square() == false), "logmat(): given matrix must be square sized" ); if(A.n_elem == 0) { @@ -111,7 +111,7 @@ op_logmat::apply_direct(Mat< std::complex >& out, const if(A.is_diagmat()) { - arma_extra_debug_print("op_logmat: detected diagonal matrix"); + arma_debug_print("op_logmat: detected diagonal matrix"); const uword N = A.n_rows; @@ -138,7 +138,7 @@ op_logmat::apply_direct(Mat< std::complex >& out, const if(try_sympd) { - arma_extra_debug_print("op_logmat: attempting sympd optimisation"); + arma_debug_print("op_logmat: attempting sympd optimisation"); // if matrix A is sympd, all its eigenvalues are positive @@ -168,7 +168,7 @@ op_logmat::apply_direct(Mat< std::complex >& out, const } } - arma_extra_debug_print("op_logmat: sympd optimisation failed"); + arma_debug_print("op_logmat: sympd optimisation failed"); // fallthrough if eigen decomposition failed or an eigenvalue is <= 0 } @@ -196,7 +196,7 @@ inline void op_logmat_cx::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_logmat_cx::apply_direct(out, in.m, in.aux_uword_a); @@ -214,7 +214,7 @@ inline bool op_logmat_cx::apply_direct(Mat& out, const Op& expr, const uword) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -245,9 +245,9 @@ inline bool op_logmat_cx::apply_direct_noalias(Mat& out, const diagmat_proxy& P) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (P.n_rows != P.n_cols), "logmat(): given matrix must be square sized" ); + arma_conform_check( (P.n_rows != P.n_cols), "logmat(): given matrix must be square sized" ); const uword N = P.n_rows; @@ -268,14 +268,14 @@ inline bool op_logmat_cx::apply_direct(Mat& out, const Base& expr, const uword n_iters) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; typedef typename T1::elem_type eT; Mat S = expr.get_ref(); - arma_debug_check( (S.n_rows != S.n_cols), "logmat(): given matrix must be square sized" ); + arma_conform_check( (S.n_rows != S.n_cols), "logmat(): given matrix must be square sized" ); if(S.n_elem == 0) { @@ -292,7 +292,7 @@ op_logmat_cx::apply_direct(Mat& out, const Base& out, const Base& out, const Base >& out, Mat< std::complex >& S, const uword n_iters) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; @@ -360,7 +360,7 @@ op_logmat_cx::apply_common(Mat< std::complex >& out, Mat< std::complex >& const bool schur_ok = auxlib::schur(U,S); - if(schur_ok == false) { arma_extra_debug_print("logmat(): schur decomposition failed"); return false; } + if(schur_ok == false) { arma_debug_print("logmat(): schur decomposition failed"); return false; } // NOTE: theta[0] and theta[1] not really used double theta[] = { 1.10e-5, 1.82e-3, 1.6206284795015624e-2, 5.3873532631381171e-2, 1.1352802267628681e-1, 1.8662860613541288e-1, 2.642960831111435e-1 }; @@ -387,19 +387,19 @@ op_logmat_cx::apply_common(Mat< std::complex >& out, Mat< std::complex >& for(uword i=2; i<=6; ++i) { if((tau/2.0) <= theta[i]) { j2 = i; break; } } // sanity check, for development purposes only - arma_debug_check( (j2 > j1), "internal error: op_logmat::apply_direct(): j2 > j1" ); + arma_conform_check( (j2 > j1), "internal error: op_logmat::apply_direct(): j2 > j1" ); if( ((j1 - j2) <= 1) || (p == 2) ) { m = j1; break; } } const bool sqrtmat_ok = op_sqrtmat_cx::apply_direct(S,S); - if(sqrtmat_ok == false) { arma_extra_debug_print("logmat(): sqrtmat() failed"); return false; } + if(sqrtmat_ok == false) { arma_debug_print("logmat(): sqrtmat() failed"); return false; } iter++; } - if(iter >= n_iters) { arma_debug_warn_level(2, "logmat(): reached max iterations without full convergence"); } + if(iter >= n_iters) { arma_conform_warn(2, "logmat(): reached max iterations without full convergence"); } S.diag() -= eT(1); @@ -424,7 +424,7 @@ inline bool op_logmat_cx::helper(Mat& A, const uword m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(A.internal_has_nonfinite()) { return false; } @@ -440,7 +440,7 @@ op_logmat_cx::helper(Mat& A, const uword m) const bool eig_ok = eig_sym_helper(eigval, eigvec, tmp, 'd', "logmat()"); - if(eig_ok == false) { arma_extra_debug_print("logmat(): eig_sym() failed"); return false; } + if(eig_ok == false) { arma_debug_print("logmat(): eig_sym() failed"); return false; } const vec nodes = (eigval + 1.0) / 2.0; const vec weights = square(eigvec.row(0).t()); @@ -458,7 +458,7 @@ op_logmat_cx::helper(Mat& A, const uword m) //const bool solve_ok = solve( X, (nodes(i)*A + eye< Mat >(N,N)), A, solve_opts::fast ); const bool solve_ok = solve( X, trimatu(nodes(i)*A + eye< Mat >(N,N)), A, solve_opts::no_approx ); - if(solve_ok == false) { arma_extra_debug_print("logmat(): solve() failed"); return false; } + if(solve_ok == false) { arma_debug_print("logmat(): solve() failed"); return false; } B += weights(i) * X; } @@ -475,7 +475,7 @@ inline void op_logmat_sympd::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_logmat_sympd::apply_direct(out, in.m); @@ -493,7 +493,7 @@ inline bool op_logmat_sympd::apply_direct(Mat& out, const Base& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -503,16 +503,16 @@ op_logmat_sympd::apply_direct(Mat& out, const Base U(expr.get_ref()); const Mat& X = U.M; - arma_debug_check( (X.is_square() == false), "logmat_sympd(): given matrix must be square sized" ); + arma_conform_check( (X.is_square() == false), "logmat_sympd(): given matrix must be square sized" ); - if((arma_config::debug) && (arma_config::warn_level > 0) && (is_cx::yes) && (sym_helper::check_diag_imag(X) == false)) + if((arma_config::check_conformance) && (arma_config::warn_level > 0) && (is_cx::yes) && (sym_helper::check_diag_imag(X) == false)) { - arma_debug_warn_level(1, "logmat_sympd(): imaginary components on diagonal are non-zero"); + arma_conform_warn(1, "logmat_sympd(): imaginary components on diagonal are non-zero"); } if(is_op_diagmat::value || X.is_diagmat()) { - arma_extra_debug_print("op_logmat_sympd: detected diagonal matrix"); + arma_debug_print("op_logmat_sympd: detected diagonal matrix"); out = X; diff --git a/inst/include/armadillo_bits/op_max_meat.hpp b/inst/include/armadillo_bits/op_max_meat.hpp index 34de86b1..5e2b39a4 100644 --- a/inst/include/armadillo_bits/op_max_meat.hpp +++ b/inst/include/armadillo_bits/op_max_meat.hpp @@ -26,12 +26,12 @@ inline void op_max::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const uword dim = in.aux_uword_a; - arma_debug_check( (dim > 1), "max(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "max(): parameter 'dim' must be 0 or 1" ); const quasi_unwrap U(in.m); const Mat& X = U.M; @@ -57,7 +57,7 @@ inline void op_max::apply_noalias(Mat& out, const Mat& X, const uword dim, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const uword X_n_rows = X.n_rows; @@ -65,7 +65,7 @@ op_max::apply_noalias(Mat& out, const Mat& X, const uword dim, const typ if(dim == 0) { - arma_extra_debug_print("op_max::apply(): dim = 0"); + arma_debug_print("op_max::apply(): dim = 0"); out.set_size((X_n_rows > 0) ? 1 : 0, X_n_cols); @@ -81,7 +81,7 @@ op_max::apply_noalias(Mat& out, const Mat& X, const uword dim, const typ else if(dim == 1) { - arma_extra_debug_print("op_max::apply(): dim = 1"); + arma_debug_print("op_max::apply(): dim = 1"); out.set_size(X_n_rows, (X_n_cols > 0) ? 1 : 0); @@ -112,7 +112,7 @@ inline void op_max::apply_noalias(Mat& out, const Mat& X, const uword dim, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const uword X_n_rows = X.n_rows; @@ -120,7 +120,7 @@ op_max::apply_noalias(Mat& out, const Mat& X, const uword dim, const typ if(dim == 0) { - arma_extra_debug_print("op_max::apply(): dim = 0"); + arma_debug_print("op_max::apply(): dim = 0"); out.set_size((X_n_rows > 0) ? 1 : 0, X_n_cols); @@ -136,7 +136,7 @@ op_max::apply_noalias(Mat& out, const Mat& X, const uword dim, const typ else if(dim == 1) { - arma_extra_debug_print("op_max::apply(): dim = 1"); + arma_debug_print("op_max::apply(): dim = 1"); out.set_size(X_n_rows, (X_n_cols > 0) ? 1 : 0); @@ -158,12 +158,12 @@ inline void op_max::apply(Cube& out, const OpCube& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const uword dim = in.aux_uword_a; - arma_debug_check( (dim > 2), "max(): parameter 'dim' must be 0 or 1 or 2" ); + arma_conform_check( (dim > 2), "max(): parameter 'dim' must be 0 or 1 or 2" ); const unwrap_cube U(in.m); @@ -188,7 +188,7 @@ inline void op_max::apply_noalias(Cube& out, const Cube& X, const uword dim, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const uword X_n_rows = X.n_rows; @@ -197,7 +197,7 @@ op_max::apply_noalias(Cube& out, const Cube& X, const uword dim, const t if(dim == 0) { - arma_extra_debug_print("op_max::apply(): dim = 0"); + arma_debug_print("op_max::apply(): dim = 0"); out.set_size((X_n_rows > 0) ? 1 : 0, X_n_cols, X_n_slices); @@ -216,7 +216,7 @@ op_max::apply_noalias(Cube& out, const Cube& X, const uword dim, const t else if(dim == 1) { - arma_extra_debug_print("op_max::apply(): dim = 1"); + arma_debug_print("op_max::apply(): dim = 1"); out.set_size(X_n_rows, (X_n_cols > 0) ? 1 : 0, X_n_slices); @@ -244,7 +244,7 @@ op_max::apply_noalias(Cube& out, const Cube& X, const uword dim, const t else if(dim == 2) { - arma_extra_debug_print("op_max::apply(): dim = 2"); + arma_debug_print("op_max::apply(): dim = 2"); out.set_size(X_n_rows, X_n_cols, (X_n_slices > 0) ? 1 : 0); @@ -277,7 +277,7 @@ inline void op_max::apply_noalias(Cube& out, const Cube& X, const uword dim, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const uword X_n_rows = X.n_rows; @@ -286,7 +286,7 @@ op_max::apply_noalias(Cube& out, const Cube& X, const uword dim, const t if(dim == 0) { - arma_extra_debug_print("op_max::apply(): dim = 0"); + arma_debug_print("op_max::apply(): dim = 0"); out.set_size((X_n_rows > 0) ? 1 : 0, X_n_cols, X_n_slices); @@ -305,7 +305,7 @@ op_max::apply_noalias(Cube& out, const Cube& X, const uword dim, const t else if(dim == 1) { - arma_extra_debug_print("op_max::apply(): dim = 1"); + arma_debug_print("op_max::apply(): dim = 1"); out.set_size(X_n_rows, (X_n_cols > 0) ? 1 : 0, X_n_slices); @@ -326,7 +326,7 @@ op_max::apply_noalias(Cube& out, const Cube& X, const uword dim, const t else if(dim == 2) { - arma_extra_debug_print("op_max::apply(): dim = 2"); + arma_debug_print("op_max::apply(): dim = 2"); out.set_size(X_n_rows, X_n_cols, (X_n_slices > 0) ? 1 : 0); @@ -359,7 +359,7 @@ inline eT op_max::direct_max(const eT* const X, const uword n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eT max_val_i = priv::most_neg(); eT max_val_j = priv::most_neg(); @@ -391,7 +391,7 @@ inline eT op_max::direct_max(const eT* const X, const uword n_elem, uword& index_of_max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eT max_val_i = priv::most_neg(); eT max_val_j = priv::most_neg(); @@ -428,7 +428,7 @@ inline eT op_max::direct_max(const Mat& X, const uword row) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword X_n_cols = X.n_cols; @@ -462,11 +462,11 @@ inline eT op_max::max(const subview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(X.n_elem == 0) { - arma_debug_check(true, "max(): object has no elements"); + arma_conform_check(true, "max(): object has no elements"); return Datum::nan; } @@ -523,7 +523,7 @@ inline typename arma_not_cx::result op_max::max(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -533,7 +533,7 @@ op_max::max(const Base& X) if(n_elem == 0) { - arma_debug_check(true, "max(): object has no elements"); + arma_conform_check(true, "max(): object has no elements"); return Datum::nan; } @@ -623,7 +623,7 @@ inline typename arma_not_cx::result op_max::max(const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -633,7 +633,7 @@ op_max::max(const BaseCube& X) if(n_elem == 0) { - arma_debug_check(true, "max(): object has no elements"); + arma_conform_check(true, "max(): object has no elements"); return Datum::nan; } @@ -695,7 +695,7 @@ inline typename arma_not_cx::result op_max::max_with_index(const Proxy& P, uword& index_of_max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -703,7 +703,7 @@ op_max::max_with_index(const Proxy& P, uword& index_of_max_val) if(n_elem == 0) { - arma_debug_check(true, "max(): object has no elements"); + arma_conform_check(true, "max(): object has no elements"); return Datum::nan; } @@ -776,7 +776,7 @@ inline typename arma_not_cx::result op_max::max_with_index(const ProxyCube& P, uword& index_of_max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -784,7 +784,7 @@ op_max::max_with_index(const ProxyCube& P, uword& index_of_max_val) if(n_elem == 0) { - arma_debug_check(true, "max(): object has no elements"); + arma_conform_check(true, "max(): object has no elements"); return Datum::nan; } @@ -837,7 +837,7 @@ inline std::complex op_max::direct_max(const std::complex* const X, const uword n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uword index = 0; T max_val = priv::most_neg(); @@ -863,7 +863,7 @@ inline std::complex op_max::direct_max(const std::complex* const X, const uword n_elem, uword& index_of_max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uword index = 0; T max_val = priv::most_neg(); @@ -891,7 +891,7 @@ inline std::complex op_max::direct_max(const Mat< std::complex >& X, const uword row) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword X_n_cols = X.n_cols; @@ -919,13 +919,13 @@ inline std::complex op_max::max(const subview< std::complex >& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; if(X.n_elem == 0) { - arma_debug_check(true, "max(): object has no elements"); + arma_conform_check(true, "max(): object has no elements"); return Datum::nan; } @@ -989,7 +989,7 @@ inline typename arma_cx_only::result op_max::max(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename get_pod_type::result T; @@ -1000,7 +1000,7 @@ op_max::max(const Base& X) if(n_elem == 0) { - arma_debug_check(true, "max(): object has no elements"); + arma_conform_check(true, "max(): object has no elements"); return Datum::nan; } @@ -1077,7 +1077,7 @@ inline typename arma_cx_only::result op_max::max(const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename get_pod_type::result T; @@ -1088,7 +1088,7 @@ op_max::max(const BaseCube& X) if(n_elem == 0) { - arma_debug_check(true, "max(): object has no elements"); + arma_conform_check(true, "max(): object has no elements"); return Datum::nan; } @@ -1149,7 +1149,7 @@ inline typename arma_cx_only::result op_max::max_with_index(const Proxy& P, uword& index_of_max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename get_pod_type::result T; @@ -1158,7 +1158,7 @@ op_max::max_with_index(const Proxy& P, uword& index_of_max_val) if(n_elem == 0) { - arma_debug_check(true, "max(): object has no elements"); + arma_conform_check(true, "max(): object has no elements"); return Datum::nan; } @@ -1252,7 +1252,7 @@ inline typename arma_cx_only::result op_max::max_with_index(const ProxyCube& P, uword& index_of_max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename get_pod_type::result T; @@ -1261,7 +1261,7 @@ op_max::max_with_index(const ProxyCube& P, uword& index_of_max_val) if(n_elem == 0) { - arma_debug_check(true, "max(): object has no elements"); + arma_conform_check(true, "max(): object has no elements"); return Datum::nan; } diff --git a/inst/include/armadillo_bits/op_mean_meat.hpp b/inst/include/armadillo_bits/op_mean_meat.hpp index 7e7a49d3..3f06b263 100644 --- a/inst/include/armadillo_bits/op_mean_meat.hpp +++ b/inst/include/armadillo_bits/op_mean_meat.hpp @@ -26,12 +26,12 @@ inline void op_mean::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const uword dim = in.aux_uword_a; - arma_debug_check( (dim > 1), "mean(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "mean(): parameter 'dim' must be 0 or 1" ); const Proxy P(in.m); @@ -56,7 +56,7 @@ inline void op_mean::apply_noalias(Mat& out, const Proxy& P, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(is_Mat::stored_type>::value) { @@ -75,7 +75,7 @@ inline void op_mean::apply_noalias_unwrap(Mat& out, const Proxy& P, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename get_pod_type::result T; @@ -140,7 +140,7 @@ inline void op_mean::apply_noalias_proxy(Mat& out, const Proxy& P, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename get_pod_type::result T; @@ -213,12 +213,12 @@ inline void op_mean::apply(Cube& out, const OpCube& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const uword dim = in.aux_uword_a; - arma_debug_check( (dim > 2), "mean(): parameter 'dim' must be 0 or 1 or 2" ); + arma_conform_check( (dim > 2), "mean(): parameter 'dim' must be 0 or 1 or 2" ); const ProxyCube P(in.m); @@ -243,7 +243,7 @@ inline void op_mean::apply_noalias(Cube& out, const ProxyCube& P, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(is_Cube::stored_type>::value) { @@ -262,7 +262,7 @@ inline void op_mean::apply_noalias_unwrap(Cube& out, const ProxyCube& P, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename get_pod_type::result T; @@ -368,7 +368,7 @@ inline void op_mean::apply_noalias_proxy(Cube& out, const ProxyCube& P, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); op_mean::apply_noalias_unwrap(out, P, dim); @@ -387,7 +387,7 @@ inline eT op_mean::direct_mean(const eT* const X, const uword n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -403,7 +403,7 @@ inline eT op_mean::direct_mean_robust(const eT* const X, const uword n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // use an adapted form of the mean finding algorithm from the running_stat class @@ -440,7 +440,7 @@ inline eT op_mean::direct_mean(const Mat& X, const uword row) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -472,7 +472,7 @@ inline eT op_mean::direct_mean_robust(const Mat& X, const uword row) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -495,7 +495,7 @@ inline eT op_mean::mean_all(const subview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -505,7 +505,7 @@ op_mean::mean_all(const subview& X) if(X_n_elem == 0) { - arma_debug_check(true, "mean(): object has no elements"); + arma_conform_check(true, "mean(): object has no elements"); return Datum::nan; } @@ -553,7 +553,7 @@ inline eT op_mean::mean_all_robust(const subview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -601,7 +601,7 @@ inline eT op_mean::mean_all(const diagview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -609,7 +609,7 @@ op_mean::mean_all(const diagview& X) if(X_n_elem == 0) { - arma_debug_check(true, "mean(): object has no elements"); + arma_conform_check(true, "mean(): object has no elements"); return Datum::nan; } @@ -633,7 +633,7 @@ inline eT op_mean::mean_all_robust(const diagview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -656,7 +656,7 @@ inline typename T1::elem_type op_mean::mean_all(const Op& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return op_mean::mean_all(X.m); } @@ -668,7 +668,7 @@ inline typename T1::elem_type op_mean::mean_all(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -679,7 +679,7 @@ op_mean::mean_all(const Base& X) if(A_n_elem == 0) { - arma_debug_check(true, "mean(): object has no elements"); + arma_conform_check(true, "mean(): object has no elements"); return Datum::nan; } diff --git a/inst/include/armadillo_bits/op_median_meat.hpp b/inst/include/armadillo_bits/op_median_meat.hpp index ae805153..a2efd84d 100644 --- a/inst/include/armadillo_bits/op_median_meat.hpp +++ b/inst/include/armadillo_bits/op_median_meat.hpp @@ -26,7 +26,7 @@ inline void op_median::apply(Mat& out, const Op& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -34,8 +34,8 @@ op_median::apply(Mat& out, const Op& expr) const uword dim = expr.aux_uword_a; - arma_debug_check( U.M.internal_has_nan(), "median(): detected NaN" ); - arma_debug_check( (dim > 1), "median(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( U.M.internal_has_nan(), "median(): detected NaN" ); + arma_conform_check( (dim > 1), "median(): parameter 'dim' must be 0 or 1" ); if(U.is_alias(out)) { @@ -58,7 +58,7 @@ inline void op_median::apply_noalias(Mat& out, const Mat& X, const uword dim, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const uword X_n_rows = X.n_rows; @@ -66,7 +66,7 @@ op_median::apply_noalias(Mat& out, const Mat& X, const uword dim, const if(dim == 0) // in each column { - arma_extra_debug_print("op_median::apply(): dim = 0"); + arma_debug_print("op_median::apply(): dim = 0"); out.set_size((X_n_rows > 0) ? 1 : 0, X_n_cols); @@ -85,7 +85,7 @@ op_median::apply_noalias(Mat& out, const Mat& X, const uword dim, const else if(dim == 1) // in each row { - arma_extra_debug_print("op_median::apply(): dim = 1"); + arma_debug_print("op_median::apply(): dim = 1"); out.set_size(X_n_rows, (X_n_cols > 0) ? 1 : 0); @@ -110,7 +110,7 @@ inline void op_median::apply_noalias(Mat& out, const Mat& X, const uword dim, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename get_pod_type::result T; @@ -120,7 +120,7 @@ op_median::apply_noalias(Mat& out, const Mat& X, const uword dim, const if(dim == 0) // in each column { - arma_extra_debug_print("op_median::apply(): dim = 0"); + arma_debug_print("op_median::apply(): dim = 0"); out.set_size((X_n_rows > 0) ? 1 : 0, X_n_cols); @@ -149,7 +149,7 @@ op_median::apply_noalias(Mat& out, const Mat& X, const uword dim, const else if(dim == 1) // in each row { - arma_extra_debug_print("op_median::apply(): dim = 1"); + arma_debug_print("op_median::apply(): dim = 1"); out.set_size(X_n_rows, (X_n_cols > 0) ? 1 : 0); @@ -186,7 +186,7 @@ op_median::median_vec const typename arma_not_cx::result* junk ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; @@ -197,12 +197,12 @@ op_median::median_vec if(n_elem == 0) { - arma_debug_check(true, "median(): object has no elements"); + arma_conform_check(true, "median(): object has no elements"); return Datum::nan; } - arma_debug_check( U.M.internal_has_nan(), "median(): detected NaN" ); + arma_conform_check( U.M.internal_has_nan(), "median(): detected NaN" ); std::vector tmp_vec(n_elem); @@ -222,7 +222,7 @@ op_median::median_vec const typename arma_cx_only::result* junk ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; @@ -234,12 +234,12 @@ op_median::median_vec if(n_elem == 0) { - arma_debug_check(true, "median(): object has no elements"); + arma_conform_check(true, "median(): object has no elements"); return Datum::nan; } - arma_debug_check( U.M.internal_has_nan(), "median(): detected NaN" ); + arma_conform_check( U.M.internal_has_nan(), "median(): detected NaN" ); std::vector< arma_cx_median_packet > tmp_vec(n_elem); @@ -265,7 +265,7 @@ inline eT op_median::direct_median(std::vector& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_elem = uword(X.size()); const uword half = n_elem/2; @@ -304,7 +304,7 @@ op_median::direct_cx_median_index std::vector< arma_cx_median_packet >& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef arma_cx_median_packet eT; diff --git a/inst/include/armadillo_bits/op_min_meat.hpp b/inst/include/armadillo_bits/op_min_meat.hpp index 9879185d..8fa6e74f 100644 --- a/inst/include/armadillo_bits/op_min_meat.hpp +++ b/inst/include/armadillo_bits/op_min_meat.hpp @@ -26,12 +26,12 @@ inline void op_min::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const uword dim = in.aux_uword_a; - arma_debug_check( (dim > 1), "min(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "min(): parameter 'dim' must be 0 or 1" ); const quasi_unwrap U(in.m); const Mat& X = U.M; @@ -57,7 +57,7 @@ inline void op_min::apply_noalias(Mat& out, const Mat& X, const uword dim, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const uword X_n_rows = X.n_rows; @@ -65,7 +65,7 @@ op_min::apply_noalias(Mat& out, const Mat& X, const uword dim, const typ if(dim == 0) { - arma_extra_debug_print("op_min::apply(): dim = 0"); + arma_debug_print("op_min::apply(): dim = 0"); out.set_size((X_n_rows > 0) ? 1 : 0, X_n_cols); @@ -81,7 +81,7 @@ op_min::apply_noalias(Mat& out, const Mat& X, const uword dim, const typ else if(dim == 1) { - arma_extra_debug_print("op_min::apply(): dim = 1"); + arma_debug_print("op_min::apply(): dim = 1"); out.set_size(X_n_rows, (X_n_cols > 0) ? 1 : 0); @@ -112,7 +112,7 @@ inline void op_min::apply_noalias(Mat& out, const Mat& X, const uword dim, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const uword X_n_rows = X.n_rows; @@ -120,7 +120,7 @@ op_min::apply_noalias(Mat& out, const Mat& X, const uword dim, const typ if(dim == 0) { - arma_extra_debug_print("op_min::apply(): dim = 0"); + arma_debug_print("op_min::apply(): dim = 0"); out.set_size((X_n_rows > 0) ? 1 : 0, X_n_cols); @@ -136,7 +136,7 @@ op_min::apply_noalias(Mat& out, const Mat& X, const uword dim, const typ else if(dim == 1) { - arma_extra_debug_print("op_min::apply(): dim = 1"); + arma_debug_print("op_min::apply(): dim = 1"); out.set_size(X_n_rows, (X_n_cols > 0) ? 1 : 0); @@ -158,12 +158,12 @@ inline void op_min::apply(Cube& out, const OpCube& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const uword dim = in.aux_uword_a; - arma_debug_check( (dim > 2), "min(): parameter 'dim' must be 0 or 1 or 2" ); + arma_conform_check( (dim > 2), "min(): parameter 'dim' must be 0 or 1 or 2" ); const unwrap_cube U(in.m); @@ -188,7 +188,7 @@ inline void op_min::apply_noalias(Cube& out, const Cube& X, const uword dim, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const uword X_n_rows = X.n_rows; @@ -197,7 +197,7 @@ op_min::apply_noalias(Cube& out, const Cube& X, const uword dim, const t if(dim == 0) { - arma_extra_debug_print("op_min::apply(): dim = 0"); + arma_debug_print("op_min::apply(): dim = 0"); out.set_size((X_n_rows > 0) ? 1 : 0, X_n_cols, X_n_slices); @@ -216,7 +216,7 @@ op_min::apply_noalias(Cube& out, const Cube& X, const uword dim, const t else if(dim == 1) { - arma_extra_debug_print("op_min::apply(): dim = 1"); + arma_debug_print("op_min::apply(): dim = 1"); out.set_size(X_n_rows, (X_n_cols > 0) ? 1 : 0, X_n_slices); @@ -244,7 +244,7 @@ op_min::apply_noalias(Cube& out, const Cube& X, const uword dim, const t else if(dim == 2) { - arma_extra_debug_print("op_min::apply(): dim = 2"); + arma_debug_print("op_min::apply(): dim = 2"); out.set_size(X_n_rows, X_n_cols, (X_n_slices > 0) ? 1 : 0); @@ -277,7 +277,7 @@ inline void op_min::apply_noalias(Cube& out, const Cube& X, const uword dim, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const uword X_n_rows = X.n_rows; @@ -286,7 +286,7 @@ op_min::apply_noalias(Cube& out, const Cube& X, const uword dim, const t if(dim == 0) { - arma_extra_debug_print("op_min::apply(): dim = 0"); + arma_debug_print("op_min::apply(): dim = 0"); out.set_size((X_n_rows > 0) ? 1 : 0, X_n_cols, X_n_slices); @@ -305,7 +305,7 @@ op_min::apply_noalias(Cube& out, const Cube& X, const uword dim, const t else if(dim == 1) { - arma_extra_debug_print("op_min::apply(): dim = 1"); + arma_debug_print("op_min::apply(): dim = 1"); out.set_size(X_n_rows, (X_n_cols > 0) ? 1 : 0, X_n_slices); @@ -326,7 +326,7 @@ op_min::apply_noalias(Cube& out, const Cube& X, const uword dim, const t else if(dim == 2) { - arma_extra_debug_print("op_min::apply(): dim = 2"); + arma_debug_print("op_min::apply(): dim = 2"); out.set_size(X_n_rows, X_n_cols, (X_n_slices > 0) ? 1 : 0); @@ -359,7 +359,7 @@ inline eT op_min::direct_min(const eT* const X, const uword n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eT min_val_i = priv::most_pos(); eT min_val_j = priv::most_pos(); @@ -391,7 +391,7 @@ inline eT op_min::direct_min(const eT* const X, const uword n_elem, uword& index_of_min_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eT min_val_i = priv::most_pos(); eT min_val_j = priv::most_pos(); @@ -428,7 +428,7 @@ inline eT op_min::direct_min(const Mat& X, const uword row) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword X_n_cols = X.n_cols; @@ -462,11 +462,11 @@ inline eT op_min::min(const subview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(X.n_elem == 0) { - arma_debug_check(true, "min(): object has no elements"); + arma_conform_check(true, "min(): object has no elements"); return Datum::nan; } @@ -523,7 +523,7 @@ inline typename arma_not_cx::result op_min::min(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -533,7 +533,7 @@ op_min::min(const Base& X) if(n_elem == 0) { - arma_debug_check(true, "min(): object has no elements"); + arma_conform_check(true, "min(): object has no elements"); return Datum::nan; } @@ -623,7 +623,7 @@ inline typename arma_not_cx::result op_min::min(const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -633,7 +633,7 @@ op_min::min(const BaseCube& X) if(n_elem == 0) { - arma_debug_check(true, "min(): object has no elements"); + arma_conform_check(true, "min(): object has no elements"); return Datum::nan; } @@ -695,7 +695,7 @@ inline typename arma_not_cx::result op_min::min_with_index(const Proxy& P, uword& index_of_min_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -703,7 +703,7 @@ op_min::min_with_index(const Proxy& P, uword& index_of_min_val) if(n_elem == 0) { - arma_debug_check(true, "min(): object has no elements"); + arma_conform_check(true, "min(): object has no elements"); return Datum::nan; } @@ -776,7 +776,7 @@ inline typename arma_not_cx::result op_min::min_with_index(const ProxyCube& P, uword& index_of_min_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -784,7 +784,7 @@ op_min::min_with_index(const ProxyCube& P, uword& index_of_min_val) if(n_elem == 0) { - arma_debug_check(true, "min(): object has no elements"); + arma_conform_check(true, "min(): object has no elements"); return Datum::nan; } @@ -837,7 +837,7 @@ inline std::complex op_min::direct_min(const std::complex* const X, const uword n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uword index = 0; T min_val = priv::most_pos(); @@ -863,7 +863,7 @@ inline std::complex op_min::direct_min(const std::complex* const X, const uword n_elem, uword& index_of_min_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uword index = 0; T min_val = priv::most_pos(); @@ -891,7 +891,7 @@ inline std::complex op_min::direct_min(const Mat< std::complex >& X, const uword row) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword X_n_cols = X.n_cols; @@ -919,13 +919,13 @@ inline std::complex op_min::min(const subview< std::complex >& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; if(X.n_elem == 0) { - arma_debug_check(true, "min(): object has no elements"); + arma_conform_check(true, "min(): object has no elements"); return Datum::nan; } @@ -989,7 +989,7 @@ inline typename arma_cx_only::result op_min::min(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename get_pod_type::result T; @@ -1000,7 +1000,7 @@ op_min::min(const Base& X) if(n_elem == 0) { - arma_debug_check(true, "min(): object has no elements"); + arma_conform_check(true, "min(): object has no elements"); return Datum::nan; } @@ -1077,7 +1077,7 @@ inline typename arma_cx_only::result op_min::min(const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename get_pod_type::result T; @@ -1088,7 +1088,7 @@ op_min::min(const BaseCube& X) if(n_elem == 0) { - arma_debug_check(true, "min(): object has no elements"); + arma_conform_check(true, "min(): object has no elements"); return Datum::nan; } @@ -1149,7 +1149,7 @@ inline typename arma_cx_only::result op_min::min_with_index(const Proxy& P, uword& index_of_min_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename get_pod_type::result T; @@ -1158,7 +1158,7 @@ op_min::min_with_index(const Proxy& P, uword& index_of_min_val) if(n_elem == 0) { - arma_debug_check(true, "min(): object has no elements"); + arma_conform_check(true, "min(): object has no elements"); return Datum::nan; } @@ -1252,7 +1252,7 @@ inline typename arma_cx_only::result op_min::min_with_index(const ProxyCube& P, uword& index_of_min_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename get_pod_type::result T; @@ -1261,7 +1261,7 @@ op_min::min_with_index(const ProxyCube& P, uword& index_of_min_val) if(n_elem == 0) { - arma_debug_check(true, "min(): object has no elements"); + arma_conform_check(true, "min(): object has no elements"); return Datum::nan; } diff --git a/inst/include/armadillo_bits/op_misc_meat.hpp b/inst/include/armadillo_bits/op_misc_meat.hpp index d1c2f364..0f6a7b96 100644 --- a/inst/include/armadillo_bits/op_misc_meat.hpp +++ b/inst/include/armadillo_bits/op_misc_meat.hpp @@ -26,7 +26,7 @@ inline void op_real::apply( Mat& out, const mtOp& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; @@ -69,7 +69,7 @@ inline void op_real::apply( Cube& out, const mtOpCube& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; @@ -114,7 +114,7 @@ inline void op_imag::apply( Mat& out, const mtOp& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; @@ -157,7 +157,7 @@ inline void op_imag::apply( Cube& out, const mtOpCube& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; @@ -202,7 +202,7 @@ inline void op_abs::apply( Mat& out, const mtOp& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; @@ -258,7 +258,7 @@ inline void op_abs::apply( Cube& out, const mtOpCube& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; @@ -316,7 +316,7 @@ inline void op_arg::apply( Mat& out, const mtOp& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; @@ -360,7 +360,7 @@ inline void op_arg::apply( Cube& out, const mtOpCube& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; diff --git a/inst/include/armadillo_bits/op_nonzeros_meat.hpp b/inst/include/armadillo_bits/op_nonzeros_meat.hpp index 8cf32fa1..15b9d820 100644 --- a/inst/include/armadillo_bits/op_nonzeros_meat.hpp +++ b/inst/include/armadillo_bits/op_nonzeros_meat.hpp @@ -27,7 +27,7 @@ inline void op_nonzeros::apply_noalias(Mat& out, const Proxy& P) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -74,7 +74,7 @@ inline void op_nonzeros::apply(Mat& out, const Op& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -103,7 +103,7 @@ inline void op_nonzeros_spmat::apply(Mat& out, const SpToDOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/op_norm2est_meat.hpp b/inst/include/armadillo_bits/op_norm2est_meat.hpp index b809d134..07b12ce9 100644 --- a/inst/include/armadillo_bits/op_norm2est_meat.hpp +++ b/inst/include/armadillo_bits/op_norm2est_meat.hpp @@ -25,7 +25,7 @@ template inline norm2est_randu_filler::norm2est_randu_filler() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::mt19937_64::result_type local_seed_type; @@ -42,7 +42,7 @@ inline void norm2est_randu_filler::fill(eT* mem, const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); for(uword i=0; i inline norm2est_randu_filler< std::complex >::norm2est_randu_filler() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::mt19937_64::result_type local_seed_type; @@ -72,7 +72,7 @@ inline void norm2est_randu_filler< std::complex >::fill(std::complex* mem, const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); for(uword i=0; i 0" ); - arma_debug_check( (max_iter == uword(0)), "norm2est(): parameter 'max_iter' must be > 0" ); + arma_conform_check( (tolerance < T(0)), "norm2est(): parameter 'tolerance' must be > 0" ); + arma_conform_check( (max_iter == uword(0)), "norm2est(): parameter 'max_iter' must be > 0" ); const T tol = (tolerance == T(0)) ? T(1e-6) : T(tolerance); @@ -116,7 +116,7 @@ op_norm2est::norm2est if(A.n_elem == 0) { return T(0); } - if(A.internal_has_nonfinite()) { arma_debug_warn_level(1, "norm2est(): given matrix has non-finite elements"); } + if(A.internal_has_nonfinite()) { arma_conform_warn(1, "norm2est(): given matrix has non-finite elements"); } if((A.n_rows == 1) || (A.n_cols == 1)) { return op_norm::vec_norm_2( Proxy< Mat >(A) ); } @@ -132,7 +132,7 @@ op_norm2est::norm2est for(uword i=0; i >(y) ); - arma_extra_debug_print(arma_str::format("norm2est(): est_old: %e") % est_old); - arma_extra_debug_print(arma_str::format("norm2est(): est_cur: %e") % est_cur); + arma_debug_print(arma_str::format("norm2est(): est_old: %e") % est_old); + arma_debug_print(arma_str::format("norm2est(): est_cur: %e") % est_cur); if(arma_isfinite(est_cur) == false) { return est_old; } @@ -181,13 +181,13 @@ op_norm2est::norm2est const uword max_iter ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; typedef typename T1::elem_type eT; - arma_debug_check( (tolerance < T(0)), "norm2est(): parameter 'tolerance' must be > 0" ); - arma_debug_check( (max_iter == uword(0)), "norm2est(): parameter 'max_iter' must be > 0" ); + arma_conform_check( (tolerance < T(0)), "norm2est(): parameter 'tolerance' must be > 0" ); + arma_conform_check( (max_iter == uword(0)), "norm2est(): parameter 'max_iter' must be > 0" ); const T tol = (tolerance == T(0)) ? T(1e-6) : T(tolerance); @@ -196,7 +196,7 @@ op_norm2est::norm2est if(A.n_nonzero == 0) { return T(0); } - if(A.internal_has_nonfinite()) { arma_debug_warn_level(1, "norm2est(): given matrix has non-finite elements"); } + if(A.internal_has_nonfinite()) { arma_conform_warn(1, "norm2est(): given matrix has non-finite elements"); } if((A.n_rows == 1) || (A.n_cols == 1)) { return spop_norm::vec_norm_k(A.values, A.n_nonzero, 2); } @@ -212,7 +212,7 @@ op_norm2est::norm2est for(uword i=0; i >(y) ); - arma_extra_debug_print(arma_str::format("norm2est(): est_old: %e") % est_old); - arma_extra_debug_print(arma_str::format("norm2est(): est_cur: %e") % est_cur); + arma_debug_print(arma_str::format("norm2est(): est_old: %e") % est_old); + arma_debug_print(arma_str::format("norm2est(): est_cur: %e") % est_cur); if(arma_isfinite(est_cur) == false) { return est_old; } diff --git a/inst/include/armadillo_bits/op_norm_meat.hpp b/inst/include/armadillo_bits/op_norm_meat.hpp index 05157766..85871d5e 100644 --- a/inst/include/armadillo_bits/op_norm_meat.hpp +++ b/inst/include/armadillo_bits/op_norm_meat.hpp @@ -26,7 +26,7 @@ inline typename T1::pod_type op_norm::vec_norm_1(const Proxy& P, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const bool use_direct_mem = (is_Mat::stored_type>::value) || (is_subview_col::stored_type>::value) || (arma_config::openmp && Proxy::use_mp); @@ -112,7 +112,7 @@ inline typename T1::pod_type op_norm::vec_norm_1(const Proxy& P, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; @@ -174,7 +174,7 @@ op_norm::vec_norm_1(const Proxy& P, const typename arma_cx_only::stored_type> R(P.Q); @@ -219,7 +219,7 @@ inline eT op_norm::vec_norm_1_direct_std(const Mat& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N = X.n_elem; const eT* A = X.memptr(); @@ -228,7 +228,7 @@ op_norm::vec_norm_1_direct_std(const Mat& X) #if defined(ARMA_USE_ATLAS) { - arma_extra_debug_print("atlas::cblas_asum()"); + arma_debug_print("atlas::cblas_asum()"); out_val = atlas::cblas_asum(N,A); } #elif defined(ARMA_USE_BLAS) @@ -239,7 +239,7 @@ op_norm::vec_norm_1_direct_std(const Mat& X) } else { - arma_extra_debug_print("blas::asum()"); + arma_debug_print("blas::asum()"); out_val = blas::asum(N,A); } } @@ -259,7 +259,7 @@ inline eT op_norm::vec_norm_1_direct_mem(const uword N, const eT* A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if (defined(ARMA_SIMPLE_LOOPS) || defined(__FAST_MATH__)) { @@ -311,7 +311,7 @@ inline typename T1::pod_type op_norm::vec_norm_2(const Proxy& P, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); const bool use_direct_mem = (is_Mat::stored_type>::value) || (is_subview_col::stored_type>::value) || (arma_config::openmp && Proxy::use_mp); @@ -403,7 +403,7 @@ op_norm::vec_norm_2(const Proxy& P, const typename arma_not_cx::stored_type> tmp(P.Q); @@ -418,7 +418,7 @@ inline typename T1::pod_type op_norm::vec_norm_2(const Proxy& P, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; @@ -482,7 +482,7 @@ op_norm::vec_norm_2(const Proxy& P, const typename arma_cx_only::stored_type> R(P.Q); @@ -520,7 +520,7 @@ inline eT op_norm::vec_norm_2_direct_std(const Mat& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N = X.n_elem; const eT* A = X.memptr(); @@ -529,7 +529,7 @@ op_norm::vec_norm_2_direct_std(const Mat& X) #if defined(ARMA_USE_ATLAS) { - arma_extra_debug_print("atlas::cblas_nrm2()"); + arma_debug_print("atlas::cblas_nrm2()"); out_val = atlas::cblas_nrm2(N,A); } #elif defined(ARMA_USE_BLAS) @@ -540,7 +540,7 @@ op_norm::vec_norm_2_direct_std(const Mat& X) } else { - arma_extra_debug_print("blas::nrm2()"); + arma_debug_print("blas::nrm2()"); out_val = blas::nrm2(N,A); } } @@ -556,7 +556,7 @@ op_norm::vec_norm_2_direct_std(const Mat& X) } else { - arma_extra_debug_print("detected possible underflow or overflow"); + arma_debug_print("detected possible underflow or overflow"); return op_norm::vec_norm_2_direct_robust(X); } @@ -569,7 +569,7 @@ inline eT op_norm::vec_norm_2_direct_mem(const uword N, const eT* A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eT acc = eT(0); @@ -627,7 +627,7 @@ inline eT op_norm::vec_norm_2_direct_robust(const Mat& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N = X.n_elem; const eT* A = X.memptr(); @@ -693,7 +693,7 @@ inline typename T1::pod_type op_norm::vec_norm_k(const Proxy& P, const int k) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; @@ -742,7 +742,7 @@ inline typename T1::pod_type op_norm::vec_norm_max(const Proxy& P) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; @@ -807,7 +807,7 @@ inline typename T1::pod_type op_norm::vec_norm_min(const Proxy& P) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; @@ -872,7 +872,7 @@ inline typename get_pod_type::result op_norm::mat_norm_1(const Mat& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // TODO: this can be sped up with a dedicated implementation return as_scalar( max( sum(abs(X), 0), 1) ); @@ -885,11 +885,11 @@ inline typename get_pod_type::result op_norm::mat_norm_2(const Mat& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; - if(X.internal_has_nonfinite()) { arma_debug_warn_level(1, "norm(): given matrix has non-finite elements"); } + if(X.internal_has_nonfinite()) { arma_conform_warn(1, "norm(): given matrix has non-finite elements"); } Col S; @@ -907,7 +907,7 @@ inline typename get_pod_type::result op_norm::mat_norm_inf(const Mat& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // TODO: this can be sped up with a dedicated implementation return as_scalar( max( sum(abs(X), 1), 0) ); diff --git a/inst/include/armadillo_bits/op_normalise_meat.hpp b/inst/include/armadillo_bits/op_normalise_meat.hpp index e56c390d..58efab2d 100644 --- a/inst/include/armadillo_bits/op_normalise_meat.hpp +++ b/inst/include/armadillo_bits/op_normalise_meat.hpp @@ -27,14 +27,14 @@ inline void op_normalise_vec::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; const uword p = in.aux_uword_a; - arma_debug_check( (p == 0), "normalise(): unsupported vector norm type" ); + arma_conform_check( (p == 0), "normalise(): unsupported vector norm type" ); const quasi_unwrap U(in.m); @@ -60,15 +60,15 @@ inline void op_normalise_mat::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const uword p = in.aux_uword_a; const uword dim = in.aux_uword_b; - arma_debug_check( (p == 0), "normalise(): unsupported vector norm type" ); - arma_debug_check( (dim > 1), "normalise(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (p == 0), "normalise(): unsupported vector norm type" ); + arma_conform_check( (dim > 1), "normalise(): parameter 'dim' must be 0 or 1" ); const quasi_unwrap U(in.m); @@ -93,7 +93,7 @@ inline void op_normalise_mat::apply(Mat& out, const Mat& A, const uword p, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; diff --git a/inst/include/armadillo_bits/op_orth_null_meat.hpp b/inst/include/armadillo_bits/op_orth_null_meat.hpp index 4a776ba4..b8fbb2ea 100644 --- a/inst/include/armadillo_bits/op_orth_null_meat.hpp +++ b/inst/include/armadillo_bits/op_orth_null_meat.hpp @@ -27,7 +27,7 @@ inline void op_orth::apply(Mat& out, const Op& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; @@ -49,12 +49,12 @@ inline bool op_orth::apply_direct(Mat& out, const Base& expr, typename T1::pod_type tol) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; - arma_debug_check((tol < T(0)), "orth(): tolerance must be >= 0"); + arma_conform_check((tol < T(0)), "orth(): tolerance must be >= 0"); Mat A(expr.get_ref()); @@ -103,7 +103,7 @@ inline void op_null::apply(Mat& out, const Op& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; @@ -125,12 +125,12 @@ inline bool op_null::apply_direct(Mat& out, const Base& expr, typename T1::pod_type tol) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; - arma_debug_check((tol < T(0)), "null(): tolerance must be >= 0"); + arma_conform_check((tol < T(0)), "null(): tolerance must be >= 0"); Mat A(expr.get_ref()); diff --git a/inst/include/armadillo_bits/op_pinv_meat.hpp b/inst/include/armadillo_bits/op_pinv_meat.hpp index f4dac14f..9012bc3a 100644 --- a/inst/include/armadillo_bits/op_pinv_meat.hpp +++ b/inst/include/armadillo_bits/op_pinv_meat.hpp @@ -27,7 +27,7 @@ inline void op_pinv_default::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_pinv_default::apply_direct(out, in.m); @@ -45,7 +45,7 @@ inline bool op_pinv_default::apply_direct(Mat& out, const Base& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; @@ -66,7 +66,7 @@ inline void op_pinv::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; @@ -89,12 +89,12 @@ inline bool op_pinv::apply_direct(Mat& out, const Base& expr, typename T1::pod_type tol, const uword method_id) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; - arma_debug_check((tol < T(0)), "pinv(): tolerance must be >= 0"); + arma_conform_check((tol < T(0)), "pinv(): tolerance must be >= 0"); // method_id = 0 -> default setting // method_id = 1 -> use standard algorithm @@ -106,7 +106,7 @@ op_pinv::apply_direct(Mat& out, const Base::value || A.is_diagmat()) { - arma_extra_debug_print("op_pinv: detected diagonal matrix"); + arma_debug_print("op_pinv: detected diagonal matrix"); return op_pinv::apply_diag(out, A, tol); } @@ -132,7 +132,7 @@ op_pinv::apply_direct(Mat& out, const Base& out, const Mat& A, typename get_pod_type::result tol) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -193,7 +193,7 @@ inline bool op_pinv::apply_sym(Mat& out, const Mat& A, typename get_pod_type::result tol, const uword method_id) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -250,7 +250,7 @@ inline bool op_pinv::apply_gen(Mat& out, Mat& A, typename get_pod_type::result tol, const uword method_id) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; diff --git a/inst/include/armadillo_bits/op_powmat_meat.hpp b/inst/include/armadillo_bits/op_powmat_meat.hpp index 323db320..bbd104cf 100644 --- a/inst/include/armadillo_bits/op_powmat_meat.hpp +++ b/inst/include/armadillo_bits/op_powmat_meat.hpp @@ -26,7 +26,7 @@ inline void op_powmat::apply(Mat& out, const Op& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword y = expr.aux_uword_a; const bool y_neg = (expr.aux_uword_b == uword(1)); @@ -47,7 +47,7 @@ inline bool op_powmat::apply_direct(Mat& out, const Base& X, const uword y, const bool y_neg) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -72,7 +72,7 @@ op_powmat::apply_direct(Mat& out, const Base U(X.get_ref()); - arma_debug_check( (U.M.is_square() == false), "powmat(): given matrix must be square sized" ); + arma_conform_check( (U.M.is_square() == false), "powmat(): given matrix must be square sized" ); op_powmat::apply_direct_positive(out, U.M, y); } @@ -87,7 +87,7 @@ inline void op_powmat::apply_direct_positive(Mat& out, const Mat& X, const uword y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N = X.n_rows; @@ -96,7 +96,7 @@ op_powmat::apply_direct_positive(Mat& out, const Mat& X, const uword y) if(X.is_diagmat()) { - arma_extra_debug_print("op_powmat: detected diagonal matrix"); + arma_debug_print("op_powmat: detected diagonal matrix"); podarray tmp(N); // use temporary array in case we have aliasing @@ -139,7 +139,7 @@ inline void op_powmat_cx::apply(Mat< std::complex >& out, const mtOp,T1,op_powmat_cx>& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type in_T; @@ -161,7 +161,7 @@ inline bool op_powmat_cx::apply_direct(Mat< std::complex >& out, const Base& X, const typename T1::pod_type y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type in_eT; typedef typename T1::pod_type in_T; @@ -169,7 +169,7 @@ op_powmat_cx::apply_direct(Mat< std::complex >& out, cons if( y == in_T(int(y)) ) { - arma_extra_debug_print("op_powmat_cx::apply_direct(): integer exponent detected; redirecting to op_powmat"); + arma_debug_print("op_powmat_cx::apply_direct(): integer exponent detected; redirecting to op_powmat"); const uword y_val = (y < int(0)) ? uword(-y) : uword(y); const bool y_neg = (y < int(0)); @@ -188,13 +188,13 @@ op_powmat_cx::apply_direct(Mat< std::complex >& out, cons const quasi_unwrap U(X.get_ref()); const Mat& A = U.M; - arma_debug_check( (A.is_square() == false), "powmat(): given matrix must be square sized" ); + arma_conform_check( (A.is_square() == false), "powmat(): given matrix must be square sized" ); const uword N = A.n_rows; if(A.is_diagmat()) { - arma_extra_debug_print("op_powmat_cx: detected diagonal matrix"); + arma_debug_print("op_powmat_cx: detected diagonal matrix"); podarray tmp(N); // use temporary array in case we have aliasing @@ -211,7 +211,7 @@ op_powmat_cx::apply_direct(Mat< std::complex >& out, cons if(try_sympd) { - arma_extra_debug_print("op_powmat_cx: attempting sympd optimisation"); + arma_debug_print("op_powmat_cx: attempting sympd optimisation"); Col eigval; Mat eigvec; @@ -229,7 +229,7 @@ op_powmat_cx::apply_direct(Mat< std::complex >& out, cons return true; } - arma_extra_debug_print("op_powmat_cx: sympd optimisation failed"); + arma_debug_print("op_powmat_cx: sympd optimisation failed"); // fallthrough if optimisation failed } diff --git a/inst/include/armadillo_bits/op_princomp_meat.hpp b/inst/include/armadillo_bits/op_princomp_meat.hpp index db6f83fe..10894760 100644 --- a/inst/include/armadillo_bits/op_princomp_meat.hpp +++ b/inst/include/armadillo_bits/op_princomp_meat.hpp @@ -40,7 +40,7 @@ op_princomp::direct_princomp const Base& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; @@ -132,7 +132,7 @@ op_princomp::direct_princomp const Base& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; @@ -206,7 +206,7 @@ op_princomp::direct_princomp const Base& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; @@ -263,7 +263,7 @@ op_princomp::direct_princomp const Base& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; @@ -302,7 +302,7 @@ op_princomp::apply const Op& in ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_princomp::direct_princomp(out, in.m); diff --git a/inst/include/armadillo_bits/op_prod_meat.hpp b/inst/include/armadillo_bits/op_prod_meat.hpp index c1b9577a..c9f3302b 100644 --- a/inst/include/armadillo_bits/op_prod_meat.hpp +++ b/inst/include/armadillo_bits/op_prod_meat.hpp @@ -25,7 +25,7 @@ inline void op_prod::apply_noalias(Mat& out, const Mat& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword X_n_rows = X.n_rows; const uword X_n_cols = X.n_cols; @@ -66,13 +66,13 @@ inline void op_prod::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const uword dim = in.aux_uword_a; - arma_debug_check( (dim > 1), "prod(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "prod(): parameter 'dim' must be 0 or 1" ); const quasi_unwrap U(in.m); @@ -97,7 +97,7 @@ inline eT op_prod::prod(const subview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); eT val = eT(1); @@ -143,7 +143,7 @@ inline typename T1::elem_type op_prod::prod(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/op_range_meat.hpp b/inst/include/armadillo_bits/op_range_meat.hpp index a3e66c21..6773090f 100644 --- a/inst/include/armadillo_bits/op_range_meat.hpp +++ b/inst/include/armadillo_bits/op_range_meat.hpp @@ -26,12 +26,12 @@ inline void op_range::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const uword dim = in.aux_uword_a; - arma_debug_check( (dim > 1), "range(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "range(): parameter 'dim' must be 0 or 1" ); const quasi_unwrap U(in.m); const Mat& X = U.M; @@ -57,7 +57,7 @@ inline void op_range::apply_noalias(Mat& out, const Mat& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // TODO: replace with dedicated implementation which finds min and max at the same time out = max(X,dim) - min(X,dim); @@ -70,7 +70,7 @@ inline typename T1::elem_type op_range::vector_range(const T1& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -82,7 +82,7 @@ op_range::vector_range(const T1& expr) if(N == 0) { - arma_debug_check(true, "range(): object has no elements"); + arma_conform_check(true, "range(): object has no elements"); return Datum::nan; } diff --git a/inst/include/armadillo_bits/op_rank_meat.hpp b/inst/include/armadillo_bits/op_rank_meat.hpp index 91c413e9..0a32c6b2 100644 --- a/inst/include/armadillo_bits/op_rank_meat.hpp +++ b/inst/include/armadillo_bits/op_rank_meat.hpp @@ -27,7 +27,7 @@ inline bool op_rank::apply(uword& out, const Base& expr, const typename T1::pod_type tol) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -37,7 +37,7 @@ op_rank::apply(uword& out, const Base& expr, const ty if(is_op_diagmat::value || A.is_diagmat()) { - arma_extra_debug_print("op_rank::apply(): detected diagonal matrix"); + arma_debug_print("op_rank::apply(): detected diagonal matrix"); return op_rank::apply_diag(out, A, tol); } @@ -63,7 +63,7 @@ op_rank::apply(uword& out, const Base& expr, const ty if(do_sym) { - arma_extra_debug_print("op_rank::apply(): symmetric/hermitian optimisation"); + arma_debug_print("op_rank::apply(): symmetric/hermitian optimisation"); return op_rank::apply_sym(out, A, tol); } @@ -78,7 +78,7 @@ inline bool op_rank::apply_diag(uword& out, Mat& A, typename get_pod_type::result tol) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -119,7 +119,7 @@ inline bool op_rank::apply_sym(uword& out, Mat& A, typename get_pod_type::result tol) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -159,7 +159,7 @@ inline bool op_rank::apply_gen(uword& out, Mat& A, typename get_pod_type::result tol) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; diff --git a/inst/include/armadillo_bits/op_rcond_meat.hpp b/inst/include/armadillo_bits/op_rcond_meat.hpp index 48123bd0..ae3aeaa9 100644 --- a/inst/include/armadillo_bits/op_rcond_meat.hpp +++ b/inst/include/armadillo_bits/op_rcond_meat.hpp @@ -26,7 +26,7 @@ inline typename T1::pod_type op_rcond::apply(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; @@ -37,7 +37,7 @@ op_rcond::apply(const Base& X) const quasi_unwrap::stored_type> U(S.M); - arma_debug_check( (U.M.is_square() == false), "rcond(): matrix must be square sized" ); + arma_conform_check( (U.M.is_square() == false), "rcond(): matrix must be square sized" ); const uword layout = (S.do_triu) ? uword(0) : uword(1); @@ -46,13 +46,13 @@ op_rcond::apply(const Base& X) Mat A = X.get_ref(); - arma_debug_check( (A.is_square() == false), "rcond(): matrix must be square sized" ); + arma_conform_check( (A.is_square() == false), "rcond(): matrix must be square sized" ); if(A.is_empty()) { return Datum::inf; } if(is_op_diagmat::value || A.is_diagmat()) { - arma_extra_debug_print("op_rcond::apply(): detected diagonal matrix"); + arma_debug_print("op_rcond::apply(): detected diagonal matrix"); const eT* colmem = A.memptr(); const uword N = A.n_rows; @@ -89,7 +89,7 @@ op_rcond::apply(const Base& X) if(try_sympd) { - arma_extra_debug_print("op_rcond::apply(): attempting sympd optimisation"); + arma_debug_print("op_rcond::apply(): attempting sympd optimisation"); bool calc_ok = false; @@ -97,7 +97,7 @@ op_rcond::apply(const Base& X) if(calc_ok) { return out_val; } - arma_extra_debug_print("op_rcond::apply(): sympd optimisation failed"); + arma_debug_print("op_rcond::apply(): sympd optimisation failed"); // auxlib::rcond_sympd() may have failed because A isn't really sympd // restore A, as auxlib::rcond_sympd() may have destroyed it diff --git a/inst/include/armadillo_bits/op_relational_meat.hpp b/inst/include/armadillo_bits/op_relational_meat.hpp index 6c7344bf..b9d050df 100644 --- a/inst/include/armadillo_bits/op_relational_meat.hpp +++ b/inst/include/armadillo_bits/op_relational_meat.hpp @@ -258,7 +258,7 @@ inline void op_rel_lt_pre::apply(Mat& out, const mtOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_mat_pre( < ); } @@ -270,7 +270,7 @@ inline void op_rel_gt_pre::apply(Mat& out, const mtOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_mat_pre( > ); } @@ -282,7 +282,7 @@ inline void op_rel_lteq_pre::apply(Mat& out, const mtOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_mat_pre( <= ); } @@ -294,7 +294,7 @@ inline void op_rel_gteq_pre::apply(Mat& out, const mtOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_mat_pre( >= ); } @@ -306,7 +306,7 @@ inline void op_rel_lt_post::apply(Mat& out, const mtOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_mat_post( < ); } @@ -318,7 +318,7 @@ inline void op_rel_gt_post::apply(Mat& out, const mtOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_mat_post( > ); } @@ -330,7 +330,7 @@ inline void op_rel_lteq_post::apply(Mat& out, const mtOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_mat_post( <= ); } @@ -342,7 +342,7 @@ inline void op_rel_gteq_post::apply(Mat& out, const mtOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_mat_post( >= ); } @@ -354,7 +354,7 @@ inline void op_rel_eq::apply(Mat& out, const mtOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_mat_post( == ); } @@ -366,7 +366,7 @@ inline void op_rel_noteq::apply(Mat& out, const mtOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_mat_post( != ); } @@ -384,7 +384,7 @@ inline void op_rel_lt_pre::apply(Cube& out, const mtOpCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_cube_pre( < ); } @@ -396,7 +396,7 @@ inline void op_rel_gt_pre::apply(Cube& out, const mtOpCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_cube_pre( > ); } @@ -408,7 +408,7 @@ inline void op_rel_lteq_pre::apply(Cube& out, const mtOpCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_cube_pre( <= ); } @@ -420,7 +420,7 @@ inline void op_rel_gteq_pre::apply(Cube& out, const mtOpCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_cube_pre( >= ); } @@ -432,7 +432,7 @@ inline void op_rel_lt_post::apply(Cube& out, const mtOpCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_cube_post( < ); } @@ -444,7 +444,7 @@ inline void op_rel_gt_post::apply(Cube& out, const mtOpCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_cube_post( > ); } @@ -456,7 +456,7 @@ inline void op_rel_lteq_post::apply(Cube& out, const mtOpCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_cube_post( <= ); } @@ -468,7 +468,7 @@ inline void op_rel_gteq_post::apply(Cube& out, const mtOpCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_cube_post( >= ); } @@ -480,7 +480,7 @@ inline void op_rel_eq::apply(Cube& out, const mtOpCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_cube_post( == ); } @@ -492,7 +492,7 @@ inline void op_rel_noteq::apply(Cube& out, const mtOpCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_applier_cube_post( != ); } diff --git a/inst/include/armadillo_bits/op_repelem_meat.hpp b/inst/include/armadillo_bits/op_repelem_meat.hpp index 38bfe36b..b9dd1ac2 100644 --- a/inst/include/armadillo_bits/op_repelem_meat.hpp +++ b/inst/include/armadillo_bits/op_repelem_meat.hpp @@ -27,7 +27,7 @@ inline void op_repelem::apply_noalias(Mat& out, const obj& X, const uword copies_per_row, const uword copies_per_col) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename obj::elem_type eT; @@ -75,7 +75,7 @@ inline void op_repelem::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/op_repmat_meat.hpp b/inst/include/armadillo_bits/op_repmat_meat.hpp index 1460350d..a89cc1b8 100644 --- a/inst/include/armadillo_bits/op_repmat_meat.hpp +++ b/inst/include/armadillo_bits/op_repmat_meat.hpp @@ -27,7 +27,7 @@ inline void op_repmat::apply_noalias(Mat& out, const obj& X, const uword copies_per_row, const uword copies_per_col) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename obj::elem_type eT; @@ -96,7 +96,7 @@ inline void op_repmat::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/op_reshape_meat.hpp b/inst/include/armadillo_bits/op_reshape_meat.hpp index 1846dc8b..453c613f 100644 --- a/inst/include/armadillo_bits/op_reshape_meat.hpp +++ b/inst/include/armadillo_bits/op_reshape_meat.hpp @@ -27,7 +27,7 @@ inline void op_reshape::apply(Mat& actual_out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -79,7 +79,7 @@ inline void op_reshape::apply_mat_inplace(Mat& A, const uword new_n_rows, const uword new_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword new_n_elem = new_n_rows * new_n_cols; @@ -99,7 +99,7 @@ inline void op_reshape::apply_mat_noalias(Mat& out, const Mat& A, const uword new_n_rows, const uword new_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out.set_size(new_n_rows, new_n_cols); @@ -124,7 +124,7 @@ inline void op_reshape::apply_proxy_noalias(Mat& out, const Proxy& P, const uword new_n_rows, const uword new_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -175,7 +175,7 @@ inline void op_reshape::apply(Cube& out, const OpCube& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -203,7 +203,7 @@ inline void op_reshape::apply_cube_inplace(Cube& A, const uword new_n_rows, const uword new_n_cols, const uword new_n_slices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword new_n_elem = new_n_rows * new_n_cols * new_n_slices; @@ -223,7 +223,7 @@ inline void op_reshape::apply_cube_noalias(Cube& out, const Cube& A, const uword new_n_rows, const uword new_n_cols, const uword new_n_slices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out.set_size(new_n_rows, new_n_cols, new_n_slices); diff --git a/inst/include/armadillo_bits/op_resize_meat.hpp b/inst/include/armadillo_bits/op_resize_meat.hpp index b18a163a..5abdc992 100644 --- a/inst/include/armadillo_bits/op_resize_meat.hpp +++ b/inst/include/armadillo_bits/op_resize_meat.hpp @@ -27,7 +27,7 @@ inline void op_resize::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -54,7 +54,7 @@ inline void op_resize::apply_mat_inplace(Mat& A, const uword new_n_rows, const uword new_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if( (A.n_rows == new_n_rows) && (A.n_cols == new_n_cols) ) { return; } @@ -74,7 +74,7 @@ inline void op_resize::apply_mat_noalias(Mat& out, const Mat& A, const uword new_n_rows, const uword new_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out.set_size(new_n_rows, new_n_cols); @@ -100,7 +100,7 @@ inline void op_resize::apply(Cube& out, const OpCube& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -128,7 +128,7 @@ inline void op_resize::apply_cube_inplace(Cube& A, const uword new_n_rows, const uword new_n_cols, const uword new_n_slices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if( (A.n_rows == new_n_rows) && (A.n_cols == new_n_cols) && (A.n_slices == new_n_slices) ) { return; } @@ -148,7 +148,7 @@ inline void op_resize::apply_cube_noalias(Cube& out, const Cube& A, const uword new_n_rows, const uword new_n_cols, const uword new_n_slices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out.set_size(new_n_rows, new_n_cols, new_n_slices); diff --git a/inst/include/armadillo_bits/op_reverse_meat.hpp b/inst/include/armadillo_bits/op_reverse_meat.hpp index 4edafa86..8bf7c5d2 100644 --- a/inst/include/armadillo_bits/op_reverse_meat.hpp +++ b/inst/include/armadillo_bits/op_reverse_meat.hpp @@ -26,13 +26,13 @@ inline void op_reverse::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const uword dim = in.aux_uword_a; - arma_debug_check( (dim > 1), "reverse(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "reverse(): parameter 'dim' must be 0 or 1" ); if(is_Mat::value) { @@ -71,7 +71,7 @@ inline void op_reverse_vec::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/op_roots_meat.hpp b/inst/include/armadillo_bits/op_roots_meat.hpp index 1e091205..4aef9d00 100644 --- a/inst/include/armadillo_bits/op_roots_meat.hpp +++ b/inst/include/armadillo_bits/op_roots_meat.hpp @@ -26,7 +26,7 @@ inline void op_roots::apply(Mat< std::complex >& out, const mtOp, T1, op_roots>& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_roots::apply_direct(out, expr.m); @@ -44,7 +44,7 @@ inline bool op_roots::apply_direct(Mat< std::complex >& out, const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef std::complex out_eT; @@ -75,13 +75,13 @@ inline bool op_roots::apply_noalias(Mat< std::complex::result> >& out, const Mat& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; typedef std::complex::result> out_eT; - arma_debug_check( (X.is_vec() == false), "roots(): given object must be a vector" ); + arma_conform_check( (X.is_vec() == false), "roots(): given object must be a vector" ); if(X.internal_has_nonfinite()) { return false; } diff --git a/inst/include/armadillo_bits/op_row_as_mat_meat.hpp b/inst/include/armadillo_bits/op_row_as_mat_meat.hpp index 751d8d80..c82d42fc 100644 --- a/inst/include/armadillo_bits/op_row_as_mat_meat.hpp +++ b/inst/include/armadillo_bits/op_row_as_mat_meat.hpp @@ -26,7 +26,7 @@ inline void op_row_as_mat::apply(Mat& out, const CubeToMatOp& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -35,7 +35,7 @@ op_row_as_mat::apply(Mat& out, const CubeToMatOp= A.n_rows), "Cube::row_as_mat(): index out of bounds" ); + arma_conform_check_bounds( (in_row >= A.n_rows), "Cube::row_as_mat(): index out of bounds" ); const uword A_n_cols = A.n_cols; const uword A_n_rows = A.n_rows; diff --git a/inst/include/armadillo_bits/op_shift_meat.hpp b/inst/include/armadillo_bits/op_shift_meat.hpp index 216290b5..00dc7277 100644 --- a/inst/include/armadillo_bits/op_shift_meat.hpp +++ b/inst/include/armadillo_bits/op_shift_meat.hpp @@ -27,7 +27,7 @@ inline void op_shift_vec::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -59,10 +59,10 @@ inline void op_shift::apply_noalias(Mat& out, const Mat& X, const uword len, const uword neg, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( ((dim == 0) && (len >= X.n_rows)), "shift(): shift amount out of bounds" ); - arma_debug_check_bounds( ((dim == 1) && (len >= X.n_cols)), "shift(): shift amount out of bounds" ); + arma_conform_check_bounds( ((dim == 0) && (len >= X.n_rows)), "shift(): shift amount out of bounds" ); + arma_conform_check_bounds( ((dim == 1) && (len >= X.n_cols)), "shift(): shift amount out of bounds" ); if(len == 0) { out = X; return; } diff --git a/inst/include/armadillo_bits/op_shuffle_meat.hpp b/inst/include/armadillo_bits/op_shuffle_meat.hpp index ecfc2f6e..d1228ad5 100644 --- a/inst/include/armadillo_bits/op_shuffle_meat.hpp +++ b/inst/include/armadillo_bits/op_shuffle_meat.hpp @@ -27,7 +27,7 @@ inline void op_shuffle::apply_direct(Mat& out, const Mat& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(X.is_empty()) { out.copy_size(X); return; } @@ -56,7 +56,7 @@ op_shuffle::apply_direct(Mat& out, const Mat& X, const uword dim) { if(is_alias == false) { - arma_extra_debug_print("op_shuffle::apply(): matrix"); + arma_debug_print("op_shuffle::apply(): matrix"); out.copy_size(X); @@ -71,7 +71,7 @@ op_shuffle::apply_direct(Mat& out, const Mat& X, const uword dim) } else // in-place shuffle { - arma_extra_debug_print("op_shuffle::apply(): in-place matrix"); + arma_debug_print("op_shuffle::apply(): in-place matrix"); // reuse the val member variable of packet_vec // to indicate whether a particular row or column @@ -116,7 +116,7 @@ op_shuffle::apply_direct(Mat& out, const Mat& X, const uword dim) { if(is_alias == false) { - arma_extra_debug_print("op_shuffle::apply(): vector"); + arma_debug_print("op_shuffle::apply(): vector"); out.copy_size(X); @@ -145,7 +145,7 @@ op_shuffle::apply_direct(Mat& out, const Mat& X, const uword dim) } else // in-place shuffle { - arma_extra_debug_print("op_shuffle::apply(): in-place vector"); + arma_debug_print("op_shuffle::apply(): in-place vector"); // reuse the val member variable of packet_vec // to indicate whether a particular row or column @@ -202,13 +202,13 @@ inline void op_shuffle::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap U(in.m); const uword dim = in.aux_uword_a; - arma_debug_check( (dim > 1), "shuffle(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "shuffle(): parameter 'dim' must be 0 or 1" ); op_shuffle::apply_direct(out, U.M, dim); } @@ -220,7 +220,7 @@ inline void op_shuffle_vec::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap U(in.m); diff --git a/inst/include/armadillo_bits/op_sort_index_meat.hpp b/inst/include/armadillo_bits/op_sort_index_meat.hpp index dfee9015..1d02be7f 100644 --- a/inst/include/armadillo_bits/op_sort_index_meat.hpp +++ b/inst/include/armadillo_bits/op_sort_index_meat.hpp @@ -26,7 +26,7 @@ inline bool arma_sort_index_helper(Mat& out, const Proxy& P, const uword sort_type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -118,7 +118,7 @@ inline bool op_sort_index::apply_noalias(Mat& out, const Proxy& P, const uword sort_type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return arma_sort_index_helper(out, P, sort_type); } @@ -130,7 +130,7 @@ inline void op_sort_index::apply(Mat& out, const mtOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Proxy P(in.m); @@ -153,7 +153,7 @@ op_sort_index::apply(Mat& out, const mtOp& in) all_non_nan = op_sort_index::apply_noalias(out, P, sort_type); } - arma_debug_check( (all_non_nan == false), "sort_index(): detected NaN" ); + arma_conform_check( (all_non_nan == false), "sort_index(): detected NaN" ); } @@ -163,7 +163,7 @@ inline bool op_stable_sort_index::apply_noalias(Mat& out, const Proxy& P, const uword sort_type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return arma_sort_index_helper(out, P, sort_type); } @@ -175,7 +175,7 @@ inline void op_stable_sort_index::apply(Mat& out, const mtOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Proxy P(in.m); @@ -198,7 +198,7 @@ op_stable_sort_index::apply(Mat& out, const mtOp comparator; @@ -109,13 +109,13 @@ inline void op_sort::apply_noalias(Mat& out, const Mat& X, const uword sort_type, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if((X.n_rows * X.n_cols) <= 1) { out = X; return; } if(dim == 0) // sort the contents of each column { - arma_extra_debug_print("op_sort::apply(): dim = 0"); + arma_debug_print("op_sort::apply(): dim = 0"); out = X; @@ -132,14 +132,14 @@ op_sort::apply_noalias(Mat& out, const Mat& X, const uword sort_type, co { if(X.n_rows == 1) // a row vector { - arma_extra_debug_print("op_sort::apply(): dim = 1, vector specific"); + arma_debug_print("op_sort::apply(): dim = 1, vector specific"); out = X; op_sort::direct_sort(out.memptr(), out.n_elem, sort_type); } else // not a row vector { - arma_extra_debug_print("op_sort::apply(): dim = 1, generic"); + arma_debug_print("op_sort::apply(): dim = 1, generic"); out.copy_size(X); @@ -167,7 +167,7 @@ inline void op_sort::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -177,9 +177,9 @@ op_sort::apply(Mat& out, const Op& in) const uword sort_type = in.aux_uword_a; const uword dim = in.aux_uword_b; - arma_debug_check( (sort_type > 1), "sort(): parameter 'sort_type' must be 0 or 1" ); - arma_debug_check( (dim > 1), "sort(): parameter 'dim' must be 0 or 1" ); - arma_debug_check( (X.internal_has_nan()), "sort(): detected NaN" ); + arma_conform_check( (sort_type > 1), "sort(): parameter 'sort_type' must be 0 or 1" ); + arma_conform_check( (dim > 1), "sort(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (X.internal_has_nan()), "sort(): detected NaN" ); if(U.is_alias(out)) { @@ -202,7 +202,7 @@ inline void op_sort_vec::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -211,8 +211,8 @@ op_sort_vec::apply(Mat& out, const Op& i const uword sort_type = in.aux_uword_a; - arma_debug_check( (sort_type > 1), "sort(): parameter 'sort_type' must be 0 or 1" ); - arma_debug_check( (X.internal_has_nan()), "sort(): detected NaN" ); + arma_conform_check( (sort_type > 1), "sort(): parameter 'sort_type' must be 0 or 1" ); + arma_conform_check( (X.internal_has_nan()), "sort(): detected NaN" ); out = X; // not checking for aliasing, to allow inplace sorting of vectors diff --git a/inst/include/armadillo_bits/op_sp_diagvec_bones.hpp b/inst/include/armadillo_bits/op_sp_diagvec_bones.hpp new file mode 100644 index 00000000..f8901971 --- /dev/null +++ b/inst/include/armadillo_bits/op_sp_diagvec_bones.hpp @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + + +//! \addtogroup op_sp_diagvec +//! @{ + + + +class op_sp_diagvec + : public traits_op_col + { + public: + + template + inline static void apply(Mat& out, const SpToDOp& in); + }; + + + +//! @} diff --git a/inst/include/armadillo_bits/op_sp_diagvec_meat.hpp b/inst/include/armadillo_bits/op_sp_diagvec_meat.hpp new file mode 100644 index 00000000..f83d1bb3 --- /dev/null +++ b/inst/include/armadillo_bits/op_sp_diagvec_meat.hpp @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + + +//! \addtogroup op_sp_diagvec +//! @{ + + + +template +inline +void +op_sp_diagvec::apply(Mat& out, const SpToDOp& in) + { + arma_debug_sigprint(); + + typedef typename T1::elem_type eT; + + const unwrap_spmat U(in.m); + const SpMat& X = U.M; + + const uword a = in.aux_uword_a; + const uword b = in.aux_uword_b; + + const uword row_offset = (b > 0) ? a : 0; + const uword col_offset = (b == 0) ? a : 0; + + arma_conform_check_bounds + ( + ((row_offset > 0) && (row_offset >= X.n_rows)) || ((col_offset > 0) && (col_offset >= X.n_cols)), + "diagvec(): requested diagonal out of bounds" + ); + + const uword len = (std::min)(X.n_rows - row_offset, X.n_cols - col_offset); + + out.set_size(len, 1); + + eT* out_mem = out.memptr(); + + for(uword i=0; i < len; ++i) + { + out_mem[i] = X.at(i + row_offset, i + col_offset); + } + } + + + +//! @} diff --git a/inst/include/armadillo_bits/spop_max_bones.hpp b/inst/include/armadillo_bits/op_sp_max_bones.hpp similarity index 79% rename from inst/include/armadillo_bits/spop_max_bones.hpp rename to inst/include/armadillo_bits/op_sp_max_bones.hpp index 4c8b60aa..00608072 100644 --- a/inst/include/armadillo_bits/spop_max_bones.hpp +++ b/inst/include/armadillo_bits/op_sp_max_bones.hpp @@ -16,22 +16,21 @@ // ------------------------------------------------------------------------ -//! \addtogroup spop_max +//! \addtogroup op_sp_max //! @{ - -class spop_max +class op_sp_max : public traits_op_xvec { public: template - inline static void apply(SpMat& out, const SpOp& in); + inline static void apply(Mat& out, const SpToDOp& in); // template - inline static void apply_proxy(SpMat& out, const SpProxy& p, const uword dim, const typename arma_not_cx::result* junk = nullptr); + inline static void apply_proxy(Mat& out, const SpProxy& p, const uword dim, const typename arma_not_cx::result* junk = nullptr); template inline static typename T1::elem_type vector_max(const T1& X, const typename arma_not_cx::result* junk = nullptr); @@ -45,7 +44,7 @@ class spop_max // template - inline static void apply_proxy(SpMat& out, const SpProxy& p, const uword dim, const typename arma_cx_only::result* junk = nullptr); + inline static void apply_proxy(Mat& out, const SpProxy& p, const uword dim, const typename arma_cx_only::result* junk = nullptr); template inline static typename T1::elem_type vector_max(const T1& X, const typename arma_cx_only::result* junk = nullptr); diff --git a/inst/include/armadillo_bits/spop_max_meat.hpp b/inst/include/armadillo_bits/op_sp_max_meat.hpp similarity index 85% rename from inst/include/armadillo_bits/spop_max_meat.hpp rename to inst/include/armadillo_bits/op_sp_max_meat.hpp index 8f40a0e0..d09750de 100644 --- a/inst/include/armadillo_bits/spop_max_meat.hpp +++ b/inst/include/armadillo_bits/op_sp_max_meat.hpp @@ -16,7 +16,7 @@ // ------------------------------------------------------------------------ -//! \addtogroup spop_max +//! \addtogroup op_sp_max //! @{ @@ -24,12 +24,13 @@ template inline void -spop_max::apply(SpMat& out, const SpOp& in) +op_sp_max::apply(Mat& out, const SpToDOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword dim = in.aux_uword_a; - arma_debug_check( (dim > 1), "max(): parameter 'dim' must be 0 or 1" ); + + arma_conform_check( (dim > 1), "max(): parameter 'dim' must be 0 or 1" ); const SpProxy p(in.m); @@ -44,7 +45,7 @@ spop_max::apply(SpMat& out, const SpOp& in) return; } - spop_max::apply_proxy(out, p, dim); + op_sp_max::apply_proxy(out, p, dim); } @@ -52,15 +53,15 @@ spop_max::apply(SpMat& out, const SpOp& in) template inline void -spop_max::apply_proxy +op_sp_max::apply_proxy ( - SpMat& out, - const SpProxy& p, - const uword dim, + Mat& out, + const SpProxy& p, + const uword dim, const typename arma_not_cx::result* junk ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; @@ -73,46 +74,44 @@ spop_max::apply_proxy if(dim == 0) // find the maximum in each column { - Row value(p_n_cols, arma_zeros_indicator()); + out.zeros(1, p_n_cols); + urowvec count(p_n_cols, arma_zeros_indicator()); while(it != it_end) { const uword col = it.col(); - value[col] = (count[col] == 0) ? (*it) : (std::max)(value[col], (*it)); + out[col] = (count[col] == 0) ? (*it) : (std::max)(out[col], (*it)); count[col]++; ++it; } for(uword col=0; col value(p_n_rows, arma_zeros_indicator()); + out.zeros(p_n_rows, 1); + ucolvec count(p_n_rows, arma_zeros_indicator()); while(it != it_end) { const uword row = it.row(); - value[row] = (count[row] == 0) ? (*it) : (std::max)(value[row], (*it)); + out[row] = (count[row] == 0) ? (*it) : (std::max)(out[row], (*it)); count[row]++; ++it; } for(uword row=0; row inline typename T1::elem_type -spop_max::vector_max +op_sp_max::vector_max ( const T1& x, const typename arma_not_cx::result* junk ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; @@ -136,7 +135,7 @@ spop_max::vector_max if(p.get_n_elem() == 0) { - arma_debug_check(true, "max(): object has no elements"); + arma_conform_check(true, "max(): object has no elements"); return Datum::nan; } @@ -187,9 +186,9 @@ spop_max::vector_max template inline typename arma_not_cx::result -spop_max::max(const SpBase& X) +op_sp_max::max(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -200,7 +199,7 @@ spop_max::max(const SpBase& X) if(n_elem == 0) { - arma_debug_check(true, "max(): object has no elements"); + arma_conform_check(true, "max(): object has no elements"); return Datum::nan; } @@ -245,9 +244,9 @@ spop_max::max(const SpBase& X) template inline typename arma_not_cx::result -spop_max::max_with_index(const SpProxy& P, uword& index_of_max_val) +op_sp_max::max_with_index(const SpProxy& P, uword& index_of_max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -257,7 +256,7 @@ spop_max::max_with_index(const SpProxy& P, uword& index_of_max_val) if(n_elem == 0) { - arma_debug_check(true, "max(): object has no elements"); + arma_conform_check(true, "max(): object has no elements"); index_of_max_val = uword(0); @@ -353,15 +352,15 @@ spop_max::max_with_index(const SpProxy& P, uword& index_of_max_val) template inline void -spop_max::apply_proxy +op_sp_max::apply_proxy ( - SpMat& out, - const SpProxy& p, - const uword dim, + Mat& out, + const SpProxy& p, + const uword dim, const typename arma_cx_only::result* junk ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; @@ -375,8 +374,9 @@ spop_max::apply_proxy if(dim == 0) // find the maximum in each column { - Row rawval(p_n_cols, arma_zeros_indicator()); - Row< T> absval(p_n_cols, arma_zeros_indicator()); + out.zeros(1, p_n_cols); + + Row absval(p_n_cols, arma_zeros_indicator()); while(it != it_end) { @@ -388,19 +388,18 @@ spop_max::apply_proxy if(a > absval[col]) { absval[col] = a; - rawval[col] = v; + out[col] = v; } ++it; } - - out = rawval; } else if(dim == 1) // find the maximum in each row { - Col rawval(p_n_rows, arma_zeros_indicator()); - Col< T> absval(p_n_rows, arma_zeros_indicator()); + out.zeros(p_n_rows, 1); + + Col absval(p_n_rows, arma_zeros_indicator()); while(it != it_end) { @@ -412,13 +411,11 @@ spop_max::apply_proxy if(a > absval[row]) { absval[row] = a; - rawval[row] = v; + out[row] = v; } ++it; } - - out = rawval; } } @@ -427,13 +424,13 @@ spop_max::apply_proxy template inline typename T1::elem_type -spop_max::vector_max +op_sp_max::vector_max ( const T1& x, const typename arma_cx_only::result* junk ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; @@ -443,7 +440,7 @@ spop_max::vector_max if(p.get_n_elem() == 0) { - arma_debug_check(true, "max(): object has no elements"); + arma_conform_check(true, "max(): object has no elements"); return Datum::nan; } @@ -508,9 +505,9 @@ spop_max::vector_max template inline typename arma_cx_only::result -spop_max::max(const SpBase& X) +op_sp_max::max(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename get_pod_type::result T; @@ -522,7 +519,7 @@ spop_max::max(const SpBase& X) if(n_elem == 0) { - arma_debug_check(true, "max(): object has no elements"); + arma_conform_check(true, "max(): object has no elements"); return Datum::nan; } @@ -575,9 +572,9 @@ spop_max::max(const SpBase& X) template inline typename arma_cx_only::result -spop_max::max_with_index(const SpProxy& P, uword& index_of_max_val) +op_sp_max::max_with_index(const SpProxy& P, uword& index_of_max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename get_pod_type::result T; @@ -588,7 +585,7 @@ spop_max::max_with_index(const SpProxy& P, uword& index_of_max_val) if(n_elem == 0) { - arma_debug_check(true, "max(): object has no elements"); + arma_conform_check(true, "max(): object has no elements"); index_of_max_val = uword(0); diff --git a/inst/include/armadillo_bits/spop_mean_bones.hpp b/inst/include/armadillo_bits/op_sp_mean_bones.hpp similarity index 83% rename from inst/include/armadillo_bits/spop_mean_bones.hpp rename to inst/include/armadillo_bits/op_sp_mean_bones.hpp index 3d3e1021..eb6ed494 100644 --- a/inst/include/armadillo_bits/spop_mean_bones.hpp +++ b/inst/include/armadillo_bits/op_sp_mean_bones.hpp @@ -16,43 +16,43 @@ // ------------------------------------------------------------------------ -//! \addtogroup spop_mean +//! \addtogroup op_sp_mean //! @{ //! Class for finding mean values of a sparse matrix -class spop_mean +class op_sp_mean : public traits_op_xvec { public: - + // Apply mean into an output sparse matrix (or vector). template - inline static void apply(SpMat& out, const SpOp& in); - + inline static void apply(Mat& out, const SpToDOp& in); + template - inline static void apply_noalias_fast(SpMat& out, const SpProxy& p, const uword dim); + inline static void apply_fast(Mat& out, const SpProxy& p, const uword dim); template - inline static void apply_noalias_slow(SpMat& out, const SpProxy& p, const uword dim); + inline static void apply_slow(Mat& out, const SpProxy& p, const uword dim); // Take direct mean of a set of values. Length of array and number of values can be different. template inline static eT direct_mean(const eT* const X, const uword length, const uword N); - + template inline static eT direct_mean_robust(const eT* const X, const uword length, const uword N); - + template inline static typename T1::elem_type mean_all(const SpBase& X); - + template inline static typename T1::elem_type mean_all(const SpOp& expr); - + // Take the mean using an iterator. template inline static eT iterator_mean(T1& it, const T1& end, const uword n_zero, const eT junk); - + template inline static eT iterator_mean_robust(T1& it, const T1& end, const uword n_zero, const eT junk); }; diff --git a/inst/include/armadillo_bits/spop_mean_meat.hpp b/inst/include/armadillo_bits/op_sp_mean_meat.hpp similarity index 67% rename from inst/include/armadillo_bits/spop_mean_meat.hpp rename to inst/include/armadillo_bits/op_sp_mean_meat.hpp index dd979166..62d8dd57 100644 --- a/inst/include/armadillo_bits/spop_mean_meat.hpp +++ b/inst/include/armadillo_bits/op_sp_mean_meat.hpp @@ -16,7 +16,7 @@ // ------------------------------------------------------------------------ -//! \addtogroup spop_mean +//! \addtogroup op_sp_mean //! @{ @@ -24,29 +24,27 @@ template inline void -spop_mean::apply(SpMat& out, const SpOp& in) +op_sp_mean::apply(Mat& out, const SpToDOp& in) { - arma_extra_debug_sigprint(); - - typedef typename T1::elem_type eT; + arma_debug_sigprint(); const uword dim = in.aux_uword_a; - arma_debug_check( (dim > 1), "mean(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "mean(): parameter 'dim' must be 0 or 1" ); const SpProxy p(in.m); - if(p.is_alias(out) == false) - { - spop_mean::apply_noalias_fast(out, p, dim); - } - else + const uword p_n_rows = p.get_n_rows(); + const uword p_n_cols = p.get_n_cols(); + + if( (p_n_rows == 0) || (p_n_cols == 0) || (p.get_n_nonzero() == 0) ) { - SpMat tmp; - - spop_mean::apply_noalias_fast(tmp, p, dim); + if(dim == 0) { out.zeros((p_n_rows > 0) ? 1 : 0, p_n_cols); } + if(dim == 1) { out.zeros(p_n_rows, (p_n_cols > 0) ? 1 : 0); } - out.steal_mem(tmp); + return; } + + op_sp_mean::apply_fast(out, p, dim); } @@ -54,14 +52,14 @@ spop_mean::apply(SpMat& out, const SpOp& template inline void -spop_mean::apply_noalias_fast +op_sp_mean::apply_fast ( - SpMat& out, - const SpProxy& p, - const uword dim + Mat& out, + const SpProxy& p, + const uword dim ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; @@ -69,19 +67,13 @@ spop_mean::apply_noalias_fast const uword p_n_rows = p.get_n_rows(); const uword p_n_cols = p.get_n_cols(); - if( (p_n_rows == 0) || (p_n_cols == 0) || (p.get_n_nonzero() == 0) ) - { - if(dim == 0) { out.zeros((p_n_rows > 0) ? 1 : 0, p_n_cols); } - if(dim == 1) { out.zeros(p_n_rows, (p_n_cols > 0) ? 1 : 0); } - - return; - } - if(dim == 0) // find the mean in each column { - Row acc(p_n_cols, arma_zeros_indicator()); + arma_debug_print("op_sp_mean::apply_fast(): dim = 0"); - eT* acc_mem = acc.memptr(); + out.zeros(1, p_n_cols); + + eT* out_mem = out.memptr(); if(SpProxy::use_iterator) { @@ -89,45 +81,43 @@ spop_mean::apply_noalias_fast const uword N = p.get_n_nonzero(); - for(uword i=0; i < N; ++i) { acc_mem[it.col()] += (*it); ++it; } + for(uword i=0; i < N; ++i) { out_mem[it.col()] += (*it); ++it; } - acc /= T(p_n_rows); + out /= T(p_n_rows); } else { for(uword col = 0; col < p_n_cols; ++col) { - acc_mem[col] = arrayops::accumulate + out_mem[col] = arrayops::accumulate ( &p.get_values()[p.get_col_ptrs()[col]], p.get_col_ptrs()[col + 1] - p.get_col_ptrs()[col] ) / T(p_n_rows); } } - - out = acc; } else if(dim == 1) // find the mean in each row { - Col acc(p_n_rows, arma_zeros_indicator()); + arma_debug_print("op_sp_mean::apply_fast(): dim = 1"); - eT* acc_mem = acc.memptr(); + out.zeros(p_n_rows, 1); + + eT* out_mem = out.memptr(); typename SpProxy::const_iterator_type it = p.begin(); const uword N = p.get_n_nonzero(); - for(uword i=0; i < N; ++i) { acc_mem[it.row()] += (*it); ++it; } - - acc /= T(p_n_cols); + for(uword i=0; i < N; ++i) { out_mem[it.row()] += (*it); ++it; } - out = acc; + out /= T(p_n_cols); } if(out.internal_has_nonfinite()) { - spop_mean::apply_noalias_slow(out, p, dim); + op_sp_mean::apply_slow(out, p, dim); } } @@ -136,27 +126,25 @@ spop_mean::apply_noalias_fast template inline void -spop_mean::apply_noalias_slow +op_sp_mean::apply_slow ( - SpMat& out, - const SpProxy& p, - const uword dim + Mat& out, + const SpProxy& p, + const uword dim ) { - arma_extra_debug_sigprint(); - + arma_debug_sigprint(); + typedef typename T1::elem_type eT; const uword p_n_rows = p.get_n_rows(); const uword p_n_cols = p.get_n_cols(); - + if(dim == 0) // find the mean in each column { - arma_extra_debug_print("spop_mean::apply_noalias(): dim = 0"); + arma_debug_print("op_sp_mean::apply_slow(): dim = 0"); - out.set_size((p_n_rows > 0) ? 1 : 0, p_n_cols); - - if( (p_n_rows == 0) || (p.get_n_nonzero() == 0) ) { return; } + out.zeros(1, p_n_cols); for(uword col = 0; col < p_n_cols; ++col) { @@ -168,11 +156,11 @@ spop_mean::apply_noalias_slow const uword n_zero = p_n_rows - (end.pos() - it.pos()); - out.at(0,col) = spop_mean::iterator_mean(it, end, n_zero, eT(0)); + out.at(0,col) = op_sp_mean::iterator_mean(it, end, n_zero, eT(0)); } else { - out.at(0,col) = spop_mean::direct_mean + out.at(0,col) = op_sp_mean::direct_mean ( &p.get_values()[p.get_col_ptrs()[col]], p.get_col_ptrs()[col + 1] - p.get_col_ptrs()[col], @@ -184,11 +172,9 @@ spop_mean::apply_noalias_slow else if(dim == 1) // find the mean in each row { - arma_extra_debug_print("spop_mean::apply_noalias(): dim = 1"); - - out.set_size(p_n_rows, (p_n_cols > 0) ? 1 : 0); + arma_debug_print("op_sp_mean::apply_slow(): dim = 1"); - if( (p_n_cols == 0) || (p.get_n_nonzero() == 0) ) { return; } + out.zeros(p_n_rows, 1); for(uword row = 0; row < p_n_rows; ++row) { @@ -198,7 +184,7 @@ spop_mean::apply_noalias_slow const uword n_zero = p_n_cols - (end.pos() - it.pos()); - out.at(row,0) = spop_mean::iterator_mean(it, end, n_zero, eT(0)); + out.at(row,0) = op_sp_mean::iterator_mean(it, end, n_zero, eT(0)); } } } @@ -208,20 +194,20 @@ spop_mean::apply_noalias_slow template inline eT -spop_mean::direct_mean +op_sp_mean::direct_mean ( const eT* const X, const uword length, const uword N ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; const eT result = ((length > 0) && (N > 0)) ? eT(arrayops::accumulate(X, length) / T(N)) : eT(0); - return arma_isfinite(result) ? result : spop_mean::direct_mean_robust(X, length, N); + return arma_isfinite(result) ? result : op_sp_mean::direct_mean_robust(X, length, N); } @@ -229,39 +215,39 @@ spop_mean::direct_mean template inline eT -spop_mean::direct_mean_robust +op_sp_mean::direct_mean_robust ( const eT* const X, const uword length, const uword N ) { - arma_extra_debug_sigprint(); - + arma_debug_sigprint(); + typedef typename get_pod_type::result T; - + uword i, j; - + eT r_mean = eT(0); - + const uword diff = (N - length); // number of zeros - + for(i = 0, j = 1; j < length; i += 2, j += 2) { const eT Xi = X[i]; const eT Xj = X[j]; - + r_mean += (Xi - r_mean) / T(diff + j); r_mean += (Xj - r_mean) / T(diff + j + 1); } - + if(i < length) { const eT Xi = X[i]; - + r_mean += (Xi - r_mean) / T(diff + i + 1); } - + return r_mean; } @@ -270,22 +256,31 @@ spop_mean::direct_mean_robust template inline typename T1::elem_type -spop_mean::mean_all(const SpBase& X) +op_sp_mean::mean_all(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); + + typedef typename T1::elem_type eT; SpProxy p(X.get_ref()); + if(p.get_n_elem() == 0) + { + arma_conform_check(true, "mean(): object has no elements"); + + return Datum::nan; + } + if(SpProxy::use_iterator) { typename SpProxy::const_iterator_type it = p.begin(); typename SpProxy::const_iterator_type end = p.end(); - - return spop_mean::iterator_mean(it, end, p.get_n_elem() - p.get_n_nonzero(), typename T1::elem_type(0)); + + return op_sp_mean::iterator_mean(it, end, p.get_n_elem() - p.get_n_nonzero(), typename T1::elem_type(0)); } else // use_iterator == false; that is, we can directly access the values array { - return spop_mean::direct_mean(p.get_values(), p.get_n_nonzero(), p.get_n_elem()); + return op_sp_mean::direct_mean(p.get_values(), p.get_n_nonzero(), p.get_n_elem()); } } @@ -294,25 +289,25 @@ spop_mean::mean_all(const SpBase& X) template inline typename T1::elem_type -spop_mean::mean_all(const SpOp& expr) +op_sp_mean::mean_all(const SpOp& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; - const bool is_vectorise = \ + constexpr bool is_vectorise = \ (is_same_type::yes) || (is_same_type::yes) || (is_same_type::yes); if(is_vectorise) { - return spop_mean::mean_all(expr.m); + return op_sp_mean::mean_all(expr.m); } const SpMat tmp = expr; - return spop_mean::mean_all(tmp); + return op_sp_mean::mean_all(tmp); } @@ -320,9 +315,9 @@ spop_mean::mean_all(const SpOp& expr) template inline eT -spop_mean::iterator_mean(T1& it, const T1& end, const uword n_zero, const eT junk) +op_sp_mean::iterator_mean(T1& it, const T1& end, const uword n_zero, const eT junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename get_pod_type::result T; @@ -343,7 +338,7 @@ spop_mean::iterator_mean(T1& it, const T1& end, const uword n_zero, const eT jun const eT result = (count > 0) ? eT(acc / T(count)) : eT(0); - return arma_isfinite(result) ? result : spop_mean::iterator_mean_robust(backup_it, end, n_zero, eT(0)); + return arma_isfinite(result) ? result : op_sp_mean::iterator_mean_robust(backup_it, end, n_zero, eT(0)); } @@ -351,23 +346,23 @@ spop_mean::iterator_mean(T1& it, const T1& end, const uword n_zero, const eT jun template inline eT -spop_mean::iterator_mean_robust(T1& it, const T1& end, const uword n_zero, const eT junk) +op_sp_mean::iterator_mean_robust(T1& it, const T1& end, const uword n_zero, const eT junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); - + typedef typename get_pod_type::result T; - + eT r_mean = eT(0); - + const uword it_begin_pos = it.pos(); - + while(it != end) { r_mean += ((*it - r_mean) / T(n_zero + (it.pos() - it_begin_pos) + 1)); ++it; } - + return r_mean; } diff --git a/inst/include/armadillo_bits/spop_min_bones.hpp b/inst/include/armadillo_bits/op_sp_min_bones.hpp similarity index 79% rename from inst/include/armadillo_bits/spop_min_bones.hpp rename to inst/include/armadillo_bits/op_sp_min_bones.hpp index 1fd8ed3d..9cd75e99 100644 --- a/inst/include/armadillo_bits/spop_min_bones.hpp +++ b/inst/include/armadillo_bits/op_sp_min_bones.hpp @@ -16,22 +16,21 @@ // ------------------------------------------------------------------------ -//! \addtogroup spop_min +//! \addtogroup op_sp_min //! @{ - -class spop_min +class op_sp_min : public traits_op_xvec { public: template - inline static void apply(SpMat& out, const SpOp& in); + inline static void apply(Mat& out, const SpToDOp& in); // template - inline static void apply_proxy(SpMat& out, const SpProxy& p, const uword dim, const typename arma_not_cx::result* junk = nullptr); + inline static void apply_proxy(Mat& out, const SpProxy& p, const uword dim, const typename arma_not_cx::result* junk = nullptr); template inline static typename T1::elem_type vector_min(const T1& X, const typename arma_not_cx::result* junk = nullptr); @@ -45,7 +44,7 @@ class spop_min // template - inline static void apply_proxy(SpMat& out, const SpProxy& p, const uword dim, const typename arma_cx_only::result* junk = nullptr); + inline static void apply_proxy(Mat& out, const SpProxy& p, const uword dim, const typename arma_cx_only::result* junk = nullptr); template inline static typename T1::elem_type vector_min(const T1& X, const typename arma_cx_only::result* junk = nullptr); diff --git a/inst/include/armadillo_bits/spop_min_meat.hpp b/inst/include/armadillo_bits/op_sp_min_meat.hpp similarity index 85% rename from inst/include/armadillo_bits/spop_min_meat.hpp rename to inst/include/armadillo_bits/op_sp_min_meat.hpp index b47c33ca..7c53aa5d 100644 --- a/inst/include/armadillo_bits/spop_min_meat.hpp +++ b/inst/include/armadillo_bits/op_sp_min_meat.hpp @@ -16,7 +16,7 @@ // ------------------------------------------------------------------------ -//! \addtogroup spop_min +//! \addtogroup op_sp_min //! @{ @@ -24,12 +24,13 @@ template inline void -spop_min::apply(SpMat& out, const SpOp& in) +op_sp_min::apply(Mat& out, const SpToDOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword dim = in.aux_uword_a; - arma_debug_check( (dim > 1), "min(): parameter 'dim' must be 0 or 1" ); + + arma_conform_check( (dim > 1), "min(): parameter 'dim' must be 0 or 1" ); const SpProxy p(in.m); @@ -44,7 +45,7 @@ spop_min::apply(SpMat& out, const SpOp& in) return; } - spop_min::apply_proxy(out, p, dim); + op_sp_min::apply_proxy(out, p, dim); } @@ -52,15 +53,15 @@ spop_min::apply(SpMat& out, const SpOp& in) template inline void -spop_min::apply_proxy +op_sp_min::apply_proxy ( - SpMat& out, - const SpProxy& p, - const uword dim, + Mat& out, + const SpProxy& p, + const uword dim, const typename arma_not_cx::result* junk ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; @@ -73,46 +74,44 @@ spop_min::apply_proxy if(dim == 0) // find the minimum in each column { - Row value(p_n_cols, arma_zeros_indicator()); + out.zeros(1, p_n_cols); + urowvec count(p_n_cols, arma_zeros_indicator()); while(it != it_end) { const uword col = it.col(); - value[col] = (count[col] == 0) ? (*it) : (std::min)(value[col], (*it)); + out[col] = (count[col] == 0) ? (*it) : (std::min)(out[col], (*it)); count[col]++; ++it; } for(uword col=0; col value(p_n_rows, arma_zeros_indicator()); + out.zeros(p_n_rows, 1); + ucolvec count(p_n_rows, arma_zeros_indicator()); while(it != it_end) { const uword row = it.row(); - value[row] = (count[row] == 0) ? (*it) : (std::min)(value[row], (*it)); + out[row] = (count[row] == 0) ? (*it) : (std::min)(out[row], (*it)); count[row]++; ++it; } for(uword row=0; row inline typename T1::elem_type -spop_min::vector_min +op_sp_min::vector_min ( const T1& x, const typename arma_not_cx::result* junk ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; @@ -136,7 +135,7 @@ spop_min::vector_min if(p.get_n_elem() == 0) { - arma_debug_check(true, "min(): object has no elements"); + arma_conform_check(true, "min(): object has no elements"); return Datum::nan; } @@ -187,34 +186,34 @@ spop_min::vector_min template inline typename arma_not_cx::result -spop_min::min(const SpBase& X) +op_sp_min::min(const SpBase& X) { - arma_extra_debug_sigprint(); - + arma_debug_sigprint(); + typedef typename T1::elem_type eT; - + const SpProxy P(X.get_ref()); - + const uword n_elem = P.get_n_elem(); const uword n_nonzero = P.get_n_nonzero(); - + if(n_elem == 0) { - arma_debug_check(true, "min(): object has no elements"); + arma_conform_check(true, "min(): object has no elements"); return Datum::nan; } - + eT min_val = priv::most_pos(); - + if(SpProxy::use_iterator) { // We have to iterate over the elements. typedef typename SpProxy::const_iterator_type it_type; - + it_type it = P.begin(); it_type it_end = P.end(); - + while(it != it_end) { if((*it) < min_val) { min_val = *it; } @@ -229,7 +228,7 @@ spop_min::min(const SpBase& X) // other functions... min_val = op_min::direct_min(P.get_values(), n_nonzero); } - + if(n_elem == n_nonzero) { return min_val; @@ -245,9 +244,9 @@ spop_min::min(const SpBase& X) template inline typename arma_not_cx::result -spop_min::min_with_index(const SpProxy& P, uword& index_of_min_val) +op_sp_min::min_with_index(const SpProxy& P, uword& index_of_min_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -257,7 +256,7 @@ spop_min::min_with_index(const SpProxy& P, uword& index_of_min_val) if(n_elem == 0) { - arma_debug_check(true, "min(): object has no elements"); + arma_conform_check(true, "min(): object has no elements"); index_of_min_val = uword(0); @@ -301,7 +300,7 @@ spop_min::min_with_index(const SpProxy& P, uword& index_of_min_val) if(n_elem != n_nonzero) { min_val = (std::min)(eT(0), min_val); - + // If the min_val is a nonzero element, we need its actual position in the matrix. if(min_val == eT(0)) { @@ -353,15 +352,15 @@ spop_min::min_with_index(const SpProxy& P, uword& index_of_min_val) template inline void -spop_min::apply_proxy +op_sp_min::apply_proxy ( - SpMat& out, - const SpProxy& p, - const uword dim, + Mat& out, + const SpProxy& p, + const uword dim, const typename arma_cx_only::result* junk ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; @@ -375,8 +374,9 @@ spop_min::apply_proxy if(dim == 0) // find the minimum in each column { - Row rawval(p_n_cols, arma_zeros_indicator()); - Row< T> absval(p_n_cols, arma_zeros_indicator()); + out.zeros(1, p_n_cols); + + Row absval(p_n_cols, arma_zeros_indicator()); urowvec count(p_n_cols, arma_zeros_indicator()); while(it != it_end) @@ -389,14 +389,14 @@ spop_min::apply_proxy if(count[col] == 0) { absval[col] = a; - rawval[col] = v; + out[col] = v; } else { if(a < absval[col]) { absval[col] = a; - rawval[col] = v; + out[col] = v; } } @@ -408,17 +408,16 @@ spop_min::apply_proxy { if(count[col] < p_n_rows) { - if(T(0) < absval[col]) { rawval[col] = eT(0); } + if(T(0) < absval[col]) { out[col] = eT(0); } } } - - out = rawval; } else if(dim == 1) // find the minimum in each row { - Col rawval(p_n_rows, arma_zeros_indicator()); - Col< T> absval(p_n_rows, arma_zeros_indicator()); + out.zeros(p_n_rows, 1); + + Col absval(p_n_rows, arma_zeros_indicator()); ucolvec count(p_n_rows, arma_zeros_indicator()); while(it != it_end) @@ -431,14 +430,14 @@ spop_min::apply_proxy if(count[row] == 0) { absval[row] = a; - rawval[row] = v; + out[row] = v; } else { if(a < absval[row]) { absval[row] = a; - rawval[row] = v; + out[row] = v; } } @@ -450,11 +449,9 @@ spop_min::apply_proxy { if(count[row] < p_n_cols) { - if(T(0) < absval[row]) { rawval[row] = eT(0); } + if(T(0) < absval[row]) { out[row] = eT(0); } } } - - out = rawval; } } @@ -463,23 +460,23 @@ spop_min::apply_proxy template inline typename T1::elem_type -spop_min::vector_min +op_sp_min::vector_min ( const T1& x, const typename arma_cx_only::result* junk ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; typedef typename get_pod_type::result T; - + const SpProxy p(x); if(p.get_n_elem() == 0) { - arma_debug_check(true, "min(): object has no elements"); + arma_conform_check(true, "min(): object has no elements"); return Datum::nan; } @@ -544,9 +541,9 @@ spop_min::vector_min template inline typename arma_cx_only::result -spop_min::min(const SpBase& X) +op_sp_min::min(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename get_pod_type::result T; @@ -558,14 +555,14 @@ spop_min::min(const SpBase& X) if(n_elem == 0) { - arma_debug_check(true, "min(): object has no elements"); + arma_conform_check(true, "min(): object has no elements"); return Datum::nan; } - + T min_val = priv::most_pos(); eT ret_val; - + if(SpProxy::use_iterator) { // We have to iterate over the elements. @@ -611,9 +608,9 @@ spop_min::min(const SpBase& X) template inline typename arma_cx_only::result -spop_min::min_with_index(const SpProxy& P, uword& index_of_min_val) +op_sp_min::min_with_index(const SpProxy& P, uword& index_of_min_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename get_pod_type::result T; @@ -624,7 +621,7 @@ spop_min::min_with_index(const SpProxy& P, uword& index_of_min_val) if(n_elem == 0) { - arma_debug_check(true, "min(): object has no elements"); + arma_conform_check(true, "min(): object has no elements"); index_of_min_val = uword(0); diff --git a/inst/include/armadillo_bits/op_sp_minus_meat.hpp b/inst/include/armadillo_bits/op_sp_minus_meat.hpp index f8151a8a..917b4294 100644 --- a/inst/include/armadillo_bits/op_sp_minus_meat.hpp +++ b/inst/include/armadillo_bits/op_sp_minus_meat.hpp @@ -26,7 +26,7 @@ inline void op_sp_minus_pre::apply(Mat& out, const SpToDOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // Note that T1 will be a sparse type, so we use SpProxy. const SpProxy proxy(in.m); @@ -51,7 +51,7 @@ inline void op_sp_minus_pre::apply(SpMat& out, const SpToDOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -80,12 +80,12 @@ inline void op_sp_minus_pre::apply_inside_schur(SpMat& out, const T2& x, const SpToDOp& y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy proxy2(x); const SpProxy proxy3(y.m); - arma_debug_assert_same_size(proxy2.get_n_rows(), proxy2.get_n_cols(), proxy3.get_n_rows(), proxy3.get_n_cols(), "element-wise multiplication"); + arma_conform_assert_same_size(proxy2.get_n_rows(), proxy2.get_n_cols(), proxy3.get_n_rows(), proxy3.get_n_cols(), "element-wise multiplication"); out.zeros(proxy2.get_n_rows(), proxy2.get_n_cols()); @@ -111,12 +111,12 @@ inline void op_sp_minus_pre::apply_inside_div(SpMat& out, const T2& x, const SpToDOp& y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy proxy2(x); const SpProxy proxy3(y.m); - arma_debug_assert_same_size(proxy2.get_n_rows(), proxy2.get_n_cols(), proxy3.get_n_rows(), proxy3.get_n_cols(), "element-wise multiplication"); + arma_conform_assert_same_size(proxy2.get_n_rows(), proxy2.get_n_cols(), proxy3.get_n_rows(), proxy3.get_n_cols(), "element-wise multiplication"); out.zeros(proxy2.get_n_rows(), proxy2.get_n_cols()); @@ -142,7 +142,7 @@ inline void op_sp_minus_post::apply(Mat& out, const SpToDOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // Note that T1 will be a sparse type, so we use SpProxy. const SpProxy proxy(in.m); @@ -167,7 +167,7 @@ inline void op_sp_minus_post::apply(SpMat& out, const SpToDOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -196,12 +196,12 @@ inline void op_sp_minus_post::apply_inside_schur(SpMat& out, const T2& x, const SpToDOp& y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy proxy2(x); const SpProxy proxy3(y.m); - arma_debug_assert_same_size(proxy2.get_n_rows(), proxy2.get_n_cols(), proxy3.get_n_rows(), proxy3.get_n_cols(), "element-wise multiplication"); + arma_conform_assert_same_size(proxy2.get_n_rows(), proxy2.get_n_cols(), proxy3.get_n_rows(), proxy3.get_n_cols(), "element-wise multiplication"); out.zeros(proxy2.get_n_rows(), proxy2.get_n_cols()); @@ -227,12 +227,12 @@ inline void op_sp_minus_post::apply_inside_div(SpMat& out, const T2& x, const SpToDOp& y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy proxy2(x); const SpProxy proxy3(y.m); - arma_debug_assert_same_size(proxy2.get_n_rows(), proxy2.get_n_cols(), proxy3.get_n_rows(), proxy3.get_n_cols(), "element-wise multiplication"); + arma_conform_assert_same_size(proxy2.get_n_rows(), proxy2.get_n_cols(), proxy3.get_n_rows(), proxy3.get_n_cols(), "element-wise multiplication"); out.zeros(proxy2.get_n_rows(), proxy2.get_n_cols()); diff --git a/inst/include/armadillo_bits/op_sp_plus_meat.hpp b/inst/include/armadillo_bits/op_sp_plus_meat.hpp index 723d9689..b5515caf 100644 --- a/inst/include/armadillo_bits/op_sp_plus_meat.hpp +++ b/inst/include/armadillo_bits/op_sp_plus_meat.hpp @@ -25,7 +25,7 @@ inline void op_sp_plus::apply(Mat& out, const SpToDOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // Note that T1 will be a sparse type, so we use SpProxy. const SpProxy proxy(in.m); @@ -50,7 +50,7 @@ inline void op_sp_plus::apply(SpMat& out, const SpToDOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -80,12 +80,12 @@ inline void op_sp_plus::apply_inside_schur(SpMat& out, const T2& x, const SpToDOp& y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy proxy2(x); const SpProxy proxy3(y.m); - arma_debug_assert_same_size(proxy2.get_n_rows(), proxy2.get_n_cols(), proxy3.get_n_rows(), proxy3.get_n_cols(), "element-wise multiplication"); + arma_conform_assert_same_size(proxy2.get_n_rows(), proxy2.get_n_cols(), proxy3.get_n_rows(), proxy3.get_n_cols(), "element-wise multiplication"); out.zeros(proxy2.get_n_rows(), proxy2.get_n_cols()); @@ -111,12 +111,12 @@ inline void op_sp_plus::apply_inside_div(SpMat& out, const T2& x, const SpToDOp& y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy proxy2(x); const SpProxy proxy3(y.m); - arma_debug_assert_same_size(proxy2.get_n_rows(), proxy2.get_n_cols(), proxy3.get_n_rows(), proxy3.get_n_cols(), "element-wise division"); + arma_conform_assert_same_size(proxy2.get_n_rows(), proxy2.get_n_cols(), proxy3.get_n_rows(), proxy3.get_n_cols(), "element-wise division"); out.zeros(proxy2.get_n_rows(), proxy2.get_n_cols()); diff --git a/inst/include/armadillo_bits/op_sp_stddev_bones.hpp b/inst/include/armadillo_bits/op_sp_stddev_bones.hpp new file mode 100644 index 00000000..1f1455f6 --- /dev/null +++ b/inst/include/armadillo_bits/op_sp_stddev_bones.hpp @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + + +//! \addtogroup op_sp_stddev +//! @{ + + + +class op_sp_stddev + : public traits_op_xvec + { + public: + + template + inline static void apply(Mat& out, const mtSpToDOp& in); + + template + inline static void apply_slow(Mat& out, const SpProxy& p, const uword norm_type, const uword dim); + + template + inline static typename T1::pod_type stddev_vec(const T1& X, const uword norm_type = 0); + }; + + + +//! @} diff --git a/inst/include/armadillo_bits/op_sp_stddev_meat.hpp b/inst/include/armadillo_bits/op_sp_stddev_meat.hpp new file mode 100644 index 00000000..52b3d313 --- /dev/null +++ b/inst/include/armadillo_bits/op_sp_stddev_meat.hpp @@ -0,0 +1,162 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + + +//! \addtogroup op_sp_stddev +//! @{ + + + +template +inline +void +op_sp_stddev::apply(Mat& out, const mtSpToDOp& in) + { + arma_debug_sigprint(); + + const uword norm_type = in.aux_uword_a; + const uword dim = in.aux_uword_b; + + arma_conform_check( (norm_type > 1), "stddev(): parameter 'norm_type' must be 0 or 1" ); + arma_conform_check( (dim > 1), "stddev(): parameter 'dim' must be 0 or 1" ); + + const SpProxy p(in.m); + + const uword p_n_rows = p.get_n_rows(); + const uword p_n_cols = p.get_n_cols(); + + if( (p_n_rows == 0) || (p_n_cols == 0) || (p.get_n_nonzero() == 0) ) + { + if(dim == 0) { out.zeros((p_n_rows > 0) ? 1 : 0, p_n_cols); } + if(dim == 1) { out.zeros(p_n_rows, (p_n_cols > 0) ? 1 : 0); } + + return; + } + + op_sp_stddev::apply_slow(out, p, norm_type, dim); + } + + + +template +inline +void +op_sp_stddev::apply_slow + ( + Mat& out, + const SpProxy& p, + const uword norm_type, + const uword dim + ) + { + arma_debug_sigprint(); + + typedef typename T1::elem_type in_eT; + //typedef typename T1::pod_type out_eT; + + const uword p_n_rows = p.get_n_rows(); + const uword p_n_cols = p.get_n_cols(); + + if(dim == 0) // find variance in each column + { + arma_debug_print("op_sp_stddev::apply_slow(): dim = 0"); + + out.zeros(1, p_n_cols); + + for(uword col = 0; col < p_n_cols; ++col) + { + if(SpProxy::use_iterator) + { + // We must use an iterator; we can't access memory directly. + typename SpProxy::const_iterator_type it = p.begin_col(col); + typename SpProxy::const_iterator_type end = p.begin_col(col + 1); + + const uword n_zero = p_n_rows - (end.pos() - it.pos()); + + // in_eT is used just to get the specialization right (complex / noncomplex) + out.at(0, col) = std::sqrt( op_sp_var::iterator_var(it, end, n_zero, norm_type, in_eT(0)) ); + } + else + { + // We can use direct memory access to calculate the variance. + out.at(0, col) = std::sqrt( + op_sp_var::direct_var + ( + &p.get_values()[p.get_col_ptrs()[col]], + p.get_col_ptrs()[col + 1] - p.get_col_ptrs()[col], + p_n_rows, + norm_type + ) + ); + } + } + } + else + if(dim == 1) // find variance in each row + { + arma_debug_print("op_sp_stddev::apply_slow(): dim = 1"); + + out.zeros(p_n_rows, 1); + + for(uword row = 0; row < p_n_rows; ++row) + { + // We have to use an iterator here regardless of whether or not we can + // directly access memory. + typename SpProxy::const_row_iterator_type it = p.begin_row(row); + typename SpProxy::const_row_iterator_type end = p.end_row(row); + + const uword n_zero = p_n_cols - (end.pos() - it.pos()); + + out.at(row, 0) = std::sqrt( op_sp_var::iterator_var(it, end, n_zero, norm_type, in_eT(0)) ); + } + } + } + + + +template +inline +typename T1::pod_type +op_sp_stddev::stddev_vec + ( + const T1& X, + const uword norm_type + ) + { + arma_debug_sigprint(); + + typedef typename T1::pod_type T; + + arma_conform_check( (norm_type > 1), "stddev(): parameter 'norm_type' must be 0 or 1" ); + + // conditionally unwrap it into a temporary and then directly operate. + + const unwrap_spmat tmp(X); + + if(tmp.M.n_elem == 0) + { + arma_conform_check(true, "stddev(): object has no elements"); + + return Datum::nan; + } + + return std::sqrt( op_sp_var::direct_var(tmp.M.values, tmp.M.n_nonzero, tmp.M.n_elem, norm_type) ); + } + + + +//! @} diff --git a/inst/include/armadillo_bits/spop_sum_bones.hpp b/inst/include/armadillo_bits/op_sp_sum_bones.hpp similarity index 86% rename from inst/include/armadillo_bits/spop_sum_bones.hpp rename to inst/include/armadillo_bits/op_sp_sum_bones.hpp index 2e4e5582..0f5c0c65 100644 --- a/inst/include/armadillo_bits/spop_sum_bones.hpp +++ b/inst/include/armadillo_bits/op_sp_sum_bones.hpp @@ -16,17 +16,17 @@ // ------------------------------------------------------------------------ -//! \addtogroup spop_sum +//! \addtogroup op_sp_sum //! @{ -class spop_sum +class op_sp_sum : public traits_op_xvec { public: template - inline static void apply(SpMat& out, const SpOp& in); + inline static void apply(Mat& out, const SpToDOp& in); }; diff --git a/inst/include/armadillo_bits/spop_sum_meat.hpp b/inst/include/armadillo_bits/op_sp_sum_meat.hpp similarity index 72% rename from inst/include/armadillo_bits/spop_sum_meat.hpp rename to inst/include/armadillo_bits/op_sp_sum_meat.hpp index 63badfd9..f60879d3 100644 --- a/inst/include/armadillo_bits/spop_sum_meat.hpp +++ b/inst/include/armadillo_bits/op_sp_sum_meat.hpp @@ -16,7 +16,7 @@ // ------------------------------------------------------------------------ -//! \addtogroup spop_sum +//! \addtogroup op_sp_sum //! @{ @@ -24,43 +24,39 @@ template inline void -spop_sum::apply(SpMat& out, const SpOp& in) +op_sp_sum::apply(Mat& out, const SpToDOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const uword dim = in.aux_uword_a; - arma_debug_check( (dim > 1), "sum(): parameter 'dim' must be 0 or 1" ); + + arma_conform_check( (dim > 1), "sum(): parameter 'dim' must be 0 or 1" ); const SpProxy p(in.m); const uword p_n_rows = p.get_n_rows(); const uword p_n_cols = p.get_n_cols(); - if(p.get_n_nonzero() == 0) - { - if(dim == 0) { out.zeros(1,p_n_cols); } - if(dim == 1) { out.zeros(p_n_rows,1); } - - return; - } + if(dim == 0) { out.zeros(1, p_n_cols); } + if(dim == 1) { out.zeros(p_n_rows, 1); } + if(p.get_n_nonzero() == 0) { return; } + + eT* out_mem = out.memptr(); + if(dim == 0) // find the sum in each column { - Row acc(p_n_cols, arma_zeros_indicator()); - - eT* acc_mem = acc.memptr(); - if(SpProxy::use_iterator) { typename SpProxy::const_iterator_type it = p.begin(); const uword N = p.get_n_nonzero(); - + for(uword i=0; i < N; ++i) { - acc_mem[it.col()] += (*it); + out_mem[it.col()] += (*it); ++it; } } @@ -68,34 +64,26 @@ spop_sum::apply(SpMat& out, const SpOp& in) { for(uword col = 0; col < p_n_cols; ++col) { - acc_mem[col] = arrayops::accumulate + out_mem[col] = arrayops::accumulate ( &p.get_values()[p.get_col_ptrs()[col]], p.get_col_ptrs()[col + 1] - p.get_col_ptrs()[col] ); } } - - out = acc; } else if(dim == 1) // find the sum in each row { - Col acc(p_n_rows, arma_zeros_indicator()); - - eT* acc_mem = acc.memptr(); - typename SpProxy::const_iterator_type it = p.begin(); const uword N = p.get_n_nonzero(); for(uword i=0; i < N; ++i) { - acc_mem[it.row()] += (*it); + out_mem[it.row()] += (*it); ++it; } - - out = acc; } } diff --git a/inst/include/armadillo_bits/spop_var_bones.hpp b/inst/include/armadillo_bits/op_sp_var_bones.hpp similarity index 88% rename from inst/include/armadillo_bits/spop_var_bones.hpp rename to inst/include/armadillo_bits/op_sp_var_bones.hpp index 09f0e243..69a29e5e 100644 --- a/inst/include/armadillo_bits/spop_var_bones.hpp +++ b/inst/include/armadillo_bits/op_sp_var_bones.hpp @@ -16,22 +16,22 @@ // ------------------------------------------------------------------------ -//! \addtogroup spop_var +//! \addtogroup op_sp_var //! @{ //! Class for finding variance values of a sparse matrix -class spop_var +class op_sp_var : public traits_op_xvec { public: - + template - inline static void apply(SpMat& out, const mtSpOp& in); - + inline static void apply(Mat& out, const mtSpToDOp& in); + template - inline static void apply_noalias(SpMat& out, const SpProxy& p, const uword norm_type, const uword dim); + inline static void apply_slow(Mat& out, const SpProxy& p, const uword norm_type, const uword dim); // Calculate variance of a sparse vector, where we can directly use the memory. template @@ -42,23 +42,21 @@ class spop_var // as well as the actual number of elements when zeros are included. template inline static eT direct_var(const eT* const X, const uword length, const uword N, const uword norm_type = 0); - + // For complex numbers. - + template inline static T direct_var(const std::complex* const X, const uword length, const uword N, const uword norm_type = 0); - + // Calculate the variance using iterators, for non-complex numbers. template inline static eT iterator_var(T1& it, const T1& end, const uword n_zero, const uword norm_type, const eT junk1, const typename arma_not_cx::result* junk2 = nullptr); - + // Calculate the variance using iterators, for complex numbers. template inline static typename get_pod_type::result iterator_var(T1& it, const T1& end, const uword n_zero, const uword norm_type, const eT junk1, const typename arma_cx_only::result* junk2 = nullptr); - }; //! @} - diff --git a/inst/include/armadillo_bits/spop_var_meat.hpp b/inst/include/armadillo_bits/op_sp_var_meat.hpp similarity index 78% rename from inst/include/armadillo_bits/spop_var_meat.hpp rename to inst/include/armadillo_bits/op_sp_var_meat.hpp index 8d01a445..68f1dd94 100644 --- a/inst/include/armadillo_bits/spop_var_meat.hpp +++ b/inst/include/armadillo_bits/op_sp_var_meat.hpp @@ -16,7 +16,7 @@ // ------------------------------------------------------------------------ -//! \addtogroup spop_var +//! \addtogroup op_sp_var //! @{ @@ -24,33 +24,30 @@ template inline void -spop_var::apply(SpMat& out, const mtSpOp& in) +op_sp_var::apply(Mat& out, const mtSpToDOp& in) { - arma_extra_debug_sigprint(); - - //typedef typename T1::elem_type in_eT; - typedef typename T1::pod_type out_eT; + arma_debug_sigprint(); const uword norm_type = in.aux_uword_a; const uword dim = in.aux_uword_b; - arma_debug_check( (norm_type > 1), "var(): parameter 'norm_type' must be 0 or 1" ); - arma_debug_check( (dim > 1), "var(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (norm_type > 1), "var(): parameter 'norm_type' must be 0 or 1" ); + arma_conform_check( (dim > 1), "var(): parameter 'dim' must be 0 or 1" ); const SpProxy p(in.m); - if(p.is_alias(out) == false) - { - spop_var::apply_noalias(out, p, norm_type, dim); - } - else + const uword p_n_rows = p.get_n_rows(); + const uword p_n_cols = p.get_n_cols(); + + if( (p_n_rows == 0) || (p_n_cols == 0) || (p.get_n_nonzero() == 0) ) { - SpMat tmp; + if(dim == 0) { out.zeros((p_n_rows > 0) ? 1 : 0, p_n_cols); } + if(dim == 1) { out.zeros(p_n_rows, (p_n_cols > 0) ? 1 : 0); } - spop_var::apply_noalias(tmp, p, norm_type, dim); - - out.steal_mem(tmp); + return; } + + op_sp_var::apply_slow(out, p, norm_type, dim); } @@ -58,15 +55,15 @@ spop_var::apply(SpMat& out, const mtSpOp inline void -spop_var::apply_noalias +op_sp_var::apply_slow ( - SpMat& out, - const SpProxy& p, - const uword norm_type, - const uword dim + Mat& out, + const SpProxy& p, + const uword norm_type, + const uword dim ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type in_eT; //typedef typename T1::pod_type out_eT; @@ -74,15 +71,11 @@ spop_var::apply_noalias const uword p_n_rows = p.get_n_rows(); const uword p_n_cols = p.get_n_cols(); - // TODO: this is slow; rewrite based on the approach used by sparse mean() - if(dim == 0) // find variance in each column { - arma_extra_debug_print("spop_var::apply_noalias(): dim = 0"); - - out.set_size((p_n_rows > 0) ? 1 : 0, p_n_cols); + arma_debug_print("op_sp_var::apply_slow(): dim = 0"); - if( (p_n_rows == 0) || (p.get_n_nonzero() == 0) ) { return; } + out.zeros(1, p_n_cols); for(uword col = 0; col < p_n_cols; ++col) { @@ -95,12 +88,12 @@ spop_var::apply_noalias const uword n_zero = p_n_rows - (end.pos() - it.pos()); // in_eT is used just to get the specialization right (complex / noncomplex) - out.at(0, col) = spop_var::iterator_var(it, end, n_zero, norm_type, in_eT(0)); + out.at(0, col) = op_sp_var::iterator_var(it, end, n_zero, norm_type, in_eT(0)); } else { // We can use direct memory access to calculate the variance. - out.at(0, col) = spop_var::direct_var + out.at(0, col) = op_sp_var::direct_var ( &p.get_values()[p.get_col_ptrs()[col]], p.get_col_ptrs()[col + 1] - p.get_col_ptrs()[col], @@ -113,11 +106,9 @@ spop_var::apply_noalias else if(dim == 1) // find variance in each row { - arma_extra_debug_print("spop_var::apply_noalias(): dim = 1"); + arma_debug_print("op_sp_var::apply_slow(): dim = 1"); - out.set_size(p_n_rows, (p_n_cols > 0) ? 1 : 0); - - if( (p_n_cols == 0) || (p.get_n_nonzero() == 0) ) { return; } + out.zeros(p_n_rows, 1); for(uword row = 0; row < p_n_rows; ++row) { @@ -128,7 +119,7 @@ spop_var::apply_noalias const uword n_zero = p_n_cols - (end.pos() - it.pos()); - out.at(row, 0) = spop_var::iterator_var(it, end, n_zero, norm_type, in_eT(0)); + out.at(row, 0) = op_sp_var::iterator_var(it, end, n_zero, norm_type, in_eT(0)); } } } @@ -138,20 +129,29 @@ spop_var::apply_noalias template inline typename T1::pod_type -spop_var::var_vec +op_sp_var::var_vec ( const T1& X, const uword norm_type ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); + + typedef typename T1::elem_type eT; - arma_debug_check( (norm_type > 1), "var(): parameter 'norm_type' must be 0 or 1" ); + arma_conform_check( (norm_type > 1), "var(): parameter 'norm_type' must be 0 or 1" ); // conditionally unwrap it into a temporary and then directly operate. const unwrap_spmat tmp(X); + if(tmp.M.n_elem == 0) + { + arma_conform_check(true, "var(): object has no elements"); + + return Datum::nan; + } + return direct_var(tmp.M.values, tmp.M.n_nonzero, tmp.M.n_elem, norm_type); } @@ -160,7 +160,7 @@ spop_var::var_vec template inline eT -spop_var::direct_var +op_sp_var::direct_var ( const eT* const X, const uword length, @@ -168,11 +168,11 @@ spop_var::direct_var const uword norm_type ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(length >= 2 && N >= 2) { - const eT acc1 = spop_mean::direct_mean(X, length, N); + const eT acc1 = op_sp_mean::direct_mean(X, length, N); eT acc2 = eT(0); eT acc3 = eT(0); @@ -234,7 +234,7 @@ spop_var::direct_var template inline T -spop_var::direct_var +op_sp_var::direct_var ( const std::complex* const X, const uword length, @@ -242,13 +242,13 @@ spop_var::direct_var const uword norm_type ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; if(length >= 2 && N >= 2) { - const eT acc1 = spop_mean::direct_mean(X, length, N); + const eT acc1 = op_sp_mean::direct_mean(X, length, N); T acc2 = T(0); eT acc3 = eT(0); @@ -294,7 +294,7 @@ spop_var::direct_var template inline eT -spop_var::iterator_var +op_sp_var::iterator_var ( T1& it, const T1& end, @@ -304,13 +304,13 @@ spop_var::iterator_var const typename arma_not_cx::result* junk2 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); T1 new_it(it); // for mean // T1 backup_it(it); // in case we have to call robust iterator_var - eT mean = spop_mean::iterator_mean(new_it, end, n_zero, eT(0)); + eT mean = op_sp_mean::iterator_mean(new_it, end, n_zero, eT(0)); eT acc2 = eT(0); eT acc3 = eT(0); @@ -353,7 +353,7 @@ spop_var::iterator_var template inline typename get_pod_type::result -spop_var::iterator_var +op_sp_var::iterator_var ( T1& it, const T1& end, @@ -363,7 +363,7 @@ spop_var::iterator_var const typename arma_cx_only::result* junk2 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk1); arma_ignore(junk2); @@ -371,7 +371,7 @@ spop_var::iterator_var T1 new_it(it); // for mean // T1 backup_it(it); // in case we have to call robust iterator_var - eT mean = spop_mean::iterator_mean(new_it, end, n_zero, eT(0)); + eT mean = op_sp_mean::iterator_mean(new_it, end, n_zero, eT(0)); T acc2 = T(0); eT acc3 = eT(0); diff --git a/inst/include/armadillo_bits/spop_vecnorm_bones.hpp b/inst/include/armadillo_bits/op_sp_vecnorm_bones.hpp similarity index 79% rename from inst/include/armadillo_bits/spop_vecnorm_bones.hpp rename to inst/include/armadillo_bits/op_sp_vecnorm_bones.hpp index eaeecd88..e049da35 100644 --- a/inst/include/armadillo_bits/spop_vecnorm_bones.hpp +++ b/inst/include/armadillo_bits/op_sp_vecnorm_bones.hpp @@ -16,17 +16,17 @@ // ------------------------------------------------------------------------ -//! \addtogroup spop_vecnorm +//! \addtogroup op_sp_vecnorm //! @{ -class spop_vecnorm +class op_sp_vecnorm : public traits_op_xvec { public: template - inline static void apply(SpMat& out, const mtSpOp& expr); + inline static void apply(Mat& out, const mtSpToDOp& expr); template inline static void apply_direct(Mat< typename get_pod_type::result >& out, const SpMat& X, const uword k); @@ -36,13 +36,13 @@ class spop_vecnorm // -class spop_vecnorm_ext +class op_sp_vecnorm_ext : public traits_op_xvec { public: template - inline static void apply(SpMat& out, const mtSpOp& expr); + inline static void apply(Mat& out, const mtSpToDOp& expr); template inline static void apply_direct(Mat< typename get_pod_type::result >& out, const SpMat& X, const uword method_id); diff --git a/inst/include/armadillo_bits/spop_vecnorm_meat.hpp b/inst/include/armadillo_bits/op_sp_vecnorm_meat.hpp similarity index 74% rename from inst/include/armadillo_bits/spop_vecnorm_meat.hpp rename to inst/include/armadillo_bits/op_sp_vecnorm_meat.hpp index 56ef7d91..43e121c9 100644 --- a/inst/include/armadillo_bits/spop_vecnorm_meat.hpp +++ b/inst/include/armadillo_bits/op_sp_vecnorm_meat.hpp @@ -16,7 +16,7 @@ // ------------------------------------------------------------------------ -//! \addtogroup spop_vecnorm +//! \addtogroup op_sp_vecnorm //! @{ @@ -24,9 +24,9 @@ template inline void -spop_vecnorm::apply(SpMat& out, const mtSpOp& expr) +op_sp_vecnorm::apply(Mat& out, const mtSpToDOp& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; @@ -34,8 +34,8 @@ spop_vecnorm::apply(SpMat& out, const mtSpOp 1), "vecnorm(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (k == 0), "vecnorm(): unsupported vector norm type" ); + arma_conform_check( (dim > 1), "vecnorm(): parameter 'dim' must be 0 or 1" ); const unwrap_spmat U(expr.m); const SpMat& X = U.M; @@ -44,11 +44,7 @@ spop_vecnorm::apply(SpMat& out, const mtSpOp tmp; - - spop_vecnorm::apply_direct(tmp, X, k); - - out = tmp; + op_sp_vecnorm::apply_direct(out, X, k); } else if(dim == 1) @@ -58,7 +54,7 @@ spop_vecnorm::apply(SpMat& out, const mtSpOp& out, const mtSpOp inline void -spop_vecnorm::apply_direct(Mat< typename get_pod_type::result >& out, const SpMat& X, const uword k) +op_sp_vecnorm::apply_direct(Mat< typename get_pod_type::result >& out, const SpMat& X, const uword k) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -114,9 +110,9 @@ spop_vecnorm::apply_direct(Mat< typename get_pod_type::result >& out, const template inline void -spop_vecnorm_ext::apply(SpMat& out, const mtSpOp& expr) +op_sp_vecnorm_ext::apply(Mat& out, const mtSpToDOp& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename T1::pod_type T; @@ -124,8 +120,8 @@ spop_vecnorm_ext::apply(SpMat& out, const mtSpOp 1), "vecnorm(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (method_id == 0), "vecnorm(): unsupported vector norm type" ); + arma_conform_check( (dim > 1), "vecnorm(): parameter 'dim' must be 0 or 1" ); const unwrap_spmat U(expr.m); const SpMat& X = U.M; @@ -134,11 +130,7 @@ spop_vecnorm_ext::apply(SpMat& out, const mtSpOp tmp; - - spop_vecnorm_ext::apply_direct(tmp, X, method_id); - - out = tmp; + op_sp_vecnorm_ext::apply_direct(out, X, method_id); } else if(dim == 1) @@ -148,7 +140,7 @@ spop_vecnorm_ext::apply(SpMat& out, const mtSpOp& out, const mtSpOp inline void -spop_vecnorm_ext::apply_direct(Mat< typename get_pod_type::result >& out, const SpMat& X, const uword method_id) +op_sp_vecnorm_ext::apply_direct(Mat< typename get_pod_type::result >& out, const SpMat& X, const uword method_id) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; diff --git a/inst/include/armadillo_bits/op_sqrtmat_meat.hpp b/inst/include/armadillo_bits/op_sqrtmat_meat.hpp index 3c2fae50..97c54b31 100644 --- a/inst/include/armadillo_bits/op_sqrtmat_meat.hpp +++ b/inst/include/armadillo_bits/op_sqrtmat_meat.hpp @@ -34,13 +34,13 @@ inline void op_sqrtmat::apply(Mat< std::complex >& out, const mtOp,T1,op_sqrtmat>& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_sqrtmat::apply_direct(out, in.m); if(status == false) { - arma_debug_warn_level(3, "sqrtmat(): given matrix is singular; may not have a square root"); + arma_conform_warn(3, "sqrtmat(): given matrix is singular; may not have a square root"); } } @@ -51,13 +51,13 @@ inline bool op_sqrtmat::apply_direct(Mat< std::complex >& out, const Op& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type T; const diagmat_proxy P(expr.m); - arma_debug_check( (P.n_rows != P.n_cols), "sqrtmat(): given matrix must be square sized" ); + arma_conform_check( (P.n_rows != P.n_cols), "sqrtmat(): given matrix must be square sized" ); const uword N = P.n_rows; @@ -91,7 +91,7 @@ inline bool op_sqrtmat::apply_direct(Mat< std::complex >& out, const Base& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type in_T; typedef typename std::complex out_T; @@ -99,7 +99,7 @@ op_sqrtmat::apply_direct(Mat< std::complex >& out, const const quasi_unwrap expr_unwrap(expr.get_ref()); const Mat& A = expr_unwrap.M; - arma_debug_check( (A.is_square() == false), "sqrtmat(): given matrix must be square sized" ); + arma_conform_check( (A.is_square() == false), "sqrtmat(): given matrix must be square sized" ); if(A.n_elem == 0) { @@ -116,7 +116,7 @@ op_sqrtmat::apply_direct(Mat< std::complex >& out, const if(A.is_diagmat()) { - arma_extra_debug_print("op_sqrtmat: detected diagonal matrix"); + arma_debug_print("op_sqrtmat: detected diagonal matrix"); const uword N = A.n_rows; @@ -143,7 +143,7 @@ op_sqrtmat::apply_direct(Mat< std::complex >& out, const if(try_sympd) { - arma_extra_debug_print("op_sqrtmat: attempting sympd optimisation"); + arma_debug_print("op_sqrtmat: attempting sympd optimisation"); // if matrix A is sympd, all its eigenvalues are positive @@ -173,7 +173,7 @@ op_sqrtmat::apply_direct(Mat< std::complex >& out, const } } - arma_extra_debug_print("op_sqrtmat: sympd optimisation failed"); + arma_debug_print("op_sqrtmat: sympd optimisation failed"); // fallthrough if eigen decomposition failed or an eigenvalue is <= 0 } @@ -196,7 +196,7 @@ op_sqrtmat::apply_direct(Mat< std::complex >& out, const if(schur_ok == false) { - arma_extra_debug_print("sqrtmat(): schur decomposition failed"); + arma_debug_print("sqrtmat(): schur decomposition failed"); out.soft_reset(); return false; } @@ -219,13 +219,13 @@ inline void op_sqrtmat_cx::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_sqrtmat_cx::apply_direct(out, in.m); if(status == false) { - arma_debug_warn_level(3, "sqrtmat(): given matrix is singular; may not have a square root"); + arma_conform_warn(3, "sqrtmat(): given matrix is singular; may not have a square root"); } } @@ -236,7 +236,7 @@ inline bool op_sqrtmat_cx::apply_direct(Mat& out, const Op& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -267,11 +267,11 @@ inline bool op_sqrtmat_cx::apply_direct_noalias(Mat& out, const diagmat_proxy& P) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; - arma_debug_check( (P.n_rows != P.n_cols), "sqrtmat(): given matrix must be square sized" ); + arma_conform_check( (P.n_rows != P.n_cols), "sqrtmat(): given matrix must be square sized" ); const uword N = P.n_rows; @@ -300,7 +300,7 @@ inline bool op_sqrtmat_cx::apply_direct(Mat& out, const Base& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; typedef typename T1::elem_type eT; @@ -308,7 +308,7 @@ op_sqrtmat_cx::apply_direct(Mat& out, const Base U; Mat S = expr.get_ref(); - arma_debug_check( (S.n_rows != S.n_cols), "sqrtmat(): given matrix must be square sized" ); + arma_conform_check( (S.n_rows != S.n_cols), "sqrtmat(): given matrix must be square sized" ); if(S.n_elem == 0) { @@ -325,7 +325,7 @@ op_sqrtmat_cx::apply_direct(Mat& out, const Base& out, const Base& out, const Base& out, const Base& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool status = op_sqrtmat_sympd::apply_direct(out, in.m); @@ -470,7 +470,7 @@ inline bool op_sqrtmat_sympd::apply_direct(Mat& out, const Base& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_LAPACK) { @@ -480,16 +480,16 @@ op_sqrtmat_sympd::apply_direct(Mat& out, const Base U(expr.get_ref()); const Mat& X = U.M; - arma_debug_check( (X.is_square() == false), "sqrtmat_sympd(): given matrix must be square sized" ); + arma_conform_check( (X.is_square() == false), "sqrtmat_sympd(): given matrix must be square sized" ); - if((arma_config::debug) && (is_cx::yes) && (sym_helper::check_diag_imag(X) == false)) + if((arma_config::check_conformance) && (is_cx::yes) && (sym_helper::check_diag_imag(X) == false)) { - arma_debug_warn_level(1, "sqrtmat_sympd(): imaginary components on the diagonal are non-zero"); + arma_conform_warn(1, "sqrtmat_sympd(): imaginary components on the diagonal are non-zero"); } if(is_op_diagmat::value || X.is_diagmat()) { - arma_extra_debug_print("op_sqrtmat_sympd: detected diagonal matrix"); + arma_debug_print("op_sqrtmat_sympd: detected diagonal matrix"); out = X; diff --git a/inst/include/armadillo_bits/op_stddev_bones.hpp b/inst/include/armadillo_bits/op_stddev_bones.hpp index dad6273c..fbef5d35 100644 --- a/inst/include/armadillo_bits/op_stddev_bones.hpp +++ b/inst/include/armadillo_bits/op_stddev_bones.hpp @@ -31,6 +31,17 @@ class op_stddev template inline static void apply_noalias(Mat::result>& out, const Mat& X, const uword norm_type, const uword dim); + + // + + template + inline static typename get_pod_type::result stddev_vec(const subview_col& X, const uword norm_type = 0); + + template + inline static typename get_pod_type::result stddev_vec(const subview_row& X, const uword norm_type = 0); + + template + inline static typename T1::pod_type stddev_vec(const Base& X, const uword norm_type = 0); }; diff --git a/inst/include/armadillo_bits/op_stddev_meat.hpp b/inst/include/armadillo_bits/op_stddev_meat.hpp index 83724bcd..9bf9e307 100644 --- a/inst/include/armadillo_bits/op_stddev_meat.hpp +++ b/inst/include/armadillo_bits/op_stddev_meat.hpp @@ -26,15 +26,15 @@ inline void op_stddev::apply(Mat& out, const mtOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type out_eT; const uword norm_type = in.aux_uword_a; const uword dim = in.aux_uword_b; - arma_debug_check( (norm_type > 1), "stddev(): parameter 'norm_type' must be 0 or 1" ); - arma_debug_check( (dim > 1), "stddev(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (norm_type > 1), "stddev(): parameter 'norm_type' must be 0 or 1" ); + arma_conform_check( (dim > 1), "stddev(): parameter 'dim' must be 0 or 1" ); const quasi_unwrap U(in.m); @@ -59,7 +59,7 @@ inline void op_stddev::apply_noalias(Mat::result>& out, const Mat& X, const uword norm_type, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result out_eT; @@ -68,7 +68,7 @@ op_stddev::apply_noalias(Mat::result>& out, const M if(dim == 0) { - arma_extra_debug_print("op_stddev::apply_noalias(): dim = 0"); + arma_debug_print("op_stddev::apply_noalias(): dim = 0"); out.set_size((X_n_rows > 0) ? 1 : 0, X_n_cols); @@ -85,7 +85,7 @@ op_stddev::apply_noalias(Mat::result>& out, const M else if(dim == 1) { - arma_extra_debug_print("op_stddev::apply_noalias(): dim = 1"); + arma_debug_print("op_stddev::apply_noalias(): dim = 1"); out.set_size(X_n_rows, (X_n_cols > 0) ? 1 : 0); @@ -108,5 +108,92 @@ op_stddev::apply_noalias(Mat::result>& out, const M +template +inline +typename T1::pod_type +op_stddev::stddev_vec(const Base& X, const uword norm_type) + { + arma_debug_sigprint(); + + typedef typename T1::pod_type T; + + arma_conform_check( (norm_type > 1), "stddev(): parameter 'norm_type' must be 0 or 1" ); + + const quasi_unwrap U(X.get_ref()); + + if(U.M.n_elem == 0) + { + arma_conform_check(true, "stddev(): object has no elements"); + + return Datum::nan; + } + + return std::sqrt( op_var::direct_var(U.M.memptr(), U.M.n_elem, norm_type) ); + } + + + +template +inline +typename get_pod_type::result +op_stddev::stddev_vec(const subview_col& X, const uword norm_type) + { + arma_debug_sigprint(); + + typedef typename get_pod_type::result T; + + arma_conform_check( (norm_type > 1), "stddev(): parameter 'norm_type' must be 0 or 1" ); + + if(X.n_elem == 0) + { + arma_conform_check(true, "stddev(): object has no elements"); + + return Datum::nan; + } + + return std::sqrt( op_var::direct_var(X.colptr(0), X.n_rows, norm_type) ); + } + + + + +template +inline +typename get_pod_type::result +op_stddev::stddev_vec(const subview_row& X, const uword norm_type) + { + arma_debug_sigprint(); + + typedef typename get_pod_type::result T; + + arma_conform_check( (norm_type > 1), "stddev(): parameter 'norm_type' must be 0 or 1" ); + + if(X.n_elem == 0) + { + arma_conform_check(true, "stddev(): object has no elements"); + + return Datum::nan; + } + + const Mat& A = X.m; + + const uword start_row = X.aux_row1; + const uword start_col = X.aux_col1; + + const uword end_col_p1 = start_col + X.n_cols; + + podarray tmp(X.n_elem); + eT* tmp_mem = tmp.memptr(); + + for(uword i=0, col=start_col; col < end_col_p1; ++col, ++i) + { + tmp_mem[i] = A.at(start_row, col); + } + + return std::sqrt( op_var::direct_var(tmp.memptr(), tmp.n_elem, norm_type) ); + } + + + //! @} diff --git a/inst/include/armadillo_bits/op_strans_meat.hpp b/inst/include/armadillo_bits/op_strans_meat.hpp index ed02d3be..42d5f08d 100644 --- a/inst/include/armadillo_bits/op_strans_meat.hpp +++ b/inst/include/armadillo_bits/op_strans_meat.hpp @@ -121,7 +121,7 @@ inline void op_strans::apply_mat_noalias_large(Mat& out, const Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_rows = A.n_rows; const uword n_cols = A.n_cols; @@ -177,7 +177,7 @@ inline void op_strans::apply_mat_noalias(Mat& out, const TA& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword A_n_cols = A.n_cols; const uword A_n_rows = A.n_rows; @@ -233,14 +233,14 @@ inline void op_strans::apply_mat_inplace(Mat& out) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_rows = out.n_rows; const uword n_cols = out.n_cols; if(n_rows == n_cols) { - arma_extra_debug_print("op_strans::apply(): doing in-place transpose of a square matrix"); + arma_debug_print("op_strans::apply_mat_inplace(): square matrix"); const uword N = n_rows; @@ -268,11 +268,21 @@ op_strans::apply_mat_inplace(Mat& out) } else { - Mat tmp; - - op_strans::apply_mat_noalias(tmp, out); - - out.steal_mem(tmp); + if( ((n_rows == 1) || (n_cols == 1)) && (out.vec_state == 0) && (out.mem_state == 0) ) + { + arma_debug_print("op_strans::apply_mat_inplace(): swapping n_rows and n_cols"); + + access::rw(out.n_rows) = n_cols; + access::rw(out.n_cols) = n_rows; + } + else + { + Mat tmp; + + op_strans::apply_mat_noalias(tmp, out); + + out.steal_mem(tmp); + } } } @@ -283,7 +293,7 @@ inline void op_strans::apply_mat(Mat& out, const TA& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(&out != &A) { @@ -302,7 +312,7 @@ inline void op_strans::apply_proxy(Mat& out, const Proxy& P) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -371,7 +381,7 @@ inline void op_strans::apply_direct(Mat& out, const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -430,7 +440,7 @@ inline void op_strans::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); op_strans::apply_direct(out, in.m); } diff --git a/inst/include/armadillo_bits/op_sum_meat.hpp b/inst/include/armadillo_bits/op_sum_meat.hpp index f759daaf..16becb36 100644 --- a/inst/include/armadillo_bits/op_sum_meat.hpp +++ b/inst/include/armadillo_bits/op_sum_meat.hpp @@ -26,12 +26,12 @@ inline void op_sum::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const uword dim = in.aux_uword_a; - arma_debug_check( (dim > 1), "sum(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "sum(): parameter 'dim' must be 0 or 1" ); const Proxy P(in.m); @@ -56,7 +56,7 @@ inline void op_sum::apply_noalias(Mat& out, const Proxy& P, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(is_Mat::stored_type>::value || (arma_config::openmp && Proxy::use_mp)) { @@ -75,7 +75,7 @@ inline void op_sum::apply_noalias_unwrap(Mat& out, const Proxy& P, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -129,7 +129,7 @@ inline void op_sum::apply_noalias_proxy(Mat& out, const Proxy& P, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -239,12 +239,12 @@ inline void op_sum::apply(Cube& out, const OpCube& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const uword dim = in.aux_uword_a; - arma_debug_check( (dim > 2), "sum(): parameter 'dim' must be 0 or 1 or 2" ); + arma_conform_check( (dim > 2), "sum(): parameter 'dim' must be 0 or 1 or 2" ); const ProxyCube P(in.m); @@ -269,7 +269,7 @@ inline void op_sum::apply_noalias(Cube& out, const ProxyCube& P, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(is_Cube::stored_type>::value || (arma_config::openmp && ProxyCube::use_mp)) { @@ -288,7 +288,7 @@ inline void op_sum::apply_noalias_unwrap(Cube& out, const ProxyCube& P, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -352,7 +352,7 @@ inline void op_sum::apply_noalias_proxy(Cube& out, const ProxyCube& P, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/op_symmat_meat.hpp b/inst/include/armadillo_bits/op_symmat_meat.hpp index 52731bd8..cc1e6d45 100644 --- a/inst/include/armadillo_bits/op_symmat_meat.hpp +++ b/inst/include/armadillo_bits/op_symmat_meat.hpp @@ -26,14 +26,14 @@ inline void op_symmatu::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const unwrap tmp(in.m); const Mat& A = tmp.M; - arma_debug_check( (A.is_square() == false), "symmatu(): given matrix must be square sized" ); + arma_conform_check( (A.is_square() == false), "symmatu(): given matrix must be square sized" ); const uword N = A.n_rows; @@ -77,14 +77,14 @@ inline void op_symmatl::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const unwrap tmp(in.m); const Mat& A = tmp.M; - arma_debug_check( (A.is_square() == false), "symmatl(): given matrix must be square sized" ); + arma_conform_check( (A.is_square() == false), "symmatl(): given matrix must be square sized" ); const uword N = A.n_rows; @@ -132,14 +132,14 @@ inline void op_symmatu_cx::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const unwrap tmp(in.m); const Mat& A = tmp.M; - arma_debug_check( (A.is_square() == false), "symmatu(): given matrix must be square sized" ); + arma_conform_check( (A.is_square() == false), "symmatu(): given matrix must be square sized" ); const uword N = A.n_rows; @@ -206,14 +206,14 @@ inline void op_symmatl_cx::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const unwrap tmp(in.m); const Mat& A = tmp.M; - arma_debug_check( (A.is_square() == false), "symmatl(): given matrix must be square sized" ); + arma_conform_check( (A.is_square() == false), "symmatl(): given matrix must be square sized" ); const uword N = A.n_rows; diff --git a/inst/include/armadillo_bits/op_toeplitz_meat.hpp b/inst/include/armadillo_bits/op_toeplitz_meat.hpp index a06c4814..a1f96c45 100644 --- a/inst/include/armadillo_bits/op_toeplitz_meat.hpp +++ b/inst/include/armadillo_bits/op_toeplitz_meat.hpp @@ -26,14 +26,14 @@ inline void op_toeplitz::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const unwrap_check tmp(in.m, out); const Mat& X = tmp.M; - arma_debug_check( ((X.is_vec() == false) && (X.is_empty() == false)), "toeplitz(): given object must be a vector" ); + arma_conform_check( ((X.is_vec() == false) && (X.is_empty() == false)), "toeplitz(): given object must be a vector" ); const uword N = X.n_elem; const eT* X_mem = X.memptr(); @@ -61,14 +61,14 @@ inline void op_toeplitz_c::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const unwrap_check tmp(in.m, out); const Mat& X = tmp.M; - arma_debug_check( ((X.is_vec() == false) && (X.is_empty() == false)), "circ_toeplitz(): given object must be a vector" ); + arma_conform_check( ((X.is_vec() == false) && (X.is_empty() == false)), "circ_toeplitz(): given object must be a vector" ); const uword N = X.n_elem; const eT* X_mem = X.memptr(); diff --git a/inst/include/armadillo_bits/op_trimat_meat.hpp b/inst/include/armadillo_bits/op_trimat_meat.hpp index 79225153..76b13d7c 100644 --- a/inst/include/armadillo_bits/op_trimat_meat.hpp +++ b/inst/include/armadillo_bits/op_trimat_meat.hpp @@ -26,7 +26,7 @@ inline void op_trimat::fill_zeros(Mat& out, const bool upper) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N = out.n_rows; @@ -61,7 +61,7 @@ inline void op_trimat::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -122,9 +122,9 @@ inline void op_trimat::apply_unwrap(Mat& out, const Mat& A, const bool upper) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (A.is_square() == false), "trimatu()/trimatl(): given matrix must be square sized" ); + arma_conform_check( (A.is_square() == false), "trimatu()/trimatl(): given matrix must be square sized" ); if(&out != &A) { @@ -166,9 +166,9 @@ inline void op_trimat::apply_proxy(Mat& out, const Proxy& P, const bool upper) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (P.get_n_rows() != P.get_n_cols()), "trimatu()/trimatl(): given matrix must be square sized" ); + arma_conform_check( (P.get_n_rows() != P.get_n_cols()), "trimatu()/trimatl(): given matrix must be square sized" ); const uword N = P.get_n_rows(); @@ -205,14 +205,14 @@ inline void op_trimatu_ext::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const unwrap tmp(in.m); const Mat& A = tmp.M; - arma_debug_check( (A.is_square() == false), "trimatu(): given matrix must be square sized" ); + arma_conform_check( (A.is_square() == false), "trimatu(): given matrix must be square sized" ); const uword row_offset = in.aux_uword_a; const uword col_offset = in.aux_uword_b; @@ -220,7 +220,7 @@ op_trimatu_ext::apply(Mat& out, const Op 0) && (row_offset >= n_rows)) || ((col_offset > 0) && (col_offset >= n_cols)), "trimatu(): requested diagonal is out of bounds" ); + arma_conform_check_bounds( ((row_offset > 0) && (row_offset >= n_rows)) || ((col_offset > 0) && (col_offset >= n_cols)), "trimatu(): requested diagonal is out of bounds" ); if(&out != &A) { @@ -261,7 +261,7 @@ inline void op_trimatu_ext::fill_zeros(Mat& out, const uword row_offset, const uword col_offset) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_rows = out.n_rows; const uword n_cols = out.n_cols; @@ -296,14 +296,14 @@ inline void op_trimatl_ext::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const unwrap tmp(in.m); const Mat& A = tmp.M; - arma_debug_check( (A.is_square() == false), "trimatl(): given matrix must be square sized" ); + arma_conform_check( (A.is_square() == false), "trimatl(): given matrix must be square sized" ); const uword row_offset = in.aux_uword_a; const uword col_offset = in.aux_uword_b; @@ -311,7 +311,7 @@ op_trimatl_ext::apply(Mat& out, const Op 0) && (row_offset >= n_rows)) || ((col_offset > 0) && (col_offset >= n_cols)), "trimatl(): requested diagonal is out of bounds" ); + arma_conform_check_bounds( ((row_offset > 0) && (row_offset >= n_rows)) || ((col_offset > 0) && (col_offset >= n_cols)), "trimatl(): requested diagonal is out of bounds" ); if(&out != &A) { @@ -346,7 +346,7 @@ inline void op_trimatl_ext::fill_zeros(Mat& out, const uword row_offset, const uword col_offset) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_rows = out.n_rows; const uword n_cols = out.n_cols; diff --git a/inst/include/armadillo_bits/op_unique_meat.hpp b/inst/include/armadillo_bits/op_unique_meat.hpp index 1605ea7c..66a3e392 100644 --- a/inst/include/armadillo_bits/op_unique_meat.hpp +++ b/inst/include/armadillo_bits/op_unique_meat.hpp @@ -27,7 +27,7 @@ inline bool op_unique::apply_helper(Mat& out, const Proxy& P, const bool P_is_row) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -142,13 +142,13 @@ inline void op_unique::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Proxy P(in.m); const bool all_non_nan = op_unique::apply_helper(out, P, false); - arma_debug_check( (all_non_nan == false), "unique(): detected NaN" ); + arma_conform_check( (all_non_nan == false), "unique(): detected NaN" ); } @@ -158,7 +158,7 @@ inline void op_unique_vec::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Proxy P(in.m); @@ -166,7 +166,7 @@ op_unique_vec::apply(Mat& out, const Op& out, const mtOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type out_eT; const uword norm_type = in.aux_uword_a; const uword dim = in.aux_uword_b; - arma_debug_check( (norm_type > 1), "var(): parameter 'norm_type' must be 0 or 1" ); - arma_debug_check( (dim > 1), "var(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (norm_type > 1), "var(): parameter 'norm_type' must be 0 or 1" ); + arma_conform_check( (dim > 1), "var(): parameter 'dim' must be 0 or 1" ); const quasi_unwrap U(in.m); @@ -59,7 +59,7 @@ inline void op_var::apply_noalias(Mat::result>& out, const Mat& X, const uword norm_type, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result out_eT; @@ -68,7 +68,7 @@ op_var::apply_noalias(Mat::result>& out, const Mat< if(dim == 0) { - arma_extra_debug_print("op_var::apply_noalias(): dim = 0"); + arma_debug_print("op_var::apply_noalias(): dim = 0"); out.set_size((X_n_rows > 0) ? 1 : 0, X_n_cols); @@ -85,7 +85,7 @@ op_var::apply_noalias(Mat::result>& out, const Mat< else if(dim == 1) { - arma_extra_debug_print("op_var::apply_noalias(): dim = 1"); + arma_debug_print("op_var::apply_noalias(): dim = 1"); out.set_size(X_n_rows, (X_n_cols > 0) ? 1 : 0); @@ -113,12 +113,21 @@ inline typename T1::pod_type op_var::var_vec(const Base& X, const uword norm_type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (norm_type > 1), "var(): parameter 'norm_type' must be 0 or 1" ); + typedef typename T1::pod_type T; + + arma_conform_check( (norm_type > 1), "var(): parameter 'norm_type' must be 0 or 1" ); const quasi_unwrap U(X.get_ref()); + if(U.M.n_elem == 0) + { + arma_conform_check(true, "var(): object has no elements"); + + return Datum::nan; + } + return op_var::direct_var(U.M.memptr(), U.M.n_elem, norm_type); } @@ -129,9 +138,18 @@ inline typename get_pod_type::result op_var::var_vec(const subview_col& X, const uword norm_type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); + + typedef typename get_pod_type::result T; - arma_debug_check( (norm_type > 1), "var(): parameter 'norm_type' must be 0 or 1" ); + arma_conform_check( (norm_type > 1), "var(): parameter 'norm_type' must be 0 or 1" ); + + if(X.n_elem == 0) + { + arma_conform_check(true, "var(): object has no elements"); + + return Datum::nan; + } return op_var::direct_var(X.colptr(0), X.n_rows, norm_type); } @@ -144,9 +162,18 @@ inline typename get_pod_type::result op_var::var_vec(const subview_row& X, const uword norm_type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); + + typedef typename get_pod_type::result T; + + arma_conform_check( (norm_type > 1), "var(): parameter 'norm_type' must be 0 or 1" ); - arma_debug_check( (norm_type > 1), "var(): parameter 'norm_type' must be 0 or 1" ); + if(X.n_elem == 0) + { + arma_conform_check(true, "var(): object has no elements"); + + return Datum::nan; + } const Mat& A = X.m; @@ -174,7 +201,7 @@ inline eT op_var::direct_var(const eT* const X, const uword n_elem, const uword norm_type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(n_elem >= 2) { @@ -226,7 +253,7 @@ inline eT op_var::direct_var_robust(const eT* const X, const uword n_elem, const uword norm_type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(n_elem > 1) { @@ -259,7 +286,7 @@ inline T op_var::direct_var(const std::complex* const X, const uword n_elem, const uword norm_type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; @@ -297,7 +324,7 @@ inline T op_var::direct_var_robust(const std::complex* const X, const uword n_elem, const uword norm_type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; diff --git a/inst/include/armadillo_bits/op_vecnorm_meat.hpp b/inst/include/armadillo_bits/op_vecnorm_meat.hpp index 7f9f6642..8e5ee172 100644 --- a/inst/include/armadillo_bits/op_vecnorm_meat.hpp +++ b/inst/include/armadillo_bits/op_vecnorm_meat.hpp @@ -26,7 +26,7 @@ inline void op_vecnorm::apply(Mat& out, const mtOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type in_eT; typedef typename T1::pod_type out_eT; @@ -37,8 +37,8 @@ op_vecnorm::apply(Mat& out, const mtOp 1), "vecnorm(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (k == 0), "vecnorm(): unsupported vector norm type" ); + arma_conform_check( (dim > 1), "vecnorm(): parameter 'dim' must be 0 or 1" ); if(U.is_alias(out)) { @@ -62,7 +62,7 @@ inline void op_vecnorm::apply_noalias(Mat::result>& out, const Mat& X, const uword k, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result out_eT; @@ -71,7 +71,7 @@ op_vecnorm::apply_noalias(Mat::result>& out, const if(dim == 0) { - arma_extra_debug_print("op_vecnorm::apply(): dim = 0"); + arma_debug_print("op_vecnorm::apply(): dim = 0"); out.set_size((X_n_rows > 0) ? 1 : 0, X_n_cols); @@ -88,7 +88,7 @@ op_vecnorm::apply_noalias(Mat::result>& out, const else if(dim == 1) { - arma_extra_debug_print("op_vecnorm::apply(): dim = 1"); + arma_debug_print("op_vecnorm::apply(): dim = 1"); out.set_size(X_n_rows, (X_n_cols > 0) ? 1 : 0); @@ -116,7 +116,7 @@ inline void op_vecnorm::apply_rawmem(typename get_pod_type::result& out_val, const in_eT* mem, const uword N, const uword k) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result out_eT; @@ -143,7 +143,7 @@ inline void op_vecnorm_ext::apply(Mat& out, const mtOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type in_eT; typedef typename T1::pod_type out_eT; @@ -154,8 +154,8 @@ op_vecnorm_ext::apply(Mat& out, const mtOp 1), "vecnorm(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (method_id == 0), "vecnorm(): unsupported vector norm type" ); + arma_conform_check( (dim > 1), "vecnorm(): parameter 'dim' must be 0 or 1" ); if(U.is_alias(out)) { @@ -179,7 +179,7 @@ inline void op_vecnorm_ext::apply_noalias(Mat::result>& out, const Mat& X, const uword method_id, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result out_eT; @@ -188,7 +188,7 @@ op_vecnorm_ext::apply_noalias(Mat::result>& out, co if(dim == 0) { - arma_extra_debug_print("op_vecnorm_ext::apply(): dim = 0"); + arma_debug_print("op_vecnorm_ext::apply(): dim = 0"); out.set_size((X_n_rows > 0) ? 1 : 0, X_n_cols); @@ -205,7 +205,7 @@ op_vecnorm_ext::apply_noalias(Mat::result>& out, co else if(dim == 1) { - arma_extra_debug_print("op_vecnorm_ext::apply(): dim = 1"); + arma_debug_print("op_vecnorm_ext::apply(): dim = 1"); out.set_size(X_n_rows, (X_n_cols > 0) ? 1 : 0); @@ -233,7 +233,7 @@ inline void op_vecnorm_ext::apply_rawmem(typename get_pod_type::result& out_val, const in_eT* mem, const uword N, const uword method_id) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result out_eT; diff --git a/inst/include/armadillo_bits/op_vectorise_meat.hpp b/inst/include/armadillo_bits/op_vectorise_meat.hpp index c0f278cb..243c0819 100644 --- a/inst/include/armadillo_bits/op_vectorise_meat.hpp +++ b/inst/include/armadillo_bits/op_vectorise_meat.hpp @@ -27,7 +27,7 @@ inline void op_vectorise_col::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); op_vectorise_col::apply_direct(out, in.m); } @@ -39,7 +39,7 @@ inline void op_vectorise_col::apply_direct(Mat& out, const T1& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -127,7 +127,7 @@ inline void op_vectorise_col::apply_subview(Mat& out, const subview& sv) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword sv_n_rows = sv.n_rows; const uword sv_n_cols = sv.n_cols; @@ -151,7 +151,7 @@ inline void op_vectorise_col::apply_proxy(Mat& out, const Proxy& P) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -214,7 +214,7 @@ inline void op_vectorise_row::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); op_vectorise_row::apply_direct(out, in.m); } @@ -226,7 +226,7 @@ inline void op_vectorise_row::apply_direct(Mat& out, const T1& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -253,7 +253,7 @@ inline void op_vectorise_row::apply_proxy(Mat& out, const Proxy& P) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -308,7 +308,7 @@ inline void op_vectorise_all::apply(Mat& out, const Op& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword dim = in.aux_uword_a; @@ -333,7 +333,7 @@ inline void op_vectorise_cube_col::apply(Mat& out, const CubeToMatOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -361,7 +361,7 @@ inline void op_vectorise_cube_col::apply_subview(Mat& out, const subview_cube& sv) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword sv_nr = sv.n_rows; const uword sv_nc = sv.n_cols; @@ -387,7 +387,7 @@ inline void op_vectorise_cube_col::apply_unwrap(Mat& out, const T1& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_cube U(expr); @@ -403,7 +403,7 @@ inline void op_vectorise_cube_col::apply_proxy(Mat& out, const T1& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/op_wishrnd_meat.hpp b/inst/include/armadillo_bits/op_wishrnd_meat.hpp index 44fa77d0..865e15ca 100644 --- a/inst/include/armadillo_bits/op_wishrnd_meat.hpp +++ b/inst/include/armadillo_bits/op_wishrnd_meat.hpp @@ -31,7 +31,7 @@ inline void op_wishrnd::apply(Mat& out, const Op& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -54,7 +54,7 @@ inline bool op_wishrnd::apply_direct(Mat& out, const Base& X, const typename T1::elem_type df, const uword mode) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -87,9 +87,9 @@ inline bool op_wishrnd::apply_noalias_mode1(Mat& out, const Mat& S, const eT df) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (S.is_square() == false), "wishrnd(): given matrix must be square sized" ); + arma_conform_check( (S.is_square() == false), "wishrnd(): given matrix must be square sized" ); if(S.is_empty()) { out.reset(); return true; } @@ -111,10 +111,10 @@ inline bool op_wishrnd::apply_noalias_mode2(Mat& out, const Mat& D, const eT df) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (df <= eT(0)), "df must be greater than zero" ); - arma_debug_check( (D.is_square() == false), "wishrnd(): given matrix must be square sized" ); + arma_conform_check( (df <= eT(0)), "df must be greater than zero" ); + arma_conform_check( (D.is_square() == false), "wishrnd(): given matrix must be square sized" ); if(D.is_empty()) { out.reset(); return true; } @@ -122,7 +122,7 @@ op_wishrnd::apply_noalias_mode2(Mat& out, const Mat& D, const eT df) if(df < eT(N)) { - arma_extra_debug_print("simple generator"); + arma_debug_print("simple generator"); const uword df_floor = uword(std::floor(df)); @@ -132,7 +132,7 @@ op_wishrnd::apply_noalias_mode2(Mat& out, const Mat& D, const eT df) } else { - arma_extra_debug_print("standard generator"); + arma_debug_print("standard generator"); op_chi2rnd_varying_df chi2rnd_generator; @@ -169,7 +169,7 @@ inline void op_iwishrnd::apply(Mat& out, const Op& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -192,7 +192,7 @@ inline bool op_iwishrnd::apply_direct(Mat& out, const Base& X, const typename T1::elem_type df, const uword mode) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -225,9 +225,9 @@ inline bool op_iwishrnd::apply_noalias_mode1(Mat& out, const Mat& T, const eT df) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (T.is_square() == false), "iwishrnd(): given matrix must be square sized" ); + arma_conform_check( (T.is_square() == false), "iwishrnd(): given matrix must be square sized" ); if(T.is_empty()) { out.reset(); return true; } @@ -254,10 +254,10 @@ inline bool op_iwishrnd::apply_noalias_mode2(Mat& out, const Mat& Dinv, const eT df) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (df <= eT(0)), "df must be greater than zero" ); - arma_debug_check( (Dinv.is_square() == false), "iwishrnd(): given matrix must be square sized" ); + arma_conform_check( (df <= eT(0)), "df must be greater than zero" ); + arma_conform_check( (Dinv.is_square() == false), "iwishrnd(): given matrix must be square sized" ); if(Dinv.is_empty()) { out.reset(); return true; } diff --git a/inst/include/armadillo_bits/operator_cube_div.hpp b/inst/include/armadillo_bits/operator_cube_div.hpp index 58ff3a0a..b96163a0 100644 --- a/inst/include/armadillo_bits/operator_cube_div.hpp +++ b/inst/include/armadillo_bits/operator_cube_div.hpp @@ -31,7 +31,7 @@ operator/ const typename T1::elem_type k ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(X.get_ref(), k); } @@ -48,7 +48,7 @@ operator/ const BaseCube& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(X.get_ref(), k); } @@ -65,7 +65,7 @@ operator/ const BaseCube& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOpCube, T1, op_cx_scalar_div_pre>('j', X.get_ref(), k); } @@ -82,7 +82,7 @@ operator/ const std::complex& k ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOpCube, T1, op_cx_scalar_div_post>('j', X.get_ref(), k); } @@ -99,7 +99,7 @@ operator/ const BaseCube& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eGlueCube(X.get_ref(), Y.get_ref()); } @@ -116,7 +116,7 @@ operator/ const BaseCube< typename force_different_type::T2_result, T2>& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -139,7 +139,7 @@ operator/ const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_cube_each1_aux::operator_div(X, Y.get_ref()); } @@ -155,7 +155,7 @@ operator/ const subview_cube_each1& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_cube_each1_aux::operator_div(X.get_ref(), Y); } @@ -171,7 +171,7 @@ operator/ const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_cube_each2_aux::operator_div(X, Y.get_ref()); } @@ -187,7 +187,7 @@ operator/ const subview_cube_each2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_cube_each2_aux::operator_div(X.get_ref(), Y); } diff --git a/inst/include/armadillo_bits/operator_cube_minus.hpp b/inst/include/armadillo_bits/operator_cube_minus.hpp index 53cb4149..ce0cd83e 100644 --- a/inst/include/armadillo_bits/operator_cube_minus.hpp +++ b/inst/include/armadillo_bits/operator_cube_minus.hpp @@ -30,7 +30,7 @@ operator- const BaseCube& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(X.get_ref()); } @@ -47,7 +47,7 @@ operator- const typename T1::elem_type k ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(X.get_ref(), k); } @@ -64,7 +64,7 @@ operator- const BaseCube& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(X.get_ref(), k); } @@ -81,7 +81,7 @@ operator- const BaseCube& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOpCube, T1, op_cx_scalar_minus_pre>('j', X.get_ref(), k); } @@ -98,7 +98,7 @@ operator- const std::complex& k ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOpCube, T1, op_cx_scalar_minus_post>('j', X.get_ref(), k); } @@ -115,7 +115,7 @@ operator- const BaseCube& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eGlueCube(X.get_ref(), Y.get_ref()); } @@ -132,7 +132,7 @@ operator- const BaseCube< typename force_different_type::T2_result, T2>& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -155,7 +155,7 @@ operator- const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_cube_each1_aux::operator_minus(X, Y.get_ref()); } @@ -171,7 +171,7 @@ operator- const subview_cube_each1& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_cube_each1_aux::operator_minus(X.get_ref(), Y); } @@ -187,7 +187,7 @@ operator- const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_cube_each2_aux::operator_minus(X, Y.get_ref()); } @@ -203,7 +203,7 @@ operator- const subview_cube_each2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_cube_each2_aux::operator_minus(X.get_ref(), Y); } diff --git a/inst/include/armadillo_bits/operator_cube_plus.hpp b/inst/include/armadillo_bits/operator_cube_plus.hpp index fb360fea..98295256 100644 --- a/inst/include/armadillo_bits/operator_cube_plus.hpp +++ b/inst/include/armadillo_bits/operator_cube_plus.hpp @@ -30,7 +30,7 @@ operator+ const BaseCube& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return X; } @@ -47,7 +47,7 @@ operator+ const typename T1::elem_type k ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(X.get_ref(), k); } @@ -64,7 +64,7 @@ operator+ const BaseCube& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(X.get_ref(), k); } @@ -81,7 +81,7 @@ operator+ const std::complex& k ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOpCube, T1, op_cx_scalar_plus>('j', X.get_ref(), k); } @@ -98,7 +98,7 @@ operator+ const BaseCube& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOpCube, T1, op_cx_scalar_plus>('j', X.get_ref(), k); // NOTE: order is swapped } @@ -115,7 +115,7 @@ operator+ const BaseCube& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eGlueCube(X.get_ref(), Y.get_ref()); } @@ -132,7 +132,7 @@ operator+ const BaseCube< typename force_different_type::T2_result, T2>& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -155,7 +155,7 @@ operator+ const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_cube_each1_aux::operator_plus(X, Y.get_ref()); } @@ -171,7 +171,7 @@ operator+ const subview_cube_each1& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_cube_each1_aux::operator_plus(Y, X.get_ref()); // NOTE: swapped order } @@ -187,7 +187,7 @@ operator+ const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_cube_each2_aux::operator_plus(X, Y.get_ref()); } @@ -203,7 +203,7 @@ operator+ const subview_cube_each2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_cube_each2_aux::operator_plus(Y, X.get_ref()); // NOTE: swapped order } diff --git a/inst/include/armadillo_bits/operator_cube_relational.hpp b/inst/include/armadillo_bits/operator_cube_relational.hpp index 8270d0f3..6615af46 100644 --- a/inst/include/armadillo_bits/operator_cube_relational.hpp +++ b/inst/include/armadillo_bits/operator_cube_relational.hpp @@ -38,7 +38,7 @@ const mtGlueCube operator< (const BaseCube::result,T1>& X, const BaseCube::result,T2>& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtGlueCube( X.get_ref(), Y.get_ref() ); } @@ -51,7 +51,7 @@ const mtGlueCube operator> (const BaseCube::result,T1>& X, const BaseCube::result,T2>& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtGlueCube( X.get_ref(), Y.get_ref() ); } @@ -64,7 +64,7 @@ const mtGlueCube operator<= (const BaseCube::result,T1>& X, const BaseCube::result,T2>& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtGlueCube( X.get_ref(), Y.get_ref() ); } @@ -77,7 +77,7 @@ const mtGlueCube operator>= (const BaseCube::result,T1>& X, const BaseCube::result,T2>& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtGlueCube( X.get_ref(), Y.get_ref() ); } @@ -90,7 +90,7 @@ const mtGlueCube operator== (const BaseCube& X, const BaseCube& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtGlueCube( X.get_ref(), Y.get_ref() ); } @@ -103,7 +103,7 @@ const mtGlueCube operator!= (const BaseCube& X, const BaseCube& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtGlueCube( X.get_ref(), Y.get_ref() ); } @@ -116,7 +116,7 @@ const mtGlueCube operator&& (const BaseCube::result,T1>& X, const BaseCube::result,T2>& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtGlueCube( X.get_ref(), Y.get_ref() ); } @@ -129,7 +129,7 @@ const mtGlueCube operator|| (const BaseCube::result,T1>& X, const BaseCube::result,T2>& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtGlueCube( X.get_ref(), Y.get_ref() ); } @@ -148,7 +148,7 @@ const mtOpCube operator< (const typename arma_not_cx::result val, const BaseCube::result,T1>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOpCube(X.get_ref(), val); } @@ -161,7 +161,7 @@ const mtOpCube operator< (const BaseCube::result,T1>& X, const typename arma_not_cx::result val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOpCube(X.get_ref(), val); } @@ -174,7 +174,7 @@ const mtOpCube operator> (const typename arma_not_cx::result val, const BaseCube::result,T1>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOpCube(X.get_ref(), val); } @@ -187,7 +187,7 @@ const mtOpCube operator> (const BaseCube::result,T1>& X, const typename arma_not_cx::result val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOpCube(X.get_ref(), val); } @@ -200,7 +200,7 @@ const mtOpCube operator<= (const typename arma_not_cx::result val, const BaseCube::result,T1>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOpCube(X.get_ref(), val); } @@ -213,7 +213,7 @@ const mtOpCube operator<= (const BaseCube::result,T1>& X, const typename arma_not_cx::result val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOpCube(X.get_ref(), val); } @@ -226,7 +226,7 @@ const mtOpCube operator>= (const typename arma_not_cx::result val, const BaseCube::result,T1>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOpCube(X.get_ref(), val); } @@ -239,7 +239,7 @@ const mtOpCube operator>= (const BaseCube::result,T1>& X, const typename arma_not_cx::result val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOpCube(X.get_ref(), val); } @@ -252,7 +252,7 @@ const mtOpCube operator== (const typename T1::elem_type val, const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOpCube(X.get_ref(), val); } @@ -265,7 +265,7 @@ const mtOpCube operator== (const BaseCube& X, const typename T1::elem_type val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOpCube(X.get_ref(), val); } @@ -278,7 +278,7 @@ const mtOpCube operator!= (const typename T1::elem_type val, const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOpCube(X.get_ref(), val); } @@ -291,7 +291,7 @@ const mtOpCube operator!= (const BaseCube& X, const typename T1::elem_type val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOpCube(X.get_ref(), val); } diff --git a/inst/include/armadillo_bits/operator_cube_schur.hpp b/inst/include/armadillo_bits/operator_cube_schur.hpp index 21b7ee1e..abe28249 100644 --- a/inst/include/armadillo_bits/operator_cube_schur.hpp +++ b/inst/include/armadillo_bits/operator_cube_schur.hpp @@ -33,7 +33,7 @@ operator% const BaseCube& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eGlueCube(X.get_ref(), Y.get_ref()); } @@ -50,7 +50,7 @@ operator% const BaseCube< typename force_different_type::T2_result, T2>& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -73,7 +73,7 @@ operator% const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_cube_each1_aux::operator_schur(X, Y.get_ref()); } @@ -89,7 +89,7 @@ operator% const subview_cube_each1& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_cube_each1_aux::operator_schur(Y, X.get_ref()); // NOTE: swapped order } @@ -105,7 +105,7 @@ operator% const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_cube_each2_aux::operator_schur(X, Y.get_ref()); } @@ -121,7 +121,7 @@ operator% const subview_cube_each2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_cube_each2_aux::operator_schur(Y, X.get_ref()); // NOTE: swapped order } diff --git a/inst/include/armadillo_bits/operator_cube_times.hpp b/inst/include/armadillo_bits/operator_cube_times.hpp index 0b9cf766..267c490d 100644 --- a/inst/include/armadillo_bits/operator_cube_times.hpp +++ b/inst/include/armadillo_bits/operator_cube_times.hpp @@ -31,7 +31,7 @@ operator* const typename T1::elem_type k ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(X.get_ref(), k); } @@ -48,7 +48,7 @@ operator* const BaseCube& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOpCube(X.get_ref(), k); } @@ -65,7 +65,7 @@ operator* const std::complex& k ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOpCube, T1, op_cx_scalar_times>('j', X.get_ref(), k); } @@ -82,7 +82,7 @@ operator* const BaseCube& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOpCube, T1, op_cx_scalar_times>('j', X.get_ref(), k); } @@ -98,7 +98,7 @@ operator* const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_cube_each1_aux::operator_times(X, Y.get_ref()); } @@ -114,7 +114,7 @@ operator* const subview_cube_each1& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_cube_each1_aux::operator_times(X.get_ref(), Y); } diff --git a/inst/include/armadillo_bits/operator_div.hpp b/inst/include/armadillo_bits/operator_div.hpp index 4f17fdf1..6f77364c 100644 --- a/inst/include/armadillo_bits/operator_div.hpp +++ b/inst/include/armadillo_bits/operator_div.hpp @@ -32,7 +32,7 @@ operator/ const typename T1::elem_type k ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(X, k); } @@ -50,7 +50,7 @@ operator/ const T1& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(X, k); } @@ -72,7 +72,7 @@ operator/ const T1& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp, T1, op_cx_scalar_div_pre>('j', X, k); } @@ -94,7 +94,7 @@ operator/ const std::complex& k ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp, T1, op_cx_scalar_div_post>('j', X, k); } @@ -116,7 +116,7 @@ operator/ const T2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eGlue(X, Y); } @@ -138,7 +138,7 @@ operator/ const T2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -163,7 +163,7 @@ operator/ const typename T1::elem_type y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat result(X); @@ -189,7 +189,7 @@ operator/ const T2& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -199,7 +199,7 @@ operator/ const uword n_rows = pa.get_n_rows(); const uword n_cols = pa.get_n_cols(); - arma_debug_assert_same_size(n_rows, n_cols, pb.get_n_rows(), pb.get_n_cols(), "element-wise division"); + arma_conform_assert_same_size(n_rows, n_cols, pb.get_n_rows(), pb.get_n_cols(), "element-wise division"); uword new_n_nonzero = 0; @@ -264,7 +264,7 @@ operator/ const SpToDOp& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat out; @@ -290,7 +290,7 @@ operator/ const T2& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -300,7 +300,7 @@ operator/ const uword n_rows = pa.get_n_rows(); const uword n_cols = pa.get_n_cols(); - arma_debug_assert_same_size(n_rows, n_cols, pb.get_n_rows(), pb.get_n_cols(), "element-wise division"); + arma_conform_assert_same_size(n_rows, n_cols, pb.get_n_rows(), pb.get_n_cols(), "element-wise division"); Mat result(n_rows, n_cols, arma_nozeros_indicator()); @@ -324,7 +324,7 @@ operator/ const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_each1_aux::operator_div(X, Y.get_ref()); } @@ -340,7 +340,7 @@ operator/ const subview_each1& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_each1_aux::operator_div(X.get_ref(), Y); } @@ -356,7 +356,7 @@ operator/ const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_each2_aux::operator_div(X, Y.get_ref()); } @@ -372,7 +372,7 @@ operator/ const subview_each2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_each2_aux::operator_div(X.get_ref(), Y); } diff --git a/inst/include/armadillo_bits/operator_minus.hpp b/inst/include/armadillo_bits/operator_minus.hpp index 42047a78..730ea3ca 100644 --- a/inst/include/armadillo_bits/operator_minus.hpp +++ b/inst/include/armadillo_bits/operator_minus.hpp @@ -29,7 +29,7 @@ enable_if2< is_arma_type::value, const eOp >::result operator- (const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(X); } @@ -47,7 +47,7 @@ operator- const typename T1::elem_type k ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(X, k); } @@ -65,7 +65,7 @@ operator- const T1& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(X, k); } @@ -87,7 +87,7 @@ operator- const T1& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp, T1, op_cx_scalar_minus_pre>('j', X, k); } @@ -109,7 +109,7 @@ operator- const std::complex& k ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp, T1, op_cx_scalar_minus_post>('j', X, k); } @@ -131,7 +131,7 @@ operator- const T2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eGlue(X, Y); } @@ -153,7 +153,7 @@ operator- const T2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -179,7 +179,7 @@ enable_if2 operator- (const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -203,7 +203,7 @@ operator- const T2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpGlue(X,Y); } @@ -225,13 +225,13 @@ operator- const T2& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy pa(x); Mat result(-y); - arma_debug_assert_same_size( pa.get_n_rows(), pa.get_n_cols(), result.n_rows, result.n_cols, "subtraction" ); + arma_conform_assert_same_size( pa.get_n_rows(), pa.get_n_cols(), result.n_rows, result.n_cols, "subtraction" ); typename SpProxy::const_iterator_type it = pa.begin(); typename SpProxy::const_iterator_type it_end = pa.end(); @@ -262,13 +262,13 @@ operator- const T2& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat result(x); const SpProxy pb(y); - arma_debug_assert_same_size( result.n_rows, result.n_cols, pb.get_n_rows(), pb.get_n_cols(), "subtraction" ); + arma_conform_assert_same_size( result.n_rows, result.n_cols, pb.get_n_rows(), pb.get_n_cols(), "subtraction" ); typename SpProxy::const_iterator_type it = pb.begin(); typename SpProxy::const_iterator_type it_end = pb.end(); @@ -299,7 +299,7 @@ operator- const T2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -328,7 +328,7 @@ operator- const T2& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat< typename promote_type::result > out; @@ -354,7 +354,7 @@ operator- const T2& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat< typename promote_type::result > out; @@ -376,7 +376,7 @@ operator- const typename T1::elem_type k ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpToDOp(X, k); } @@ -394,7 +394,7 @@ operator- const T1& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpToDOp(X, k); } @@ -419,7 +419,7 @@ operator- const typename T1::elem_type k ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const typename T1::elem_type aux = (is_same_type::value) ? -x.aux : x.aux; @@ -446,7 +446,7 @@ operator- const SpToDOp& x ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const typename T1::elem_type aux = (is_same_type::value) ? -x.aux : x.aux; @@ -472,7 +472,7 @@ operator- const typename T1::elem_type k ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpToDOp(x.m, x.aux - k); } @@ -496,7 +496,7 @@ operator- const SpToDOp& x ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpToDOp(x.m, k - x.aux); } @@ -512,7 +512,7 @@ operator- const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_each1_aux::operator_minus(X, Y.get_ref()); } @@ -528,7 +528,7 @@ operator- const subview_each1& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_each1_aux::operator_minus(X.get_ref(), Y); } @@ -544,7 +544,7 @@ operator- const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_each2_aux::operator_minus(X, Y.get_ref()); } @@ -560,7 +560,7 @@ operator- const subview_each2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_each2_aux::operator_minus(X.get_ref(), Y); } diff --git a/inst/include/armadillo_bits/operator_ostream.hpp b/inst/include/armadillo_bits/operator_ostream.hpp index ce9a9cb0..77567106 100644 --- a/inst/include/armadillo_bits/operator_ostream.hpp +++ b/inst/include/armadillo_bits/operator_ostream.hpp @@ -26,7 +26,7 @@ inline std::ostream& operator<< (std::ostream& o, const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap tmp(X.get_ref()); @@ -42,7 +42,7 @@ inline std::ostream& operator<< (std::ostream& o, const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat tmp(X.get_ref()); @@ -58,7 +58,7 @@ inline std::ostream& operator<< (std::ostream& o, const SpValProxy& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -74,7 +74,7 @@ inline std::ostream& operator<< (std::ostream& o, const MapMat_val& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); o << eT(X); @@ -88,7 +88,7 @@ inline std::ostream& operator<< (std::ostream& o, const SpMat_MapMat_val& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); o << eT(X); @@ -102,7 +102,7 @@ inline std::ostream& operator<< (std::ostream& o, const SpSubview_MapMat_val& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); o << eT(X); @@ -116,7 +116,7 @@ inline std::ostream& operator<< (std::ostream& o, const BaseCube& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_cube tmp(X.get_ref()); @@ -133,7 +133,7 @@ inline std::ostream& operator<< (std::ostream& o, const field& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ostream::print(o, X); @@ -148,7 +148,7 @@ inline std::ostream& operator<< (std::ostream& o, const subview_field& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ostream::print(o, X); @@ -161,7 +161,7 @@ inline std::ostream& operator<< (std::ostream& o, const SizeMat& S) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ostream::print(o, S); @@ -174,7 +174,7 @@ inline std::ostream& operator<< (std::ostream& o, const SizeCube& S) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ostream::print(o, S); diff --git a/inst/include/armadillo_bits/operator_plus.hpp b/inst/include/armadillo_bits/operator_plus.hpp index 3cae597c..fd0603d0 100644 --- a/inst/include/armadillo_bits/operator_plus.hpp +++ b/inst/include/armadillo_bits/operator_plus.hpp @@ -28,7 +28,7 @@ typename enable_if2< is_arma_type::value, const T1& >::result operator+ (const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return X; } @@ -42,7 +42,7 @@ typename enable_if2< is_arma_type::value, const eOp >:: operator+ (const T1& X, const typename T1::elem_type k) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(X, k); } @@ -56,7 +56,7 @@ typename enable_if2< is_arma_type::value, const eOp >:: operator+ (const typename T1::elem_type k, const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(X, k); // NOTE: order is swapped } @@ -78,7 +78,7 @@ operator+ const std::complex& k ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp, T1, op_cx_scalar_plus>('j', X, k); } @@ -100,7 +100,7 @@ operator+ const T1& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp, T1, op_cx_scalar_plus>('j', X, k); // NOTE: order is swapped } @@ -122,7 +122,7 @@ operator+ const T2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eGlue(X, Y); } @@ -144,7 +144,7 @@ operator+ const T2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -173,7 +173,7 @@ operator+ const T2& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpGlue(x, y); } @@ -195,13 +195,13 @@ operator+ const T2& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat result(x); const SpProxy pb(y); - arma_debug_assert_same_size( result.n_rows, result.n_cols, pb.get_n_rows(), pb.get_n_cols(), "addition" ); + arma_conform_assert_same_size( result.n_rows, result.n_cols, pb.get_n_rows(), pb.get_n_cols(), "addition" ); typename SpProxy::const_iterator_type it = pb.begin(); typename SpProxy::const_iterator_type it_end = pb.end(); @@ -232,13 +232,13 @@ operator+ const T2& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy pa(x); Mat result(y); - arma_debug_assert_same_size( pa.get_n_rows(), pa.get_n_cols(), result.n_rows, result.n_cols, "addition" ); + arma_conform_assert_same_size( pa.get_n_rows(), pa.get_n_cols(), result.n_rows, result.n_cols, "addition" ); typename SpProxy::const_iterator_type it = pa.begin(); typename SpProxy::const_iterator_type it_end = pa.end(); @@ -269,7 +269,7 @@ operator+ const T2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -298,7 +298,7 @@ operator+ const T2& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat< typename promote_type::result > out; @@ -324,7 +324,7 @@ operator+ const T2& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat< typename promote_type::result > out; @@ -347,7 +347,7 @@ operator+ const typename T1::elem_type k ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpToDOp(X, k); } @@ -363,7 +363,7 @@ operator+ const T1& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpToDOp(X, k); // NOTE: swapped order } @@ -388,7 +388,7 @@ operator+ const typename T1::elem_type k ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const typename T1::elem_type aux = (is_same_type::value) ? x.aux : -x.aux; @@ -414,7 +414,7 @@ operator+ const typename T1::elem_type k ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpToDOp(x.m, x.aux + k); } @@ -439,7 +439,7 @@ operator+ const SpToDOp& x ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const typename T1::elem_type aux = (is_same_type::value) ? x.aux : -x.aux; @@ -465,7 +465,7 @@ operator+ const SpToDOp& x ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpToDOp(x.m, x.aux + k); } @@ -482,7 +482,7 @@ operator+ const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_each1_aux::operator_plus(X, Y.get_ref()); } @@ -498,7 +498,7 @@ operator+ const subview_each1& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_each1_aux::operator_plus(Y, X.get_ref()); // NOTE: swapped order } @@ -514,7 +514,7 @@ operator+ const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_each2_aux::operator_plus(X, Y.get_ref()); } @@ -530,7 +530,7 @@ operator+ const subview_each2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_each2_aux::operator_plus(Y, X.get_ref()); // NOTE: swapped order } diff --git a/inst/include/armadillo_bits/operator_relational.hpp b/inst/include/armadillo_bits/operator_relational.hpp index 7313fdc5..e6560039 100644 --- a/inst/include/armadillo_bits/operator_relational.hpp +++ b/inst/include/armadillo_bits/operator_relational.hpp @@ -41,7 +41,7 @@ enable_if2 operator< (const T1& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtGlue( X, Y ); } @@ -59,7 +59,7 @@ enable_if2 operator> (const T1& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtGlue( X, Y ); } @@ -77,7 +77,7 @@ enable_if2 operator<= (const T1& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtGlue( X, Y ); } @@ -95,7 +95,7 @@ enable_if2 operator>= (const T1& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtGlue( X, Y ); } @@ -113,7 +113,7 @@ enable_if2 operator== (const T1& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtGlue( X, Y ); } @@ -131,7 +131,7 @@ enable_if2 operator!= (const T1& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtGlue( X, Y ); } @@ -149,7 +149,7 @@ enable_if2 operator&& (const T1& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtGlue( X, Y ); } @@ -167,7 +167,7 @@ enable_if2 operator|| (const T1& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtGlue( X, Y ); } @@ -191,7 +191,7 @@ enable_if2 operator< (const typename T1::elem_type val, const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X, val); } @@ -209,7 +209,7 @@ enable_if2 operator< (const T1& X, const typename T1::elem_type val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X, val); } @@ -227,7 +227,7 @@ enable_if2 operator> (const typename T1::elem_type val, const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X, val); } @@ -245,7 +245,7 @@ enable_if2 operator> (const T1& X, const typename T1::elem_type val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X, val); } @@ -263,7 +263,7 @@ enable_if2 operator<= (const typename T1::elem_type val, const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X, val); } @@ -281,7 +281,7 @@ enable_if2 operator<= (const T1& X, const typename T1::elem_type val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X, val); } @@ -299,7 +299,7 @@ enable_if2 operator>= (const typename T1::elem_type val, const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X, val); } @@ -317,7 +317,7 @@ enable_if2 operator>= (const T1& X, const typename T1::elem_type val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X, val); } @@ -335,7 +335,7 @@ enable_if2 operator== (const typename T1::elem_type val, const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X, val); } @@ -353,7 +353,7 @@ enable_if2 operator== (const T1& X, const typename T1::elem_type val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X, val); } @@ -371,7 +371,7 @@ enable_if2 operator!= (const typename T1::elem_type val, const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X, val); } @@ -389,7 +389,7 @@ enable_if2 operator!= (const T1& X, const typename T1::elem_type val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp(X, val); } @@ -411,7 +411,7 @@ enable_if2 operator< (const T1& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // TODO: ensure T1::elem_type and T2::elem_type are the same @@ -431,7 +431,7 @@ enable_if2 operator> (const T1& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // TODO: ensure T1::elem_type and T2::elem_type are the same @@ -451,7 +451,7 @@ enable_if2 operator&& (const T1& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // TODO: ensure T1::elem_type and T2::elem_type are the same @@ -471,7 +471,7 @@ enable_if2 operator|| (const T1& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // TODO: ensure T1::elem_type and T2::elem_type are the same diff --git a/inst/include/armadillo_bits/operator_schur.hpp b/inst/include/armadillo_bits/operator_schur.hpp index 2acfdbc6..dfb0b31b 100644 --- a/inst/include/armadillo_bits/operator_schur.hpp +++ b/inst/include/armadillo_bits/operator_schur.hpp @@ -38,7 +38,7 @@ operator% const T2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eGlue(X, Y); } @@ -60,7 +60,7 @@ operator% const T2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -89,7 +89,7 @@ operator% const T2& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpGlue(x, y); } @@ -111,7 +111,7 @@ operator% const T2& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat out; @@ -137,7 +137,7 @@ operator% const T2& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat out; @@ -171,7 +171,7 @@ operator% const SpToDOp& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat out; @@ -203,7 +203,7 @@ operator% const T2& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat out; @@ -231,7 +231,7 @@ operator% const T2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -260,7 +260,7 @@ operator% const T2& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat< typename promote_type::result > out; @@ -286,7 +286,7 @@ operator% const T2& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat< typename promote_type::result > out; @@ -308,7 +308,7 @@ operator% const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_each1_aux::operator_schur(X, Y.get_ref()); } @@ -324,7 +324,7 @@ operator% const subview_each1& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_each1_aux::operator_schur(Y, X.get_ref()); // NOTE: swapped order } @@ -340,7 +340,7 @@ operator% const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_each2_aux::operator_schur(X, Y.get_ref()); } @@ -356,7 +356,7 @@ operator% const subview_each2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_each2_aux::operator_schur(Y, X.get_ref()); // NOTE: swapped order } diff --git a/inst/include/armadillo_bits/operator_times.hpp b/inst/include/armadillo_bits/operator_times.hpp index 861166c0..2070bc6c 100644 --- a/inst/include/armadillo_bits/operator_times.hpp +++ b/inst/include/armadillo_bits/operator_times.hpp @@ -28,7 +28,7 @@ typename enable_if2< is_arma_type::value, const eOp >: operator* (const T1& X, const typename T1::elem_type k) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(X,k); } @@ -42,7 +42,7 @@ typename enable_if2< is_arma_type::value, const eOp >: operator* (const typename T1::elem_type k, const T1& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return eOp(X,k); // NOTE: order is swapped } @@ -64,7 +64,7 @@ operator* const std::complex& k ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp, T1, op_cx_scalar_times>('j', X, k); } @@ -86,7 +86,7 @@ operator* const T1& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtOp, T1, op_cx_scalar_times>('j', X, k); } @@ -100,7 +100,7 @@ const Op operator* (const typename T1::elem_type k, const Op& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X.m, k); } @@ -114,7 +114,7 @@ const Op operator* (const Op& X, const typename T1::elem_type k) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Op(X.m, k); } @@ -133,7 +133,7 @@ enable_if2 operator* (const T1& X, const Op& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Glue, glue_times_diag>(X, Y); } @@ -152,7 +152,7 @@ enable_if2 operator* (const Op& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Glue, T2, glue_times_diag>(X, Y); } @@ -166,7 +166,7 @@ Mat< typename promote_type::resu operator* (const Op& X, const Op& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -178,7 +178,7 @@ operator* const diagmat_proxy A(X.m); const diagmat_proxy B(Y.m); - arma_debug_assert_mul_size(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication"); + arma_conform_assert_mul_size(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication"); Mat out(A.n_rows, B.n_cols, arma_zeros_indicator()); @@ -209,7 +209,7 @@ enable_if2 operator* (const T1& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return Glue(X, Y); } @@ -231,7 +231,7 @@ operator* const T2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -260,7 +260,7 @@ operator* const typename T1::elem_type k ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpOp(X, k); } @@ -281,7 +281,7 @@ operator* const T1& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpOp(X, k); } @@ -303,7 +303,7 @@ operator* const std::complex& k ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtSpOp, T1, spop_cx_scalar_times>('j', X, k); } @@ -325,7 +325,7 @@ operator* const T1& X ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return mtSpOp, T1, spop_cx_scalar_times>('j', X, k); } @@ -347,7 +347,7 @@ operator* const T2& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpGlue(x, y); } @@ -369,7 +369,7 @@ operator* const T2& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpToDGlue(x, y); } @@ -391,7 +391,7 @@ operator* const T2& y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return SpToDGlue(x, y); } @@ -413,7 +413,7 @@ operator* const T2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -442,7 +442,7 @@ operator* const T2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat< typename promote_type::result > out; @@ -468,7 +468,7 @@ operator* const T2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat< typename promote_type::result > out; diff --git a/inst/include/armadillo_bits/podarray_meat.hpp b/inst/include/armadillo_bits/podarray_meat.hpp index 2eb62f24..17be3216 100644 --- a/inst/include/armadillo_bits/podarray_meat.hpp +++ b/inst/include/armadillo_bits/podarray_meat.hpp @@ -24,7 +24,7 @@ template inline podarray::~podarray() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); if(n_elem > podarray_prealloc_n_elem::val ) { @@ -40,7 +40,7 @@ podarray::podarray() : n_elem(0) , mem (0) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } @@ -50,7 +50,7 @@ inline podarray::podarray(const podarray& x) : n_elem(x.n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword x_n_elem = x.n_elem; @@ -66,7 +66,7 @@ inline const podarray& podarray::operator=(const podarray& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(this != &x) { @@ -87,7 +87,7 @@ arma_inline podarray::podarray(const uword new_n_elem) : n_elem(new_n_elem) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(new_n_elem); } @@ -100,13 +100,13 @@ inline podarray::podarray(const uword new_n_elem, const arma_initmode_indicator&) : n_elem(new_n_elem) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); init_cold(new_n_elem); if(do_zeros) { - arma_extra_debug_print("podarray::constructor: zeroing memory"); + arma_debug_print("podarray::constructor: zeroing memory"); arrayops::fill_zeros(memptr(), n_elem); } } @@ -138,7 +138,7 @@ arma_inline eT podarray::operator() (const uword i) const { - arma_debug_check_bounds( (i >= n_elem), "podarray::operator(): index out of bounds" ); + arma_conform_check_bounds( (i >= n_elem), "podarray::operator(): index out of bounds" ); return mem[i]; } @@ -150,7 +150,7 @@ arma_inline eT& podarray::operator() (const uword i) { - arma_debug_check_bounds( (i >= n_elem), "podarray::operator(): index out of bounds" ); + arma_conform_check_bounds( (i >= n_elem), "podarray::operator(): index out of bounds" ); return access::rw(mem[i]); } @@ -162,7 +162,7 @@ inline void podarray::set_min_size(const uword min_n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(min_n_elem > n_elem) { init_warm(min_n_elem); } } @@ -174,7 +174,7 @@ inline void podarray::set_size(const uword new_n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init_warm(new_n_elem); } @@ -186,7 +186,7 @@ inline void podarray::reset() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init_warm(0); } @@ -198,7 +198,7 @@ inline void podarray::fill(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arrayops::inplace_set(memptr(), val, n_elem); } @@ -210,7 +210,7 @@ inline void podarray::zeros() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arrayops::fill_zeros(memptr(), n_elem); } @@ -222,7 +222,7 @@ inline void podarray::zeros(const uword new_n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); init_warm(new_n_elem); @@ -256,7 +256,7 @@ inline void podarray::copy_row(const Mat& A, const uword row) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // note: this function assumes that the podarray has been set to the correct size beforehand @@ -281,7 +281,7 @@ inline void podarray::init_cold(const uword new_n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); mem = (new_n_elem <= podarray_prealloc_n_elem::val) ? mem_local : memory::acquire(new_n_elem); } @@ -293,7 +293,7 @@ inline void podarray::init_warm(const uword new_n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(n_elem == new_n_elem) { return; } diff --git a/inst/include/armadillo_bits/running_stat_meat.hpp b/inst/include/armadillo_bits/running_stat_meat.hpp index 35e6ba82..795e11cc 100644 --- a/inst/include/armadillo_bits/running_stat_meat.hpp +++ b/inst/include/armadillo_bits/running_stat_meat.hpp @@ -25,7 +25,7 @@ template inline arma_counter::~arma_counter() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } @@ -36,7 +36,7 @@ arma_counter::arma_counter() : d_count( eT(0)) , i_count(uword(0)) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } @@ -134,7 +134,7 @@ template inline running_stat::~running_stat() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } @@ -149,7 +149,7 @@ running_stat::running_stat() , min_val_norm(typename running_stat::T(0)) , max_val_norm(typename running_stat::T(0)) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } @@ -160,11 +160,11 @@ inline void running_stat::operator() (const typename running_stat::T sample) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if( arma_isfinite(sample) == false ) { - arma_debug_warn_level(3, "running_stat: sample ignored as it is non-finite" ); + arma_conform_warn(3, "running_stat: sample ignored as it is non-finite" ); return; } @@ -179,11 +179,11 @@ inline void running_stat::operator() (const std::complex< typename running_stat::T >& sample) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if( arma_isfinite(sample) == false ) { - arma_debug_warn_level(3, "running_stat: sample ignored as it is non-finite" ); + arma_conform_warn(3, "running_stat: sample ignored as it is non-finite" ); return; } @@ -198,7 +198,7 @@ inline void running_stat::reset() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // typedef typename running_stat::T T; @@ -222,7 +222,7 @@ inline eT running_stat::mean() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return r_mean; } @@ -235,7 +235,7 @@ inline typename running_stat::T running_stat::var(const uword norm_type) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const T N = counter.value(); @@ -265,7 +265,7 @@ inline typename running_stat::T running_stat::stddev(const uword norm_type) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return std::sqrt( (*this).var(norm_type) ); } @@ -278,7 +278,7 @@ inline eT running_stat::min() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return min_val; } @@ -291,7 +291,7 @@ inline eT running_stat::max() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return max_val; } @@ -303,7 +303,7 @@ inline eT running_stat::range() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (max_val - min_val); } @@ -316,7 +316,7 @@ inline typename get_pod_type::result running_stat::count() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return counter.value(); } @@ -329,7 +329,7 @@ inline void running_stat_aux::update_stats(running_stat& x, const eT sample, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename running_stat::T T; @@ -382,7 +382,7 @@ inline void running_stat_aux::update_stats(running_stat& x, const std::complex& sample, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); running_stat_aux::update_stats(x, std::real(sample)); @@ -396,7 +396,7 @@ inline void running_stat_aux::update_stats(running_stat& x, const typename eT::value_type sample, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename eT::value_type T; @@ -412,7 +412,7 @@ inline void running_stat_aux::update_stats(running_stat& x, const eT& sample, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename eT::value_type T; diff --git a/inst/include/armadillo_bits/running_stat_vec_meat.hpp b/inst/include/armadillo_bits/running_stat_vec_meat.hpp index 370fcf73..32aed2d9 100644 --- a/inst/include/armadillo_bits/running_stat_vec_meat.hpp +++ b/inst/include/armadillo_bits/running_stat_vec_meat.hpp @@ -25,7 +25,7 @@ template inline running_stat_vec::~running_stat_vec() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } @@ -35,7 +35,7 @@ inline running_stat_vec::running_stat_vec(const bool in_calc_cov) : calc_cov(in_calc_cov) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } @@ -53,7 +53,7 @@ running_stat_vec::running_stat_vec(const running_stat_vec& i , min_val_norm(in_rsv.min_val_norm) , max_val_norm(in_rsv.max_val_norm) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } @@ -63,7 +63,7 @@ inline running_stat_vec& running_stat_vec::operator=(const running_stat_vec& in_rsv) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); access::rw(calc_cov) = in_rsv.calc_cov; @@ -88,7 +88,7 @@ inline void running_stat_vec::operator() (const Base::T, T1>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap tmp(X.get_ref()); const Mat& sample = tmp.M; @@ -100,7 +100,7 @@ running_stat_vec::operator() (const Base::operator() (const Base< std::complex::T>, T1>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap tmp(X.get_ref()); @@ -128,7 +128,7 @@ running_stat_vec::operator() (const Base< std::complex::reset() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); counter.reset(); @@ -172,7 +172,7 @@ inline const typename running_stat_vec::return_type1& running_stat_vec::mean() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return r_mean; } @@ -185,7 +185,7 @@ inline const typename running_stat_vec::return_type2& running_stat_vec::var(const uword norm_type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const T N = counter.value(); @@ -221,7 +221,7 @@ inline typename running_stat_vec::return_type2 running_stat_vec::stddev(const uword norm_type) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const T N = counter.value(); @@ -253,7 +253,7 @@ inline const Mat< typename running_stat_vec::eT >& running_stat_vec::cov(const uword norm_type) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(calc_cov) { @@ -300,7 +300,7 @@ inline const typename running_stat_vec::return_type1& running_stat_vec::min() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return min_val; } @@ -313,7 +313,7 @@ inline const typename running_stat_vec::return_type1& running_stat_vec::max() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return max_val; } @@ -325,7 +325,7 @@ inline typename running_stat_vec::return_type1 running_stat_vec::range() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (max_val - min_val); } @@ -338,7 +338,7 @@ inline typename running_stat_vec::T running_stat_vec::count() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return counter.value(); } @@ -360,7 +360,7 @@ running_stat_vec_aux::update_stats const typename arma_not_cx::eT>::result* junk ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename running_stat_vec::eT eT; @@ -370,7 +370,7 @@ running_stat_vec_aux::update_stats if(N > T(0)) { - arma_debug_assert_same_size(x.r_mean, sample, "running_stat_vec(): dimensionality mismatch"); + arma_conform_assert_same_size(x.r_mean, sample, "running_stat_vec(): dimensionality mismatch"); const uword n_elem = sample.n_elem; const eT* sample_mem = sample.memptr(); @@ -427,7 +427,7 @@ running_stat_vec_aux::update_stats } else { - arma_debug_check( (sample.is_vec() == false), "running_stat_vec(): given sample must be a vector" ); + arma_conform_check( (sample.is_vec() == false), "running_stat_vec(): given sample must be a vector" ); x.r_mean.set_size(sample.n_rows, sample.n_cols); @@ -475,7 +475,7 @@ running_stat_vec_aux::update_stats const typename arma_not_cx::eT>::result* junk ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename running_stat_vec::eT eT; @@ -496,7 +496,7 @@ running_stat_vec_aux::update_stats const typename arma_cx_only::eT>::result* junk ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename running_stat_vec::eT eT; @@ -517,7 +517,7 @@ running_stat_vec_aux::update_stats const typename arma_cx_only::eT>::result* junk ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename running_stat_vec::eT eT; @@ -527,7 +527,7 @@ running_stat_vec_aux::update_stats if(N > T(0)) { - arma_debug_assert_same_size(x.r_mean, sample, "running_stat_vec(): dimensionality mismatch"); + arma_conform_assert_same_size(x.r_mean, sample, "running_stat_vec(): dimensionality mismatch"); const uword n_elem = sample.n_elem; const eT* sample_mem = sample.memptr(); @@ -588,7 +588,7 @@ running_stat_vec_aux::update_stats } else { - arma_debug_check( (sample.is_vec() == false), "running_stat_vec(): given sample must be a vector" ); + arma_conform_check( (sample.is_vec() == false), "running_stat_vec(): given sample must be a vector" ); x.r_mean.set_size(sample.n_rows, sample.n_cols); diff --git a/inst/include/armadillo_bits/sp_auxlib_meat.hpp b/inst/include/armadillo_bits/sp_auxlib_meat.hpp index 97df7e8c..f6ba4d17 100644 --- a/inst/include/armadillo_bits/sp_auxlib_meat.hpp +++ b/inst/include/armadillo_bits/sp_auxlib_meat.hpp @@ -24,7 +24,7 @@ inline sp_auxlib::form_type sp_auxlib::interpret_form_str(const char* form_str) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // the order of the 3 if statements below is important if( form_str == nullptr ) { return form_none; } @@ -61,21 +61,21 @@ inline bool sp_auxlib::eigs_sym(Col& eigval, Mat& eigvec, const SpBase& X, const uword n_eigvals, const form_type form_val, const eigs_opts& opts) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat U(X.get_ref()); - arma_debug_check( (U.M.is_square() == false), "eigs_sym(): given matrix must be square sized" ); + arma_conform_check( (U.M.is_square() == false), "eigs_sym(): given matrix must be square sized" ); - if((arma_config::debug) && (sp_auxlib::rudimentary_sym_check(U.M) == false)) + if((arma_config::check_conformance) && (sp_auxlib::rudimentary_sym_check(U.M) == false)) { - if(is_cx::no ) { arma_debug_warn_level(1, "eigs_sym(): given matrix is not symmetric"); } - if(is_cx::yes) { arma_debug_warn_level(1, "eigs_sym(): given matrix is not hermitian"); } + if(is_cx::no ) { arma_conform_warn(1, "eigs_sym(): given matrix is not symmetric"); } + if(is_cx::yes) { arma_conform_warn(1, "eigs_sym(): given matrix is not hermitian"); } } if(arma_config::check_nonfinite && U.M.internal_has_nonfinite()) { - arma_debug_warn_level(3, "eigs_sym(): detected non-finite elements"); + arma_conform_warn(3, "eigs_sym(): detected non-finite elements"); return false; } @@ -114,21 +114,21 @@ inline bool sp_auxlib::eigs_sym(Col& eigval, Mat& eigvec, const SpBase& X, const uword n_eigvals, const eT sigma, const eigs_opts& opts) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat U(X.get_ref()); - arma_debug_check( (U.M.is_square() == false), "eigs_sym(): given matrix must be square sized" ); + arma_conform_check( (U.M.is_square() == false), "eigs_sym(): given matrix must be square sized" ); - if((arma_config::debug) && (sp_auxlib::rudimentary_sym_check(U.M) == false)) + if((arma_config::check_conformance) && (sp_auxlib::rudimentary_sym_check(U.M) == false)) { - if(is_cx::no ) { arma_debug_warn_level(1, "eigs_sym(): given matrix is not symmetric"); } - if(is_cx::yes) { arma_debug_warn_level(1, "eigs_sym(): given matrix is not hermitian"); } + if(is_cx::no ) { arma_conform_warn(1, "eigs_sym(): given matrix is not symmetric"); } + if(is_cx::yes) { arma_conform_warn(1, "eigs_sym(): given matrix is not hermitian"); } } if(arma_config::check_nonfinite && U.M.internal_has_nonfinite()) { - arma_debug_warn_level(3, "eigs_sym(): detected non-finite elements"); + arma_conform_warn(3, "eigs_sym(): detected non-finite elements"); return false; } @@ -163,17 +163,17 @@ inline bool sp_auxlib::eigs_sym_newarp(Col& eigval, Mat& eigvec, const SpMat& X, const uword n_eigvals, const form_type form_val, const eigs_opts& opts) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_NEWARP) { - arma_debug_check( (form_val != form_lm) && (form_val != form_sm) && (form_val != form_la) && (form_val != form_sa), "eigs_sym(): unknown form specified" ); + arma_conform_check( (form_val != form_lm) && (form_val != form_sm) && (form_val != form_la) && (form_val != form_sa), "eigs_sym(): unknown form specified" ); if(X.is_square() == false) { return false; } const newarp::SparseGenMatProd op(X); - arma_debug_check( (n_eigvals >= op.n_rows), "eigs_sym(): n_eigvals must be less than the number of rows in the matrix" ); + arma_conform_check( (n_eigvals >= op.n_rows), "eigs_sym(): n_eigvals must be less than the number of rows in the matrix" ); // If the matrix is empty, the case is trivial. if( (op.n_cols == 0) || (n_eigvals == 0) ) // We already know n_cols == n_rows. @@ -195,13 +195,13 @@ sp_auxlib::eigs_sym_newarp(Col& eigval, Mat& eigvec, const SpMat& X, { if(opts.subdim < (n_eigvals + 1)) { - arma_debug_warn_level(1, "eigs_sym(): opts.subdim must be greater than k; using k+1 instead of ", opts.subdim); + arma_conform_warn(1, "eigs_sym(): opts.subdim must be greater than k; using k+1 instead of ", opts.subdim); ncv = uword(n_eigvals + 1); } else if(opts.subdim > n) { - arma_debug_warn_level(1, "eigs_sym(): opts.subdim cannot be greater than n_rows; using n_rows instead of ", opts.subdim); + arma_conform_warn(1, "eigs_sym(): opts.subdim cannot be greater than n_rows; using n_rows instead of ", opts.subdim); ncv = n; } else @@ -296,7 +296,7 @@ inline bool sp_auxlib::eigs_sym_newarp(Col& eigval, Mat& eigvec, const SpMat& X, const uword n_eigvals, const eT sigma, const eigs_opts& opts) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_NEWARP) { @@ -306,7 +306,7 @@ sp_auxlib::eigs_sym_newarp(Col& eigval, Mat& eigvec, const SpMat& X, if(op.valid == false) { return false; } - arma_debug_check( (n_eigvals >= op.n_rows), "eigs_sym(): n_eigvals must be less than the number of rows in the matrix" ); + arma_conform_check( (n_eigvals >= op.n_rows), "eigs_sym(): n_eigvals must be less than the number of rows in the matrix" ); // If the matrix is empty, the case is trivial. if( (op.n_cols == 0) || (n_eigvals == 0) ) // We already know n_cols == n_rows. @@ -328,13 +328,13 @@ sp_auxlib::eigs_sym_newarp(Col& eigval, Mat& eigvec, const SpMat& X, { if(opts.subdim < (n_eigvals + 1)) { - arma_debug_warn_level(1, "eigs_sym(): opts.subdim must be greater than k; using k+1 instead of ", opts.subdim); + arma_conform_warn(1, "eigs_sym(): opts.subdim must be greater than k; using k+1 instead of ", opts.subdim); ncv = uword(n_eigvals + 1); } else if(opts.subdim > n) { - arma_debug_warn_level(1, "eigs_sym(): opts.subdim cannot be greater than n_rows; using n_rows instead of ", opts.subdim); + arma_conform_warn(1, "eigs_sym(): opts.subdim cannot be greater than n_rows; using n_rows instead of ", opts.subdim); ncv = n; } else @@ -399,11 +399,11 @@ inline bool sp_auxlib::eigs_sym_arpack(Col& eigval, Mat& eigvec, const SpMat& X, const uword n_eigvals, const form_type form_val, const eT sigma, const eigs_opts& opts) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_ARPACK) { - arma_debug_check( (form_val != form_lm) && (form_val != form_sm) && (form_val != form_la) && (form_val != form_sa) && (form_val != form_sigma), "eigs_sym(): unknown form specified" ); + arma_conform_check( (form_val != form_lm) && (form_val != form_sm) && (form_val != form_la) && (form_val != form_sa) && (form_val != form_sigma), "eigs_sym(): unknown form specified" ); if(X.is_square() == false) { return false; } @@ -425,7 +425,7 @@ sp_auxlib::eigs_sym_arpack(Col& eigval, Mat& eigvec, const SpMat& X, // Make sure we aren't asking for every eigenvalue. // The _saupd() functions allow asking for one more eigenvalue than the _naupd() functions. - arma_debug_check( (n_eigvals >= X.n_rows), "eigs_sym(): n_eigvals must be less than the number of rows in the matrix" ); + arma_conform_check( (n_eigvals >= X.n_rows), "eigs_sym(): n_eigvals must be less than the number of rows in the matrix" ); // If the matrix is empty, the case is trivial. if( (X.n_cols == 0) || (n_eigvals == 0) ) // We already know n_cols == n_rows. @@ -457,13 +457,13 @@ sp_auxlib::eigs_sym_arpack(Col& eigval, Mat& eigvec, const SpMat& X, { if(opts.subdim < (n_eigvals + 1)) { - arma_debug_warn_level(1, "eigs_sym(): opts.subdim must be greater than k; using k+1 instead of ", opts.subdim); + arma_conform_warn(1, "eigs_sym(): opts.subdim must be greater than k; using k+1 instead of ", opts.subdim); ncv = blas_int(n_eigvals + 1); } else if(blas_int(opts.subdim) > n) { - arma_debug_warn_level(1, "eigs_sym(): opts.subdim cannot be greater than n_rows; using n_rows instead of ", opts.subdim); + arma_conform_warn(1, "eigs_sym(): opts.subdim cannot be greater than n_rows; using n_rows instead of ", opts.subdim); ncv = n; } else @@ -503,7 +503,7 @@ sp_auxlib::eigs_sym_arpack(Col& eigval, Mat& eigvec, const SpMat& X, arpack::seupd(&rvec, &howmny, select.memptr(), eigval.memptr(), eigvec.memptr(), &ldz, (eT*) &sigma, &bmat, &n, which, &nev, &tol, resid.memptr(), &ncv, v.memptr(), &ldv, iparam.memptr(), ipntr.memptr(), workd.memptr(), workl.memptr(), &lworkl, &info); // Check for errors. - if(info != 0) { arma_debug_warn_level(1, "eigs_sym(): ARPACK error ", info, " in seupd()"); return false; } + if(info != 0) { arma_conform_warn(1, "eigs_sym(): ARPACK error ", info, " in seupd()"); return false; } return (info == 0); } @@ -530,15 +530,15 @@ inline bool sp_auxlib::eigs_gen(Col< std::complex >& eigval, Mat< std::complex >& eigvec, const SpBase& X, const uword n_eigvals, const form_type form_val, const eigs_opts& opts) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat U(X.get_ref()); - arma_debug_check( (U.M.is_square() == false), "eigs_gen(): given matrix must be square sized" ); + arma_conform_check( (U.M.is_square() == false), "eigs_gen(): given matrix must be square sized" ); if(arma_config::check_nonfinite && U.M.internal_has_nonfinite()) { - arma_debug_warn_level(3, "eigs_gen(): detected non-finite elements"); + arma_conform_warn(3, "eigs_gen(): detected non-finite elements"); return false; } @@ -577,15 +577,15 @@ inline bool sp_auxlib::eigs_gen(Col< std::complex >& eigval, Mat< std::complex >& eigvec, const SpBase& X, const uword n_eigvals, const std::complex sigma, const eigs_opts& opts) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat U(X.get_ref()); - arma_debug_check( (U.M.is_square() == false), "eigs_gen(): given matrix must be square sized" ); + arma_conform_check( (U.M.is_square() == false), "eigs_gen(): given matrix must be square sized" ); if(arma_config::check_nonfinite && U.M.internal_has_nonfinite()) { - arma_debug_warn_level(3, "eigs_gen(): detected non-finite elements"); + arma_conform_warn(3, "eigs_gen(): detected non-finite elements"); return false; } @@ -616,17 +616,17 @@ inline bool sp_auxlib::eigs_gen_newarp(Col< std::complex >& eigval, Mat< std::complex >& eigvec, const SpMat& X, const uword n_eigvals, const form_type form_val, const eigs_opts& opts) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_NEWARP) { - arma_debug_check( (form_val != form_lm) && (form_val != form_sm) && (form_val != form_lr) && (form_val != form_sr) && (form_val != form_li) && (form_val != form_si), "eigs_gen(): unknown form specified" ); + arma_conform_check( (form_val != form_lm) && (form_val != form_sm) && (form_val != form_lr) && (form_val != form_sr) && (form_val != form_li) && (form_val != form_si), "eigs_gen(): unknown form specified" ); if(X.is_square() == false) { return false; } const newarp::SparseGenMatProd op(X); - arma_debug_check( (n_eigvals + 1 >= op.n_rows), "eigs_gen(): n_eigvals + 1 must be less than the number of rows in the matrix" ); + arma_conform_check( (n_eigvals + 1 >= op.n_rows), "eigs_gen(): n_eigvals + 1 must be less than the number of rows in the matrix" ); // If the matrix is empty, the case is trivial. if( (op.n_cols == 0) || (n_eigvals == 0) ) // We already know n_cols == n_rows. @@ -648,13 +648,13 @@ sp_auxlib::eigs_gen_newarp(Col< std::complex >& eigval, Mat< std::complex { if(opts.subdim < (n_eigvals + 3)) { - arma_debug_warn_level(1, "eigs_gen(): opts.subdim must be greater than k+2; using k+3 instead of ", opts.subdim); + arma_conform_warn(1, "eigs_gen(): opts.subdim must be greater than k+2; using k+3 instead of ", opts.subdim); ncv = uword(n_eigvals + 3); } else if(opts.subdim > n) { - arma_debug_warn_level(1, "eigs_gen(): opts.subdim cannot be greater than n_rows; using n_rows instead of ", opts.subdim); + arma_conform_warn(1, "eigs_gen(): opts.subdim cannot be greater than n_rows; using n_rows instead of ", opts.subdim); ncv = n; } else @@ -768,11 +768,11 @@ inline bool sp_auxlib::eigs_gen_arpack(Col< std::complex >& eigval, Mat< std::complex >& eigvec, const SpMat& X, const uword n_eigvals, const form_type form_val, const std::complex sigma, const eigs_opts& opts) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_ARPACK) { - arma_debug_check( (form_val != form_lm) && (form_val != form_sm) && (form_val != form_lr) && (form_val != form_sr) && (form_val != form_li) && (form_val != form_si) && (form_val != form_sigma), "eigs_gen(): unknown form specified" ); + arma_conform_check( (form_val != form_lm) && (form_val != form_sm) && (form_val != form_lr) && (form_val != form_sr) && (form_val != form_li) && (form_val != form_si) && (form_val != form_sigma), "eigs_gen(): unknown form specified" ); if(X.is_square() == false) { return false; } @@ -798,7 +798,7 @@ sp_auxlib::eigs_gen_arpack(Col< std::complex >& eigval, Mat< std::complex } // Make sure we aren't asking for every eigenvalue. - arma_debug_check( (n_eigvals + 1 >= X.n_rows), "eigs_gen(): n_eigvals + 1 must be less than the number of rows in the matrix" ); + arma_conform_check( (n_eigvals + 1 >= X.n_rows), "eigs_gen(): n_eigvals + 1 must be less than the number of rows in the matrix" ); // If the matrix is empty, the case is trivial. if( (X.n_cols == 0) || (n_eigvals == 0) ) // We already know n_cols == n_rows. @@ -830,13 +830,13 @@ sp_auxlib::eigs_gen_arpack(Col< std::complex >& eigval, Mat< std::complex { if(opts.subdim < (n_eigvals + 3)) { - arma_debug_warn_level(1, "eigs_gen(): opts.subdim must be greater than k+2; using k+3 instead of ", opts.subdim); + arma_conform_warn(1, "eigs_gen(): opts.subdim must be greater than k+2; using k+3 instead of ", opts.subdim); ncv = blas_int(n_eigvals + 3); } else if(blas_int(opts.subdim) > n) { - arma_debug_warn_level(1, "eigs_gen(): opts.subdim cannot be greater than n_rows; using n_rows instead of ", opts.subdim); + arma_conform_warn(1, "eigs_gen(): opts.subdim cannot be greater than n_rows; using n_rows instead of ", opts.subdim); ncv = n; } else @@ -890,7 +890,7 @@ sp_auxlib::eigs_gen_arpack(Col< std::complex >& eigval, Mat< std::complex arpack::neupd(&rvec, &howmny, select.memptr(), dr.memptr(), di.memptr(), z.memptr(), &ldz, (T*) &sigmar, (T*) &sigmai, workev.memptr(), &bmat, &n, which, &nev, &tol, resid.memptr(), &ncv, v.memptr(), &ldv, iparam.memptr(), ipntr.memptr(), workd.memptr(), workl.memptr(), &lworkl, rwork.memptr(), &info); // Check for errors. - if(info != 0) { arma_debug_warn_level(1, "eigs_gen(): ARPACK error ", info, " in neupd()"); return false; } + if(info != 0) { arma_conform_warn(1, "eigs_gen(): ARPACK error ", info, " in neupd()"); return false; } // Put it into the outputs. eigval.set_size(n_eigvals); @@ -959,15 +959,15 @@ inline bool sp_auxlib::eigs_gen(Col< std::complex >& eigval, Mat< std::complex >& eigvec, const SpBase< std::complex, T1>& X_expr, const uword n_eigvals, const form_type form_val, const eigs_opts& opts) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat U(X_expr.get_ref()); - arma_debug_check( (U.M.is_square() == false), "eigs_gen(): given matrix must be square sized" ); + arma_conform_check( (U.M.is_square() == false), "eigs_gen(): given matrix must be square sized" ); if(arma_config::check_nonfinite && U.M.internal_has_nonfinite()) { - arma_debug_warn_level(3, "eigs_gen(): detected non-finite elements"); + arma_conform_warn(3, "eigs_gen(): detected non-finite elements"); return false; } @@ -984,15 +984,15 @@ inline bool sp_auxlib::eigs_gen(Col< std::complex >& eigval, Mat< std::complex >& eigvec, const SpBase< std::complex, T1>& X, const uword n_eigvals, const std::complex sigma, const eigs_opts& opts) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat U(X.get_ref()); - arma_debug_check( (U.M.is_square() == false), "eigs_gen(): given matrix must be square sized" ); + arma_conform_check( (U.M.is_square() == false), "eigs_gen(): given matrix must be square sized" ); if(arma_config::check_nonfinite && U.M.internal_has_nonfinite()) { - arma_debug_warn_level(3, "eigs_gen(): detected non-finite elements"); + arma_conform_warn(3, "eigs_gen(): detected non-finite elements"); return false; } @@ -1023,13 +1023,13 @@ inline bool sp_auxlib::eigs_gen(Col< std::complex >& eigval, Mat< std::complex >& eigvec, const SpMat< std::complex >& X, const uword n_eigvals, const form_type form_val, const std::complex sigma, const eigs_opts& opts) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_ARPACK) { // typedef typename std::complex eT; - arma_debug_check( (form_val != form_lm) && (form_val != form_sm) && (form_val != form_lr) && (form_val != form_sr) && (form_val != form_li) && (form_val != form_si) && (form_val != form_sigma), "eigs_gen(): unknown form specified" ); + arma_conform_check( (form_val != form_lm) && (form_val != form_sm) && (form_val != form_lr) && (form_val != form_sr) && (form_val != form_li) && (form_val != form_si) && (form_val != form_sigma), "eigs_gen(): unknown form specified" ); if(X.is_square() == false) { return false; } @@ -1055,7 +1055,7 @@ sp_auxlib::eigs_gen(Col< std::complex >& eigval, Mat< std::complex >& eigv } // Make sure we aren't asking for every eigenvalue. - arma_debug_check( (n_eigvals + 1 >= X.n_rows), "eigs_gen(): n_eigvals + 1 must be less than the number of rows in the matrix" ); + arma_conform_check( (n_eigvals + 1 >= X.n_rows), "eigs_gen(): n_eigvals + 1 must be less than the number of rows in the matrix" ); // If the matrix is empty, the case is trivial. if( (X.n_cols == 0) || (n_eigvals == 0) ) // We already know n_cols == n_rows. @@ -1087,13 +1087,13 @@ sp_auxlib::eigs_gen(Col< std::complex >& eigval, Mat< std::complex >& eigv { if(opts.subdim < (n_eigvals + 3)) { - arma_debug_warn_level(1, "eigs_gen(): opts.subdim must be greater than k+2; using k+3 instead of ", opts.subdim); + arma_conform_warn(1, "eigs_gen(): opts.subdim must be greater than k+2; using k+3 instead of ", opts.subdim); ncv = blas_int(n_eigvals + 3); } else if(blas_int(opts.subdim) > n) { - arma_debug_warn_level(1, "eigs_gen(): opts.subdim cannot be greater than n_rows; using n_rows instead of ", opts.subdim); + arma_conform_warn(1, "eigs_gen(): opts.subdim cannot be greater than n_rows; using n_rows instead of ", opts.subdim); ncv = n; } else @@ -1138,7 +1138,7 @@ sp_auxlib::eigs_gen(Col< std::complex >& eigval, Mat< std::complex >& eigv (std::complex*) NULL, eigvec.memptr(), &ldz, (std::complex*) &sigma, (std::complex*) NULL, workev.memptr(), &bmat, &n, which, &nev, &tol, resid.memptr(), &ncv, v.memptr(), &ldv, iparam.memptr(), ipntr.memptr(), workd.memptr(), workl.memptr(), &lworkl, rwork.memptr(), &info); // Check for errors. - if(info != 0) { arma_debug_warn_level(1, "eigs_gen(): ARPACK error ", info, " in neupd()"); return false; } + if(info != 0) { arma_conform_warn(1, "eigs_gen(): ARPACK error ", info, " in neupd()"); return false; } return (info == 0); } @@ -1165,7 +1165,7 @@ inline bool sp_auxlib::spsolve_simple(Mat& X, const SpBase& A_expr, const Base& B_expr, const superlu_opts& user_opts) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_SUPERLU) { @@ -1186,7 +1186,7 @@ sp_auxlib::spsolve_simple(Mat& X, const SpBase& X, const SpBase& X, const SpBase(&options, a.get_ptr(), perm_c.get_ptr(), perm_r.get_ptr(), l.get_ptr(), u.get_ptr(), x.get_ptr(), stat.get_ptr(), &info); @@ -1248,17 +1248,17 @@ sp_auxlib::spsolve_simple(Mat& X, const SpBase int(A.n_cols)) { - arma_debug_warn_level(1, "spsolve(): memory allocation failure"); + arma_conform_warn(1, "spsolve(): memory allocation failure"); } else if(info < 0) { - arma_debug_warn_level(1, "spsolve(): unknown SuperLU error code from gssv(): ", info); + arma_conform_warn(1, "spsolve(): unknown SuperLU error code from gssv(): ", info); } // No need to extract the data from x, since it's using the same memory as X @@ -1284,7 +1284,7 @@ inline bool sp_auxlib::spsolve_refine(Mat& X, typename T1::pod_type& out_rcond, const SpBase& A_expr, const Base& B_expr, const superlu_opts& user_opts) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_SUPERLU) { @@ -1313,7 +1313,7 @@ sp_auxlib::spsolve_refine(Mat& X, typename T1::pod_type& return false; } - arma_debug_check( (A.n_rows != B.n_rows), "spsolve(): number of rows in the given objects must be the same", [&](){ X.soft_reset(); } ); + arma_conform_check( (A.n_rows != B.n_rows), "spsolve(): number of rows in the given objects must be the same", [&](){ X.soft_reset(); } ); X.zeros(A.n_cols, B.n_cols); // set the elements to zero, as we don't trust the SuperLU spaghetti code @@ -1323,11 +1323,11 @@ sp_auxlib::spsolve_refine(Mat& X, typename T1::pod_type& if(arma_config::check_nonfinite && (A.internal_has_nonfinite() || B.internal_has_nonfinite())) { - arma_debug_warn_level(3, "spsolve(): detected non-finite elements"); + arma_conform_warn(3, "spsolve(): detected non-finite elements"); return false; } - if(arma_config::debug) + if(arma_config::check_conformance) { bool overflow; @@ -1386,7 +1386,7 @@ sp_auxlib::spsolve_refine(Mat& X, typename T1::pod_type& char work[8] = {}; int lwork = int(0); // 0 means superlu will allocate memory - arma_extra_debug_print("superlu::gssvx()"); + arma_debug_print("superlu::gssvx()"); superlu::gssvx(&options, a.get_ptr(), perm_c.get_ptr(), perm_r.get_ptr(), etree.get_ptr(), equed, R.get_ptr(), C.get_ptr(), l.get_ptr(), u.get_ptr(), &work[0], lwork, b.get_ptr(), x.get_ptr(), &rpg, &rcond, ferr.get_ptr(), berr.get_ptr(), &glu, &mu, stat.get_ptr(), &info); bool status = false; @@ -1400,23 +1400,23 @@ sp_auxlib::spsolve_refine(Mat& X, typename T1::pod_type& { // std::ostringstream tmp; // tmp << "spsolve(): could not solve system; LU factorisation completed, but detected zero in U(" << (info-1) << ',' << (info-1) << ')'; - // arma_debug_warn_level(1, tmp.str()); + // arma_conform_warn(1, tmp.str()); } else if( (info == int(A.n_cols+1)) && (user_opts.allow_ugly) ) { - arma_debug_warn_level(2, "spsolve(): system is singular to working precision (rcond: ", rcond, ")"); + arma_conform_warn(2, "spsolve(): system is singular to working precision (rcond: ", rcond, ")"); status = true; } else if(info > int(A.n_cols+1)) { - arma_debug_warn_level(1, "spsolve(): memory allocation failure"); + arma_conform_warn(1, "spsolve(): memory allocation failure"); } else if(info < 0) { - arma_debug_warn_level(1, "spsolve(): unknown SuperLU error code from gssvx(): ", info); + arma_conform_warn(1, "spsolve(): unknown SuperLU error code from gssvx(): ", info); } // No need to extract the data from x, since it's using the same memory as X @@ -1447,11 +1447,11 @@ sp_auxlib::spsolve_refine(Mat& X, typename T1::pod_type& typename get_pod_type::result sp_auxlib::norm1(superlu::SuperMatrix* A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); char norm_id = '1'; - arma_extra_debug_print("superlu::langs()"); + arma_debug_print("superlu::langs()"); return superlu::langs(&norm_id, A); } @@ -1462,7 +1462,7 @@ sp_auxlib::spsolve_refine(Mat& X, typename T1::pod_type& typename get_pod_type::result sp_auxlib::lu_rcond(superlu::SuperMatrix* L, superlu::SuperMatrix* U, typename get_pod_type::result norm_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -1472,7 +1472,7 @@ sp_auxlib::spsolve_refine(Mat& X, typename T1::pod_type& superlu_stat_wrangler stat; - arma_extra_debug_print("superlu::gscon()"); + arma_debug_print("superlu::gscon()"); superlu::gscon(&norm_id, L, U, norm_val, &rcond_out, stat.get_ptr(), &info); return (info == 0) ? T(rcond_out) : T(0); @@ -1484,7 +1484,7 @@ sp_auxlib::spsolve_refine(Mat& X, typename T1::pod_type& void sp_auxlib::set_superlu_opts(superlu::superlu_options_t& options, const superlu_opts& user_opts) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // default options as the starting point superlu::set_default_opts(&options); @@ -1521,7 +1521,7 @@ sp_auxlib::spsolve_refine(Mat& X, typename T1::pod_type& bool sp_auxlib::copy_to_supermatrix(superlu::SuperMatrix& out, const SpMat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // We store in column-major CSC. out.Stype = superlu::SLU_NC; @@ -1575,13 +1575,13 @@ sp_auxlib::spsolve_refine(Mat& X, typename T1::pod_type& bool sp_auxlib::copy_to_supermatrix_with_shift(superlu::SuperMatrix& out, const SpMat& A, const eT shift) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (A.is_square() == false), "sp_auxlib::copy_to_supermatrix_with_shift(): given matrix must be square sized" ); + arma_conform_check( (A.is_square() == false), "sp_auxlib::copy_to_supermatrix_with_shift(): given matrix must be square sized" ); if(shift == eT(0)) { - arma_extra_debug_print("sp_auxlib::copy_to_supermatrix_with_shift(): shift is zero; redirecting to sp_auxlib::copy_to_supermatrix()"); + arma_debug_print("sp_auxlib::copy_to_supermatrix_with_shift(): shift is zero; redirecting to sp_auxlib::copy_to_supermatrix()"); return sp_auxlib::copy_to_supermatrix(out, A); } @@ -1642,10 +1642,10 @@ sp_auxlib::spsolve_refine(Mat& X, typename T1::pod_type& const uword out_n_nonzero = A.n_nonzero - n_nonzero_diag_old + n_nonzero_diag_new; - arma_extra_debug_print( arma_str::format("A.n_nonzero: %u") % A.n_nonzero ); - arma_extra_debug_print( arma_str::format("n_nonzero_diag_old: %u") % n_nonzero_diag_old ); - arma_extra_debug_print( arma_str::format("n_nonzero_diag_new: %u") % n_nonzero_diag_new ); - arma_extra_debug_print( arma_str::format("out_n_nonzero: %u") % out_n_nonzero ); + arma_debug_print( arma_str::format("A.n_nonzero: %u") % A.n_nonzero ); + arma_debug_print( arma_str::format("n_nonzero_diag_old: %u") % n_nonzero_diag_old ); + arma_debug_print( arma_str::format("n_nonzero_diag_new: %u") % n_nonzero_diag_new ); + arma_debug_print( arma_str::format("out_n_nonzero: %u") % out_n_nonzero ); nc->nnz = out_n_nonzero; nc->nzval = (void*) superlu::malloc(sizeof(eT) * out_n_nonzero ); @@ -1737,7 +1737,7 @@ sp_auxlib::spsolve_refine(Mat& X, typename T1::pod_type& nc->colptr[j + 1] = superlu::int_t(nc->colptr[j] + nnz_col); } - arma_extra_debug_print( arma_str::format("count: %u") % count ); + arma_debug_print( arma_str::format("count: %u") % count ); arma_check( (count != out_n_nonzero), "internal error: sp_auxlib::copy_to_supermatrix_with_shift(): count != out_n_nonzero" ); @@ -1756,7 +1756,7 @@ sp_auxlib::spsolve_refine(Mat& X, typename T1::pod_type& // void // sp_auxlib::copy_to_spmat(SpMat& out, const superlu::SuperMatrix& A) // { -// arma_extra_debug_sigprint(); +// arma_debug_sigprint(); // // bool type_matched = false; // @@ -1765,8 +1765,8 @@ sp_auxlib::spsolve_refine(Mat& X, typename T1::pod_type& // else if( is_cx_float::value) { type_matched = (A.Dtype == superlu::SLU_C); } // else if(is_cx_double::value) { type_matched = (A.Dtype == superlu::SLU_Z); } // -// arma_debug_check( (type_matched == false), "copy_to_spmat(): type mismatch" ); -// arma_debug_check( (A.Mtype != superlu::SLU_GE), "copy_to_spmat(): unknown layout" ); +// arma_conform_check( (type_matched == false), "copy_to_spmat(): type mismatch" ); +// arma_conform_check( (A.Mtype != superlu::SLU_GE), "copy_to_spmat(): unknown layout" ); // // // NOTE: the l and u instances of SuperMatrix resulting from superlu::gstrf() // // NOTE: do not have the superlu::SLU_GE layout @@ -1800,7 +1800,7 @@ sp_auxlib::spsolve_refine(Mat& X, typename T1::pod_type& bool sp_auxlib::wrap_to_supermatrix(superlu::SuperMatrix& out, const Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: this function re-uses memory from matrix A @@ -1835,7 +1835,7 @@ sp_auxlib::spsolve_refine(Mat& X, typename T1::pod_type& void sp_auxlib::destroy_supermatrix(superlu::SuperMatrix& out) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // Clean up. if(out.Stype == superlu::SLU_NC) @@ -1884,7 +1884,7 @@ sp_auxlib::spsolve_refine(Mat& X, typename T1::pod_type& if(out.Stype == superlu::SLU_DN) { tmp << "SLU_DN"; } if(out.Stype == superlu::SLU_NR_loc) { tmp << "SLU_NR_loc"; } - arma_debug_warn_level(1, tmp.str()); + arma_conform_warn(1, tmp.str()); arma_stop_runtime_error("internal error: sp_auxlib::destroy_supermatrix()"); } } @@ -1967,12 +1967,12 @@ sp_auxlib::run_aupd_plain // Call saupd() or naupd() with the current parameters. if(sym) { - arma_extra_debug_print("arpack::saupd()"); + arma_debug_print("arpack::saupd()"); arpack::saupd(&ido, &bmat, &n, which, &nev, &tol, resid.memptr(), &ncv, v.memptr(), &ldv, iparam.memptr(), ipntr.memptr(), workd.memptr(), workl.memptr(), &lworkl, &info); } else { - arma_extra_debug_print("arpack::naupd()"); + arma_debug_print("arpack::naupd()"); arpack::naupd(&ido, &bmat, &n, which, &nev, &tol, resid.memptr(), &ncv, v.memptr(), &ldv, iparam.memptr(), ipntr.memptr(), workd.memptr(), workl.memptr(), &lworkl, rwork.memptr(), &info); } @@ -2012,11 +2012,11 @@ sp_auxlib::run_aupd_plain if(sym) { - arma_debug_warn_level(1, "eigs_sym(): ARPACK error ", info, " in saupd()"); + arma_conform_warn(1, "eigs_sym(): ARPACK error ", info, " in saupd()"); } else { - arma_debug_warn_level(1, "eigs_gen(): ARPACK error ", info, " in naupd()"); + arma_conform_warn(1, "eigs_gen(): ARPACK error ", info, " in naupd()"); } return; // Parent frame can look at the value of info. @@ -2178,14 +2178,14 @@ sp_auxlib::run_aupd_shiftinvert int relax = superlu::sp_ispec_environ(2); int slu_info = 0; // Return code. - arma_extra_debug_print("superlu::gstrf()"); + arma_debug_print("superlu::gstrf()"); superlu::get_permutation_c(options.ColPerm, x.get_ptr(), perm_c.get_ptr()); superlu::sp_preorder_mat(&options, x.get_ptr(), perm_c.get_ptr(), etree.get_ptr(), xC.get_ptr()); superlu::gstrf(&options, xC.get_ptr(), relax, panel_size, etree.get_ptr(), NULL, lwork, perm_c.get_ptr(), perm_r.get_ptr(), l.get_ptr(), u.get_ptr(), &Glu, stat.get_ptr(), &slu_info); if(slu_info != 0) { - arma_debug_warn_level(2, "matrix is singular to working precision"); + arma_conform_warn(2, "matrix is singular to working precision"); info = blas_int(-1); return; } @@ -2196,7 +2196,7 @@ sp_auxlib::run_aupd_shiftinvert if( (x_rcond < std::numeric_limits::epsilon()) || arma_isnan(x_rcond) ) { - arma_debug_warn_level(2, "matrix is singular to working precision (rcond: ", x_rcond, ")"); + arma_conform_warn(2, "matrix is singular to working precision (rcond: ", x_rcond, ")"); info = blas_int(-1); return; } @@ -2207,12 +2207,12 @@ sp_auxlib::run_aupd_shiftinvert // Call saupd() or naupd() with the current parameters. if(sym) { - arma_extra_debug_print("arpack::saupd()"); + arma_debug_print("arpack::saupd()"); arpack::saupd(&ido, &bmat, &n, which, &nev, &tol, resid.memptr(), &ncv, v.memptr(), &ldv, iparam.memptr(), ipntr.memptr(), workd.memptr(), workl.memptr(), &lworkl, &info); } else { - arma_extra_debug_print("arpack::naupd()"); + arma_debug_print("arpack::naupd()"); arpack::naupd(&ido, &bmat, &n, which, &nev, &tol, resid.memptr(), &ncv, v.memptr(), &ldv, iparam.memptr(), ipntr.memptr(), workd.memptr(), workl.memptr(), &lworkl, rwork.memptr(), &info); } @@ -2242,7 +2242,7 @@ sp_auxlib::run_aupd_shiftinvert if(status_out_slu == false) { arma_stop_runtime_error("run_aupd_shiftinvert(): could not construct SuperLU matrix"); return; } - arma_extra_debug_print("superlu::gstrs()"); + arma_debug_print("superlu::gstrs()"); superlu::gstrs(trans, l.get_ptr(), u.get_ptr(), perm_c.get_ptr(), perm_r.get_ptr(), out_slu.get_ptr(), stat.get_ptr(), &info); // No need to modify memory further since it was all done in-place. @@ -2266,11 +2266,11 @@ sp_auxlib::run_aupd_shiftinvert if(sym) { - arma_debug_warn_level(2, "eigs_sym(): ARPACK error ", info, " in saupd()"); + arma_conform_warn(2, "eigs_sym(): ARPACK error ", info, " in saupd()"); } else { - arma_debug_warn_level(2, "eigs_gen(): ARPACK error ", info, " in naupd()"); + arma_conform_warn(2, "eigs_gen(): ARPACK error ", info, " in naupd()"); } return; // Parent frame can look at the value of info. @@ -2307,7 +2307,7 @@ inline bool sp_auxlib::rudimentary_sym_check(const SpMat& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(X.n_rows != X.n_cols) { return false; } @@ -2352,7 +2352,7 @@ inline bool sp_auxlib::rudimentary_sym_check(const SpMat< std::complex >& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: the function name is a misnomer, as it checks for hermitian complex matrices; // NOTE: for simplicity of use, the function name is the same as for real matrices @@ -2416,7 +2416,7 @@ template inline eigs_randu_filler::eigs_randu_filler() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::mt19937_64::result_type local_seed_type; @@ -2433,7 +2433,7 @@ inline void eigs_randu_filler::fill(podarray& X, const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); X.set_size(N); @@ -2447,7 +2447,7 @@ template inline eigs_randu_filler< std::complex >::eigs_randu_filler() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::mt19937_64::result_type local_seed_type; @@ -2464,7 +2464,7 @@ inline void eigs_randu_filler< std::complex >::fill(podarray< std::complex >& X, const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename std::complex eT; @@ -2492,7 +2492,7 @@ eigs_randu_filler< std::complex >::fill(podarray< std::complex >& X, const inline superlu_supermatrix_wrangler::~superlu_supermatrix_wrangler() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); if(used == false) { return; } @@ -2510,7 +2510,7 @@ superlu_supermatrix_wrangler::~superlu_supermatrix_wrangler() inline superlu_supermatrix_wrangler::superlu_supermatrix_wrangler() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); arrayops::fill_zeros(reinterpret_cast(&m), sizeof(superlu::SuperMatrix)); } @@ -2540,7 +2540,7 @@ superlu_supermatrix_wrangler::get_ptr() inline superlu_stat_wrangler::~superlu_stat_wrangler() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); superlu::free_stat(&stat); } @@ -2548,7 +2548,7 @@ superlu_stat_wrangler::~superlu_stat_wrangler() inline superlu_stat_wrangler::superlu_stat_wrangler() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); arrayops::fill_zeros(reinterpret_cast(&stat), sizeof(superlu::SuperLUStat_t)); @@ -2570,7 +2570,7 @@ template inline superlu_array_wrangler::~superlu_array_wrangler() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); (*this).reset(); } @@ -2580,7 +2580,7 @@ inline superlu_array_wrangler::superlu_array_wrangler() : mem(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } template @@ -2588,7 +2588,7 @@ inline superlu_array_wrangler::superlu_array_wrangler(const uword n_elem) : mem(nullptr) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); (*this).set_size(n_elem); } @@ -2598,7 +2598,7 @@ inline void superlu_array_wrangler::set_size(const uword n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(mem != nullptr) { (*this).reset(); } @@ -2614,7 +2614,7 @@ inline void superlu_array_wrangler::reset() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(mem != nullptr) { @@ -2639,7 +2639,7 @@ template inline superlu_worker::~superlu_worker() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); if(l != nullptr) { delete l; l = nullptr; } if(u != nullptr) { delete u; u = nullptr; } @@ -2650,7 +2650,7 @@ template inline superlu_worker::superlu_worker() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } @@ -2659,7 +2659,7 @@ inline bool superlu_worker::factorise(typename get_pod_type::result& out_rcond, const SpMat& A, const superlu_opts& user_opts) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -2673,7 +2673,7 @@ superlu_worker::factorise(typename get_pod_type::result& out_rcond, cons if( (l == nullptr) || (u == nullptr) ) { - arma_debug_warn_level(3, "superlu_worker()::factorise(): could not construct SuperLU matrix"); + arma_conform_warn(3, "superlu_worker()::factorise(): could not construct SuperLU matrix"); return false; } @@ -2690,7 +2690,7 @@ superlu_worker::factorise(typename get_pod_type::result& out_rcond, cons if(status_AA == false) { - arma_debug_warn_level(3, "superlu_worker()::factorise(): could not construct SuperLU matrix"); + arma_conform_warn(3, "superlu_worker()::factorise(): could not construct SuperLU matrix"); return false; } @@ -2707,18 +2707,18 @@ superlu_worker::factorise(typename get_pod_type::result& out_rcond, cons int lwork = 0; int info = 0; - arma_extra_debug_print("superlu::superlu::get_permutation_c()"); + arma_debug_print("superlu::superlu::get_permutation_c()"); superlu::get_permutation_c(options.ColPerm, AA.get_ptr(), perm_c.get_ptr()); - arma_extra_debug_print("superlu::superlu::sp_preorder_mat()"); + arma_debug_print("superlu::superlu::sp_preorder_mat()"); superlu::sp_preorder_mat(&options, AA.get_ptr(), perm_c.get_ptr(), etree.get_ptr(), AAc.get_ptr()); - arma_extra_debug_print("superlu::gstrf()"); + arma_debug_print("superlu::gstrf()"); superlu::gstrf(&options, AAc.get_ptr(), relax, panel_size, etree.get_ptr(), NULL, lwork, perm_c.get_ptr(), perm_r.get_ptr(), l_ref.get_ptr(), u_ref.get_ptr(), &Glu, stat.get_ptr(), &info); if(info != 0) { - arma_debug_warn_level(3, "superlu_worker()::factorise(): LU factorisation failed"); + arma_conform_warn(3, "superlu_worker()::factorise(): LU factorisation failed"); return false; } @@ -2741,7 +2741,7 @@ inline bool superlu_worker::solve(Mat& X, const Mat& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(factorisation_valid == false) { return false; } if( (l == nullptr) || (u == nullptr) ) { return false; } @@ -2757,14 +2757,14 @@ superlu_worker::solve(Mat& X, const Mat& B) if(status_XX == false) { - arma_debug_warn_level(3, "superlu_worker()::solve(): could not construct SuperLU matrix"); + arma_conform_warn(3, "superlu_worker()::solve(): could not construct SuperLU matrix"); return false; } superlu::trans_t trans = superlu::NOTRANS; int info = 0; - arma_extra_debug_print("superlu::gstrs()"); + arma_debug_print("superlu::gstrs()"); superlu::gstrs(trans, l_ref.get_ptr(), u_ref.get_ptr(), perm_c.get_ptr(), perm_r.get_ptr(), XX.get_ptr(), stat.get_ptr(), &info); return (info == 0); diff --git a/inst/include/armadillo_bits/spdiagview_meat.hpp b/inst/include/armadillo_bits/spdiagview_meat.hpp index 603cadc9..1a5b113c 100644 --- a/inst/include/armadillo_bits/spdiagview_meat.hpp +++ b/inst/include/armadillo_bits/spdiagview_meat.hpp @@ -24,7 +24,7 @@ template inline spdiagview::~spdiagview() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -37,7 +37,7 @@ spdiagview::spdiagview(const SpMat& in_m, const uword in_row_offset, con , n_rows(in_len) , n_elem(in_len) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -48,11 +48,11 @@ inline void spdiagview::operator= (const spdiagview& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); spdiagview& d = *this; - arma_debug_check( (d.n_elem != x.n_elem), "spdiagview: diagonals have incompatible lengths" ); + arma_conform_check( (d.n_elem != x.n_elem), "spdiagview: diagonals have incompatible lengths" ); SpMat& d_m = const_cast< SpMat& >(d.m); const SpMat& x_m = x.m; @@ -86,7 +86,7 @@ inline void spdiagview::operator+=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(val == eT(0)) { return; } @@ -109,7 +109,7 @@ inline void spdiagview::operator-=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(val == eT(0)) { return; } @@ -132,7 +132,7 @@ inline void spdiagview::operator*=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(val == eT(0)) { (*this).zeros(); return; } @@ -155,7 +155,7 @@ inline void spdiagview::operator/=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat& t_m = const_cast< SpMat& >(m); @@ -178,7 +178,7 @@ inline void spdiagview::operator= (const Base& o) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); spdiagview& d = *this; @@ -192,7 +192,7 @@ spdiagview::operator= (const Base& o) { const Proxy P(o.get_ref()); - arma_debug_check( (d_n_elem != P.get_n_elem()), "spdiagview: given object has incompatible size" ); + arma_conform_check( (d_n_elem != P.get_n_elem()), "spdiagview: given object has incompatible size" ); (*this).zeros(); @@ -203,7 +203,7 @@ spdiagview::operator= (const Base& o) { const Proxy P(o.get_ref()); - arma_debug_check( (d_n_elem != P.get_n_elem()), "spdiagview: given object has incompatible size" ); + arma_conform_check( (d_n_elem != P.get_n_elem()), "spdiagview: given object has incompatible size" ); (*this).ones(); @@ -215,7 +215,7 @@ spdiagview::operator= (const Base& o) const eT* x_mem = x.memptr(); - arma_debug_check + arma_conform_check ( ( (d_n_elem != x.n_elem) || ((x.n_rows != 1) && (x.n_cols != 1)) ), "spdiagview: given object has incompatible size" @@ -265,7 +265,7 @@ inline void spdiagview::operator+=(const Base& o) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); spdiagview& d = *this; @@ -277,7 +277,7 @@ spdiagview::operator+=(const Base& o) const Proxy P( o.get_ref() ); - arma_debug_check + arma_conform_check ( ( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ), "spdiagview: given object has incompatible size" @@ -314,7 +314,7 @@ inline void spdiagview::operator-=(const Base& o) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); spdiagview& d = *this; @@ -326,7 +326,7 @@ spdiagview::operator-=(const Base& o) const Proxy P( o.get_ref() ); - arma_debug_check + arma_conform_check ( ( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ), "spdiagview: given object has incompatible size" @@ -363,7 +363,7 @@ inline void spdiagview::operator%=(const Base& o) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); spdiagview& d = *this; @@ -375,7 +375,7 @@ spdiagview::operator%=(const Base& o) const Proxy P( o.get_ref() ); - arma_debug_check + arma_conform_check ( ( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ), "spdiagview: given object has incompatible size" @@ -412,7 +412,7 @@ inline void spdiagview::operator/=(const Base& o) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); spdiagview& d = *this; @@ -424,7 +424,7 @@ spdiagview::operator/=(const Base& o) const Proxy P( o.get_ref() ); - arma_debug_check + arma_conform_check ( ( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ), "spdiagview: given object has incompatible size" @@ -462,12 +462,12 @@ inline void spdiagview::operator= (const SpBase& o) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat U( o.get_ref() ); const SpMat& x = U.M; - arma_debug_check + arma_conform_check ( ( (n_elem != x.n_elem) || ((x.n_rows != 1) && (x.n_cols != 1)) ), "spdiagview: given object has incompatible size" @@ -486,7 +486,7 @@ inline void spdiagview::operator+=(const SpBase& o) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); spdiagview& d = *this; @@ -498,7 +498,7 @@ spdiagview::operator+=(const SpBase& o) const SpProxy P( o.get_ref() ); - arma_debug_check + arma_conform_check ( ( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ), "spdiagview: given object has incompatible size" @@ -540,7 +540,7 @@ inline void spdiagview::operator-=(const SpBase& o) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); spdiagview& d = *this; @@ -552,7 +552,7 @@ spdiagview::operator-=(const SpBase& o) const SpProxy P( o.get_ref() ); - arma_debug_check + arma_conform_check ( ( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ), "spdiagview: given object has incompatible size" @@ -594,7 +594,7 @@ inline void spdiagview::operator%=(const SpBase& o) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); spdiagview& d = *this; @@ -606,7 +606,7 @@ spdiagview::operator%=(const SpBase& o) const SpProxy P( o.get_ref() ); - arma_debug_check + arma_conform_check ( ( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ), "spdiagview: given object has incompatible size" @@ -648,7 +648,7 @@ inline void spdiagview::operator/=(const SpBase& o) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); spdiagview& d = *this; @@ -660,7 +660,7 @@ spdiagview::operator/=(const SpBase& o) const SpProxy P( o.get_ref() ); - arma_debug_check + arma_conform_check ( ( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ), "spdiagview: given object has incompatible size" @@ -701,7 +701,7 @@ inline void spdiagview::extract(SpMat& out, const spdiagview& d) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpMat& d_m = d.m; @@ -750,7 +750,7 @@ inline void spdiagview::extract(Mat& out, const spdiagview& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: we're assuming that the 'out' matrix has already been set to the correct size; // size setting is done by either the Mat contructor or Mat::operator=() @@ -816,7 +816,7 @@ inline SpMat_MapMat_val spdiagview::operator()(const uword i) { - arma_debug_check_bounds( (i >= n_elem), "spdiagview::operator(): out of bounds" ); + arma_conform_check_bounds( (i >= n_elem), "spdiagview::operator(): out of bounds" ); return (const_cast< SpMat& >(m)).at(i+row_offset, i+col_offset); } @@ -828,7 +828,7 @@ inline eT spdiagview::operator()(const uword i) const { - arma_debug_check_bounds( (i >= n_elem), "spdiagview::operator(): out of bounds" ); + arma_conform_check_bounds( (i >= n_elem), "spdiagview::operator(): out of bounds" ); return m.at(i+row_offset, i+col_offset); } @@ -860,7 +860,7 @@ inline SpMat_MapMat_val spdiagview::operator()(const uword row, const uword col) { - arma_debug_check_bounds( ((row >= n_elem) || (col > 0)), "spdiagview::operator(): out of bounds" ); + arma_conform_check_bounds( ((row >= n_elem) || (col > 0)), "spdiagview::operator(): out of bounds" ); return (const_cast< SpMat& >(m)).at(row+row_offset, row+col_offset); } @@ -872,7 +872,7 @@ inline eT spdiagview::operator()(const uword row, const uword col) const { - arma_debug_check_bounds( ((row >= n_elem) || (col > 0)), "spdiagview::operator(): out of bounds" ); + arma_conform_check_bounds( ((row >= n_elem) || (col > 0)), "spdiagview::operator(): out of bounds" ); return m.at(row+row_offset, row+col_offset); } @@ -884,11 +884,11 @@ inline void spdiagview::replace(const eT old_val, const eT new_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(old_val == eT(0)) { - arma_debug_warn_level(1, "spdiagview::replace(): replacement not done, as old_val = 0"); + arma_conform_warn(1, "spdiagview::replace(): replacement not done, as old_val = 0"); } else { @@ -907,7 +907,7 @@ inline void spdiagview::clean(const typename get_pod_type::result threshold) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat tmp(*this); @@ -923,7 +923,7 @@ inline void spdiagview::clamp(const eT min_val, const eT max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat tmp(*this); @@ -939,7 +939,7 @@ inline void spdiagview::fill(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if( (row_offset == 0) && (col_offset == 0) && (m.sync_state != 1) ) { @@ -1013,7 +1013,7 @@ inline void spdiagview::zeros() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).fill(eT(0)); } @@ -1025,7 +1025,7 @@ inline void spdiagview::ones() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).fill(eT(1)); } @@ -1037,15 +1037,19 @@ inline void spdiagview::randu() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat& x = const_cast< SpMat& >(m); const uword local_n_elem = n_elem; + Col tmp(local_n_elem, arma_nozeros_indicator()); + + tmp.randu(); + for(uword i=0; i < local_n_elem; ++i) { - x.at(i+row_offset, i+col_offset) = eT(arma_rng::randu()); + x.at(i+row_offset, i+col_offset) = tmp[i]; } } @@ -1056,15 +1060,19 @@ inline void spdiagview::randn() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); SpMat& x = const_cast< SpMat& >(m); const uword local_n_elem = n_elem; + Col tmp(local_n_elem, arma_nozeros_indicator()); + + tmp.randn(); + for(uword i=0; i < local_n_elem; ++i) { - x.at(i+row_offset, i+col_offset) = eT(arma_rng::randn()); + x.at(i+row_offset, i+col_offset) = tmp[i]; } } diff --git a/inst/include/armadillo_bits/spglue_join_meat.hpp b/inst/include/armadillo_bits/spglue_join_meat.hpp index 4a3e2441..74709434 100644 --- a/inst/include/armadillo_bits/spglue_join_meat.hpp +++ b/inst/include/armadillo_bits/spglue_join_meat.hpp @@ -26,7 +26,7 @@ inline void spglue_join_cols::apply(SpMat& out, const SpGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -54,7 +54,7 @@ inline void spglue_join_cols::apply_noalias(SpMat& out, const SpMat& A, const SpMat& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword A_n_rows = A.n_rows; const uword A_n_cols = A.n_cols; @@ -62,7 +62,7 @@ spglue_join_cols::apply_noalias(SpMat& out, const SpMat& A, const SpMat< const uword B_n_rows = B.n_rows; const uword B_n_cols = B.n_cols; - arma_debug_check + arma_conform_check ( ( (A_n_cols != B_n_cols) && ( (A_n_rows > 0) || (A_n_cols > 0) ) && ( (B_n_rows > 0) || (B_n_cols > 0) ) ), "join_cols() / join_vert(): number of columns must be the same" @@ -91,7 +91,7 @@ inline void spglue_join_cols::apply(SpMat& out, const SpBase& A_expr, const SpBase& B_expr, const SpBase& C_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat UA(A_expr.get_ref()); const unwrap_spmat UB(B_expr.get_ref()); @@ -104,9 +104,9 @@ spglue_join_cols::apply(SpMat& out, const SpBase& A_expr, const SpBas const uword out_n_rows = A.n_rows + B.n_rows + C.n_rows; const uword out_n_cols = (std::max)((std::max)(A.n_cols, B.n_cols), C.n_cols); - arma_debug_check( ((A.n_cols != out_n_cols) && ((A.n_rows > 0) || (A.n_cols > 0))), "join_cols() / join_vert(): number of columns must be the same" ); - arma_debug_check( ((B.n_cols != out_n_cols) && ((B.n_rows > 0) || (B.n_cols > 0))), "join_cols() / join_vert(): number of columns must be the same" ); - arma_debug_check( ((C.n_cols != out_n_cols) && ((C.n_rows > 0) || (C.n_cols > 0))), "join_cols() / join_vert(): number of columns must be the same" ); + arma_conform_check( ((A.n_cols != out_n_cols) && ((A.n_rows > 0) || (A.n_cols > 0))), "join_cols() / join_vert(): number of columns must be the same" ); + arma_conform_check( ((B.n_cols != out_n_cols) && ((B.n_rows > 0) || (B.n_cols > 0))), "join_cols() / join_vert(): number of columns must be the same" ); + arma_conform_check( ((C.n_cols != out_n_cols) && ((C.n_rows > 0) || (C.n_cols > 0))), "join_cols() / join_vert(): number of columns must be the same" ); out.set_size(out_n_rows, out_n_cols); @@ -133,7 +133,7 @@ inline void spglue_join_cols::apply(SpMat& out, const SpBase& A_expr, const SpBase& B_expr, const SpBase& C_expr, const SpBase& D_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat UA(A_expr.get_ref()); const unwrap_spmat UB(B_expr.get_ref()); @@ -148,10 +148,10 @@ spglue_join_cols::apply(SpMat& out, const SpBase& A_expr, const SpBas const uword out_n_rows = A.n_rows + B.n_rows + C.n_rows + D.n_rows; const uword out_n_cols = (std::max)(((std::max)((std::max)(A.n_cols, B.n_cols), C.n_cols)), D.n_cols); - arma_debug_check( ((A.n_cols != out_n_cols) && ((A.n_rows > 0) || (A.n_cols > 0))), "join_cols() / join_vert(): number of columns must be the same" ); - arma_debug_check( ((B.n_cols != out_n_cols) && ((B.n_rows > 0) || (B.n_cols > 0))), "join_cols() / join_vert(): number of columns must be the same" ); - arma_debug_check( ((C.n_cols != out_n_cols) && ((C.n_rows > 0) || (C.n_cols > 0))), "join_cols() / join_vert(): number of columns must be the same" ); - arma_debug_check( ((D.n_cols != out_n_cols) && ((D.n_rows > 0) || (D.n_cols > 0))), "join_cols() / join_vert(): number of columns must be the same" ); + arma_conform_check( ((A.n_cols != out_n_cols) && ((A.n_rows > 0) || (A.n_cols > 0))), "join_cols() / join_vert(): number of columns must be the same" ); + arma_conform_check( ((B.n_cols != out_n_cols) && ((B.n_rows > 0) || (B.n_cols > 0))), "join_cols() / join_vert(): number of columns must be the same" ); + arma_conform_check( ((C.n_cols != out_n_cols) && ((C.n_rows > 0) || (C.n_cols > 0))), "join_cols() / join_vert(): number of columns must be the same" ); + arma_conform_check( ((D.n_cols != out_n_cols) && ((D.n_rows > 0) || (D.n_cols > 0))), "join_cols() / join_vert(): number of columns must be the same" ); out.set_size(out_n_rows, out_n_cols); @@ -182,7 +182,7 @@ inline void spglue_join_rows::apply(SpMat& out, const SpGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -210,7 +210,7 @@ inline void spglue_join_rows::apply_noalias(SpMat& out, const SpMat& A, const SpMat& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword A_n_rows = A.n_rows; const uword A_n_cols = A.n_cols; @@ -220,7 +220,7 @@ spglue_join_rows::apply_noalias(SpMat& out, const SpMat& A, const SpMat< const uword B_n_cols = B.n_cols; const uword B_n_nz = B.n_nonzero; - arma_debug_check + arma_conform_check ( ( (A_n_rows != B.n_rows) && ( (A_n_rows > 0) || (A_n_cols > 0) ) && ( (B_n_rows > 0) || (B_n_cols > 0) ) ), "join_rows() / join_horiz(): number of rows must be the same" @@ -302,7 +302,7 @@ inline void spglue_join_rows::apply(SpMat& out, const SpBase& A_expr, const SpBase& B_expr, const SpBase& C_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat UA(A_expr.get_ref()); const unwrap_spmat UB(B_expr.get_ref()); @@ -325,7 +325,7 @@ inline void spglue_join_rows::apply(SpMat& out, const SpBase& A_expr, const SpBase& B_expr, const SpBase& C_expr, const SpBase& D_expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_spmat UA(A_expr.get_ref()); const unwrap_spmat UB(B_expr.get_ref()); diff --git a/inst/include/armadillo_bits/spglue_kron_meat.hpp b/inst/include/armadillo_bits/spglue_kron_meat.hpp index b45f3e76..03d697c5 100644 --- a/inst/include/armadillo_bits/spglue_kron_meat.hpp +++ b/inst/include/armadillo_bits/spglue_kron_meat.hpp @@ -26,7 +26,7 @@ inline void spglue_kron::apply(SpMat& out, const SpGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -54,7 +54,7 @@ inline void spglue_kron::apply_noalias(SpMat& out, const SpMat& A, const SpMat& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword A_n_rows = A.n_rows; const uword A_n_cols = A.n_cols; @@ -101,7 +101,7 @@ spglue_kron::apply_noalias(SpMat& out, const SpMat& A, const SpMat& // void // spglue_kron::apply(SpMat& out, const SpGlue& X) // { -// arma_extra_debug_sigprint(); +// arma_debug_sigprint(); // // typedef typename T1::elem_type eT; // diff --git a/inst/include/armadillo_bits/spglue_max_meat.hpp b/inst/include/armadillo_bits/spglue_max_meat.hpp index 4ee19a62..d6da17e1 100644 --- a/inst/include/armadillo_bits/spglue_max_meat.hpp +++ b/inst/include/armadillo_bits/spglue_max_meat.hpp @@ -26,7 +26,7 @@ inline void spglue_max::apply(SpMat& out, const SpGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -56,9 +56,9 @@ inline void spglue_max::apply_noalias(SpMat& out, const SpProxy& pa, const SpProxy& pb) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(pa.get_n_rows(), pa.get_n_cols(), pb.get_n_rows(), pb.get_n_cols(), "element-wise max()"); + arma_conform_assert_same_size(pa.get_n_rows(), pa.get_n_cols(), pb.get_n_rows(), pb.get_n_cols(), "element-wise max()"); const uword max_n_nonzero = pa.get_n_nonzero() + pb.get_n_nonzero(); @@ -159,7 +159,7 @@ inline void spglue_max::apply_noalias(SpMat& out, const SpMat& A, const SpMat& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy< SpMat > pa(A); const SpProxy< SpMat > pb(B); @@ -174,7 +174,7 @@ inline void spglue_max::dense_sparse_max(Mat& out, const Base& X, const SpBase& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: this function assumes there is no aliasing between matrix 'out' and X @@ -184,7 +184,7 @@ spglue_max::dense_sparse_max(Mat& out, const Base& X, const SpBase& sv, const SpMat& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(sv.n_elem == 0) { return; } @@ -198,7 +198,7 @@ inline void spglue_merge::subview_merge(SpSubview& sv, const Mat& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(sv.n_elem == 0) { return; } @@ -385,7 +385,7 @@ inline void spglue_merge::symmat_merge(SpMat& out, const SpMat& A, const SpMat& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out.reserve(A.n_rows, A.n_cols, 2*A.n_nonzero); // worst case scenario @@ -469,7 +469,7 @@ inline void spglue_merge::diagview_merge(SpMat& out, const SpMat& A, const SpMat& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: assuming that B has non-zero elements only on the main diagonal diff --git a/inst/include/armadillo_bits/spglue_min_meat.hpp b/inst/include/armadillo_bits/spglue_min_meat.hpp index cdfc1971..c1252480 100644 --- a/inst/include/armadillo_bits/spglue_min_meat.hpp +++ b/inst/include/armadillo_bits/spglue_min_meat.hpp @@ -26,7 +26,7 @@ inline void spglue_min::apply(SpMat& out, const SpGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -56,9 +56,9 @@ inline void spglue_min::apply_noalias(SpMat& out, const SpProxy& pa, const SpProxy& pb) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(pa.get_n_rows(), pa.get_n_cols(), pb.get_n_rows(), pb.get_n_cols(), "element-wise min()"); + arma_conform_assert_same_size(pa.get_n_rows(), pa.get_n_cols(), pb.get_n_rows(), pb.get_n_cols(), "element-wise min()"); const uword max_n_nonzero = pa.get_n_nonzero() + pb.get_n_nonzero(); @@ -159,7 +159,7 @@ inline void spglue_min::apply_noalias(SpMat& out, const SpMat& A, const SpMat& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy< SpMat > pa(A); const SpProxy< SpMat > pb(B); @@ -174,7 +174,7 @@ inline void spglue_min::dense_sparse_min(Mat& out, const Base& X, const SpBase& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: this function assumes there is no aliasing between matrix 'out' and X @@ -184,7 +184,7 @@ spglue_min::dense_sparse_min(Mat& out, const Base& X, const SpBase& out, const SpGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -56,9 +56,9 @@ inline void spglue_minus::apply_noalias(SpMat& out, const SpProxy& pa, const SpProxy& pb) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(pa.get_n_rows(), pa.get_n_cols(), pb.get_n_rows(), pb.get_n_cols(), "subtraction"); + arma_conform_assert_same_size(pa.get_n_rows(), pa.get_n_cols(), pb.get_n_rows(), pb.get_n_cols(), "subtraction"); if(pa.get_n_nonzero() == 0) { out = pb.Q; out *= eT(-1); return; } if(pb.get_n_nonzero() == 0) { out = pa.Q; return; } @@ -162,7 +162,7 @@ inline void spglue_minus::apply_noalias(SpMat& out, const SpMat& A, const SpMat& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy< SpMat > pa(A); const SpProxy< SpMat > pb(B); @@ -181,7 +181,7 @@ inline void spglue_minus_mixed::apply(SpMat::eT>& out, const mtSpGlue::eT, T1, T2, spglue_minus_mixed>& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -254,7 +254,7 @@ inline void spglue_minus_mixed::sparse_minus_dense(Mat< typename promote_type::result>& out, const T1& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -280,7 +280,7 @@ spglue_minus_mixed::sparse_minus_dense(Mat< typename promote_type pa(X); - arma_debug_assert_same_size( pa.get_n_rows(), pa.get_n_cols(), out.n_rows, out.n_cols, "subtraction" ); + arma_conform_assert_same_size( pa.get_n_rows(), pa.get_n_cols(), out.n_rows, out.n_cols, "subtraction" ); typename SpProxy::const_iterator_type it = pa.begin(); typename SpProxy::const_iterator_type it_end = pa.end(); @@ -299,7 +299,7 @@ inline void spglue_minus_mixed::dense_minus_sparse(Mat< typename promote_type::result>& out, const T1& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -323,7 +323,7 @@ spglue_minus_mixed::dense_minus_sparse(Mat< typename promote_type pb(Y); - arma_debug_assert_same_size( out.n_rows, out.n_cols, pb.get_n_rows(), pb.get_n_cols(), "subtraction" ); + arma_conform_assert_same_size( out.n_rows, out.n_cols, pb.get_n_rows(), pb.get_n_cols(), "subtraction" ); typename SpProxy::const_iterator_type it = pb.begin(); typename SpProxy::const_iterator_type it_end = pb.end(); diff --git a/inst/include/armadillo_bits/spglue_plus_meat.hpp b/inst/include/armadillo_bits/spglue_plus_meat.hpp index b8eada0b..389e8faa 100644 --- a/inst/include/armadillo_bits/spglue_plus_meat.hpp +++ b/inst/include/armadillo_bits/spglue_plus_meat.hpp @@ -26,7 +26,7 @@ inline void spglue_plus::apply(SpMat& out, const SpGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -56,9 +56,9 @@ inline void spglue_plus::apply_noalias(SpMat& out, const SpProxy& pa, const SpProxy& pb) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(pa.get_n_rows(), pa.get_n_cols(), pb.get_n_rows(), pb.get_n_cols(), "addition"); + arma_conform_assert_same_size(pa.get_n_rows(), pa.get_n_cols(), pb.get_n_rows(), pb.get_n_cols(), "addition"); if(pa.get_n_nonzero() == 0) { out = pb.Q; return; } if(pb.get_n_nonzero() == 0) { out = pa.Q; return; } @@ -162,7 +162,7 @@ inline void spglue_plus::apply_noalias(SpMat& out, const SpMat& A, const SpMat& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy< SpMat > pa(A); const SpProxy< SpMat > pb(B); @@ -181,7 +181,7 @@ inline void spglue_plus_mixed::apply(SpMat::eT>& out, const mtSpGlue::eT, T1, T2, spglue_plus_mixed>& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -254,7 +254,7 @@ inline void spglue_plus_mixed::dense_plus_sparse(Mat< typename promote_type::result>& out, const T1& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -278,7 +278,7 @@ spglue_plus_mixed::dense_plus_sparse(Mat< typename promote_type pb(Y); - arma_debug_assert_same_size( out.n_rows, out.n_cols, pb.get_n_rows(), pb.get_n_cols(), "addition" ); + arma_conform_assert_same_size( out.n_rows, out.n_cols, pb.get_n_rows(), pb.get_n_cols(), "addition" ); typename SpProxy::const_iterator_type it = pb.begin(); typename SpProxy::const_iterator_type it_end = pb.end(); diff --git a/inst/include/armadillo_bits/spglue_relational_meat.hpp b/inst/include/armadillo_bits/spglue_relational_meat.hpp index 92564abc..310af450 100644 --- a/inst/include/armadillo_bits/spglue_relational_meat.hpp +++ b/inst/include/armadillo_bits/spglue_relational_meat.hpp @@ -26,7 +26,7 @@ inline void spglue_rel_lt::apply(SpMat& out, const mtSpGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy PA(X.A); const SpProxy PB(X.B); @@ -54,11 +54,11 @@ inline void spglue_rel_lt::apply_noalias(SpMat& out, const SpProxy& PA, const SpProxy& PB) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; - arma_debug_assert_same_size(PA.get_n_rows(), PA.get_n_cols(), PB.get_n_rows(), PB.get_n_cols(), "operator<"); + arma_conform_assert_same_size(PA.get_n_rows(), PA.get_n_cols(), PB.get_n_rows(), PB.get_n_cols(), "operator<"); const uword max_n_nonzero = PA.get_n_nonzero() + PB.get_n_nonzero(); @@ -163,7 +163,7 @@ inline void spglue_rel_gt::apply(SpMat& out, const mtSpGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy PA(X.A); const SpProxy PB(X.B); @@ -191,11 +191,11 @@ inline void spglue_rel_gt::apply_noalias(SpMat& out, const SpProxy& PA, const SpProxy& PB) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; - arma_debug_assert_same_size(PA.get_n_rows(), PA.get_n_cols(), PB.get_n_rows(), PB.get_n_cols(), "operator>"); + arma_conform_assert_same_size(PA.get_n_rows(), PA.get_n_cols(), PB.get_n_rows(), PB.get_n_cols(), "operator>"); const uword max_n_nonzero = PA.get_n_nonzero() + PB.get_n_nonzero(); @@ -300,7 +300,7 @@ inline void spglue_rel_and::apply(SpMat& out, const mtSpGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy PA(X.A); const SpProxy PB(X.B); @@ -328,11 +328,11 @@ inline void spglue_rel_and::apply_noalias(SpMat& out, const SpProxy& PA, const SpProxy& PB) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; - arma_debug_assert_same_size(PA.get_n_rows(), PA.get_n_cols(), PB.get_n_rows(), PB.get_n_cols(), "operator&&"); + arma_conform_assert_same_size(PA.get_n_rows(), PA.get_n_cols(), PB.get_n_rows(), PB.get_n_cols(), "operator&&"); if( (PA.get_n_nonzero() == 0) || (PB.get_n_nonzero() == 0) ) { @@ -425,7 +425,7 @@ inline void spglue_rel_or::apply(SpMat& out, const mtSpGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy PA(X.A); const SpProxy PB(X.B); @@ -453,11 +453,11 @@ inline void spglue_rel_or::apply_noalias(SpMat& out, const SpProxy& PA, const SpProxy& PB) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; - arma_debug_assert_same_size(PA.get_n_rows(), PA.get_n_cols(), PB.get_n_rows(), PB.get_n_cols(), "operator||"); + arma_conform_assert_same_size(PA.get_n_rows(), PA.get_n_cols(), PB.get_n_rows(), PB.get_n_cols(), "operator||"); const uword max_n_nonzero = PA.get_n_nonzero() + PB.get_n_nonzero(); diff --git a/inst/include/armadillo_bits/spglue_schur_meat.hpp b/inst/include/armadillo_bits/spglue_schur_meat.hpp index 1ad8a8f9..b8ed3193 100644 --- a/inst/include/armadillo_bits/spglue_schur_meat.hpp +++ b/inst/include/armadillo_bits/spglue_schur_meat.hpp @@ -26,7 +26,7 @@ inline void spglue_schur::apply(SpMat& out, const SpGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -56,9 +56,9 @@ inline void spglue_schur::apply_noalias(SpMat& out, const SpProxy& pa, const SpProxy& pb) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(pa.get_n_rows(), pa.get_n_cols(), pb.get_n_rows(), pb.get_n_cols(), "element-wise multiplication"); + arma_conform_assert_same_size(pa.get_n_rows(), pa.get_n_cols(), pb.get_n_rows(), pb.get_n_cols(), "element-wise multiplication"); if( (pa.get_n_nonzero() == 0) || (pb.get_n_nonzero() == 0) ) { @@ -152,7 +152,7 @@ inline void spglue_schur::apply_noalias(SpMat& out, const SpMat& A, const SpMat& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy< SpMat > pa(A); const SpProxy< SpMat > pb(B); @@ -173,14 +173,14 @@ inline void spglue_schur_misc::dense_schur_sparse(SpMat& out, const T1& x, const T2& y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const Proxy pa(x); const SpProxy pb(y); - arma_debug_assert_same_size(pa.get_n_rows(), pa.get_n_cols(), pb.get_n_rows(), pb.get_n_cols(), "element-wise multiplication"); + arma_conform_assert_same_size(pa.get_n_rows(), pa.get_n_cols(), pb.get_n_rows(), pb.get_n_cols(), "element-wise multiplication"); const uword max_n_nonzero = pb.get_n_nonzero(); @@ -245,7 +245,7 @@ inline void spglue_schur_mixed::apply(SpMat::eT>& out, const mtSpGlue::eT, T1, T2, spglue_schur_mixed>& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -318,7 +318,7 @@ inline void spglue_schur_mixed::dense_schur_sparse(SpMat< typename promote_type::result>& out, const T1& X, const T2& Y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; @@ -330,7 +330,7 @@ spglue_schur_mixed::dense_schur_sparse(SpMat< typename promote_type pa(X); const SpProxy pb(Y); - arma_debug_assert_same_size(pa.get_n_rows(), pa.get_n_cols(), pb.get_n_rows(), pb.get_n_cols(), "element-wise multiplication"); + arma_conform_assert_same_size(pa.get_n_rows(), pa.get_n_cols(), pb.get_n_rows(), pb.get_n_cols(), "element-wise multiplication"); // count new size uword new_n_nonzero = 0; diff --git a/inst/include/armadillo_bits/spglue_times_meat.hpp b/inst/include/armadillo_bits/spglue_times_meat.hpp index 852dcad6..80d40cbf 100644 --- a/inst/include/armadillo_bits/spglue_times_meat.hpp +++ b/inst/include/armadillo_bits/spglue_times_meat.hpp @@ -26,7 +26,7 @@ inline void spglue_times::apply(SpMat& out, const SpGlue& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -56,7 +56,7 @@ inline void spglue_times::apply(SpMat& out, const SpGlue,T2,spglue_times>& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -88,14 +88,14 @@ inline void spglue_times::apply_noalias(SpMat& c, const SpMat& x, const SpMat& y) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword x_n_rows = x.n_rows; const uword x_n_cols = x.n_cols; const uword y_n_rows = y.n_rows; const uword y_n_cols = y.n_cols; - arma_debug_assert_mul_size(x_n_rows, x_n_cols, y_n_rows, y_n_cols, "matrix multiplication"); + arma_conform_assert_mul_size(x_n_rows, x_n_cols, y_n_rows, y_n_cols, "matrix multiplication"); // First we must determine the structure of the new matrix (column pointers). // This follows the algorithm described in 'Sparse Matrix Multiplication @@ -300,7 +300,7 @@ inline void spglue_times_mixed::apply(SpMat::eT>& out, const mtSpGlue::eT, T1, T2, spglue_times_mixed>& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; diff --git a/inst/include/armadillo_bits/spop_diagmat_meat.hpp b/inst/include/armadillo_bits/spop_diagmat_meat.hpp index a6f9faf9..85423942 100644 --- a/inst/include/armadillo_bits/spop_diagmat_meat.hpp +++ b/inst/include/armadillo_bits/spop_diagmat_meat.hpp @@ -26,7 +26,7 @@ inline void spop_diagmat::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -51,7 +51,7 @@ inline void spop_diagmat::apply_noalias(SpMat& out, const SpBase& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -142,7 +142,7 @@ inline void spop_diagmat::apply_noalias(SpMat& out, const SpGlue& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -152,7 +152,7 @@ spop_diagmat::apply_noalias(SpMat& out, const SpGlue& A = UA.M; const SpMat& B = UB.M; - arma_debug_assert_same_size(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "addition"); + arma_conform_assert_same_size(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "addition"); const bool is_vec = (A.n_rows == 1) || (A.n_cols == 1); @@ -187,7 +187,7 @@ inline void spop_diagmat::apply_noalias(SpMat& out, const SpGlue& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -197,7 +197,7 @@ spop_diagmat::apply_noalias(SpMat& out, const SpGlue& A = UA.M; const SpMat& B = UB.M; - arma_debug_assert_same_size(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "subtraction"); + arma_conform_assert_same_size(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "subtraction"); const bool is_vec = (A.n_rows == 1) || (A.n_cols == 1); @@ -232,7 +232,7 @@ inline void spop_diagmat::apply_noalias(SpMat& out, const SpGlue& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -242,7 +242,7 @@ spop_diagmat::apply_noalias(SpMat& out, const SpGlue& A = UA.M; const SpMat& B = UB.M; - arma_debug_assert_same_size(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "element-wise multiplication"); + arma_conform_assert_same_size(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "element-wise multiplication"); const bool is_vec = (A.n_rows == 1) || (A.n_cols == 1); @@ -277,7 +277,7 @@ inline void spop_diagmat::apply_noalias(SpMat& out, const SpGlue& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -287,7 +287,7 @@ spop_diagmat::apply_noalias(SpMat& out, const SpGlue& A = UA.M; const SpMat& B = UB.M; - arma_debug_assert_mul_size(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication"); + arma_conform_assert_mul_size(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication"); const uword C_n_rows = A.n_rows; const uword C_n_cols = B.n_cols; @@ -349,7 +349,7 @@ inline void spop_diagmat2::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -379,7 +379,7 @@ inline void spop_diagmat2::apply_noalias(SpMat& out, const SpMat& X, const uword row_offset, const uword col_offset) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_rows = X.n_rows; const uword n_cols = X.n_cols; @@ -427,7 +427,7 @@ spop_diagmat2::apply_noalias(SpMat& out, const SpMat& X, const uword row } else // generate a diagonal matrix out of a matrix { - arma_debug_check_bounds + arma_conform_check_bounds ( ((row_offset > 0) && (row_offset >= n_rows)) || ((col_offset > 0) && (col_offset >= n_cols)), "diagmat(): requested diagonal out of bounds" diff --git a/inst/include/armadillo_bits/spop_htrans_meat.hpp b/inst/include/armadillo_bits/spop_htrans_meat.hpp index 624d3995..108207fe 100644 --- a/inst/include/armadillo_bits/spop_htrans_meat.hpp +++ b/inst/include/armadillo_bits/spop_htrans_meat.hpp @@ -26,7 +26,7 @@ inline void spop_htrans::apply(SpMat& out, const SpOp& in, const typename arma_not_cx::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); spop_strans::apply(out, in); @@ -39,7 +39,7 @@ inline void spop_htrans::apply(SpMat& out, const SpOp& in, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/spop_misc_bones.hpp b/inst/include/armadillo_bits/spop_misc_bones.hpp index ed62df20..e8a4c721 100644 --- a/inst/include/armadillo_bits/spop_misc_bones.hpp +++ b/inst/include/armadillo_bits/spop_misc_bones.hpp @@ -240,17 +240,6 @@ class spop_sign -class spop_diagvec - : public traits_op_col - { - public: - - template - inline static void apply(SpMat& out, const SpOp& in); - }; - - - class spop_flipud : public traits_op_passthru { diff --git a/inst/include/armadillo_bits/spop_misc_meat.hpp b/inst/include/armadillo_bits/spop_misc_meat.hpp index 78b8636a..3560ffce 100644 --- a/inst/include/armadillo_bits/spop_misc_meat.hpp +++ b/inst/include/armadillo_bits/spop_misc_meat.hpp @@ -41,7 +41,7 @@ inline void spop_scalar_times::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -81,7 +81,7 @@ inline void spop_cx_scalar_times::apply(SpMat< std::complex >& out, const mtSpOp< std::complex, T1, spop_cx_scalar_times >& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::pod_type T; typedef typename std::complex out_eT; @@ -116,7 +116,7 @@ inline void spop_square::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out.init_xform(in.m, priv::functor_square()); } @@ -139,7 +139,7 @@ inline void spop_sqrt::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out.init_xform(in.m, priv::functor_sqrt()); } @@ -162,7 +162,7 @@ inline void spop_cbrt::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out.init_xform(in.m, priv::functor_cbrt()); } @@ -185,7 +185,7 @@ inline void spop_abs::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out.init_xform(in.m, priv::functor_abs()); } @@ -208,7 +208,7 @@ inline void spop_cx_abs::apply(SpMat& out, const mtSpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out.init_xform_mt(in.m, priv::functor_cx_abs()); } @@ -231,7 +231,7 @@ inline void spop_arg::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out.init_xform(in.m, priv::functor_arg()); } @@ -254,7 +254,7 @@ inline void spop_cx_arg::apply(SpMat& out, const mtSpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out.init_xform_mt(in.m, priv::functor_cx_arg()); } @@ -277,7 +277,7 @@ inline void spop_real::apply(SpMat& out, const mtSpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out.init_xform_mt(in.m, priv::functor_real()); } @@ -300,7 +300,7 @@ inline void spop_imag::apply(SpMat& out, const mtSpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out.init_xform_mt(in.m, priv::functor_imag()); } @@ -323,7 +323,7 @@ inline void spop_conj::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out.init_xform(in.m, priv::functor_conj()); } @@ -335,7 +335,7 @@ inline void spop_repelem::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -392,7 +392,7 @@ inline void spop_reshape::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out = in.m; @@ -406,7 +406,7 @@ inline void spop_resize::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out = in.m; @@ -431,7 +431,7 @@ inline void spop_floor::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out.init_xform(in.m, priv::functor_floor()); } @@ -454,7 +454,7 @@ inline void spop_ceil::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out.init_xform(in.m, priv::functor_ceil()); } @@ -477,7 +477,7 @@ inline void spop_round::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out.init_xform(in.m, priv::functor_round()); } @@ -500,7 +500,7 @@ inline void spop_trunc::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out.init_xform(in.m, priv::functor_trunc()); } @@ -523,81 +523,19 @@ inline void spop_sign::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out.init_xform(in.m, priv::functor_sign()); } -template -inline -void -spop_diagvec::apply(SpMat& out, const SpOp& in) - { - arma_extra_debug_sigprint(); - - typedef typename T1::elem_type eT; - - const unwrap_spmat U(in.m); - - const SpMat& X = U.M; - - const uword a = in.aux_uword_a; - const uword b = in.aux_uword_b; - - const uword row_offset = (b > 0) ? a : 0; - const uword col_offset = (b == 0) ? a : 0; - - arma_debug_check_bounds - ( - ((row_offset > 0) && (row_offset >= X.n_rows)) || ((col_offset > 0) && (col_offset >= X.n_cols)), - "diagvec(): requested diagonal out of bounds" - ); - - const uword len = (std::min)(X.n_rows - row_offset, X.n_cols - col_offset); - - Col cache(len, arma_nozeros_indicator()); - eT* cache_mem = cache.memptr(); - - uword n_nonzero = 0; - - for(uword i=0; i < len; ++i) - { - const eT val = X.at(i + row_offset, i + col_offset); - - cache_mem[i] = val; - - n_nonzero += (val != eT(0)) ? uword(1) : uword(0); - } - - out.reserve(len, 1, n_nonzero); - - uword count = 0; - for(uword i=0; i < len; ++i) - { - const eT val = cache_mem[i]; - - if(val != eT(0)) - { - access::rw(out.row_indices[count]) = i; - access::rw(out.values[count]) = val; - ++count; - } - } - - access::rw(out.col_ptrs[0]) = 0; - access::rw(out.col_ptrs[1]) = n_nonzero; - } - - - template inline void spop_flipud::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out = reverse(in.m, 0); } @@ -609,7 +547,7 @@ inline void spop_fliplr::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); out = reverse(in.m, 1); } diff --git a/inst/include/armadillo_bits/spop_norm_meat.hpp b/inst/include/armadillo_bits/spop_norm_meat.hpp index 85485068..517c0da8 100644 --- a/inst/include/armadillo_bits/spop_norm_meat.hpp +++ b/inst/include/armadillo_bits/spop_norm_meat.hpp @@ -26,7 +26,7 @@ inline typename get_pod_type::result spop_norm::mat_norm_1(const SpMat& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // TODO: this can be sped up with a dedicated implementation return as_scalar( max( sum(abs(X), 0), 1) ); @@ -39,7 +39,7 @@ inline typename get_pod_type::result spop_norm::mat_norm_2(const SpMat& X, const typename arma_real_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); // norm = sqrt( largest eigenvalue of (A^H)*A ), where ^H is the conjugate transpose @@ -68,7 +68,7 @@ inline typename get_pod_type::result spop_norm::mat_norm_2(const SpMat& X, const typename arma_cx_only::result* junk) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); typedef typename get_pod_type::result T; @@ -102,7 +102,7 @@ inline typename get_pod_type::result spop_norm::mat_norm_inf(const SpMat& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // TODO: this can be sped up with a dedicated implementation return as_scalar( max( sum(abs(X), 1), 0) ); @@ -115,9 +115,9 @@ inline typename get_pod_type::result spop_norm::vec_norm_k(const eT* mem, const uword N, const uword k) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (k == 0), "norm(): unsupported vector norm type" ); + arma_conform_check( (k == 0), "norm(): unsupported vector norm type" ); // create a fake dense vector to allow reuse of code for dense vectors Col fake_vector( access::rwp(mem), N, false ); diff --git a/inst/include/armadillo_bits/spop_normalise_meat.hpp b/inst/include/armadillo_bits/spop_normalise_meat.hpp index 96a1759d..d580a5f8 100644 --- a/inst/include/armadillo_bits/spop_normalise_meat.hpp +++ b/inst/include/armadillo_bits/spop_normalise_meat.hpp @@ -26,15 +26,15 @@ inline void spop_normalise::apply(SpMat& out, const SpOp& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const uword p = expr.aux_uword_a; const uword dim = expr.aux_uword_b; - arma_debug_check( (p == 0), "normalise(): unsupported vector norm type" ); - arma_debug_check( (dim > 1), "normalise(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (p == 0), "normalise(): unsupported vector norm type" ); + arma_conform_check( (dim > 1), "normalise(): parameter 'dim' must be 0 or 1" ); const unwrap_spmat U(expr.m); @@ -69,7 +69,7 @@ inline void spop_normalise::apply_direct(SpMat& out, const SpMat& X, const uword p) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; diff --git a/inst/include/armadillo_bits/spop_repmat_meat.hpp b/inst/include/armadillo_bits/spop_repmat_meat.hpp index 4c09a3ea..ad810937 100644 --- a/inst/include/armadillo_bits/spop_repmat_meat.hpp +++ b/inst/include/armadillo_bits/spop_repmat_meat.hpp @@ -26,7 +26,7 @@ inline void spop_repmat::apply(SpMat& out, const SpOp& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -53,7 +53,7 @@ inline void spop_repmat::apply_noalias(SpMat& out, const uword A_n_rows, const uword A_n_cols, const SpMat& B) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword B_n_rows = B.n_rows; const uword B_n_cols = B.n_cols; @@ -95,7 +95,7 @@ spop_repmat::apply_noalias(SpMat& out, const uword A_n_rows, const uword A_n // void // spop_repmat::apply(SpMat& out, const SpOp& in) // { -// arma_extra_debug_sigprint(); +// arma_debug_sigprint(); // // typedef typename T1::elem_type eT; // diff --git a/inst/include/armadillo_bits/spop_reverse_meat.hpp b/inst/include/armadillo_bits/spop_reverse_meat.hpp index 2ba6e45c..5f888874 100644 --- a/inst/include/armadillo_bits/spop_reverse_meat.hpp +++ b/inst/include/armadillo_bits/spop_reverse_meat.hpp @@ -26,7 +26,7 @@ inline void spop_reverse::apply_spmat(SpMat& out, const SpMat& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword X_n_rows = X.n_rows; const uword X_n_cols = X.n_cols; @@ -90,7 +90,7 @@ inline void spop_reverse::apply_proxy(SpMat& out, const T1& X, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -162,11 +162,11 @@ inline void spop_reverse::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword dim = in.aux_uword_a; - arma_debug_check( (dim > 1), "reverse(): parameter 'dim' must be 0 or 1" ); + arma_conform_check( (dim > 1), "reverse(): parameter 'dim' must be 0 or 1" ); if(is_SpMat::value) { diff --git a/inst/include/armadillo_bits/spop_shift_meat.hpp b/inst/include/armadillo_bits/spop_shift_meat.hpp index 1fd14aa0..f75c2542 100644 --- a/inst/include/armadillo_bits/spop_shift_meat.hpp +++ b/inst/include/armadillo_bits/spop_shift_meat.hpp @@ -27,10 +27,10 @@ inline void spop_shift::apply_noalias(SpMat& out, const SpMat& X, const uword len, const uword neg, const uword dim) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( ((dim == 0) && (len >= X.n_rows)), "shift(): shift amount out of bounds" ); - arma_debug_check_bounds( ((dim == 1) && (len >= X.n_cols)), "shift(): shift amount out of bounds" ); + arma_conform_check_bounds( ((dim == 0) && (len >= X.n_rows)), "shift(): shift amount out of bounds" ); + arma_conform_check_bounds( ((dim == 1) && (len >= X.n_cols)), "shift(): shift amount out of bounds" ); if(X.n_nonzero == 0) { out.zeros(X.n_rows, X.n_cols); return; } diff --git a/inst/include/armadillo_bits/spop_strans_meat.hpp b/inst/include/armadillo_bits/spop_strans_meat.hpp index 4cb83c9c..18166d6f 100644 --- a/inst/include/armadillo_bits/spop_strans_meat.hpp +++ b/inst/include/armadillo_bits/spop_strans_meat.hpp @@ -26,7 +26,7 @@ inline void spop_strans::apply_noalias(SpMat& B, const SpMat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); B.reserve(A.n_cols, A.n_rows, A.n_nonzero); // deliberately swapped @@ -99,7 +99,7 @@ inline void spop_strans::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -127,7 +127,7 @@ inline void spop_strans::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; diff --git a/inst/include/armadillo_bits/spop_symmat_meat.hpp b/inst/include/armadillo_bits/spop_symmat_meat.hpp index 2ce7cbaa..8ce7d460 100644 --- a/inst/include/armadillo_bits/spop_symmat_meat.hpp +++ b/inst/include/armadillo_bits/spop_symmat_meat.hpp @@ -26,14 +26,14 @@ inline void spop_symmat::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const unwrap_spmat U(in.m); const SpMat& X = U.M; - arma_debug_check( (X.n_rows != X.n_cols), "symmatu()/symmatl(): given matrix must be square sized" ); + arma_conform_check( (X.n_rows != X.n_cols), "symmatu()/symmatl(): given matrix must be square sized" ); if(X.n_nonzero == uword(0)) { out.zeros(X.n_rows, X.n_cols); return; } @@ -52,14 +52,14 @@ inline void spop_symmat_cx::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const unwrap_spmat U(in.m); const SpMat& X = U.M; - arma_debug_check( (X.n_rows != X.n_cols), "symmatu()/symmatl(): given matrix must be square sized" ); + arma_conform_check( (X.n_rows != X.n_cols), "symmatu()/symmatl(): given matrix must be square sized" ); if(X.n_nonzero == uword(0)) { out.zeros(X.n_rows, X.n_cols); return; } diff --git a/inst/include/armadillo_bits/spop_trimat_meat.hpp b/inst/include/armadillo_bits/spop_trimat_meat.hpp index 548b8e8a..4fd53d8b 100644 --- a/inst/include/armadillo_bits/spop_trimat_meat.hpp +++ b/inst/include/armadillo_bits/spop_trimat_meat.hpp @@ -26,7 +26,7 @@ inline void spop_trimat::apply_noalias(SpMat& out, const SpProxy& P, const bool upper) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typename SpProxy::const_iterator_type it = P.begin(); @@ -117,13 +117,13 @@ inline void spop_trimat::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const SpProxy P(in.m); - arma_debug_check( (P.get_n_rows() != P.get_n_cols()), "trimatu()/trimatl(): given matrix must be square sized" ); + 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); @@ -150,12 +150,12 @@ inline void spop_trimatu_ext::apply_noalias(SpMat& out, const SpMat& A, const uword row_offset, const uword col_offset) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_rows = A.n_rows; const uword n_cols = A.n_cols; - arma_debug_check_bounds( ((row_offset > 0) && (row_offset >= n_rows)) || ((col_offset > 0) && (col_offset >= n_cols)), "trimatu(): requested diagonal is out of bounds" ); + arma_conform_check_bounds( ((row_offset > 0) && (row_offset >= n_rows)) || ((col_offset > 0) && (col_offset >= n_cols)), "trimatu(): requested diagonal is out of bounds" ); if(A.n_nonzero == 0) { out.zeros(n_rows, n_cols); return; } @@ -231,14 +231,14 @@ inline void spop_trimatu_ext::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const unwrap_spmat U(in.m); const SpMat& A = U.M; - arma_debug_check( (A.is_square() == false), "trimatu(): given matrix must be square sized" ); + arma_conform_check( (A.is_square() == false), "trimatu(): given matrix must be square sized" ); const uword row_offset = in.aux_uword_a; const uword col_offset = in.aux_uword_b; @@ -266,12 +266,12 @@ inline void spop_trimatl_ext::apply_noalias(SpMat& out, const SpMat& A, const uword row_offset, const uword col_offset) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword n_rows = A.n_rows; const uword n_cols = A.n_cols; - arma_debug_check_bounds( ((row_offset > 0) && (row_offset >= n_rows)) || ((col_offset > 0) && (col_offset >= n_cols)), "trimatl(): requested diagonal is out of bounds" ); + arma_conform_check_bounds( ((row_offset > 0) && (row_offset >= n_rows)) || ((col_offset > 0) && (col_offset >= n_cols)), "trimatl(): requested diagonal is out of bounds" ); if(A.n_nonzero == 0) { out.zeros(n_rows, n_cols); return; } @@ -337,14 +337,14 @@ inline void spop_trimatl_ext::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; const unwrap_spmat U(in.m); const SpMat& A = U.M; - arma_debug_check( (A.is_square() == false), "trimatl(): given matrix must be square sized" ); + arma_conform_check( (A.is_square() == false), "trimatl(): given matrix must be square sized" ); const uword row_offset = in.aux_uword_a; const uword col_offset = in.aux_uword_b; diff --git a/inst/include/armadillo_bits/spop_vectorise_meat.hpp b/inst/include/armadillo_bits/spop_vectorise_meat.hpp index 56733901..279d1b2e 100644 --- a/inst/include/armadillo_bits/spop_vectorise_meat.hpp +++ b/inst/include/armadillo_bits/spop_vectorise_meat.hpp @@ -27,7 +27,7 @@ inline void spop_vectorise_col::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); spop_vectorise_col::apply_direct(out, in.m); } @@ -39,7 +39,7 @@ inline void spop_vectorise_col::apply_direct(SpMat& out, const T1& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -66,7 +66,7 @@ inline void spop_vectorise_row::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); spop_vectorise_row::apply_direct(out, in.m); } @@ -78,7 +78,7 @@ inline void spop_vectorise_row::apply_direct(SpMat& out, const T1& expr) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename T1::elem_type eT; @@ -107,7 +107,7 @@ inline void spop_vectorise_all::apply(SpMat& out, const SpOp& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword dim = in.aux_uword_a; diff --git a/inst/include/armadillo_bits/spsolve_factoriser_meat.hpp b/inst/include/armadillo_bits/spsolve_factoriser_meat.hpp index 4450a15c..09744900 100644 --- a/inst/include/armadillo_bits/spsolve_factoriser_meat.hpp +++ b/inst/include/armadillo_bits/spsolve_factoriser_meat.hpp @@ -26,7 +26,7 @@ inline void spsolve_factoriser::delete_worker() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(worker_ptr != nullptr) { @@ -44,7 +44,7 @@ inline void spsolve_factoriser::cleanup() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); #if defined(ARMA_USE_SUPERLU) { @@ -66,7 +66,7 @@ spsolve_factoriser::cleanup() inline spsolve_factoriser::~spsolve_factoriser() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); cleanup(); } @@ -76,7 +76,7 @@ spsolve_factoriser::~spsolve_factoriser() inline spsolve_factoriser::spsolve_factoriser() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } @@ -85,7 +85,7 @@ inline void spsolve_factoriser::reset() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); cleanup(); } @@ -96,7 +96,7 @@ inline double spsolve_factoriser::rcond() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return rcond_value; } @@ -113,7 +113,7 @@ spsolve_factoriser::factorise const typename arma_blas_type_only::result* junk ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); #if defined(ARMA_USE_SUPERLU) @@ -134,7 +134,7 @@ spsolve_factoriser::factorise if(A.is_square() == false) { - arma_debug_warn_level(1, "spsolve_factoriser::factorise(): solving under-determined / over-determined systems is currently not supported"); + arma_conform_warn(1, "spsolve_factoriser::factorise(): solving under-determined / over-determined systems is currently not supported"); return false; } @@ -148,7 +148,7 @@ spsolve_factoriser::factorise if( (opts.pivot_thresh < double(0)) || (opts.pivot_thresh > double(1)) ) { - arma_debug_warn_level(1, "spsolve_factoriser::factorise(): pivot_thresh must be in the [0,1] interval" ); + arma_conform_warn(1, "spsolve_factoriser::factorise(): pivot_thresh must be in the [0,1] interval" ); return false; } @@ -158,7 +158,7 @@ spsolve_factoriser::factorise if(worker_ptr == nullptr) { - arma_debug_warn_level(3, "spsolve_factoriser::factorise(): could not construct worker object"); + arma_conform_warn(3, "spsolve_factoriser::factorise(): could not construct worker object"); return false; } @@ -184,7 +184,7 @@ spsolve_factoriser::factorise if( (status == false) || arma_isnan(local_rcond_value) || ((opts.allow_ugly == false) && (local_rcond_value < std::numeric_limits::epsilon())) ) { - arma_debug_warn_level(3, "spsolve_factoriser::factorise(): factorisation failed; rcond: ", local_rcond_value); + arma_conform_warn(3, "spsolve_factoriser::factorise(): factorisation failed; rcond: ", local_rcond_value); delete_worker(); return false; } @@ -213,7 +213,7 @@ spsolve_factoriser::solve const typename arma_blas_type_only::result* junk ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_ignore(junk); #if defined(ARMA_USE_SUPERLU) @@ -224,7 +224,7 @@ spsolve_factoriser::solve if(worker_ptr == nullptr) { - arma_debug_warn_level(2, "spsolve_factoriser::solve(): no factorisation available"); + arma_conform_warn(2, "spsolve_factoriser::solve(): no factorisation available"); X.soft_reset(); return false; } @@ -238,7 +238,7 @@ spsolve_factoriser::solve if(type_mismatch) { - arma_debug_warn_level(1, "spsolve_factoriser::solve(): matrix type mismatch"); + arma_conform_warn(1, "spsolve_factoriser::solve(): matrix type mismatch"); X.soft_reset(); return false; } @@ -248,7 +248,7 @@ spsolve_factoriser::solve if(n_rows != B.n_rows) { - arma_debug_warn_level(1, "spsolve_factoriser::solve(): matrix size mismatch"); + arma_conform_warn(1, "spsolve_factoriser::solve(): matrix size mismatch"); X.soft_reset(); return false; } @@ -267,7 +267,7 @@ spsolve_factoriser::solve if(status == false) { - arma_debug_warn_level(3, "spsolve_factoriser::solve(): solution not found"); + arma_conform_warn(3, "spsolve_factoriser::solve(): solution not found"); X.soft_reset(); return false; } diff --git a/inst/include/armadillo_bits/strip.hpp b/inst/include/armadillo_bits/strip.hpp index 73850c58..6e1e6715 100644 --- a/inst/include/armadillo_bits/strip.hpp +++ b/inst/include/armadillo_bits/strip.hpp @@ -30,7 +30,7 @@ struct strip_diagmat strip_diagmat(const T1& X) : M(X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } static constexpr bool do_diagmat = false; @@ -49,7 +49,7 @@ struct strip_diagmat< Op > strip_diagmat(const Op& X) : M(X.m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } static constexpr bool do_diagmat = true; @@ -68,7 +68,7 @@ struct strip_inv strip_inv(const T1& X) : M(X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const T1& M; @@ -88,7 +88,7 @@ struct strip_inv< Op > strip_inv(const Op& X) : M(X.m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const T1& M; @@ -108,7 +108,7 @@ struct strip_inv< Op > strip_inv(const Op& X) : M(X.m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const T1& M; @@ -134,7 +134,7 @@ struct strip_trimat strip_trimat(const T1& X) : M(X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } }; @@ -158,7 +158,7 @@ struct strip_trimat< Op > , do_triu(X.aux_uword_a == 0) , do_tril(X.aux_uword_a == 1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } }; @@ -177,7 +177,7 @@ struct sp_strip_trans sp_strip_trans(const T1& X) : M(X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } static constexpr bool do_htrans = false; @@ -197,7 +197,7 @@ struct sp_strip_trans< SpOp > sp_strip_trans(const SpOp& X) : M(X.m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } static constexpr bool do_htrans = true; @@ -217,7 +217,7 @@ struct sp_strip_trans< SpOp > sp_strip_trans(const SpOp& X) : M(X.m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } static constexpr bool do_htrans = false; diff --git a/inst/include/armadillo_bits/subview_cube_each_meat.hpp b/inst/include/armadillo_bits/subview_cube_each_meat.hpp index a3069182..edac828c 100644 --- a/inst/include/armadillo_bits/subview_cube_each_meat.hpp +++ b/inst/include/armadillo_bits/subview_cube_each_meat.hpp @@ -29,7 +29,7 @@ inline subview_cube_each_common::subview_cube_each_common(const Cube& in_p) : P(in_p) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -40,7 +40,7 @@ inline void subview_cube_each_common::check_size(const Mat& A) const { - if(arma_config::debug) + if(arma_config::check_conformance) { if( (A.n_rows != P.n_rows) || (A.n_cols != P.n_cols) ) { @@ -76,7 +76,7 @@ template inline subview_cube_each1::~subview_cube_each1() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -86,7 +86,7 @@ inline subview_cube_each1::subview_cube_each1(const Cube& in_p) : subview_cube_each_common::subview_cube_each_common(in_p) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -97,7 +97,7 @@ inline void subview_cube_each1::operator= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Cube& p = access::rw(subview_cube_each_common::P); @@ -122,7 +122,7 @@ inline void subview_cube_each1::operator+= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Cube& p = access::rw(subview_cube_each_common::P); @@ -147,7 +147,7 @@ inline void subview_cube_each1::operator-= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Cube& p = access::rw(subview_cube_each_common::P); @@ -172,7 +172,7 @@ inline void subview_cube_each1::operator%= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Cube& p = access::rw(subview_cube_each_common::P); @@ -197,7 +197,7 @@ inline void subview_cube_each1::operator/= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Cube& p = access::rw(subview_cube_each_common::P); @@ -222,7 +222,7 @@ inline void subview_cube_each1::operator*= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Cube& C = access::rw(subview_cube_each_common::P); @@ -241,7 +241,7 @@ template inline subview_cube_each2::~subview_cube_each2() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -252,7 +252,7 @@ subview_cube_each2::subview_cube_each2(const Cube& in_p, const Base::subview_cube_each_common(in_p) , base_indices(in_indices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -262,7 +262,7 @@ inline void subview_cube_each2::check_indices(const Mat& indices) const { - arma_debug_check( ((indices.is_vec() == false) && (indices.is_empty() == false)), "each_slice(): list of indices must be a vector" ); + arma_conform_check( ((indices.is_vec() == false) && (indices.is_empty() == false)), "each_slice(): list of indices must be a vector" ); } @@ -273,7 +273,7 @@ inline void subview_cube_each2::operator= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Cube& p = access::rw(subview_cube_each_common::P); @@ -298,7 +298,7 @@ subview_cube_each2::operator= (const Base& in) { const uword slice = indices_mem[i]; - arma_debug_check_bounds( (slice >= p_n_slices), "each_slice(): index out of bounds" ); + arma_conform_check_bounds( (slice >= p_n_slices), "each_slice(): index out of bounds" ); arrayops::copy(p.slice_memptr(slice), A_mem, p_n_elem_slice); } @@ -312,7 +312,7 @@ inline void subview_cube_each2::operator+= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Cube& p = access::rw(subview_cube_each_common::P); @@ -337,7 +337,7 @@ subview_cube_each2::operator+= (const Base& in) { const uword slice = indices_mem[i]; - arma_debug_check_bounds( (slice >= p_n_slices), "each_slice(): index out of bounds" ); + arma_conform_check_bounds( (slice >= p_n_slices), "each_slice(): index out of bounds" ); arrayops::inplace_plus(p.slice_memptr(slice), A_mem, p_n_elem_slice); } @@ -351,7 +351,7 @@ inline void subview_cube_each2::operator-= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Cube& p = access::rw(subview_cube_each_common::P); @@ -376,7 +376,7 @@ subview_cube_each2::operator-= (const Base& in) { const uword slice = indices_mem[i]; - arma_debug_check_bounds( (slice >= p_n_slices), "each_slice(): index out of bounds" ); + arma_conform_check_bounds( (slice >= p_n_slices), "each_slice(): index out of bounds" ); arrayops::inplace_minus(p.slice_memptr(slice), A_mem, p_n_elem_slice); } @@ -390,7 +390,7 @@ inline void subview_cube_each2::operator%= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Cube& p = access::rw(subview_cube_each_common::P); @@ -415,7 +415,7 @@ subview_cube_each2::operator%= (const Base& in) { const uword slice = indices_mem[i]; - arma_debug_check_bounds( (slice >= p_n_slices), "each_slice(): index out of bounds" ); + arma_conform_check_bounds( (slice >= p_n_slices), "each_slice(): index out of bounds" ); arrayops::inplace_mul(p.slice_memptr(slice), A_mem, p_n_elem_slice); } @@ -429,7 +429,7 @@ inline void subview_cube_each2::operator/= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Cube& p = access::rw(subview_cube_each_common::P); @@ -454,7 +454,7 @@ subview_cube_each2::operator/= (const Base& in) { const uword slice = indices_mem[i]; - arma_debug_check_bounds( (slice >= p_n_slices), "each_slice(): index out of bounds" ); + arma_conform_check_bounds( (slice >= p_n_slices), "each_slice(): index out of bounds" ); arrayops::inplace_div(p.slice_memptr(slice), A_mem, p_n_elem_slice); } @@ -477,7 +477,7 @@ subview_cube_each1_aux::operator_plus const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Cube& p = X.P; @@ -514,7 +514,7 @@ subview_cube_each1_aux::operator_minus const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Cube& p = X.P; @@ -551,7 +551,7 @@ subview_cube_each1_aux::operator_minus const subview_cube_each1& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Cube& p = Y.P; @@ -588,7 +588,7 @@ subview_cube_each1_aux::operator_schur const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Cube& p = X.P; @@ -625,7 +625,7 @@ subview_cube_each1_aux::operator_div const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Cube& p = X.P; @@ -662,7 +662,7 @@ subview_cube_each1_aux::operator_div const subview_cube_each1& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Cube& p = Y.P; @@ -699,7 +699,7 @@ subview_cube_each1_aux::operator_times const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Cube& C = X.P; @@ -730,7 +730,7 @@ subview_cube_each1_aux::operator_times const subview_cube_each1& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap tmp(X.get_ref()); const Mat& M = tmp.M; @@ -767,7 +767,7 @@ subview_cube_each2_aux::operator_plus const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Cube& p = X.P; @@ -793,7 +793,7 @@ subview_cube_each2_aux::operator_plus { const uword slice = indices_mem[i]; - arma_debug_check_bounds( (slice >= p_n_slices), "each_slice(): index out of bounds" ); + arma_conform_check_bounds( (slice >= p_n_slices), "each_slice(): index out of bounds" ); arrayops::inplace_plus(out.slice_memptr(slice), A_mem, p_n_elem_slice); } @@ -812,7 +812,7 @@ subview_cube_each2_aux::operator_minus const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Cube& p = X.P; @@ -838,7 +838,7 @@ subview_cube_each2_aux::operator_minus { const uword slice = indices_mem[i]; - arma_debug_check_bounds( (slice >= p_n_slices), "each_slice(): index out of bounds" ); + arma_conform_check_bounds( (slice >= p_n_slices), "each_slice(): index out of bounds" ); arrayops::inplace_minus(out.slice_memptr(slice), A_mem, p_n_elem_slice); } @@ -857,7 +857,7 @@ subview_cube_each2_aux::operator_minus const subview_cube_each2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Cube& p = Y.P; @@ -882,7 +882,7 @@ subview_cube_each2_aux::operator_minus { const uword slice = indices_mem[i]; - arma_debug_check_bounds( (slice >= p_n_slices), "each_slice(): index out of bounds" ); + arma_conform_check_bounds( (slice >= p_n_slices), "each_slice(): index out of bounds" ); Mat out_slice( out.slice_memptr(slice), p_n_rows, p_n_cols, false, true); const Mat p_slice(const_cast(p.slice_memptr(slice)), p_n_rows, p_n_cols, false, true); @@ -904,7 +904,7 @@ subview_cube_each2_aux::operator_schur const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Cube& p = X.P; @@ -930,7 +930,7 @@ subview_cube_each2_aux::operator_schur { const uword slice = indices_mem[i]; - arma_debug_check_bounds( (slice >= p_n_slices), "each_slice(): index out of bounds" ); + arma_conform_check_bounds( (slice >= p_n_slices), "each_slice(): index out of bounds" ); arrayops::inplace_mul(out.slice_memptr(slice), A_mem, p_n_elem_slice); } @@ -949,7 +949,7 @@ subview_cube_each2_aux::operator_div const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Cube& p = X.P; @@ -975,7 +975,7 @@ subview_cube_each2_aux::operator_div { const uword slice = indices_mem[i]; - arma_debug_check_bounds( (slice >= p_n_slices), "each_slice(): index out of bounds" ); + arma_conform_check_bounds( (slice >= p_n_slices), "each_slice(): index out of bounds" ); arrayops::inplace_div(out.slice_memptr(slice), A_mem, p_n_elem_slice); } @@ -994,7 +994,7 @@ subview_cube_each2_aux::operator_div const subview_cube_each2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Cube& p = Y.P; @@ -1019,7 +1019,7 @@ subview_cube_each2_aux::operator_div { const uword slice = indices_mem[i]; - arma_debug_check_bounds( (slice >= p_n_slices), "each_slice(): index out of bounds" ); + arma_conform_check_bounds( (slice >= p_n_slices), "each_slice(): index out of bounds" ); Mat out_slice( out.slice_memptr(slice), p_n_rows, p_n_cols, false, true); const Mat p_slice(const_cast(p.slice_memptr(slice)), p_n_rows, p_n_cols, false, true); diff --git a/inst/include/armadillo_bits/subview_cube_meat.hpp b/inst/include/armadillo_bits/subview_cube_meat.hpp index 039e80c4..6edd431b 100644 --- a/inst/include/armadillo_bits/subview_cube_meat.hpp +++ b/inst/include/armadillo_bits/subview_cube_meat.hpp @@ -24,7 +24,7 @@ template inline subview_cube::~subview_cube() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } @@ -51,7 +51,7 @@ subview_cube::subview_cube , n_slices (in_n_slices) , n_elem (n_elem_slice * in_n_slices) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } @@ -69,7 +69,7 @@ subview_cube::subview_cube(const subview_cube& in) , n_slices (in.n_slices ) , n_elem (in.n_elem ) { - arma_extra_debug_sigprint(arma_str::format("this = %x in = %x") % this % &in); + arma_debug_sigprint(arma_str::format("this: %x; in: %x") % this % &in); } @@ -87,7 +87,7 @@ subview_cube::subview_cube(subview_cube&& in) , n_slices (in.n_slices ) , n_elem (in.n_elem ) { - arma_extra_debug_sigprint(arma_str::format("this = %x in = %x") % this % &in); + arma_debug_sigprint(arma_str::format("this: %x; in: %x") % this % &in); // for paranoia @@ -109,7 +109,7 @@ inline void subview_cube::inplace_op(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_cube& t = *this; @@ -138,7 +138,7 @@ inline void subview_cube::inplace_op(const BaseCube& in, const char* identifier) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const ProxyCube P(in.get_ref()); @@ -148,12 +148,12 @@ subview_cube::inplace_op(const BaseCube& in, const char* identifier) const uword t_n_cols = t.n_cols; const uword t_n_slices = t.n_slices; - arma_debug_assert_same_size(t, P, identifier); + arma_conform_assert_same_size(t, P, identifier); const bool use_mp = arma_config::openmp && ProxyCube::use_mp && mp_gate::eval(t.n_elem); const bool has_overlap = P.has_overlap(t); - if(has_overlap) { arma_extra_debug_print("aliasing or overlap detected"); } + if(has_overlap) { arma_debug_print("aliasing or overlap detected"); } if( (is_Cube::stored_type>::value) || (use_mp) || (has_overlap) ) { @@ -235,7 +235,7 @@ inline void subview_cube::inplace_op(const subview_cube& x, const char* identifier) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(check_overlap(x)) { @@ -252,7 +252,7 @@ subview_cube::inplace_op(const subview_cube& x, const char* identifier) subview_cube& t = *this; - arma_debug_assert_same_size(t, x, identifier); + arma_conform_assert_same_size(t, x, identifier); const uword t_n_rows = t.n_rows; const uword t_n_cols = t.n_cols; @@ -276,11 +276,11 @@ inline void subview_cube::operator= (const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(n_elem != 1) { - arma_debug_assert_same_size(n_rows, n_cols, n_slices, 1, 1, 1, "copy into subcube"); + arma_conform_assert_same_size(n_rows, n_cols, n_slices, 1, 1, 1, "copy into subcube"); } Cube& Q = const_cast< Cube& >(m); @@ -295,7 +295,7 @@ inline void subview_cube::operator+= (const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(val); } @@ -307,7 +307,7 @@ inline void subview_cube::operator-= (const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(val); } @@ -319,7 +319,7 @@ inline void subview_cube::operator*= (const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(val); } @@ -331,7 +331,7 @@ inline void subview_cube::operator/= (const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(val); } @@ -344,7 +344,7 @@ inline void subview_cube::operator= (const BaseCube& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(in, "copy into subcube"); } @@ -357,7 +357,7 @@ inline void subview_cube::operator+= (const BaseCube& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(in, "addition"); } @@ -370,7 +370,7 @@ inline void subview_cube::operator-= (const BaseCube& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(in, "subtraction"); } @@ -383,7 +383,7 @@ inline void subview_cube::operator%= (const BaseCube& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(in, "element-wise multiplication"); } @@ -396,7 +396,7 @@ inline void subview_cube::operator/= (const BaseCube& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(in, "element-wise division"); } @@ -409,7 +409,7 @@ inline void subview_cube::operator= (const subview_cube& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x, "copy into subcube"); } @@ -421,7 +421,7 @@ inline void subview_cube::operator+= (const subview_cube& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x, "addition"); } @@ -433,7 +433,7 @@ inline void subview_cube::operator-= (const subview_cube& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x, "subtraction"); } @@ -445,7 +445,7 @@ inline void subview_cube::operator%= (const subview_cube& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x, "element-wise multiplication"); } @@ -457,7 +457,7 @@ inline void subview_cube::operator/= (const subview_cube& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x, "element-wise division"); } @@ -470,7 +470,7 @@ inline void subview_cube::operator= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap tmp(in.get_ref()); @@ -560,7 +560,7 @@ subview_cube::operator= (const Base& in) } else { - if(arma_config::debug) + if(arma_config::check_conformance) { arma_stop_logic_error( arma_incompat_size_string(t, x, "copy into subcube") ); } @@ -575,7 +575,7 @@ inline void subview_cube::operator+= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap tmp(in.get_ref()); @@ -663,7 +663,7 @@ subview_cube::operator+= (const Base& in) } else { - if(arma_config::debug) + if(arma_config::check_conformance) { arma_stop_logic_error( arma_incompat_size_string(t, x, "addition") ); } @@ -678,7 +678,7 @@ inline void subview_cube::operator-= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap tmp(in.get_ref()); @@ -766,7 +766,7 @@ subview_cube::operator-= (const Base& in) } else { - if(arma_config::debug) + if(arma_config::check_conformance) { arma_stop_logic_error( arma_incompat_size_string(t, x, "subtraction") ); } @@ -781,7 +781,7 @@ inline void subview_cube::operator%= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap tmp(in.get_ref()); @@ -869,7 +869,7 @@ subview_cube::operator%= (const Base& in) } else { - if(arma_config::debug) + if(arma_config::check_conformance) { arma_stop_logic_error( arma_incompat_size_string(t, x, "element-wise multiplication") ); } @@ -884,7 +884,7 @@ inline void subview_cube::operator/= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const quasi_unwrap tmp(in.get_ref()); @@ -972,7 +972,7 @@ subview_cube::operator/= (const Base& in) } else { - if(arma_config::debug) + if(arma_config::check_conformance) { arma_stop_logic_error( arma_incompat_size_string(t, x, "element-wise division") ); } @@ -987,9 +987,9 @@ inline void subview_cube::operator= (const GenCube& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(n_rows, n_cols, n_slices, in.n_rows, in.n_cols, in.n_slices, "copy into subcube"); + arma_conform_assert_same_size(n_rows, n_cols, n_slices, in.n_rows, in.n_cols, in.n_slices, "copy into subcube"); in.apply(*this); } @@ -1003,7 +1003,7 @@ inline void subview_cube::for_each(functor F) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Cube& Q = const_cast< Cube& >(m); @@ -1031,7 +1031,7 @@ inline void subview_cube::for_each(functor F) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Cube& Q = m; @@ -1060,7 +1060,7 @@ inline void subview_cube::transform(functor F) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Cube& Q = const_cast< Cube& >(m); @@ -1089,7 +1089,7 @@ inline void subview_cube::imbue(functor F) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Cube& Q = const_cast< Cube& >(m); @@ -1117,7 +1117,7 @@ inline void subview_cube::each_slice(const std::function< void(Mat&) >& F) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat tmp1(n_rows, n_cols, arma_nozeros_indicator()); Mat tmp2('j', tmp1.memptr(), n_rows, n_cols); @@ -1145,7 +1145,7 @@ inline void subview_cube::each_slice(const std::function< void(const Mat&) >& F) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat tmp1(n_rows, n_cols, arma_nozeros_indicator()); const Mat tmp2('j', tmp1.memptr(), n_rows, n_cols); @@ -1168,7 +1168,7 @@ inline void subview_cube::replace(const eT old_val, const eT new_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword local_n_rows = n_rows; const uword local_n_cols = n_cols; @@ -1190,7 +1190,7 @@ inline void subview_cube::clean(const typename get_pod_type::result threshold) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword local_n_rows = n_rows; const uword local_n_cols = n_cols; @@ -1212,16 +1212,16 @@ inline void subview_cube::clamp(const eT min_val, const eT max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(is_cx::no) { - arma_debug_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "subview_cube::clamp(): min_val must be less than max_val" ); + arma_conform_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "subview_cube::clamp(): min_val must be less than max_val" ); } else { - arma_debug_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "subview_cube::clamp(): real(min_val) must be less than real(max_val)" ); - arma_debug_check( (access::tmp_imag(min_val) > access::tmp_imag(max_val)), "subview_cube::clamp(): imag(min_val) must be less than imag(max_val)" ); + arma_conform_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "subview_cube::clamp(): real(min_val) must be less than real(max_val)" ); + arma_conform_check( (access::tmp_imag(min_val) > access::tmp_imag(max_val)), "subview_cube::clamp(): imag(min_val) must be less than imag(max_val)" ); } const uword local_n_rows = n_rows; @@ -1244,7 +1244,7 @@ inline void subview_cube::fill(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword local_n_rows = n_rows; const uword local_n_cols = n_cols; @@ -1266,7 +1266,7 @@ inline void subview_cube::zeros() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword local_n_rows = n_rows; const uword local_n_cols = n_cols; @@ -1288,7 +1288,7 @@ inline void subview_cube::ones() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); fill(eT(1)); } @@ -1300,7 +1300,7 @@ inline void subview_cube::randu() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword local_n_rows = n_rows; const uword local_n_cols = n_cols; @@ -1322,7 +1322,7 @@ inline void subview_cube::randn() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword local_n_rows = n_rows; const uword local_n_cols = n_cols; @@ -1344,9 +1344,9 @@ inline bool subview_cube::is_finite() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "is_finite(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_conform_warn(1, "is_finite(): detection of non-finite values is not reliable in fast math mode"); } const uword local_n_rows = n_rows; const uword local_n_cols = n_cols; @@ -1370,7 +1370,7 @@ inline bool subview_cube::is_zero(const typename get_pod_type::result tol) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword local_n_rows = n_rows; const uword local_n_cols = n_cols; @@ -1394,9 +1394,9 @@ inline bool subview_cube::has_inf() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "has_inf(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_inf(): detection of non-finite values is not reliable in fast math mode"); } const uword local_n_rows = n_rows; const uword local_n_cols = n_cols; @@ -1420,9 +1420,9 @@ inline bool subview_cube::has_nan() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "has_nan(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_nan(): detection of non-finite values is not reliable in fast math mode"); } const uword local_n_rows = n_rows; const uword local_n_cols = n_cols; @@ -1446,9 +1446,9 @@ inline bool subview_cube::has_nonfinite() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "has_nonfinite(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_nonfinite(): detection of non-finite values is not reliable in fast math mode"); } const uword local_n_rows = n_rows; const uword local_n_cols = n_cols; @@ -1520,7 +1520,7 @@ inline eT& subview_cube::operator()(const uword i) { - arma_debug_check_bounds( (i >= n_elem), "subview_cube::operator(): index out of bounds" ); + arma_conform_check_bounds( (i >= n_elem), "subview_cube::operator(): index out of bounds" ); const uword in_slice = i / n_elem_slice; const uword offset = in_slice * n_elem_slice; @@ -1541,7 +1541,7 @@ inline eT subview_cube::operator()(const uword i) const { - arma_debug_check_bounds( (i >= n_elem), "subview_cube::operator(): index out of bounds" ); + arma_conform_check_bounds( (i >= n_elem), "subview_cube::operator(): index out of bounds" ); const uword in_slice = i / n_elem_slice; const uword offset = in_slice * n_elem_slice; @@ -1562,7 +1562,7 @@ arma_inline eT& subview_cube::operator()(const uword in_row, const uword in_col, const uword in_slice) { - arma_debug_check_bounds( ( (in_row >= n_rows) || (in_col >= n_cols) || (in_slice >= n_slices) ), "subview_cube::operator(): location out of bounds" ); + arma_conform_check_bounds( ( (in_row >= n_rows) || (in_col >= n_cols) || (in_slice >= n_slices) ), "subview_cube::operator(): location out of bounds" ); const uword index = (in_slice + aux_slice1)*m.n_elem_slice + (in_col + aux_col1)*m.n_rows + aux_row1 + in_row; @@ -1576,7 +1576,7 @@ arma_inline eT subview_cube::operator()(const uword in_row, const uword in_col, const uword in_slice) const { - arma_debug_check_bounds( ( (in_row >= n_rows) || (in_col >= n_cols) || (in_slice >= n_slices) ), "subview_cube::operator(): location out of bounds" ); + arma_conform_check_bounds( ( (in_row >= n_rows) || (in_col >= n_cols) || (in_slice >= n_slices) ), "subview_cube::operator(): location out of bounds" ); const uword index = (in_slice + aux_slice1)*m.n_elem_slice + (in_col + aux_col1)*m.n_rows + aux_row1 + in_row; @@ -1703,7 +1703,7 @@ inline void subview_cube::extract(Cube& out, const subview_cube& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: we're assuming that the cube has already been set to the correct size and there is no aliasing; // size setting and alias checking is done by either the Cube contructor or operator=() @@ -1712,7 +1712,7 @@ subview_cube::extract(Cube& out, const subview_cube& in) const uword n_cols = in.n_cols; const uword n_slices = in.n_slices; - arma_extra_debug_print(arma_str::format("out.n_rows = %u out.n_cols = %u out.n_slices = %u in.m.n_rows = %u in.m.n_cols = %u in.m.n_slices = %u") % out.n_rows % out.n_cols % out.n_slices % in.m.n_rows % in.m.n_cols % in.m.n_slices); + arma_debug_print(arma_str::format("out.n_rows: %u; out.n_cols: %u; out.n_slices: %u; in.m.n_rows: %u; in.m.n_cols: %u; in.m.n_slices: %u") % out.n_rows % out.n_cols % out.n_slices % in.m.n_rows % in.m.n_cols % in.m.n_slices); if( (in.aux_row1 == 0) && (n_rows == in.m.n_rows) ) { @@ -1739,9 +1739,9 @@ inline void subview_cube::plus_inplace(Cube& out, const subview_cube& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(out, in, "addition"); + arma_conform_assert_same_size(out, in, "addition"); const uword n_rows = out.n_rows; const uword n_cols = out.n_cols; @@ -1764,9 +1764,9 @@ inline void subview_cube::minus_inplace(Cube& out, const subview_cube& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(out, in, "subtraction"); + arma_conform_assert_same_size(out, in, "subtraction"); const uword n_rows = out.n_rows; const uword n_cols = out.n_cols; @@ -1789,9 +1789,9 @@ inline void subview_cube::schur_inplace(Cube& out, const subview_cube& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(out, in, "element-wise multiplication"); + arma_conform_assert_same_size(out, in, "element-wise multiplication"); const uword n_rows = out.n_rows; const uword n_cols = out.n_cols; @@ -1814,9 +1814,9 @@ inline void subview_cube::div_inplace(Cube& out, const subview_cube& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(out, in, "element-wise division"); + arma_conform_assert_same_size(out, in, "element-wise division"); const uword n_rows = out.n_rows; const uword n_cols = out.n_cols; @@ -1839,9 +1839,9 @@ inline void subview_cube::extract(Mat& out, const subview_cube& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_cube_as_mat(out, in, "copy into matrix", false); + arma_conform_assert_cube_as_mat(out, in, "copy into matrix", false); const uword in_n_rows = in.n_rows; const uword in_n_cols = in.n_cols; @@ -1933,9 +1933,9 @@ inline void subview_cube::plus_inplace(Mat& out, const subview_cube& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_cube_as_mat(out, in, "addition", true); + arma_conform_assert_cube_as_mat(out, in, "addition", true); const uword in_n_rows = in.n_rows; const uword in_n_cols = in.n_cols; @@ -1947,7 +1947,7 @@ subview_cube::plus_inplace(Mat& out, const subview_cube& in) if(in_n_slices == 1) { - if( (arma_config::debug) && ((out_n_rows != in_n_rows) || (out_n_cols != in_n_cols)) ) + if( (arma_config::check_conformance) && ((out_n_rows != in_n_rows) || (out_n_cols != in_n_cols)) ) { std::ostringstream tmp; @@ -2034,9 +2034,9 @@ inline void subview_cube::minus_inplace(Mat& out, const subview_cube& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_cube_as_mat(out, in, "subtraction", true); + arma_conform_assert_cube_as_mat(out, in, "subtraction", true); const uword in_n_rows = in.n_rows; const uword in_n_cols = in.n_cols; @@ -2048,7 +2048,7 @@ subview_cube::minus_inplace(Mat& out, const subview_cube& in) if(in_n_slices == 1) { - if( (arma_config::debug) && ((out_n_rows != in_n_rows) || (out_n_cols != in_n_cols)) ) + if( (arma_config::check_conformance) && ((out_n_rows != in_n_rows) || (out_n_cols != in_n_cols)) ) { std::ostringstream tmp; @@ -2135,9 +2135,9 @@ inline void subview_cube::schur_inplace(Mat& out, const subview_cube& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_cube_as_mat(out, in, "element-wise multiplication", true); + arma_conform_assert_cube_as_mat(out, in, "element-wise multiplication", true); const uword in_n_rows = in.n_rows; const uword in_n_cols = in.n_cols; @@ -2149,7 +2149,7 @@ subview_cube::schur_inplace(Mat& out, const subview_cube& in) if(in_n_slices == 1) { - if( (arma_config::debug) && ((out_n_rows != in_n_rows) || (out_n_cols != in_n_cols)) ) + if( (arma_config::check_conformance) && ((out_n_rows != in_n_rows) || (out_n_cols != in_n_cols)) ) { std::ostringstream tmp; @@ -2236,9 +2236,9 @@ inline void subview_cube::div_inplace(Mat& out, const subview_cube& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_cube_as_mat(out, in, "element-wise division", true); + arma_conform_assert_cube_as_mat(out, in, "element-wise division", true); const uword in_n_rows = in.n_rows; const uword in_n_cols = in.n_cols; @@ -2250,7 +2250,7 @@ subview_cube::div_inplace(Mat& out, const subview_cube& in) if(in_n_slices == 1) { - if( (arma_config::debug) && ((out_n_rows != in_n_rows) || (out_n_cols != in_n_cols)) ) + if( (arma_config::check_conformance) && ((out_n_rows != in_n_rows) || (out_n_cols != in_n_cols)) ) { std::ostringstream tmp; @@ -2410,7 +2410,7 @@ subview_cube::iterator::iterator() , aux_row2_p1 (0 ) , aux_col2_p1 (0 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // Technically this iterator is invalid (it does not point to a valid element) } @@ -2429,7 +2429,7 @@ subview_cube::iterator::iterator(const iterator& X) , aux_row2_p1 (X.aux_row2_p1 ) , aux_col2_p1 (X.aux_col2_p1 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -2447,7 +2447,7 @@ subview_cube::iterator::iterator(subview_cube& in_sv, const uword in_row , aux_row2_p1 (in_sv.aux_row1 + in_sv.n_rows ) , aux_col2_p1 (in_sv.aux_col1 + in_sv.n_cols ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -2565,7 +2565,7 @@ subview_cube::const_iterator::const_iterator() , aux_row2_p1 (0 ) , aux_col2_p1 (0 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // Technically this iterator is invalid (it does not point to a valid element) } @@ -2584,7 +2584,7 @@ subview_cube::const_iterator::const_iterator(const iterator& X) , aux_row2_p1 (X.aux_row2_p1 ) , aux_col2_p1 (X.aux_col2_p1 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -2602,7 +2602,7 @@ subview_cube::const_iterator::const_iterator(const const_iterator& X) , aux_row2_p1 (X.aux_row2_p1 ) , aux_col2_p1 (X.aux_col2_p1 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -2620,7 +2620,7 @@ subview_cube::const_iterator::const_iterator(const subview_cube& in_sv, , aux_row2_p1 (in_sv.aux_row1 + in_sv.n_rows ) , aux_col2_p1 (in_sv.aux_col1 + in_sv.n_cols ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } diff --git a/inst/include/armadillo_bits/subview_cube_slices_meat.hpp b/inst/include/armadillo_bits/subview_cube_slices_meat.hpp index f520da07..29569b3e 100644 --- a/inst/include/armadillo_bits/subview_cube_slices_meat.hpp +++ b/inst/include/armadillo_bits/subview_cube_slices_meat.hpp @@ -24,7 +24,7 @@ template inline subview_cube_slices::~subview_cube_slices() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -38,7 +38,7 @@ subview_cube_slices::subview_cube_slices : m (in_m ) , base_si(in_si) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -48,7 +48,7 @@ inline void subview_cube_slices::inplace_rand(const uword rand_mode) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Cube& m_local = const_cast< Cube& >(m); @@ -58,7 +58,7 @@ subview_cube_slices::inplace_rand(const uword rand_mode) const quasi_unwrap U(base_si.get_ref()); const umat& si = U.M; - arma_debug_check + arma_conform_check ( ( (si.is_vec() == false) && (si.is_empty() == false) ), "Cube::slices(): given object must be a vector" @@ -71,7 +71,7 @@ subview_cube_slices::inplace_rand(const uword rand_mode) { const uword i = si_mem[si_count]; - arma_debug_check_bounds( (i >= m_n_slices), "Cube::slices(): index out of bounds" ); + arma_conform_check_bounds( (i >= m_n_slices), "Cube::slices(): index out of bounds" ); eT* m_slice_ptr = m_local.slice_memptr(i); @@ -88,7 +88,7 @@ inline void subview_cube_slices::inplace_op(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Cube& m_local = const_cast< Cube& >(m); @@ -98,7 +98,7 @@ subview_cube_slices::inplace_op(const eT val) const quasi_unwrap U(base_si.get_ref()); const umat& si = U.M; - arma_debug_check + arma_conform_check ( ( (si.is_vec() == false) && (si.is_empty() == false) ), "Cube::slices(): given object must be a vector" @@ -111,7 +111,7 @@ subview_cube_slices::inplace_op(const eT val) { const uword i = si_mem[si_count]; - arma_debug_check_bounds( (i >= m_n_slices), "Cube::slices(): index out of bounds" ); + arma_conform_check_bounds( (i >= m_n_slices), "Cube::slices(): index out of bounds" ); eT* m_slice_ptr = m_local.slice_memptr(i); @@ -131,7 +131,7 @@ inline void subview_cube_slices::inplace_op(const BaseCube& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Cube& m_local = const_cast< Cube& >(m); @@ -141,7 +141,7 @@ subview_cube_slices::inplace_op(const BaseCube& x) const quasi_unwrap U(base_si.get_ref()); const umat& si = U.M; - arma_debug_check + arma_conform_check ( ( (si.is_vec() == false) && (si.is_empty() == false) ), "Cube::slices(): given object must be a vector" @@ -153,13 +153,13 @@ subview_cube_slices::inplace_op(const BaseCube& x) const unwrap_cube_check tmp(x.get_ref(), m_local); const Cube& X = tmp.M; - arma_debug_assert_same_size( m_local.n_rows, m_local.n_cols, si_n_elem, X.n_rows, X.n_cols, X.n_slices, "Cube::slices()" ); + arma_conform_assert_same_size( m_local.n_rows, m_local.n_cols, si_n_elem, X.n_rows, X.n_cols, X.n_slices, "Cube::slices()" ); for(uword si_count=0; si_count < si_n_elem; ++si_count) { const uword i = si_mem[si_count]; - arma_debug_check_bounds( (i >= m_n_slices), "Cube::slices(): index out of bounds" ); + arma_conform_check_bounds( (i >= m_n_slices), "Cube::slices(): index out of bounds" ); eT* m_slice_ptr = m_local.slice_memptr(i); const eT* X_slice_ptr = X.slice_memptr(si_count); @@ -184,7 +184,7 @@ inline void subview_cube_slices::fill(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(val); } @@ -196,7 +196,7 @@ inline void subview_cube_slices::zeros() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(eT(0)); } @@ -208,7 +208,7 @@ inline void subview_cube_slices::ones() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(eT(1)); } @@ -220,7 +220,7 @@ inline void subview_cube_slices::randu() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_rand(0); } @@ -232,7 +232,7 @@ inline void subview_cube_slices::randn() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_rand(1); } @@ -244,7 +244,7 @@ inline void subview_cube_slices::operator+= (const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(val); } @@ -256,7 +256,7 @@ inline void subview_cube_slices::operator-= (const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(val); } @@ -268,7 +268,7 @@ inline void subview_cube_slices::operator*= (const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(val); } @@ -280,7 +280,7 @@ inline void subview_cube_slices::operator/= (const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(val); } @@ -298,7 +298,7 @@ inline void subview_cube_slices::operator_equ(const subview_cube_slices& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -312,7 +312,7 @@ inline void subview_cube_slices::operator= (const subview_cube_slices& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).operator_equ(x); } @@ -325,7 +325,7 @@ inline void subview_cube_slices::operator= (const subview_cube_slices& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).operator_equ(x); } @@ -338,7 +338,7 @@ inline void subview_cube_slices::operator+= (const subview_cube_slices& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -351,7 +351,7 @@ inline void subview_cube_slices::operator-= (const subview_cube_slices& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -364,7 +364,7 @@ inline void subview_cube_slices::operator%= (const subview_cube_slices& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -377,7 +377,7 @@ inline void subview_cube_slices::operator/= (const subview_cube_slices& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -390,7 +390,7 @@ inline void subview_cube_slices::operator= (const BaseCube& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -403,7 +403,7 @@ inline void subview_cube_slices::operator+= (const BaseCube& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -416,7 +416,7 @@ inline void subview_cube_slices::operator-= (const BaseCube& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -429,7 +429,7 @@ inline void subview_cube_slices::operator%= (const BaseCube& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -442,7 +442,7 @@ inline void subview_cube_slices::operator/= (const BaseCube& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -459,7 +459,7 @@ inline void subview_cube_slices::extract(Cube& out, const subview_cube_slices& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Cube& m_local = in.m; @@ -469,7 +469,7 @@ subview_cube_slices::extract(Cube& out, const subview_cube_slices U(in.base_si.get_ref()); const umat& si = U.M; - arma_debug_check + arma_conform_check ( ( (si.is_vec() == false) && (si.is_empty() == false) ), "Cube::slices(): given object must be a vector" @@ -484,7 +484,7 @@ subview_cube_slices::extract(Cube& out, const subview_cube_slices= m_n_slices), "Cube::slices(): index out of bounds" ); + arma_conform_check_bounds( (i >= m_n_slices), "Cube::slices(): index out of bounds" ); eT* out_slice_ptr = out.slice_memptr(si_count); const eT* m_slice_ptr = m_local.slice_memptr(i); @@ -501,7 +501,7 @@ inline void subview_cube_slices::plus_inplace(Cube& out, const subview_cube_slices& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Cube tmp(in); @@ -515,7 +515,7 @@ inline void subview_cube_slices::minus_inplace(Cube& out, const subview_cube_slices& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Cube tmp(in); @@ -529,7 +529,7 @@ inline void subview_cube_slices::schur_inplace(Cube& out, const subview_cube_slices& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Cube tmp(in); @@ -543,7 +543,7 @@ inline void subview_cube_slices::div_inplace(Cube& out, const subview_cube_slices& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Cube tmp(in); diff --git a/inst/include/armadillo_bits/subview_each_meat.hpp b/inst/include/armadillo_bits/subview_each_meat.hpp index 12d263ef..fca7b7c7 100644 --- a/inst/include/armadillo_bits/subview_each_meat.hpp +++ b/inst/include/armadillo_bits/subview_each_meat.hpp @@ -29,7 +29,7 @@ inline subview_each_common::subview_each_common(const parent& in_P) : P(in_P) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -70,7 +70,7 @@ inline void subview_each_common::check_size(const Mat& A) const { - if(arma_config::debug) + if(arma_config::check_conformance) { if(mode == 0) { @@ -123,7 +123,7 @@ template inline subview_each1::~subview_each1() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -133,7 +133,7 @@ inline subview_each1::subview_each1(const parent& in_P) : subview_each_common::subview_each_common(in_P) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -144,7 +144,7 @@ inline void subview_each1::operator= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); parent& p = access::rw(subview_each_common::P); @@ -181,7 +181,7 @@ inline void subview_each1::operator+= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); parent& p = access::rw(subview_each_common::P); @@ -218,7 +218,7 @@ inline void subview_each1::operator-= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); parent& p = access::rw(subview_each_common::P); @@ -255,7 +255,7 @@ inline void subview_each1::operator%= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); parent& p = access::rw(subview_each_common::P); @@ -292,7 +292,7 @@ inline void subview_each1::operator/= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); parent& p = access::rw(subview_each_common::P); @@ -333,7 +333,7 @@ template inline subview_each2::~subview_each2() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -344,7 +344,7 @@ subview_each2::subview_each2(const parent& in_P, const Base::subview_each_common(in_P) , base_indices(in_indices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -356,11 +356,11 @@ subview_each2::check_indices(const Mat& indices) const { if(mode == 0) { - arma_debug_check( ((indices.is_vec() == false) && (indices.is_empty() == false)), "each_col(): list of indices must be a vector" ); + arma_conform_check( ((indices.is_vec() == false) && (indices.is_empty() == false)), "each_col(): list of indices must be a vector" ); } else { - arma_debug_check( ((indices.is_vec() == false) && (indices.is_empty() == false)), "each_row(): list of indices must be a vector" ); + arma_conform_check( ((indices.is_vec() == false) && (indices.is_empty() == false)), "each_row(): list of indices must be a vector" ); } } @@ -372,7 +372,7 @@ inline void subview_each2::operator= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); parent& p = access::rw(subview_each_common::P); @@ -398,7 +398,7 @@ subview_each2::operator= (const Base& in) { const uword col = indices_mem[i]; - arma_debug_check_bounds( (col >= p_n_cols), "each_col(): index out of bounds" ); + arma_conform_check_bounds( (col >= p_n_cols), "each_col(): index out of bounds" ); arrayops::copy( p.colptr(col), A_mem, p_n_rows ); } @@ -409,7 +409,7 @@ subview_each2::operator= (const Base& in) { const uword row = indices_mem[i]; - arma_debug_check_bounds( (row >= p_n_rows), "each_row(): index out of bounds" ); + arma_conform_check_bounds( (row >= p_n_rows), "each_row(): index out of bounds" ); for(uword col=0; col < p_n_cols; ++col) { @@ -427,7 +427,7 @@ inline void subview_each2::operator+= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); parent& p = access::rw(subview_each_common::P); @@ -454,7 +454,7 @@ subview_each2::operator+= (const Base& in) { const uword col = indices_mem[i]; - arma_debug_check_bounds( (col >= p_n_cols), "each_col(): index out of bounds" ); + arma_conform_check_bounds( (col >= p_n_cols), "each_col(): index out of bounds" ); arrayops::inplace_plus( p.colptr(col), A_mem, p_n_rows ); } @@ -465,7 +465,7 @@ subview_each2::operator+= (const Base& in) { const uword row = indices_mem[i]; - arma_debug_check_bounds( (row >= p_n_rows), "each_row(): index out of bounds" ); + arma_conform_check_bounds( (row >= p_n_rows), "each_row(): index out of bounds" ); p.row(row) += A; } @@ -480,7 +480,7 @@ inline void subview_each2::operator-= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); parent& p = access::rw(subview_each_common::P); @@ -507,7 +507,7 @@ subview_each2::operator-= (const Base& in) { const uword col = indices_mem[i]; - arma_debug_check_bounds( (col >= p_n_cols), "each_col(): index out of bounds" ); + arma_conform_check_bounds( (col >= p_n_cols), "each_col(): index out of bounds" ); arrayops::inplace_minus( p.colptr(col), A_mem, p_n_rows ); } @@ -518,7 +518,7 @@ subview_each2::operator-= (const Base& in) { const uword row = indices_mem[i]; - arma_debug_check_bounds( (row >= p_n_rows), "each_row(): index out of bounds" ); + arma_conform_check_bounds( (row >= p_n_rows), "each_row(): index out of bounds" ); p.row(row) -= A; } @@ -533,7 +533,7 @@ inline void subview_each2::operator%= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); parent& p = access::rw(subview_each_common::P); @@ -560,7 +560,7 @@ subview_each2::operator%= (const Base& in) { const uword col = indices_mem[i]; - arma_debug_check_bounds( (col >= p_n_cols), "each_col(): index out of bounds" ); + arma_conform_check_bounds( (col >= p_n_cols), "each_col(): index out of bounds" ); arrayops::inplace_mul( p.colptr(col), A_mem, p_n_rows ); } @@ -571,7 +571,7 @@ subview_each2::operator%= (const Base& in) { const uword row = indices_mem[i]; - arma_debug_check_bounds( (row >= p_n_rows), "each_row(): index out of bounds" ); + arma_conform_check_bounds( (row >= p_n_rows), "each_row(): index out of bounds" ); p.row(row) %= A; } @@ -586,7 +586,7 @@ inline void subview_each2::operator/= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); parent& p = access::rw(subview_each_common::P); @@ -613,7 +613,7 @@ subview_each2::operator/= (const Base& in) { const uword col = indices_mem[i]; - arma_debug_check_bounds( (col >= p_n_cols), "each_col(): index out of bounds" ); + arma_conform_check_bounds( (col >= p_n_cols), "each_col(): index out of bounds" ); arrayops::inplace_div( p.colptr(col), A_mem, p_n_rows ); } @@ -624,7 +624,7 @@ subview_each2::operator/= (const Base& in) { const uword row = indices_mem[i]; - arma_debug_check_bounds( (row >= p_n_rows), "each_row(): index out of bounds" ); + arma_conform_check_bounds( (row >= p_n_rows), "each_row(): index out of bounds" ); p.row(row) /= A; } @@ -648,7 +648,7 @@ subview_each1_aux::operator_plus const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename parent::elem_type eT; @@ -710,7 +710,7 @@ subview_each1_aux::operator_minus const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename parent::elem_type eT; @@ -772,7 +772,7 @@ subview_each1_aux::operator_minus const subview_each1& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename parent::elem_type eT; @@ -834,7 +834,7 @@ subview_each1_aux::operator_schur const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename parent::elem_type eT; @@ -896,7 +896,7 @@ subview_each1_aux::operator_div const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename parent::elem_type eT; @@ -958,7 +958,7 @@ subview_each1_aux::operator_div const subview_each1& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename parent::elem_type eT; @@ -1026,7 +1026,7 @@ subview_each2_aux::operator_plus const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename parent::elem_type eT; @@ -1056,7 +1056,7 @@ subview_each2_aux::operator_plus { const uword col = indices_mem[i]; - arma_debug_check_bounds( (col >= p_n_cols), "each_col(): index out of bounds" ); + arma_conform_check_bounds( (col >= p_n_cols), "each_col(): index out of bounds" ); arrayops::inplace_plus( out.colptr(col), A_mem, p_n_rows ); } @@ -1068,7 +1068,7 @@ subview_each2_aux::operator_plus { const uword row = indices_mem[i]; - arma_debug_check_bounds( (row >= p_n_rows), "each_row(): index out of bounds" ); + arma_conform_check_bounds( (row >= p_n_rows), "each_row(): index out of bounds" ); out.row(row) += A; } @@ -1088,7 +1088,7 @@ subview_each2_aux::operator_minus const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename parent::elem_type eT; @@ -1118,7 +1118,7 @@ subview_each2_aux::operator_minus { const uword col = indices_mem[i]; - arma_debug_check_bounds( (col >= p_n_cols), "each_col(): index out of bounds" ); + arma_conform_check_bounds( (col >= p_n_cols), "each_col(): index out of bounds" ); arrayops::inplace_minus( out.colptr(col), A_mem, p_n_rows ); } @@ -1130,7 +1130,7 @@ subview_each2_aux::operator_minus { const uword row = indices_mem[i]; - arma_debug_check_bounds( (row >= p_n_rows), "each_row(): index out of bounds" ); + arma_conform_check_bounds( (row >= p_n_rows), "each_row(): index out of bounds" ); out.row(row) -= A; } @@ -1150,7 +1150,7 @@ subview_each2_aux::operator_minus const subview_each2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename parent::elem_type eT; @@ -1180,7 +1180,7 @@ subview_each2_aux::operator_minus { const uword col = indices_mem[i]; - arma_debug_check_bounds( (col >= p_n_cols), "each_col(): index out of bounds" ); + arma_conform_check_bounds( (col >= p_n_cols), "each_col(): index out of bounds" ); const eT* p_mem = p.colptr(col); eT* out_mem = out.colptr(col); @@ -1198,7 +1198,7 @@ subview_each2_aux::operator_minus { const uword row = indices_mem[i]; - arma_debug_check_bounds( (row >= p_n_rows), "each_row(): index out of bounds" ); + arma_conform_check_bounds( (row >= p_n_rows), "each_row(): index out of bounds" ); out.row(row) = A - p.row(row); } @@ -1218,7 +1218,7 @@ subview_each2_aux::operator_schur const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename parent::elem_type eT; @@ -1248,7 +1248,7 @@ subview_each2_aux::operator_schur { const uword col = indices_mem[i]; - arma_debug_check_bounds( (col >= p_n_cols), "each_col(): index out of bounds" ); + arma_conform_check_bounds( (col >= p_n_cols), "each_col(): index out of bounds" ); arrayops::inplace_mul( out.colptr(col), A_mem, p_n_rows ); } @@ -1260,7 +1260,7 @@ subview_each2_aux::operator_schur { const uword row = indices_mem[i]; - arma_debug_check_bounds( (row >= p_n_rows), "each_row(): index out of bounds" ); + arma_conform_check_bounds( (row >= p_n_rows), "each_row(): index out of bounds" ); out.row(row) %= A; } @@ -1280,7 +1280,7 @@ subview_each2_aux::operator_div const Base& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename parent::elem_type eT; @@ -1310,7 +1310,7 @@ subview_each2_aux::operator_div { const uword col = indices_mem[i]; - arma_debug_check_bounds( (col >= p_n_cols), "each_col(): index out of bounds" ); + arma_conform_check_bounds( (col >= p_n_cols), "each_col(): index out of bounds" ); arrayops::inplace_div( out.colptr(col), A_mem, p_n_rows ); } @@ -1322,7 +1322,7 @@ subview_each2_aux::operator_div { const uword row = indices_mem[i]; - arma_debug_check_bounds( (row >= p_n_rows), "each_row(): index out of bounds" ); + arma_conform_check_bounds( (row >= p_n_rows), "each_row(): index out of bounds" ); out.row(row) /= A; } @@ -1342,7 +1342,7 @@ subview_each2_aux::operator_div const subview_each2& Y ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename parent::elem_type eT; @@ -1372,7 +1372,7 @@ subview_each2_aux::operator_div { const uword col = indices_mem[i]; - arma_debug_check_bounds( (col >= p_n_cols), "each_col(): index out of bounds" ); + arma_conform_check_bounds( (col >= p_n_cols), "each_col(): index out of bounds" ); const eT* p_mem = p.colptr(col); eT* out_mem = out.colptr(col); @@ -1390,7 +1390,7 @@ subview_each2_aux::operator_div { const uword row = indices_mem[i]; - arma_debug_check_bounds( (row >= p_n_rows), "each_row(): index out of bounds" ); + arma_conform_check_bounds( (row >= p_n_rows), "each_row(): index out of bounds" ); out.row(row) = A / p.row(row); } diff --git a/inst/include/armadillo_bits/subview_elem1_meat.hpp b/inst/include/armadillo_bits/subview_elem1_meat.hpp index d1b67128..32a06caa 100644 --- a/inst/include/armadillo_bits/subview_elem1_meat.hpp +++ b/inst/include/armadillo_bits/subview_elem1_meat.hpp @@ -24,7 +24,7 @@ template inline subview_elem1::~subview_elem1() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -34,7 +34,7 @@ subview_elem1::subview_elem1(const Mat& in_m, const Base& i : m(in_m) , a(in_a) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -46,7 +46,7 @@ subview_elem1::subview_elem1(const Cube& in_q, const Base& , m( fake_m ) , a( in_a ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -57,7 +57,7 @@ inline void subview_elem1::inplace_op(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat& m_local = const_cast< Mat& >(m); @@ -67,7 +67,7 @@ subview_elem1::inplace_op(const eT val) const unwrap_check_mixed tmp(a.get_ref(), m_local); const umat& aa = tmp.M; - arma_debug_check + arma_conform_check ( ( (aa.is_vec() == false) && (aa.is_empty() == false) ), "Mat::elem(): given object must be a vector" @@ -82,7 +82,7 @@ subview_elem1::inplace_op(const eT val) const uword ii = aa_mem[iq]; const uword jj = aa_mem[jq]; - arma_debug_check_bounds( ( (ii >= m_n_elem) || (jj >= m_n_elem) ), "Mat::elem(): index out of bounds" ); + arma_conform_check_bounds( ( (ii >= m_n_elem) || (jj >= m_n_elem) ), "Mat::elem(): index out of bounds" ); if(is_same_type::yes) { m_mem[ii] = val; m_mem[jj] = val; } if(is_same_type::yes) { m_mem[ii] += val; m_mem[jj] += val; } @@ -95,7 +95,7 @@ subview_elem1::inplace_op(const eT val) { const uword ii = aa_mem[iq]; - arma_debug_check_bounds( (ii >= m_n_elem) , "Mat::elem(): index out of bounds" ); + arma_conform_check_bounds( (ii >= m_n_elem) , "Mat::elem(): index out of bounds" ); if(is_same_type::yes) { m_mem[ii] = val; } if(is_same_type::yes) { m_mem[ii] += val; } @@ -113,13 +113,13 @@ inline void subview_elem1::inplace_op(const subview_elem1& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_elem1& s = *this; if(&(s.m) == &(x.m)) { - arma_extra_debug_print("subview_elem1::inplace_op(): aliasing detected"); + arma_debug_print("subview_elem1::inplace_op(): aliasing detected"); const Mat tmp(x); @@ -140,7 +140,7 @@ subview_elem1::inplace_op(const subview_elem1& x) const umat& s_aa = s_tmp.M; const umat& x_aa = x_tmp.M; - arma_debug_check + arma_conform_check ( ( ((s_aa.is_vec() == false) && (s_aa.is_empty() == false)) || ((x_aa.is_vec() == false) && (x_aa.is_empty() == false)) ), "Mat::elem(): given object must be a vector" @@ -151,7 +151,7 @@ subview_elem1::inplace_op(const subview_elem1& x) const uword s_aa_n_elem = s_aa.n_elem; - arma_debug_check( (s_aa_n_elem != x_aa.n_elem), "Mat::elem(): size mismatch" ); + arma_conform_check( (s_aa_n_elem != x_aa.n_elem), "Mat::elem(): size mismatch" ); eT* s_m_mem = s_m_local.memptr(); @@ -169,7 +169,7 @@ subview_elem1::inplace_op(const subview_elem1& x) const uword x_ii = x_aa_mem[iq]; const uword x_jj = x_aa_mem[jq]; - arma_debug_check_bounds + arma_conform_check_bounds ( (s_ii >= s_m_n_elem) || (s_jj >= s_m_n_elem) || (x_ii >= x_m_n_elem) || (x_jj >= x_m_n_elem), "Mat::elem(): index out of bounds" @@ -187,7 +187,7 @@ subview_elem1::inplace_op(const subview_elem1& x) const uword s_ii = s_aa_mem[iq]; const uword x_ii = x_aa_mem[iq]; - arma_debug_check_bounds + arma_conform_check_bounds ( ( (s_ii >= s_m_n_elem) || (x_ii >= x_m_n_elem) ), "Mat::elem(): index out of bounds" @@ -210,7 +210,7 @@ inline void subview_elem1::inplace_op(const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat& m_local = const_cast< Mat& >(m); @@ -220,7 +220,7 @@ subview_elem1::inplace_op(const Base& x) const unwrap_check_mixed aa_tmp(a.get_ref(), m_local); const umat& aa = aa_tmp.M; - arma_debug_check + arma_conform_check ( ( (aa.is_vec() == false) && (aa.is_empty() == false) ), "Mat::elem(): given object must be a vector" @@ -231,7 +231,7 @@ subview_elem1::inplace_op(const Base& x) const Proxy P(x.get_ref()); - arma_debug_check( (aa_n_elem != P.get_n_elem()), "Mat::elem(): size mismatch" ); + arma_conform_check( (aa_n_elem != P.get_n_elem()), "Mat::elem(): size mismatch" ); const bool is_alias = P.is_alias(m); @@ -245,7 +245,7 @@ subview_elem1::inplace_op(const Base& x) const uword ii = aa_mem[iq]; const uword jj = aa_mem[jq]; - arma_debug_check_bounds( ( (ii >= m_n_elem) || (jj >= m_n_elem) ), "Mat::elem(): index out of bounds" ); + arma_conform_check_bounds( ( (ii >= m_n_elem) || (jj >= m_n_elem) ), "Mat::elem(): index out of bounds" ); if(is_same_type::yes) { m_mem[ii] = X[iq]; m_mem[jj] = X[jq]; } if(is_same_type::yes) { m_mem[ii] += X[iq]; m_mem[jj] += X[jq]; } @@ -258,7 +258,7 @@ subview_elem1::inplace_op(const Base& x) { const uword ii = aa_mem[iq]; - arma_debug_check_bounds( (ii >= m_n_elem) , "Mat::elem(): index out of bounds" ); + arma_conform_check_bounds( (ii >= m_n_elem) , "Mat::elem(): index out of bounds" ); if(is_same_type::yes) { m_mem[ii] = X[iq]; } if(is_same_type::yes) { m_mem[ii] += X[iq]; } @@ -269,7 +269,7 @@ subview_elem1::inplace_op(const Base& x) } else { - arma_extra_debug_print("subview_elem1::inplace_op(): aliasing or use_at detected"); + arma_debug_print("subview_elem1::inplace_op(): aliasing or use_at detected"); const unwrap_check::stored_type> tmp(P.Q, is_alias); const Mat& M = tmp.M; @@ -282,7 +282,7 @@ subview_elem1::inplace_op(const Base& x) const uword ii = aa_mem[iq]; const uword jj = aa_mem[jq]; - arma_debug_check_bounds( ( (ii >= m_n_elem) || (jj >= m_n_elem) ), "Mat::elem(): index out of bounds" ); + arma_conform_check_bounds( ( (ii >= m_n_elem) || (jj >= m_n_elem) ), "Mat::elem(): index out of bounds" ); if(is_same_type::yes) { m_mem[ii] = X[iq]; m_mem[jj] = X[jq]; } if(is_same_type::yes) { m_mem[ii] += X[iq]; m_mem[jj] += X[jq]; } @@ -295,7 +295,7 @@ subview_elem1::inplace_op(const Base& x) { const uword ii = aa_mem[iq]; - arma_debug_check_bounds( (ii >= m_n_elem) , "Mat::elem(): index out of bounds" ); + arma_conform_check_bounds( (ii >= m_n_elem) , "Mat::elem(): index out of bounds" ); if(is_same_type::yes) { m_mem[ii] = X[iq]; } if(is_same_type::yes) { m_mem[ii] += X[iq]; } @@ -348,7 +348,7 @@ inline void subview_elem1::replace(const eT old_val, const eT new_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat& m_local = const_cast< Mat& >(m); @@ -358,7 +358,7 @@ subview_elem1::replace(const eT old_val, const eT new_val) const unwrap_check_mixed tmp(a.get_ref(), m_local); const umat& aa = tmp.M; - arma_debug_check + arma_conform_check ( ( (aa.is_vec() == false) && (aa.is_empty() == false) ), "Mat::elem(): given object must be a vector" @@ -373,7 +373,7 @@ subview_elem1::replace(const eT old_val, const eT new_val) { const uword ii = aa_mem[iq]; - arma_debug_check_bounds( (ii >= m_n_elem), "Mat::elem(): index out of bounds" ); + arma_conform_check_bounds( (ii >= m_n_elem), "Mat::elem(): index out of bounds" ); eT& val = m_mem[ii]; @@ -386,7 +386,7 @@ subview_elem1::replace(const eT old_val, const eT new_val) { const uword ii = aa_mem[iq]; - arma_debug_check_bounds( (ii >= m_n_elem), "Mat::elem(): index out of bounds" ); + arma_conform_check_bounds( (ii >= m_n_elem), "Mat::elem(): index out of bounds" ); eT& val = m_mem[ii]; @@ -402,7 +402,7 @@ inline void subview_elem1::clean(const pod_type threshold) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat tmp(*this); @@ -418,7 +418,7 @@ inline void subview_elem1::clamp(const eT min_val, const eT max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat tmp(*this); @@ -434,7 +434,7 @@ inline void subview_elem1::fill(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(val); } @@ -446,7 +446,7 @@ inline void subview_elem1::zeros() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(eT(0)); } @@ -458,7 +458,7 @@ inline void subview_elem1::ones() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(eT(1)); } @@ -470,7 +470,7 @@ inline void subview_elem1::randu() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat& m_local = const_cast< Mat& >(m); @@ -480,7 +480,7 @@ subview_elem1::randu() const unwrap_check_mixed tmp(a.get_ref(), m_local); const umat& aa = tmp.M; - arma_debug_check + arma_conform_check ( ( (aa.is_vec() == false) && (aa.is_empty() == false) ), "Mat::elem(): given object must be a vector" @@ -495,7 +495,7 @@ subview_elem1::randu() const uword ii = aa_mem[iq]; const uword jj = aa_mem[jq]; - arma_debug_check_bounds( ( (ii >= m_n_elem) || (jj >= m_n_elem) ), "Mat::elem(): index out of bounds" ); + arma_conform_check_bounds( ( (ii >= m_n_elem) || (jj >= m_n_elem) ), "Mat::elem(): index out of bounds" ); const eT val1 = eT(arma_rng::randu()); const eT val2 = eT(arma_rng::randu()); @@ -508,7 +508,7 @@ subview_elem1::randu() { const uword ii = aa_mem[iq]; - arma_debug_check_bounds( (ii >= m_n_elem) , "Mat::elem(): index out of bounds" ); + arma_conform_check_bounds( (ii >= m_n_elem) , "Mat::elem(): index out of bounds" ); m_mem[ii] = eT(arma_rng::randu()); } @@ -521,7 +521,7 @@ inline void subview_elem1::randn() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat& m_local = const_cast< Mat& >(m); @@ -531,7 +531,7 @@ subview_elem1::randn() const unwrap_check_mixed tmp(a.get_ref(), m_local); const umat& aa = tmp.M; - arma_debug_check + arma_conform_check ( ( (aa.is_vec() == false) && (aa.is_empty() == false) ), "Mat::elem(): given object must be a vector" @@ -546,7 +546,7 @@ subview_elem1::randn() const uword ii = aa_mem[iq]; const uword jj = aa_mem[jq]; - arma_debug_check_bounds( ( (ii >= m_n_elem) || (jj >= m_n_elem) ), "Mat::elem(): index out of bounds" ); + arma_conform_check_bounds( ( (ii >= m_n_elem) || (jj >= m_n_elem) ), "Mat::elem(): index out of bounds" ); arma_rng::randn::dual_val( m_mem[ii], m_mem[jj] ); } @@ -555,7 +555,7 @@ subview_elem1::randn() { const uword ii = aa_mem[iq]; - arma_debug_check_bounds( (ii >= m_n_elem) , "Mat::elem(): index out of bounds" ); + arma_conform_check_bounds( (ii >= m_n_elem) , "Mat::elem(): index out of bounds" ); m_mem[ii] = eT(arma_rng::randn()); } @@ -568,7 +568,7 @@ inline void subview_elem1::operator+= (const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(val); } @@ -580,7 +580,7 @@ inline void subview_elem1::operator-= (const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(val); } @@ -592,7 +592,7 @@ inline void subview_elem1::operator*= (const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(val); } @@ -604,7 +604,7 @@ inline void subview_elem1::operator/= (const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(val); } @@ -622,7 +622,7 @@ inline void subview_elem1::operator_equ(const subview_elem1& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -636,7 +636,7 @@ inline void subview_elem1::operator= (const subview_elem1& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).operator_equ(x); } @@ -649,7 +649,7 @@ inline void subview_elem1::operator= (const subview_elem1& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).operator_equ(x); } @@ -662,7 +662,7 @@ inline void subview_elem1::operator+= (const subview_elem1& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -675,7 +675,7 @@ inline void subview_elem1::operator-= (const subview_elem1& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -688,7 +688,7 @@ inline void subview_elem1::operator%= (const subview_elem1& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -701,7 +701,7 @@ inline void subview_elem1::operator/= (const subview_elem1& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -714,7 +714,7 @@ inline void subview_elem1::operator= (const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -727,7 +727,7 @@ inline void subview_elem1::operator+= (const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -740,7 +740,7 @@ inline void subview_elem1::operator-= (const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -753,7 +753,7 @@ inline void subview_elem1::operator%= (const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -766,7 +766,7 @@ inline void subview_elem1::operator/= (const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -783,12 +783,12 @@ inline void subview_elem1::extract(Mat& actual_out, const subview_elem1& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap_check_mixed tmp1(in.a.get_ref(), actual_out); const umat& aa = tmp1.M; - arma_debug_check + arma_conform_check ( ( (aa.is_vec() == false) && (aa.is_empty() == false) ), "Mat::elem(): given object must be a vector" @@ -804,7 +804,7 @@ subview_elem1::extract(Mat& actual_out, const subview_elem1& i const bool alias = (&actual_out == &m_local); - if(alias) { arma_extra_debug_print("subview_elem1::extract(): aliasing detected"); } + if(alias) { arma_debug_print("subview_elem1::extract(): aliasing detected"); } Mat* tmp_out = alias ? new Mat() : nullptr; Mat& out = alias ? *tmp_out : actual_out; @@ -819,7 +819,7 @@ subview_elem1::extract(Mat& actual_out, const subview_elem1& i const uword ii = aa_mem[i]; const uword jj = aa_mem[j]; - arma_debug_check_bounds( ( (ii >= m_n_elem) || (jj >= m_n_elem) ), "Mat::elem(): index out of bounds" ); + arma_conform_check_bounds( ( (ii >= m_n_elem) || (jj >= m_n_elem) ), "Mat::elem(): index out of bounds" ); out_mem[i] = m_mem[ii]; out_mem[j] = m_mem[jj]; @@ -829,7 +829,7 @@ subview_elem1::extract(Mat& actual_out, const subview_elem1& i { const uword ii = aa_mem[i]; - arma_debug_check_bounds( (ii >= m_n_elem) , "Mat::elem(): index out of bounds" ); + arma_conform_check_bounds( (ii >= m_n_elem) , "Mat::elem(): index out of bounds" ); out_mem[i] = m_mem[ii]; } @@ -849,12 +849,12 @@ inline void subview_elem1::mat_inplace_op(Mat& out, const subview_elem1& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const unwrap tmp1(in.a.get_ref()); const umat& aa = tmp1.M; - arma_debug_check + arma_conform_check ( ( (aa.is_vec() == false) && (aa.is_empty() == false) ), "Mat::elem(): given object must be a vector" @@ -869,7 +869,7 @@ subview_elem1::mat_inplace_op(Mat& out, const subview_elem1& in) const eT* m_mem = m_local.memptr(); const uword m_n_elem = m_local.n_elem; - arma_debug_check( (out.n_elem != aa_n_elem), "Mat::elem(): size mismatch" ); + arma_conform_check( (out.n_elem != aa_n_elem), "Mat::elem(): size mismatch" ); eT* out_mem = out.memptr(); @@ -879,7 +879,7 @@ subview_elem1::mat_inplace_op(Mat& out, const subview_elem1& in) const uword ii = aa_mem[i]; const uword jj = aa_mem[j]; - arma_debug_check_bounds( ( (ii >= m_n_elem) || (jj >= m_n_elem) ), "Mat::elem(): index out of bounds" ); + arma_conform_check_bounds( ( (ii >= m_n_elem) || (jj >= m_n_elem) ), "Mat::elem(): index out of bounds" ); if(is_same_type::yes) { out_mem[i] += m_mem[ii]; out_mem[j] += m_mem[jj]; } if(is_same_type::yes) { out_mem[i] -= m_mem[ii]; out_mem[j] -= m_mem[jj]; } @@ -891,7 +891,7 @@ subview_elem1::mat_inplace_op(Mat& out, const subview_elem1& in) { const uword ii = aa_mem[i]; - arma_debug_check_bounds( (ii >= m_n_elem) , "Mat::elem(): index out of bounds" ); + arma_conform_check_bounds( (ii >= m_n_elem) , "Mat::elem(): index out of bounds" ); if(is_same_type::yes) { out_mem[i] += m_mem[ii]; } if(is_same_type::yes) { out_mem[i] -= m_mem[ii]; } @@ -907,7 +907,7 @@ inline void subview_elem1::plus_inplace(Mat& out, const subview_elem1& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); mat_inplace_op(out, in); } @@ -919,7 +919,7 @@ inline void subview_elem1::minus_inplace(Mat& out, const subview_elem1& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); mat_inplace_op(out, in); } @@ -931,7 +931,7 @@ inline void subview_elem1::schur_inplace(Mat& out, const subview_elem1& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); mat_inplace_op(out, in); } @@ -943,7 +943,7 @@ inline void subview_elem1::div_inplace(Mat& out, const subview_elem1& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); mat_inplace_op(out, in); } diff --git a/inst/include/armadillo_bits/subview_elem2_meat.hpp b/inst/include/armadillo_bits/subview_elem2_meat.hpp index 69d5f5d7..a6e9dc23 100644 --- a/inst/include/armadillo_bits/subview_elem2_meat.hpp +++ b/inst/include/armadillo_bits/subview_elem2_meat.hpp @@ -24,7 +24,7 @@ template inline subview_elem2::~subview_elem2() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -44,7 +44,7 @@ subview_elem2::subview_elem2 , all_rows (in_all_rows) , all_cols (in_all_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -55,7 +55,7 @@ inline void subview_elem2::inplace_op(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat& m_local = const_cast< Mat& >(m); @@ -70,7 +70,7 @@ subview_elem2::inplace_op(const eT val) const umat& ri = tmp1.M; const umat& ci = tmp2.M; - arma_debug_check + arma_conform_check ( ( ((ri.is_vec() == false) && (ri.is_empty() == false)) || ((ci.is_vec() == false) && (ci.is_empty() == false)) ), "Mat::elem(): given object must be a vector" @@ -86,13 +86,13 @@ subview_elem2::inplace_op(const eT val) { const uword col = ci_mem[ci_count]; - arma_debug_check_bounds( (col >= m_n_cols), "Mat::elem(): index out of bounds" ); + arma_conform_check_bounds( (col >= m_n_cols), "Mat::elem(): index out of bounds" ); for(uword ri_count=0; ri_count < ri_n_elem; ++ri_count) { const uword row = ri_mem[ri_count]; - arma_debug_check_bounds( (row >= m_n_rows), "Mat::elem(): index out of bounds" ); + arma_conform_check_bounds( (row >= m_n_rows), "Mat::elem(): index out of bounds" ); if(is_same_type::yes) { m_local.at(row,col) = val; } if(is_same_type::yes) { m_local.at(row,col) += val; } @@ -109,7 +109,7 @@ subview_elem2::inplace_op(const eT val) const umat& ci = tmp2.M; - arma_debug_check + arma_conform_check ( ( (ci.is_vec() == false) && (ci.is_empty() == false) ), "Mat::elem(): given object must be a vector" @@ -122,7 +122,7 @@ subview_elem2::inplace_op(const eT val) { const uword col = ci_mem[ci_count]; - arma_debug_check_bounds( (col >= m_n_cols), "Mat::elem(): index out of bounds" ); + arma_conform_check_bounds( (col >= m_n_cols), "Mat::elem(): index out of bounds" ); eT* colptr = m_local.colptr(col); @@ -140,7 +140,7 @@ subview_elem2::inplace_op(const eT val) const umat& ri = tmp1.M; - arma_debug_check + arma_conform_check ( ( (ri.is_vec() == false) && (ri.is_empty() == false) ), "Mat::elem(): given object must be a vector" @@ -155,7 +155,7 @@ subview_elem2::inplace_op(const eT val) { const uword row = ri_mem[ri_count]; - arma_debug_check_bounds( (row >= m_n_rows), "Mat::elem(): index out of bounds" ); + arma_conform_check_bounds( (row >= m_n_rows), "Mat::elem(): index out of bounds" ); if(is_same_type::yes) { m_local.at(row,col) = val; } if(is_same_type::yes) { m_local.at(row,col) += val; } @@ -175,7 +175,7 @@ inline void subview_elem2::inplace_op(const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat& m_local = const_cast< Mat& >(m); @@ -193,7 +193,7 @@ subview_elem2::inplace_op(const Base& x) const umat& ri = tmp1.M; const umat& ci = tmp2.M; - arma_debug_check + arma_conform_check ( ( ((ri.is_vec() == false) && (ri.is_empty() == false)) || ((ci.is_vec() == false) && (ci.is_empty() == false)) ), "Mat::elem(): given object must be a vector" @@ -205,19 +205,19 @@ subview_elem2::inplace_op(const Base& x) const uword* ci_mem = ci.memptr(); const uword ci_n_elem = ci.n_elem; - arma_debug_assert_same_size( ri_n_elem, ci_n_elem, X.n_rows, X.n_cols, "Mat::elem()" ); + arma_conform_assert_same_size( ri_n_elem, ci_n_elem, X.n_rows, X.n_cols, "Mat::elem()" ); for(uword ci_count=0; ci_count < ci_n_elem; ++ci_count) { const uword col = ci_mem[ci_count]; - arma_debug_check_bounds( (col >= m_n_cols), "Mat::elem(): index out of bounds" ); + arma_conform_check_bounds( (col >= m_n_cols), "Mat::elem(): index out of bounds" ); for(uword ri_count=0; ri_count < ri_n_elem; ++ri_count) { const uword row = ri_mem[ri_count]; - arma_debug_check_bounds( (row >= m_n_rows), "Mat::elem(): index out of bounds" ); + arma_conform_check_bounds( (row >= m_n_rows), "Mat::elem(): index out of bounds" ); if(is_same_type::yes) { m_local.at(row,col) = X.at(ri_count, ci_count); } if(is_same_type::yes) { m_local.at(row,col) += X.at(ri_count, ci_count); } @@ -234,7 +234,7 @@ subview_elem2::inplace_op(const Base& x) const umat& ci = tmp2.M; - arma_debug_check + arma_conform_check ( ( (ci.is_vec() == false) && (ci.is_empty() == false) ), "Mat::elem(): given object must be a vector" @@ -243,13 +243,13 @@ subview_elem2::inplace_op(const Base& x) const uword* ci_mem = ci.memptr(); const uword ci_n_elem = ci.n_elem; - arma_debug_assert_same_size( m_n_rows, ci_n_elem, X.n_rows, X.n_cols, "Mat::elem()" ); + arma_conform_assert_same_size( m_n_rows, ci_n_elem, X.n_rows, X.n_cols, "Mat::elem()" ); for(uword ci_count=0; ci_count < ci_n_elem; ++ci_count) { const uword col = ci_mem[ci_count]; - arma_debug_check_bounds( (col >= m_n_cols), "Mat::elem(): index out of bounds" ); + arma_conform_check_bounds( (col >= m_n_cols), "Mat::elem(): index out of bounds" ); eT* m_colptr = m_local.colptr(col); const eT* X_colptr = X.colptr(ci_count); @@ -268,7 +268,7 @@ subview_elem2::inplace_op(const Base& x) const umat& ri = tmp1.M; - arma_debug_check + arma_conform_check ( ( (ri.is_vec() == false) && (ri.is_empty() == false) ), "Mat::elem(): given object must be a vector" @@ -277,7 +277,7 @@ subview_elem2::inplace_op(const Base& x) const uword* ri_mem = ri.memptr(); const uword ri_n_elem = ri.n_elem; - arma_debug_assert_same_size( ri_n_elem, m_n_cols, X.n_rows, X.n_cols, "Mat::elem()" ); + arma_conform_assert_same_size( ri_n_elem, m_n_cols, X.n_rows, X.n_cols, "Mat::elem()" ); for(uword col=0; col < m_n_cols; ++col) { @@ -285,7 +285,7 @@ subview_elem2::inplace_op(const Base& x) { const uword row = ri_mem[ri_count]; - arma_debug_check_bounds( (row >= m_n_rows), "Mat::elem(): index out of bounds" ); + arma_conform_check_bounds( (row >= m_n_rows), "Mat::elem(): index out of bounds" ); if(is_same_type::yes) { m_local.at(row,col) = X.at(ri_count, col); } if(is_same_type::yes) { m_local.at(row,col) += X.at(ri_count, col); } @@ -309,7 +309,7 @@ inline void subview_elem2::replace(const eT old_val, const eT new_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat tmp(*this); @@ -325,7 +325,7 @@ inline void subview_elem2::clean(const pod_type threshold) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat tmp(*this); @@ -341,7 +341,7 @@ inline void subview_elem2::clamp(const eT min_val, const eT max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat tmp(*this); @@ -357,7 +357,7 @@ inline void subview_elem2::fill(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(val); } @@ -369,7 +369,7 @@ inline void subview_elem2::zeros() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(eT(0)); } @@ -381,7 +381,7 @@ inline void subview_elem2::ones() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(eT(1)); } @@ -393,7 +393,7 @@ inline void subview_elem2::operator+= (const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(val); } @@ -405,7 +405,7 @@ inline void subview_elem2::operator-= (const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(val); } @@ -417,7 +417,7 @@ inline void subview_elem2::operator*= (const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(val); } @@ -429,7 +429,7 @@ inline void subview_elem2::operator/= (const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(val); } @@ -447,7 +447,7 @@ inline void subview_elem2::operator_equ(const subview_elem2& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -461,7 +461,7 @@ inline void subview_elem2::operator= (const subview_elem2& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).operator_equ(x); } @@ -474,7 +474,7 @@ inline void subview_elem2::operator= (const subview_elem2& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).operator_equ(x); } @@ -487,7 +487,7 @@ inline void subview_elem2::operator+= (const subview_elem2& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -500,7 +500,7 @@ inline void subview_elem2::operator-= (const subview_elem2& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -513,7 +513,7 @@ inline void subview_elem2::operator%= (const subview_elem2& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -526,7 +526,7 @@ inline void subview_elem2::operator/= (const subview_elem2& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -539,7 +539,7 @@ inline void subview_elem2::operator= (const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -552,7 +552,7 @@ inline void subview_elem2::operator+= (const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -565,7 +565,7 @@ inline void subview_elem2::operator-= (const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -578,7 +578,7 @@ inline void subview_elem2::operator%= (const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -591,7 +591,7 @@ inline void subview_elem2::operator/= (const Base& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x); } @@ -609,7 +609,7 @@ inline void subview_elem2::operator= (const SpBase& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat tmp(x); @@ -624,7 +624,7 @@ inline void subview_elem2::operator+= (const SpBase& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat tmp(x); @@ -639,7 +639,7 @@ inline void subview_elem2::operator-= (const SpBase& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat tmp(x); @@ -654,7 +654,7 @@ inline void subview_elem2::operator%= (const SpBase& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat tmp(x); @@ -669,7 +669,7 @@ inline void subview_elem2::operator/= (const SpBase& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat tmp(x); @@ -688,7 +688,7 @@ inline void subview_elem2::extract(Mat& actual_out, const subview_elem2& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat& m_local = const_cast< Mat& >(in.m); @@ -697,7 +697,7 @@ subview_elem2::extract(Mat& actual_out, const subview_elem2* tmp_out = alias ? new Mat() : nullptr; Mat& out = alias ? *tmp_out : actual_out; @@ -710,7 +710,7 @@ subview_elem2::extract(Mat& actual_out, const subview_elem2::extract(Mat& actual_out, const subview_elem2= m_n_cols), "Mat::elem(): index out of bounds" ); + arma_conform_check_bounds( (col >= m_n_cols), "Mat::elem(): index out of bounds" ); for(uword ri_count=0; ri_count < ri_n_elem; ++ri_count) { const uword row = ri_mem[ri_count]; - arma_debug_check_bounds( (row >= m_n_rows), "Mat::elem(): index out of bounds" ); + arma_conform_check_bounds( (row >= m_n_rows), "Mat::elem(): index out of bounds" ); out_mem[out_count] = m_local.at(row,col); ++out_count; @@ -751,7 +751,7 @@ subview_elem2::extract(Mat& actual_out, const subview_elem2::extract(Mat& actual_out, const subview_elem2= m_n_cols), "Mat::elem(): index out of bounds" ); + arma_conform_check_bounds( (col >= m_n_cols), "Mat::elem(): index out of bounds" ); arrayops::copy( out.colptr(ci_count), m_local.colptr(col), m_n_rows ); } @@ -778,7 +778,7 @@ subview_elem2::extract(Mat& actual_out, const subview_elem2::extract(Mat& actual_out, const subview_elem2= m_n_rows), "Mat::elem(): index out of bounds" ); + arma_conform_check_bounds( (row >= m_n_rows), "Mat::elem(): index out of bounds" ); out.at(ri_count,col) = m_local.at(row,col); } @@ -819,7 +819,7 @@ inline void subview_elem2::plus_inplace(Mat& out, const subview_elem2& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat tmp(in); @@ -833,7 +833,7 @@ inline void subview_elem2::minus_inplace(Mat& out, const subview_elem2& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat tmp(in); @@ -847,7 +847,7 @@ inline void subview_elem2::schur_inplace(Mat& out, const subview_elem2& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat tmp(in); @@ -861,7 +861,7 @@ inline void subview_elem2::div_inplace(Mat& out, const subview_elem2& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat tmp(in); diff --git a/inst/include/armadillo_bits/subview_field_meat.hpp b/inst/include/armadillo_bits/subview_field_meat.hpp index dafc4df4..7a402e19 100644 --- a/inst/include/armadillo_bits/subview_field_meat.hpp +++ b/inst/include/armadillo_bits/subview_field_meat.hpp @@ -24,7 +24,7 @@ template inline subview_field::~subview_field() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -48,7 +48,7 @@ subview_field::subview_field , n_slices( (in_f.n_slices > 0) ? uword(1) : uword(0) ) , n_elem(in_n_rows*in_n_cols*n_slices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -74,7 +74,7 @@ subview_field::subview_field , n_slices(in_n_slices) , n_elem(in_n_rows*in_n_cols*in_n_slices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -84,11 +84,11 @@ inline void subview_field::operator= (const field& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_field& t = *this; - arma_debug_check( (t.n_rows != x.n_rows) || (t.n_cols != x.n_cols) || (t.n_slices != x.n_slices), "incompatible field dimensions" ); + arma_conform_check( (t.n_rows != x.n_rows) || (t.n_cols != x.n_cols) || (t.n_slices != x.n_slices), "incompatible field dimensions" ); if(t.n_slices == 1) { @@ -117,7 +117,7 @@ inline void subview_field::operator= (const subview_field& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(check_overlap(x)) { @@ -130,7 +130,7 @@ subview_field::operator= (const subview_field& x) subview_field& t = *this; - arma_debug_check( (t.n_rows != x.n_rows) || (t.n_cols != x.n_cols) || (t.n_slices != x.n_slices), "incompatible field dimensions" ); + arma_conform_check( (t.n_rows != x.n_rows) || (t.n_cols != x.n_cols) || (t.n_slices != x.n_slices), "incompatible field dimensions" ); if(t.n_slices == 1) { @@ -200,7 +200,7 @@ arma_inline oT& subview_field::operator()(const uword i) { - arma_debug_check_bounds( (i >= n_elem), "subview_field::operator(): index out of bounds" ); + arma_conform_check_bounds( (i >= n_elem), "subview_field::operator(): index out of bounds" ); return operator[](i); } @@ -212,7 +212,7 @@ arma_inline const oT& subview_field::operator()(const uword i) const { - arma_debug_check_bounds( (i >= n_elem), "subview_field::operator(): index out of bounds" ); + arma_conform_check_bounds( (i >= n_elem), "subview_field::operator(): index out of bounds" ); return operator[](i); } @@ -244,7 +244,7 @@ arma_inline oT& subview_field::operator()(const uword in_row, const uword in_col, const uword in_slice) { - arma_debug_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols) || (in_slice >= n_slices)), "subview_field::operator(): index out of bounds" ); + arma_conform_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols) || (in_slice >= n_slices)), "subview_field::operator(): index out of bounds" ); const uword index = (in_slice + aux_slice1)*(f.n_rows*f.n_cols) + (in_col + aux_col1)*f.n_rows + aux_row1 + in_row; @@ -258,7 +258,7 @@ arma_inline const oT& subview_field::operator()(const uword in_row, const uword in_col, const uword in_slice) const { - arma_debug_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols) || (in_slice >= n_slices)), "subview_field::operator(): index out of bounds" ); + arma_conform_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols) || (in_slice >= n_slices)), "subview_field::operator(): index out of bounds" ); const uword index = (in_slice + aux_slice1)*(f.n_rows*f.n_cols) + (in_col + aux_col1)*f.n_rows + aux_row1 + in_row; @@ -374,7 +374,7 @@ inline void subview_field::print(const std::string extra_text) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(extra_text.length() != 0) { @@ -395,7 +395,7 @@ inline void subview_field::print(std::ostream& user_stream, const std::string extra_text) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(extra_text.length() != 0) { @@ -417,7 +417,7 @@ inline void subview_field::for_each(functor F) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_field& t = *this; @@ -448,7 +448,7 @@ inline void subview_field::for_each(functor F) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const subview_field& t = *this; @@ -478,7 +478,7 @@ inline void subview_field::fill(const oT& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview_field& t = *this; @@ -509,7 +509,7 @@ inline void subview_field::extract(field& actual_out, const subview_field& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // const bool alias = (&actual_out == &in.f); @@ -525,7 +525,7 @@ subview_field::extract(field& actual_out, const subview_field& in) out.set_size(n_rows, n_cols, n_slices); - arma_extra_debug_print(arma_str::format("out.n_rows = %u out.n_cols = %u out.n_slices = %u in.m.n_rows = %u in.m.n_cols = %u in.m.n_slices = %u") % out.n_rows % out.n_cols % out.n_slices % in.f.n_rows % in.f.n_cols % in.f.n_slices); + arma_debug_print(arma_str::format("out.n_rows: %u; out.n_cols: %u; out.n_slices: %u; n.m.n_rows: %u; in.m.n_cols: %u; in.m.n_slices: %u") % out.n_rows % out.n_cols % out.n_slices % in.f.n_rows % in.f.n_cols % in.f.n_slices); if(n_slices == 1) { diff --git a/inst/include/armadillo_bits/subview_meat.hpp b/inst/include/armadillo_bits/subview_meat.hpp index 543383db..6535eb9b 100644 --- a/inst/include/armadillo_bits/subview_meat.hpp +++ b/inst/include/armadillo_bits/subview_meat.hpp @@ -24,7 +24,7 @@ template inline subview::~subview() { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } @@ -39,7 +39,7 @@ subview::subview(const Mat& in_m, const uword in_row1, const uword in_co , n_cols (in_n_cols) , n_elem (in_n_rows*in_n_cols) { - arma_extra_debug_sigprint_this(this); + arma_debug_sigprint_this(this); } @@ -54,7 +54,7 @@ subview::subview(const subview& in) , n_cols (in.n_cols ) , n_elem (in.n_elem ) { - arma_extra_debug_sigprint(arma_str::format("this = %x in = %x") % this % &in); + arma_debug_sigprint(arma_str::format("this: %x; in: %x") % this % &in); } @@ -69,7 +69,7 @@ subview::subview(subview&& in) , n_cols (in.n_cols ) , n_elem (in.n_elem ) { - arma_extra_debug_sigprint(arma_str::format("this = %x in = %x") % this % &in); + arma_debug_sigprint(arma_str::format("this: %x; in: %x") % this % &in); // for paranoia @@ -88,7 +88,7 @@ inline void subview::inplace_op(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview& s = *this; @@ -140,7 +140,7 @@ inline void subview::inplace_op(const Base& in, const char* identifier) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Proxy P(in.get_ref()); @@ -149,12 +149,12 @@ subview::inplace_op(const Base& in, const char* identifier) const uword s_n_rows = s.n_rows; const uword s_n_cols = s.n_cols; - arma_debug_assert_same_size(s, P, identifier); + arma_conform_assert_same_size(s, P, identifier); const bool use_mp = arma_config::openmp && Proxy::use_mp && mp_gate::eval(s.n_elem); const bool has_overlap = P.has_overlap(s); - if(has_overlap) { arma_extra_debug_print("aliasing or overlap detected"); } + if(has_overlap) { arma_debug_print("aliasing or overlap detected"); } if( (is_Mat::stored_type>::value) || (use_mp) || (has_overlap) ) { @@ -329,7 +329,7 @@ inline void subview::inplace_op(const subview& x, const char* identifier) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(check_overlap(x)) { @@ -346,7 +346,7 @@ subview::inplace_op(const subview& x, const char* identifier) subview& s = *this; - arma_debug_assert_same_size(s, x, identifier); + arma_conform_assert_same_size(s, x, identifier); const uword s_n_cols = s.n_cols; const uword s_n_rows = s.n_rows; @@ -404,11 +404,11 @@ inline void subview::operator= (const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(n_elem != 1) { - arma_debug_assert_same_size(n_rows, n_cols, 1, 1, "copy into submatrix"); + arma_conform_assert_same_size(n_rows, n_cols, 1, 1, "copy into submatrix"); } Mat& X = const_cast< Mat& >(m); @@ -423,7 +423,7 @@ inline void subview::operator+= (const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(val); } @@ -435,7 +435,7 @@ inline void subview::operator-= (const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(val); } @@ -447,7 +447,7 @@ inline void subview::operator*= (const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(val); } @@ -459,7 +459,7 @@ inline void subview::operator/= (const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(val); } @@ -471,7 +471,7 @@ inline void subview::operator= (const subview& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x, "copy into submatrix"); } @@ -483,7 +483,7 @@ inline void subview::operator+= (const subview& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x, "addition"); } @@ -495,7 +495,7 @@ inline void subview::operator-= (const subview& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x, "subtraction"); } @@ -507,7 +507,7 @@ inline void subview::operator%= (const subview& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x, "element-wise multiplication"); } @@ -519,7 +519,7 @@ inline void subview::operator/= (const subview& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(x, "element-wise division"); } @@ -532,7 +532,7 @@ inline void subview::operator= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(in, "copy into submatrix"); } @@ -545,7 +545,7 @@ inline void subview::operator+= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(in, "addition"); } @@ -558,7 +558,7 @@ inline void subview::operator-= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(in, "subtraction"); } @@ -571,7 +571,7 @@ inline void subview::operator%= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(in, "element-wise multiplication"); } @@ -584,7 +584,7 @@ inline void subview::operator/= (const Base& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); inplace_op(in, "element-wise division"); } @@ -597,11 +597,11 @@ inline void subview::operator=(const SpBase& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy p(x.get_ref()); - arma_debug_assert_same_size(n_rows, n_cols, p.get_n_rows(), p.get_n_cols(), "copy into submatrix"); + arma_conform_assert_same_size(n_rows, n_cols, p.get_n_rows(), p.get_n_cols(), "copy into submatrix"); // Clear the subview. zeros(); @@ -625,11 +625,11 @@ inline void subview::operator+=(const SpBase& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy p(x.get_ref()); - arma_debug_assert_same_size(n_rows, n_cols, p.get_n_rows(), p.get_n_cols(), "addition"); + arma_conform_assert_same_size(n_rows, n_cols, p.get_n_rows(), p.get_n_cols(), "addition"); // Iterate through the sparse subview and add its values. typename SpProxy::const_iterator_type cit = p.begin(); @@ -650,11 +650,11 @@ inline void subview::operator-=(const SpBase& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy p(x.get_ref()); - arma_debug_assert_same_size(n_rows, n_cols, p.get_n_rows(), p.get_n_cols(), "subtraction"); + arma_conform_assert_same_size(n_rows, n_cols, p.get_n_rows(), p.get_n_cols(), "subtraction"); // Iterate through the sparse subview and subtract its values. typename SpProxy::const_iterator_type cit = p.begin(); @@ -675,14 +675,14 @@ inline void subview::operator%=(const SpBase& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword s_n_rows = (*this).n_rows; const uword s_n_cols = (*this).n_cols; const SpProxy p(x.get_ref()); - arma_debug_assert_same_size(s_n_rows, s_n_cols, p.get_n_rows(), p.get_n_cols(), "element-wise multiplication"); + arma_conform_assert_same_size(s_n_rows, s_n_cols, p.get_n_rows(), p.get_n_cols(), "element-wise multiplication"); if(n_elem == 0) { return; } @@ -723,11 +723,11 @@ inline void subview::operator/=(const SpBase& x) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const SpProxy p(x.get_ref()); - arma_debug_assert_same_size(n_rows, n_cols, p.get_n_rows(), p.get_n_cols(), "element-wise division"); + arma_conform_assert_same_size(n_rows, n_cols, p.get_n_rows(), p.get_n_cols(), "element-wise division"); // This is probably going to fill your subview with a bunch of NaNs, // so I'm not going to bother to implement it fast. @@ -747,9 +747,9 @@ inline typename enable_if2< is_same_type::value, void>::result subview::operator= (const Gen& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(n_rows, n_cols, in.n_rows, in.n_cols, "copy into submatrix"); + arma_conform_assert_same_size(n_rows, n_cols, in.n_rows, in.n_cols, "copy into submatrix"); in.apply(*this); } @@ -761,15 +761,15 @@ inline void subview::operator=(const std::initializer_list& list) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (is_vec() == false), "copy into submatrix: size mismatch" ); + arma_conform_check( (is_vec() == false), "copy into submatrix: size mismatch" ); const uword N = uword(list.size()); if(n_rows == 1) { - arma_debug_assert_same_size(1, n_cols, 1, N, "copy into submatrix"); + arma_conform_assert_same_size(1, n_cols, 1, N, "copy into submatrix"); auto it = list.begin(); @@ -778,7 +778,7 @@ subview::operator=(const std::initializer_list& list) else if(n_cols == 1) { - arma_debug_assert_same_size(n_rows, 1, N, 1, "copy into submatrix"); + arma_conform_assert_same_size(n_rows, 1, N, 1, "copy into submatrix"); arrayops::copy( (*this).colptr(0), list.begin(), N ); } @@ -791,7 +791,7 @@ inline void subview::operator=(const std::initializer_list< std::initializer_list >& list) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat tmp(list); @@ -807,7 +807,7 @@ inline void subview::for_each(functor F) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat& X = const_cast< Mat& >(m); @@ -846,7 +846,7 @@ inline void subview::for_each(functor F) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const Mat& X = m; @@ -886,7 +886,7 @@ inline void subview::transform(functor F) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat& X = const_cast< Mat& >(m); @@ -926,7 +926,7 @@ inline void subview::imbue(functor F) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); Mat& X = const_cast< Mat& >(m); @@ -964,7 +964,7 @@ inline void subview::replace(const eT old_val, const eT new_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview& s = *this; @@ -1014,7 +1014,7 @@ inline void subview::clean(const typename get_pod_type::result threshold) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview& s = *this; @@ -1034,16 +1034,16 @@ inline void subview::clamp(const eT min_val, const eT max_val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(is_cx::no) { - arma_debug_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "subview::clamp(): min_val must be less than max_val" ); + arma_conform_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "subview::clamp(): min_val must be less than max_val" ); } else { - arma_debug_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "subview::clamp(): real(min_val) must be less than real(max_val)" ); - arma_debug_check( (access::tmp_imag(min_val) > access::tmp_imag(max_val)), "subview::clamp(): imag(min_val) must be less than imag(max_val)" ); + arma_conform_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "subview::clamp(): real(min_val) must be less than real(max_val)" ); + arma_conform_check( (access::tmp_imag(min_val) > access::tmp_imag(max_val)), "subview::clamp(): imag(min_val) must be less than imag(max_val)" ); } subview& s = *this; @@ -1064,7 +1064,7 @@ inline void subview::fill(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview& s = *this; @@ -1114,7 +1114,7 @@ inline void subview::zeros() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).fill(eT(0)); } @@ -1126,7 +1126,7 @@ inline void subview::ones() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).fill(eT(1)); } @@ -1138,7 +1138,7 @@ inline void subview::eye() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); (*this).zeros(); @@ -1157,7 +1157,7 @@ inline void subview::randu() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview& s = (*this); @@ -1197,7 +1197,7 @@ inline void subview::randn() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview& s = (*this); @@ -1277,7 +1277,7 @@ inline eT& subview::operator()(const uword ii) { - arma_debug_check_bounds( (ii >= n_elem), "subview::operator(): index out of bounds" ); + arma_conform_check_bounds( (ii >= n_elem), "subview::operator(): index out of bounds" ); const uword in_col = ii / n_rows; const uword in_row = ii % n_rows; @@ -1294,7 +1294,7 @@ inline eT subview::operator()(const uword ii) const { - arma_debug_check_bounds( (ii >= n_elem), "subview::operator(): index out of bounds" ); + arma_conform_check_bounds( (ii >= n_elem), "subview::operator(): index out of bounds" ); const uword in_col = ii / n_rows; const uword in_row = ii % n_rows; @@ -1311,7 +1311,7 @@ inline eT& subview::operator()(const uword in_row, const uword in_col) { - arma_debug_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols)), "subview::operator(): index out of bounds" ); + arma_conform_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols)), "subview::operator(): index out of bounds" ); const uword index = (in_col + aux_col1)*m.n_rows + aux_row1 + in_row; @@ -1325,7 +1325,7 @@ inline eT subview::operator()(const uword in_row, const uword in_col) const { - arma_debug_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols)), "subview::operator(): index out of bounds" ); + arma_conform_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols)), "subview::operator(): index out of bounds" ); const uword index = (in_col + aux_col1)*m.n_rows + aux_row1 + in_row; @@ -1483,9 +1483,9 @@ inline bool subview::is_finite() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "is_finite(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_conform_warn(1, "is_finite(): detection of non-finite values is not reliable in fast math mode"); } const uword local_n_rows = n_rows; const uword local_n_cols = n_cols; @@ -1505,7 +1505,7 @@ inline bool subview::is_zero(const typename get_pod_type::result tol) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword local_n_rows = n_rows; const uword local_n_cols = n_cols; @@ -1525,9 +1525,9 @@ inline bool subview::has_inf() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "has_inf(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_inf(): detection of non-finite values is not reliable in fast math mode"); } const uword local_n_rows = n_rows; const uword local_n_cols = n_cols; @@ -1547,9 +1547,9 @@ inline bool subview::has_nan() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "has_nan(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_nan(): detection of non-finite values is not reliable in fast math mode"); } const uword local_n_rows = n_rows; const uword local_n_cols = n_cols; @@ -1569,9 +1569,9 @@ inline bool subview::has_nonfinite() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "has_nonfinite(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_nonfinite(): detection of non-finite values is not reliable in fast math mode"); } const uword local_n_rows = n_rows; const uword local_n_cols = n_cols; @@ -1592,7 +1592,7 @@ inline void subview::extract(Mat& out, const subview& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: we're assuming that the matrix has already been set to the correct size and there is no aliasing; // size setting and alias checking is done by either the Mat contructor or operator=() @@ -1600,14 +1600,14 @@ subview::extract(Mat& out, const subview& in) const uword n_rows = in.n_rows; // number of rows in the subview const uword n_cols = in.n_cols; // number of columns in the subview - arma_extra_debug_print(arma_str::format("out.n_rows = %u out.n_cols = %u in.m.n_rows = %u in.m.n_cols = %u") % out.n_rows % out.n_cols % in.m.n_rows % in.m.n_cols ); + arma_debug_print(arma_str::format("out.n_rows: %u; out.n_cols: %u; in.m.n_rows: %u; in.m.n_cols: %u") % out.n_rows % out.n_cols % in.m.n_rows % in.m.n_cols ); if(in.is_vec()) { if(n_cols == 1) // a column vector { - arma_extra_debug_print("subview::extract(): copying col (going across rows)"); + arma_debug_print("subview::extract(): copying col (going across rows)"); // in.colptr(0) the first column of the subview, taking into account any row offset arrayops::copy( out.memptr(), in.colptr(0), n_rows ); @@ -1615,7 +1615,7 @@ subview::extract(Mat& out, const subview& in) else if(n_rows == 1) // a row vector { - arma_extra_debug_print("subview::extract(): copying row (going across columns)"); + arma_debug_print("subview::extract(): copying row (going across columns)"); eT* out_mem = out.memptr(); @@ -1642,7 +1642,7 @@ subview::extract(Mat& out, const subview& in) } else // general submatrix { - arma_extra_debug_print("subview::extract(): general submatrix"); + arma_debug_print("subview::extract(): general submatrix"); if( (in.aux_row1 == 0) && (n_rows == in.m.n_rows) ) { @@ -1666,9 +1666,9 @@ inline void subview::plus_inplace(Mat& out, const subview& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(out, in, "addition"); + arma_conform_assert_same_size(out, in, "addition"); const uword n_rows = in.n_rows; const uword n_cols = in.n_cols; @@ -1714,9 +1714,9 @@ inline void subview::minus_inplace(Mat& out, const subview& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(out, in, "subtraction"); + arma_conform_assert_same_size(out, in, "subtraction"); const uword n_rows = in.n_rows; const uword n_cols = in.n_cols; @@ -1762,9 +1762,9 @@ inline void subview::schur_inplace(Mat& out, const subview& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(out, in, "element-wise multiplication"); + arma_conform_assert_same_size(out, in, "element-wise multiplication"); const uword n_rows = in.n_rows; const uword n_cols = in.n_cols; @@ -1810,9 +1810,9 @@ inline void subview::div_inplace(Mat& out, const subview& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(out, in, "element-wise division"); + arma_conform_assert_same_size(out, in, "element-wise division"); const uword n_rows = in.n_rows; const uword n_cols = in.n_cols; @@ -1858,9 +1858,9 @@ inline subview_row subview::row(const uword row_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( row_num >= n_rows, "subview::row(): out of bounds" ); + arma_conform_check_bounds( row_num >= n_rows, "subview::row(): out of bounds" ); const uword base_row = aux_row1 + row_num; @@ -1875,9 +1875,9 @@ inline const subview_row subview::row(const uword row_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( row_num >= n_rows, "subview::row(): out of bounds" ); + arma_conform_check_bounds( row_num >= n_rows, "subview::row(): out of bounds" ); const uword base_row = aux_row1 + row_num; @@ -1891,7 +1891,7 @@ inline subview_row subview::operator()(const uword row_num, const span& col_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool col_all = col_span.whole; @@ -1904,7 +1904,7 @@ subview::operator()(const uword row_num, const span& col_span) const uword base_col1 = aux_col1 + in_col1; const uword base_row = aux_row1 + row_num; - arma_debug_check_bounds + arma_conform_check_bounds ( (row_num >= n_rows) || @@ -1923,7 +1923,7 @@ inline const subview_row subview::operator()(const uword row_num, const span& col_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool col_all = col_span.whole; @@ -1936,7 +1936,7 @@ subview::operator()(const uword row_num, const span& col_span) const const uword base_col1 = aux_col1 + in_col1; const uword base_row = aux_row1 + row_num; - arma_debug_check_bounds + arma_conform_check_bounds ( (row_num >= n_rows) || @@ -1956,9 +1956,9 @@ inline subview_col subview::col(const uword col_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( col_num >= n_cols, "subview::col(): out of bounds" ); + arma_conform_check_bounds( col_num >= n_cols, "subview::col(): out of bounds" ); const uword base_col = aux_col1 + col_num; @@ -1973,9 +1973,9 @@ inline const subview_col subview::col(const uword col_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( col_num >= n_cols, "subview::col(): out of bounds" ); + arma_conform_check_bounds( col_num >= n_cols, "subview::col(): out of bounds" ); const uword base_col = aux_col1 + col_num; @@ -1989,7 +1989,7 @@ inline subview_col subview::operator()(const span& row_span, const uword col_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool row_all = row_span.whole; @@ -2002,7 +2002,7 @@ subview::operator()(const span& row_span, const uword col_num) const uword base_row1 = aux_row1 + in_row1; const uword base_col = aux_col1 + col_num; - arma_debug_check_bounds + arma_conform_check_bounds ( (col_num >= n_cols) || @@ -2021,7 +2021,7 @@ inline const subview_col subview::operator()(const span& row_span, const uword col_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool row_all = row_span.whole; @@ -2034,7 +2034,7 @@ subview::operator()(const span& row_span, const uword col_num) const const uword base_row1 = aux_row1 + in_row1; const uword base_col = aux_col1 + col_num; - arma_debug_check_bounds + arma_conform_check_bounds ( (col_num >= n_cols) || @@ -2058,9 +2058,9 @@ inline Col subview::unsafe_col(const uword col_num) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( col_num >= n_cols, "subview::unsafe_col(): out of bounds" ); + arma_conform_check_bounds( col_num >= n_cols, "subview::unsafe_col(): out of bounds" ); return Col(colptr(col_num), n_rows, false, true); } @@ -2077,9 +2077,9 @@ inline const Col subview::unsafe_col(const uword col_num) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( col_num >= n_cols, "subview::unsafe_col(): out of bounds" ); + arma_conform_check_bounds( col_num >= n_cols, "subview::unsafe_col(): out of bounds" ); return Col(const_cast(colptr(col_num)), n_rows, false, true); } @@ -2092,9 +2092,9 @@ inline subview subview::rows(const uword in_row1, const uword in_row2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_row2 >= n_rows), "subview::rows(): indices out of bounds or incorrectly used" @@ -2114,9 +2114,9 @@ inline const subview subview::rows(const uword in_row1, const uword in_row2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_row2 >= n_rows), "subview::rows(): indices out of bounds or incorrectly used" @@ -2136,9 +2136,9 @@ inline subview subview::cols(const uword in_col1, const uword in_col2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_col1 > in_col2) || (in_col2 >= n_cols), "subview::cols(): indices out of bounds or incorrectly used" @@ -2158,9 +2158,9 @@ inline const subview subview::cols(const uword in_col1, const uword in_col2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_col1 > in_col2) || (in_col2 >= n_cols), "subview::cols(): indices out of bounds or incorrectly used" @@ -2180,9 +2180,9 @@ inline subview subview::submat(const uword in_row1, const uword in_col1, const uword in_row2, const uword in_col2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols), "subview::submat(): indices out of bounds or incorrectly used" @@ -2205,9 +2205,9 @@ inline const subview subview::submat(const uword in_row1, const uword in_col1, const uword in_row2, const uword in_col2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols), "subview::submat(): indices out of bounds or incorrectly used" @@ -2230,7 +2230,7 @@ inline subview subview::submat(const span& row_span, const span& col_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool row_all = row_span.whole; const bool col_all = col_span.whole; @@ -2246,7 +2246,7 @@ subview::submat(const span& row_span, const span& col_span) const uword in_col2 = col_span.b; const uword submat_n_cols = col_all ? local_n_cols : in_col2 - in_col1 + 1; - arma_debug_check_bounds + arma_conform_check_bounds ( ( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= local_n_rows)) ) || @@ -2269,7 +2269,7 @@ inline const subview subview::submat(const span& row_span, const span& col_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const bool row_all = row_span.whole; const bool col_all = col_span.whole; @@ -2285,7 +2285,7 @@ subview::submat(const span& row_span, const span& col_span) const const uword in_col2 = col_span.b; const uword submat_n_cols = col_all ? local_n_cols : in_col2 - in_col1 + 1; - arma_debug_check_bounds + arma_conform_check_bounds ( ( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= local_n_rows)) ) || @@ -2307,7 +2307,7 @@ inline subview subview::operator()(const span& row_span, const span& col_span) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).submat(row_span, col_span); } @@ -2319,7 +2319,7 @@ inline const subview subview::operator()(const span& row_span, const span& col_span) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return (*this).submat(row_span, col_span); } @@ -2331,7 +2331,7 @@ inline subview_each1< subview, 0 > subview::each_col() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_each1< subview, 0 >(*this); } @@ -2343,7 +2343,7 @@ inline subview_each1< subview, 1 > subview::each_row() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_each1< subview, 1 >(*this); } @@ -2356,7 +2356,7 @@ inline subview_each2< subview, 0, T1 > subview::each_col(const Base& indices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_each2< subview, 0, T1 >(*this, indices); } @@ -2369,7 +2369,7 @@ inline subview_each2< subview, 1, T1 > subview::each_row(const Base& indices) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); return subview_each2< subview, 1, T1 >(*this, indices); } @@ -2382,7 +2382,7 @@ inline void subview::each_col(const std::function< void(Col&) >& F) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); for(uword ii=0; ii < n_cols; ++ii) { @@ -2398,7 +2398,7 @@ inline void subview::each_col(const std::function< void(const Col&) >& F) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); for(uword ii=0; ii < n_cols; ++ii) { @@ -2415,7 +2415,7 @@ inline void subview::each_row(const std::function< void(Row&) >& F) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); podarray array1(n_cols); podarray array2(n_cols); @@ -2467,7 +2467,7 @@ inline void subview::each_row(const std::function< void(const Row&) >& F) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); podarray array1(n_cols); podarray array2(n_cols); @@ -2510,12 +2510,12 @@ inline diagview subview::diag(const sword in_id) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword row_offset = (in_id < 0) ? uword(-in_id) : 0; const uword col_offset = (in_id > 0) ? uword( in_id) : 0; - arma_debug_check_bounds + arma_conform_check_bounds ( ((row_offset > 0) && (row_offset >= n_rows)) || ((col_offset > 0) && (col_offset >= n_cols)), "subview::diag(): requested diagonal out of bounds" @@ -2537,12 +2537,12 @@ inline const diagview subview::diag(const sword in_id) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword row_offset = uword( (in_id < 0) ? -in_id : 0 ); const uword col_offset = uword( (in_id > 0) ? in_id : 0 ); - arma_debug_check_bounds + arma_conform_check_bounds ( ((row_offset > 0) && (row_offset >= n_rows)) || ((col_offset > 0) && (col_offset >= n_cols)), "subview::diag(): requested diagonal out of bounds" @@ -2563,9 +2563,9 @@ inline void subview::swap_rows(const uword in_row1, const uword in_row2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_row1 >= n_rows) || (in_row2 >= n_rows), "subview::swap_rows(): out of bounds" @@ -2595,9 +2595,9 @@ inline void subview::swap_cols(const uword in_col1, const uword in_col2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds + arma_conform_check_bounds ( (in_col1 >= n_cols) || (in_col2 >= n_cols), "subview::swap_cols(): out of bounds" @@ -2693,7 +2693,7 @@ subview::iterator::iterator() , aux_row1 (0 ) , aux_row2_p1(0 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // Technically this iterator is invalid (it does not point to a valid element) } @@ -2709,7 +2709,7 @@ subview::iterator::iterator(const iterator& X) , aux_row1 (X.aux_row1 ) , aux_row2_p1(X.aux_row2_p1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -2724,7 +2724,7 @@ subview::iterator::iterator(subview& in_sv, const uword in_row, const uw , aux_row1 (in_sv.aux_row1 ) , aux_row2_p1(in_sv.aux_row1 + in_sv.n_rows ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -2833,7 +2833,7 @@ subview::const_iterator::const_iterator() , aux_row1 (0 ) , aux_row2_p1(0 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // Technically this iterator is invalid (it does not point to a valid element) } @@ -2849,7 +2849,7 @@ subview::const_iterator::const_iterator(const iterator& X) , aux_row1 (X.aux_row1 ) , aux_row2_p1(X.aux_row2_p1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -2864,7 +2864,7 @@ subview::const_iterator::const_iterator(const const_iterator& X) , aux_row1 (X.aux_row1 ) , aux_row2_p1(X.aux_row2_p1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -2879,7 +2879,7 @@ subview::const_iterator::const_iterator(const subview& in_sv, const uwor , aux_row1 (in_sv.aux_row1 ) , aux_row2_p1(in_sv.aux_row1 + in_sv.n_rows) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -2987,7 +2987,7 @@ subview::row_iterator::row_iterator() , aux_col1 (0 ) , aux_col2_p1(0 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // Technically this iterator is invalid (it does not point to a valid element) } @@ -3002,7 +3002,7 @@ subview::row_iterator::row_iterator(const row_iterator& X) , aux_col1 (X.aux_col1 ) , aux_col2_p1(X.aux_col2_p1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -3016,7 +3016,7 @@ subview::row_iterator::row_iterator(subview& in_sv, const uword in_row, , aux_col1 (in_sv.aux_col1 ) , aux_col2_p1(in_sv.aux_col1 + in_sv.n_cols ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -3118,7 +3118,7 @@ subview::const_row_iterator::const_row_iterator() , aux_col1 (0 ) , aux_col2_p1(0 ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // Technically this iterator is invalid (it does not point to a valid element) } @@ -3133,7 +3133,7 @@ subview::const_row_iterator::const_row_iterator(const row_iterator& X) , aux_col1 (X.aux_col1 ) , aux_col2_p1(X.aux_col2_p1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -3147,7 +3147,7 @@ subview::const_row_iterator::const_row_iterator(const const_row_iterator& X) , aux_col1 (X.aux_col1 ) , aux_col2_p1(X.aux_col2_p1) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -3161,7 +3161,7 @@ subview::const_row_iterator::const_row_iterator(const subview& in_sv, co , aux_col1 (in_sv.aux_col1 ) , aux_col2_p1(in_sv.aux_col1 + in_sv.n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -3260,7 +3260,7 @@ subview_col::subview_col(const Mat& in_m, const uword in_col) : subview(in_m, 0, in_col, in_m.n_rows, 1) , colmem(subview::colptr(0)) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -3271,7 +3271,7 @@ subview_col::subview_col(const Mat& in_m, const uword in_col, const uwor : subview(in_m, in_row1, in_col, in_n_rows, 1) , colmem(subview::colptr(0)) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -3282,7 +3282,7 @@ subview_col::subview_col(const subview_col& in) : subview(in) // interprets 'subview_col' as 'subview' , colmem(in.colmem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -3293,7 +3293,7 @@ subview_col::subview_col(subview_col&& in) : subview(std::move(in)) // interprets 'subview_col' as 'subview' , colmem(in.colmem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); access::rw(in.colmem) = nullptr; } @@ -3305,7 +3305,7 @@ inline void subview_col::operator=(const subview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview::operator=(X); } @@ -3317,7 +3317,7 @@ inline void subview_col::operator=(const subview_col& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview::operator=(X); // interprets 'subview_col' as 'subview' } @@ -3329,11 +3329,11 @@ inline void subview_col::operator=(const std::initializer_list& list) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N = uword(list.size()); - arma_debug_assert_same_size(subview::n_rows, subview::n_cols, N, 1, "copy into submatrix"); + arma_conform_assert_same_size(subview::n_rows, subview::n_cols, N, 1, "copy into submatrix"); arrayops::copy( access::rwp(colmem), list.begin(), N ); } @@ -3345,11 +3345,11 @@ inline void subview_col::operator=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(subview::n_elem != 1) { - arma_debug_assert_same_size(subview::n_rows, subview::n_cols, 1, 1, "copy into submatrix"); + arma_conform_assert_same_size(subview::n_rows, subview::n_cols, 1, 1, "copy into submatrix"); } access::rw( colmem[0] ) = val; @@ -3363,7 +3363,7 @@ inline void subview_col::operator=(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview::operator=(X); } @@ -3376,7 +3376,7 @@ inline void subview_col::operator=(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview::operator=(X.get_ref()); } @@ -3389,9 +3389,9 @@ inline typename enable_if2< is_same_type::value, void>::result subview_col::operator= (const Gen& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(subview::n_rows, uword(1), in.n_rows, (in.is_col ? uword(1) : in.n_cols), "copy into submatrix"); + arma_conform_assert_same_size(subview::n_rows, uword(1), in.n_rows, (in.is_col ? uword(1) : in.n_cols), "copy into submatrix"); in.apply(*this); } @@ -3443,7 +3443,7 @@ inline void subview_col::fill(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arrayops::inplace_set( access::rwp(colmem), val, subview::n_rows ); } @@ -3455,7 +3455,7 @@ inline void subview_col::zeros() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arrayops::fill_zeros( access::rwp(colmem), subview::n_rows ); } @@ -3467,7 +3467,7 @@ inline void subview_col::ones() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arrayops::inplace_set( access::rwp(colmem), eT(1), subview::n_rows ); } @@ -3512,7 +3512,7 @@ inline eT& subview_col::operator()(const uword ii) { - arma_debug_check_bounds( (ii >= subview::n_elem), "subview::operator(): index out of bounds" ); + arma_conform_check_bounds( (ii >= subview::n_elem), "subview::operator(): index out of bounds" ); return access::rw( colmem[ii] ); } @@ -3524,7 +3524,7 @@ inline eT subview_col::operator()(const uword ii) const { - arma_debug_check_bounds( (ii >= subview::n_elem), "subview::operator(): index out of bounds" ); + arma_conform_check_bounds( (ii >= subview::n_elem), "subview::operator(): index out of bounds" ); return colmem[ii]; } @@ -3536,7 +3536,7 @@ inline eT& subview_col::operator()(const uword in_row, const uword in_col) { - arma_debug_check_bounds( ((in_row >= subview::n_rows) || (in_col > 0)), "subview::operator(): index out of bounds" ); + arma_conform_check_bounds( ((in_row >= subview::n_rows) || (in_col > 0)), "subview::operator(): index out of bounds" ); return access::rw( colmem[in_row] ); } @@ -3548,7 +3548,7 @@ inline eT subview_col::operator()(const uword in_row, const uword in_col) const { - arma_debug_check_bounds( ((in_row >= subview::n_rows) || (in_col > 0)), "subview::operator(): index out of bounds" ); + arma_conform_check_bounds( ((in_row >= subview::n_rows) || (in_col > 0)), "subview::operator(): index out of bounds" ); return colmem[in_row]; } @@ -3598,9 +3598,9 @@ inline subview_col subview_col::rows(const uword in_row1, const uword in_row2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( ( (in_row1 > in_row2) || (in_row2 >= subview::n_rows) ), "subview_col::rows(): indices out of bounds or incorrectly used" ); + arma_conform_check_bounds( ( (in_row1 > in_row2) || (in_row2 >= subview::n_rows) ), "subview_col::rows(): indices out of bounds or incorrectly used" ); const uword subview_n_rows = in_row2 - in_row1 + 1; @@ -3616,9 +3616,9 @@ inline const subview_col subview_col::rows(const uword in_row1, const uword in_row2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( ( (in_row1 > in_row2) || (in_row2 >= subview::n_rows) ), "subview_col::rows(): indices out of bounds or incorrectly used" ); + arma_conform_check_bounds( ( (in_row1 > in_row2) || (in_row2 >= subview::n_rows) ), "subview_col::rows(): indices out of bounds or incorrectly used" ); const uword subview_n_rows = in_row2 - in_row1 + 1; @@ -3634,9 +3634,9 @@ inline subview_col subview_col::subvec(const uword in_row1, const uword in_row2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( ( (in_row1 > in_row2) || (in_row2 >= subview::n_rows) ), "subview_col::subvec(): indices out of bounds or incorrectly used" ); + arma_conform_check_bounds( ( (in_row1 > in_row2) || (in_row2 >= subview::n_rows) ), "subview_col::subvec(): indices out of bounds or incorrectly used" ); const uword subview_n_rows = in_row2 - in_row1 + 1; @@ -3652,9 +3652,9 @@ inline const subview_col subview_col::subvec(const uword in_row1, const uword in_row2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( ( (in_row1 > in_row2) || (in_row2 >= subview::n_rows) ), "subview_col::subvec(): indices out of bounds or incorrectly used" ); + arma_conform_check_bounds( ( (in_row1 > in_row2) || (in_row2 >= subview::n_rows) ), "subview_col::subvec(): indices out of bounds or incorrectly used" ); const uword subview_n_rows = in_row2 - in_row1 + 1; @@ -3670,11 +3670,11 @@ inline subview_col subview_col::subvec(const uword start_row, const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (s.n_cols != 1), "subview_col::subvec(): given size does not specify a column vector" ); + arma_conform_check( (s.n_cols != 1), "subview_col::subvec(): given size does not specify a column vector" ); - arma_debug_check_bounds( ( (start_row >= subview::n_rows) || ((start_row + s.n_rows) > subview::n_rows) ), "subview_col::subvec(): size out of bounds" ); + arma_conform_check_bounds( ( (start_row >= subview::n_rows) || ((start_row + s.n_rows) > subview::n_rows) ), "subview_col::subvec(): size out of bounds" ); const uword base_row1 = this->aux_row1 + start_row; @@ -3688,11 +3688,11 @@ inline const subview_col subview_col::subvec(const uword start_row, const SizeMat& s) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (s.n_cols != 1), "subview_col::subvec(): given size does not specify a column vector" ); + arma_conform_check( (s.n_cols != 1), "subview_col::subvec(): given size does not specify a column vector" ); - arma_debug_check_bounds( ( (start_row >= subview::n_rows) || ((start_row + s.n_rows) > subview::n_rows) ), "subview_col::subvec(): size out of bounds" ); + arma_conform_check_bounds( ( (start_row >= subview::n_rows) || ((start_row + s.n_rows) > subview::n_rows) ), "subview_col::subvec(): size out of bounds" ); const uword base_row1 = this->aux_row1 + start_row; @@ -3706,9 +3706,9 @@ inline subview_col subview_col::head(const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > subview::n_rows), "subview_col::head(): size out of bounds" ); + arma_conform_check_bounds( (N > subview::n_rows), "subview_col::head(): size out of bounds" ); return subview_col(this->m, this->aux_col1, this->aux_row1, N); } @@ -3720,9 +3720,9 @@ inline const subview_col subview_col::head(const uword N) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > subview::n_rows), "subview_col::head(): size out of bounds" ); + arma_conform_check_bounds( (N > subview::n_rows), "subview_col::head(): size out of bounds" ); return subview_col(this->m, this->aux_col1, this->aux_row1, N); } @@ -3734,9 +3734,9 @@ inline subview_col subview_col::tail(const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > subview::n_rows), "subview_col::tail(): size out of bounds" ); + arma_conform_check_bounds( (N > subview::n_rows), "subview_col::tail(): size out of bounds" ); const uword start_row = subview::aux_row1 + subview::n_rows - N; @@ -3750,9 +3750,9 @@ inline const subview_col subview_col::tail(const uword N) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > subview::n_rows), "subview_col::tail(): size out of bounds" ); + arma_conform_check_bounds( (N > subview::n_rows), "subview_col::tail(): size out of bounds" ); const uword start_row = subview::aux_row1 + subview::n_rows - N; @@ -3766,11 +3766,11 @@ inline eT subview_col::min() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(subview::n_elem == 0) { - arma_debug_check(true, "min(): object has no elements"); + arma_conform_check(true, "min(): object has no elements"); return Datum::nan; } @@ -3785,11 +3785,11 @@ inline eT subview_col::max() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(subview::n_elem == 0) { - arma_debug_check(true, "max(): object has no elements"); + arma_conform_check(true, "max(): object has no elements"); return Datum::nan; } @@ -3804,11 +3804,11 @@ inline eT subview_col::min(uword& index_of_min_val) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(subview::n_elem == 0) { - arma_debug_check(true, "min(): object has no elements"); + arma_conform_check(true, "min(): object has no elements"); index_of_min_val = uword(0); @@ -3827,11 +3827,11 @@ inline eT subview_col::max(uword& index_of_max_val) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(subview::n_elem == 0) { - arma_debug_check(true, "max(): object has no elements"); + arma_conform_check(true, "max(): object has no elements"); index_of_max_val = uword(0); @@ -3850,13 +3850,13 @@ inline uword subview_col::index_min() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uword index = 0; if(subview::n_elem == 0) { - arma_debug_check(true, "index_min(): object has no elements"); + arma_conform_check(true, "index_min(): object has no elements"); } else { @@ -3873,13 +3873,13 @@ inline uword subview_col::index_max() const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); uword index = 0; if(subview::n_elem == 0) { - arma_debug_check(true, "index_max(): object has no elements"); + arma_conform_check(true, "index_max(): object has no elements"); } else { @@ -3901,7 +3901,7 @@ inline subview_cols::subview_cols(const Mat& in_m, const uword in_col1, const uword in_n_cols) : subview(in_m, 0, in_col1, in_m.n_rows, in_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -3911,7 +3911,7 @@ inline subview_cols::subview_cols(const subview_cols& in) : subview(in) // interprets 'subview_cols' as 'subview' { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -3921,7 +3921,7 @@ inline subview_cols::subview_cols(subview_cols&& in) : subview(std::move(in)) // interprets 'subview_cols' as 'subview' { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -3931,7 +3931,7 @@ inline void subview_cols::operator=(const subview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview::operator=(X); } @@ -3943,7 +3943,7 @@ inline void subview_cols::operator=(const subview_cols& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview::operator=(X); // interprets 'subview_cols' as 'subview' } @@ -3955,7 +3955,7 @@ inline void subview_cols::operator=(const std::initializer_list& list) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview::operator=(list); } @@ -3967,7 +3967,7 @@ inline void subview_cols::operator=(const std::initializer_list< std::initializer_list >& list) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview::operator=(list); } @@ -3979,7 +3979,7 @@ inline void subview_cols::operator=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview::operator=(val); } @@ -3992,7 +3992,7 @@ inline void subview_cols::operator=(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview::operator=(X.get_ref()); } @@ -4005,7 +4005,7 @@ inline void subview_cols::operator=(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview::operator=(X.get_ref()); } @@ -4018,7 +4018,7 @@ inline typename enable_if2< is_same_type::value, void>::result subview_cols::operator= (const Gen& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview::operator=(in); } @@ -4104,7 +4104,7 @@ inline eT& subview_cols::operator()(const uword ii) { - arma_debug_check_bounds( (ii >= subview::n_elem), "subview::operator(): index out of bounds" ); + arma_conform_check_bounds( (ii >= subview::n_elem), "subview::operator(): index out of bounds" ); const uword index = subview::aux_col1 * subview::m.n_rows + ii; @@ -4118,7 +4118,7 @@ inline eT subview_cols::operator()(const uword ii) const { - arma_debug_check_bounds( (ii >= subview::n_elem), "subview::operator(): index out of bounds" ); + arma_conform_check_bounds( (ii >= subview::n_elem), "subview::operator(): index out of bounds" ); const uword index = subview::aux_col1 * subview::m.n_rows + ii; @@ -4132,7 +4132,7 @@ inline eT& subview_cols::operator()(const uword in_row, const uword in_col) { - arma_debug_check_bounds( ((in_row >= subview::n_rows) || (in_col >= subview::n_cols)), "subview::operator(): index out of bounds" ); + arma_conform_check_bounds( ((in_row >= subview::n_rows) || (in_col >= subview::n_cols)), "subview::operator(): index out of bounds" ); const uword index = (in_col + subview::aux_col1) * subview::m.n_rows + in_row; @@ -4146,7 +4146,7 @@ inline eT subview_cols::operator()(const uword in_row, const uword in_col) const { - arma_debug_check_bounds( ((in_row >= subview::n_rows) || (in_col >= subview::n_cols)), "subview::operator(): index out of bounds" ); + arma_conform_check_bounds( ((in_row >= subview::n_rows) || (in_col >= subview::n_cols)), "subview::operator(): index out of bounds" ); const uword index = (in_col + subview::aux_col1) * subview::m.n_rows + in_row; @@ -4210,7 +4210,7 @@ inline subview_row::subview_row(const Mat& in_m, const uword in_row) : subview(in_m, in_row, 0, 1, in_m.n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -4220,7 +4220,7 @@ inline subview_row::subview_row(const Mat& in_m, const uword in_row, const uword in_col1, const uword in_n_cols) : subview(in_m, in_row, in_col1, 1, in_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -4230,7 +4230,7 @@ inline subview_row::subview_row(const subview_row& in) : subview(in) // interprets 'subview_row' as 'subview' { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -4240,7 +4240,7 @@ inline subview_row::subview_row(subview_row&& in) : subview(std::move(in)) // interprets 'subview_row' as 'subview' { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -4250,7 +4250,7 @@ inline void subview_row::operator=(const subview& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview::operator=(X); } @@ -4262,7 +4262,7 @@ inline void subview_row::operator=(const subview_row& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview::operator=(X); // interprets 'subview_row' as 'subview' } @@ -4274,7 +4274,7 @@ inline void subview_row::operator=(const eT val) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview::operator=(val); // interprets 'subview_row' as 'subview' } @@ -4286,11 +4286,11 @@ inline void subview_row::operator=(const std::initializer_list& list) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const uword N = uword(list.size()); - arma_debug_assert_same_size(subview::n_rows, subview::n_cols, 1, N, "copy into submatrix"); + arma_conform_assert_same_size(subview::n_rows, subview::n_cols, 1, N, "copy into submatrix"); auto it = list.begin(); @@ -4309,7 +4309,7 @@ inline void subview_row::operator=(const Base& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview::operator=(X); } @@ -4322,7 +4322,7 @@ inline void subview_row::operator=(const SpBase& X) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); subview::operator=(X.get_ref()); } @@ -4335,9 +4335,9 @@ inline typename enable_if2< is_same_type::value, void>::result subview_row::operator= (const Gen& in) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_assert_same_size(uword(1), subview::n_cols, (in.is_row ? uword(1) : in.n_rows), in.n_cols, "copy into submatrix"); + arma_conform_assert_same_size(uword(1), subview::n_cols, (in.is_row ? uword(1) : in.n_rows), in.n_cols, "copy into submatrix"); in.apply(*this); } @@ -4425,7 +4425,7 @@ inline eT& subview_row::operator()(const uword ii) { - arma_debug_check_bounds( (ii >= subview::n_elem), "subview::operator(): index out of bounds" ); + arma_conform_check_bounds( (ii >= subview::n_elem), "subview::operator(): index out of bounds" ); const uword index = (ii + (subview::aux_col1))*(subview::m).n_rows + (subview::aux_row1); @@ -4439,7 +4439,7 @@ inline eT subview_row::operator()(const uword ii) const { - arma_debug_check_bounds( (ii >= subview::n_elem), "subview::operator(): index out of bounds" ); + arma_conform_check_bounds( (ii >= subview::n_elem), "subview::operator(): index out of bounds" ); const uword index = (ii + (subview::aux_col1))*(subview::m).n_rows + (subview::aux_row1); @@ -4453,7 +4453,7 @@ inline eT& subview_row::operator()(const uword in_row, const uword in_col) { - arma_debug_check_bounds( ((in_row > 0) || (in_col >= subview::n_cols)), "subview::operator(): index out of bounds" ); + arma_conform_check_bounds( ((in_row > 0) || (in_col >= subview::n_cols)), "subview::operator(): index out of bounds" ); const uword index = (in_col + (subview::aux_col1))*(subview::m).n_rows + (subview::aux_row1); @@ -4467,7 +4467,7 @@ inline eT subview_row::operator()(const uword in_row, const uword in_col) const { - arma_debug_check_bounds( ((in_row > 0) || (in_col >= subview::n_cols)), "subview::operator(): index out of bounds" ); + arma_conform_check_bounds( ((in_row > 0) || (in_col >= subview::n_cols)), "subview::operator(): index out of bounds" ); const uword index = (in_col + (subview::aux_col1))*(subview::m).n_rows + (subview::aux_row1); @@ -4505,9 +4505,9 @@ inline subview_row subview_row::cols(const uword in_col1, const uword in_col2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( ( (in_col1 > in_col2) || (in_col2 >= subview::n_cols) ), "subview_row::cols(): indices out of bounds or incorrectly used" ); + arma_conform_check_bounds( ( (in_col1 > in_col2) || (in_col2 >= subview::n_cols) ), "subview_row::cols(): indices out of bounds or incorrectly used" ); const uword subview_n_cols = in_col2 - in_col1 + 1; @@ -4523,9 +4523,9 @@ inline const subview_row subview_row::cols(const uword in_col1, const uword in_col2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( ( (in_col1 > in_col2) || (in_col2 >= subview::n_cols) ), "subview_row::cols(): indices out of bounds or incorrectly used" ); + arma_conform_check_bounds( ( (in_col1 > in_col2) || (in_col2 >= subview::n_cols) ), "subview_row::cols(): indices out of bounds or incorrectly used" ); const uword subview_n_cols = in_col2 - in_col1 + 1; @@ -4541,9 +4541,9 @@ inline subview_row subview_row::subvec(const uword in_col1, const uword in_col2) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( ( (in_col1 > in_col2) || (in_col2 >= subview::n_cols) ), "subview_row::subvec(): indices out of bounds or incorrectly used" ); + arma_conform_check_bounds( ( (in_col1 > in_col2) || (in_col2 >= subview::n_cols) ), "subview_row::subvec(): indices out of bounds or incorrectly used" ); const uword subview_n_cols = in_col2 - in_col1 + 1; @@ -4559,9 +4559,9 @@ inline const subview_row subview_row::subvec(const uword in_col1, const uword in_col2) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( ( (in_col1 > in_col2) || (in_col2 >= subview::n_cols) ), "subview_row::subvec(): indices out of bounds or incorrectly used" ); + arma_conform_check_bounds( ( (in_col1 > in_col2) || (in_col2 >= subview::n_cols) ), "subview_row::subvec(): indices out of bounds or incorrectly used" ); const uword subview_n_cols = in_col2 - in_col1 + 1; @@ -4577,11 +4577,11 @@ inline subview_row subview_row::subvec(const uword start_col, const SizeMat& s) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (s.n_rows != 1), "subview_row::subvec(): given size does not specify a row vector" ); + arma_conform_check( (s.n_rows != 1), "subview_row::subvec(): given size does not specify a row vector" ); - arma_debug_check_bounds( ( (start_col >= subview::n_cols) || ((start_col + s.n_cols) > subview::n_cols) ), "subview_row::subvec(): size out of bounds" ); + arma_conform_check_bounds( ( (start_col >= subview::n_cols) || ((start_col + s.n_cols) > subview::n_cols) ), "subview_row::subvec(): size out of bounds" ); const uword base_col1 = this->aux_col1 + start_col; @@ -4595,11 +4595,11 @@ inline const subview_row subview_row::subvec(const uword start_col, const SizeMat& s) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check( (s.n_rows != 1), "subview_row::subvec(): given size does not specify a row vector" ); + arma_conform_check( (s.n_rows != 1), "subview_row::subvec(): given size does not specify a row vector" ); - arma_debug_check_bounds( ( (start_col >= subview::n_cols) || ((start_col + s.n_cols) > subview::n_cols) ), "subview_row::subvec(): size out of bounds" ); + arma_conform_check_bounds( ( (start_col >= subview::n_cols) || ((start_col + s.n_cols) > subview::n_cols) ), "subview_row::subvec(): size out of bounds" ); const uword base_col1 = this->aux_col1 + start_col; @@ -4613,9 +4613,9 @@ inline subview_row subview_row::head(const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > subview::n_cols), "subview_row::head(): size out of bounds" ); + arma_conform_check_bounds( (N > subview::n_cols), "subview_row::head(): size out of bounds" ); return subview_row(this->m, this->aux_row1, this->aux_col1, N); } @@ -4627,9 +4627,9 @@ inline const subview_row subview_row::head(const uword N) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > subview::n_cols), "subview_row::head(): size out of bounds" ); + arma_conform_check_bounds( (N > subview::n_cols), "subview_row::head(): size out of bounds" ); return subview_row(this->m, this->aux_row1, this->aux_col1, N); } @@ -4641,9 +4641,9 @@ inline subview_row subview_row::tail(const uword N) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > subview::n_cols), "subview_row::tail(): size out of bounds" ); + arma_conform_check_bounds( (N > subview::n_cols), "subview_row::tail(): size out of bounds" ); const uword start_col = subview::aux_col1 + subview::n_cols - N; @@ -4657,9 +4657,9 @@ inline const subview_row subview_row::tail(const uword N) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); - arma_debug_check_bounds( (N > subview::n_cols), "subview_row::tail(): size out of bounds" ); + arma_conform_check_bounds( (N > subview::n_cols), "subview_row::tail(): size out of bounds" ); const uword start_col = subview::aux_col1 + subview::n_cols - N; @@ -4679,7 +4679,7 @@ subview_row::index_min() const if(P.get_n_elem() == 0) { - arma_debug_check(true, "index_min(): object has no elements"); + arma_conform_check(true, "index_min(): object has no elements"); } else { @@ -4702,7 +4702,7 @@ subview_row::index_max() const if(P.get_n_elem() == 0) { - arma_debug_check(true, "index_max(): object has no elements"); + arma_conform_check(true, "index_max(): object has no elements"); } else { @@ -4787,7 +4787,7 @@ subview_row_strans::subview_row_strans(const subview_row& in_sv_row) , n_rows(in_sv_row.n_cols) , n_elem(in_sv_row.n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -4797,7 +4797,7 @@ inline void subview_row_strans::extract(Mat& out) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: this function assumes that matrix 'out' has already been set to the correct size @@ -4891,7 +4891,7 @@ subview_row_htrans::subview_row_htrans(const subview_row& in_sv_row) , n_rows(in_sv_row.n_cols) , n_elem(in_sv_row.n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -4901,7 +4901,7 @@ inline void subview_row_htrans::extract(Mat& out) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: this function assumes that matrix 'out' has already been set to the correct size diff --git a/inst/include/armadillo_bits/sym_helper.hpp b/inst/include/armadillo_bits/sym_helper.hpp index 00555c49..fab7d553 100644 --- a/inst/include/armadillo_bits/sym_helper.hpp +++ b/inst/include/armadillo_bits/sym_helper.hpp @@ -39,7 +39,7 @@ inline typename enable_if2::no, bool>::result guess_sympd_worker(const Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: assuming A is square-sized @@ -113,7 +113,7 @@ inline typename enable_if2::yes, bool>::result guess_sympd_worker(const Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: assuming A is square-sized @@ -215,7 +215,7 @@ inline bool guess_sympd(const Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // analyse matrices with size >= 4x4 @@ -231,7 +231,7 @@ inline bool guess_sympd(const Mat& A, const uword min_n_rows) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if((A.n_rows != A.n_cols) || (A.n_rows < min_n_rows)) { return false; } @@ -249,7 +249,7 @@ inline typename enable_if2::no, void>::result analyse_matrix_worker(bool& is_approx_sym, bool& is_approx_sympd, const Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); is_approx_sym = true; is_approx_sympd = true; @@ -325,7 +325,7 @@ inline typename enable_if2::yes, void>::result analyse_matrix_worker(bool& is_approx_sym, bool& is_approx_sympd, const Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); typedef typename get_pod_type::result T; @@ -431,7 +431,7 @@ inline void analyse_matrix(bool& is_approx_sym, bool& is_approx_sympd, const Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if((A.n_rows != A.n_cols) || (A.n_rows < uword(4))) { @@ -452,7 +452,7 @@ inline bool check_diag_imag(const Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: assuming matrix A is square-sized diff --git a/inst/include/armadillo_bits/traits.hpp b/inst/include/armadillo_bits/traits.hpp index e778fef8..9ccc5eaa 100644 --- a/inst/include/armadillo_bits/traits.hpp +++ b/inst/include/armadillo_bits/traits.hpp @@ -342,6 +342,19 @@ struct is_SpToDOp< const SpToDOp > { static constexpr bool value = true; }; +template +struct is_mtSpToDOp + { static constexpr bool value = false; }; + +template +struct is_mtSpToDOp< mtSpToDOp > + { static constexpr bool value = true; }; + +template +struct is_mtSpToDOp< const mtSpToDOp > + { static constexpr bool value = true; }; + + template struct is_SpToDGlue { static constexpr bool value = false; }; @@ -467,23 +480,6 @@ struct is_op_diagmat< const Op > // -template -struct is_Mat_trans - { static constexpr bool value = false; }; - -template -struct is_Mat_trans< Op > - { static constexpr bool value = is_Mat::value; }; - -template -struct is_Mat_trans< Op > - { static constexpr bool value = is_Mat::value; }; - - -// -// - - template struct is_GenCube { static constexpr bool value = false; }; @@ -574,6 +570,7 @@ struct is_arma_type2 || is_CubeToMatOp::value || is_SpToDOp::value || is_SpToDGlue::value + || is_mtSpToDOp::value ; }; diff --git a/inst/include/armadillo_bits/trimat_helper.hpp b/inst/include/armadillo_bits/trimat_helper.hpp index 9242083d..416cd2f3 100644 --- a/inst/include/armadillo_bits/trimat_helper.hpp +++ b/inst/include/armadillo_bits/trimat_helper.hpp @@ -30,7 +30,7 @@ inline bool is_triu(const Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: assuming that A has a square size @@ -70,7 +70,7 @@ inline bool is_tril(const Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: assuming that A has a square size @@ -112,7 +112,7 @@ inline bool has_nonfinite_tril(const Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: assuming that A has a square size @@ -138,7 +138,7 @@ inline bool has_nonfinite_triu(const Mat& A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: assuming that A has a square size diff --git a/inst/include/armadillo_bits/unwrap.hpp b/inst/include/armadillo_bits/unwrap.hpp index 4e935067..75afd3b6 100644 --- a/inst/include/armadillo_bits/unwrap.hpp +++ b/inst/include/armadillo_bits/unwrap.hpp @@ -34,7 +34,7 @@ struct unwrap_default unwrap_default(const T1& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const Mat M; @@ -51,7 +51,7 @@ struct unwrap_fixed unwrap_fixed(const T1& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const T1& M; @@ -90,7 +90,7 @@ struct unwrap< Mat > unwrap(const Mat& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const Mat& M; @@ -107,7 +107,7 @@ struct unwrap< Row > unwrap(const Row& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const Row& M; @@ -124,7 +124,7 @@ struct unwrap< Col > unwrap(const Col& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const Col& M; @@ -141,7 +141,7 @@ struct unwrap< subview_col > unwrap(const subview_col& A) : M(A.colmem, A.n_rows) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const Col M; @@ -158,7 +158,7 @@ struct unwrap< subview_cols > unwrap(const subview_cols& A) : M(A.colptr(0), A.n_rows, A.n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const Mat M; @@ -175,7 +175,7 @@ struct unwrap< mtGlue > unwrap(const mtGlue& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const Mat M; @@ -192,7 +192,7 @@ struct unwrap< mtOp > unwrap(const mtOp& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const Mat M; @@ -215,7 +215,7 @@ struct quasi_unwrap_default quasi_unwrap_default(const T1& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } // NOTE: DO NOT DIRECTLY CHECK FOR ALIASING BY TAKING THE ADDRESS OF THE "M" OBJECT IN ANY quasi_unwrap CLASS !!! @@ -240,7 +240,7 @@ struct quasi_unwrap_fixed quasi_unwrap_fixed(const T1& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const T1& M; @@ -293,7 +293,7 @@ struct quasi_unwrap< Mat > quasi_unwrap(const Mat& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const Mat& M; @@ -316,7 +316,7 @@ struct quasi_unwrap< Row > quasi_unwrap(const Row& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const Row& M; @@ -338,7 +338,7 @@ struct quasi_unwrap< Col > quasi_unwrap(const Col& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const Col& M; @@ -361,7 +361,7 @@ struct quasi_unwrap< subview > : sv( A ) , M ( A, ((A.aux_row1 == 0) && (A.n_rows == A.m.n_rows)) ) // reuse memory if the subview is a contiguous chunk { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const subview& sv; @@ -384,7 +384,7 @@ struct quasi_unwrap< subview_row > quasi_unwrap(const subview_row& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } Row M; @@ -407,7 +407,7 @@ struct quasi_unwrap< subview_col > : orig( A.m ) , M ( const_cast( A.colmem ), A.n_rows, false, false ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const Mat& orig; @@ -431,7 +431,7 @@ struct quasi_unwrap< subview_cols > : orig( A.m ) , M ( const_cast( A.colptr(0) ), A.n_rows, A.n_cols, false, false ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const Mat& orig; @@ -454,7 +454,7 @@ struct quasi_unwrap< mtGlue > quasi_unwrap(const mtGlue& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } Mat M; @@ -476,7 +476,7 @@ struct quasi_unwrap< mtOp > quasi_unwrap(const mtOp& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } Mat M; @@ -501,7 +501,7 @@ struct quasi_unwrap< Op > : U( A.m ) , M( const_cast(U.M.memptr()), U.M.n_elem, 1, false, false ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const quasi_unwrap U; @@ -525,7 +525,7 @@ struct quasi_unwrap< Op, op_strans> > : orig(A.m) , M (const_cast(A.m.memptr()), A.m.n_elem, false, false) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const Col& orig; @@ -549,7 +549,7 @@ struct quasi_unwrap< Op, op_strans> > : orig(A.m) , M (const_cast(A.m.memptr()), A.m.n_elem, false, false) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const Row& orig; @@ -573,7 +573,7 @@ struct quasi_unwrap< Op, op_strans> > : orig( A.m.m ) , M ( const_cast( A.m.colmem ), A.m.n_rows, false, false ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const Mat& orig; @@ -605,7 +605,7 @@ struct quasi_unwrap_Col_htrans< Op, op_htrans> > : orig(A.m) , M (const_cast(A.m.memptr()), A.m.n_elem, false, false) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const Col& orig; @@ -669,7 +669,7 @@ struct quasi_unwrap_Row_htrans< Op, op_htrans> > : orig(A.m) , M (const_cast(A.m.memptr()), A.m.n_elem, false, false) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const Row& orig; @@ -733,7 +733,7 @@ struct quasi_unwrap_subview_col_htrans< Op, op_htrans> > : orig(A.m.m) , M (const_cast(A.m.colmem), A.m.n_rows, false, false) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const Mat& orig; @@ -791,7 +791,7 @@ struct quasi_unwrap< CubeToMatOp > : U( A.m ) , M( const_cast(U.M.memptr()), U.M.n_elem, 1, false, true ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const unwrap_cube U; @@ -817,7 +817,7 @@ struct quasi_unwrap< SpToDOp > : U( A.m ) , M( const_cast(U.M.values), U.M.n_nonzero, 1, false, true ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const unwrap_spmat U; @@ -849,14 +849,14 @@ struct unwrap_check_default unwrap_check_default(const T1& A, const Mat&) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline unwrap_check_default(const T1& A, const bool) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const Mat M; @@ -875,7 +875,7 @@ struct unwrap_check_fixed : M_local( (&A == &B) ? new T1(A) : nullptr ) , M ( (&A == &B) ? *M_local : A ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline @@ -883,13 +883,13 @@ struct unwrap_check_fixed : M_local( is_alias ? new T1(A) : nullptr ) , M ( is_alias ? *M_local : A ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline ~unwrap_check_fixed() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(M_local) { delete M_local; } } @@ -938,7 +938,7 @@ struct unwrap_check< Mat > : M_local( (&A == &B) ? new Mat(A) : nullptr ) , M ( (&A == &B) ? (*M_local) : A ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline @@ -946,13 +946,13 @@ struct unwrap_check< Mat > : M_local( is_alias ? new Mat(A) : nullptr ) , M ( is_alias ? (*M_local) : A ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline ~unwrap_check() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(M_local) { delete M_local; } } @@ -975,7 +975,7 @@ struct unwrap_check< Row > : M_local( (&A == &B) ? new Row(A) : nullptr ) , M ( (&A == &B) ? (*M_local) : A ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline @@ -983,13 +983,13 @@ struct unwrap_check< Row > : M_local( is_alias ? new Row(A) : nullptr ) , M ( is_alias ? (*M_local) : A ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline ~unwrap_check() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(M_local) { delete M_local; } } @@ -1012,7 +1012,7 @@ struct unwrap_check< Col > : M_local( (&A == &B) ? new Col(A) : nullptr ) , M ( (&A == &B) ? (*M_local) : A ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline @@ -1020,13 +1020,13 @@ struct unwrap_check< Col > : M_local( is_alias ? new Col(A) : nullptr ) , M ( is_alias ? (*M_local) : A ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline ~unwrap_check() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(M_local) { delete M_local; } } @@ -1055,7 +1055,7 @@ struct unwrap_check_mixed unwrap_check_mixed(const T1& A, const Mat&) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } //template @@ -1063,7 +1063,7 @@ struct unwrap_check_mixed unwrap_check_mixed(const T1& A, const bool) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const Mat M; @@ -1080,7 +1080,7 @@ struct unwrap_check_mixed< Mat > : M_local( (void_ptr(&A) == void_ptr(&B)) ? new Mat(A) : nullptr ) , M ( (void_ptr(&A) == void_ptr(&B)) ? (*M_local) : A ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } //template @@ -1089,13 +1089,13 @@ struct unwrap_check_mixed< Mat > : M_local( is_alias ? new Mat(A) : nullptr ) , M ( is_alias ? (*M_local) : A ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline ~unwrap_check_mixed() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(M_local) { delete M_local; } } @@ -1117,7 +1117,7 @@ struct unwrap_check_mixed< Row > : M_local( (void_ptr(&A) == void_ptr(&B)) ? new Row(A) : nullptr ) , M ( (void_ptr(&A) == void_ptr(&B)) ? (*M_local) : A ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -1127,13 +1127,13 @@ struct unwrap_check_mixed< Row > : M_local( is_alias ? new Row(A) : nullptr ) , M ( is_alias ? (*M_local) : A ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline ~unwrap_check_mixed() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(M_local) { delete M_local; } } @@ -1155,7 +1155,7 @@ struct unwrap_check_mixed< Col > : M_local( (void_ptr(&A) == void_ptr(&B)) ? new Col(A) : nullptr ) , M ( (void_ptr(&A) == void_ptr(&B)) ? (*M_local) : A ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } //template @@ -1164,13 +1164,13 @@ struct unwrap_check_mixed< Col > : M_local( is_alias ? new Col(A) : nullptr ) , M ( is_alias ? (*M_local) : A ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline ~unwrap_check_mixed() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(M_local) { delete M_local; } } @@ -1199,7 +1199,7 @@ struct partial_unwrap_default partial_unwrap_default(const T1& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(1); } @@ -1209,6 +1209,7 @@ struct partial_unwrap_default static constexpr bool do_trans = false; static constexpr bool do_times = false; + static constexpr bool is_fast = false; const Mat M; }; @@ -1224,7 +1225,7 @@ struct partial_unwrap_fixed partial_unwrap_fixed(const T1& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(1); } @@ -1234,6 +1235,7 @@ struct partial_unwrap_fixed static constexpr bool do_trans = false; static constexpr bool do_times = false; + static constexpr bool is_fast = true; const T1& M; }; @@ -1270,7 +1272,7 @@ struct partial_unwrap< Mat > partial_unwrap(const Mat& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(1); } @@ -1280,6 +1282,7 @@ struct partial_unwrap< Mat > static constexpr bool do_trans = false; static constexpr bool do_times = false; + static constexpr bool is_fast = true; const Mat& M; }; @@ -1295,7 +1298,7 @@ struct partial_unwrap< Row > partial_unwrap(const Row& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(1); } @@ -1305,6 +1308,7 @@ struct partial_unwrap< Row > static constexpr bool do_trans = false; static constexpr bool do_times = false; + static constexpr bool is_fast = true; const Row& M; }; @@ -1320,7 +1324,7 @@ struct partial_unwrap< Col > partial_unwrap(const Col& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(1); } @@ -1330,6 +1334,7 @@ struct partial_unwrap< Col > static constexpr bool do_trans = false; static constexpr bool do_times = false; + static constexpr bool is_fast = true; const Col& M; }; @@ -1346,7 +1351,7 @@ struct partial_unwrap< subview > : sv( A ) , M ( A, ((A.aux_row1 == 0) && (A.n_rows == A.m.n_rows)) ) // reuse memory if the subview is a contiguous chunk { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(1); } @@ -1356,6 +1361,7 @@ struct partial_unwrap< subview > static constexpr bool do_trans = false; static constexpr bool do_times = false; + static constexpr bool is_fast = false; // can't guarantee that memory is reused const subview& sv; const Mat M; @@ -1373,7 +1379,7 @@ struct partial_unwrap< subview_col > : orig( A.m ) , M ( const_cast( A.colmem ), A.n_rows, false, false ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(1); } @@ -1383,6 +1389,7 @@ struct partial_unwrap< subview_col > static constexpr bool do_trans = false; static constexpr bool do_times = false; + static constexpr bool is_fast = true; const Mat& orig; const Col M; @@ -1400,7 +1407,7 @@ struct partial_unwrap< subview_cols > : orig( A.m ) , M ( const_cast( A.colptr(0) ), A.n_rows, A.n_cols, false, false ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(1); } @@ -1410,6 +1417,7 @@ struct partial_unwrap< subview_cols > static constexpr bool do_trans = false; static constexpr bool do_times = false; + static constexpr bool is_fast = true; const Mat& orig; const Mat M; @@ -1426,7 +1434,7 @@ struct partial_unwrap< subview_row > partial_unwrap(const subview_row& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(1); } @@ -1436,6 +1444,7 @@ struct partial_unwrap< subview_row > static constexpr bool do_trans = false; static constexpr bool do_times = false; + static constexpr bool is_fast = false; const Row M; }; @@ -1452,7 +1461,7 @@ struct partial_unwrap_htrans_default partial_unwrap_htrans_default(const Op& A) : M(A.m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(1); } @@ -1462,6 +1471,7 @@ struct partial_unwrap_htrans_default static constexpr bool do_trans = true; static constexpr bool do_times = false; + static constexpr bool is_fast = false; const Mat M; }; @@ -1477,7 +1487,7 @@ struct partial_unwrap_htrans_fixed partial_unwrap_htrans_fixed(const Op& A) : M(A.m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(1); } @@ -1487,6 +1497,7 @@ struct partial_unwrap_htrans_fixed static constexpr bool do_trans = true; static constexpr bool do_times = false; + static constexpr bool is_fast = true; const T1& M; }; @@ -1522,7 +1533,7 @@ struct partial_unwrap< Op< Mat, op_htrans> > partial_unwrap(const Op< Mat, op_htrans>& A) : M(A.m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(1); } @@ -1532,6 +1543,7 @@ struct partial_unwrap< Op< Mat, op_htrans> > static constexpr bool do_trans = true; static constexpr bool do_times = false; + static constexpr bool is_fast = true; const Mat& M; }; @@ -1547,7 +1559,7 @@ struct partial_unwrap< Op< Row, op_htrans> > partial_unwrap(const Op< Row, op_htrans>& A) : M(A.m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(1); } @@ -1557,6 +1569,7 @@ struct partial_unwrap< Op< Row, op_htrans> > static constexpr bool do_trans = true; static constexpr bool do_times = false; + static constexpr bool is_fast = true; const Row& M; }; @@ -1572,7 +1585,7 @@ struct partial_unwrap< Op< Col, op_htrans> > partial_unwrap(const Op< Col, op_htrans>& A) : M(A.m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(1); } @@ -1582,6 +1595,7 @@ struct partial_unwrap< Op< Col, op_htrans> > static constexpr bool do_trans = true; static constexpr bool do_times = false; + static constexpr bool is_fast = true; const Col& M; }; @@ -1598,7 +1612,7 @@ struct partial_unwrap< Op< subview, op_htrans> > : sv( A.m ) , M ( A.m, ((A.m.aux_row1 == 0) && (A.m.n_rows == A.m.m.n_rows)) ) // reuse memory if the subview is a contiguous chunk { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(1); } @@ -1608,6 +1622,7 @@ struct partial_unwrap< Op< subview, op_htrans> > static constexpr bool do_trans = true; static constexpr bool do_times = false; + static constexpr bool is_fast = false; // can't guarantee that memory is reused const subview& sv; const Mat M; @@ -1625,7 +1640,7 @@ struct partial_unwrap< Op< subview_cols, op_htrans> > : orig( A.m.m ) , M ( const_cast( A.m.colptr(0) ), A.m.n_rows, A.m.n_cols, false, false ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(1); } @@ -1635,6 +1650,7 @@ struct partial_unwrap< Op< subview_cols, op_htrans> > static constexpr bool do_trans = true; static constexpr bool do_times = false; + static constexpr bool is_fast = true; const Mat& orig; const Mat M; @@ -1652,7 +1668,7 @@ struct partial_unwrap< Op< subview_col, op_htrans> > : orig( A.m.m ) , M ( const_cast( A.m.colmem ), A.m.n_rows, false, false ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(1); } @@ -1662,6 +1678,7 @@ struct partial_unwrap< Op< subview_col, op_htrans> > static constexpr bool do_trans = true; static constexpr bool do_times = false; + static constexpr bool is_fast = true; const Mat& orig; const Col M; @@ -1678,7 +1695,7 @@ struct partial_unwrap< Op< subview_row, op_htrans> > partial_unwrap(const Op< subview_row, op_htrans>& A) : M(A.m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(1); } @@ -1688,6 +1705,7 @@ struct partial_unwrap< Op< subview_row, op_htrans> > static constexpr bool do_trans = true; static constexpr bool do_times = false; + static constexpr bool is_fast = false; const Row M; }; @@ -1705,7 +1723,7 @@ struct partial_unwrap_htrans2_default : val(A.aux) , M (A.m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline eT get_val() const { return val; } @@ -1715,6 +1733,7 @@ struct partial_unwrap_htrans2_default static constexpr bool do_trans = true; static constexpr bool do_times = true; + static constexpr bool is_fast = false; const eT val; const Mat M; @@ -1732,7 +1751,7 @@ struct partial_unwrap_htrans2_fixed : val(A.aux) , M (A.m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline eT get_val() const { return val; } @@ -1742,6 +1761,7 @@ struct partial_unwrap_htrans2_fixed static constexpr bool do_trans = true; static constexpr bool do_times = true; + static constexpr bool is_fast = true; const eT val; const T1& M; @@ -1779,7 +1799,7 @@ struct partial_unwrap< Op< Mat, op_htrans2> > : val(A.aux) , M (A.m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline eT get_val() const { return val; } @@ -1789,6 +1809,7 @@ struct partial_unwrap< Op< Mat, op_htrans2> > static constexpr bool do_trans = true; static constexpr bool do_times = true; + static constexpr bool is_fast = true; const eT val; const Mat& M; @@ -1806,7 +1827,7 @@ struct partial_unwrap< Op< Row, op_htrans2> > : val(A.aux) , M (A.m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline eT get_val() const { return val; } @@ -1816,6 +1837,7 @@ struct partial_unwrap< Op< Row, op_htrans2> > static constexpr bool do_trans = true; static constexpr bool do_times = true; + static constexpr bool is_fast = true; const eT val; const Row& M; @@ -1833,7 +1855,7 @@ struct partial_unwrap< Op< Col, op_htrans2> > : val(A.aux) , M (A.m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline eT get_val() const { return val; } @@ -1843,6 +1865,7 @@ struct partial_unwrap< Op< Col, op_htrans2> > static constexpr bool do_trans = true; static constexpr bool do_times = true; + static constexpr bool is_fast = true; const eT val; const Col& M; @@ -1861,7 +1884,7 @@ struct partial_unwrap< Op< subview, op_htrans2> > , val( A.aux ) , M ( A.m, ((A.m.aux_row1 == 0) && (A.m.n_rows == A.m.m.n_rows)) ) // reuse memory if the subview is a contiguous chunk { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline eT get_val() const { return val; } @@ -1871,6 +1894,7 @@ struct partial_unwrap< Op< subview, op_htrans2> > static constexpr bool do_trans = true; static constexpr bool do_times = true; + static constexpr bool is_fast = false; // can't guarantee that memory is reused const subview& sv; const eT val; @@ -1890,7 +1914,7 @@ struct partial_unwrap< Op< subview_cols, op_htrans2> > , val ( A.aux ) , M ( const_cast( A.m.colptr(0) ), A.m.n_rows, A.m.n_cols, false, false ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline eT get_val() const { return val; } @@ -1900,6 +1924,7 @@ struct partial_unwrap< Op< subview_cols, op_htrans2> > static constexpr bool do_trans = true; static constexpr bool do_times = true; + static constexpr bool is_fast = true; const Mat& orig; const eT val; @@ -1919,7 +1944,7 @@ struct partial_unwrap< Op< subview_col, op_htrans2> > , val ( A.aux ) , M ( const_cast( A.m.colmem ), A.m.n_rows, false, false ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline eT get_val() const { return val; } @@ -1929,6 +1954,7 @@ struct partial_unwrap< Op< subview_col, op_htrans2> > static constexpr bool do_trans = true; static constexpr bool do_times = true; + static constexpr bool is_fast = true; const Mat& orig; @@ -1948,7 +1974,7 @@ struct partial_unwrap< Op< subview_row, op_htrans2> > : val(A.aux) , M (A.m ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline eT get_val() const { return val; } @@ -1958,6 +1984,7 @@ struct partial_unwrap< Op< subview_row, op_htrans2> > static constexpr bool do_trans = true; static constexpr bool do_times = true; + static constexpr bool is_fast = false; const eT val; const Row M; @@ -1976,7 +2003,7 @@ struct partial_unwrap_scalar_times_default : val(A.aux) , M (A.P.Q) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline eT get_val() const { return val; } @@ -1986,6 +2013,7 @@ struct partial_unwrap_scalar_times_default static constexpr bool do_trans = false; static constexpr bool do_times = true; + static constexpr bool is_fast = false; const eT val; const Mat M; @@ -2004,7 +2032,7 @@ struct partial_unwrap_scalar_times_fixed : val(A.aux) , M (A.P.Q) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline eT get_val() const { return val; } @@ -2014,6 +2042,7 @@ struct partial_unwrap_scalar_times_fixed static constexpr bool do_trans = false; static constexpr bool do_times = true; + static constexpr bool is_fast = true; const eT val; const T1& M; @@ -2055,7 +2084,7 @@ struct partial_unwrap< eOp, eop_scalar_times> > : val(A.aux) , M (A.P.Q) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline eT get_val() const { return val; } @@ -2065,6 +2094,7 @@ struct partial_unwrap< eOp, eop_scalar_times> > static constexpr bool do_trans = false; static constexpr bool do_times = true; + static constexpr bool is_fast = true; const eT val; const Mat& M; @@ -2082,7 +2112,7 @@ struct partial_unwrap< eOp, eop_scalar_times> > : val(A.aux) , M (A.P.Q) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline eT get_val() const { return val; } @@ -2092,6 +2122,7 @@ struct partial_unwrap< eOp, eop_scalar_times> > static constexpr bool do_trans = false; static constexpr bool do_times = true; + static constexpr bool is_fast = true; const eT val; const Row& M; @@ -2109,7 +2140,7 @@ struct partial_unwrap< eOp, eop_scalar_times> > : val(A.aux) , M (A.P.Q) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline eT get_val() const { return val; } @@ -2119,6 +2150,7 @@ struct partial_unwrap< eOp, eop_scalar_times> > static constexpr bool do_trans = false; static constexpr bool do_times = true; + static constexpr bool is_fast = true; const eT val; const Col& M; @@ -2137,7 +2169,7 @@ struct partial_unwrap< eOp, eop_scalar_times> > , val ( A.aux ) , M ( const_cast( A.P.Q.colmem ), A.P.Q.n_rows, false, false ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline eT get_val() const { return val; } @@ -2147,6 +2179,7 @@ struct partial_unwrap< eOp, eop_scalar_times> > static constexpr bool do_trans = false; static constexpr bool do_times = true; + static constexpr bool is_fast = true; const Mat& orig; @@ -2166,7 +2199,7 @@ struct partial_unwrap< eOp, eop_scalar_times> > : val(A.aux) , M (A.P.Q) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline eT get_val() const { return val; } @@ -2176,6 +2209,7 @@ struct partial_unwrap< eOp, eop_scalar_times> > static constexpr bool do_trans = false; static constexpr bool do_times = true; + static constexpr bool is_fast = false; const eT val; const Row M; @@ -2193,7 +2227,7 @@ struct partial_unwrap_neg_default partial_unwrap_neg_default(const eOp& A) : M(A.P.Q) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(-1); } @@ -2203,6 +2237,7 @@ struct partial_unwrap_neg_default static constexpr bool do_trans = false; static constexpr bool do_times = true; + static constexpr bool is_fast = false; const Mat M; }; @@ -2219,7 +2254,7 @@ struct partial_unwrap_neg_fixed partial_unwrap_neg_fixed(const eOp& A) : M(A.P.Q) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(-1); } @@ -2229,6 +2264,7 @@ struct partial_unwrap_neg_fixed static constexpr bool do_trans = false; static constexpr bool do_times = true; + static constexpr bool is_fast = true; const T1& M; }; @@ -2268,7 +2304,7 @@ struct partial_unwrap< eOp, eop_neg> > partial_unwrap(const eOp,eop_neg>& A) : M(A.P.Q) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(-1); } @@ -2278,6 +2314,7 @@ struct partial_unwrap< eOp, eop_neg> > static constexpr bool do_trans = false; static constexpr bool do_times = true; + static constexpr bool is_fast = true; const Mat& M; }; @@ -2293,7 +2330,7 @@ struct partial_unwrap< eOp, eop_neg> > partial_unwrap(const eOp,eop_neg>& A) : M(A.P.Q) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(-1); } @@ -2303,6 +2340,7 @@ struct partial_unwrap< eOp, eop_neg> > static constexpr bool do_trans = false; static constexpr bool do_times = true; + static constexpr bool is_fast = true; const Row& M; }; @@ -2318,7 +2356,7 @@ struct partial_unwrap< eOp, eop_neg> > partial_unwrap(const eOp,eop_neg>& A) : M(A.P.Q) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(-1); } @@ -2328,6 +2366,7 @@ struct partial_unwrap< eOp, eop_neg> > static constexpr bool do_trans = false; static constexpr bool do_times = true; + static constexpr bool is_fast = true; const Col& M; }; @@ -2344,7 +2383,7 @@ struct partial_unwrap< eOp, eop_neg> > : orig( A.P.Q.m ) , M ( const_cast( A.P.Q.colmem ), A.P.Q.n_rows, false, false ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(-1); } @@ -2354,6 +2393,7 @@ struct partial_unwrap< eOp, eop_neg> > static constexpr bool do_trans = false; static constexpr bool do_times = true; + static constexpr bool is_fast = true; const Mat& orig; const Col M; @@ -2370,7 +2410,7 @@ struct partial_unwrap< eOp, eop_neg> > partial_unwrap(const eOp,eop_neg>& A) : M(A.P.Q) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(-1); } @@ -2380,6 +2420,7 @@ struct partial_unwrap< eOp, eop_neg> > static constexpr bool do_trans = false; static constexpr bool do_times = true; + static constexpr bool is_fast = false; const Row M; }; @@ -2400,7 +2441,7 @@ struct partial_unwrap_check_default partial_unwrap_check_default(const T1& A, const Mat&) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(1); } @@ -2423,13 +2464,13 @@ struct partial_unwrap_check_fixed : M_local( (&A == &B) ? new T1(A) : nullptr ) , M ( (&A == &B) ? (*M_local) : A ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline ~partial_unwrap_check_fixed() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(M_local) { delete M_local; } } @@ -2477,14 +2518,14 @@ struct partial_unwrap_check< Mat > : M_local ( (&A == &B) ? new Mat(A) : nullptr ) , M ( (&A == &B) ? (*M_local) : A ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline ~partial_unwrap_check() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(M_local) { delete M_local; } } @@ -2511,14 +2552,14 @@ struct partial_unwrap_check< Row > : M_local ( (&A == &B) ? new Row(A) : nullptr ) , M ( (&A == &B) ? (*M_local) : A ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline ~partial_unwrap_check() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(M_local) { delete M_local; } } @@ -2545,14 +2586,14 @@ struct partial_unwrap_check< Col > : M_local ( (&A == &B) ? new Col(A) : nullptr ) , M ( (&A == &B) ? (*M_local) : A ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline ~partial_unwrap_check() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(M_local) { delete M_local; } } @@ -2580,7 +2621,7 @@ struct partial_unwrap_check< subview_col > partial_unwrap_check(const subview_col& A, const Mat& B) : M ( const_cast( A.colmem ), A.n_rows, (&(A.m) == &B), false ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(1); } @@ -2603,7 +2644,7 @@ struct partial_unwrap_check_htrans_default partial_unwrap_check_htrans_default(const Op& A, const Mat&) : M(A.m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(1); } @@ -2626,13 +2667,13 @@ struct partial_unwrap_check_htrans_fixed : M_local( (&(A.m) == &B) ? new T1(A.m) : nullptr ) , M ( (&(A.m) == &B) ? (*M_local) : A.m ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline ~partial_unwrap_check_htrans_fixed() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(M_local) { delete M_local; } } @@ -2681,13 +2722,13 @@ struct partial_unwrap_check< Op< Mat, op_htrans> > : M_local ( (&A.m == &B) ? new Mat(A.m) : nullptr ) , M ( (&A.m == &B) ? (*M_local) : A.m ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline ~partial_unwrap_check() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(M_local) { delete M_local; } } @@ -2714,13 +2755,13 @@ struct partial_unwrap_check< Op< Row, op_htrans> > : M_local ( (&A.m == &B) ? new Row(A.m) : nullptr ) , M ( (&A.m == &B) ? (*M_local) : A.m ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline ~partial_unwrap_check() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(M_local) { delete M_local; } } @@ -2747,13 +2788,13 @@ struct partial_unwrap_check< Op< Col, op_htrans> > : M_local ( (&A.m == &B) ? new Col(A.m) : nullptr ) , M ( (&A.m == &B) ? (*M_local) : A.m ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline ~partial_unwrap_check() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(M_local) { delete M_local; } } @@ -2781,7 +2822,7 @@ struct partial_unwrap_check< Op< subview_col, op_htrans> > partial_unwrap_check(const Op< subview_col, op_htrans>& A, const Mat& B) : M ( const_cast( A.m.colmem ), A.m.n_rows, (&(A.m.m) == &B), false ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(1); } @@ -2805,7 +2846,7 @@ struct partial_unwrap_check_htrans2_default : val(A.aux) , M (A.m) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline eT get_val() const { return val; } @@ -2831,13 +2872,13 @@ struct partial_unwrap_check_htrans2_fixed , M_local( (&(A.m) == &B) ? new T1(A.m) : nullptr ) , M ( (&(A.m) == &B) ? (*M_local) : A.m ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline ~partial_unwrap_check_htrans2_fixed() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(M_local) { delete M_local; } } @@ -2888,13 +2929,13 @@ struct partial_unwrap_check< Op< Mat, op_htrans2> > , M_local ( (&A.m == &B) ? new Mat(A.m) : nullptr ) , M ( (&A.m == &B) ? (*M_local) : A.m ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline ~partial_unwrap_check() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(M_local) { delete M_local; } } @@ -2923,13 +2964,13 @@ struct partial_unwrap_check< Op< Row, op_htrans2> > , M_local ( (&A.m == &B) ? new Row(A.m) : nullptr ) , M ( (&A.m == &B) ? (*M_local) : A.m ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline ~partial_unwrap_check() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(M_local) { delete M_local; } } @@ -2958,13 +2999,13 @@ struct partial_unwrap_check< Op< Col, op_htrans2> > , M_local ( (&A.m == &B) ? new Col(A.m) : nullptr ) , M ( (&A.m == &B) ? (*M_local) : A.m ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline ~partial_unwrap_check() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(M_local) { delete M_local; } } @@ -2994,7 +3035,7 @@ struct partial_unwrap_check< Op< subview_col, op_htrans2> > : val( A.aux ) , M ( const_cast( A.m.colmem ), A.m.n_rows, (&(A.m.m) == &B), false ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline eT get_val() const { return val; } @@ -3019,7 +3060,7 @@ struct partial_unwrap_check_scalar_times_default : val(A.aux) , M (A.P.Q) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline eT get_val() const { return val; } @@ -3045,13 +3086,13 @@ struct partial_unwrap_check_scalar_times_fixed , M_local( (&(A.P.Q) == &B) ? new T1(A.P.Q) : nullptr ) , M ( (&(A.P.Q) == &B) ? (*M_local) : A.P.Q ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline ~partial_unwrap_check_scalar_times_fixed() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(M_local) { delete M_local; } } @@ -3102,13 +3143,13 @@ struct partial_unwrap_check< eOp, eop_scalar_times> > , M_local( (&(A.P.Q) == &B) ? new Mat(A.P.Q) : nullptr ) , M ( (&(A.P.Q) == &B) ? *M_local : A.P.Q ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline ~partial_unwrap_check() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(M_local) { delete M_local; } } @@ -3136,13 +3177,13 @@ struct partial_unwrap_check< eOp, eop_scalar_times> > , M_local( (&(A.P.Q) == &B) ? new Row(A.P.Q) : nullptr ) , M ( (&(A.P.Q) == &B) ? *M_local : A.P.Q ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline ~partial_unwrap_check() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(M_local) { delete M_local; } } @@ -3170,13 +3211,13 @@ struct partial_unwrap_check< eOp, eop_scalar_times> > , M_local( (&(A.P.Q) == &B) ? new Col(A.P.Q) : nullptr ) , M ( (&(A.P.Q) == &B) ? *M_local : A.P.Q ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline ~partial_unwrap_check() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(M_local) { delete M_local; } } @@ -3205,7 +3246,7 @@ struct partial_unwrap_check< eOp, eop_scalar_times> > : val( A.aux ) , M ( const_cast( A.P.Q.colmem ), A.P.Q.n_rows, (&(A.P.Q.m) == &B), false ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } arma_inline eT get_val() const { return val; } @@ -3229,7 +3270,7 @@ struct partial_unwrap_check_neg_default partial_unwrap_check_neg_default(const eOp& A, const Mat&) : M(A.P.Q) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(-1); } @@ -3253,13 +3294,13 @@ struct partial_unwrap_check_neg_fixed : M_local( (&(A.P.Q) == &B) ? new T1(A.P.Q) : nullptr ) , M ( (&(A.P.Q) == &B) ? (*M_local) : A.P.Q ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline ~partial_unwrap_check_neg_fixed() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(M_local) { delete M_local; } } @@ -3308,13 +3349,13 @@ struct partial_unwrap_check< eOp, eop_neg> > : M_local( (&(A.P.Q) == &B) ? new Mat(A.P.Q) : nullptr ) , M ( (&(A.P.Q) == &B) ? *M_local : A.P.Q ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline ~partial_unwrap_check() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(M_local) { delete M_local; } } @@ -3340,13 +3381,13 @@ struct partial_unwrap_check< eOp, eop_neg> > : M_local( (&(A.P.Q) == &B) ? new Row(A.P.Q) : nullptr ) , M ( (&(A.P.Q) == &B) ? *M_local : A.P.Q ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline ~partial_unwrap_check() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(M_local) { delete M_local; } } @@ -3372,13 +3413,13 @@ struct partial_unwrap_check< eOp, eop_neg> > : M_local( (&(A.P.Q) == &B) ? new Col(A.P.Q) : nullptr ) , M ( (&(A.P.Q) == &B) ? *M_local : A.P.Q ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline ~partial_unwrap_check() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(M_local) { delete M_local; } } @@ -3405,7 +3446,7 @@ struct partial_unwrap_check< eOp, eop_neg> > partial_unwrap_check(const eOp,eop_neg>& A, const Mat& B) : M ( const_cast( A.P.Q.colmem ), A.P.Q.n_rows, (&(A.P.Q.m) == &B), false ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } constexpr eT get_val() const { return eT(-1); } diff --git a/inst/include/armadillo_bits/unwrap_cube.hpp b/inst/include/armadillo_bits/unwrap_cube.hpp index ca91cfad..8017b2f1 100644 --- a/inst/include/armadillo_bits/unwrap_cube.hpp +++ b/inst/include/armadillo_bits/unwrap_cube.hpp @@ -30,7 +30,7 @@ struct unwrap_cube unwrap_cube(const T1& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const Cube M; @@ -48,7 +48,7 @@ struct unwrap_cube< Cube > unwrap_cube(const Cube& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const Cube& M; @@ -74,7 +74,7 @@ struct unwrap_cube_check unwrap_cube_check(const T1& A, const Cube&) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_arma_cube_type::value == false )); } @@ -83,7 +83,7 @@ struct unwrap_cube_check unwrap_cube_check(const T1& A, const bool) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); arma_type_check(( is_arma_cube_type::value == false )); } @@ -101,7 +101,7 @@ struct unwrap_cube_check< Cube > : M_local( (&A == &B) ? new Cube(A) : nullptr ) , M ( (&A == &B) ? (*M_local) : A ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -110,14 +110,14 @@ struct unwrap_cube_check< Cube > : M_local( is_alias ? new Cube(A) : nullptr ) , M ( is_alias ? (*M_local) : A ) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } inline ~unwrap_cube_check() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); if(M_local) { delete M_local; } } diff --git a/inst/include/armadillo_bits/unwrap_spmat.hpp b/inst/include/armadillo_bits/unwrap_spmat.hpp index 0597aaa2..2290bd9d 100644 --- a/inst/include/armadillo_bits/unwrap_spmat.hpp +++ b/inst/include/armadillo_bits/unwrap_spmat.hpp @@ -32,7 +32,7 @@ struct unwrap_spmat unwrap_spmat(const T1& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const SpMat M; @@ -52,7 +52,7 @@ struct unwrap_spmat< SpMat > unwrap_spmat(const SpMat& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); M.sync(); } @@ -74,7 +74,7 @@ struct unwrap_spmat< SpRow > unwrap_spmat(const SpRow& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); M.sync(); } @@ -96,7 +96,7 @@ struct unwrap_spmat< SpCol > unwrap_spmat(const SpCol& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); M.sync(); } @@ -120,7 +120,7 @@ struct unwrap_spmat< SpOp > unwrap_spmat(const SpOp& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const SpMat M; @@ -142,7 +142,7 @@ struct unwrap_spmat< SpGlue > unwrap_spmat(const SpGlue& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const SpMat M; @@ -162,7 +162,7 @@ struct unwrap_spmat< mtSpOp > unwrap_spmat(const mtSpOp& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const SpMat M; @@ -182,7 +182,7 @@ struct unwrap_spmat< mtSpGlue > unwrap_spmat(const mtSpGlue& A) : M(A) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } const SpMat M; diff --git a/inst/include/armadillo_bits/wall_clock_meat.hpp b/inst/include/armadillo_bits/wall_clock_meat.hpp index a45b88a2..9f6459ab 100644 --- a/inst/include/armadillo_bits/wall_clock_meat.hpp +++ b/inst/include/armadillo_bits/wall_clock_meat.hpp @@ -23,7 +23,7 @@ inline wall_clock::wall_clock() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); chrono_time1 = std::chrono::steady_clock::now(); // warmup } @@ -33,7 +33,7 @@ wall_clock::wall_clock() inline wall_clock::~wall_clock() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -42,7 +42,7 @@ inline void wall_clock::tic() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); chrono_time1 = std::chrono::steady_clock::now(); @@ -55,7 +55,7 @@ inline double wall_clock::toc() { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); const std::chrono::steady_clock::time_point chrono_time2 = std::chrono::steady_clock::now(); diff --git a/inst/include/armadillo_bits/xtrans_mat_meat.hpp b/inst/include/armadillo_bits/xtrans_mat_meat.hpp index 1872c303..7be5b62a 100644 --- a/inst/include/armadillo_bits/xtrans_mat_meat.hpp +++ b/inst/include/armadillo_bits/xtrans_mat_meat.hpp @@ -28,7 +28,7 @@ xtrans_mat::xtrans_mat(const Mat& in_X) , n_cols(in_X.n_rows) , n_elem(in_X.n_elem) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -38,7 +38,7 @@ inline void xtrans_mat::extract(Mat& out) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); really_do_conj ? op_htrans::apply_mat(out, X) : op_strans::apply_mat(out, X); } diff --git a/inst/include/armadillo_bits/xvec_htrans_meat.hpp b/inst/include/armadillo_bits/xvec_htrans_meat.hpp index b79a7ef1..00f517cb 100644 --- a/inst/include/armadillo_bits/xvec_htrans_meat.hpp +++ b/inst/include/armadillo_bits/xvec_htrans_meat.hpp @@ -28,7 +28,7 @@ xvec_htrans::xvec_htrans(const eT* const in_mem, const uword in_n_rows, cons , n_cols(in_n_rows ) , n_elem(in_n_rows*in_n_cols) { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); } @@ -38,7 +38,7 @@ inline void xvec_htrans::extract(Mat& out) const { - arma_extra_debug_sigprint(); + arma_debug_sigprint(); // NOTE: this function assumes that matrix 'out' has already been set to the correct size From d25f83e14739b59ece148558ccedacbc1193bd69 Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Mon, 10 Jun 2024 07:33:45 -0500 Subject: [PATCH 2/7] RcppArmadillo 0.12.8.4.0.14.0 first test for 14.0.0 --- DESCRIPTION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index adae0f6e..c6888665 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: RcppArmadillo Type: Package Title: 'Rcpp' Integration for the 'Armadillo' Templated Linear Algebra Library -Version: 0.12.8.4.0 -Date: 2024-05-30 +Version: 0.12.8.4.0.14.0 +Date: 2024-06-10 Author: Dirk Eddelbuettel, Romain Francois, Doug Bates, Binxiang Ni, and Conrad Sanderson Maintainer: Dirk Eddelbuettel Description: 'Armadillo' is a templated C++ linear algebra library (by Conrad From c15c3e6f3686cb01f3e56161fd97ed0454ba92f9 Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Tue, 11 Jun 2024 11:45:01 -0500 Subject: [PATCH 3/7] Updated / relaxed C++11 check --- .../include/armadillo_bits/compiler_check.hpp | 19 ++- .../include/armadillo_bits/compiler_setup.hpp | 29 +++- inst/include/armadillo_bits/debug.hpp | 1 + inst/include/armadillo_bits/fn_accu.hpp | 33 ++++- inst/include/armadillo_bits/fn_as_scalar.hpp | 2 +- inst/include/armadillo_bits/op_dot_bones.hpp | 4 +- inst/include/armadillo_bits/op_dot_meat.hpp | 47 ++++++- inst/include/armadillo_bits/unwrap.hpp | 132 +++++++++++++++++- 8 files changed, 253 insertions(+), 14 deletions(-) diff --git a/inst/include/armadillo_bits/compiler_check.hpp b/inst/include/armadillo_bits/compiler_check.hpp index 396efcde..18ea59a1 100644 --- a/inst/include/armadillo_bits/compiler_check.hpp +++ b/inst/include/armadillo_bits/compiler_check.hpp @@ -16,11 +16,16 @@ // ------------------------------------------------------------------------ +#undef ARMA_HAVE_CXX11 #undef ARMA_HAVE_CXX14 #undef ARMA_HAVE_CXX17 #undef ARMA_HAVE_CXX20 #undef ARMA_HAVE_CXX23 +#if (__cplusplus >= 201103L) + #define ARMA_HAVE_CXX11 +#endif + #if (__cplusplus >= 201402L) #define ARMA_HAVE_CXX14 #endif @@ -42,6 +47,9 @@ #if defined(_MSVC_LANG) #if (_MSVC_LANG >= 201402L) + #undef ARMA_HAVE_CXX11 + #define ARMA_HAVE_CXX11 + #undef ARMA_HAVE_CXX14 #define ARMA_HAVE_CXX14 #endif @@ -70,8 +78,15 @@ #endif -#if !defined(ARMA_HAVE_CXX14) - #error "*** C++14 compiler required; enable C++14 mode in your compiler, or use an earlier version of Armadillo" +#if !defined(ARMA_HAVE_CXX11) + #error "*** C++11 compiler required; enable C++11 mode in your compiler, or use an earlier version of Armadillo" +#endif + + +#if (!defined(ARMA_HAVE_CXX14)) + #if (!defined(ARMA_IGNORE_DEPRECATED_MARKER)) || defined(ARMA_DONT_IGNORE_DEPRECATED_MARKER) || defined(ARMA_DEBUG) + #pragma message ("INFO: support for C++11 is deprecated") + #endif #endif diff --git a/inst/include/armadillo_bits/compiler_setup.hpp b/inst/include/armadillo_bits/compiler_setup.hpp index 43dce590..d6c151ba 100644 --- a/inst/include/armadillo_bits/compiler_setup.hpp +++ b/inst/include/armadillo_bits/compiler_setup.hpp @@ -34,8 +34,8 @@ #define arma_aligned #define arma_align_mem #define arma_warn_unused -#define arma_deprecated [[deprecated]] -#define arma_frown(msg) [[deprecated(msg)]] +#define arma_deprecated +#define arma_frown(msg) #define arma_malloc #define arma_inline inline #define arma_noinline @@ -175,6 +175,8 @@ #undef arma_aligned #undef arma_align_mem #undef arma_warn_unused + #undef arma_deprecated + #undef arma_frown #undef arma_malloc #undef arma_inline #undef arma_noinline @@ -184,6 +186,8 @@ #define arma_aligned __attribute__((__aligned__)) #define arma_align_mem __attribute__((__aligned__(16))) #define arma_warn_unused __attribute__((__warn_unused_result__)) + #define arma_deprecated __attribute__((__deprecated__)) + #define arma_frown(msg) __attribute__((__deprecated__(msg))) #define arma_malloc __attribute__((__malloc__)) #define arma_inline __attribute__((__always_inline__)) inline #define arma_noinline __attribute__((__noinline__)) @@ -243,6 +247,16 @@ #define arma_warn_unused __attribute__((__warn_unused_result__)) #endif + #if __has_attribute(__deprecated__) + #undef arma_deprecated + #define arma_deprecated __attribute__((__deprecated__)) + #endif + + #if __has_attribute(__deprecated__) + #undef arma_frown + #define arma_frown(msg) __attribute__((__deprecated__(msg))) + #endif + #if __has_attribute(__malloc__) #undef arma_malloc #define arma_malloc __attribute__((__malloc__)) @@ -302,6 +316,8 @@ #error "*** newer compiler required ***" #endif + #undef arma_deprecated + #define arma_deprecated __declspec(deprecated) // #undef arma_inline // #define arma_inline __forceinline inline @@ -359,6 +375,15 @@ #endif +#if defined(ARMA_HAVE_CXX14) + #undef arma_deprecated + #define arma_deprecated [[deprecated]] + + #undef arma_frown + #define arma_frown(msg) [[deprecated(msg)]] +#endif + + #if defined(ARMA_HAVE_CXX17) #undef arma_warn_unused #define arma_warn_unused [[nodiscard]] diff --git a/inst/include/armadillo_bits/debug.hpp b/inst/include/armadillo_bits/debug.hpp index 89176fc3..e536376e 100644 --- a/inst/include/armadillo_bits/debug.hpp +++ b/inst/include/armadillo_bits/debug.hpp @@ -1420,6 +1420,7 @@ inline void arma_debug_check(bool state, const char* msg) { arma_conform_check( << " (" << nickname << ')'; out << "\n@ arma_config::wrapper = " << arma_config::wrapper; + out << "\n@ arma_config::cxx14 = " << arma_config::cxx14; out << "\n@ arma_config::cxx17 = " << arma_config::cxx17; out << "\n@ arma_config::cxx20 = " << arma_config::cxx20; out << "\n@ arma_config::cxx23 = " << arma_config::cxx23; diff --git a/inst/include/armadillo_bits/fn_accu.hpp b/inst/include/armadillo_bits/fn_accu.hpp index dc297c44..e7c07b3e 100644 --- a/inst/include/armadillo_bits/fn_accu.hpp +++ b/inst/include/armadillo_bits/fn_accu.hpp @@ -314,7 +314,7 @@ accu(const Glue& expr) arma_conform_assert_mul_size(PA.get_n_rows(), PA.get_n_cols(), PB.get_n_rows(), PB.get_n_cols(), "matrix multiplication"); - return op_dot::apply_proxy(PA,PB); + return op_dot::apply_proxy_linear(PA,PB); } } @@ -339,11 +339,42 @@ accu(const eGlue& expr) typedef typename expr_type::proxy1_type::stored_type P1_stored_type; typedef typename expr_type::proxy2_type::stored_type P2_stored_type; + constexpr bool is_sv = (is_subview::value) || (is_subview::value); + + if( (is_sv) && (expr.get_n_rows() >= 4) ) + { + arma_debug_print("accu(): eglue_schur subview optimisation"); + + typedef typename T1::elem_type eT; + + const sv_keep_unwrap& UA(expr.P1.Q); + const sv_keep_unwrap& UB(expr.P2.Q); + + typedef typename sv_keep_unwrap::stored_type UA_M_type; + typedef typename sv_keep_unwrap::stored_type UB_M_type; + + const UA_M_type& A = UA.M; + const UB_M_type& B = UB.M; + + // A and B have the same size (checked by the eGlue constructor) + + const uword A_n_rows = A.n_rows; + const uword A_n_cols = A.n_cols; + + eT acc = eT(0); + + for(uword c=0; c < A_n_cols; ++c) { acc += op_dot::direct_dot(A_n_rows, A.colptr(c), B.colptr(c)); } + + return acc; + } + constexpr bool have_direct_mem_1 = (is_Mat::value) || (is_subview_col::value); constexpr bool have_direct_mem_2 = (is_Mat::value) || (is_subview_col::value); if(have_direct_mem_1 && have_direct_mem_2) { + arma_debug_print("accu(): eglue_schur direct_mem optimisation"); + const quasi_unwrap tmp1(expr.P1.Q); const quasi_unwrap tmp2(expr.P2.Q); diff --git a/inst/include/armadillo_bits/fn_as_scalar.hpp b/inst/include/armadillo_bits/fn_as_scalar.hpp index e2ae69cf..38cf8bf1 100644 --- a/inst/include/armadillo_bits/fn_as_scalar.hpp +++ b/inst/include/armadillo_bits/fn_as_scalar.hpp @@ -117,7 +117,7 @@ as_scalar_redirect<2>::apply(const Glue& X) "as_scalar(): incompatible dimensions" ); - return op_dot::apply_proxy(PA,PB); + return op_dot::apply_proxy_linear(PA,PB); } } diff --git a/inst/include/armadillo_bits/op_dot_bones.hpp b/inst/include/armadillo_bits/op_dot_bones.hpp index 23068de8..d4b0674b 100644 --- a/inst/include/armadillo_bits/op_dot_bones.hpp +++ b/inst/include/armadillo_bits/op_dot_bones.hpp @@ -57,10 +57,10 @@ class op_dot arma_hot inline static typename T1::elem_type apply(const T1& X, const T2& Y); template - arma_hot inline static typename arma_not_cx::result apply_proxy(const Proxy& PA, const Proxy& PB); + arma_hot inline static typename arma_not_cx::result apply_proxy_linear(const Proxy& PA, const Proxy& PB); template - arma_hot inline static typename arma_cx_only::result apply_proxy(const Proxy& PA, const Proxy& PB); + arma_hot inline static typename arma_cx_only::result apply_proxy_linear(const Proxy& PA, const Proxy& PB); }; diff --git a/inst/include/armadillo_bits/op_dot_meat.hpp b/inst/include/armadillo_bits/op_dot_meat.hpp index ec462cbe..e4ed53e8 100644 --- a/inst/include/armadillo_bits/op_dot_meat.hpp +++ b/inst/include/armadillo_bits/op_dot_meat.hpp @@ -216,6 +216,8 @@ op_dot::apply(const T1& X, const T2& Y) if( (A.m.n_rows == 1) && (B.m.n_rows == 1) ) { + arma_debug_print("op_dot::apply(): subview_row optimisation"); + arma_conform_check( (A.n_elem != B.n_elem), "dot(): objects must have the same number of elements" ); const eT* A_mem = A.m.memptr(); @@ -225,10 +227,47 @@ op_dot::apply(const T1& X, const T2& Y) } } + if(is_subview::value || is_subview::value) + { + arma_debug_print("op_dot::apply(): subview optimisation"); + + const sv_keep_unwrap& UA(X); + const sv_keep_unwrap& UB(Y); + + typedef typename sv_keep_unwrap::stored_type UA_M_type; + typedef typename sv_keep_unwrap::stored_type UB_M_type; + + const UA_M_type& A = UA.M; + const UB_M_type& B = UB.M; + + const uword A_n_rows = A.n_rows; + const uword A_n_cols = A.n_cols; + + if( (A_n_rows == B.n_rows) && (A_n_cols == B.n_cols) ) + { + eT acc = eT(0); + + for(uword c=0; c < A_n_cols; ++c) { acc += op_dot::direct_dot(A_n_rows, A.colptr(c), B.colptr(c)); } + + return acc; + } + else + { + const quasi_unwrap UUA(A); + const quasi_unwrap UUB(B); + + arma_conform_check( (UUA.M.n_elem != UUB.M.n_elem), "dot(): objects must have the same number of elements" ); + + return op_dot::direct_dot(UUA.M.n_elem, UUA.M.memptr(), UUB.M.memptr()); + } + } + // if possible, bypass transposes of non-complex vectors if( (is_cx::no) && (resolves_to_vector::value) && (resolves_to_vector::value) && (partial_unwrap::is_fast) && (partial_unwrap::is_fast) ) { + arma_debug_print("op_dot::apply(): vector optimisation"); + const partial_unwrap UA(X); const partial_unwrap UB(Y); @@ -250,6 +289,8 @@ op_dot::apply(const T1& X, const T2& Y) if(proxy_is_mat || use_at || have_direct_mem) { + arma_debug_print("op_dot::apply(): direct_mem optimisation"); + const quasi_unwrap A(X); const quasi_unwrap B(Y); @@ -263,7 +304,7 @@ op_dot::apply(const T1& X, const T2& Y) arma_conform_check( (PA.get_n_elem() != PB.get_n_elem()), "dot(): objects must have the same number of elements" ); - return op_dot::apply_proxy(PA,PB); + return op_dot::apply_proxy_linear(PA,PB); } @@ -271,7 +312,7 @@ op_dot::apply(const T1& X, const T2& Y) template inline typename arma_not_cx::result -op_dot::apply_proxy(const Proxy& PA, const Proxy& PB) +op_dot::apply_proxy_linear(const Proxy& PA, const Proxy& PB) { arma_debug_sigprint(); @@ -308,7 +349,7 @@ op_dot::apply_proxy(const Proxy& PA, const Proxy& PB) template inline typename arma_cx_only::result -op_dot::apply_proxy(const Proxy& PA, const Proxy& PB) +op_dot::apply_proxy_linear(const Proxy& PA, const Proxy& PB) { arma_debug_sigprint(); diff --git a/inst/include/armadillo_bits/unwrap.hpp b/inst/include/armadillo_bits/unwrap.hpp index 75afd3b6..5f2009b6 100644 --- a/inst/include/armadillo_bits/unwrap.hpp +++ b/inst/include/armadillo_bits/unwrap.hpp @@ -1361,7 +1361,7 @@ struct partial_unwrap< subview > static constexpr bool do_trans = false; static constexpr bool do_times = false; - static constexpr bool is_fast = false; // can't guarantee that memory is reused + static constexpr bool is_fast = false; // can't determine at compile time that memory is reused const subview& sv; const Mat M; @@ -1622,7 +1622,7 @@ struct partial_unwrap< Op< subview, op_htrans> > static constexpr bool do_trans = true; static constexpr bool do_times = false; - static constexpr bool is_fast = false; // can't guarantee that memory is reused + static constexpr bool is_fast = false; // can't determine at compile time that memory is reused const subview& sv; const Mat M; @@ -1894,7 +1894,7 @@ struct partial_unwrap< Op< subview, op_htrans2> > static constexpr bool do_trans = true; static constexpr bool do_times = true; - static constexpr bool is_fast = false; // can't guarantee that memory is reused + static constexpr bool is_fast = false; // can't determine at compile time that memory is reused const subview& sv; const eT val; @@ -3459,4 +3459,130 @@ struct partial_unwrap_check< eOp, eop_neg> > +// +// +// + + + +template +struct sv_keep_unwrap + { + typedef typename T1::elem_type eT; + typedef Mat stored_type; + + inline + sv_keep_unwrap(const T1& A) + : M(A) + { + arma_debug_sigprint(); + } + + const Mat M; + }; + + + +template +struct sv_keep_unwrap< subview > + { + typedef subview stored_type; + + inline + sv_keep_unwrap(const subview& A) + : M(A) + { + arma_debug_sigprint(); + } + + const subview& M; + }; + + + +template +struct sv_keep_unwrap< subview_row > + { + typedef subview_row stored_type; + + inline + sv_keep_unwrap(const subview_row& A) + : M(A) + { + arma_debug_sigprint(); + } + + const subview_row& M; + }; + + + +template +struct sv_keep_unwrap< subview_col > + { + typedef subview_col stored_type; + + inline + sv_keep_unwrap(const subview_col& A) + : M(A) + { + arma_debug_sigprint(); + } + + const subview_col& M; + }; + + + +template +struct sv_keep_unwrap< Mat > + { + typedef Mat stored_type; + + inline + sv_keep_unwrap(const Mat& A) + : M(A) + { + arma_debug_sigprint(); + } + + const Mat& M; + }; + + + +template +struct sv_keep_unwrap< Row > + { + typedef Row stored_type; + + inline + sv_keep_unwrap(const Row& A) + : M(A) + { + arma_debug_sigprint(); + } + + const Row& M; + }; + + + +template +struct sv_keep_unwrap< Col > + { + typedef Col stored_type; + + inline + sv_keep_unwrap(const Col& A) + : M(A) + { + arma_debug_sigprint(); + } + + const Col& M; + }; + + + //! @} From 0d4ec88d49f25b343dc17ec5a0abe12b34383001 Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Mon, 17 Jun 2024 06:27:48 -0500 Subject: [PATCH 4/7] Another update to 14.0.0 rc --- inst/include/armadillo | 24 ++- inst/include/armadillo_bits/Cube_meat.hpp | 2 +- inst/include/armadillo_bits/Mat_bones.hpp | 38 ++-- inst/include/armadillo_bits/Mat_meat.hpp | 18 +- inst/include/armadillo_bits/Proxy.hpp | 109 +++------- inst/include/armadillo_bits/SpBase_bones.hpp | 2 + inst/include/armadillo_bits/SpBase_meat.hpp | 10 + inst/include/armadillo_bits/SpCol_bones.hpp | 6 +- inst/include/armadillo_bits/SpCol_meat.hpp | 22 ++ inst/include/armadillo_bits/SpMat_bones.hpp | 27 +-- inst/include/armadillo_bits/SpMat_meat.hpp | 204 +++++++++++------- inst/include/armadillo_bits/SpProxy.hpp | 101 ++++++--- inst/include/armadillo_bits/SpRow_bones.hpp | 8 +- inst/include/armadillo_bits/SpRow_meat.hpp | 24 +++ .../armadillo_bits/SpSubview_bones.hpp | 4 + .../include/armadillo_bits/SpSubview_meat.hpp | 20 ++ inst/include/armadillo_bits/SpToDOp_bones.hpp | 1 + inst/include/armadillo_bits/arma_config.hpp | 4 +- inst/include/armadillo_bits/arma_forward.hpp | 4 +- inst/include/armadillo_bits/auxlib_meat.hpp | 4 +- .../include/armadillo_bits/compiler_setup.hpp | 6 +- inst/include/armadillo_bits/debug.hpp | 54 ++--- inst/include/armadillo_bits/fn_as_scalar.hpp | 99 +++++++-- inst/include/armadillo_bits/fn_chol.hpp | 2 +- inst/include/armadillo_bits/fn_conv_to.hpp | 8 +- inst/include/armadillo_bits/fn_diagvec.hpp | 4 +- inst/include/armadillo_bits/fn_eig_sym.hpp | 2 +- inst/include/armadillo_bits/fn_max.hpp | 8 +- inst/include/armadillo_bits/fn_mean.hpp | 8 +- inst/include/armadillo_bits/fn_min.hpp | 8 +- inst/include/armadillo_bits/fn_nonzeros.hpp | 4 +- inst/include/armadillo_bits/fn_stddev.hpp | 8 +- inst/include/armadillo_bits/fn_sum.hpp | 8 +- inst/include/armadillo_bits/fn_var.hpp | 8 +- inst/include/armadillo_bits/fn_vecnorm.hpp | 16 +- .../armadillo_bits/glue_mvnrnd_meat.hpp | 2 +- .../armadillo_bits/glue_times_meat.hpp | 8 +- .../armadillo_bits/mtSpReduceOp_bones.hpp | 62 ++++++ .../armadillo_bits/mtSpReduceOp_meat.hpp | 55 +++++ inst/include/armadillo_bits/op_chol_meat.hpp | 2 +- .../include/armadillo_bits/op_expmat_meat.hpp | 2 +- inst/include/armadillo_bits/op_find_meat.hpp | 4 +- .../armadillo_bits/op_inv_spd_meat.hpp | 4 +- .../armadillo_bits/op_log_det_meat.hpp | 4 +- .../include/armadillo_bits/op_logmat_meat.hpp | 2 +- .../armadillo_bits/op_nonzeros_bones.hpp | 11 - .../armadillo_bits/op_nonzeros_meat.hpp | 50 ----- .../armadillo_bits/op_sp_as_dense_bones.hpp | 33 +++ .../armadillo_bits/op_sp_as_dense_meat.hpp | 36 ++++ .../armadillo_bits/op_sp_diagvec_bones.hpp | 2 +- .../armadillo_bits/op_sp_diagvec_meat.hpp | 2 +- .../armadillo_bits/op_sp_max_bones.hpp | 2 +- .../include/armadillo_bits/op_sp_max_meat.hpp | 2 +- .../armadillo_bits/op_sp_mean_bones.hpp | 2 +- .../armadillo_bits/op_sp_mean_meat.hpp | 2 +- .../armadillo_bits/op_sp_min_bones.hpp | 2 +- .../include/armadillo_bits/op_sp_min_meat.hpp | 2 +- .../armadillo_bits/op_sp_minus_bones.hpp | 20 +- .../armadillo_bits/op_sp_minus_meat.hpp | 164 ++++---------- .../armadillo_bits/op_sp_nonzeros_bones.hpp | 36 ++++ .../armadillo_bits/op_sp_nonzeros_meat.hpp | 75 +++++++ .../armadillo_bits/op_sp_plus_bones.hpp | 8 +- .../armadillo_bits/op_sp_plus_meat.hpp | 83 ++----- .../armadillo_bits/op_sp_stddev_bones.hpp | 2 +- .../armadillo_bits/op_sp_stddev_meat.hpp | 2 +- .../armadillo_bits/op_sp_sum_bones.hpp | 2 +- .../include/armadillo_bits/op_sp_sum_meat.hpp | 2 +- .../armadillo_bits/op_sp_var_bones.hpp | 2 +- .../include/armadillo_bits/op_sp_var_meat.hpp | 2 +- .../armadillo_bits/op_sp_vecnorm_bones.hpp | 4 +- .../armadillo_bits/op_sp_vecnorm_meat.hpp | 4 +- .../armadillo_bits/op_sqrtmat_meat.hpp | 2 +- .../include/armadillo_bits/sp_auxlib_meat.hpp | 8 +- .../armadillo_bits/subview_cube_each_meat.hpp | 2 +- .../armadillo_bits/subview_cube_meat.hpp | 18 +- .../armadillo_bits/subview_each_meat.hpp | 2 +- inst/include/armadillo_bits/traits.hpp | 24 +-- inst/include/armadillo_bits/unwrap.hpp | 18 +- inst/include/armadillo_bits/unwrap_spmat.hpp | 20 ++ .../armadillo_bits/wall_clock_meat.hpp | 4 +- 80 files changed, 1008 insertions(+), 662 deletions(-) create mode 100644 inst/include/armadillo_bits/mtSpReduceOp_bones.hpp create mode 100644 inst/include/armadillo_bits/mtSpReduceOp_meat.hpp create mode 100644 inst/include/armadillo_bits/op_sp_as_dense_bones.hpp create mode 100644 inst/include/armadillo_bits/op_sp_as_dense_meat.hpp create mode 100644 inst/include/armadillo_bits/op_sp_nonzeros_bones.hpp create mode 100644 inst/include/armadillo_bits/op_sp_nonzeros_meat.hpp diff --git a/inst/include/armadillo b/inst/include/armadillo index c94313f7..f64d93d9 100644 --- a/inst/include/armadillo +++ b/inst/include/armadillo @@ -221,7 +221,7 @@ namespace arma #include "armadillo_bits/OpCube_bones.hpp" #include "armadillo_bits/SpOp_bones.hpp" #include "armadillo_bits/SpToDOp_bones.hpp" - #include "armadillo_bits/mtSpToDOp_bones.hpp" + #include "armadillo_bits/mtSpReduceOp_bones.hpp" #include "armadillo_bits/eOp_bones.hpp" #include "armadillo_bits/eOpCube_bones.hpp" @@ -315,6 +315,10 @@ namespace arma #include "armadillo_bits/op_roots_bones.hpp" #include "armadillo_bits/op_cond_bones.hpp" #include "armadillo_bits/op_rcond_bones.hpp" + #include "armadillo_bits/op_powmat_bones.hpp" + #include "armadillo_bits/op_rank_bones.hpp" + #include "armadillo_bits/op_row_as_mat_bones.hpp" + #include "armadillo_bits/op_col_as_mat_bones.hpp" #include "armadillo_bits/op_sp_plus_bones.hpp" #include "armadillo_bits/op_sp_minus_bones.hpp" #include "armadillo_bits/op_sp_sum_bones.hpp" @@ -325,10 +329,8 @@ namespace arma #include "armadillo_bits/op_sp_stddev_bones.hpp" #include "armadillo_bits/op_sp_vecnorm_bones.hpp" #include "armadillo_bits/op_sp_diagvec_bones.hpp" - #include "armadillo_bits/op_powmat_bones.hpp" - #include "armadillo_bits/op_rank_bones.hpp" - #include "armadillo_bits/op_row_as_mat_bones.hpp" - #include "armadillo_bits/op_col_as_mat_bones.hpp" + #include "armadillo_bits/op_sp_nonzeros_bones.hpp" + #include "armadillo_bits/op_sp_as_dense_bones.hpp" #include "armadillo_bits/glue_times_bones.hpp" #include "armadillo_bits/glue_times_misc_bones.hpp" @@ -623,11 +625,11 @@ namespace arma #include "armadillo_bits/OpCube_meat.hpp" #include "armadillo_bits/SpOp_meat.hpp" #include "armadillo_bits/SpToDOp_meat.hpp" - #include "armadillo_bits/mtSpToDOp_meat.hpp" #include "armadillo_bits/mtOp_meat.hpp" #include "armadillo_bits/mtOpCube_meat.hpp" #include "armadillo_bits/mtSpOp_meat.hpp" + #include "armadillo_bits/mtSpReduceOp_meat.hpp" #include "armadillo_bits/Glue_meat.hpp" #include "armadillo_bits/GlueCube_meat.hpp" @@ -766,6 +768,10 @@ namespace arma #include "armadillo_bits/op_roots_meat.hpp" #include "armadillo_bits/op_cond_meat.hpp" #include "armadillo_bits/op_rcond_meat.hpp" + #include "armadillo_bits/op_powmat_meat.hpp" + #include "armadillo_bits/op_rank_meat.hpp" + #include "armadillo_bits/op_row_as_mat_meat.hpp" + #include "armadillo_bits/op_col_as_mat_meat.hpp" #include "armadillo_bits/op_sp_plus_meat.hpp" #include "armadillo_bits/op_sp_minus_meat.hpp" #include "armadillo_bits/op_sp_sum_meat.hpp" @@ -776,10 +782,8 @@ namespace arma #include "armadillo_bits/op_sp_stddev_meat.hpp" #include "armadillo_bits/op_sp_vecnorm_meat.hpp" #include "armadillo_bits/op_sp_diagvec_meat.hpp" - #include "armadillo_bits/op_powmat_meat.hpp" - #include "armadillo_bits/op_rank_meat.hpp" - #include "armadillo_bits/op_row_as_mat_meat.hpp" - #include "armadillo_bits/op_col_as_mat_meat.hpp" + #include "armadillo_bits/op_sp_nonzeros_meat.hpp" + #include "armadillo_bits/op_sp_as_dense_meat.hpp" #include "armadillo_bits/glue_times_meat.hpp" #include "armadillo_bits/glue_times_misc_meat.hpp" diff --git a/inst/include/armadillo_bits/Cube_meat.hpp b/inst/include/armadillo_bits/Cube_meat.hpp index a136306f..9256a453 100644 --- a/inst/include/armadillo_bits/Cube_meat.hpp +++ b/inst/include/armadillo_bits/Cube_meat.hpp @@ -2264,7 +2264,7 @@ Cube::shed_slices(const Base& indices) const uword* slices_to_shed_mem = slices_to_shed.memptr(); const uword N = slices_to_shed.n_elem; - if(arma_config::check_conformance) + if(arma_config::check_conform) { for(uword i=0; i > inline Mat& operator+=(const SpSubview& X); inline Mat& operator-=(const SpSubview& X); - inline Mat(const spdiagview& X); + inline explicit Mat(const spdiagview& X); inline Mat& operator= (const spdiagview& X); inline Mat& operator+=(const spdiagview& X); inline Mat& operator-=(const spdiagview& X); @@ -310,8 +310,8 @@ class Mat : public Base< eT, Mat > template inline void shed_rows(const Base& indices); template inline void shed_cols(const Base& indices); - arma_deprecated inline void insert_rows(const uword row_num, const uword N, const bool set_to_zero); - arma_deprecated inline void insert_cols(const uword col_num, const uword N, const bool set_to_zero); + arma_frown("use insert_rows(row_num, N) instead") inline void insert_rows(const uword row_num, const uword N, const bool set_to_zero); + arma_frown("use insert_cols(col_num, N) instead") inline void insert_cols(const uword col_num, const uword N, const bool set_to_zero); inline void insert_rows(const uword row_num, const uword N); inline void insert_cols(const uword col_num, const uword N); @@ -368,13 +368,13 @@ class Mat : public Base< eT, Mat > template inline Mat& operator%=(const SpToDOp& X); template inline Mat& operator/=(const SpToDOp& X); - template inline Mat(const mtSpToDOp& X); - template inline Mat& operator= (const mtSpToDOp& X); - template inline Mat& operator+=(const mtSpToDOp& X); - template inline Mat& operator-=(const mtSpToDOp& X); - template inline Mat& operator*=(const mtSpToDOp& X); - template inline Mat& operator%=(const mtSpToDOp& X); - template inline Mat& operator/=(const mtSpToDOp& X); + template inline explicit Mat(const mtSpReduceOp& X); + template inline Mat& operator= (const mtSpReduceOp& X); + template inline Mat& operator+=(const mtSpReduceOp& X); + template inline Mat& operator-=(const mtSpReduceOp& X); + template inline Mat& operator*=(const mtSpReduceOp& X); + template inline Mat& operator%=(const mtSpReduceOp& X); + template inline Mat& operator/=(const mtSpReduceOp& X); template inline Mat(const Glue& X); template inline Mat& operator= (const Glue& X); @@ -485,7 +485,7 @@ class Mat : public Base< eT, Mat > inline Mat& reshape(const uword new_n_rows, const uword new_n_cols); inline Mat& reshape(const SizeMat& s); - arma_deprecated inline void reshape(const uword new_n_rows, const uword new_n_cols, const uword dim); //!< NOTE: don't use this form: it will be removed + arma_frown("use reshape(n_rows, n_cols) instead") inline void reshape(const uword new_n_rows, const uword new_n_cols, const uword dim); //!< NOTE: don't use this form: it will be removed template inline Mat& for_each(functor F); @@ -558,15 +558,15 @@ class Mat : public Base< eT, Mat > arma_cold inline bool load(const csv_name& spec, const file_type type = csv_ascii); arma_cold inline bool load( std::istream& is, const file_type type = auto_detect); - arma_deprecated inline bool quiet_save(const std::string name, const file_type type = arma_binary) const; - arma_deprecated inline bool quiet_save(const hdf5_name& spec, const file_type type = hdf5_binary) const; - arma_deprecated inline bool quiet_save(const csv_name& spec, const file_type type = csv_ascii) const; - arma_deprecated inline bool quiet_save( std::ostream& os, const file_type type = arma_binary) const; + arma_frown("use save() instead") inline bool quiet_save(const std::string name, const file_type type = arma_binary) const; + arma_frown("use save() instead") inline bool quiet_save(const hdf5_name& spec, const file_type type = hdf5_binary) const; + arma_frown("use save() instead") inline bool quiet_save(const csv_name& spec, const file_type type = csv_ascii) const; + arma_frown("use save() instead") inline bool quiet_save( std::ostream& os, const file_type type = arma_binary) const; - arma_deprecated inline bool quiet_load(const std::string name, const file_type type = auto_detect); - arma_deprecated inline bool quiet_load(const hdf5_name& spec, const file_type type = hdf5_binary); - arma_deprecated inline bool quiet_load(const csv_name& spec, const file_type type = csv_ascii); - arma_deprecated inline bool quiet_load( std::istream& is, const file_type type = auto_detect); + arma_frown("use load() instead") inline bool quiet_load(const std::string name, const file_type type = auto_detect); + arma_frown("use load() instead") inline bool quiet_load(const hdf5_name& spec, const file_type type = hdf5_binary); + arma_frown("use load() instead") inline bool quiet_load(const csv_name& spec, const file_type type = csv_ascii); + arma_frown("use load() instead") inline bool quiet_load( std::istream& is, const file_type type = auto_detect); // for container-like functionality diff --git a/inst/include/armadillo_bits/Mat_meat.hpp b/inst/include/armadillo_bits/Mat_meat.hpp index 3db9bcd8..54ed5094 100644 --- a/inst/include/armadillo_bits/Mat_meat.hpp +++ b/inst/include/armadillo_bits/Mat_meat.hpp @@ -4519,7 +4519,7 @@ Mat::shed_rows(const Base& indices) const uword* rows_to_shed_mem = rows_to_shed.memptr(); const uword N = rows_to_shed.n_elem; - if(arma_config::check_conformance) + if(arma_config::check_conform) { for(uword i=0; i::shed_cols(const Base& indices) const uword* cols_to_shed_mem = cols_to_shed.memptr(); const uword N = cols_to_shed.n_elem; - if(arma_config::check_conformance) + if(arma_config::check_conform) { for(uword i=0; i::operator/=(const SpToDOp& X) template template inline -Mat::Mat(const mtSpToDOp& X) +Mat::Mat(const mtSpReduceOp& X) : n_rows(0) , n_cols(0) , n_elem(0) @@ -5678,7 +5678,7 @@ template template inline Mat& -Mat::operator=(const mtSpToDOp& X) +Mat::operator=(const mtSpReduceOp& X) { arma_debug_sigprint(); @@ -5693,7 +5693,7 @@ template template inline Mat& -Mat::operator+=(const mtSpToDOp& X) +Mat::operator+=(const mtSpReduceOp& X) { arma_debug_sigprint(); @@ -5708,7 +5708,7 @@ template template inline Mat& -Mat::operator-=(const mtSpToDOp& X) +Mat::operator-=(const mtSpReduceOp& X) { arma_debug_sigprint(); @@ -5723,7 +5723,7 @@ template template inline Mat& -Mat::operator*=(const mtSpToDOp& X) +Mat::operator*=(const mtSpReduceOp& X) { arma_debug_sigprint(); @@ -5738,7 +5738,7 @@ template template inline Mat& -Mat::operator%=(const mtSpToDOp& X) +Mat::operator%=(const mtSpReduceOp& X) { arma_debug_sigprint(); @@ -5753,7 +5753,7 @@ template template inline Mat& -Mat::operator/=(const mtSpToDOp& X) +Mat::operator/=(const mtSpReduceOp& X) { arma_debug_sigprint(); diff --git a/inst/include/armadillo_bits/Proxy.hpp b/inst/include/armadillo_bits/Proxy.hpp index 023b703f..4fe0a02a 100644 --- a/inst/include/armadillo_bits/Proxy.hpp +++ b/inst/include/armadillo_bits/Proxy.hpp @@ -22,36 +22,36 @@ // within each specialisation of the Proxy class: // -// elem_type = the type of the elements obtained from object Q -// pod_type = the underlying type of elements if elem_type is std::complex -// stored_type = the type of the Q object -// ea_type = the type of the object that provides access to elements via operator[i] -// aligned_ea_type = the type of the object that provides access to elements via at_alt(i) +// elem_type = type of the elements obtained from object Q +// pod_type = underlying type of elements if elem_type is std::complex +// stored_type = type of Q object +// ea_type = type of object that provides access to elements via operator[i] +// aligned_ea_type = type of object that provides access to elements via at_alt(i) // -// use_at = boolean indicating whether at(row,col) must be used to get elements -// use_mp = boolean indicating whether OpenMP can be used while processing elements -// has_subview = boolean indicating whether the Q object has a subview +// use_at = boolean to indicate at(row,col) must be used to get elements +// use_mp = boolean to indicate OpenMP can be used while processing elements +// has_subview = boolean to indicate Q object has a subview // -// is_row = boolean indicating whether the Q object can be treated a row vector -// is_col = boolean indicating whether the Q object can be treated a column vector -// is_xvec = boolean indicating whether the Q object is a vector with unknown orientation +// is_row = boolean to indicate Q object can be treated a row vector +// is_col = boolean to indicate Q object can be treated a column vector +// is_xvec = boolean to indicate Q object is a vector with unknown orientation // -// Q = object that can be unwrapped via the unwrap family of classes (ie. Q must be convertible to Mat) +// Q = object that can be unwrapped via unwrap family of classes (ie. Q must be convertible to Mat) // -// get_n_rows() = return the number of rows in Q -// get_n_cols() = return the number of columns in Q -// get_n_elem() = return the number of elements in Q +// get_n_rows() = return number of rows in Q +// get_n_cols() = return number of columns in Q +// get_n_elem() = return number of elements in Q // -// operator[i] = linear element accessor; valid only if the 'use_at' boolean is false -// at(row,col) = access elements via (row,col); valid only if the 'use_at' boolean is true -// at_alt(i) = aligned linear element accessor; valid only if the 'use_at' boolean is false and is_aligned() returns true +// operator[i] = linear element accessor; valid only if 'use_at' boolean is false +// at(row,col) = access elements via (row,col); valid only if 'use_at' boolean is true +// at_alt(i) = aligned linear element accessor; valid only if 'use_at' boolean is false and is_aligned() returns true // -// get_ea() = return the object that provides linear access to elements via operator[i] -// get_aligned_ea() = return the object that provides linear access to elements via at_alt(i); valid only if is_aligned() returns true +// get_ea() = return object that provides linear access to elements via operator[i] +// get_aligned_ea() = return object that provides linear access to elements via at_alt(i); valid only if is_aligned() returns true // -// is_alias(X) = return true/false indicating whether the Q object aliases matrix X -// has_overlap(X) = return true/false indicating whether the Q object has overlap with subview X -// is_aligned() = return true/false indicating whether the Q object has aligned memory +// is_alias(X) = return true/false to indicate Q object aliases matrix X +// has_overlap(X) = return true/false to indicate Q object has overlap with subview X +// is_aligned() = return true/false to indicate Q object has aligned memory @@ -880,10 +880,10 @@ struct Proxy< SpToDOp > -template -struct Proxy< SpToDOp > +template +struct Proxy< SpToDOp, op_sp_nonzeros> > { - typedef typename T1::elem_type elem_type; + typedef eT elem_type; typedef typename get_pod_type::result pod_type; typedef Mat stored_type; typedef const elem_type* ea_type; @@ -897,12 +897,12 @@ struct Proxy< SpToDOp > static constexpr bool is_col = true; static constexpr bool is_xvec = false; - arma_aligned const unwrap_spmat U; - arma_aligned const Mat Q; + arma_aligned const SpMat& R; + arma_aligned const Mat Q; - inline explicit Proxy(const SpToDOp& A) - : U(A.m) - , Q(const_cast(U.M.values), U.M.n_nonzero, 1, false, true) + inline explicit Proxy(const SpToDOp, op_sp_nonzeros>& A) + : R(A.m) + , Q(const_cast(R.values), R.n_nonzero, 1, false, true) { arma_debug_sigprint(); } @@ -929,53 +929,6 @@ struct Proxy< SpToDOp > -template -struct Proxy< mtSpToDOp > - { - typedef out_eT elem_type; - typedef typename get_pod_type::result pod_type; - typedef Mat stored_type; - typedef const elem_type* ea_type; - typedef const Mat& aligned_ea_type; - - static constexpr bool use_at = false; - static constexpr bool use_mp = false; - static constexpr bool has_subview = false; - - static constexpr bool is_row = mtSpToDOp::is_row; - static constexpr bool is_col = mtSpToDOp::is_col; - static constexpr bool is_xvec = mtSpToDOp::is_xvec; - - arma_aligned const Mat Q; - - inline explicit Proxy(const mtSpToDOp& A) - : Q(A) - { - arma_debug_sigprint(); - } - - arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; } - arma_inline uword get_n_cols() const { return is_col ? 1 : Q.n_cols; } - arma_inline uword get_n_elem() const { return Q.n_elem; } - - arma_inline elem_type operator[] (const uword i) const { return Q[i]; } - arma_inline elem_type at (const uword r, const uword c) const { return Q.at(r, c); } - arma_inline elem_type at_alt (const uword i) const { return Q.at_alt(i); } - - arma_inline ea_type get_ea() const { return Q.memptr(); } - arma_inline aligned_ea_type get_aligned_ea() const { return Q; } - - template - constexpr bool is_alias(const Mat&) const { return false; } - - template - constexpr bool has_overlap(const subview&) const { return false; } - - arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr()); } - }; - - - template struct Proxy< SpToDGlue > { diff --git a/inst/include/armadillo_bits/SpBase_bones.hpp b/inst/include/armadillo_bits/SpBase_bones.hpp index d16bf476..cc53e93b 100644 --- a/inst/include/armadillo_bits/SpBase_bones.hpp +++ b/inst/include/armadillo_bits/SpBase_bones.hpp @@ -109,6 +109,8 @@ struct SpBase arma_warn_unused inline const SpOp as_col() const; arma_warn_unused inline const SpOp as_row() const; + + arma_warn_unused inline const SpToDOp as_dense() const; }; diff --git a/inst/include/armadillo_bits/SpBase_meat.hpp b/inst/include/armadillo_bits/SpBase_meat.hpp index b8ba23e5..01cfb692 100644 --- a/inst/include/armadillo_bits/SpBase_meat.hpp +++ b/inst/include/armadillo_bits/SpBase_meat.hpp @@ -880,4 +880,14 @@ SpBase::as_row() const +template +inline +const SpToDOp +SpBase::as_dense() const + { + return SpToDOp( (*this).get_ref() ); + } + + + //! @} diff --git a/inst/include/armadillo_bits/SpCol_bones.hpp b/inst/include/armadillo_bits/SpCol_bones.hpp index b49f1a58..03b4b5fa 100644 --- a/inst/include/armadillo_bits/SpCol_bones.hpp +++ b/inst/include/armadillo_bits/SpCol_bones.hpp @@ -47,7 +47,9 @@ class SpCol : public SpMat inline SpCol& operator=(const eT val); - template inline SpCol(const Base& X); + inline SpCol(const Col& X); // for backwards compatibility + + template inline explicit SpCol(const Base& X); template inline SpCol& operator=(const Base& X); template inline SpCol(const SpBase& X); @@ -60,6 +62,8 @@ class SpCol : public SpMat arma_warn_unused inline const SpOp,spop_htrans> ht() const; arma_warn_unused inline const SpOp,spop_strans> st() const; + arma_warn_unused inline const SpToDOp,op_sp_as_dense> as_dense() const; + inline void shed_row (const uword row_num); inline void shed_rows(const uword in_row1, const uword in_row2); diff --git a/inst/include/armadillo_bits/SpCol_meat.hpp b/inst/include/armadillo_bits/SpCol_meat.hpp index 58806d94..9ff3bf23 100644 --- a/inst/include/armadillo_bits/SpCol_meat.hpp +++ b/inst/include/armadillo_bits/SpCol_meat.hpp @@ -142,6 +142,18 @@ SpCol::SpCol(const Base& X) +template +inline +SpCol::SpCol(const Col& X) + : SpMat(arma_vec_indicator(), 1) + { + arma_debug_sigprint(); + + SpMat::operator=(X); + } + + + template template inline @@ -232,6 +244,16 @@ SpCol::st() const +template +inline +const SpToDOp,op_sp_as_dense> +SpCol::as_dense() const + { + return SpToDOp,op_sp_as_dense>(*this); + } + + + //! remove specified row template inline diff --git a/inst/include/armadillo_bits/SpMat_bones.hpp b/inst/include/armadillo_bits/SpMat_bones.hpp index 73f00d2e..34b7d81b 100644 --- a/inst/include/armadillo_bits/SpMat_bones.hpp +++ b/inst/include/armadillo_bits/SpMat_bones.hpp @@ -124,7 +124,7 @@ class SpMat : public SpBase< eT, SpMat > inline SpMat& operator%=(const SpMat& m); inline SpMat& operator/=(const SpMat& m); - template inline SpMat(const Base& m); + template inline explicit SpMat(const Base& m); template inline SpMat& operator= (const Base& m); template inline SpMat& operator+=(const Base& m); template inline SpMat& operator-=(const Base& m); @@ -132,7 +132,7 @@ class SpMat : public SpBase< eT, SpMat > template inline SpMat& operator/=(const Base& m); template inline SpMat& operator%=(const Base& m); - template inline SpMat(const Op& expr); + template inline explicit SpMat(const Op& expr); template inline SpMat& operator= (const Op& expr); template inline SpMat& operator+=(const Op& expr); template inline SpMat& operator-=(const Op& expr); @@ -140,9 +140,6 @@ class SpMat : public SpBase< eT, SpMat > template inline SpMat& operator/=(const Op& expr); template inline SpMat& operator%=(const Op& expr); - // template inline SpMat(const SpToDOp< T1, op_type>& expr); - // template inline SpMat(const mtSpToDOp& expr); - //! construction of complex matrix out of two non-complex matrices template inline explicit SpMat(const SpBase& A, const SpBase& B); @@ -171,7 +168,6 @@ class SpMat : public SpBase< eT, SpMat > inline SpMat& operator%=(const spdiagview& X); inline SpMat& operator/=(const spdiagview& X); - // delayed unary ops template inline SpMat(const SpOp& X); template inline SpMat& operator= (const SpOp& X); template inline SpMat& operator+=(const SpOp& X); @@ -180,7 +176,6 @@ class SpMat : public SpBase< eT, SpMat > template inline SpMat& operator%=(const SpOp& X); template inline SpMat& operator/=(const SpOp& X); - // delayed binary ops template inline SpMat(const SpGlue& X); template inline SpMat& operator= (const SpGlue& X); template inline SpMat& operator+=(const SpGlue& X); @@ -189,7 +184,6 @@ class SpMat : public SpBase< eT, SpMat > template inline SpMat& operator%=(const SpGlue& X); template inline SpMat& operator/=(const SpGlue& X); - // delayed mixed-type unary ops template inline SpMat(const mtSpOp& X); template inline SpMat& operator= (const mtSpOp& X); template inline SpMat& operator+=(const mtSpOp& X); @@ -198,7 +192,6 @@ class SpMat : public SpBase< eT, SpMat > template inline SpMat& operator%=(const mtSpOp& X); template inline SpMat& operator/=(const mtSpOp& X); - // delayed mixed-type binary ops template inline SpMat(const mtSpGlue& X); template inline SpMat& operator= (const mtSpGlue& X); template inline SpMat& operator+=(const mtSpGlue& X); @@ -207,6 +200,14 @@ class SpMat : public SpBase< eT, SpMat > template inline SpMat& operator%=(const mtSpGlue& X); template inline SpMat& operator/=(const mtSpGlue& X); + template inline SpMat(const mtSpReduceOp& X); + template inline SpMat& operator= (const mtSpReduceOp& X); + template inline SpMat& operator+=(const mtSpReduceOp& X); + template inline SpMat& operator-=(const mtSpReduceOp& X); + template inline SpMat& operator*=(const mtSpReduceOp& X); + template inline SpMat& operator%=(const mtSpReduceOp& X); + template inline SpMat& operator/=(const mtSpReduceOp& X); + arma_inline SpSubview_row row(const uword row_num); arma_inline const SpSubview_row row(const uword row_num) const; @@ -398,11 +399,11 @@ class SpMat : public SpBase< eT, SpMat > arma_cold inline bool load(const csv_name& spec, const file_type type = csv_ascii); arma_cold inline bool load( std::istream& is, const file_type type = arma_binary); - arma_deprecated inline bool quiet_save(const std::string name, const file_type type = arma_binary) const; - arma_deprecated inline bool quiet_save( std::ostream& os, const file_type type = arma_binary) const; + arma_frown("use save() instead") inline bool quiet_save(const std::string name, const file_type type = arma_binary) const; + arma_frown("use save() instead") inline bool quiet_save( std::ostream& os, const file_type type = arma_binary) const; - arma_deprecated inline bool quiet_load(const std::string name, const file_type type = arma_binary); - arma_deprecated inline bool quiet_load( std::istream& is, const file_type type = arma_binary); + arma_frown("use load() instead") inline bool quiet_load(const std::string name, const file_type type = arma_binary); + arma_frown("use load() instead") inline bool quiet_load( std::istream& is, const file_type type = arma_binary); diff --git a/inst/include/armadillo_bits/SpMat_meat.hpp b/inst/include/armadillo_bits/SpMat_meat.hpp index 6ef8088a..14e9b3e5 100644 --- a/inst/include/armadillo_bits/SpMat_meat.hpp +++ b/inst/include/armadillo_bits/SpMat_meat.hpp @@ -787,48 +787,6 @@ SpMat::operator/=(const SpMat& x) -// template -// template -// inline -// SpMat::SpMat(const SpToDOp& expr) -// : n_rows(0) -// , n_cols(0) -// , n_elem(0) -// , n_nonzero(0) -// , vec_state(0) -// , values(nullptr) -// , row_indices(nullptr) -// , col_ptrs(nullptr) -// { -// arma_debug_sigprint_this(this); -// -// arma_type_check(( is_same_type< eT, typename T1::elem_type >::no )); -// -// (*this) = Mat(expr); -// } - - - -// template -// template -// inline -// SpMat::SpMat(const mtSpToDOp& expr) -// : n_rows(0) -// , n_cols(0) -// , n_elem(0) -// , n_nonzero(0) -// , vec_state(0) -// , values(nullptr) -// , row_indices(nullptr) -// , col_ptrs(nullptr) -// { -// arma_debug_sigprint_this(this); -// -// (*this) = Mat(expr); -// } - - - // Construct a complex matrix out of two non-complex matrices template template @@ -2230,6 +2188,118 @@ SpMat::operator/=(const mtSpGlue& X) +template +template +inline +SpMat::SpMat(const mtSpReduceOp& X) + : n_rows(0) + , n_cols(0) + , n_elem(0) + , n_nonzero(0) + , vec_state(0) + , values(nullptr) + , row_indices(nullptr) + , col_ptrs(nullptr) + { + arma_debug_sigprint_this(this); + + const Mat tmp(X); + + (*this).operator=(tmp); + } + + + +template +template +inline +SpMat& +SpMat::operator=(const mtSpReduceOp& X) + { + arma_debug_sigprint(); + + const Mat tmp(X); + + return (*this).operator=(tmp); + } + + + +template +template +inline +SpMat& +SpMat::operator+=(const mtSpReduceOp& X) + { + arma_debug_sigprint(); + + const Mat tmp(X); + + return (*this).operator+=(tmp); + } + + + +template +template +inline +SpMat& +SpMat::operator-=(const mtSpReduceOp& X) + { + arma_debug_sigprint(); + + const Mat tmp(X); + + return (*this).operator-=(tmp); + } + + + +template +template +inline +SpMat& +SpMat::operator*=(const mtSpReduceOp& X) + { + arma_debug_sigprint(); + + const Mat tmp(X); + + return (*this).operator*=(tmp); + } + + + +template +template +inline +SpMat& +SpMat::operator%=(const mtSpReduceOp& X) + { + arma_debug_sigprint(); + + const Mat tmp(X); + + return (*this).operator%=(tmp); + } + + + +template +template +inline +SpMat& +SpMat::operator/=(const mtSpReduceOp& X) + { + arma_debug_sigprint(); + + const Mat tmp(X); + + return (*this).operator/=(tmp); + } + + + template arma_inline SpSubview_row @@ -4312,26 +4382,15 @@ SpMat::sprandu(const uword in_rows, const uword in_cols, const double densit } } - uword cur_index = 0; - uword count = 0; - - for(uword lcol = 0; lcol < in_cols; ++lcol) - for(uword lrow = 0; lrow < in_rows; ++lrow) + for(uword i=0; i::sprandn(const uword in_rows, const uword in_cols, const double densit } } - uword cur_index = 0; - uword count = 0; - - for(uword lcol = 0; lcol < in_cols; ++lcol) - for(uword lrow = 0; lrow < in_rows; ++lrow) + for(uword i=0; i > +template +struct SpProxy< mtSpReduceOp > + { + typedef out_eT elem_type; + typedef typename get_pod_type::result pod_type; + typedef SpMat stored_type; + + typedef typename SpMat::const_iterator const_iterator_type; + typedef typename SpMat::const_row_iterator const_row_iterator_type; + + static constexpr bool use_iterator = false; + static constexpr bool Q_is_generated = true; + + static constexpr bool is_row = mtSpReduceOp::is_row; + static constexpr bool is_col = mtSpReduceOp::is_col; + static constexpr bool is_xvec = mtSpReduceOp::is_xvec; + + arma_aligned const SpMat Q; + + inline explicit SpProxy(const mtSpReduceOp& A) + : Q(A) + { + arma_debug_sigprint(); + } + + arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; } + arma_inline uword get_n_cols() const { return is_col ? 1 : Q.n_cols; } + arma_inline uword get_n_elem() const { return Q.n_elem; } + arma_inline uword get_n_nonzero() const { return Q.n_nonzero; } + + arma_inline elem_type operator[](const uword i) const { return Q[i]; } + arma_inline elem_type at (const uword row, const uword col) const { return Q.at(row, col); } + + arma_inline const out_eT* get_values() const { return Q.values; } + arma_inline const uword* get_row_indices() const { return Q.row_indices; } + arma_inline const uword* get_col_ptrs() const { return Q.col_ptrs; } + + arma_inline const_iterator_type begin() const { return Q.begin(); } + arma_inline const_iterator_type begin_col(const uword col_num) const { return Q.begin_col(col_num); } + arma_inline const_row_iterator_type begin_row(const uword row_num = 0) const { return Q.begin_row(row_num); } + + arma_inline const_iterator_type end() const { return Q.end(); } + arma_inline const_row_iterator_type end_row() const { return Q.end_row(); } + arma_inline const_row_iterator_type end_row(const uword row_num) const { return Q.end_row(row_num); } + + template + constexpr bool is_alias(const SpMat&) const { return false; } + }; + + + //! @} diff --git a/inst/include/armadillo_bits/SpRow_bones.hpp b/inst/include/armadillo_bits/SpRow_bones.hpp index c13de1b4..c5fed2fa 100644 --- a/inst/include/armadillo_bits/SpRow_bones.hpp +++ b/inst/include/armadillo_bits/SpRow_bones.hpp @@ -25,7 +25,7 @@ template class SpRow : public SpMat { public: - + typedef eT elem_type; typedef typename get_pod_type::result pod_type; @@ -47,7 +47,9 @@ class SpRow : public SpMat inline SpRow& operator=(const eT val); - template inline SpRow(const Base& X); + inline SpRow(const Row& X); // for backwards compatibility + + template inline explicit SpRow(const Base& X); template inline SpRow& operator=(const Base& X); template inline SpRow(const SpBase& X); @@ -60,6 +62,8 @@ class SpRow : public SpMat arma_warn_unused inline const SpOp,spop_htrans> ht() const; arma_warn_unused inline const SpOp,spop_strans> st() const; + arma_warn_unused inline const SpToDOp,op_sp_as_dense> as_dense() const; + inline void shed_col (const uword col_num); inline void shed_cols(const uword in_col1, const uword in_col2); diff --git a/inst/include/armadillo_bits/SpRow_meat.hpp b/inst/include/armadillo_bits/SpRow_meat.hpp index a3de8e07..3d063bfb 100644 --- a/inst/include/armadillo_bits/SpRow_meat.hpp +++ b/inst/include/armadillo_bits/SpRow_meat.hpp @@ -142,6 +142,20 @@ SpRow::SpRow(const Base& X) + +template +inline +SpRow::SpRow(const Row& X) + : SpMat(arma_vec_indicator(), 2) + { + arma_debug_sigprint(); + + SpMat::operator=(X); + } + + + + template template inline @@ -232,6 +246,16 @@ SpRow::st() const +template +inline +const SpToDOp,op_sp_as_dense> +SpRow::as_dense() const + { + return SpToDOp,op_sp_as_dense>(*this); + } + + + //! remove specified columns template inline diff --git a/inst/include/armadillo_bits/SpSubview_bones.hpp b/inst/include/armadillo_bits/SpSubview_bones.hpp index 6be50b3a..fe32216e 100644 --- a/inst/include/armadillo_bits/SpSubview_bones.hpp +++ b/inst/include/armadillo_bits/SpSubview_bones.hpp @@ -361,6 +361,8 @@ class SpSubview_col : public SpSubview arma_warn_unused inline const SpOp,spop_htrans> ht() const; arma_warn_unused inline const SpOp,spop_strans> st() const; + arma_warn_unused inline const SpToDOp,op_sp_as_dense> as_dense() const; + protected: @@ -399,6 +401,8 @@ class SpSubview_row : public SpSubview arma_warn_unused inline const SpOp,spop_htrans> ht() const; arma_warn_unused inline const SpOp,spop_strans> st() const; + arma_warn_unused inline const SpToDOp,op_sp_as_dense> as_dense() const; + protected: diff --git a/inst/include/armadillo_bits/SpSubview_meat.hpp b/inst/include/armadillo_bits/SpSubview_meat.hpp index 8b2e704a..757be653 100644 --- a/inst/include/armadillo_bits/SpSubview_meat.hpp +++ b/inst/include/armadillo_bits/SpSubview_meat.hpp @@ -1907,6 +1907,16 @@ SpSubview_col::st() const +template +inline +const SpToDOp,op_sp_as_dense> +SpSubview_col::as_dense() const + { + return SpToDOp,op_sp_as_dense>(*this); + } + + + // // // @@ -2013,4 +2023,14 @@ SpSubview_row::st() const +template +inline +const SpToDOp,op_sp_as_dense> +SpSubview_row::as_dense() const + { + return SpToDOp,op_sp_as_dense>(*this); + } + + + //! @} diff --git a/inst/include/armadillo_bits/SpToDOp_bones.hpp b/inst/include/armadillo_bits/SpToDOp_bones.hpp index 4a49028b..44fa7895 100644 --- a/inst/include/armadillo_bits/SpToDOp_bones.hpp +++ b/inst/include/armadillo_bits/SpToDOp_bones.hpp @@ -20,6 +20,7 @@ //! @{ +// NOTE: SpToDOp is dedicated for unary operations on sparse matrices that result in dense matrices. template class SpToDOp : public Base< typename T1::elem_type, SpToDOp > diff --git a/inst/include/armadillo_bits/arma_config.hpp b/inst/include/armadillo_bits/arma_config.hpp index e7d45314..892b21ff 100644 --- a/inst/include/armadillo_bits/arma_config.hpp +++ b/inst/include/armadillo_bits/arma_config.hpp @@ -66,9 +66,9 @@ struct arma_config #if defined(ARMA_CHECK_CONFORMANCE) - static constexpr bool check_conformance = true; + static constexpr bool check_conform = true; #else - static constexpr bool check_conformance = false; + static constexpr bool check_conform = false; #endif diff --git a/inst/include/armadillo_bits/arma_forward.hpp b/inst/include/armadillo_bits/arma_forward.hpp index f1249df1..1bad37f4 100644 --- a/inst/include/armadillo_bits/arma_forward.hpp +++ b/inst/include/armadillo_bits/arma_forward.hpp @@ -138,7 +138,7 @@ class spglue_min; class spglue_rel_lt; class spglue_rel_gt; - +class op_sp_as_dense; class op_internal_equ; class op_internal_plus; @@ -244,7 +244,6 @@ template< typename T1, typename eop_type> class eOp; template< typename T1, typename op_type> class SpToDOp; template< typename T1, typename op_type> class CubeToMatOp; template class mtOp; -template class mtSpToDOp; template< typename T1, typename T2, typename glue_type> class Glue; template< typename T1, typename T2, typename eglue_type> class eGlue; @@ -327,6 +326,7 @@ struct state_type template< typename T1, typename spop_type> class SpOp; template class mtSpOp; +template class mtSpReduceOp; template< typename T1, typename T2, typename spglue_type> class SpGlue; template class mtSpGlue; diff --git a/inst/include/armadillo_bits/auxlib_meat.hpp b/inst/include/armadillo_bits/auxlib_meat.hpp index ef697b3a..631c3a0d 100644 --- a/inst/include/armadillo_bits/auxlib_meat.hpp +++ b/inst/include/armadillo_bits/auxlib_meat.hpp @@ -1988,7 +1988,7 @@ auxlib::eig_sym(Col& eigval, Mat& A) if(A.is_empty()) { eigval.reset(); return true; } - if((arma_config::check_conformance) && (auxlib::rudimentary_sym_check(A) == false)) + if((arma_config::check_conform) && (auxlib::rudimentary_sym_check(A) == false)) { arma_conform_warn(1, "eig_sym(): given matrix is not symmetric"); } @@ -2041,7 +2041,7 @@ auxlib::eig_sym(Col& eigval, Mat< std::complex >& A) if(A.is_empty()) { eigval.reset(); return true; } - if((arma_config::check_conformance) && (auxlib::rudimentary_sym_check(A) == false)) + if((arma_config::check_conform) && (auxlib::rudimentary_sym_check(A) == false)) { arma_conform_warn(1, "eig_sym(): given matrix is not hermitian"); } diff --git a/inst/include/armadillo_bits/compiler_setup.hpp b/inst/include/armadillo_bits/compiler_setup.hpp index d6c151ba..d106840e 100644 --- a/inst/include/armadillo_bits/compiler_setup.hpp +++ b/inst/include/armadillo_bits/compiler_setup.hpp @@ -318,8 +318,10 @@ #undef arma_deprecated #define arma_deprecated __declspec(deprecated) - // #undef arma_inline - // #define arma_inline __forceinline inline + + #undef arma_noinline + #define arma_noinline __declspec(noinline) + #pragma warning(push) diff --git a/inst/include/armadillo_bits/debug.hpp b/inst/include/armadillo_bits/debug.hpp index e536376e..27434a1b 100644 --- a/inst/include/armadillo_bits/debug.hpp +++ b/inst/include/armadillo_bits/debug.hpp @@ -1419,33 +1419,33 @@ inline void arma_debug_check(bool state, const char* msg) { arma_conform_check( << arma_version::major << '.' << arma_version::minor << '.' << arma_version::patch << " (" << nickname << ')'; - out << "\n@ arma_config::wrapper = " << arma_config::wrapper; - out << "\n@ arma_config::cxx14 = " << arma_config::cxx14; - out << "\n@ arma_config::cxx17 = " << arma_config::cxx17; - out << "\n@ arma_config::cxx20 = " << arma_config::cxx20; - out << "\n@ arma_config::cxx23 = " << arma_config::cxx23; - out << "\n@ arma_config::std_mutex = " << arma_config::std_mutex; - out << "\n@ arma_config::posix = " << arma_config::posix; - out << "\n@ arma_config::openmp = " << arma_config::openmp; - out << "\n@ arma_config::lapack = " << arma_config::lapack; - out << "\n@ arma_config::blas = " << arma_config::blas; - out << "\n@ arma_config::newarp = " << arma_config::newarp; - out << "\n@ arma_config::arpack = " << arma_config::arpack; - out << "\n@ arma_config::superlu = " << arma_config::superlu; - out << "\n@ arma_config::atlas = " << arma_config::atlas; - out << "\n@ arma_config::hdf5 = " << arma_config::hdf5; - out << "\n@ arma_config::good_comp = " << arma_config::good_comp; - out << "\n@ arma_config::extra_code = " << arma_config::extra_code; - out << "\n@ arma_config::hidden_args = " << arma_config::hidden_args; - out << "\n@ arma_config::mat_prealloc = " << arma_config::mat_prealloc; - out << "\n@ arma_config::mp_threshold = " << arma_config::mp_threshold; - out << "\n@ arma_config::mp_threads = " << arma_config::mp_threads; - out << "\n@ arma_config::optimise_band = " << arma_config::optimise_band; - out << "\n@ arma_config::optimise_sym = " << arma_config::optimise_sym; - out << "\n@ arma_config::optimise_invexpr = " << arma_config::optimise_invexpr; - out << "\n@ arma_config::check_conformance = " << arma_config::check_conformance; - out << "\n@ arma_config::check_nonfinite = " << arma_config::check_nonfinite; - out << "\n@ arma_config::fast_math = " << arma_config::fast_math; + out << "\n@ arma_config::wrapper = " << arma_config::wrapper; + out << "\n@ arma_config::cxx14 = " << arma_config::cxx14; + out << "\n@ arma_config::cxx17 = " << arma_config::cxx17; + out << "\n@ arma_config::cxx20 = " << arma_config::cxx20; + out << "\n@ arma_config::cxx23 = " << arma_config::cxx23; + out << "\n@ arma_config::std_mutex = " << arma_config::std_mutex; + out << "\n@ arma_config::posix = " << arma_config::posix; + out << "\n@ arma_config::openmp = " << arma_config::openmp; + out << "\n@ arma_config::lapack = " << arma_config::lapack; + out << "\n@ arma_config::blas = " << arma_config::blas; + out << "\n@ arma_config::newarp = " << arma_config::newarp; + out << "\n@ arma_config::arpack = " << arma_config::arpack; + out << "\n@ arma_config::superlu = " << arma_config::superlu; + out << "\n@ arma_config::atlas = " << arma_config::atlas; + out << "\n@ arma_config::hdf5 = " << arma_config::hdf5; + out << "\n@ arma_config::good_comp = " << arma_config::good_comp; + out << "\n@ arma_config::extra_code = " << arma_config::extra_code; + out << "\n@ arma_config::hidden_args = " << arma_config::hidden_args; + out << "\n@ arma_config::mat_prealloc = " << arma_config::mat_prealloc; + out << "\n@ arma_config::mp_threshold = " << arma_config::mp_threshold; + out << "\n@ arma_config::mp_threads = " << arma_config::mp_threads; + out << "\n@ arma_config::optimise_band = " << arma_config::optimise_band; + out << "\n@ arma_config::optimise_sym = " << arma_config::optimise_sym; + out << "\n@ arma_config::optimise_invexpr = " << arma_config::optimise_invexpr; + out << "\n@ arma_config::check_conform = " << arma_config::check_conform; + out << "\n@ arma_config::check_nonfinite = " << arma_config::check_nonfinite; + out << "\n@ arma_config::fast_math = " << arma_config::fast_math; out << "\n@ sizeof(void*) = " << sizeof(void*); out << "\n@ sizeof(int) = " << sizeof(int); out << "\n@ sizeof(long) = " << sizeof(long); diff --git a/inst/include/armadillo_bits/fn_as_scalar.hpp b/inst/include/armadillo_bits/fn_as_scalar.hpp index 38cf8bf1..7b5c9b2d 100644 --- a/inst/include/armadillo_bits/fn_as_scalar.hpp +++ b/inst/include/armadillo_bits/fn_as_scalar.hpp @@ -21,6 +21,37 @@ +struct as_scalar_errmsg + { + arma_cold + arma_noinline + static + std::string + incompat_size_string(const uword n_rows, const uword n_cols) + { + std::ostringstream tmp; + + tmp << "as_scalar(): expected 1x1 matrix; got " << n_rows << 'x' << n_cols; + + return tmp.str(); + } + + arma_cold + arma_noinline + static + std::string + incompat_size_string(const uword n_rows, const uword n_cols, const uword n_slices) + { + std::ostringstream tmp; + + tmp << "as_scalar(): expected 1x1x1 cube; got " << n_rows << 'x' << n_cols << 'x' << n_slices; + + return tmp.str(); + } + }; + + + template struct as_scalar_redirect { @@ -35,6 +66,8 @@ struct as_scalar_redirect<2> { template inline static typename T1::elem_type apply(const Glue& X); + + inline static void check_size(const uword A_n_rows, const uword A_n_cols, const uword B_n_rows, const uword B_n_cols); }; @@ -57,7 +90,10 @@ as_scalar_redirect::apply(const T1& X) const Proxy P(X); - arma_conform_check( (P.get_n_elem() != 1), "as_scalar(): expression must evaluate to exactly one element" ); + if( (arma_config::check_conform) && (P.get_n_elem() != 1) ) + { + arma_conform_check_bounds( true, as_scalar_errmsg::incompat_size_string(P.get_n_rows(), P.get_n_cols()) ); + } return (Proxy::use_at) ? P.at(0,0) : P[0]; } @@ -100,7 +136,10 @@ as_scalar_redirect<2>::apply(const Glue& X) const uword B_n_rows = (tmp2.do_trans == false) ? (TB::is_row ? 1 : B.n_rows) : (TB::is_col ? 1 : B.n_cols); const uword B_n_cols = (tmp2.do_trans == false) ? (TB::is_col ? 1 : B.n_cols) : (TB::is_row ? 1 : B.n_rows); - arma_conform_check( (A_n_rows != 1) || (B_n_cols != 1) || (A_n_cols != B_n_rows), "as_scalar(): incompatible dimensions" ); + if( (arma_config::check_conform) && ((A_n_rows != 1) || (B_n_cols != 1) || (A_n_cols != B_n_rows)) ) + { + as_scalar_redirect<2>::check_size(A_n_rows, A_n_cols, B_n_rows, B_n_cols); + } const eT val = op_dot::direct_dot(A.n_elem, A.memptr(), B.memptr()); @@ -111,11 +150,16 @@ as_scalar_redirect<2>::apply(const Glue& X) const Proxy PA(X.A); const Proxy PB(X.B); - arma_conform_check - ( - (PA.get_n_rows() != 1) || (PB.get_n_cols() != 1) || (PA.get_n_cols() != PB.get_n_rows()), - "as_scalar(): incompatible dimensions" - ); + const uword A_n_rows = PA.get_n_rows(); + const uword A_n_cols = PA.get_n_cols(); + + const uword B_n_rows = PB.get_n_rows(); + const uword B_n_cols = PB.get_n_cols(); + + if( (arma_config::check_conform) && ((A_n_rows != 1) || (B_n_cols != 1) || (A_n_cols != B_n_rows)) ) + { + as_scalar_redirect<2>::check_size(A_n_rows, A_n_cols, B_n_rows, B_n_cols); + } return op_dot::apply_proxy_linear(PA,PB); } @@ -123,6 +167,17 @@ as_scalar_redirect<2>::apply(const Glue& X) +inline +void +as_scalar_redirect<2>::check_size(const uword A_n_rows, const uword A_n_cols, const uword B_n_rows, const uword B_n_cols) + { + arma_conform_assert_mul_size(A_n_rows, A_n_cols, B_n_rows, B_n_cols, "matrix multiplication"); + + arma_conform_check_bounds( ((A_n_rows != 1) || (B_n_cols != 1)), as_scalar_errmsg::incompat_size_string(A_n_rows, B_n_cols) ); + } + + + template inline typename T1::elem_type @@ -149,7 +204,10 @@ as_scalar_redirect<3>::apply(const Glue< Glue, T3, glue_time { const Mat tmp(X); - arma_conform_check( (tmp.n_elem != 1), "as_scalar(): expression must evaluate to exactly one element" ); + if( (arma_config::check_conform) && (tmp.n_elem != 1) ) + { + arma_conform_check_bounds(true, as_scalar_errmsg::incompat_size_string(tmp.n_rows, tmp.n_cols) ); + } return tmp[0]; } @@ -176,14 +234,14 @@ as_scalar_redirect<3>::apply(const Glue< Glue, T3, glue_time const eT val = tmp1.get_val() * tmp2.get_val() * tmp3.get_val(); - arma_conform_check + arma_conform_check_bounds ( (A_n_rows != 1) || (C_n_cols != 1) || (A_n_cols != B_n_rows) || (B_n_cols != C_n_rows) , - "as_scalar(): incompatible dimensions" + "as_scalar(): expected 1x1 matrix" ); @@ -226,7 +284,7 @@ as_scalar_diag(const Base& X) const unwrap tmp(X.get_ref()); const Mat& A = tmp.M; - arma_conform_check( (A.n_elem != 1), "as_scalar(): expression must evaluate to exactly one element" ); + arma_conform_check_bounds( (A.n_elem != 1), "as_scalar(): expected 1x1 matrix" ); return A.mem[0]; } @@ -271,14 +329,14 @@ as_scalar_diag(const Glue< Glue, T3, glue_times >& X) const eT val = tmp1.get_val() * tmp2.get_val() * tmp3.get_val(); - arma_conform_check + arma_conform_check_bounds ( (A_n_rows != 1) || (C_n_cols != 1) || (A_n_cols != B_n_rows) || (B_n_cols != C_n_rows) , - "as_scalar(): incompatible dimensions" + "as_scalar(): expected 1x1 matrix" ); @@ -324,7 +382,10 @@ as_scalar(const Base& X) const Proxy P(X.get_ref()); - arma_conform_check( (P.get_n_elem() != 1), "as_scalar(): expression must evaluate to exactly one element" ); + if( (arma_config::check_conform) && (P.get_n_elem() != 1) ) + { + arma_conform_check_bounds( true, as_scalar_errmsg::incompat_size_string(P.get_n_rows(), P.get_n_cols()) ); + } return (Proxy::use_at) ? P.at(0,0) : P[0]; } @@ -340,7 +401,10 @@ as_scalar(const BaseCube& X) const ProxyCube P(X.get_ref()); - arma_conform_check( (P.get_n_elem() != 1), "as_scalar(): expression must evaluate to exactly one element" ); + if( (arma_config::check_conform) && (P.get_n_elem() != 1) ) + { + arma_conform_check_bounds( true, as_scalar_errmsg::incompat_size_string(P.get_n_rows(), P.get_n_cols(), P.get_n_slices()) ); + } return (ProxyCube::use_at) ? P.at(0,0,0) : P[0]; } @@ -371,7 +435,10 @@ as_scalar(const SpBase& X) const unwrap_spmat tmp(X.get_ref()); const SpMat& A = tmp.M; - arma_conform_check( (A.n_elem != 1), "as_scalar(): expression must evaluate to exactly one element" ); + if( (arma_config::check_conform) && (A.n_elem != 1) ) + { + arma_conform_check_bounds(true, as_scalar_errmsg::incompat_size_string(A.n_rows, A.n_cols) ); + } return A.at(0,0); } diff --git a/inst/include/armadillo_bits/fn_chol.hpp b/inst/include/armadillo_bits/fn_chol.hpp index bd4e26b8..b84dbc13 100644 --- a/inst/include/armadillo_bits/fn_chol.hpp +++ b/inst/include/armadillo_bits/fn_chol.hpp @@ -103,7 +103,7 @@ chol return true; } - if((arma_config::check_conformance) && (auxlib::rudimentary_sym_check(out) == false)) + if((arma_config::check_conform) && (auxlib::rudimentary_sym_check(out) == false)) { if(is_cx::no ) { arma_conform_warn(1, "chol(): given matrix is not symmetric"); } if(is_cx::yes) { arma_conform_warn(1, "chol(): given matrix is not hermitian"); } diff --git a/inst/include/armadillo_bits/fn_conv_to.hpp b/inst/include/armadillo_bits/fn_conv_to.hpp index 29a291ca..3639fdd3 100644 --- a/inst/include/armadillo_bits/fn_conv_to.hpp +++ b/inst/include/armadillo_bits/fn_conv_to.hpp @@ -57,7 +57,7 @@ conv_to::from(const Base& in, const typename arma_not_cx P(in.get_ref()); - arma_conform_check( (P.get_n_elem() != 1), "conv_to(): given object does not have exactly one element" ); + arma_conform_check( (P.get_n_elem() != 1), "conv_to(): expected 1x1 matrix" ); return out_eT(Proxy::use_at ? P.at(0,0) : P[0]); } @@ -78,7 +78,7 @@ conv_to::from(const Base& in, const typename arma_cx_only P(in.get_ref()); - arma_conform_check( (P.get_n_elem() != 1), "conv_to(): given object does not have exactly one element" ); + arma_conform_check( (P.get_n_elem() != 1), "conv_to(): expected 1x1 matrix" ); out_eT out; @@ -103,7 +103,7 @@ conv_to::from(const BaseCube& in, const typename arma_not_cx< const ProxyCube P(in.get_ref()); - arma_conform_check( (P.get_n_elem() != 1), "conv_to(): given object does not have exactly one element" ); + arma_conform_check( (P.get_n_elem() != 1), "conv_to(): expected 1x1x1 cube" ); return out_eT(ProxyCube::use_at ? P.at(0,0,0) : P[0]); } @@ -124,7 +124,7 @@ conv_to::from(const BaseCube& in, const typename arma_cx_only const ProxyCube P(in.get_ref()); - arma_conform_check( (P.get_n_elem() != 1), "conv_to(): given object does not have exactly one element" ); + arma_conform_check( (P.get_n_elem() != 1), "conv_to(): expected 1x1x1 cube" ); out_eT out; diff --git a/inst/include/armadillo_bits/fn_diagvec.hpp b/inst/include/armadillo_bits/fn_diagvec.hpp index a96a8200..3665a09d 100644 --- a/inst/include/armadillo_bits/fn_diagvec.hpp +++ b/inst/include/armadillo_bits/fn_diagvec.hpp @@ -51,12 +51,12 @@ diagvec(const Base& X, const sword diag_id) template arma_warn_unused arma_inline -const SpToDOp +const mtSpReduceOp diagvec(const SpBase& X, const sword diag_id = 0) { arma_debug_sigprint(); - return SpToDOp(X.get_ref(), ((diag_id < 0) ? -diag_id : diag_id), ((diag_id < 0) ? 1 : 0) ); + return mtSpReduceOp(X.get_ref(), ((diag_id < 0) ? -diag_id : diag_id), ((diag_id < 0) ? 1 : 0) ); } diff --git a/inst/include/armadillo_bits/fn_eig_sym.hpp b/inst/include/armadillo_bits/fn_eig_sym.hpp index 5061cf54..638cf4ee 100644 --- a/inst/include/armadillo_bits/fn_eig_sym.hpp +++ b/inst/include/armadillo_bits/fn_eig_sym.hpp @@ -95,7 +95,7 @@ eig_sym_helper { arma_debug_sigprint(); - if((arma_config::check_conformance) && (auxlib::rudimentary_sym_check(X) == false)) + if((arma_config::check_conform) && (auxlib::rudimentary_sym_check(X) == false)) { if(is_cx::no ) { arma_conform_warn(1, caller_sig, ": given matrix is not symmetric"); } if(is_cx::yes) { arma_conform_warn(1, caller_sig, ": given matrix is not hermitian"); } diff --git a/inst/include/armadillo_bits/fn_max.hpp b/inst/include/armadillo_bits/fn_max.hpp index a6f28752..39337b22 100644 --- a/inst/include/armadillo_bits/fn_max.hpp +++ b/inst/include/armadillo_bits/fn_max.hpp @@ -152,13 +152,13 @@ typename enable_if2 < is_arma_sparse_type::value && resolves_to_sparse_vector::no, - const SpToDOp + const mtSpReduceOp >::result max(const T1& X) { arma_debug_sigprint(); - return SpToDOp(X, 0, 0); + return mtSpReduceOp(X, 0, 0); } @@ -170,13 +170,13 @@ typename enable_if2 < is_arma_sparse_type::value, - const SpToDOp + const mtSpReduceOp >::result max(const T1& X, const uword dim) { arma_debug_sigprint(); - return SpToDOp(X, dim, 0); + return mtSpReduceOp(X, dim, 0); } diff --git a/inst/include/armadillo_bits/fn_mean.hpp b/inst/include/armadillo_bits/fn_mean.hpp index 26515ca2..23416280 100644 --- a/inst/include/armadillo_bits/fn_mean.hpp +++ b/inst/include/armadillo_bits/fn_mean.hpp @@ -113,13 +113,13 @@ typename enable_if2 < is_arma_sparse_type::value && resolves_to_sparse_vector::no, - const SpToDOp + const mtSpReduceOp >::result mean(const T1& x) { arma_debug_sigprint(); - return SpToDOp(x, 0, 0); + return mtSpReduceOp(x, 0, 0); } @@ -131,13 +131,13 @@ typename enable_if2 < is_arma_sparse_type::value, - const SpToDOp + const mtSpReduceOp >::result mean(const T1& x, const uword dim) { arma_debug_sigprint(); - return SpToDOp(x, dim, 0); + return mtSpReduceOp(x, dim, 0); } diff --git a/inst/include/armadillo_bits/fn_min.hpp b/inst/include/armadillo_bits/fn_min.hpp index 433da86d..f5f230e2 100644 --- a/inst/include/armadillo_bits/fn_min.hpp +++ b/inst/include/armadillo_bits/fn_min.hpp @@ -152,13 +152,13 @@ typename enable_if2 < is_arma_sparse_type::value && resolves_to_sparse_vector::no, - const SpToDOp + const mtSpReduceOp >::result min(const T1& X) { arma_debug_sigprint(); - return SpToDOp(X, 0, 0); + return mtSpReduceOp(X, 0, 0); } @@ -170,13 +170,13 @@ typename enable_if2 < is_arma_sparse_type::value, - const SpToDOp + const mtSpReduceOp >::result min(const T1& X, const uword dim) { arma_debug_sigprint(); - return SpToDOp(X, dim, 0); + return mtSpReduceOp(X, dim, 0); } diff --git a/inst/include/armadillo_bits/fn_nonzeros.hpp b/inst/include/armadillo_bits/fn_nonzeros.hpp index cc621f9b..b724444a 100644 --- a/inst/include/armadillo_bits/fn_nonzeros.hpp +++ b/inst/include/armadillo_bits/fn_nonzeros.hpp @@ -36,12 +36,12 @@ nonzeros(const Base& X) template arma_warn_unused inline -const SpToDOp +const SpToDOp nonzeros(const SpBase& X) { arma_debug_sigprint(); - return SpToDOp(X.get_ref()); + return SpToDOp(X.get_ref()); } diff --git a/inst/include/armadillo_bits/fn_stddev.hpp b/inst/include/armadillo_bits/fn_stddev.hpp index fe60a2f8..cb8e2785 100644 --- a/inst/include/armadillo_bits/fn_stddev.hpp +++ b/inst/include/armadillo_bits/fn_stddev.hpp @@ -111,13 +111,13 @@ typename enable_if2 < is_arma_sparse_type::value && resolves_to_sparse_vector::no, - const mtSpToDOp + const mtSpReduceOp >::result stddev(const T1& X, const uword norm_type = 0) { arma_debug_sigprint(); - return mtSpToDOp(X, norm_type, 0); + return mtSpReduceOp(X, norm_type, 0); } @@ -129,13 +129,13 @@ typename enable_if2 < is_arma_sparse_type::value, - const mtSpToDOp + const mtSpReduceOp >::result stddev(const T1& X, const uword norm_type, const uword dim) { arma_debug_sigprint(); - return mtSpToDOp(X, norm_type, dim); + return mtSpReduceOp(X, norm_type, dim); } diff --git a/inst/include/armadillo_bits/fn_sum.hpp b/inst/include/armadillo_bits/fn_sum.hpp index 2ae47d24..c27b1c4a 100644 --- a/inst/include/armadillo_bits/fn_sum.hpp +++ b/inst/include/armadillo_bits/fn_sum.hpp @@ -115,13 +115,13 @@ typename enable_if2 < is_arma_sparse_type::value && resolves_to_sparse_vector::no, - const SpToDOp + const mtSpReduceOp >::result sum(const T1& x) { arma_debug_sigprint(); - return SpToDOp(x, 0, 0); + return mtSpReduceOp(x, 0, 0); } @@ -133,13 +133,13 @@ typename enable_if2 < is_arma_sparse_type::value, - const SpToDOp + const mtSpReduceOp >::result sum(const T1& x, const uword dim) { arma_debug_sigprint(); - return SpToDOp(x, dim, 0); + return mtSpReduceOp(x, dim, 0); } diff --git a/inst/include/armadillo_bits/fn_var.hpp b/inst/include/armadillo_bits/fn_var.hpp index 0ec5b8fd..1902e30a 100644 --- a/inst/include/armadillo_bits/fn_var.hpp +++ b/inst/include/armadillo_bits/fn_var.hpp @@ -111,13 +111,13 @@ typename enable_if2 < is_arma_sparse_type::value && resolves_to_sparse_vector::no, - const mtSpToDOp + const mtSpReduceOp >::result var(const T1& X, const uword norm_type = 0) { arma_debug_sigprint(); - return mtSpToDOp(X, norm_type, 0); + return mtSpReduceOp(X, norm_type, 0); } @@ -129,13 +129,13 @@ typename enable_if2 < is_arma_sparse_type::value, - const mtSpToDOp + const mtSpReduceOp >::result var(const T1& X, const uword norm_type, const uword dim) { arma_debug_sigprint(); - return mtSpToDOp(X, norm_type, dim); + return mtSpReduceOp(X, norm_type, dim); } diff --git a/inst/include/armadillo_bits/fn_vecnorm.hpp b/inst/include/armadillo_bits/fn_vecnorm.hpp index ff0c5635..4cfc2d99 100644 --- a/inst/include/armadillo_bits/fn_vecnorm.hpp +++ b/inst/include/armadillo_bits/fn_vecnorm.hpp @@ -249,7 +249,7 @@ typename enable_if2 < is_arma_sparse_type::value && resolves_to_sparse_vector::no, - const mtSpToDOp + const mtSpReduceOp >::result vecnorm ( @@ -265,7 +265,7 @@ vecnorm const uword dim = 0; - return mtSpToDOp(X, k, dim); + return mtSpReduceOp(X, k, dim); } @@ -273,7 +273,7 @@ vecnorm template arma_warn_unused inline -const mtSpToDOp +const mtSpReduceOp vecnorm ( const SpBase& X, @@ -285,7 +285,7 @@ vecnorm arma_debug_sigprint(); arma_ignore(junk); - return mtSpToDOp(X.get_ref(), k, dim); + return mtSpReduceOp(X.get_ref(), k, dim); } @@ -327,7 +327,7 @@ typename enable_if2 < is_arma_sparse_type::value && resolves_to_sparse_vector::no, - const mtSpToDOp + const mtSpReduceOp >::result vecnorm ( @@ -350,7 +350,7 @@ vecnorm const uword dim = 0; - return mtSpToDOp(X, method_id, dim); + return mtSpReduceOp(X, method_id, dim); } @@ -358,7 +358,7 @@ vecnorm template arma_warn_unused inline -const mtSpToDOp +const mtSpReduceOp vecnorm ( const SpBase& X, @@ -377,7 +377,7 @@ vecnorm if( (sig == 'i') || (sig == 'I') || (sig == '+') ) { method_id = 1; } if( (sig == '-') ) { method_id = 2; } - return mtSpToDOp(X.get_ref(), method_id, dim); + return mtSpReduceOp(X.get_ref(), method_id, dim); } diff --git a/inst/include/armadillo_bits/glue_mvnrnd_meat.hpp b/inst/include/armadillo_bits/glue_mvnrnd_meat.hpp index 8f770365..6feaab58 100644 --- a/inst/include/armadillo_bits/glue_mvnrnd_meat.hpp +++ b/inst/include/armadillo_bits/glue_mvnrnd_meat.hpp @@ -85,7 +85,7 @@ glue_mvnrnd::apply_direct(Mat& out, const Base::apply(Mat& out, const arma_conform_check( (A.is_square() == false), "inv(): given matrix must be square sized" ); - if( (strip_inv::do_inv_spd) && (arma_config::check_conformance) && (auxlib::rudimentary_sym_check(A) == false) ) + if( (strip_inv::do_inv_spd) && (arma_config::check_conform) && (auxlib::rudimentary_sym_check(A) == false) ) { if(is_cx::no ) { arma_conform_warn(1, "inv_sympd(): given matrix is not symmetric"); } if(is_cx::yes) { arma_conform_warn(1, "inv_sympd(): given matrix is not hermitian"); } @@ -145,7 +145,7 @@ glue_times_redirect2_helper::apply(Mat& out, const arma_conform_check( (B.is_square() == false), "inv_sympd(): given matrix must be square sized" ); - if( (arma_config::check_conformance) && (auxlib::rudimentary_sym_check(B) == false) ) + if( (arma_config::check_conform) && (auxlib::rudimentary_sym_check(B) == false) ) { if(is_cx::no ) { arma_conform_warn(1, "inv_sympd(): given matrix is not symmetric"); } if(is_cx::yes) { arma_conform_warn(1, "inv_sympd(): given matrix is not hermitian"); } @@ -272,7 +272,7 @@ glue_times_redirect3_helper::apply(Mat& out, const arma_conform_assert_mul_size(A, BC, "matrix multiplication"); - if( (strip_inv::do_inv_spd) && (arma_config::check_conformance) && (auxlib::rudimentary_sym_check(A) == false) ) + if( (strip_inv::do_inv_spd) && (arma_config::check_conform) && (auxlib::rudimentary_sym_check(A) == false) ) { if(is_cx::no ) { arma_conform_warn(1, "inv_sympd(): given matrix is not symmetric"); } if(is_cx::yes) { arma_conform_warn(1, "inv_sympd(): given matrix is not hermitian"); } @@ -307,7 +307,7 @@ glue_times_redirect3_helper::apply(Mat& out, const arma_conform_assert_mul_size(B, C, "matrix multiplication"); - if( (strip_inv::do_inv_spd) && (arma_config::check_conformance) && (auxlib::rudimentary_sym_check(B) == false) ) + if( (strip_inv::do_inv_spd) && (arma_config::check_conform) && (auxlib::rudimentary_sym_check(B) == false) ) { if(is_cx::no ) { arma_conform_warn(1, "inv_sympd(): given matrix is not symmetric"); } if(is_cx::yes) { arma_conform_warn(1, "inv_sympd(): given matrix is not hermitian"); } diff --git a/inst/include/armadillo_bits/mtSpReduceOp_bones.hpp b/inst/include/armadillo_bits/mtSpReduceOp_bones.hpp new file mode 100644 index 00000000..51be0a3f --- /dev/null +++ b/inst/include/armadillo_bits/mtSpReduceOp_bones.hpp @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + + +//! \addtogroup mtSpReduceOp +//! @{ + + +// NOTE: mtSpReduceOp is dedicated for reduction operations on sparse matrices, +// NOTE: including sum(), min(), max(), mean(), var(), stddev(), +// NOTE where the entire sparse matrix is reduced to a vector. +// NOTE: +// NOTE: Even though it would make more sense for mtSpReduceOp to be derived from Base +// NOTE: (as it's more efficient to store the resulting vectors in dense format), +// NOTE: mtSpReduceOp is derived from SpBase so the default user-accessible output is in sparse storage format. +// NOTE. This is to mimic the behaviour of Octave and to keep compatibility with existing user code. +// NOTE: +// NOTE: However, for simplicity and efficiency, each mtSpReduceOp op_type::apply() function +// NOTE: must output to a dense matrix, ie. apply(Mat, ...). +// NOTE: The SpMat class handles mtSpReduceOp by converting the dense output to a sparse representation. +// NOTE: The Mat class has an explicit constructor to efficiently handle mtSpReduceOp. + +template +class mtSpReduceOp : public SpBase< out_eT, mtSpReduceOp > + { + public: + + typedef out_eT elem_type; + typedef typename get_pod_type::result pod_type; + + typedef typename T1::elem_type in_eT; + + static constexpr bool is_row = op_type::template traits::is_row; + static constexpr bool is_col = op_type::template traits::is_col; + static constexpr bool is_xvec = op_type::template traits::is_xvec; + + inline explicit mtSpReduceOp(const T1& in_m); + inline mtSpReduceOp(const T1& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b); + inline ~mtSpReduceOp(); + + arma_aligned const T1& m; //!< the operand; must be derived from SpBase + arma_aligned uword aux_uword_a; //!< auxiliary data, uword format + arma_aligned uword aux_uword_b; //!< auxiliary data, uword format + }; + + + +//! @} diff --git a/inst/include/armadillo_bits/mtSpReduceOp_meat.hpp b/inst/include/armadillo_bits/mtSpReduceOp_meat.hpp new file mode 100644 index 00000000..e7a63c75 --- /dev/null +++ b/inst/include/armadillo_bits/mtSpReduceOp_meat.hpp @@ -0,0 +1,55 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + + +//! \addtogroup mtSpReduceOp +//! @{ + + + +template +inline +mtSpReduceOp::mtSpReduceOp(const T1& in_m) + : m(in_m) + { + arma_debug_sigprint(); + } + + + +template +inline +mtSpReduceOp::mtSpReduceOp(const T1& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b) + : m(in_m) + , aux_uword_a(in_aux_uword_a) + , aux_uword_b(in_aux_uword_b) + { + arma_debug_sigprint(); + } + + + +template +inline +mtSpReduceOp::~mtSpReduceOp() + { + arma_debug_sigprint(); + } + + + +//! @} diff --git a/inst/include/armadillo_bits/op_chol_meat.hpp b/inst/include/armadillo_bits/op_chol_meat.hpp index d565d198..b0bf2bbc 100644 --- a/inst/include/armadillo_bits/op_chol_meat.hpp +++ b/inst/include/armadillo_bits/op_chol_meat.hpp @@ -54,7 +54,7 @@ op_chol::apply_direct(Mat& out, const Base::no ) { arma_conform_warn(1, "chol(): given matrix is not symmetric"); } if(is_cx::yes) { arma_conform_warn(1, "chol(): given matrix is not hermitian"); } diff --git a/inst/include/armadillo_bits/op_expmat_meat.hpp b/inst/include/armadillo_bits/op_expmat_meat.hpp index 0fdcf768..35ceda6c 100644 --- a/inst/include/armadillo_bits/op_expmat_meat.hpp +++ b/inst/include/armadillo_bits/op_expmat_meat.hpp @@ -200,7 +200,7 @@ op_expmat_sym::apply_direct(Mat& out, const Base 0) && (is_cx::yes) && (sym_helper::check_diag_imag(X) == false)) + if((arma_config::check_conform) && (arma_config::warn_level > 0) && (is_cx::yes) && (sym_helper::check_diag_imag(X) == false)) { arma_conform_warn(1, "inv_sympd(): imaginary components on diagonal are non-zero"); } diff --git a/inst/include/armadillo_bits/op_find_meat.hpp b/inst/include/armadillo_bits/op_find_meat.hpp index 5b851ef2..f70916b5 100644 --- a/inst/include/armadillo_bits/op_find_meat.hpp +++ b/inst/include/armadillo_bits/op_find_meat.hpp @@ -93,7 +93,7 @@ op_find::helper const eT val = X.aux; - if((is_same_type::yes || is_same_type::yes) && arma_config::check_conformance && arma_isnan(val)) + if((is_same_type::yes || is_same_type::yes) && arma_config::check_conform && arma_isnan(val)) { arma_conform_warn(1, "find(): NaN is not equal to anything; suggest to use find_nonfinite() instead"); } @@ -226,7 +226,7 @@ op_find::helper const eT val = X.aux; - if((is_same_type::yes || is_same_type::yes) && arma_config::check_conformance && arma_isnan(val)) + if((is_same_type::yes || is_same_type::yes) && arma_config::check_conform && arma_isnan(val)) { arma_conform_warn(1, "find(): NaN is not equal to anything; suggest to use find_nonfinite() instead"); } diff --git a/inst/include/armadillo_bits/op_inv_spd_meat.hpp b/inst/include/armadillo_bits/op_inv_spd_meat.hpp index 36f8a80f..11d6415f 100644 --- a/inst/include/armadillo_bits/op_inv_spd_meat.hpp +++ b/inst/include/armadillo_bits/op_inv_spd_meat.hpp @@ -150,7 +150,7 @@ op_inv_spd_full::apply_direct(Mat& out, const Base 0)) + if((arma_config::check_conform) && (arma_config::warn_level > 0)) { if(auxlib::rudimentary_sym_check(out) == false) { @@ -284,7 +284,7 @@ op_inv_spd_rcond::apply_direct(Mat& out, op_inv_spd_stat arma_conform_check( (out.is_square() == false), "inv_sympd(): given matrix must be square sized", [&](){ out.soft_reset(); } ); - if((arma_config::check_conformance) && (arma_config::warn_level > 0)) + if((arma_config::check_conform) && (arma_config::warn_level > 0)) { if(auxlib::rudimentary_sym_check(out) == false) { diff --git a/inst/include/armadillo_bits/op_log_det_meat.hpp b/inst/include/armadillo_bits/op_log_det_meat.hpp index 91983df7..b143295d 100644 --- a/inst/include/armadillo_bits/op_log_det_meat.hpp +++ b/inst/include/armadillo_bits/op_log_det_meat.hpp @@ -195,7 +195,7 @@ op_log_det_sympd::apply_direct(typename T1::pod_type& out_val, const Base 0) && (is_cx::yes) && (sym_helper::check_diag_imag(A) == false)) + if((arma_config::check_conform) && (arma_config::warn_level > 0) && (is_cx::yes) && (sym_helper::check_diag_imag(A) == false)) { arma_conform_warn(1, "log_det_sympd(): imaginary components on diagonal are non-zero"); } @@ -225,7 +225,7 @@ op_log_det_sympd::apply_direct(typename T1::pod_type& out_val, const Base::no ) { arma_conform_warn(1, "log_det_sympd(): given matrix is not symmetric"); } if(is_cx::yes) { arma_conform_warn(1, "log_det_sympd(): given matrix is not hermitian"); } diff --git a/inst/include/armadillo_bits/op_logmat_meat.hpp b/inst/include/armadillo_bits/op_logmat_meat.hpp index 45ed5fec..0baa641a 100644 --- a/inst/include/armadillo_bits/op_logmat_meat.hpp +++ b/inst/include/armadillo_bits/op_logmat_meat.hpp @@ -505,7 +505,7 @@ op_logmat_sympd::apply_direct(Mat& out, const Base 0) && (is_cx::yes) && (sym_helper::check_diag_imag(X) == false)) + if((arma_config::check_conform) && (arma_config::warn_level > 0) && (is_cx::yes) && (sym_helper::check_diag_imag(X) == false)) { arma_conform_warn(1, "logmat_sympd(): imaginary components on diagonal are non-zero"); } diff --git a/inst/include/armadillo_bits/op_nonzeros_bones.hpp b/inst/include/armadillo_bits/op_nonzeros_bones.hpp index 8c3fd65e..be62b3f4 100644 --- a/inst/include/armadillo_bits/op_nonzeros_bones.hpp +++ b/inst/include/armadillo_bits/op_nonzeros_bones.hpp @@ -38,15 +38,4 @@ class op_nonzeros -class op_nonzeros_spmat - : public traits_op_col - { - public: - - template - static inline void apply(Mat& out, const SpToDOp& X); - }; - - - //! @} diff --git a/inst/include/armadillo_bits/op_nonzeros_meat.hpp b/inst/include/armadillo_bits/op_nonzeros_meat.hpp index 15b9d820..cdc0b932 100644 --- a/inst/include/armadillo_bits/op_nonzeros_meat.hpp +++ b/inst/include/armadillo_bits/op_nonzeros_meat.hpp @@ -98,54 +98,4 @@ op_nonzeros::apply(Mat& out, const Op& -template -inline -void -op_nonzeros_spmat::apply(Mat& out, const SpToDOp& X) - { - arma_debug_sigprint(); - - typedef typename T1::elem_type eT; - - const SpProxy P(X.m); - - const uword N = P.get_n_nonzero(); - - out.set_size(N,1); - - if(N == 0) { return; } - - if(is_SpMat::stored_type>::value) - { - const unwrap_spmat::stored_type> U(P.Q); - - arrayops::copy(out.memptr(), U.M.values, N); - - return; - } - - if(is_SpSubview::stored_type>::value) - { - const SpSubview& sv = reinterpret_cast< const SpSubview& >(P.Q); - - if(sv.n_rows == sv.m.n_rows) - { - const SpMat& m = sv.m; - const uword col = sv.aux_col1; - - arrayops::copy(out.memptr(), &(m.values[ m.col_ptrs[col] ]), N); - - return; - } - } - - eT* out_mem = out.memptr(); - - typename SpProxy::const_iterator_type it = P.begin(); - - for(uword i=0; i + inline static void apply(Mat& out, const SpToDOp& expr); + }; + + +//! @} diff --git a/inst/include/armadillo_bits/op_sp_as_dense_meat.hpp b/inst/include/armadillo_bits/op_sp_as_dense_meat.hpp new file mode 100644 index 00000000..6b10ab98 --- /dev/null +++ b/inst/include/armadillo_bits/op_sp_as_dense_meat.hpp @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + + +//! \addtogroup op_sp_as_dense +//! @{ + + + +template +inline +void +op_sp_as_dense::apply(Mat& out, const SpToDOp& expr) + { + arma_debug_sigprint(); + + out = expr.m; + } + + + +//! @} diff --git a/inst/include/armadillo_bits/op_sp_diagvec_bones.hpp b/inst/include/armadillo_bits/op_sp_diagvec_bones.hpp index f8901971..f5b6ad47 100644 --- a/inst/include/armadillo_bits/op_sp_diagvec_bones.hpp +++ b/inst/include/armadillo_bits/op_sp_diagvec_bones.hpp @@ -27,7 +27,7 @@ class op_sp_diagvec public: template - inline static void apply(Mat& out, const SpToDOp& in); + inline static void apply(Mat& out, const mtSpReduceOp& in); }; diff --git a/inst/include/armadillo_bits/op_sp_diagvec_meat.hpp b/inst/include/armadillo_bits/op_sp_diagvec_meat.hpp index f83d1bb3..a332f852 100644 --- a/inst/include/armadillo_bits/op_sp_diagvec_meat.hpp +++ b/inst/include/armadillo_bits/op_sp_diagvec_meat.hpp @@ -24,7 +24,7 @@ template inline void -op_sp_diagvec::apply(Mat& out, const SpToDOp& in) +op_sp_diagvec::apply(Mat& out, const mtSpReduceOp& in) { arma_debug_sigprint(); diff --git a/inst/include/armadillo_bits/op_sp_max_bones.hpp b/inst/include/armadillo_bits/op_sp_max_bones.hpp index 00608072..1268a679 100644 --- a/inst/include/armadillo_bits/op_sp_max_bones.hpp +++ b/inst/include/armadillo_bits/op_sp_max_bones.hpp @@ -25,7 +25,7 @@ class op_sp_max public: template - inline static void apply(Mat& out, const SpToDOp& in); + inline static void apply(Mat& out, const mtSpReduceOp& in); // diff --git a/inst/include/armadillo_bits/op_sp_max_meat.hpp b/inst/include/armadillo_bits/op_sp_max_meat.hpp index d09750de..b86bf280 100644 --- a/inst/include/armadillo_bits/op_sp_max_meat.hpp +++ b/inst/include/armadillo_bits/op_sp_max_meat.hpp @@ -24,7 +24,7 @@ template inline void -op_sp_max::apply(Mat& out, const SpToDOp& in) +op_sp_max::apply(Mat& out, const mtSpReduceOp& in) { arma_debug_sigprint(); diff --git a/inst/include/armadillo_bits/op_sp_mean_bones.hpp b/inst/include/armadillo_bits/op_sp_mean_bones.hpp index eb6ed494..66358149 100644 --- a/inst/include/armadillo_bits/op_sp_mean_bones.hpp +++ b/inst/include/armadillo_bits/op_sp_mean_bones.hpp @@ -28,7 +28,7 @@ class op_sp_mean // Apply mean into an output sparse matrix (or vector). template - inline static void apply(Mat& out, const SpToDOp& in); + inline static void apply(Mat& out, const mtSpReduceOp& in); template inline static void apply_fast(Mat& out, const SpProxy& p, const uword dim); diff --git a/inst/include/armadillo_bits/op_sp_mean_meat.hpp b/inst/include/armadillo_bits/op_sp_mean_meat.hpp index 62d8dd57..eb4b5acc 100644 --- a/inst/include/armadillo_bits/op_sp_mean_meat.hpp +++ b/inst/include/armadillo_bits/op_sp_mean_meat.hpp @@ -24,7 +24,7 @@ template inline void -op_sp_mean::apply(Mat& out, const SpToDOp& in) +op_sp_mean::apply(Mat& out, const mtSpReduceOp& in) { arma_debug_sigprint(); diff --git a/inst/include/armadillo_bits/op_sp_min_bones.hpp b/inst/include/armadillo_bits/op_sp_min_bones.hpp index 9cd75e99..5dda6e87 100644 --- a/inst/include/armadillo_bits/op_sp_min_bones.hpp +++ b/inst/include/armadillo_bits/op_sp_min_bones.hpp @@ -25,7 +25,7 @@ class op_sp_min public: template - inline static void apply(Mat& out, const SpToDOp& in); + inline static void apply(Mat& out, const mtSpReduceOp& in); // diff --git a/inst/include/armadillo_bits/op_sp_min_meat.hpp b/inst/include/armadillo_bits/op_sp_min_meat.hpp index 7c53aa5d..cb7c80d4 100644 --- a/inst/include/armadillo_bits/op_sp_min_meat.hpp +++ b/inst/include/armadillo_bits/op_sp_min_meat.hpp @@ -24,7 +24,7 @@ template inline void -op_sp_min::apply(Mat& out, const SpToDOp& in) +op_sp_min::apply(Mat& out, const mtSpReduceOp& in) { arma_debug_sigprint(); diff --git a/inst/include/armadillo_bits/op_sp_minus_bones.hpp b/inst/include/armadillo_bits/op_sp_minus_bones.hpp index c0134ed0..fb1487b6 100644 --- a/inst/include/armadillo_bits/op_sp_minus_bones.hpp +++ b/inst/include/armadillo_bits/op_sp_minus_bones.hpp @@ -26,18 +26,14 @@ class op_sp_minus_pre : public traits_op_passthru { public: - + template inline static void apply(Mat& out, const SpToDOp& in); - - // force apply into sparse matrix - template - inline static void apply(SpMat& out, const SpToDOp& in); - + // used for the optimization of sparse % (scalar - sparse) template inline static void apply_inside_schur(SpMat& out, const T2& x, const SpToDOp& y); - + // used for the optimization of sparse / (scalar - sparse) template inline static void apply_inside_div(SpMat& out, const T2& x, const SpToDOp& y); @@ -50,18 +46,14 @@ class op_sp_minus_post : public traits_op_passthru { public: - + template inline static void apply(Mat& out, const SpToDOp& in); - - // force apply into sparse matrix - template - inline static void apply(SpMat& out, const SpToDOp& in); - + // used for the optimization of sparse % (sparse - scalar) template inline static void apply_inside_schur(SpMat& out, const T2& x, const SpToDOp& y); - + // used for the optimization of sparse / (sparse - scalar) template inline static void apply_inside_div(SpMat& out, const T2& x, const SpToDOp& y); diff --git a/inst/include/armadillo_bits/op_sp_minus_meat.hpp b/inst/include/armadillo_bits/op_sp_minus_meat.hpp index 917b4294..1086891f 100644 --- a/inst/include/armadillo_bits/op_sp_minus_meat.hpp +++ b/inst/include/armadillo_bits/op_sp_minus_meat.hpp @@ -28,48 +28,12 @@ op_sp_minus_pre::apply(Mat& out, const SpToDOp proxy(in.m); + const SpProxy P(in.m); - out.set_size(proxy.get_n_rows(), proxy.get_n_cols()); + out.set_size(P.get_n_rows(), P.get_n_cols()); out.fill(in.aux); - typename SpProxy::const_iterator_type it = proxy.begin(); - typename SpProxy::const_iterator_type it_end = proxy.end(); - - for(; it != it_end; ++it) - { - out.at(it.row(), it.col()) -= (*it); - } - } - - - -// force apply into SpMat -template -inline -void -op_sp_minus_pre::apply(SpMat& out, const SpToDOp& in) - { - arma_debug_sigprint(); - - typedef typename T1::elem_type eT; - - // Note that T1 will be a sparse type, so we use SpProxy. - const SpProxy proxy(in.m); - - const uword n_rows = proxy.get_n_rows(); - const uword n_cols = proxy.get_n_cols(); - - out.set_size(n_rows, n_cols); - - const eT k = in.aux; - - for(uword c = 0; c < n_cols; ++c) - for(uword r = 0; r < n_rows; ++r) - { - out.at(r, c) = k - proxy.at(r, c); - } + out -= P.Q; } @@ -81,16 +45,16 @@ void op_sp_minus_pre::apply_inside_schur(SpMat& out, const T2& x, const SpToDOp& y) { arma_debug_sigprint(); - - const SpProxy proxy2(x); - const SpProxy proxy3(y.m); - - arma_conform_assert_same_size(proxy2.get_n_rows(), proxy2.get_n_cols(), proxy3.get_n_rows(), proxy3.get_n_cols(), "element-wise multiplication"); - - out.zeros(proxy2.get_n_rows(), proxy2.get_n_cols()); - typename SpProxy::const_iterator_type it = proxy2.begin(); - typename SpProxy::const_iterator_type it_end = proxy2.end(); + const SpProxy P2(x); + const SpProxy P3(y.m); + + arma_conform_assert_same_size(P2.get_n_rows(), P2.get_n_cols(), P3.get_n_rows(), P3.get_n_cols(), "element-wise multiplication"); + + out.zeros(P2.get_n_rows(), P2.get_n_cols()); + + typename SpProxy::const_iterator_type it = P2.begin(); + typename SpProxy::const_iterator_type it_end = P2.end(); const eT k = y.aux; @@ -99,7 +63,7 @@ op_sp_minus_pre::apply_inside_schur(SpMat& out, const T2& x, const SpToDOp& out, const T2& x, const SpToDOp& y) { arma_debug_sigprint(); - - const SpProxy proxy2(x); - const SpProxy proxy3(y.m); - - arma_conform_assert_same_size(proxy2.get_n_rows(), proxy2.get_n_cols(), proxy3.get_n_rows(), proxy3.get_n_cols(), "element-wise multiplication"); - - out.zeros(proxy2.get_n_rows(), proxy2.get_n_cols()); - typename SpProxy::const_iterator_type it = proxy2.begin(); - typename SpProxy::const_iterator_type it_end = proxy2.end(); + const SpProxy P2(x); + const SpProxy P3(y.m); + + arma_conform_assert_same_size(P2.get_n_rows(), P2.get_n_cols(), P3.get_n_rows(), P3.get_n_cols(), "element-wise multiplication"); + + out.zeros(P2.get_n_rows(), P2.get_n_cols()); + + typename SpProxy::const_iterator_type it = P2.begin(); + typename SpProxy::const_iterator_type it_end = P2.end(); const eT k = y.aux; @@ -130,7 +94,7 @@ op_sp_minus_pre::apply_inside_div(SpMat& out, const T2& x, const SpToDOp& out, const SpToDOp proxy(in.m); + const SpProxy P(in.m); - out.set_size(proxy.get_n_rows(), proxy.get_n_cols()); + out.set_size(P.get_n_rows(), P.get_n_cols()); out.fill(-in.aux); - typename SpProxy::const_iterator_type it = proxy.begin(); - typename SpProxy::const_iterator_type it_end = proxy.end(); - - for(; it != it_end; ++it) - { - out.at(it.row(), it.col()) += (*it); - } - } - - - -// force apply into sparse matrix -template -inline -void -op_sp_minus_post::apply(SpMat& out, const SpToDOp& in) - { - arma_debug_sigprint(); - - typedef typename T1::elem_type eT; - - // Note that T1 will be a sparse type, so we use SpProxy. - const SpProxy proxy(in.m); - - const uword n_rows = proxy.get_n_rows(); - const uword n_cols = proxy.get_n_cols(); - - out.set_size(n_rows, n_cols); - - const eT k = in.aux; - - for(uword c = 0; c < n_cols; ++c) - for(uword r = 0; r < n_rows; ++r) - { - out.at(r, c) = proxy.at(r, c) - k; - } + out += P.Q; } @@ -197,16 +125,16 @@ void op_sp_minus_post::apply_inside_schur(SpMat& out, const T2& x, const SpToDOp& y) { arma_debug_sigprint(); - - const SpProxy proxy2(x); - const SpProxy proxy3(y.m); - - arma_conform_assert_same_size(proxy2.get_n_rows(), proxy2.get_n_cols(), proxy3.get_n_rows(), proxy3.get_n_cols(), "element-wise multiplication"); - - out.zeros(proxy2.get_n_rows(), proxy2.get_n_cols()); - typename SpProxy::const_iterator_type it = proxy2.begin(); - typename SpProxy::const_iterator_type it_end = proxy2.end(); + const SpProxy P2(x); + const SpProxy P3(y.m); + + arma_conform_assert_same_size(P2.get_n_rows(), P2.get_n_cols(), P3.get_n_rows(), P3.get_n_cols(), "element-wise multiplication"); + + out.zeros(P2.get_n_rows(), P2.get_n_cols()); + + typename SpProxy::const_iterator_type it = P2.begin(); + typename SpProxy::const_iterator_type it_end = P2.end(); const eT k = y.aux; @@ -215,7 +143,7 @@ op_sp_minus_post::apply_inside_schur(SpMat& out, const T2& x, const SpToDOp< const uword it_row = it.row(); const uword it_col = it.col(); - out.at(it_row, it_col) = (*it) * (proxy3.at(it_row, it_col) - k); + out.at(it_row, it_col) = (*it) * (P3.at(it_row, it_col) - k); } } @@ -228,16 +156,16 @@ void op_sp_minus_post::apply_inside_div(SpMat& out, const T2& x, const SpToDOp& y) { arma_debug_sigprint(); - - const SpProxy proxy2(x); - const SpProxy proxy3(y.m); - - arma_conform_assert_same_size(proxy2.get_n_rows(), proxy2.get_n_cols(), proxy3.get_n_rows(), proxy3.get_n_cols(), "element-wise multiplication"); - - out.zeros(proxy2.get_n_rows(), proxy2.get_n_cols()); - typename SpProxy::const_iterator_type it = proxy2.begin(); - typename SpProxy::const_iterator_type it_end = proxy2.end(); + const SpProxy P2(x); + const SpProxy P3(y.m); + + arma_conform_assert_same_size(P2.get_n_rows(), P2.get_n_cols(), P3.get_n_rows(), P3.get_n_cols(), "element-wise multiplication"); + + out.zeros(P2.get_n_rows(), P2.get_n_cols()); + + typename SpProxy::const_iterator_type it = P2.begin(); + typename SpProxy::const_iterator_type it_end = P2.end(); const eT k = y.aux; @@ -246,7 +174,7 @@ op_sp_minus_post::apply_inside_div(SpMat& out, const T2& x, const SpToDOp + static inline void apply(Mat& out, const SpToDOp& X); + }; + + + +//! @} diff --git a/inst/include/armadillo_bits/op_sp_nonzeros_meat.hpp b/inst/include/armadillo_bits/op_sp_nonzeros_meat.hpp new file mode 100644 index 00000000..33a8e1c3 --- /dev/null +++ b/inst/include/armadillo_bits/op_sp_nonzeros_meat.hpp @@ -0,0 +1,75 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + + + +//! \addtogroup op_sp_nonzeros +//! @{ + + + +template +inline +void +op_sp_nonzeros::apply(Mat& out, const SpToDOp& X) + { + arma_debug_sigprint(); + + typedef typename T1::elem_type eT; + + const SpProxy P(X.m); + + const uword N = P.get_n_nonzero(); + + out.set_size(N,1); + + if(N == 0) { return; } + + if(is_SpMat::stored_type>::value) + { + const unwrap_spmat::stored_type> U(P.Q); + + arrayops::copy(out.memptr(), U.M.values, N); + + return; + } + + if(is_SpSubview::stored_type>::value) + { + const SpSubview& sv = reinterpret_cast< const SpSubview& >(P.Q); + + if(sv.n_rows == sv.m.n_rows) + { + const SpMat& m = sv.m; + const uword col = sv.aux_col1; + + arrayops::copy(out.memptr(), &(m.values[ m.col_ptrs[col] ]), N); + + return; + } + } + + eT* out_mem = out.memptr(); + + typename SpProxy::const_iterator_type it = P.begin(); + + for(uword i=0; i inline static void apply(Mat& out, const SpToDOp& in); - - // force apply into an SpMat<> - template - inline static void apply(SpMat& out, const SpToDOp& in); - + // used for the optimization of sparse % (sparse + scalar) template inline static void apply_inside_schur(SpMat& out, const T2& x, const SpToDOp& y); - + // used for the optimization of sparse / (sparse + scalar) template inline static void apply_inside_div(SpMat& out, const T2& x, const SpToDOp& y); diff --git a/inst/include/armadillo_bits/op_sp_plus_meat.hpp b/inst/include/armadillo_bits/op_sp_plus_meat.hpp index b5515caf..d80f2fb2 100644 --- a/inst/include/armadillo_bits/op_sp_plus_meat.hpp +++ b/inst/include/armadillo_bits/op_sp_plus_meat.hpp @@ -27,49 +27,12 @@ op_sp_plus::apply(Mat& out, const SpToDOp { arma_debug_sigprint(); - // Note that T1 will be a sparse type, so we use SpProxy. - const SpProxy proxy(in.m); + const SpProxy P(in.m); - out.set_size(proxy.get_n_rows(), proxy.get_n_cols()); + out.set_size(P.get_n_rows(), P.get_n_cols()); out.fill(in.aux); - typename SpProxy::const_iterator_type it = proxy.begin(); - typename SpProxy::const_iterator_type it_end = proxy.end(); - - for(; it != it_end; ++it) - { - out.at(it.row(), it.col()) += (*it); - } - } - - - -// force apply into sparse matrix -template -inline -void -op_sp_plus::apply(SpMat& out, const SpToDOp& in) - { - arma_debug_sigprint(); - - typedef typename T1::elem_type eT; - - // Note that T1 will be a sparse type, so we use SpProxy. - const SpProxy proxy(in.m); - - const uword n_rows = proxy.get_n_rows(); - const uword n_cols = proxy.get_n_cols(); - - out.set_size(n_rows, n_cols); - - const eT k = in.aux; - - // We have to loop over all the elements. - for(uword c = 0; c < n_cols; ++c) - for(uword r = 0; r < n_rows; ++r) - { - out.at(r, c) = proxy.at(r, c) + k; - } + out += P.Q; } @@ -81,16 +44,16 @@ void op_sp_plus::apply_inside_schur(SpMat& out, const T2& x, const SpToDOp& y) { arma_debug_sigprint(); - - const SpProxy proxy2(x); - const SpProxy proxy3(y.m); - - arma_conform_assert_same_size(proxy2.get_n_rows(), proxy2.get_n_cols(), proxy3.get_n_rows(), proxy3.get_n_cols(), "element-wise multiplication"); - - out.zeros(proxy2.get_n_rows(), proxy2.get_n_cols()); - typename SpProxy::const_iterator_type it = proxy2.begin(); - typename SpProxy::const_iterator_type it_end = proxy2.end(); + const SpProxy P2(x); + const SpProxy P3(y.m); + + arma_conform_assert_same_size(P2.get_n_rows(), P2.get_n_cols(), P3.get_n_rows(), P3.get_n_cols(), "element-wise multiplication"); + + out.zeros(P2.get_n_rows(), P2.get_n_cols()); + + typename SpProxy::const_iterator_type it = P2.begin(); + typename SpProxy::const_iterator_type it_end = P2.end(); const eT k = y.aux; @@ -99,7 +62,7 @@ op_sp_plus::apply_inside_schur(SpMat& out, const T2& x, const SpToDOp& out, const T2& x, const SpToDOp& y) { arma_debug_sigprint(); - - const SpProxy proxy2(x); - const SpProxy proxy3(y.m); - - arma_conform_assert_same_size(proxy2.get_n_rows(), proxy2.get_n_cols(), proxy3.get_n_rows(), proxy3.get_n_cols(), "element-wise division"); - - out.zeros(proxy2.get_n_rows(), proxy2.get_n_cols()); - typename SpProxy::const_iterator_type it = proxy2.begin(); - typename SpProxy::const_iterator_type it_end = proxy2.end(); + const SpProxy P2(x); + const SpProxy P3(y.m); + + arma_conform_assert_same_size(P2.get_n_rows(), P2.get_n_cols(), P3.get_n_rows(), P3.get_n_cols(), "element-wise division"); + + out.zeros(P2.get_n_rows(), P2.get_n_cols()); + + typename SpProxy::const_iterator_type it = P2.begin(); + typename SpProxy::const_iterator_type it_end = P2.end(); const eT k = y.aux; @@ -130,7 +93,7 @@ op_sp_plus::apply_inside_div(SpMat& out, const T2& x, const SpToDOp - inline static void apply(Mat& out, const mtSpToDOp& in); + inline static void apply(Mat& out, const mtSpReduceOp& in); template inline static void apply_slow(Mat& out, const SpProxy& p, const uword norm_type, const uword dim); diff --git a/inst/include/armadillo_bits/op_sp_stddev_meat.hpp b/inst/include/armadillo_bits/op_sp_stddev_meat.hpp index 52b3d313..56521a1e 100644 --- a/inst/include/armadillo_bits/op_sp_stddev_meat.hpp +++ b/inst/include/armadillo_bits/op_sp_stddev_meat.hpp @@ -24,7 +24,7 @@ template inline void -op_sp_stddev::apply(Mat& out, const mtSpToDOp& in) +op_sp_stddev::apply(Mat& out, const mtSpReduceOp& in) { arma_debug_sigprint(); diff --git a/inst/include/armadillo_bits/op_sp_sum_bones.hpp b/inst/include/armadillo_bits/op_sp_sum_bones.hpp index 0f5c0c65..8c9c67a0 100644 --- a/inst/include/armadillo_bits/op_sp_sum_bones.hpp +++ b/inst/include/armadillo_bits/op_sp_sum_bones.hpp @@ -26,7 +26,7 @@ class op_sp_sum public: template - inline static void apply(Mat& out, const SpToDOp& in); + inline static void apply(Mat& out, const mtSpReduceOp& in); }; diff --git a/inst/include/armadillo_bits/op_sp_sum_meat.hpp b/inst/include/armadillo_bits/op_sp_sum_meat.hpp index f60879d3..8e9a22da 100644 --- a/inst/include/armadillo_bits/op_sp_sum_meat.hpp +++ b/inst/include/armadillo_bits/op_sp_sum_meat.hpp @@ -24,7 +24,7 @@ template inline void -op_sp_sum::apply(Mat& out, const SpToDOp& in) +op_sp_sum::apply(Mat& out, const mtSpReduceOp& in) { arma_debug_sigprint(); diff --git a/inst/include/armadillo_bits/op_sp_var_bones.hpp b/inst/include/armadillo_bits/op_sp_var_bones.hpp index 69a29e5e..bdcd9b24 100644 --- a/inst/include/armadillo_bits/op_sp_var_bones.hpp +++ b/inst/include/armadillo_bits/op_sp_var_bones.hpp @@ -28,7 +28,7 @@ class op_sp_var public: template - inline static void apply(Mat& out, const mtSpToDOp& in); + inline static void apply(Mat& out, const mtSpReduceOp& in); template inline static void apply_slow(Mat& out, const SpProxy& p, const uword norm_type, const uword dim); diff --git a/inst/include/armadillo_bits/op_sp_var_meat.hpp b/inst/include/armadillo_bits/op_sp_var_meat.hpp index 68f1dd94..8c5cdff8 100644 --- a/inst/include/armadillo_bits/op_sp_var_meat.hpp +++ b/inst/include/armadillo_bits/op_sp_var_meat.hpp @@ -24,7 +24,7 @@ template inline void -op_sp_var::apply(Mat& out, const mtSpToDOp& in) +op_sp_var::apply(Mat& out, const mtSpReduceOp& in) { arma_debug_sigprint(); diff --git a/inst/include/armadillo_bits/op_sp_vecnorm_bones.hpp b/inst/include/armadillo_bits/op_sp_vecnorm_bones.hpp index e049da35..aadf943b 100644 --- a/inst/include/armadillo_bits/op_sp_vecnorm_bones.hpp +++ b/inst/include/armadillo_bits/op_sp_vecnorm_bones.hpp @@ -26,7 +26,7 @@ class op_sp_vecnorm public: template - inline static void apply(Mat& out, const mtSpToDOp& expr); + inline static void apply(Mat& out, const mtSpReduceOp& expr); template inline static void apply_direct(Mat< typename get_pod_type::result >& out, const SpMat& X, const uword k); @@ -42,7 +42,7 @@ class op_sp_vecnorm_ext public: template - inline static void apply(Mat& out, const mtSpToDOp& expr); + inline static void apply(Mat& out, const mtSpReduceOp& expr); template inline static void apply_direct(Mat< typename get_pod_type::result >& out, const SpMat& X, const uword method_id); diff --git a/inst/include/armadillo_bits/op_sp_vecnorm_meat.hpp b/inst/include/armadillo_bits/op_sp_vecnorm_meat.hpp index 43e121c9..e5cfab2b 100644 --- a/inst/include/armadillo_bits/op_sp_vecnorm_meat.hpp +++ b/inst/include/armadillo_bits/op_sp_vecnorm_meat.hpp @@ -24,7 +24,7 @@ template inline void -op_sp_vecnorm::apply(Mat& out, const mtSpToDOp& expr) +op_sp_vecnorm::apply(Mat& out, const mtSpReduceOp& expr) { arma_debug_sigprint(); @@ -110,7 +110,7 @@ op_sp_vecnorm::apply_direct(Mat< typename get_pod_type::result >& out, const template inline void -op_sp_vecnorm_ext::apply(Mat& out, const mtSpToDOp& expr) +op_sp_vecnorm_ext::apply(Mat& out, const mtSpReduceOp& expr) { arma_debug_sigprint(); diff --git a/inst/include/armadillo_bits/op_sqrtmat_meat.hpp b/inst/include/armadillo_bits/op_sqrtmat_meat.hpp index 97c54b31..0313d600 100644 --- a/inst/include/armadillo_bits/op_sqrtmat_meat.hpp +++ b/inst/include/armadillo_bits/op_sqrtmat_meat.hpp @@ -482,7 +482,7 @@ op_sqrtmat_sympd::apply_direct(Mat& out, const Base::yes) && (sym_helper::check_diag_imag(X) == false)) + if((arma_config::check_conform) && (is_cx::yes) && (sym_helper::check_diag_imag(X) == false)) { arma_conform_warn(1, "sqrtmat_sympd(): imaginary components on the diagonal are non-zero"); } diff --git a/inst/include/armadillo_bits/sp_auxlib_meat.hpp b/inst/include/armadillo_bits/sp_auxlib_meat.hpp index f6ba4d17..8da4a71b 100644 --- a/inst/include/armadillo_bits/sp_auxlib_meat.hpp +++ b/inst/include/armadillo_bits/sp_auxlib_meat.hpp @@ -67,7 +67,7 @@ sp_auxlib::eigs_sym(Col& eigval, Mat& eigvec, const SpBase& X, c arma_conform_check( (U.M.is_square() == false), "eigs_sym(): given matrix must be square sized" ); - if((arma_config::check_conformance) && (sp_auxlib::rudimentary_sym_check(U.M) == false)) + if((arma_config::check_conform) && (sp_auxlib::rudimentary_sym_check(U.M) == false)) { if(is_cx::no ) { arma_conform_warn(1, "eigs_sym(): given matrix is not symmetric"); } if(is_cx::yes) { arma_conform_warn(1, "eigs_sym(): given matrix is not hermitian"); } @@ -120,7 +120,7 @@ sp_auxlib::eigs_sym(Col& eigval, Mat& eigvec, const SpBase& X, c arma_conform_check( (U.M.is_square() == false), "eigs_sym(): given matrix must be square sized" ); - if((arma_config::check_conformance) && (sp_auxlib::rudimentary_sym_check(U.M) == false)) + if((arma_config::check_conform) && (sp_auxlib::rudimentary_sym_check(U.M) == false)) { if(is_cx::no ) { arma_conform_warn(1, "eigs_sym(): given matrix is not symmetric"); } if(is_cx::yes) { arma_conform_warn(1, "eigs_sym(): given matrix is not hermitian"); } @@ -1202,7 +1202,7 @@ sp_auxlib::spsolve_simple(Mat& X, const SpBase& X, typename T1::pod_type& return false; } - if(arma_config::check_conformance) + if(arma_config::check_conform) { bool overflow; diff --git a/inst/include/armadillo_bits/subview_cube_each_meat.hpp b/inst/include/armadillo_bits/subview_cube_each_meat.hpp index edac828c..96b3d582 100644 --- a/inst/include/armadillo_bits/subview_cube_each_meat.hpp +++ b/inst/include/armadillo_bits/subview_cube_each_meat.hpp @@ -40,7 +40,7 @@ inline void subview_cube_each_common::check_size(const Mat& A) const { - if(arma_config::check_conformance) + if(arma_config::check_conform) { if( (A.n_rows != P.n_rows) || (A.n_cols != P.n_cols) ) { diff --git a/inst/include/armadillo_bits/subview_cube_meat.hpp b/inst/include/armadillo_bits/subview_cube_meat.hpp index 6edd431b..c90d20ae 100644 --- a/inst/include/armadillo_bits/subview_cube_meat.hpp +++ b/inst/include/armadillo_bits/subview_cube_meat.hpp @@ -560,7 +560,7 @@ subview_cube::operator= (const Base& in) } else { - if(arma_config::check_conformance) + if(arma_config::check_conform) { arma_stop_logic_error( arma_incompat_size_string(t, x, "copy into subcube") ); } @@ -663,7 +663,7 @@ subview_cube::operator+= (const Base& in) } else { - if(arma_config::check_conformance) + if(arma_config::check_conform) { arma_stop_logic_error( arma_incompat_size_string(t, x, "addition") ); } @@ -766,7 +766,7 @@ subview_cube::operator-= (const Base& in) } else { - if(arma_config::check_conformance) + if(arma_config::check_conform) { arma_stop_logic_error( arma_incompat_size_string(t, x, "subtraction") ); } @@ -869,7 +869,7 @@ subview_cube::operator%= (const Base& in) } else { - if(arma_config::check_conformance) + if(arma_config::check_conform) { arma_stop_logic_error( arma_incompat_size_string(t, x, "element-wise multiplication") ); } @@ -972,7 +972,7 @@ subview_cube::operator/= (const Base& in) } else { - if(arma_config::check_conformance) + if(arma_config::check_conform) { arma_stop_logic_error( arma_incompat_size_string(t, x, "element-wise division") ); } @@ -1947,7 +1947,7 @@ subview_cube::plus_inplace(Mat& out, const subview_cube& in) if(in_n_slices == 1) { - if( (arma_config::check_conformance) && ((out_n_rows != in_n_rows) || (out_n_cols != in_n_cols)) ) + if( (arma_config::check_conform) && ((out_n_rows != in_n_rows) || (out_n_cols != in_n_cols)) ) { std::ostringstream tmp; @@ -2048,7 +2048,7 @@ subview_cube::minus_inplace(Mat& out, const subview_cube& in) if(in_n_slices == 1) { - if( (arma_config::check_conformance) && ((out_n_rows != in_n_rows) || (out_n_cols != in_n_cols)) ) + if( (arma_config::check_conform) && ((out_n_rows != in_n_rows) || (out_n_cols != in_n_cols)) ) { std::ostringstream tmp; @@ -2149,7 +2149,7 @@ subview_cube::schur_inplace(Mat& out, const subview_cube& in) if(in_n_slices == 1) { - if( (arma_config::check_conformance) && ((out_n_rows != in_n_rows) || (out_n_cols != in_n_cols)) ) + if( (arma_config::check_conform) && ((out_n_rows != in_n_rows) || (out_n_cols != in_n_cols)) ) { std::ostringstream tmp; @@ -2250,7 +2250,7 @@ subview_cube::div_inplace(Mat& out, const subview_cube& in) if(in_n_slices == 1) { - if( (arma_config::check_conformance) && ((out_n_rows != in_n_rows) || (out_n_cols != in_n_cols)) ) + if( (arma_config::check_conform) && ((out_n_rows != in_n_rows) || (out_n_cols != in_n_cols)) ) { std::ostringstream tmp; diff --git a/inst/include/armadillo_bits/subview_each_meat.hpp b/inst/include/armadillo_bits/subview_each_meat.hpp index fca7b7c7..b905eeb8 100644 --- a/inst/include/armadillo_bits/subview_each_meat.hpp +++ b/inst/include/armadillo_bits/subview_each_meat.hpp @@ -70,7 +70,7 @@ inline void subview_each_common::check_size(const Mat& A) const { - if(arma_config::check_conformance) + if(arma_config::check_conform) { if(mode == 0) { diff --git a/inst/include/armadillo_bits/traits.hpp b/inst/include/armadillo_bits/traits.hpp index 9ccc5eaa..5318ef9f 100644 --- a/inst/include/armadillo_bits/traits.hpp +++ b/inst/include/armadillo_bits/traits.hpp @@ -342,19 +342,6 @@ struct is_SpToDOp< const SpToDOp > { static constexpr bool value = true; }; -template -struct is_mtSpToDOp - { static constexpr bool value = false; }; - -template -struct is_mtSpToDOp< mtSpToDOp > - { static constexpr bool value = true; }; - -template -struct is_mtSpToDOp< const mtSpToDOp > - { static constexpr bool value = true; }; - - template struct is_SpToDGlue { static constexpr bool value = false; }; @@ -570,7 +557,6 @@ struct is_arma_type2 || is_CubeToMatOp::value || is_SpToDOp::value || is_SpToDGlue::value - || is_mtSpToDOp::value ; }; @@ -731,6 +717,15 @@ struct is_mtSpGlue< mtSpGlue > { static constexpr bool value = true; }; +template +struct is_mtSpReduceOp + { static constexpr bool value = false; }; + +template +struct is_mtSpReduceOp< mtSpReduceOp > + { static constexpr bool value = true; }; + + template struct is_arma_sparse_type @@ -746,6 +741,7 @@ struct is_arma_sparse_type || is_SpGlue::value || is_mtSpOp::value || is_mtSpGlue::value + || is_mtSpReduceOp::value ; }; diff --git a/inst/include/armadillo_bits/unwrap.hpp b/inst/include/armadillo_bits/unwrap.hpp index 5f2009b6..9418b4c6 100644 --- a/inst/include/armadillo_bits/unwrap.hpp +++ b/inst/include/armadillo_bits/unwrap.hpp @@ -807,24 +807,22 @@ struct quasi_unwrap< CubeToMatOp > -template -struct quasi_unwrap< SpToDOp > +template +struct quasi_unwrap< SpToDOp, op_sp_nonzeros> > { - typedef typename T1::elem_type eT; - inline - quasi_unwrap(const SpToDOp& A) - : U( A.m ) - , M( const_cast(U.M.values), U.M.n_nonzero, 1, false, true ) + quasi_unwrap(const SpToDOp, op_sp_nonzeros>& A) + : orig( A.m ) + , M( const_cast(orig.values), orig.n_nonzero, 1, false, true ) { arma_debug_sigprint(); } - const unwrap_spmat U; - const Mat M; + const SpMat& orig; + const Mat M; static constexpr bool is_const = true; - static constexpr bool has_subview = true; + static constexpr bool has_subview = false; static constexpr bool has_orig_mem = true; template diff --git a/inst/include/armadillo_bits/unwrap_spmat.hpp b/inst/include/armadillo_bits/unwrap_spmat.hpp index 2290bd9d..460b9621 100644 --- a/inst/include/armadillo_bits/unwrap_spmat.hpp +++ b/inst/include/armadillo_bits/unwrap_spmat.hpp @@ -193,4 +193,24 @@ struct unwrap_spmat< mtSpGlue > +template +struct unwrap_spmat< mtSpReduceOp > + { + typedef SpMat stored_type; + + inline + unwrap_spmat(const mtSpReduceOp& A) + : M(A) + { + arma_debug_sigprint(); + } + + const SpMat M; + + template + constexpr bool is_alias(const SpMat&) const { return false; } + }; + + + //! @} diff --git a/inst/include/armadillo_bits/wall_clock_meat.hpp b/inst/include/armadillo_bits/wall_clock_meat.hpp index 9f6459ab..1e2eebf5 100644 --- a/inst/include/armadillo_bits/wall_clock_meat.hpp +++ b/inst/include/armadillo_bits/wall_clock_meat.hpp @@ -44,9 +44,9 @@ wall_clock::tic() { arma_debug_sigprint(); - chrono_time1 = std::chrono::steady_clock::now(); - valid = true; + + chrono_time1 = std::chrono::steady_clock::now(); } From ecbd7d2d1a1870fd257ccc3c26d9ad3a56987439 Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Fri, 21 Jun 2024 11:25:33 -0500 Subject: [PATCH 5/7] Another Armadillo 14.0.0 rc update --- DESCRIPTION | 4 +- inst/include/armadillo | 2 + inst/include/armadillo_bits/BaseCube_meat.hpp | 8 +- inst/include/armadillo_bits/Base_meat.hpp | 8 +- inst/include/armadillo_bits/Cube_meat.hpp | 28 +- inst/include/armadillo_bits/Mat_meat.hpp | 42 +- inst/include/armadillo_bits/SpBase_meat.hpp | 8 +- inst/include/armadillo_bits/SpMat_meat.hpp | 42 +- inst/include/armadillo_bits/SpProxy.hpp | 12 +- inst/include/armadillo_bits/arma_forward.hpp | 11 + inst/include/armadillo_bits/auxlib_meat.hpp | 12 +- .../include/armadillo_bits/compiler_setup.hpp | 3 +- inst/include/armadillo_bits/debug.hpp | 2 - inst/include/armadillo_bits/diskio_meat.hpp | 4 +- inst/include/armadillo_bits/eop_aux.hpp | 16 +- inst/include/armadillo_bits/field_meat.hpp | 16 +- inst/include/armadillo_bits/fn_accu.hpp | 241 ++++++-- inst/include/armadillo_bits/fn_chol.hpp | 8 +- inst/include/armadillo_bits/fn_det.hpp | 2 +- inst/include/armadillo_bits/fn_eig_gen.hpp | 14 +- inst/include/armadillo_bits/fn_eig_pair.hpp | 6 +- inst/include/armadillo_bits/fn_eig_sym.hpp | 8 +- inst/include/armadillo_bits/fn_eigs_gen.hpp | 12 +- inst/include/armadillo_bits/fn_eigs_sym.hpp | 8 +- inst/include/armadillo_bits/fn_expmat.hpp | 4 +- inst/include/armadillo_bits/fn_hess.hpp | 4 +- inst/include/armadillo_bits/fn_inv.hpp | 6 +- inst/include/armadillo_bits/fn_inv_sympd.hpp | 6 +- inst/include/armadillo_bits/fn_log_det.hpp | 4 +- inst/include/armadillo_bits/fn_logmat.hpp | 6 +- inst/include/armadillo_bits/fn_lu.hpp | 4 +- inst/include/armadillo_bits/fn_mvnrnd.hpp | 4 +- inst/include/armadillo_bits/fn_orth_null.hpp | 4 +- inst/include/armadillo_bits/fn_pinv.hpp | 2 +- inst/include/armadillo_bits/fn_polyfit.hpp | 2 +- inst/include/armadillo_bits/fn_powmat.hpp | 4 +- inst/include/armadillo_bits/fn_princomp.hpp | 8 +- inst/include/armadillo_bits/fn_qr.hpp | 6 +- inst/include/armadillo_bits/fn_qz.hpp | 2 +- inst/include/armadillo_bits/fn_roots.hpp | 2 +- inst/include/armadillo_bits/fn_schur.hpp | 4 +- inst/include/armadillo_bits/fn_solve.hpp | 8 +- inst/include/armadillo_bits/fn_spsolve.hpp | 10 +- inst/include/armadillo_bits/fn_sqrtmat.hpp | 6 +- inst/include/armadillo_bits/fn_svd.hpp | 6 +- inst/include/armadillo_bits/fn_svds.hpp | 8 +- inst/include/armadillo_bits/fn_sylvester.hpp | 2 +- inst/include/armadillo_bits/fn_wishrnd.hpp | 8 +- .../armadillo_bits/glue_mvnrnd_meat.hpp | 2 +- .../armadillo_bits/glue_solve_meat.hpp | 28 +- .../armadillo_bits/glue_times_meat.hpp | 16 +- inst/include/armadillo_bits/gmm_diag_meat.hpp | 28 +- inst/include/armadillo_bits/gmm_full_meat.hpp | 20 +- inst/include/armadillo_bits/mtSpOp_bones.hpp | 2 + inst/include/armadillo_bits/mtSpOp_meat.hpp | 11 + .../armadillo_bits/mtSpToDOp_bones.hpp | 49 -- .../include/armadillo_bits/mtSpToDOp_meat.hpp | 55 -- .../newarp_SparseGenRealShiftSolve_meat.hpp | 6 +- inst/include/armadillo_bits/op_chol_meat.hpp | 4 +- inst/include/armadillo_bits/op_cond_meat.hpp | 6 +- .../include/armadillo_bits/op_expmat_meat.hpp | 2 +- inst/include/armadillo_bits/op_find_meat.hpp | 10 +- .../armadillo_bits/op_inv_spd_meat.hpp | 12 +- .../armadillo_bits/op_log_det_meat.hpp | 6 +- .../include/armadillo_bits/op_logmat_meat.hpp | 4 +- .../armadillo_bits/op_norm2est_meat.hpp | 4 +- inst/include/armadillo_bits/op_norm_meat.hpp | 2 +- .../armadillo_bits/op_sqrtmat_meat.hpp | 6 +- .../include/armadillo_bits/operator_minus.hpp | 45 +- .../armadillo_bits/operator_relational.hpp | 222 ++++++++ inst/include/armadillo_bits/restrictors.hpp | 15 + .../armadillo_bits/running_stat_meat.hpp | 4 +- .../armadillo_bits/running_stat_vec_meat.hpp | 4 +- .../include/armadillo_bits/sp_auxlib_meat.hpp | 90 +-- .../armadillo_bits/spdiagview_meat.hpp | 2 +- .../armadillo_bits/spop_relational_bones.hpp | 134 +++++ .../armadillo_bits/spop_relational_meat.hpp | 521 ++++++++++++++++++ .../spsolve_factoriser_meat.hpp | 16 +- .../armadillo_bits/subview_cube_meat.hpp | 8 +- inst/include/armadillo_bits/subview_meat.hpp | 8 +- inst/include/armadillo_bits/unwrap.hpp | 24 +- inst/include/armadillo_bits/unwrap_spmat.hpp | 6 +- 82 files changed, 1512 insertions(+), 497 deletions(-) delete mode 100644 inst/include/armadillo_bits/mtSpToDOp_bones.hpp delete mode 100644 inst/include/armadillo_bits/mtSpToDOp_meat.hpp create mode 100644 inst/include/armadillo_bits/spop_relational_bones.hpp create mode 100644 inst/include/armadillo_bits/spop_relational_meat.hpp diff --git a/DESCRIPTION b/DESCRIPTION index c6888665..01947570 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: RcppArmadillo Type: Package Title: 'Rcpp' Integration for the 'Armadillo' Templated Linear Algebra Library -Version: 0.12.8.4.0.14.0 -Date: 2024-06-10 +Version: 0.12.8.4.0.14.3 +Date: 2024-06-21 Author: Dirk Eddelbuettel, Romain Francois, Doug Bates, Binxiang Ni, and Conrad Sanderson Maintainer: Dirk Eddelbuettel Description: 'Armadillo' is a templated C++ linear algebra library (by Conrad diff --git a/inst/include/armadillo b/inst/include/armadillo index f64d93d9..7b2790dc 100644 --- a/inst/include/armadillo +++ b/inst/include/armadillo @@ -375,6 +375,7 @@ namespace arma #include "armadillo_bits/spop_vectorise_bones.hpp" #include "armadillo_bits/spop_norm_bones.hpp" #include "armadillo_bits/spop_shift_bones.hpp" + #include "armadillo_bits/spop_relational_bones.hpp" #include "armadillo_bits/spglue_plus_bones.hpp" #include "armadillo_bits/spglue_minus_bones.hpp" @@ -828,6 +829,7 @@ namespace arma #include "armadillo_bits/spop_vectorise_meat.hpp" #include "armadillo_bits/spop_norm_meat.hpp" #include "armadillo_bits/spop_shift_meat.hpp" + #include "armadillo_bits/spop_relational_meat.hpp" #include "armadillo_bits/spglue_plus_meat.hpp" #include "armadillo_bits/spglue_minus_meat.hpp" diff --git a/inst/include/armadillo_bits/BaseCube_meat.hpp b/inst/include/armadillo_bits/BaseCube_meat.hpp index b521629f..7fbf7f67 100644 --- a/inst/include/armadillo_bits/BaseCube_meat.hpp +++ b/inst/include/armadillo_bits/BaseCube_meat.hpp @@ -308,7 +308,7 @@ BaseCube::is_finite() const { arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_conform_warn(1, "is_finite(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_warn(1, "is_finite(): detection of non-finite values is not reliable in fast math mode"); } if(is_Cube::stored_type>::value) { @@ -344,7 +344,7 @@ BaseCube::has_inf() const { arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_inf(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_warn(1, "has_inf(): detection of non-finite values is not reliable in fast math mode"); } if(is_Cube::stored_type>::value) { @@ -380,7 +380,7 @@ BaseCube::has_nan() const { arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_nan(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_warn(1, "has_nan(): detection of non-finite values is not reliable in fast math mode"); } if(is_Cube::stored_type>::value) { @@ -416,7 +416,7 @@ BaseCube::has_nonfinite() const { arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_nonfinite(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_warn(1, "has_nonfinite(): detection of non-finite values is not reliable in fast math mode"); } if(is_Cube::stored_type>::value) { diff --git a/inst/include/armadillo_bits/Base_meat.hpp b/inst/include/armadillo_bits/Base_meat.hpp index 85fd36e0..bc48d363 100644 --- a/inst/include/armadillo_bits/Base_meat.hpp +++ b/inst/include/armadillo_bits/Base_meat.hpp @@ -665,7 +665,7 @@ Base::is_finite() const { arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_conform_warn(1, "is_finite(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_warn(1, "is_finite(): detection of non-finite values is not reliable in fast math mode"); } if(is_Mat::stored_type>::value) { @@ -713,7 +713,7 @@ Base::has_inf() const { arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_inf(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_warn(1, "has_inf(): detection of non-finite values is not reliable in fast math mode"); } if(is_Mat::stored_type>::value) { @@ -761,7 +761,7 @@ Base::has_nan() const { arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_nan(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_warn(1, "has_nan(): detection of non-finite values is not reliable in fast math mode"); } if(is_Mat::stored_type>::value) { @@ -809,7 +809,7 @@ Base::has_nonfinite() const { arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_nonfinite(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_warn(1, "has_nonfinite(): detection of non-finite values is not reliable in fast math mode"); } if(is_Mat::stored_type>::value) { diff --git a/inst/include/armadillo_bits/Cube_meat.hpp b/inst/include/armadillo_bits/Cube_meat.hpp index 9256a453..3caa0153 100644 --- a/inst/include/armadillo_bits/Cube_meat.hpp +++ b/inst/include/armadillo_bits/Cube_meat.hpp @@ -4574,11 +4574,11 @@ Cube::save(const std::string name, const file_type type) const break; default: - arma_conform_warn(1, "Cube::save(): unsupported file type"); + arma_warn(1, "Cube::save(): unsupported file type"); save_okay = false; } - if(save_okay == false) { arma_conform_warn(3, "Cube::save(): write failed; file: ", name); } + if(save_okay == false) { arma_warn(3, "Cube::save(): write failed; file: ", name); } return save_okay; } @@ -4630,11 +4630,11 @@ Cube::save(const hdf5_name& spec, const file_type type) const { if(err_msg.length() > 0) { - arma_conform_warn(3, "Cube::save(): ", err_msg, "; file: ", spec.filename); + arma_warn(3, "Cube::save(): ", err_msg, "; file: ", spec.filename); } else { - arma_conform_warn(3, "Cube::save(): write failed; file: ", spec.filename); + arma_warn(3, "Cube::save(): write failed; file: ", spec.filename); } } @@ -4676,11 +4676,11 @@ Cube::save(std::ostream& os, const file_type type) const break; default: - arma_conform_warn(1, "Cube::save(): unsupported file type"); + arma_warn(1, "Cube::save(): unsupported file type"); save_okay = false; } - if(save_okay == false) { arma_conform_warn(3, "Cube::save(): stream write failed"); } + if(save_okay == false) { arma_warn(3, "Cube::save(): stream write failed"); } return save_okay; } @@ -4733,7 +4733,7 @@ Cube::load(const std::string name, const file_type type) break; default: - arma_conform_warn(1, "Cube::load(): unsupported file type"); + arma_warn(1, "Cube::load(): unsupported file type"); load_okay = false; } @@ -4743,11 +4743,11 @@ Cube::load(const std::string name, const file_type type) if(err_msg.length() > 0) { - arma_conform_warn(3, "Cube::load(): ", err_msg, "; file: ", name); + arma_warn(3, "Cube::load(): ", err_msg, "; file: ", name); } else { - arma_conform_warn(3, "Cube::load(): read failed; file: ", name); + arma_warn(3, "Cube::load(): read failed; file: ", name); } } @@ -4794,11 +4794,11 @@ Cube::load(const hdf5_name& spec, const file_type type) if(err_msg.length() > 0) { - arma_conform_warn(3, "Cube::load(): ", err_msg, "; file: ", spec.filename); + arma_warn(3, "Cube::load(): ", err_msg, "; file: ", spec.filename); } else { - arma_conform_warn(3, "Cube::load(): read failed; file: ", spec.filename); + arma_warn(3, "Cube::load(): read failed; file: ", spec.filename); } } @@ -4845,7 +4845,7 @@ Cube::load(std::istream& is, const file_type type) break; default: - arma_conform_warn(1, "Cube::load(): unsupported file type"); + arma_warn(1, "Cube::load(): unsupported file type"); load_okay = false; } @@ -4855,11 +4855,11 @@ Cube::load(std::istream& is, const file_type type) if(err_msg.length() > 0) { - arma_conform_warn(3, "Cube::load(): ", err_msg); + arma_warn(3, "Cube::load(): ", err_msg); } else { - arma_conform_warn(3, "Cube::load(): stream read failed"); + arma_warn(3, "Cube::load(): stream read failed"); } } diff --git a/inst/include/armadillo_bits/Mat_meat.hpp b/inst/include/armadillo_bits/Mat_meat.hpp index 54ed5094..3afe3536 100644 --- a/inst/include/armadillo_bits/Mat_meat.hpp +++ b/inst/include/armadillo_bits/Mat_meat.hpp @@ -7891,11 +7891,11 @@ Mat::save(const std::string name, const file_type type) const break; default: - arma_conform_warn(1, "Mat::save(): unsupported file type"); + arma_warn(1, "Mat::save(): unsupported file type"); save_okay = false; } - if(save_okay == false) { arma_conform_warn(3, "Mat::save(): write failed; file: ", name); } + if(save_okay == false) { arma_warn(3, "Mat::save(): write failed; file: ", name); } return save_okay; } @@ -7948,11 +7948,11 @@ Mat::save(const hdf5_name& spec, const file_type type) const { if(err_msg.length() > 0) { - arma_conform_warn(3, "Mat::save(): ", err_msg, "; file: ", spec.filename); + arma_warn(3, "Mat::save(): ", err_msg, "; file: ", spec.filename); } else { - arma_conform_warn(3, "Mat::save(): write failed; file: ", spec.filename); + arma_warn(3, "Mat::save(): write failed; file: ", spec.filename); } } @@ -7992,7 +7992,7 @@ Mat::save(const csv_name& spec, const file_type type) const { if( (spec.header_ro.n_cols != 1) && (spec.header_ro.n_rows != 1) ) { - arma_conform_warn(1, "Mat::save(): given header must have a vector layout"); + arma_warn(1, "Mat::save(): given header must have a vector layout"); return false; } @@ -8002,7 +8002,7 @@ Mat::save(const csv_name& spec, const file_type type) const if(token.find(separator) != std::string::npos) { - arma_conform_warn(1, "Mat::save(): token within the header contains the separator character: '", token, "'"); + arma_warn(1, "Mat::save(): token within the header contains the separator character: '", token, "'"); return false; } } @@ -8011,7 +8011,7 @@ Mat::save(const csv_name& spec, const file_type type) const if(spec.header_ro.n_elem != save_n_cols) { - arma_conform_warn(1, "Mat::save(): size mismatch between header and matrix"); + arma_warn(1, "Mat::save(): size mismatch between header and matrix"); return false; } } @@ -8029,7 +8029,7 @@ Mat::save(const csv_name& spec, const file_type type) const save_okay = diskio::save_csv_ascii(*this, spec.filename, spec.header_ro, with_header, separator); } - if(save_okay == false) { arma_conform_warn(3, "Mat::save(): write failed; file: ", spec.filename); } + if(save_okay == false) { arma_warn(3, "Mat::save(): write failed; file: ", spec.filename); } return save_okay; } @@ -8081,11 +8081,11 @@ Mat::save(std::ostream& os, const file_type type) const break; default: - arma_conform_warn(1, "Mat::save(): unsupported file type"); + arma_warn(1, "Mat::save(): unsupported file type"); save_okay = false; } - if(save_okay == false) { arma_conform_warn(3, "Mat::save(): stream write failed"); } + if(save_okay == false) { arma_warn(3, "Mat::save(): stream write failed"); } return save_okay; } @@ -8150,7 +8150,7 @@ Mat::load(const std::string name, const file_type type) break; default: - arma_conform_warn(1, "Mat::load(): unsupported file type"); + arma_warn(1, "Mat::load(): unsupported file type"); load_okay = false; } @@ -8158,11 +8158,11 @@ Mat::load(const std::string name, const file_type type) { if(err_msg.length() > 0) { - arma_conform_warn(3, "Mat::load(): ", err_msg, "; file: ", name); + arma_warn(3, "Mat::load(): ", err_msg, "; file: ", name); } else { - arma_conform_warn(3, "Mat::load(): read failed; file: ", name); + arma_warn(3, "Mat::load(): read failed; file: ", name); } } @@ -8209,11 +8209,11 @@ Mat::load(const hdf5_name& spec, const file_type type) { if(err_msg.length() > 0) { - arma_conform_warn(3, "Mat::load(): ", err_msg, "; file: ", spec.filename); + arma_warn(3, "Mat::load(): ", err_msg, "; file: ", spec.filename); } else { - arma_conform_warn(3, "Mat::load(): read failed; file: ", spec.filename); + arma_warn(3, "Mat::load(): read failed; file: ", spec.filename); } } @@ -8282,11 +8282,11 @@ Mat::load(const csv_name& spec, const file_type type) { if(err_msg.length() > 0) { - arma_conform_warn(3, "Mat::load(): ", err_msg, "; file: ", spec.filename); + arma_warn(3, "Mat::load(): ", err_msg, "; file: ", spec.filename); } else { - arma_conform_warn(3, "Mat::load(): read failed; file: ", spec.filename); + arma_warn(3, "Mat::load(): read failed; file: ", spec.filename); } } else @@ -8295,7 +8295,7 @@ Mat::load(const csv_name& spec, const file_type type) if(with_header && (spec.header_rw.n_elem != load_n_cols)) { - arma_conform_warn(3, "Mat::load(): size mismatch between header and matrix"); + arma_warn(3, "Mat::load(): size mismatch between header and matrix"); } } @@ -8361,7 +8361,7 @@ Mat::load(std::istream& is, const file_type type) break; default: - arma_conform_warn(1, "Mat::load(): unsupported file type"); + arma_warn(1, "Mat::load(): unsupported file type"); load_okay = false; } @@ -8369,11 +8369,11 @@ Mat::load(std::istream& is, const file_type type) { if(err_msg.length() > 0) { - arma_conform_warn(3, "Mat::load(): ", err_msg); + arma_warn(3, "Mat::load(): ", err_msg); } else { - arma_conform_warn(3, "Mat::load(): stream read failed"); + arma_warn(3, "Mat::load(): stream read failed"); } } diff --git a/inst/include/armadillo_bits/SpBase_meat.hpp b/inst/include/armadillo_bits/SpBase_meat.hpp index 01cfb692..d96cd051 100644 --- a/inst/include/armadillo_bits/SpBase_meat.hpp +++ b/inst/include/armadillo_bits/SpBase_meat.hpp @@ -731,7 +731,7 @@ SpBase::is_finite() const { arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_conform_warn(1, "is_finite(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_warn(1, "is_finite(): detection of non-finite values is not reliable in fast math mode"); } if(is_SpMat::stored_type>::value) { @@ -765,7 +765,7 @@ SpBase::has_inf() const { arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_inf(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_warn(1, "has_inf(): detection of non-finite values is not reliable in fast math mode"); } if(is_SpMat::stored_type>::value) { @@ -799,7 +799,7 @@ SpBase::has_nan() const { arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_nan(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_warn(1, "has_nan(): detection of non-finite values is not reliable in fast math mode"); } if(is_SpMat::stored_type>::value) { @@ -833,7 +833,7 @@ SpBase::has_nonfinite() const { arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_nonfinite(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_warn(1, "has_nonfinite(): detection of non-finite values is not reliable in fast math mode"); } if(is_SpMat::stored_type>::value) { diff --git a/inst/include/armadillo_bits/SpMat_meat.hpp b/inst/include/armadillo_bits/SpMat_meat.hpp index 14e9b3e5..a09fa3f3 100644 --- a/inst/include/armadillo_bits/SpMat_meat.hpp +++ b/inst/include/armadillo_bits/SpMat_meat.hpp @@ -4116,7 +4116,7 @@ SpMat::replace(const eT old_val, const eT new_val) if(old_val == eT(0)) { - arma_conform_warn(1, "SpMat::replace(): replacement not done, as old_val = 0"); + arma_warn(1, "SpMat::replace(): replacement not done, as old_val = 0"); } else { @@ -4399,6 +4399,8 @@ SpMat::sprandu(const uword in_rows, const uword in_cols, const double densit access::rw(col_ptrs[lcol]) += col_ptrs[lcol - 1]; } + (*this).remove_zeros(); + return *this; } @@ -4474,6 +4476,8 @@ SpMat::sprandn(const uword in_rows, const uword in_cols, const double densit access::rw(col_ptrs[lcol]) += col_ptrs[lcol - 1]; } + (*this).remove_zeros(); + return *this; } @@ -4612,11 +4616,11 @@ SpMat::save(const std::string name, const file_type type) const break; default: - arma_conform_warn(1, "SpMat::save(): unsupported file type"); + arma_warn(1, "SpMat::save(): unsupported file type"); save_okay = false; } - if(save_okay == false) { arma_conform_warn(3, "SpMat::save(): write failed; file: ", name); } + if(save_okay == false) { arma_warn(3, "SpMat::save(): write failed; file: ", name); } return save_okay; } @@ -4654,7 +4658,7 @@ SpMat::save(const csv_name& spec, const file_type type) const { if( (spec.header_ro.n_cols != 1) && (spec.header_ro.n_rows != 1) ) { - arma_conform_warn(1, "SpMat::save(): given header must have a vector layout"); + arma_warn(1, "SpMat::save(): given header must have a vector layout"); return false; } @@ -4664,7 +4668,7 @@ SpMat::save(const csv_name& spec, const file_type type) const if(token.find(separator) != std::string::npos) { - arma_conform_warn(1, "SpMat::save(): token within the header contains the separator character: '", token, "'"); + arma_warn(1, "SpMat::save(): token within the header contains the separator character: '", token, "'"); return false; } } @@ -4673,7 +4677,7 @@ SpMat::save(const csv_name& spec, const file_type type) const if(spec.header_ro.n_elem != save_n_cols) { - arma_conform_warn(1, "SpMat::save(): size mismatch between header and matrix"); + arma_warn(1, "SpMat::save(): size mismatch between header and matrix"); return false; } } @@ -4691,7 +4695,7 @@ SpMat::save(const csv_name& spec, const file_type type) const save_okay = diskio::save_csv_ascii(*this, spec.filename, spec.header_ro, with_header, separator); } - if(save_okay == false) { arma_conform_warn(3, "SpMat::save(): write failed; file: ", spec.filename); } + if(save_okay == false) { arma_warn(3, "SpMat::save(): write failed; file: ", spec.filename); } return save_okay; } @@ -4729,11 +4733,11 @@ SpMat::save(std::ostream& os, const file_type type) const break; default: - arma_conform_warn(1, "SpMat::save(): unsupported file type"); + arma_warn(1, "SpMat::save(): unsupported file type"); save_okay = false; } - if(save_okay == false) { arma_conform_warn(3, "SpMat::save(): stream write failed"); } + if(save_okay == false) { arma_warn(3, "SpMat::save(): stream write failed"); } return save_okay; } @@ -4776,7 +4780,7 @@ SpMat::load(const std::string name, const file_type type) break; default: - arma_conform_warn(1, "SpMat::load(): unsupported file type"); + arma_warn(1, "SpMat::load(): unsupported file type"); load_okay = false; } @@ -4784,11 +4788,11 @@ SpMat::load(const std::string name, const file_type type) { if(err_msg.length() > 0) { - arma_conform_warn(3, "SpMat::load(): ", err_msg, "; file: ", name); + arma_warn(3, "SpMat::load(): ", err_msg, "; file: ", name); } else { - arma_conform_warn(3, "SpMat::load(): read failed; file: ", name); + arma_warn(3, "SpMat::load(): read failed; file: ", name); } } @@ -4826,7 +4830,7 @@ SpMat::load(const csv_name& spec, const file_type type) if(use_semicolon) { arma_debug_print("semicolon"); } if(strict ) { arma_debug_print("strict"); } - if(strict) { arma_conform_warn(1, "SpMat::load(): option 'strict' not implemented for sparse matrices"); } + if(strict) { arma_warn(1, "SpMat::load(): option 'strict' not implemented for sparse matrices"); } const char separator = (use_semicolon) ? char(';') : char(','); @@ -4859,11 +4863,11 @@ SpMat::load(const csv_name& spec, const file_type type) { if(err_msg.length() > 0) { - arma_conform_warn(3, "SpMat::load(): ", err_msg, "; file: ", spec.filename); + arma_warn(3, "SpMat::load(): ", err_msg, "; file: ", spec.filename); } else { - arma_conform_warn(3, "SpMat::load(): read failed; file: ", spec.filename); + arma_warn(3, "SpMat::load(): read failed; file: ", spec.filename); } } else @@ -4872,7 +4876,7 @@ SpMat::load(const csv_name& spec, const file_type type) if(with_header && (spec.header_rw.n_elem != load_n_cols)) { - arma_conform_warn(3, "SpMat::load(): size mismatch between header and matrix"); + arma_warn(3, "SpMat::load(): size mismatch between header and matrix"); } } @@ -4924,7 +4928,7 @@ SpMat::load(std::istream& is, const file_type type) break; default: - arma_conform_warn(1, "SpMat::load(): unsupported file type"); + arma_warn(1, "SpMat::load(): unsupported file type"); load_okay = false; } @@ -4932,11 +4936,11 @@ SpMat::load(std::istream& is, const file_type type) { if(err_msg.length() > 0) { - arma_conform_warn(3, "SpMat::load(): ", err_msg); + arma_warn(3, "SpMat::load(): ", err_msg); } else { - arma_conform_warn(3, "SpMat::load(): stream read failed"); + arma_warn(3, "SpMat::load(): stream read failed"); } } diff --git a/inst/include/armadillo_bits/SpProxy.hpp b/inst/include/armadillo_bits/SpProxy.hpp index 5fc18be6..82dd7b6c 100644 --- a/inst/include/armadillo_bits/SpProxy.hpp +++ b/inst/include/armadillo_bits/SpProxy.hpp @@ -112,7 +112,7 @@ struct SpProxy< SpMat > arma_inline const_row_iterator_type end_row(const uword row_num) const { return Q.end_row(row_num); } template - arma_inline bool is_alias(const SpMat& X) const { return (void_ptr(&Q) == void_ptr(&X)); } + arma_inline bool is_alias(const SpMat& X) const { return (is_same_type::yes) && (void_ptr(&Q) == void_ptr(&X)); } }; @@ -164,7 +164,7 @@ struct SpProxy< SpCol > arma_inline const_row_iterator_type end_row(const uword row_num) const { return Q.end_row(row_num); } template - arma_inline bool is_alias(const SpMat& X) const { return (void_ptr(&Q) == void_ptr(&X)); } + arma_inline bool is_alias(const SpMat& X) const { return (is_same_type::yes) && (void_ptr(&Q) == void_ptr(&X)); } }; @@ -216,7 +216,7 @@ struct SpProxy< SpRow > arma_inline const_row_iterator_type end_row(const uword row_num) const { return Q.end_row(row_num); } template - arma_inline bool is_alias(const SpMat& X) const { return (void_ptr(&Q) == void_ptr(&X)); } + arma_inline bool is_alias(const SpMat& X) const { return (is_same_type::yes) && (void_ptr(&Q) == void_ptr(&X)); } }; @@ -268,7 +268,7 @@ struct SpProxy< SpSubview > arma_inline const_row_iterator_type end_row(const uword row_num) const { return Q.end_row(row_num); } template - arma_inline bool is_alias(const SpMat& X) const { return (void_ptr(&Q.m) == void_ptr(&X)); } + arma_inline bool is_alias(const SpMat& X) const { return (is_same_type::yes) && (void_ptr(&Q.m) == void_ptr(&X)); } }; @@ -320,7 +320,7 @@ struct SpProxy< SpSubview_col > arma_inline const_row_iterator_type end_row(const uword row_num) const { return Q.end_row(row_num); } template - arma_inline bool is_alias(const SpMat& X) const { return (void_ptr(&Q.m) == void_ptr(&X)); } + arma_inline bool is_alias(const SpMat& X) const { return (is_same_type::yes) && (void_ptr(&Q.m) == void_ptr(&X)); } }; @@ -423,7 +423,7 @@ struct SpProxy< SpSubview_row > arma_inline const_row_iterator_type end_row(const uword row_num) const { return Q.end_row(row_num); } template - arma_inline bool is_alias(const SpMat& X) const { return (void_ptr(&Q.m) == void_ptr(&X)); } + arma_inline bool is_alias(const SpMat& X) const { return (is_same_type::yes) && (void_ptr(&Q.m) == void_ptr(&X)); } }; diff --git a/inst/include/armadillo_bits/arma_forward.hpp b/inst/include/armadillo_bits/arma_forward.hpp index 1bad37f4..b35d64ef 100644 --- a/inst/include/armadillo_bits/arma_forward.hpp +++ b/inst/include/armadillo_bits/arma_forward.hpp @@ -129,6 +129,17 @@ class spop_htrans; class spop_vectorise_row; class spop_vectorise_col; +class spop_rel_lt_pre; +class spop_rel_lt_post; +class spop_rel_gt_pre; +class spop_rel_gt_post; +class spop_rel_lteq_pre; +class spop_rel_lteq_post; +class spop_rel_gteq_pre; +class spop_rel_gteq_post; +class spop_rel_eq; +class spop_rel_noteq; + class spglue_plus; class spglue_minus; class spglue_schur; diff --git a/inst/include/armadillo_bits/auxlib_meat.hpp b/inst/include/armadillo_bits/auxlib_meat.hpp index 631c3a0d..bc70fdad 100644 --- a/inst/include/armadillo_bits/auxlib_meat.hpp +++ b/inst/include/armadillo_bits/auxlib_meat.hpp @@ -1609,7 +1609,7 @@ auxlib::eig_pair } } - if(beta_has_zero) { arma_conform_warn(1, "eig_pair(): given matrices appear ill-conditioned"); } + if(beta_has_zero) { arma_warn(1, "eig_pair(): given matrices appear ill-conditioned"); } if(vecs_on) { @@ -1730,7 +1730,7 @@ auxlib::eig_pair beta_has_zero = (beta_has_zero || (beta_val == zero)); } - if(beta_has_zero) { arma_conform_warn(1, "eig_pair(): given matrices appear ill-conditioned"); } + if(beta_has_zero) { arma_warn(1, "eig_pair(): given matrices appear ill-conditioned"); } return true; } @@ -1838,7 +1838,7 @@ auxlib::eig_pair_twosided } } - if(beta_has_zero) { arma_conform_warn(1, "eig_pair(): given matrices appear ill-conditioned"); } + if(beta_has_zero) { arma_warn(1, "eig_pair(): given matrices appear ill-conditioned"); } for(uword j=0; j < A.n_rows; ++j) { @@ -1955,7 +1955,7 @@ auxlib::eig_pair_twosided beta_has_zero = (beta_has_zero || (beta_val == zero)); } - if(beta_has_zero) { arma_conform_warn(1, "eig_pair(): given matrices appear ill-conditioned"); } + if(beta_has_zero) { arma_warn(1, "eig_pair(): given matrices appear ill-conditioned"); } return true; } @@ -1990,7 +1990,7 @@ auxlib::eig_sym(Col& eigval, Mat& A) if((arma_config::check_conform) && (auxlib::rudimentary_sym_check(A) == false)) { - arma_conform_warn(1, "eig_sym(): given matrix is not symmetric"); + arma_warn(1, "eig_sym(): given matrix is not symmetric"); } if(arma_config::check_nonfinite && trimat_helper::has_nonfinite_triu(A)) { return false; } @@ -2043,7 +2043,7 @@ auxlib::eig_sym(Col& eigval, Mat< std::complex >& A) if((arma_config::check_conform) && (auxlib::rudimentary_sym_check(A) == false)) { - arma_conform_warn(1, "eig_sym(): given matrix is not hermitian"); + arma_warn(1, "eig_sym(): given matrix is not hermitian"); } if(arma_config::check_nonfinite && trimat_helper::has_nonfinite_triu(A)) { return false; } diff --git a/inst/include/armadillo_bits/compiler_setup.hpp b/inst/include/armadillo_bits/compiler_setup.hpp index d106840e..931fd967 100644 --- a/inst/include/armadillo_bits/compiler_setup.hpp +++ b/inst/include/armadillo_bits/compiler_setup.hpp @@ -326,6 +326,7 @@ #pragma warning(push) #pragma warning(disable: 4127) // conditional expression is constant + #pragma warning(disable: 4146) // unary minus operator applied to unsigned type, result still unsigned #pragma warning(disable: 4180) // qualifier has no meaning #pragma warning(disable: 4244) // possible loss of data when converting types (see also 4305) #pragma warning(disable: 4510) // default constructor could not be generated @@ -345,8 +346,6 @@ #pragma warning(disable: 4714) // __forceinline can't be inlined #pragma warning(disable: 4800) // value forced to bool - // NOTE: also possible to disable 4146 (unary minus operator applied to unsigned type, result still unsigned) - #if defined(ARMA_HAVE_CXX17) #pragma warning(disable: 26812) // unscoped enum #pragma warning(disable: 26819) // unannotated fallthrough diff --git a/inst/include/armadillo_bits/debug.hpp b/inst/include/armadillo_bits/debug.hpp index 27434a1b..e2a51731 100644 --- a/inst/include/armadillo_bits/debug.hpp +++ b/inst/include/armadillo_bits/debug.hpp @@ -1341,7 +1341,6 @@ arma_assert_atlas_size(const T1& A, const T2& B) #if defined(ARMA_CHECK_CONFORMANCE) - #define arma_conform_warn arma_warn #define arma_conform_check arma_check #define arma_conform_check_bounds arma_check_bounds #define arma_conform_set_error arma_set_error @@ -1354,7 +1353,6 @@ arma_assert_atlas_size(const T1& A, const T2& B) #else - #define arma_conform_warn true ? (void)0 : arma_warn #define arma_conform_check true ? (void)0 : arma_check #define arma_conform_check_bounds true ? (void)0 : arma_check_bounds #define arma_conform_set_error true ? (void)0 : arma_set_error diff --git a/inst/include/armadillo_bits/diskio_meat.hpp b/inst/include/armadillo_bits/diskio_meat.hpp index 8ae7f2ec..570d7dbf 100644 --- a/inst/include/armadillo_bits/diskio_meat.hpp +++ b/inst/include/armadillo_bits/diskio_meat.hpp @@ -2994,7 +2994,7 @@ diskio::save_csv_ascii(const SpMat< std::complex >& x, std::ostream& f, const arma_ignore(f); arma_ignore(separator); - arma_conform_warn(1, "saving complex sparse matrices as csv_ascii not yet implemented"); + arma_warn(1, "saving complex sparse matrices as csv_ascii not yet implemented"); return false; } @@ -3382,7 +3382,7 @@ diskio::load_csv_ascii(SpMat< std::complex >& x, std::istream& f, std::string arma_ignore(err_msg); arma_ignore(separator); - arma_conform_warn(1, "loading complex sparse matrices as csv_ascii not yet implemented"); + arma_warn(1, "loading complex sparse matrices as csv_ascii not yet implemented"); return false; } diff --git a/inst/include/armadillo_bits/eop_aux.hpp b/inst/include/armadillo_bits/eop_aux.hpp index 5b962379..b63eba66 100644 --- a/inst/include/armadillo_bits/eop_aux.hpp +++ b/inst/include/armadillo_bits/eop_aux.hpp @@ -73,8 +73,8 @@ class eop_aux template arma_inline static typename arma_real_or_cx_only::result sinh (const eT x) { return std::sinh (x); } template arma_inline static typename arma_real_or_cx_only::result tanh (const eT x) { return std::tanh (x); } - template arma_inline static typename arma_unsigned_integral_only::result neg (const eT x) { return x; } - template arma_inline static typename arma_signed_only::result neg (const eT x) { return -x; } + template arma_inline static typename arma_unsigned_integral_only::result neg (const eT x) { return static_cast(-1 * x); } // TODO: not sure how to best handle this + template arma_inline static typename arma_signed_only::result neg (const eT x) { return -x; } template arma_inline static typename arma_integral_only::result floor (const eT x) { return x; } template arma_inline static typename arma_real_only::result floor (const eT x) { return std::floor(x); } @@ -84,13 +84,13 @@ class eop_aux template arma_inline static typename arma_real_only::result ceil (const eT x) { return std::ceil(x); } template arma_inline static typename arma_cx_only::result ceil (const eT& x) { return eT( std::ceil(x.real()), std::ceil(x.imag()) ); } - template arma_inline static typename arma_integral_only::result round (const eT x) { return x; } - template arma_inline static typename arma_real_only::result round (const eT x) { return std::round(x); } - template arma_inline static typename arma_cx_only::result round (const eT& x) { return eT( std::round(x.real()), std::round(x.imag()) ); } + template arma_inline static typename arma_integral_only::result round (const eT x) { return x; } + template arma_inline static typename arma_real_only::result round (const eT x) { return std::round(x); } + template arma_inline static typename arma_cx_only::result round (const eT& x) { return eT( std::round(x.real()), std::round(x.imag()) ); } - template arma_inline static typename arma_integral_only::result trunc (const eT x) { return x; } - template arma_inline static typename arma_real_only::result trunc (const eT x) { return std::trunc(x); } - template arma_inline static typename arma_cx_only::result trunc (const eT& x) { return eT( std::trunc(x.real()), std::trunc(x.imag()) ); } + template arma_inline static typename arma_integral_only::result trunc (const eT x) { return x; } + template arma_inline static typename arma_real_only::result trunc (const eT x) { return std::trunc(x); } + template arma_inline static typename arma_cx_only::result trunc (const eT& x) { return eT( std::trunc(x.real()), std::trunc(x.imag()) ); } template arma_inline static typename arma_integral_only::result log2 (const eT x) { return eT( std::log2(double(x)) ); } template arma_inline static typename arma_real_only::result log2 (const eT x) { return std::log2(x); } diff --git a/inst/include/armadillo_bits/field_meat.hpp b/inst/include/armadillo_bits/field_meat.hpp index de75ac2a..5d7d380e 100644 --- a/inst/include/armadillo_bits/field_meat.hpp +++ b/inst/include/armadillo_bits/field_meat.hpp @@ -1811,11 +1811,11 @@ field::save(const std::string name, const file_type type) const { if(err_msg.length() > 0) { - arma_conform_warn(3, "field::save(): ", err_msg, "; file: ", name); + arma_warn(3, "field::save(): ", err_msg, "; file: ", name); } else { - arma_conform_warn(3, "field::save(): write failed; file: ", name); + arma_warn(3, "field::save(): write failed; file: ", name); } } @@ -1839,11 +1839,11 @@ field::save(std::ostream& os, const file_type type) const { if(err_msg.length() > 0) { - arma_conform_warn(3, "field::save(): ", err_msg); + arma_warn(3, "field::save(): ", err_msg); } else { - arma_conform_warn(3, "field::save(): stream write failed"); + arma_warn(3, "field::save(): stream write failed"); } } @@ -1867,11 +1867,11 @@ field::load(const std::string name, const file_type type) { if(err_msg.length() > 0) { - arma_conform_warn(3, "field::load(): ", err_msg, "; file: ", name); + arma_warn(3, "field::load(): ", err_msg, "; file: ", name); } else { - arma_conform_warn(3, "field::load(): read failed; file: ", name); + arma_warn(3, "field::load(): read failed; file: ", name); } } @@ -1896,11 +1896,11 @@ field::load(std::istream& is, const file_type type) { if(err_msg.length() > 0) { - arma_conform_warn(3, "field::load(): ", err_msg); + arma_warn(3, "field::load(): ", err_msg); } else { - arma_conform_warn(3, "field::load(): stream read failed"); + arma_warn(3, "field::load(): stream read failed"); } } diff --git a/inst/include/armadillo_bits/fn_accu.hpp b/inst/include/armadillo_bits/fn_accu.hpp index e7c07b3e..68442cbf 100644 --- a/inst/include/armadillo_bits/fn_accu.hpp +++ b/inst/include/armadillo_bits/fn_accu.hpp @@ -388,22 +388,23 @@ accu(const eGlue& expr) -//! explicit handling of Hamming norm (also known as zero norm) -template +template arma_warn_unused inline uword -accu(const mtOp& X) +accu(const mtOp& X, const typename arma_op_rel_only::result* junk1 = nullptr, const typename arma_not_cx::result* junk2 = nullptr) { arma_debug_sigprint(); + arma_ignore(junk1); + arma_ignore(junk2); typedef typename T1::elem_type eT; - const eT val = X.aux; + const eT k = X.aux; const Proxy P(X.m); - uword n_nonzero = 0; + uword count = 0; if(Proxy::use_at == false) { @@ -414,7 +415,23 @@ accu(const mtOp& X) for(uword i=0; i::yes) { condition = (val == k ); } + else if(is_same_type::yes) { condition = (val != k ); } + else if(is_same_type::yes) { condition = (k < val); } + else if(is_same_type::yes) { condition = (val < k ); } + else if(is_same_type::yes) { condition = (k > val); } + else if(is_same_type::yes) { condition = (val > k ); } + else if(is_same_type::yes) { condition = (k <= val); } + else if(is_same_type::yes) { condition = (val <= k ); } + else if(is_same_type::yes) { condition = (k >= val); } + else if(is_same_type::yes) { condition = (val >= k ); } + else { condition = false; } + + count += (condition) ? uword(1) : uword(0); } } else @@ -422,43 +439,51 @@ accu(const mtOp& X) const uword P_n_cols = P.get_n_cols(); const uword P_n_rows = P.get_n_rows(); - if(P_n_rows == 1) - { - for(uword col=0; col < P_n_cols; ++col) - { - n_nonzero += (P.at(0,col) != val) ? uword(1) : uword(0); - } - } - else + for(uword col=0; col < P_n_cols; ++col) + for(uword row=0; row < P_n_rows; ++row) { - for(uword col=0; col < P_n_cols; ++col) - for(uword row=0; row < P_n_rows; ++row) - { - n_nonzero += (P.at(row,col) != val) ? uword(1) : uword(0); - } + const eT val = P.at(row,col); + + bool condition; + + if(is_same_type::yes) { condition = (val == k ); } + else if(is_same_type::yes) { condition = (val != k ); } + else if(is_same_type::yes) { condition = (k < val); } + else if(is_same_type::yes) { condition = (val < k ); } + else if(is_same_type::yes) { condition = (k > val); } + else if(is_same_type::yes) { condition = (val > k ); } + else if(is_same_type::yes) { condition = (k <= val); } + else if(is_same_type::yes) { condition = (val <= k ); } + else if(is_same_type::yes) { condition = (k >= val); } + else if(is_same_type::yes) { condition = (val >= k ); } + else { condition = false; } + + count += (condition) ? uword(1) : uword(0); } } - return n_nonzero; + return count; } -template +template arma_warn_unused inline uword -accu(const mtOp& X) +accu(const mtOp& X, const typename arma_op_rel_only::result* junk1 = nullptr, const typename arma_cx_only::result* junk2 = nullptr) { arma_debug_sigprint(); + arma_ignore(junk1); + arma_ignore(junk2); typedef typename T1::elem_type eT; - const eT val = X.aux; + const eT k = X.aux; const Proxy P(X.m); - uword n_nonzero = 0; + uword count = 0; if(Proxy::use_at == false) { @@ -469,7 +494,15 @@ accu(const mtOp& X) for(uword i=0; i::yes) { condition = (val == k); } + else if(is_same_type::yes) { condition = (val != k); } + else { condition = false; } + + count += (condition) ? uword(1) : uword(0); } } else @@ -477,24 +510,22 @@ accu(const mtOp& X) const uword P_n_cols = P.get_n_cols(); const uword P_n_rows = P.get_n_rows(); - if(P_n_rows == 1) + for(uword col=0; col < P_n_cols; ++col) + for(uword row=0; row < P_n_rows; ++row) { - for(uword col=0; col < P_n_cols; ++col) - { - n_nonzero += (P.at(0,col) == val) ? uword(1) : uword(0); - } - } - else - { - for(uword col=0; col < P_n_cols; ++col) - for(uword row=0; row < P_n_rows; ++row) - { - n_nonzero += (P.at(row,col) == val) ? uword(1) : uword(0); - } + const eT val = P.at(row,col); + + bool condition; + + if(is_same_type::yes) { condition = (val == k); } + else if(is_same_type::yes) { condition = (val != k); } + else { condition = false; } + + count += (condition) ? uword(1) : uword(0); } } - return n_nonzero; + return count; } @@ -1080,4 +1111,136 @@ accu(const SpOp& expr) +template +arma_warn_unused +inline +uword +accu(const mtSpOp& X, const typename arma_spop_rel_only::result* junk1 = nullptr, const typename arma_not_cx::result* junk2 = nullptr) + { + arma_debug_sigprint(); + arma_ignore(junk1); + arma_ignore(junk2); + + typedef typename T1::elem_type eT; + + const eT k = X.aux; + + const SpProxy P(X.m); + + const uword n_zeros = P.get_n_elem() - P.get_n_nonzero(); + + const eT zero = eT(0); + + // shortcuts + + if( (is_same_type::yes) && (k == zero) ) { return n_zeros; } + if( (is_same_type::yes) && (k == zero) ) { return P.get_n_nonzero(); } + + // take into account all implicit zeros + + bool use_n_zeros; + + if(is_same_type::yes) { use_n_zeros = (zero == k ); } + else if(is_same_type::yes) { use_n_zeros = (zero != k ); } + else if(is_same_type::yes) { use_n_zeros = (k < zero); } + else if(is_same_type::yes) { use_n_zeros = (zero < k ); } + else if(is_same_type::yes) { use_n_zeros = (k > zero); } + else if(is_same_type::yes) { use_n_zeros = (zero > k ); } + else if(is_same_type::yes) { use_n_zeros = (k <= zero); } + else if(is_same_type::yes) { use_n_zeros = (zero <= k ); } + else if(is_same_type::yes) { use_n_zeros = (k >= zero); } + else if(is_same_type::yes) { use_n_zeros = (zero >= k ); } + else { use_n_zeros = false; } + + uword count = (use_n_zeros) ? n_zeros : 0; + + typename SpProxy::const_iterator_type it = P.begin(); + typename SpProxy::const_iterator_type it_end = P.end(); + + // take into account all non-zero elements + + for(; it != it_end; ++it) + { + const eT val = (*it); + + bool condition; + + if(is_same_type::yes) { condition = (val == k ); } + else if(is_same_type::yes) { condition = (val != k ); } + else if(is_same_type::yes) { condition = (k < val); } + else if(is_same_type::yes) { condition = (val < k ); } + else if(is_same_type::yes) { condition = (k > val); } + else if(is_same_type::yes) { condition = (val > k ); } + else if(is_same_type::yes) { condition = (k <= val); } + else if(is_same_type::yes) { condition = (val <= k ); } + else if(is_same_type::yes) { condition = (k >= val); } + else if(is_same_type::yes) { condition = (val >= k ); } + else { condition = false; } + + count += (condition) ? uword(1) : uword(0); + } + + return count; + } + + + +template +arma_warn_unused +inline +uword +accu(const mtSpOp& X, const typename arma_spop_rel_only::result* junk1 = nullptr, const typename arma_cx_only::result* junk2 = nullptr) + { + arma_debug_sigprint(); + arma_ignore(junk1); + arma_ignore(junk2); + + typedef typename T1::elem_type eT; + + const eT k = X.aux; + + const SpProxy P(X.m); + + const uword n_zeros = P.get_n_elem() - P.get_n_nonzero(); + + const eT zero = eT(0); + + // shortcuts + + if( (is_same_type::yes) && (k == zero) ) { return n_zeros; } + if( (is_same_type::yes) && (k == zero) ) { return P.get_n_nonzero(); } + + // take into account all implicit zeros + + bool use_n_zeros; + + if(is_same_type::yes) { use_n_zeros = (zero == k); } + else if(is_same_type::yes) { use_n_zeros = (zero != k); } + else { use_n_zeros = false; } + + uword count = (use_n_zeros) ? n_zeros : 0; + + typename SpProxy::const_iterator_type it = P.begin(); + typename SpProxy::const_iterator_type it_end = P.end(); + + // take into account all non-zero elements + + for(; it != it_end; ++it) + { + const eT val = (*it); + + bool condition; + + if(is_same_type::yes) { condition = (val == k); } + else if(is_same_type::yes) { condition = (val != k); } + else { condition = false; } + + count += (condition) ? uword(1) : uword(0); + } + + return count; + } + + + //! @} diff --git a/inst/include/armadillo_bits/fn_chol.hpp b/inst/include/armadillo_bits/fn_chol.hpp index b84dbc13..00b640d1 100644 --- a/inst/include/armadillo_bits/fn_chol.hpp +++ b/inst/include/armadillo_bits/fn_chol.hpp @@ -63,7 +63,7 @@ chol if(status == false) { out.soft_reset(); - arma_conform_warn(3, "chol(): decomposition failed"); + arma_warn(3, "chol(): decomposition failed"); } return status; @@ -105,8 +105,8 @@ chol if((arma_config::check_conform) && (auxlib::rudimentary_sym_check(out) == false)) { - if(is_cx::no ) { arma_conform_warn(1, "chol(): given matrix is not symmetric"); } - if(is_cx::yes) { arma_conform_warn(1, "chol(): given matrix is not hermitian"); } + if(is_cx::no ) { arma_warn(1, "chol(): given matrix is not symmetric"); } + if(is_cx::yes) { arma_warn(1, "chol(): given matrix is not hermitian"); } } bool status = false; @@ -138,7 +138,7 @@ chol { out.soft_reset(); P.soft_reset(); - arma_conform_warn(3, "chol(): decomposition failed"); + arma_warn(3, "chol(): decomposition failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_det.hpp b/inst/include/armadillo_bits/fn_det.hpp index 4ea0b5e6..244bdf81 100644 --- a/inst/include/armadillo_bits/fn_det.hpp +++ b/inst/include/armadillo_bits/fn_det.hpp @@ -60,7 +60,7 @@ det(typename T1::elem_type& out_val, const Base& X) if(status == false) { out_val = eT(0); - arma_conform_warn(3, "det(): failed to find determinant"); + arma_warn(3, "det(): failed to find determinant"); } return status; diff --git a/inst/include/armadillo_bits/fn_eig_gen.hpp b/inst/include/armadillo_bits/fn_eig_gen.hpp index 23bdeb83..06a1d4a0 100644 --- a/inst/include/armadillo_bits/fn_eig_gen.hpp +++ b/inst/include/armadillo_bits/fn_eig_gen.hpp @@ -39,7 +39,7 @@ eig_gen arma_conform_check( ((sig != 'n') && (sig != 'b')), "eig_gen(): unknown option" ); - if( auxlib::crippled_lapack(expr) && (sig == 'b') ) { arma_conform_warn(1, "eig_gen(): 'balance' option ignored due to linking with crippled lapack"); } + if( auxlib::crippled_lapack(expr) && (sig == 'b') ) { arma_warn(1, "eig_gen(): 'balance' option ignored due to linking with crippled lapack"); } Col eigvals; Mat eigvecs; @@ -76,7 +76,7 @@ eig_gen arma_conform_check( ((sig != 'n') && (sig != 'b')), "eig_gen(): unknown option" ); - if( auxlib::crippled_lapack(expr) && (sig == 'b') ) { arma_conform_warn(1, "eig_gen(): 'balance' option ignored due to linking with crippled lapack"); } + if( auxlib::crippled_lapack(expr) && (sig == 'b') ) { arma_warn(1, "eig_gen(): 'balance' option ignored due to linking with crippled lapack"); } Mat eigvecs; @@ -85,7 +85,7 @@ eig_gen if(status == false) { eigvals.soft_reset(); - arma_conform_warn(3, "eig_gen(): decomposition failed"); + arma_warn(3, "eig_gen(): decomposition failed"); } return status; @@ -112,7 +112,7 @@ eig_gen arma_conform_check( ((sig != 'n') && (sig != 'b')), "eig_gen(): unknown option" ); - if( auxlib::crippled_lapack(expr) && (sig == 'b') ) { arma_conform_warn(1, "eig_gen(): 'balance' option ignored due to linking with crippled lapack"); } + if( auxlib::crippled_lapack(expr) && (sig == 'b') ) { arma_warn(1, "eig_gen(): 'balance' option ignored due to linking with crippled lapack"); } const bool status = (sig == 'b') ? auxlib::eig_gen_balance(eigvals, eigvecs, true, expr.get_ref()) : auxlib::eig_gen(eigvals, eigvecs, true, expr.get_ref()); @@ -120,7 +120,7 @@ eig_gen { eigvals.soft_reset(); eigvecs.soft_reset(); - arma_conform_warn(3, "eig_gen(): decomposition failed"); + arma_warn(3, "eig_gen(): decomposition failed"); } return status; @@ -150,7 +150,7 @@ eig_gen arma_conform_check( ((sig != 'n') && (sig != 'b')), "eig_gen(): unknown option" ); - if( auxlib::crippled_lapack(expr) && (sig == 'b') ) { arma_conform_warn(1, "eig_gen(): 'balance' option ignored due to linking with crippled lapack"); } + if( auxlib::crippled_lapack(expr) && (sig == 'b') ) { arma_warn(1, "eig_gen(): 'balance' option ignored due to linking with crippled lapack"); } const bool status = (sig == 'b') ? auxlib::eig_gen_twosided_balance(eigvals, leigvecs, reigvecs, expr.get_ref()) : auxlib::eig_gen_twosided(eigvals, leigvecs, reigvecs, expr.get_ref()); @@ -159,7 +159,7 @@ eig_gen eigvals.soft_reset(); leigvecs.soft_reset(); reigvecs.soft_reset(); - arma_conform_warn(3, "eig_gen(): decomposition failed"); + arma_warn(3, "eig_gen(): decomposition failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_eig_pair.hpp b/inst/include/armadillo_bits/fn_eig_pair.hpp index c3ed9866..d641a01c 100644 --- a/inst/include/armadillo_bits/fn_eig_pair.hpp +++ b/inst/include/armadillo_bits/fn_eig_pair.hpp @@ -71,7 +71,7 @@ eig_pair if(status == false) { eigvals.soft_reset(); - arma_conform_warn(3, "eig_pair(): decomposition failed"); + arma_warn(3, "eig_pair(): decomposition failed"); } return status; @@ -100,7 +100,7 @@ eig_pair { eigvals.soft_reset(); eigvecs.soft_reset(); - arma_conform_warn(3, "eig_pair(): decomposition failed"); + arma_warn(3, "eig_pair(): decomposition failed"); } return status; @@ -133,7 +133,7 @@ eig_pair eigvals.soft_reset(); leigvecs.soft_reset(); reigvecs.soft_reset(); - arma_conform_warn(3, "eig_pair(): decomposition failed"); + arma_warn(3, "eig_pair(): decomposition failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_eig_sym.hpp b/inst/include/armadillo_bits/fn_eig_sym.hpp index 638cf4ee..6e5370f6 100644 --- a/inst/include/armadillo_bits/fn_eig_sym.hpp +++ b/inst/include/armadillo_bits/fn_eig_sym.hpp @@ -41,7 +41,7 @@ eig_sym if(status == false) { eigval.soft_reset(); - arma_conform_warn(3, "eig_sym(): decomposition failed"); + arma_warn(3, "eig_sym(): decomposition failed"); } return status; @@ -97,8 +97,8 @@ eig_sym_helper if((arma_config::check_conform) && (auxlib::rudimentary_sym_check(X) == false)) { - if(is_cx::no ) { arma_conform_warn(1, caller_sig, ": given matrix is not symmetric"); } - if(is_cx::yes) { arma_conform_warn(1, caller_sig, ": given matrix is not hermitian"); } + if(is_cx::no ) { arma_warn(1, caller_sig, ": given matrix is not symmetric"); } + if(is_cx::yes) { arma_warn(1, caller_sig, ": given matrix is not hermitian"); } } bool status = false; @@ -146,7 +146,7 @@ eig_sym { eigval.soft_reset(); eigvec.soft_reset(); - arma_conform_warn(3, "eig_sym(): decomposition failed"); + arma_warn(3, "eig_sym(): decomposition failed"); } else { diff --git a/inst/include/armadillo_bits/fn_eigs_gen.hpp b/inst/include/armadillo_bits/fn_eigs_gen.hpp index 4b22abce..685dcaa9 100644 --- a/inst/include/armadillo_bits/fn_eigs_gen.hpp +++ b/inst/include/armadillo_bits/fn_eigs_gen.hpp @@ -179,7 +179,7 @@ eigs_gen if(status == false) { eigval.soft_reset(); - arma_conform_warn(3, "eigs_gen(): decomposition failed"); + arma_warn(3, "eigs_gen(): decomposition failed"); } return status; @@ -245,7 +245,7 @@ eigs_gen if(status == false) { eigval.soft_reset(); - arma_conform_warn(3, "eigs_gen(): decomposition failed"); + arma_warn(3, "eigs_gen(): decomposition failed"); } return status; @@ -276,7 +276,7 @@ eigs_gen if(status == false) { eigval.soft_reset(); - arma_conform_warn(3, "eigs_gen(): decomposition failed"); + arma_warn(3, "eigs_gen(): decomposition failed"); } return status; @@ -312,7 +312,7 @@ eigs_gen { eigval.soft_reset(); eigvec.soft_reset(); - arma_conform_warn(3, "eigs_gen(): decomposition failed"); + arma_warn(3, "eigs_gen(): decomposition failed"); } return status; @@ -381,7 +381,7 @@ eigs_gen { eigval.soft_reset(); eigvec.soft_reset(); - arma_conform_warn(3, "eigs_gen(): decomposition failed"); + arma_warn(3, "eigs_gen(): decomposition failed"); } return status; @@ -414,7 +414,7 @@ eigs_gen { eigval.soft_reset(); eigvec.soft_reset(); - arma_conform_warn(3, "eigs_gen(): decomposition failed"); + arma_warn(3, "eigs_gen(): decomposition failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_eigs_sym.hpp b/inst/include/armadillo_bits/fn_eigs_sym.hpp index e3f4d5c6..0503f4fb 100644 --- a/inst/include/armadillo_bits/fn_eigs_sym.hpp +++ b/inst/include/armadillo_bits/fn_eigs_sym.hpp @@ -132,7 +132,7 @@ eigs_sym if(status == false) { eigval.soft_reset(); - arma_conform_warn(3, "eigs_sym(): decomposition failed"); + arma_warn(3, "eigs_sym(): decomposition failed"); } return status; @@ -187,7 +187,7 @@ eigs_sym if(status == false) { eigval.soft_reset(); - arma_conform_warn(3, "eigs_sym(): decomposition failed"); + arma_warn(3, "eigs_sym(): decomposition failed"); } return status; @@ -221,7 +221,7 @@ eigs_sym { eigval.soft_reset(); eigvec.soft_reset(); - arma_conform_warn(3, "eigs_sym(): decomposition failed"); + arma_warn(3, "eigs_sym(): decomposition failed"); } return status; @@ -279,7 +279,7 @@ eigs_sym { eigval.soft_reset(); eigvec.soft_reset(); - arma_conform_warn(3, "eigs_sym(): decomposition failed"); + arma_warn(3, "eigs_sym(): decomposition failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_expmat.hpp b/inst/include/armadillo_bits/fn_expmat.hpp index 62babb2f..cab6891b 100644 --- a/inst/include/armadillo_bits/fn_expmat.hpp +++ b/inst/include/armadillo_bits/fn_expmat.hpp @@ -55,7 +55,7 @@ expmat(Mat& B, const Base& A) if(status == false) { B.soft_reset(); - arma_conform_warn(3, "expmat(): given matrix appears ill-conditioned"); + arma_warn(3, "expmat(): given matrix appears ill-conditioned"); } return status; @@ -92,7 +92,7 @@ expmat_sym(Mat& Y, const Base if(status == false) { Y.soft_reset(); - arma_conform_warn(3, "expmat_sym(): transformation failed"); + arma_warn(3, "expmat_sym(): transformation failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_hess.hpp b/inst/include/armadillo_bits/fn_hess.hpp index aec91a01..c93bc7c9 100644 --- a/inst/include/armadillo_bits/fn_hess.hpp +++ b/inst/include/armadillo_bits/fn_hess.hpp @@ -50,7 +50,7 @@ hess if(status == false) { H.soft_reset(); - arma_conform_warn(3, "hess(): decomposition failed"); + arma_warn(3, "hess(): decomposition failed"); } return status; @@ -163,7 +163,7 @@ hess { U.soft_reset(); H.soft_reset(); - arma_conform_warn(3, "hess(): decomposition failed"); + arma_warn(3, "hess(): decomposition failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_inv.hpp b/inst/include/armadillo_bits/fn_inv.hpp index e3f4e149..ba610912 100644 --- a/inst/include/armadillo_bits/fn_inv.hpp +++ b/inst/include/armadillo_bits/fn_inv.hpp @@ -53,7 +53,7 @@ inv if(status == false) { out.soft_reset(); - arma_conform_warn(3, "inv(): matrix is singular"); + arma_warn(3, "inv(): matrix is singular"); } return status; @@ -95,7 +95,7 @@ inv if(status == false) { out.soft_reset(); - arma_conform_warn(3, "inv(): matrix is singular"); + arma_warn(3, "inv(): matrix is singular"); } return status; @@ -127,7 +127,7 @@ inv { out_rcond = T(0); out_inv.soft_reset(); - arma_conform_warn(3, "inv(): matrix is singular"); + arma_warn(3, "inv(): matrix is singular"); } return status; diff --git a/inst/include/armadillo_bits/fn_inv_sympd.hpp b/inst/include/armadillo_bits/fn_inv_sympd.hpp index 21712735..a179638f 100644 --- a/inst/include/armadillo_bits/fn_inv_sympd.hpp +++ b/inst/include/armadillo_bits/fn_inv_sympd.hpp @@ -53,7 +53,7 @@ inv_sympd if(status == false) { out.soft_reset(); - arma_conform_warn(3, "inv_sympd(): matrix is singular or not positive definite"); + arma_warn(3, "inv_sympd(): matrix is singular or not positive definite"); } return status; @@ -95,7 +95,7 @@ inv_sympd if(status == false) { out.soft_reset(); - arma_conform_warn(3, "inv_sympd(): matrix is singular or not positive definite"); + arma_warn(3, "inv_sympd(): matrix is singular or not positive definite"); } return status; @@ -127,7 +127,7 @@ inv_sympd { out_rcond = T(0); out_inv.soft_reset(); - arma_conform_warn(3, "inv_sympd(): matrix is singular or not positive definite"); + arma_warn(3, "inv_sympd(): matrix is singular or not positive definite"); } return status; diff --git a/inst/include/armadillo_bits/fn_log_det.hpp b/inst/include/armadillo_bits/fn_log_det.hpp index b8acc704..b94c0f4d 100644 --- a/inst/include/armadillo_bits/fn_log_det.hpp +++ b/inst/include/armadillo_bits/fn_log_det.hpp @@ -46,7 +46,7 @@ log_det out_val = eT(Datum::nan); out_sign = T(0); - arma_conform_warn(3, "log_det(): failed to find determinant"); + arma_warn(3, "log_det(): failed to find determinant"); } return status; @@ -115,7 +115,7 @@ log_det_sympd { out_val = Datum::nan; - arma_conform_warn(3, "log_det_sympd(): given matrix is not symmetric positive definite"); + arma_warn(3, "log_det_sympd(): given matrix is not symmetric positive definite"); } return status; diff --git a/inst/include/armadillo_bits/fn_logmat.hpp b/inst/include/armadillo_bits/fn_logmat.hpp index af52f41f..f7ea56d0 100644 --- a/inst/include/armadillo_bits/fn_logmat.hpp +++ b/inst/include/armadillo_bits/fn_logmat.hpp @@ -59,7 +59,7 @@ logmat(Mat< std::complex >& Y, const Base& Y, const Base& X, if(status == false) { Y.soft_reset(); - arma_conform_warn(3, "logmat(): transformation failed"); + arma_warn(3, "logmat(): transformation failed"); } return status; @@ -116,7 +116,7 @@ logmat_sympd(Mat& Y, const Base& out, const Base& if(status == false) { out.soft_reset(); - arma_conform_warn(3, "mvnrnd(): given covariance matrix is not symmetric positive semi-definite"); + arma_warn(3, "mvnrnd(): given covariance matrix is not symmetric positive semi-definite"); } return status; @@ -99,7 +99,7 @@ mvnrnd(Mat& out, const Base& if(status == false) { out.soft_reset(); - arma_conform_warn(3, "mvnrnd(): given covariance matrix is not symmetric positive semi-definite"); + arma_warn(3, "mvnrnd(): given covariance matrix is not symmetric positive semi-definite"); } return status; diff --git a/inst/include/armadillo_bits/fn_orth_null.hpp b/inst/include/armadillo_bits/fn_orth_null.hpp index 5f9f449c..36060a9c 100644 --- a/inst/include/armadillo_bits/fn_orth_null.hpp +++ b/inst/include/armadillo_bits/fn_orth_null.hpp @@ -48,7 +48,7 @@ orth(Mat& out, const Base& X if(status == false) { out.soft_reset(); - arma_conform_warn(3, "orth(): svd failed"); + arma_warn(3, "orth(): svd failed"); } return status; @@ -87,7 +87,7 @@ null(Mat& out, const Base& X if(status == false) { out.soft_reset(); - arma_conform_warn(3, "null(): svd failed"); + arma_warn(3, "null(): svd failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_pinv.hpp b/inst/include/armadillo_bits/fn_pinv.hpp index f88cde5c..76181561 100644 --- a/inst/include/armadillo_bits/fn_pinv.hpp +++ b/inst/include/armadillo_bits/fn_pinv.hpp @@ -99,7 +99,7 @@ pinv if(status == false) { out.soft_reset(); - arma_conform_warn(3, "pinv(): svd failed"); + arma_warn(3, "pinv(): svd failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_polyfit.hpp b/inst/include/armadillo_bits/fn_polyfit.hpp index 77a1a234..38aa0b68 100644 --- a/inst/include/armadillo_bits/fn_polyfit.hpp +++ b/inst/include/armadillo_bits/fn_polyfit.hpp @@ -38,7 +38,7 @@ polyfit(Mat& out, const Base if(status == false) { out.soft_reset(); - arma_conform_warn(3, "polyfit(): failed"); + arma_warn(3, "polyfit(): failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_powmat.hpp b/inst/include/armadillo_bits/fn_powmat.hpp index 69cf925e..4b58b97b 100644 --- a/inst/include/armadillo_bits/fn_powmat.hpp +++ b/inst/include/armadillo_bits/fn_powmat.hpp @@ -56,7 +56,7 @@ powmat if(status == false) { out.soft_reset(); - arma_conform_warn(3, "powmat(): transformation failed"); + arma_warn(3, "powmat(): transformation failed"); } return status; @@ -98,7 +98,7 @@ powmat if(status == false) { out.soft_reset(); - arma_conform_warn(3, "powmat(): transformation failed"); + arma_warn(3, "powmat(): transformation failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_princomp.hpp b/inst/include/armadillo_bits/fn_princomp.hpp index 9f2e1f94..dc8ec429 100644 --- a/inst/include/armadillo_bits/fn_princomp.hpp +++ b/inst/include/armadillo_bits/fn_princomp.hpp @@ -52,7 +52,7 @@ princomp latent_out.soft_reset(); tsquared_out.soft_reset(); - arma_conform_warn(3, "princomp(): decomposition failed"); + arma_warn(3, "princomp(): decomposition failed"); } return status; @@ -88,7 +88,7 @@ princomp score_out.soft_reset(); latent_out.soft_reset(); - arma_conform_warn(3, "princomp(): decomposition failed"); + arma_warn(3, "princomp(): decomposition failed"); } return status; @@ -121,7 +121,7 @@ princomp coeff_out.soft_reset(); score_out.soft_reset(); - arma_conform_warn(3, "princomp(): decomposition failed"); + arma_warn(3, "princomp(): decomposition failed"); } return status; @@ -151,7 +151,7 @@ princomp { coeff_out.soft_reset(); - arma_conform_warn(3, "princomp(): decomposition failed"); + arma_warn(3, "princomp(): decomposition failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_qr.hpp b/inst/include/armadillo_bits/fn_qr.hpp index e257281c..3049cd87 100644 --- a/inst/include/armadillo_bits/fn_qr.hpp +++ b/inst/include/armadillo_bits/fn_qr.hpp @@ -44,7 +44,7 @@ qr { Q.soft_reset(); R.soft_reset(); - arma_conform_warn(3, "qr(): decomposition failed"); + arma_warn(3, "qr(): decomposition failed"); } return status; @@ -75,7 +75,7 @@ qr_econ { Q.soft_reset(); R.soft_reset(); - arma_conform_warn(3, "qr_econ(): decomposition failed"); + arma_warn(3, "qr_econ(): decomposition failed"); } return status; @@ -134,7 +134,7 @@ qr Q.soft_reset(); R.soft_reset(); P.soft_reset(); - arma_conform_warn(3, "qr(): decomposition failed"); + arma_warn(3, "qr(): decomposition failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_qz.hpp b/inst/include/armadillo_bits/fn_qz.hpp index 081ece87..4b2a1551 100644 --- a/inst/include/armadillo_bits/fn_qz.hpp +++ b/inst/include/armadillo_bits/fn_qz.hpp @@ -55,7 +55,7 @@ qz BB.soft_reset(); Q.soft_reset(); Z.soft_reset(); - arma_conform_warn(3, "qz(): decomposition failed"); + arma_warn(3, "qz(): decomposition failed"); } return status; diff --git a/inst/include/armadillo_bits/fn_roots.hpp b/inst/include/armadillo_bits/fn_roots.hpp index 137adcf7..4779aaaf 100644 --- a/inst/include/armadillo_bits/fn_roots.hpp +++ b/inst/include/armadillo_bits/fn_roots.hpp @@ -56,7 +56,7 @@ roots(Mat< std::complex >& out, const Base AA; @@ -90,7 +90,7 @@ spsolve_helper } catch(...) { - arma_conform_warn(1, "spsolve(): not enough memory to use LAPACK based solver"); + arma_warn(1, "spsolve(): not enough memory to use LAPACK based solver"); } if(conversion_ok) @@ -110,12 +110,12 @@ spsolve_helper if( (status == false) && (rcond > T(0)) ) { - arma_conform_warn(2, "spsolve(): system is singular (rcond: ", rcond, ")"); + arma_warn(2, "spsolve(): system is singular (rcond: ", rcond, ")"); } if( (status == true) && (rcond > T(0)) && (rcond < std::numeric_limits::epsilon()) ) { - arma_conform_warn(2, "solve(): solution computed, but system is singular to working precision (rcond: ", rcond, ")"); + arma_warn(2, "solve(): solution computed, but system is singular to working precision (rcond: ", rcond, ")"); } return status; @@ -148,7 +148,7 @@ spsolve if(status == false) { out.soft_reset(); - arma_conform_warn(3, "spsolve(): solution not found"); + arma_warn(3, "spsolve(): solution not found"); } return status; diff --git a/inst/include/armadillo_bits/fn_sqrtmat.hpp b/inst/include/armadillo_bits/fn_sqrtmat.hpp index 9bf029d0..354e39a0 100644 --- a/inst/include/armadillo_bits/fn_sqrtmat.hpp +++ b/inst/include/armadillo_bits/fn_sqrtmat.hpp @@ -58,7 +58,7 @@ sqrtmat(Mat< std::complex >& Y, const Base& Y, const Base& X if(status == false) { - arma_conform_warn(3, "sqrtmat(): given matrix is singular; may not have a square root"); + arma_warn(3, "sqrtmat(): given matrix is singular; may not have a square root"); } return status; @@ -114,7 +114,7 @@ sqrtmat_sympd(Mat& Y, const Base& W, const Base& if(status == false) { W.soft_reset(); - arma_conform_warn(3, "wishrnd(): given matrix is not symmetric positive definite"); + arma_warn(3, "wishrnd(): given matrix is not symmetric positive definite"); } return status; @@ -101,7 +101,7 @@ wishrnd(Mat& W, const Base& if(status == false) { W.soft_reset(); - arma_conform_warn(3, "wishrnd(): problem with given 'D' matrix"); + arma_warn(3, "wishrnd(): problem with given 'D' matrix"); } return status; @@ -167,7 +167,7 @@ iwishrnd(Mat& W, const Base& if(status == false) { W.soft_reset(); - arma_conform_warn(3, "iwishrnd(): given matrix is not symmetric positive definite and/or df is too low"); + arma_warn(3, "iwishrnd(): given matrix is not symmetric positive definite and/or df is too low"); } return status; @@ -193,7 +193,7 @@ iwishrnd(Mat& W, const Base& if(status == false) { W.soft_reset(); - arma_conform_warn(3, "wishrnd(): problem with given 'Dinv' matrix and/or df is too low"); + arma_warn(3, "wishrnd(): problem with given 'Dinv' matrix and/or df is too low"); } return status; diff --git a/inst/include/armadillo_bits/glue_mvnrnd_meat.hpp b/inst/include/armadillo_bits/glue_mvnrnd_meat.hpp index 6feaab58..4b61820b 100644 --- a/inst/include/armadillo_bits/glue_mvnrnd_meat.hpp +++ b/inst/include/armadillo_bits/glue_mvnrnd_meat.hpp @@ -87,7 +87,7 @@ glue_mvnrnd::apply_direct(Mat& out, const Base& actual_out, const Base& A_expr, const arma_conform_check( no_approx, "solve(): options 'no_approx' and 'force_approx' are mutually exclusive" ); - if(fast) { arma_conform_warn(2, "solve(): option 'fast' ignored for forced approximate solution" ); } - if(equilibrate) { arma_conform_warn(2, "solve(): option 'equilibrate' ignored for forced approximate solution" ); } - if(refine) { arma_conform_warn(2, "solve(): option 'refine' ignored for forced approximate solution" ); } - if(likely_sympd) { arma_conform_warn(2, "solve(): option 'likely_sympd' ignored for forced approximate solution" ); } + if(fast) { arma_warn(2, "solve(): option 'fast' ignored for forced approximate solution" ); } + if(equilibrate) { arma_warn(2, "solve(): option 'equilibrate' ignored for forced approximate solution" ); } + if(refine) { arma_warn(2, "solve(): option 'refine' ignored for forced approximate solution" ); } + if(likely_sympd) { arma_warn(2, "solve(): option 'likely_sympd' ignored for forced approximate solution" ); } return auxlib::solve_approx_svd(actual_out, A, B_expr.get_ref()); // A is overwritten } @@ -312,9 +312,9 @@ glue_solve_gen_full::apply(Mat& actual_out, const Base& A_expr, const { arma_debug_print("glue_solve_gen_full::apply(): detected non-square system"); - if(equilibrate) { arma_conform_warn(2, "solve(): option 'equilibrate' ignored for non-square matrix" ); } - if(refine) { arma_conform_warn(2, "solve(): option 'refine' ignored for non-square matrix" ); } - if(likely_sympd) { arma_conform_warn(2, "solve(): option 'likely_sympd' ignored for non-square matrix" ); } + if(equilibrate) { arma_warn(2, "solve(): option 'equilibrate' ignored for non-square matrix" ); } + if(refine) { arma_warn(2, "solve(): option 'refine' ignored for non-square matrix" ); } + if(likely_sympd) { arma_warn(2, "solve(): option 'likely_sympd' ignored for non-square matrix" ); } if(fast) { @@ -339,11 +339,11 @@ glue_solve_gen_full::apply(Mat& actual_out, const Base& A_expr, const if(rcond == T(0)) { - arma_conform_warn(2, "solve(): system is singular; attempting approx solution"); + arma_warn(2, "solve(): system is singular; attempting approx solution"); } else { - arma_conform_warn(2, "solve(): system is singular (rcond: ", rcond, "); attempting approx solution"); + arma_warn(2, "solve(): system is singular (rcond: ", rcond, "); attempting approx solution"); } // TODO: conditionally recreate A: have a separate state flag which indicates whether A was previously overwritten @@ -436,11 +436,11 @@ glue_solve_tri_default::apply(Mat& actual_out, const Base& A_expr, co if(rcond == T(0)) { - arma_conform_warn(2, "solve(): system is singular; attempting approx solution"); + arma_warn(2, "solve(): system is singular; attempting approx solution"); } else { - arma_conform_warn(2, "solve(): system is singular (rcond: ", rcond, "); attempting approx solution"); + arma_warn(2, "solve(): system is singular (rcond: ", rcond, "); attempting approx solution"); } Mat triA = (triu) ? trimatu(A) : trimatl(A); // trimatu() and trimatl() return the same type @@ -518,7 +518,7 @@ glue_solve_tri_full::apply(Mat& actual_out, const Base& A_expr, const return glue_solve_gen_full::apply(actual_out, ((triu) ? trimatu(A_expr.get_ref()) : trimatl(A_expr.get_ref())), B_expr, (flags & mask)); } - if(likely_sympd) { arma_conform_warn(2, "solve(): option 'likely_sympd' ignored for triangular matrix"); } + if(likely_sympd) { arma_warn(2, "solve(): option 'likely_sympd' ignored for triangular matrix"); } const quasi_unwrap UA(A_expr.get_ref()); const Mat& A = UA.M; @@ -564,11 +564,11 @@ glue_solve_tri_full::apply(Mat& actual_out, const Base& A_expr, const if(rcond == T(0)) { - arma_conform_warn(2, "solve(): system is singular; attempting approx solution"); + arma_warn(2, "solve(): system is singular; attempting approx solution"); } else { - arma_conform_warn(2, "solve(): system is singular (rcond: ", rcond, "); attempting approx solution"); + arma_warn(2, "solve(): system is singular (rcond: ", rcond, "); attempting approx solution"); } Mat triA = (triu) ? trimatu(A) : trimatl(A); // trimatu() and trimatl() return the same type diff --git a/inst/include/armadillo_bits/glue_times_meat.hpp b/inst/include/armadillo_bits/glue_times_meat.hpp index 8d22423a..9b4020fa 100644 --- a/inst/include/armadillo_bits/glue_times_meat.hpp +++ b/inst/include/armadillo_bits/glue_times_meat.hpp @@ -110,8 +110,8 @@ glue_times_redirect2_helper::apply(Mat& out, const if( (strip_inv::do_inv_spd) && (arma_config::check_conform) && (auxlib::rudimentary_sym_check(A) == false) ) { - if(is_cx::no ) { arma_conform_warn(1, "inv_sympd(): given matrix is not symmetric"); } - if(is_cx::yes) { arma_conform_warn(1, "inv_sympd(): given matrix is not hermitian"); } + if(is_cx::no ) { arma_warn(1, "inv_sympd(): given matrix is not symmetric"); } + if(is_cx::yes) { arma_warn(1, "inv_sympd(): given matrix is not hermitian"); } } const unwrap_check B_tmp(X.B, out); @@ -147,8 +147,8 @@ glue_times_redirect2_helper::apply(Mat& out, const if( (arma_config::check_conform) && (auxlib::rudimentary_sym_check(B) == false) ) { - if(is_cx::no ) { arma_conform_warn(1, "inv_sympd(): given matrix is not symmetric"); } - if(is_cx::yes) { arma_conform_warn(1, "inv_sympd(): given matrix is not hermitian"); } + if(is_cx::no ) { arma_warn(1, "inv_sympd(): given matrix is not symmetric"); } + if(is_cx::yes) { arma_warn(1, "inv_sympd(): given matrix is not hermitian"); } } arma_conform_assert_mul_size(At.n_cols, At.n_rows, B.n_rows, B.n_cols, "matrix multiplication"); @@ -274,8 +274,8 @@ glue_times_redirect3_helper::apply(Mat& out, const if( (strip_inv::do_inv_spd) && (arma_config::check_conform) && (auxlib::rudimentary_sym_check(A) == false) ) { - if(is_cx::no ) { arma_conform_warn(1, "inv_sympd(): given matrix is not symmetric"); } - if(is_cx::yes) { arma_conform_warn(1, "inv_sympd(): given matrix is not hermitian"); } + if(is_cx::no ) { arma_warn(1, "inv_sympd(): given matrix is not symmetric"); } + if(is_cx::yes) { arma_warn(1, "inv_sympd(): given matrix is not hermitian"); } } const bool status = (strip_inv::do_inv_spd) ? auxlib::solve_sympd_fast(out, A, BC) : auxlib::solve_square_fast(out, A, BC); @@ -309,8 +309,8 @@ glue_times_redirect3_helper::apply(Mat& out, const if( (strip_inv::do_inv_spd) && (arma_config::check_conform) && (auxlib::rudimentary_sym_check(B) == false) ) { - if(is_cx::no ) { arma_conform_warn(1, "inv_sympd(): given matrix is not symmetric"); } - if(is_cx::yes) { arma_conform_warn(1, "inv_sympd(): given matrix is not hermitian"); } + if(is_cx::no ) { arma_warn(1, "inv_sympd(): given matrix is not symmetric"); } + if(is_cx::yes) { arma_warn(1, "inv_sympd(): given matrix is not hermitian"); } } Mat solve_result; diff --git a/inst/include/armadillo_bits/gmm_diag_meat.hpp b/inst/include/armadillo_bits/gmm_diag_meat.hpp index 6eaa8230..185f892a 100644 --- a/inst/include/armadillo_bits/gmm_diag_meat.hpp +++ b/inst/include/armadillo_bits/gmm_diag_meat.hpp @@ -285,7 +285,7 @@ gmm_diag::load(const std::string name) if( (status == false) || (Q.n_slices != 2) ) { reset(); - arma_conform_warn(3, "gmm_diag::load(): problem with loading or incompatible format"); + arma_warn(3, "gmm_diag::load(): problem with loading or incompatible format"); return false; } @@ -690,8 +690,8 @@ gmm_diag::learn const unwrap tmp_X(data.get_ref()); const Mat& X = tmp_X.M; - if(X.is_empty() ) { arma_conform_warn(3, "gmm_diag::learn(): given matrix is empty" ); return false; } - if(X.internal_has_nonfinite()) { arma_conform_warn(3, "gmm_diag::learn(): given matrix has non-finite values"); return false; } + if(X.is_empty() ) { arma_warn(3, "gmm_diag::learn(): given matrix is empty" ); return false; } + if(X.internal_has_nonfinite()) { arma_warn(3, "gmm_diag::learn(): given matrix has non-finite values"); return false; } if(N_gaus == 0) { reset(); return true; } @@ -720,14 +720,14 @@ gmm_diag::learn if(seed_mode == keep_existing) { - if(means.is_empty() ) { arma_conform_warn(3, "gmm_diag::learn(): no existing means" ); return false; } - if(X.n_rows != means.n_rows) { arma_conform_warn(3, "gmm_diag::learn(): dimensionality mismatch"); return false; } + if(means.is_empty() ) { arma_warn(3, "gmm_diag::learn(): no existing means" ); return false; } + if(X.n_rows != means.n_rows) { arma_warn(3, "gmm_diag::learn(): dimensionality mismatch"); return false; } // TODO: also check for number of vectors? } else { - if(X.n_cols < N_gaus) { arma_conform_warn(3, "gmm_diag::learn(): number of vectors is less than number of gaussians"); return false; } + if(X.n_cols < N_gaus) { arma_warn(3, "gmm_diag::learn(): number of vectors is less than number of gaussians"); return false; } reset(X.n_rows, N_gaus); @@ -751,7 +751,7 @@ gmm_diag::learn stream_state.restore(get_cout_stream()); - if(status == false) { arma_conform_warn(3, "gmm_diag::learn(): k-means algorithm failed; not enough data, or too many gaussians requested"); init(orig); return false; } + if(status == false) { arma_warn(3, "gmm_diag::learn(): k-means algorithm failed; not enough data, or too many gaussians requested"); init(orig); return false; } } @@ -778,7 +778,7 @@ gmm_diag::learn stream_state.restore(get_cout_stream()); - if(status == false) { arma_conform_warn(3, "gmm_diag::learn(): EM algorithm failed"); init(orig); return false; } + if(status == false) { arma_warn(3, "gmm_diag::learn(): EM algorithm failed"); init(orig); return false; } } mah_aux.reset(); @@ -818,8 +818,8 @@ gmm_diag::kmeans_wrapper const unwrap tmp_X(data.get_ref()); const Mat& X = tmp_X.M; - if(X.is_empty() ) { arma_conform_warn(3, "kmeans(): given matrix is empty" ); return false; } - if(X.internal_has_nonfinite()) { arma_conform_warn(3, "kmeans(): given matrix has non-finite values"); return false; } + if(X.is_empty() ) { arma_warn(3, "kmeans(): given matrix is empty" ); return false; } + if(X.internal_has_nonfinite()) { arma_warn(3, "kmeans(): given matrix has non-finite values"); return false; } if(N_gaus == 0) { reset(); return true; } @@ -830,14 +830,14 @@ gmm_diag::kmeans_wrapper { access::rw(means) = user_means; - if(means.is_empty() ) { arma_conform_warn(3, "kmeans(): no existing means" ); return false; } - if(X.n_rows != means.n_rows) { arma_conform_warn(3, "kmeans(): dimensionality mismatch"); return false; } + if(means.is_empty() ) { arma_warn(3, "kmeans(): no existing means" ); return false; } + if(X.n_rows != means.n_rows) { arma_warn(3, "kmeans(): dimensionality mismatch"); return false; } // TODO: also check for number of vectors? } else { - if(X.n_cols < N_gaus) { arma_conform_warn(3, "kmeans(): number of vectors is less than number of means"); return false; } + if(X.n_cols < N_gaus) { arma_warn(3, "kmeans(): number of vectors is less than number of means"); return false; } access::rw(means).zeros(X.n_rows, N_gaus); @@ -859,7 +859,7 @@ gmm_diag::kmeans_wrapper stream_state.restore(get_cout_stream()); - if(status == false) { arma_conform_warn(3, "kmeans(): clustering failed; not enough data, or too many means requested"); return false; } + if(status == false) { arma_warn(3, "kmeans(): clustering failed; not enough data, or too many means requested"); return false; } } return true; diff --git a/inst/include/armadillo_bits/gmm_full_meat.hpp b/inst/include/armadillo_bits/gmm_full_meat.hpp index 8b8d3d02..6e9d1f7d 100644 --- a/inst/include/armadillo_bits/gmm_full_meat.hpp +++ b/inst/include/armadillo_bits/gmm_full_meat.hpp @@ -293,7 +293,7 @@ gmm_full::load(const std::string name) if( (status == false) || (storage.n_elem < 2) ) { reset(); - arma_conform_warn(3, "gmm_full::load(): problem with loading or incompatible format"); + arma_warn(3, "gmm_full::load(): problem with loading or incompatible format"); return false; } @@ -308,7 +308,7 @@ gmm_full::load(const std::string name) if( (storage.n_elem != (N_gaus + 2)) || (storage_hefts.n_rows != 1) || (storage_hefts.n_cols != N_gaus) ) { reset(); - arma_conform_warn(3, "gmm_full::load(): incompatible format"); + arma_warn(3, "gmm_full::load(): incompatible format"); return false; } @@ -324,7 +324,7 @@ gmm_full::load(const std::string name) if( (storage_fcov.n_rows != N_dims) || (storage_fcov.n_cols != N_dims) ) { reset(); - arma_conform_warn(3, "gmm_full::load(): incompatible format"); + arma_warn(3, "gmm_full::load(): incompatible format"); return false; } @@ -729,8 +729,8 @@ gmm_full::learn const unwrap tmp_X(data.get_ref()); const Mat& X = tmp_X.M; - if(X.is_empty() ) { arma_conform_warn(3, "gmm_full::learn(): given matrix is empty" ); return false; } - if(X.internal_has_nonfinite()) { arma_conform_warn(3, "gmm_full::learn(): given matrix has non-finite values"); return false; } + if(X.is_empty() ) { arma_warn(3, "gmm_full::learn(): given matrix is empty" ); return false; } + if(X.internal_has_nonfinite()) { arma_warn(3, "gmm_full::learn(): given matrix has non-finite values"); return false; } if(N_gaus == 0) { reset(); return true; } @@ -759,14 +759,14 @@ gmm_full::learn if(seed_mode == keep_existing) { - if(means.is_empty() ) { arma_conform_warn(3, "gmm_full::learn(): no existing means" ); return false; } - if(X.n_rows != means.n_rows) { arma_conform_warn(3, "gmm_full::learn(): dimensionality mismatch"); return false; } + if(means.is_empty() ) { arma_warn(3, "gmm_full::learn(): no existing means" ); return false; } + if(X.n_rows != means.n_rows) { arma_warn(3, "gmm_full::learn(): dimensionality mismatch"); return false; } // TODO: also check for number of vectors? } else { - if(X.n_cols < N_gaus) { arma_conform_warn(3, "gmm_full::learn(): number of vectors is less than number of gaussians"); return false; } + if(X.n_cols < N_gaus) { arma_warn(3, "gmm_full::learn(): number of vectors is less than number of gaussians"); return false; } reset(X.n_rows, N_gaus); @@ -790,7 +790,7 @@ gmm_full::learn stream_state.restore(get_cout_stream()); - if(status == false) { arma_conform_warn(3, "gmm_full::learn(): k-means algorithm failed; not enough data, or too many gaussians requested"); init(orig); return false; } + if(status == false) { arma_warn(3, "gmm_full::learn(): k-means algorithm failed; not enough data, or too many gaussians requested"); init(orig); return false; } } @@ -817,7 +817,7 @@ gmm_full::learn stream_state.restore(get_cout_stream()); - if(status == false) { arma_conform_warn(3, "gmm_full::learn(): EM algorithm failed"); init(orig); return false; } + if(status == false) { arma_warn(3, "gmm_full::learn(): EM algorithm failed"); init(orig); return false; } } mah_aux.reset(); diff --git a/inst/include/armadillo_bits/mtSpOp_bones.hpp b/inst/include/armadillo_bits/mtSpOp_bones.hpp index 8a07d176..78facfaa 100644 --- a/inst/include/armadillo_bits/mtSpOp_bones.hpp +++ b/inst/include/armadillo_bits/mtSpOp_bones.hpp @@ -36,6 +36,7 @@ class mtSpOp : public SpBase< out_eT, mtSpOp > static constexpr bool is_xvec = spop_type::template traits::is_xvec; inline explicit mtSpOp(const T1& in_m); + inline mtSpOp(const T1& in_m, const in_eT in_aux); inline mtSpOp(const T1& in_m, const uword aux_uword_a, const uword aux_uword_b); inline mtSpOp(const char junk, const T1& in_m, const out_eT in_aux); inline ~mtSpOp(); @@ -44,6 +45,7 @@ class mtSpOp : public SpBase< out_eT, mtSpOp > arma_inline bool is_alias(const SpMat& X) const; arma_aligned const T1& m; //!< the operand; must be derived from SpBase + arma_aligned in_eT aux; //!< auxiliary data, using the element type as used by T1 arma_aligned out_eT aux_out_eT; //!< auxiliary data, using the element type as specified by the out_eT template parameter arma_aligned uword aux_uword_a; arma_aligned uword aux_uword_b; diff --git a/inst/include/armadillo_bits/mtSpOp_meat.hpp b/inst/include/armadillo_bits/mtSpOp_meat.hpp index 525851b5..59d2f3eb 100644 --- a/inst/include/armadillo_bits/mtSpOp_meat.hpp +++ b/inst/include/armadillo_bits/mtSpOp_meat.hpp @@ -31,6 +31,17 @@ mtSpOp::mtSpOp(const T1& in_m) +template +inline +mtSpOp::mtSpOp(const T1& in_m, const typename T1::elem_type in_aux) + : m(in_m) + , aux(in_aux) + { + arma_debug_sigprint(); + } + + + template inline mtSpOp::mtSpOp(const T1& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b) diff --git a/inst/include/armadillo_bits/mtSpToDOp_bones.hpp b/inst/include/armadillo_bits/mtSpToDOp_bones.hpp deleted file mode 100644 index 83aae4d0..00000000 --- a/inst/include/armadillo_bits/mtSpToDOp_bones.hpp +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// -// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) -// Copyright 2008-2016 National ICT Australia (NICTA) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ------------------------------------------------------------------------ - - -//! \addtogroup mtSpToDOp -//! @{ - - - -template -class mtSpToDOp : public Base< out_eT, mtSpToDOp > - { - public: - - typedef out_eT elem_type; - typedef typename get_pod_type::result pod_type; - - typedef typename T1::elem_type in_eT; - - static constexpr bool is_row = op_type::template traits::is_row; - static constexpr bool is_col = op_type::template traits::is_col; - static constexpr bool is_xvec = op_type::template traits::is_xvec; - - inline explicit mtSpToDOp(const T1& in_m); - inline mtSpToDOp(const T1& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b); - inline ~mtSpToDOp(); - - arma_aligned const T1& m; //!< the operand; must be derived from SpBase - arma_aligned uword aux_uword_a; //!< auxiliary data, uword format - arma_aligned uword aux_uword_b; //!< auxiliary data, uword format - }; - - - -//! @} diff --git a/inst/include/armadillo_bits/mtSpToDOp_meat.hpp b/inst/include/armadillo_bits/mtSpToDOp_meat.hpp deleted file mode 100644 index 7065490d..00000000 --- a/inst/include/armadillo_bits/mtSpToDOp_meat.hpp +++ /dev/null @@ -1,55 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// -// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) -// Copyright 2008-2016 National ICT Australia (NICTA) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ------------------------------------------------------------------------ - - -//! \addtogroup mtSpToDOp -//! @{ - - - -template -inline -mtSpToDOp::mtSpToDOp(const T1& in_m) - : m(in_m) - { - arma_debug_sigprint(); - } - - - -template -inline -mtSpToDOp::mtSpToDOp(const T1& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b) - : m(in_m) - , aux_uword_a(in_aux_uword_a) - , aux_uword_b(in_aux_uword_b) - { - arma_debug_sigprint(); - } - - - -template -inline -mtSpToDOp::~mtSpToDOp() - { - arma_debug_sigprint(); - } - - - -//! @} diff --git a/inst/include/armadillo_bits/newarp_SparseGenRealShiftSolve_meat.hpp b/inst/include/armadillo_bits/newarp_SparseGenRealShiftSolve_meat.hpp index 0d2cab20..9213d2be 100644 --- a/inst/include/armadillo_bits/newarp_SparseGenRealShiftSolve_meat.hpp +++ b/inst/include/armadillo_bits/newarp_SparseGenRealShiftSolve_meat.hpp @@ -68,7 +68,7 @@ SparseGenRealShiftSolve::SparseGenRealShiftSolve(const SpMat& mat_obj, c if(slu_info != 0) { - arma_conform_warn(2, "matrix is singular to working precision"); + arma_warn(2, "matrix is singular to working precision"); return; } @@ -77,8 +77,8 @@ SparseGenRealShiftSolve::SparseGenRealShiftSolve(const SpMat& mat_obj, c if( (x_rcond < std::numeric_limits::epsilon()) || arma_isnan(x_rcond) ) { - if(x_rcond == eT(0)) { arma_conform_warn(2, "matrix is singular to working precision"); } - else { arma_conform_warn(2, "matrix is singular to working precision (rcond: ", x_rcond, ")"); } + if(x_rcond == eT(0)) { arma_warn(2, "matrix is singular to working precision"); } + else { arma_warn(2, "matrix is singular to working precision (rcond: ", x_rcond, ")"); } return; } diff --git a/inst/include/armadillo_bits/op_chol_meat.hpp b/inst/include/armadillo_bits/op_chol_meat.hpp index b0bf2bbc..d79f989f 100644 --- a/inst/include/armadillo_bits/op_chol_meat.hpp +++ b/inst/include/armadillo_bits/op_chol_meat.hpp @@ -56,8 +56,8 @@ op_chol::apply_direct(Mat& out, const Base::no ) { arma_conform_warn(1, "chol(): given matrix is not symmetric"); } - if(is_cx::yes) { arma_conform_warn(1, "chol(): given matrix is not hermitian"); } + if(is_cx::no ) { arma_warn(1, "chol(): given matrix is not symmetric"); } + if(is_cx::yes) { arma_warn(1, "chol(): given matrix is not hermitian"); } } uword KD = 0; diff --git a/inst/include/armadillo_bits/op_cond_meat.hpp b/inst/include/armadillo_bits/op_cond_meat.hpp index 295f2121..f0ac5829 100644 --- a/inst/include/armadillo_bits/op_cond_meat.hpp +++ b/inst/include/armadillo_bits/op_cond_meat.hpp @@ -81,7 +81,7 @@ op_cond::apply_diag(const Mat& A) if(arma_isnan(abs_val)) { - arma_conform_warn(3, "cond(): failed"); + arma_warn(3, "cond(): failed"); return Datum::nan; } @@ -112,7 +112,7 @@ op_cond::apply_sym(Mat& A) if(status == false) { - arma_conform_warn(3, "cond(): failed"); + arma_warn(3, "cond(): failed"); return Datum::nan; } @@ -154,7 +154,7 @@ op_cond::apply_gen(Mat& A) if(status == false) { - arma_conform_warn(3, "cond(): failed"); + arma_warn(3, "cond(): failed"); return Datum::nan; } diff --git a/inst/include/armadillo_bits/op_expmat_meat.hpp b/inst/include/armadillo_bits/op_expmat_meat.hpp index 35ceda6c..7dd076b8 100644 --- a/inst/include/armadillo_bits/op_expmat_meat.hpp +++ b/inst/include/armadillo_bits/op_expmat_meat.hpp @@ -202,7 +202,7 @@ op_expmat_sym::apply_direct(Mat& out, const Base 0) && (is_cx::yes) && (sym_helper::check_diag_imag(X) == false)) { - arma_conform_warn(1, "inv_sympd(): imaginary components on diagonal are non-zero"); + arma_warn(1, "inv_sympd(): imaginary components on diagonal are non-zero"); } if(is_op_diagmat::value || X.is_diagmat()) diff --git a/inst/include/armadillo_bits/op_find_meat.hpp b/inst/include/armadillo_bits/op_find_meat.hpp index f70916b5..6654add2 100644 --- a/inst/include/armadillo_bits/op_find_meat.hpp +++ b/inst/include/armadillo_bits/op_find_meat.hpp @@ -95,7 +95,7 @@ op_find::helper if((is_same_type::yes || is_same_type::yes) && arma_config::check_conform && arma_isnan(val)) { - arma_conform_warn(1, "find(): NaN is not equal to anything; suggest to use find_nonfinite() instead"); + arma_warn(1, "find(): NaN is not equal to anything; suggest to use find_nonfinite() instead"); } const Proxy A(X.m); @@ -228,7 +228,7 @@ op_find::helper if((is_same_type::yes || is_same_type::yes) && arma_config::check_conform && arma_isnan(val)) { - arma_conform_warn(1, "find(): NaN is not equal to anything; suggest to use find_nonfinite() instead"); + arma_warn(1, "find(): NaN is not equal to anything; suggest to use find_nonfinite() instead"); } const Proxy A(X.m); @@ -520,7 +520,7 @@ op_find_finite::apply(Mat& out, const mtOp& X) { arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_conform_warn(1, "find_finite(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_warn(1, "find_finite(): detection of non-finite values is not reliable in fast math mode"); } const Proxy P(X.m); @@ -568,7 +568,7 @@ op_find_nonfinite::apply(Mat& out, const mtOp P(X.m); @@ -616,7 +616,7 @@ op_find_nan::apply(Mat& out, const mtOp& X) { arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_conform_warn(1, "find_nan(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_warn(1, "find_nan(): detection of non-finite values is not reliable in fast math mode"); } const Proxy P(X.m); diff --git a/inst/include/armadillo_bits/op_inv_spd_meat.hpp b/inst/include/armadillo_bits/op_inv_spd_meat.hpp index 11d6415f..13994e38 100644 --- a/inst/include/armadillo_bits/op_inv_spd_meat.hpp +++ b/inst/include/armadillo_bits/op_inv_spd_meat.hpp @@ -154,13 +154,13 @@ op_inv_spd_full::apply_direct(Mat& out, const Base::no ) { arma_conform_warn(1, "inv_sympd(): given matrix is not symmetric"); } - if(is_cx::yes) { arma_conform_warn(1, "inv_sympd(): given matrix is not hermitian"); } + if(is_cx::no ) { arma_warn(1, "inv_sympd(): given matrix is not symmetric"); } + if(is_cx::yes) { arma_warn(1, "inv_sympd(): given matrix is not hermitian"); } } else if((is_cx::yes) && (sym_helper::check_diag_imag(out) == false)) { - arma_conform_warn(1, "inv_sympd(): imaginary components on diagonal are non-zero"); + arma_warn(1, "inv_sympd(): imaginary components on diagonal are non-zero"); } } @@ -288,13 +288,13 @@ op_inv_spd_rcond::apply_direct(Mat& out, op_inv_spd_stat { if(auxlib::rudimentary_sym_check(out) == false) { - if(is_cx::no ) { arma_conform_warn(1, "inv_sympd(): given matrix is not symmetric"); } - if(is_cx::yes) { arma_conform_warn(1, "inv_sympd(): given matrix is not hermitian"); } + if(is_cx::no ) { arma_warn(1, "inv_sympd(): given matrix is not symmetric"); } + if(is_cx::yes) { arma_warn(1, "inv_sympd(): given matrix is not hermitian"); } } else if((is_cx::yes) && (sym_helper::check_diag_imag(out) == false)) { - arma_conform_warn(1, "inv_sympd(): imaginary components on diagonal are non-zero"); + arma_warn(1, "inv_sympd(): imaginary components on diagonal are non-zero"); } } diff --git a/inst/include/armadillo_bits/op_log_det_meat.hpp b/inst/include/armadillo_bits/op_log_det_meat.hpp index b143295d..5601597d 100644 --- a/inst/include/armadillo_bits/op_log_det_meat.hpp +++ b/inst/include/armadillo_bits/op_log_det_meat.hpp @@ -197,7 +197,7 @@ op_log_det_sympd::apply_direct(typename T1::pod_type& out_val, const Base 0) && (is_cx::yes) && (sym_helper::check_diag_imag(A) == false)) { - arma_conform_warn(1, "log_det_sympd(): imaginary components on diagonal are non-zero"); + arma_warn(1, "log_det_sympd(): imaginary components on diagonal are non-zero"); } if(is_op_diagmat::value || A.is_diagmat()) @@ -227,8 +227,8 @@ op_log_det_sympd::apply_direct(typename T1::pod_type& out_val, const Base::no ) { arma_conform_warn(1, "log_det_sympd(): given matrix is not symmetric"); } - if(is_cx::yes) { arma_conform_warn(1, "log_det_sympd(): given matrix is not hermitian"); } + if(is_cx::no ) { arma_warn(1, "log_det_sympd(): given matrix is not symmetric"); } + if(is_cx::yes) { arma_warn(1, "log_det_sympd(): given matrix is not hermitian"); } } return auxlib::log_det_sympd(out_val, A); diff --git a/inst/include/armadillo_bits/op_logmat_meat.hpp b/inst/include/armadillo_bits/op_logmat_meat.hpp index 0baa641a..67136602 100644 --- a/inst/include/armadillo_bits/op_logmat_meat.hpp +++ b/inst/include/armadillo_bits/op_logmat_meat.hpp @@ -399,7 +399,7 @@ op_logmat_cx::apply_common(Mat< std::complex >& out, Mat< std::complex >& iter++; } - if(iter >= n_iters) { arma_conform_warn(2, "logmat(): reached max iterations without full convergence"); } + if(iter >= n_iters) { arma_warn(2, "logmat(): reached max iterations without full convergence"); } S.diag() -= eT(1); @@ -507,7 +507,7 @@ op_logmat_sympd::apply_direct(Mat& out, const Base 0) && (is_cx::yes) && (sym_helper::check_diag_imag(X) == false)) { - arma_conform_warn(1, "logmat_sympd(): imaginary components on diagonal are non-zero"); + arma_warn(1, "logmat_sympd(): imaginary components on diagonal are non-zero"); } if(is_op_diagmat::value || X.is_diagmat()) diff --git a/inst/include/armadillo_bits/op_norm2est_meat.hpp b/inst/include/armadillo_bits/op_norm2est_meat.hpp index 07b12ce9..bf7d4497 100644 --- a/inst/include/armadillo_bits/op_norm2est_meat.hpp +++ b/inst/include/armadillo_bits/op_norm2est_meat.hpp @@ -116,7 +116,7 @@ op_norm2est::norm2est if(A.n_elem == 0) { return T(0); } - if(A.internal_has_nonfinite()) { arma_conform_warn(1, "norm2est(): given matrix has non-finite elements"); } + if(A.internal_has_nonfinite()) { arma_warn(1, "norm2est(): given matrix has non-finite elements"); } if((A.n_rows == 1) || (A.n_cols == 1)) { return op_norm::vec_norm_2( Proxy< Mat >(A) ); } @@ -196,7 +196,7 @@ op_norm2est::norm2est if(A.n_nonzero == 0) { return T(0); } - if(A.internal_has_nonfinite()) { arma_conform_warn(1, "norm2est(): given matrix has non-finite elements"); } + if(A.internal_has_nonfinite()) { arma_warn(1, "norm2est(): given matrix has non-finite elements"); } if((A.n_rows == 1) || (A.n_cols == 1)) { return spop_norm::vec_norm_k(A.values, A.n_nonzero, 2); } diff --git a/inst/include/armadillo_bits/op_norm_meat.hpp b/inst/include/armadillo_bits/op_norm_meat.hpp index 85871d5e..210dfd8f 100644 --- a/inst/include/armadillo_bits/op_norm_meat.hpp +++ b/inst/include/armadillo_bits/op_norm_meat.hpp @@ -889,7 +889,7 @@ op_norm::mat_norm_2(const Mat& X) typedef typename get_pod_type::result T; - if(X.internal_has_nonfinite()) { arma_conform_warn(1, "norm(): given matrix has non-finite elements"); } + if(X.internal_has_nonfinite()) { arma_warn(1, "norm(): given matrix has non-finite elements"); } Col S; diff --git a/inst/include/armadillo_bits/op_sqrtmat_meat.hpp b/inst/include/armadillo_bits/op_sqrtmat_meat.hpp index 0313d600..44017455 100644 --- a/inst/include/armadillo_bits/op_sqrtmat_meat.hpp +++ b/inst/include/armadillo_bits/op_sqrtmat_meat.hpp @@ -40,7 +40,7 @@ op_sqrtmat::apply(Mat< std::complex >& out, const mtOp& out, const Op& out, const Base::yes) && (sym_helper::check_diag_imag(X) == false)) { - arma_conform_warn(1, "sqrtmat_sympd(): imaginary components on the diagonal are non-zero"); + arma_warn(1, "sqrtmat_sympd(): imaginary components on the diagonal are non-zero"); } if(is_op_diagmat::value || X.is_diagmat()) diff --git a/inst/include/armadillo_bits/operator_minus.hpp b/inst/include/armadillo_bits/operator_minus.hpp index 730ea3ca..3cc1bba2 100644 --- a/inst/include/armadillo_bits/operator_minus.hpp +++ b/inst/include/armadillo_bits/operator_minus.hpp @@ -36,6 +36,36 @@ operator- +// //! unary - +// template +// arma_inline +// typename +// enable_if2< (is_arma_type::value && is_signed::value), const eOp >::result +// operator- +// (const T1& X) +// { +// arma_debug_sigprint(); +// +// return eOp(X); +// } +// +// +// +// template +// arma_inline +// typename enable_if2< (is_arma_type::value && (is_signed::value == false)), const eOp >::result +// operator- +// (const T1& X) +// { +// arma_debug_sigprint(); +// +// typedef typename T1::elem_type eT; +// +// return eOp(X, eT(-1)); +// } + + + //! Base - scalar template arma_inline @@ -227,19 +257,26 @@ operator- { arma_debug_sigprint(); + typedef typename T1::elem_type eT; + const SpProxy pa(x); - Mat result(-y); + const quasi_unwrap UB(y); + const Mat& B = UB.M; + + Mat result = -B; arma_conform_assert_same_size( pa.get_n_rows(), pa.get_n_cols(), result.n_rows, result.n_cols, "subtraction" ); typename SpProxy::const_iterator_type it = pa.begin(); typename SpProxy::const_iterator_type it_end = pa.end(); - while(it != it_end) + for(; it != it_end; ++it) { - result.at(it.row(), it.col()) += (*it); - ++it; + const uword r = it.row(); + const uword c = it.col(); + + result.at(r, c) = (*it) - B.at(r,c); } return result; diff --git a/inst/include/armadillo_bits/operator_relational.hpp b/inst/include/armadillo_bits/operator_relational.hpp index e6560039..5bd6d7ca 100644 --- a/inst/include/armadillo_bits/operator_relational.hpp +++ b/inst/include/armadillo_bits/operator_relational.hpp @@ -480,4 +480,226 @@ operator|| +// +// +// + + + +template +inline +typename +enable_if2 + < + (is_arma_sparse_type::value && (is_cx::no)), + const mtSpOp + >::result +operator< +(const typename T1::elem_type val, const T1& X) + { + arma_debug_sigprint(); + + return mtSpOp(X, val); + } + + + +template +inline +typename +enable_if2 + < + (is_arma_sparse_type::value && (is_cx::no)), + const mtSpOp + >::result +operator< +(const T1& X, const typename T1::elem_type val) + { + arma_debug_sigprint(); + + return mtSpOp(X, val); + } + + + +template +inline +typename +enable_if2 + < + (is_arma_sparse_type::value && (is_cx::no)), + const mtSpOp + >::result +operator> +(const typename T1::elem_type val, const T1& X) + { + arma_debug_sigprint(); + + return mtSpOp(X, val); + } + + + +template +inline +typename +enable_if2 + < + (is_arma_sparse_type::value && (is_cx::no)), + const mtSpOp + >::result +operator> +(const T1& X, const typename T1::elem_type val) + { + arma_debug_sigprint(); + + return mtSpOp(X, val); + } + + + +template +inline +typename +enable_if2 + < + (is_arma_sparse_type::value && (is_cx::no)), + const mtSpOp + >::result +operator<= +(const typename T1::elem_type val, const T1& X) + { + arma_debug_sigprint(); + + return mtSpOp(X, val); + } + + + +template +inline +typename +enable_if2 + < + (is_arma_sparse_type::value && (is_cx::no)), + const mtSpOp + >::result +operator<= +(const T1& X, const typename T1::elem_type val) + { + arma_debug_sigprint(); + + return mtSpOp(X, val); + } + + + +template +inline +typename +enable_if2 + < + (is_arma_sparse_type::value && (is_cx::no)), + const mtSpOp + >::result +operator>= +(const typename T1::elem_type val, const T1& X) + { + arma_debug_sigprint(); + + return mtSpOp(X, val); + } + + + +template +inline +typename +enable_if2 + < + (is_arma_sparse_type::value && (is_cx::no)), + const mtSpOp + >::result +operator>= +(const T1& X, const typename T1::elem_type val) + { + arma_debug_sigprint(); + + return mtSpOp(X, val); + } + + + +template +inline +typename +enable_if2 + < + is_arma_sparse_type::value, + const mtSpOp + >::result +operator== +(const typename T1::elem_type val, const T1& X) + { + arma_debug_sigprint(); + + return mtSpOp(X, val); + } + + + +template +inline +typename +enable_if2 + < + is_arma_sparse_type::value, + const mtSpOp + >::result +operator== +(const T1& X, const typename T1::elem_type val) + { + arma_debug_sigprint(); + + return mtSpOp(X, val); + } + + + +template +inline +typename +enable_if2 + < + is_arma_sparse_type::value, + const mtSpOp + >::result +operator!= +(const typename T1::elem_type val, const T1& X) + { + arma_debug_sigprint(); + + return mtSpOp(X, val); + } + + + +template +inline +typename +enable_if2 + < + is_arma_sparse_type::value, + const mtSpOp + >::result +operator!= +(const T1& X, const typename T1::elem_type val) + { + arma_debug_sigprint(); + + return mtSpOp(X, val); + } + + + //! @} diff --git a/inst/include/armadillo_bits/restrictors.hpp b/inst/include/armadillo_bits/restrictors.hpp index 019a5f41..78d84f8a 100644 --- a/inst/include/armadillo_bits/restrictors.hpp +++ b/inst/include/armadillo_bits/restrictors.hpp @@ -182,6 +182,21 @@ template<> struct arma_glue_rel_only< glue_rel_or > { typedef int result; }; +template struct arma_spop_rel_only { }; + +template<> struct arma_spop_rel_only< spop_rel_lt_pre > { typedef int result; }; +template<> struct arma_spop_rel_only< spop_rel_lt_post > { typedef int result; }; +template<> struct arma_spop_rel_only< spop_rel_gt_pre > { typedef int result; }; +template<> struct arma_spop_rel_only< spop_rel_gt_post > { typedef int result; }; +template<> struct arma_spop_rel_only< spop_rel_lteq_pre > { typedef int result; }; +template<> struct arma_spop_rel_only< spop_rel_lteq_post > { typedef int result; }; +template<> struct arma_spop_rel_only< spop_rel_gteq_pre > { typedef int result; }; +template<> struct arma_spop_rel_only< spop_rel_gteq_post > { typedef int result; }; +template<> struct arma_spop_rel_only< spop_rel_eq > { typedef int result; }; +template<> struct arma_spop_rel_only< spop_rel_noteq > { typedef int result; }; + + + template struct arma_Mat_Col_Row_only { }; template struct arma_Mat_Col_Row_only< Mat > { typedef Mat result; }; diff --git a/inst/include/armadillo_bits/running_stat_meat.hpp b/inst/include/armadillo_bits/running_stat_meat.hpp index 795e11cc..00f73deb 100644 --- a/inst/include/armadillo_bits/running_stat_meat.hpp +++ b/inst/include/armadillo_bits/running_stat_meat.hpp @@ -164,7 +164,7 @@ running_stat::operator() (const typename running_stat::T sample) if( arma_isfinite(sample) == false ) { - arma_conform_warn(3, "running_stat: sample ignored as it is non-finite" ); + arma_warn(3, "running_stat: sample ignored as it is non-finite" ); return; } @@ -183,7 +183,7 @@ running_stat::operator() (const std::complex< typename running_stat::T > if( arma_isfinite(sample) == false ) { - arma_conform_warn(3, "running_stat: sample ignored as it is non-finite" ); + arma_warn(3, "running_stat: sample ignored as it is non-finite" ); return; } diff --git a/inst/include/armadillo_bits/running_stat_vec_meat.hpp b/inst/include/armadillo_bits/running_stat_vec_meat.hpp index 32aed2d9..d949ac81 100644 --- a/inst/include/armadillo_bits/running_stat_vec_meat.hpp +++ b/inst/include/armadillo_bits/running_stat_vec_meat.hpp @@ -100,7 +100,7 @@ running_stat_vec::operator() (const Base::operator() (const Base< std::complex& eigval, Mat& eigvec, const SpBase& X, c if((arma_config::check_conform) && (sp_auxlib::rudimentary_sym_check(U.M) == false)) { - if(is_cx::no ) { arma_conform_warn(1, "eigs_sym(): given matrix is not symmetric"); } - if(is_cx::yes) { arma_conform_warn(1, "eigs_sym(): given matrix is not hermitian"); } + if(is_cx::no ) { arma_warn(1, "eigs_sym(): given matrix is not symmetric"); } + if(is_cx::yes) { arma_warn(1, "eigs_sym(): given matrix is not hermitian"); } } if(arma_config::check_nonfinite && U.M.internal_has_nonfinite()) { - arma_conform_warn(3, "eigs_sym(): detected non-finite elements"); + arma_warn(3, "eigs_sym(): detected non-finite elements"); return false; } @@ -122,13 +122,13 @@ sp_auxlib::eigs_sym(Col& eigval, Mat& eigvec, const SpBase& X, c if((arma_config::check_conform) && (sp_auxlib::rudimentary_sym_check(U.M) == false)) { - if(is_cx::no ) { arma_conform_warn(1, "eigs_sym(): given matrix is not symmetric"); } - if(is_cx::yes) { arma_conform_warn(1, "eigs_sym(): given matrix is not hermitian"); } + if(is_cx::no ) { arma_warn(1, "eigs_sym(): given matrix is not symmetric"); } + if(is_cx::yes) { arma_warn(1, "eigs_sym(): given matrix is not hermitian"); } } if(arma_config::check_nonfinite && U.M.internal_has_nonfinite()) { - arma_conform_warn(3, "eigs_sym(): detected non-finite elements"); + arma_warn(3, "eigs_sym(): detected non-finite elements"); return false; } @@ -195,13 +195,13 @@ sp_auxlib::eigs_sym_newarp(Col& eigval, Mat& eigvec, const SpMat& X, { if(opts.subdim < (n_eigvals + 1)) { - arma_conform_warn(1, "eigs_sym(): opts.subdim must be greater than k; using k+1 instead of ", opts.subdim); + arma_warn(1, "eigs_sym(): opts.subdim must be greater than k; using k+1 instead of ", opts.subdim); ncv = uword(n_eigvals + 1); } else if(opts.subdim > n) { - arma_conform_warn(1, "eigs_sym(): opts.subdim cannot be greater than n_rows; using n_rows instead of ", opts.subdim); + arma_warn(1, "eigs_sym(): opts.subdim cannot be greater than n_rows; using n_rows instead of ", opts.subdim); ncv = n; } else @@ -328,13 +328,13 @@ sp_auxlib::eigs_sym_newarp(Col& eigval, Mat& eigvec, const SpMat& X, { if(opts.subdim < (n_eigvals + 1)) { - arma_conform_warn(1, "eigs_sym(): opts.subdim must be greater than k; using k+1 instead of ", opts.subdim); + arma_warn(1, "eigs_sym(): opts.subdim must be greater than k; using k+1 instead of ", opts.subdim); ncv = uword(n_eigvals + 1); } else if(opts.subdim > n) { - arma_conform_warn(1, "eigs_sym(): opts.subdim cannot be greater than n_rows; using n_rows instead of ", opts.subdim); + arma_warn(1, "eigs_sym(): opts.subdim cannot be greater than n_rows; using n_rows instead of ", opts.subdim); ncv = n; } else @@ -457,13 +457,13 @@ sp_auxlib::eigs_sym_arpack(Col& eigval, Mat& eigvec, const SpMat& X, { if(opts.subdim < (n_eigvals + 1)) { - arma_conform_warn(1, "eigs_sym(): opts.subdim must be greater than k; using k+1 instead of ", opts.subdim); + arma_warn(1, "eigs_sym(): opts.subdim must be greater than k; using k+1 instead of ", opts.subdim); ncv = blas_int(n_eigvals + 1); } else if(blas_int(opts.subdim) > n) { - arma_conform_warn(1, "eigs_sym(): opts.subdim cannot be greater than n_rows; using n_rows instead of ", opts.subdim); + arma_warn(1, "eigs_sym(): opts.subdim cannot be greater than n_rows; using n_rows instead of ", opts.subdim); ncv = n; } else @@ -503,7 +503,7 @@ sp_auxlib::eigs_sym_arpack(Col& eigval, Mat& eigvec, const SpMat& X, arpack::seupd(&rvec, &howmny, select.memptr(), eigval.memptr(), eigvec.memptr(), &ldz, (eT*) &sigma, &bmat, &n, which, &nev, &tol, resid.memptr(), &ncv, v.memptr(), &ldv, iparam.memptr(), ipntr.memptr(), workd.memptr(), workl.memptr(), &lworkl, &info); // Check for errors. - if(info != 0) { arma_conform_warn(1, "eigs_sym(): ARPACK error ", info, " in seupd()"); return false; } + if(info != 0) { arma_warn(1, "eigs_sym(): ARPACK error ", info, " in seupd()"); return false; } return (info == 0); } @@ -538,7 +538,7 @@ sp_auxlib::eigs_gen(Col< std::complex >& eigval, Mat< std::complex >& eigv if(arma_config::check_nonfinite && U.M.internal_has_nonfinite()) { - arma_conform_warn(3, "eigs_gen(): detected non-finite elements"); + arma_warn(3, "eigs_gen(): detected non-finite elements"); return false; } @@ -585,7 +585,7 @@ sp_auxlib::eigs_gen(Col< std::complex >& eigval, Mat< std::complex >& eigv if(arma_config::check_nonfinite && U.M.internal_has_nonfinite()) { - arma_conform_warn(3, "eigs_gen(): detected non-finite elements"); + arma_warn(3, "eigs_gen(): detected non-finite elements"); return false; } @@ -648,13 +648,13 @@ sp_auxlib::eigs_gen_newarp(Col< std::complex >& eigval, Mat< std::complex { if(opts.subdim < (n_eigvals + 3)) { - arma_conform_warn(1, "eigs_gen(): opts.subdim must be greater than k+2; using k+3 instead of ", opts.subdim); + arma_warn(1, "eigs_gen(): opts.subdim must be greater than k+2; using k+3 instead of ", opts.subdim); ncv = uword(n_eigvals + 3); } else if(opts.subdim > n) { - arma_conform_warn(1, "eigs_gen(): opts.subdim cannot be greater than n_rows; using n_rows instead of ", opts.subdim); + arma_warn(1, "eigs_gen(): opts.subdim cannot be greater than n_rows; using n_rows instead of ", opts.subdim); ncv = n; } else @@ -830,13 +830,13 @@ sp_auxlib::eigs_gen_arpack(Col< std::complex >& eigval, Mat< std::complex { if(opts.subdim < (n_eigvals + 3)) { - arma_conform_warn(1, "eigs_gen(): opts.subdim must be greater than k+2; using k+3 instead of ", opts.subdim); + arma_warn(1, "eigs_gen(): opts.subdim must be greater than k+2; using k+3 instead of ", opts.subdim); ncv = blas_int(n_eigvals + 3); } else if(blas_int(opts.subdim) > n) { - arma_conform_warn(1, "eigs_gen(): opts.subdim cannot be greater than n_rows; using n_rows instead of ", opts.subdim); + arma_warn(1, "eigs_gen(): opts.subdim cannot be greater than n_rows; using n_rows instead of ", opts.subdim); ncv = n; } else @@ -890,7 +890,7 @@ sp_auxlib::eigs_gen_arpack(Col< std::complex >& eigval, Mat< std::complex arpack::neupd(&rvec, &howmny, select.memptr(), dr.memptr(), di.memptr(), z.memptr(), &ldz, (T*) &sigmar, (T*) &sigmai, workev.memptr(), &bmat, &n, which, &nev, &tol, resid.memptr(), &ncv, v.memptr(), &ldv, iparam.memptr(), ipntr.memptr(), workd.memptr(), workl.memptr(), &lworkl, rwork.memptr(), &info); // Check for errors. - if(info != 0) { arma_conform_warn(1, "eigs_gen(): ARPACK error ", info, " in neupd()"); return false; } + if(info != 0) { arma_warn(1, "eigs_gen(): ARPACK error ", info, " in neupd()"); return false; } // Put it into the outputs. eigval.set_size(n_eigvals); @@ -967,7 +967,7 @@ sp_auxlib::eigs_gen(Col< std::complex >& eigval, Mat< std::complex >& eigv if(arma_config::check_nonfinite && U.M.internal_has_nonfinite()) { - arma_conform_warn(3, "eigs_gen(): detected non-finite elements"); + arma_warn(3, "eigs_gen(): detected non-finite elements"); return false; } @@ -992,7 +992,7 @@ sp_auxlib::eigs_gen(Col< std::complex >& eigval, Mat< std::complex >& eigv if(arma_config::check_nonfinite && U.M.internal_has_nonfinite()) { - arma_conform_warn(3, "eigs_gen(): detected non-finite elements"); + arma_warn(3, "eigs_gen(): detected non-finite elements"); return false; } @@ -1087,13 +1087,13 @@ sp_auxlib::eigs_gen(Col< std::complex >& eigval, Mat< std::complex >& eigv { if(opts.subdim < (n_eigvals + 3)) { - arma_conform_warn(1, "eigs_gen(): opts.subdim must be greater than k+2; using k+3 instead of ", opts.subdim); + arma_warn(1, "eigs_gen(): opts.subdim must be greater than k+2; using k+3 instead of ", opts.subdim); ncv = blas_int(n_eigvals + 3); } else if(blas_int(opts.subdim) > n) { - arma_conform_warn(1, "eigs_gen(): opts.subdim cannot be greater than n_rows; using n_rows instead of ", opts.subdim); + arma_warn(1, "eigs_gen(): opts.subdim cannot be greater than n_rows; using n_rows instead of ", opts.subdim); ncv = n; } else @@ -1138,7 +1138,7 @@ sp_auxlib::eigs_gen(Col< std::complex >& eigval, Mat< std::complex >& eigv (std::complex*) NULL, eigvec.memptr(), &ldz, (std::complex*) &sigma, (std::complex*) NULL, workev.memptr(), &bmat, &n, which, &nev, &tol, resid.memptr(), &ncv, v.memptr(), &ldv, iparam.memptr(), ipntr.memptr(), workd.memptr(), workl.memptr(), &lworkl, rwork.memptr(), &info); // Check for errors. - if(info != 0) { arma_conform_warn(1, "eigs_gen(): ARPACK error ", info, " in neupd()"); return false; } + if(info != 0) { arma_warn(1, "eigs_gen(): ARPACK error ", info, " in neupd()"); return false; } return (info == 0); } @@ -1198,7 +1198,7 @@ sp_auxlib::spsolve_simple(Mat& X, const SpBase& X, const SpBase int(A.n_cols)) { - arma_conform_warn(1, "spsolve(): memory allocation failure"); + arma_warn(1, "spsolve(): memory allocation failure"); } else if(info < 0) { - arma_conform_warn(1, "spsolve(): unknown SuperLU error code from gssv(): ", info); + arma_warn(1, "spsolve(): unknown SuperLU error code from gssv(): ", info); } // No need to extract the data from x, since it's using the same memory as X @@ -1323,7 +1323,7 @@ sp_auxlib::spsolve_refine(Mat& X, typename T1::pod_type& if(arma_config::check_nonfinite && (A.internal_has_nonfinite() || B.internal_has_nonfinite())) { - arma_conform_warn(3, "spsolve(): detected non-finite elements"); + arma_warn(3, "spsolve(): detected non-finite elements"); return false; } @@ -1400,23 +1400,23 @@ sp_auxlib::spsolve_refine(Mat& X, typename T1::pod_type& { // std::ostringstream tmp; // tmp << "spsolve(): could not solve system; LU factorisation completed, but detected zero in U(" << (info-1) << ',' << (info-1) << ')'; - // arma_conform_warn(1, tmp.str()); + // arma_warn(1, tmp.str()); } else if( (info == int(A.n_cols+1)) && (user_opts.allow_ugly) ) { - arma_conform_warn(2, "spsolve(): system is singular to working precision (rcond: ", rcond, ")"); + arma_warn(2, "spsolve(): system is singular to working precision (rcond: ", rcond, ")"); status = true; } else if(info > int(A.n_cols+1)) { - arma_conform_warn(1, "spsolve(): memory allocation failure"); + arma_warn(1, "spsolve(): memory allocation failure"); } else if(info < 0) { - arma_conform_warn(1, "spsolve(): unknown SuperLU error code from gssvx(): ", info); + arma_warn(1, "spsolve(): unknown SuperLU error code from gssvx(): ", info); } // No need to extract the data from x, since it's using the same memory as X @@ -1884,7 +1884,7 @@ sp_auxlib::spsolve_refine(Mat& X, typename T1::pod_type& if(out.Stype == superlu::SLU_DN) { tmp << "SLU_DN"; } if(out.Stype == superlu::SLU_NR_loc) { tmp << "SLU_NR_loc"; } - arma_conform_warn(1, tmp.str()); + arma_warn(1, tmp.str()); arma_stop_runtime_error("internal error: sp_auxlib::destroy_supermatrix()"); } } @@ -2012,11 +2012,11 @@ sp_auxlib::run_aupd_plain if(sym) { - arma_conform_warn(1, "eigs_sym(): ARPACK error ", info, " in saupd()"); + arma_warn(1, "eigs_sym(): ARPACK error ", info, " in saupd()"); } else { - arma_conform_warn(1, "eigs_gen(): ARPACK error ", info, " in naupd()"); + arma_warn(1, "eigs_gen(): ARPACK error ", info, " in naupd()"); } return; // Parent frame can look at the value of info. @@ -2185,7 +2185,7 @@ sp_auxlib::run_aupd_shiftinvert if(slu_info != 0) { - arma_conform_warn(2, "matrix is singular to working precision"); + arma_warn(2, "matrix is singular to working precision"); info = blas_int(-1); return; } @@ -2196,7 +2196,7 @@ sp_auxlib::run_aupd_shiftinvert if( (x_rcond < std::numeric_limits::epsilon()) || arma_isnan(x_rcond) ) { - arma_conform_warn(2, "matrix is singular to working precision (rcond: ", x_rcond, ")"); + arma_warn(2, "matrix is singular to working precision (rcond: ", x_rcond, ")"); info = blas_int(-1); return; } @@ -2266,11 +2266,11 @@ sp_auxlib::run_aupd_shiftinvert if(sym) { - arma_conform_warn(2, "eigs_sym(): ARPACK error ", info, " in saupd()"); + arma_warn(2, "eigs_sym(): ARPACK error ", info, " in saupd()"); } else { - arma_conform_warn(2, "eigs_gen(): ARPACK error ", info, " in naupd()"); + arma_warn(2, "eigs_gen(): ARPACK error ", info, " in naupd()"); } return; // Parent frame can look at the value of info. @@ -2673,7 +2673,7 @@ superlu_worker::factorise(typename get_pod_type::result& out_rcond, cons if( (l == nullptr) || (u == nullptr) ) { - arma_conform_warn(3, "superlu_worker()::factorise(): could not construct SuperLU matrix"); + arma_warn(3, "superlu_worker()::factorise(): could not construct SuperLU matrix"); return false; } @@ -2690,7 +2690,7 @@ superlu_worker::factorise(typename get_pod_type::result& out_rcond, cons if(status_AA == false) { - arma_conform_warn(3, "superlu_worker()::factorise(): could not construct SuperLU matrix"); + arma_warn(3, "superlu_worker()::factorise(): could not construct SuperLU matrix"); return false; } @@ -2718,7 +2718,7 @@ superlu_worker::factorise(typename get_pod_type::result& out_rcond, cons if(info != 0) { - arma_conform_warn(3, "superlu_worker()::factorise(): LU factorisation failed"); + arma_warn(3, "superlu_worker()::factorise(): LU factorisation failed"); return false; } @@ -2757,7 +2757,7 @@ superlu_worker::solve(Mat& X, const Mat& B) if(status_XX == false) { - arma_conform_warn(3, "superlu_worker()::solve(): could not construct SuperLU matrix"); + arma_warn(3, "superlu_worker()::solve(): could not construct SuperLU matrix"); return false; } diff --git a/inst/include/armadillo_bits/spdiagview_meat.hpp b/inst/include/armadillo_bits/spdiagview_meat.hpp index 1a5b113c..b08585d6 100644 --- a/inst/include/armadillo_bits/spdiagview_meat.hpp +++ b/inst/include/armadillo_bits/spdiagview_meat.hpp @@ -888,7 +888,7 @@ spdiagview::replace(const eT old_val, const eT new_val) if(old_val == eT(0)) { - arma_conform_warn(1, "spdiagview::replace(): replacement not done, as old_val = 0"); + arma_warn(1, "spdiagview::replace(): replacement not done, as old_val = 0"); } else { diff --git a/inst/include/armadillo_bits/spop_relational_bones.hpp b/inst/include/armadillo_bits/spop_relational_bones.hpp new file mode 100644 index 00000000..780475f4 --- /dev/null +++ b/inst/include/armadillo_bits/spop_relational_bones.hpp @@ -0,0 +1,134 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + + +//! \addtogroup spop_relational +//! @{ + + + +class spop_rel_lt_pre + : public traits_op_passthru + { + public: + + template + inline static void apply(SpMat& out, const mtSpOp& X); + }; + + + +class spop_rel_lt_post + : public traits_op_passthru + { + public: + + template + inline static void apply(SpMat& out, const mtSpOp& X); + }; + + + +class spop_rel_gt_pre + : public traits_op_passthru + { + public: + + template + inline static void apply(SpMat& out, const mtSpOp& X); + }; + + + +class spop_rel_gt_post + : public traits_op_passthru + { + public: + + template + inline static void apply(SpMat& out, const mtSpOp& X); + }; + + + +class spop_rel_lteq_pre + : public traits_op_passthru + { + public: + + template + inline static void apply(SpMat& out, const mtSpOp& X); + }; + + + +class spop_rel_lteq_post + : public traits_op_passthru + { + public: + + template + inline static void apply(SpMat& out, const mtSpOp& X); + }; + + + +class spop_rel_gteq_pre + : public traits_op_passthru + { + public: + + template + inline static void apply(SpMat& out, const mtSpOp& X); + }; + + + +class spop_rel_gteq_post + : public traits_op_passthru + { + public: + + template + inline static void apply(SpMat& out, const mtSpOp& X); + }; + + + +class spop_rel_eq + : public traits_op_passthru + { + public: + + template + inline static void apply(SpMat& out, const mtSpOp& X); + }; + + + +class spop_rel_noteq + : public traits_op_passthru + { + public: + + template + inline static void apply(SpMat& out, const mtSpOp& X); + }; + + + +//! @} diff --git a/inst/include/armadillo_bits/spop_relational_meat.hpp b/inst/include/armadillo_bits/spop_relational_meat.hpp new file mode 100644 index 00000000..d31fc699 --- /dev/null +++ b/inst/include/armadillo_bits/spop_relational_meat.hpp @@ -0,0 +1,521 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + + +//! \addtogroup spop_relational +//! @{ + +// NOTE: in general, relational operations between sparse matrices and scalars +// NOTE: have the risk of producing sparse matrices with most elements as non-zeros. +// NOTE: these operations should only be used as an argument to the accu() function, +// NOTE: which aims to omit the generation of intermediate sparse matrices. + + +#undef operator_rel + +#undef arma_applier_spmat_pre +#undef arma_applier_spmat_post + + +#define arma_applier_spmat_pre(operator_rel)\ + {\ + const uword zero_comp_val = (k operator_rel eT(0)) ? uword(1) : uword(0);\ + \ + const uword n_cols = A.n_cols;\ + const uword n_rows = A.n_rows;\ + const uword n_elem = A.n_elem;\ + \ + Mat tmp(n_rows, n_cols);\ + \ + typename SpMat::const_iterator it = A.begin();\ + typename SpMat::const_iterator it_end = A.end();\ + \ + uword last_pos = 0;\ + uword offset = 0;\ + \ + for(; it != it_end; ++it)\ + {\ + const uword cur_pos = it.row() + n_rows * it.col();\ + \ + if((cur_pos - last_pos) > offset)\ + {\ + arrayops::inplace_set(tmp.memptr() + last_pos + offset, zero_comp_val, cur_pos - last_pos - offset);\ + }\ + \ + tmp.at(cur_pos) = (k operator_rel (*it)) ? uword(1) : uword(0);\ + \ + last_pos = cur_pos;\ + offset = 1;\ + }\ + \ + if(last_pos != (n_elem-1))\ + {\ + arrayops::inplace_set(tmp.memptr() + last_pos + offset, zero_comp_val, (n_elem - last_pos));\ + }\ + \ + out = tmp;\ + } + + + +#define arma_applier_spmat_post(operator_rel)\ + {\ + const uword zero_comp_val = (eT(0) operator_rel k) ? uword(1) : uword(0);\ + \ + const uword n_cols = A.n_cols;\ + const uword n_rows = A.n_rows;\ + const uword n_elem = A.n_elem;\ + \ + Mat tmp(n_rows, n_cols);\ + \ + typename SpMat::const_iterator it = A.begin();\ + typename SpMat::const_iterator it_end = A.end();\ + \ + uword last_pos = 0;\ + uword offset = 0;\ + \ + for(; it != it_end; ++it)\ + {\ + const uword cur_pos = it.row() + n_rows * it.col();\ + \ + if((cur_pos - last_pos) > offset)\ + {\ + arrayops::inplace_set(tmp.memptr() + last_pos + offset, zero_comp_val, cur_pos - last_pos - offset);\ + }\ + \ + tmp.at(cur_pos) = ((*it) operator_rel k) ? uword(1) : uword(0);\ + \ + last_pos = cur_pos;\ + offset = 1;\ + }\ + \ + if(last_pos != (n_elem-1))\ + {\ + arrayops::inplace_set(tmp.memptr() + last_pos + offset, zero_comp_val, (n_elem - last_pos));\ + }\ + \ + out = tmp;\ + } + + + +template +inline +void +spop_rel_lt_pre::apply(SpMat& out, const mtSpOp& X) + { + arma_debug_sigprint(); + + // operation: scalar < spmat + + typedef typename T1::elem_type eT; + + const eT k = X.aux; + + const unwrap_spmat U(X.m); + const SpMat& A = U.M; + + if(k > eT(0)) + { + arma_debug_print("optimisation: k > 0"); + + SpMat tmp(A.n_rows, A.n_cols); + + typename SpMat::const_iterator it = A.begin(); + typename SpMat::const_iterator it_end = A.end(); + + for(; it != it_end; ++it) + { + if( k < (*it) ) { tmp.at(it.row(), it.col()) = uword(1); } + } + + out.steal_mem(tmp); + } + else + { + arma_applier_spmat_pre( < ); + } + } + + + +template +inline +void +spop_rel_gt_pre::apply(SpMat& out, const mtSpOp& X) + { + arma_debug_sigprint(); + + // operation: scalar > spmat + + typedef typename T1::elem_type eT; + + const eT k = X.aux; + + const unwrap_spmat U(X.m); + const SpMat& A = U.M; + + if(k < eT(0)) + { + arma_debug_print("optimisation: k < 0"); + + SpMat tmp(A.n_rows, A.n_cols); + + typename SpMat::const_iterator it = A.begin(); + typename SpMat::const_iterator it_end = A.end(); + + for(; it != it_end; ++it) + { + if( k > (*it) ) { tmp.at(it.row(), it.col()) = uword(1); } + } + + out.steal_mem(tmp); + } + else + { + arma_applier_spmat_pre( > ); + } + } + + + +template +inline +void +spop_rel_lteq_pre::apply(SpMat& out, const mtSpOp& X) + { + arma_debug_sigprint(); + + // operation: scalar <= spmat + + typedef typename T1::elem_type eT; + + const eT k = X.aux; + + const unwrap_spmat U(X.m); + const SpMat& A = U.M; + + if(k > eT(0)) + { + arma_debug_print("optimisation: k > 0"); + + SpMat tmp(A.n_rows, A.n_cols); + + typename SpMat::const_iterator it = A.begin(); + typename SpMat::const_iterator it_end = A.end(); + + for(; it != it_end; ++it) + { + if( k <= (*it) ) { tmp.at(it.row(), it.col()) = uword(1); } + } + + out.steal_mem(tmp); + } + else + { + arma_applier_spmat_pre( <= ); + } + } + + + +template +inline +void +spop_rel_gteq_pre::apply(SpMat& out, const mtSpOp& X) + { + arma_debug_sigprint(); + + // operation: scalar >= spmat + + typedef typename T1::elem_type eT; + + const eT k = X.aux; + + const unwrap_spmat U(X.m); + const SpMat& A = U.M; + + if(k < eT(0)) + { + arma_debug_print("optimisation: k < 0"); + + SpMat tmp(A.n_rows, A.n_cols); + + typename SpMat::const_iterator it = A.begin(); + typename SpMat::const_iterator it_end = A.end(); + + for(; it != it_end; ++it) + { + if( k >= (*it) ) { tmp.at(it.row(), it.col()) = uword(1); } + } + + out.steal_mem(tmp); + } + else + { + arma_applier_spmat_pre( >= ); + } + } + + + +template +inline +void +spop_rel_lt_post::apply(SpMat& out, const mtSpOp& X) + { + arma_debug_sigprint(); + + // operation: spmat < scalar + + typedef typename T1::elem_type eT; + + const eT k = X.aux; + + const unwrap_spmat U(X.m); + const SpMat& A = U.M; + + if(k < eT(0)) + { + arma_debug_print("optimisation: k < 0"); + + SpMat tmp(A.n_rows, A.n_cols); + + typename SpMat::const_iterator it = A.begin(); + typename SpMat::const_iterator it_end = A.end(); + + for(; it != it_end; ++it) + { + if( (*it) < k ) { tmp.at(it.row(), it.col()) = uword(1); } + } + + out.steal_mem(tmp); + } + else + { + arma_applier_spmat_post( < ); + } + } + + + +template +inline +void +spop_rel_gt_post::apply(SpMat& out, const mtSpOp& X) + { + arma_debug_sigprint(); + + // operation: spmat > scalar + + typedef typename T1::elem_type eT; + + const eT k = X.aux; + + const unwrap_spmat U(X.m); + const SpMat& A = U.M; + + if(k > eT(0)) + { + arma_debug_print("optimisation: k > 0"); + + SpMat tmp(A.n_rows, A.n_cols); + + typename SpMat::const_iterator it = A.begin(); + typename SpMat::const_iterator it_end = A.end(); + + for(; it != it_end; ++it) + { + if( (*it) > k ) { tmp.at(it.row(), it.col()) = uword(1); } + } + + out.steal_mem(tmp); + } + else + { + arma_applier_spmat_post( > ); + } + } + + + +template +inline +void +spop_rel_lteq_post::apply(SpMat& out, const mtSpOp& X) + { + arma_debug_sigprint(); + + // operation: spmat <= scalar + + typedef typename T1::elem_type eT; + + const eT k = X.aux; + + const unwrap_spmat U(X.m); + const SpMat& A = U.M; + + if(k < eT(0)) + { + arma_debug_print("optimisation: k < 0"); + + SpMat tmp(A.n_rows, A.n_cols); + + typename SpMat::const_iterator it = A.begin(); + typename SpMat::const_iterator it_end = A.end(); + + for(; it != it_end; ++it) + { + if( (*it) <= k ) { tmp.at(it.row(), it.col()) = uword(1); } + } + + out.steal_mem(tmp); + } + else + { + arma_applier_spmat_post( <= ); + } + } + + + +template +inline +void +spop_rel_gteq_post::apply(SpMat& out, const mtSpOp& X) + { + arma_debug_sigprint(); + + // operation: spmat >= scalar + + typedef typename T1::elem_type eT; + + const eT k = X.aux; + + const unwrap_spmat U(X.m); + const SpMat& A = U.M; + + if(k > eT(0)) + { + arma_debug_print("optimisation: k > 0"); + + SpMat tmp(A.n_rows, A.n_cols); + + typename SpMat::const_iterator it = A.begin(); + typename SpMat::const_iterator it_end = A.end(); + + for(; it != it_end; ++it) + { + if( (*it) >= k ) { tmp.at(it.row(), it.col()) = uword(1); } + } + + out.steal_mem(tmp); + } + else + { + arma_applier_spmat_post( >= ); + } + } + + + +template +inline +void +spop_rel_eq::apply(SpMat& out, const mtSpOp& X) + { + arma_debug_sigprint(); + + // operation: spmat == scalar + + typedef typename T1::elem_type eT; + + const eT k = X.aux; + + const unwrap_spmat U(X.m); + const SpMat& A = U.M; + + if(k != eT(0)) + { + arma_debug_print("optimisation: k != 0"); + + SpMat tmp(A.n_rows, A.n_cols); + + typename SpMat::const_iterator it = A.begin(); + typename SpMat::const_iterator it_end = A.end(); + + for(; it != it_end; ++it) + { + if( (*it) == k ) { tmp.at(it.row(), it.col()) = uword(1); } + } + + out.steal_mem(tmp); + } + else + { + arma_applier_spmat_post( == ); + } + } + + + +template +inline +void +spop_rel_noteq::apply(SpMat& out, const mtSpOp& X) + { + arma_debug_sigprint(); + + // operation: spmat != scalar + + typedef typename T1::elem_type eT; + + const eT k = X.aux; + + const unwrap_spmat U(X.m); + const SpMat& A = U.M; + + if(k == eT(0)) + { + arma_debug_print("optimisation: k = 0"); + + SpMat tmp(A.n_rows, A.n_cols); + + typename SpMat::const_iterator it = A.begin(); + typename SpMat::const_iterator it_end = A.end(); + + for(; it != it_end; ++it) + { + tmp.at(it.row(), it.col()) = uword(1); + } + + out.steal_mem(tmp); + } + else + { + arma_applier_spmat_post( != ); + } + } + + + +#undef arma_applier_spmat_pre +#undef arma_applier_spmat_post + + + +//! @} diff --git a/inst/include/armadillo_bits/spsolve_factoriser_meat.hpp b/inst/include/armadillo_bits/spsolve_factoriser_meat.hpp index 09744900..4206035c 100644 --- a/inst/include/armadillo_bits/spsolve_factoriser_meat.hpp +++ b/inst/include/armadillo_bits/spsolve_factoriser_meat.hpp @@ -134,7 +134,7 @@ spsolve_factoriser::factorise if(A.is_square() == false) { - arma_conform_warn(1, "spsolve_factoriser::factorise(): solving under-determined / over-determined systems is currently not supported"); + arma_warn(1, "spsolve_factoriser::factorise(): solving under-determined / over-determined systems is currently not supported"); return false; } @@ -148,7 +148,7 @@ spsolve_factoriser::factorise if( (opts.pivot_thresh < double(0)) || (opts.pivot_thresh > double(1)) ) { - arma_conform_warn(1, "spsolve_factoriser::factorise(): pivot_thresh must be in the [0,1] interval" ); + arma_warn(1, "spsolve_factoriser::factorise(): pivot_thresh must be in the [0,1] interval" ); return false; } @@ -158,7 +158,7 @@ spsolve_factoriser::factorise if(worker_ptr == nullptr) { - arma_conform_warn(3, "spsolve_factoriser::factorise(): could not construct worker object"); + arma_warn(3, "spsolve_factoriser::factorise(): could not construct worker object"); return false; } @@ -184,7 +184,7 @@ spsolve_factoriser::factorise if( (status == false) || arma_isnan(local_rcond_value) || ((opts.allow_ugly == false) && (local_rcond_value < std::numeric_limits::epsilon())) ) { - arma_conform_warn(3, "spsolve_factoriser::factorise(): factorisation failed; rcond: ", local_rcond_value); + arma_warn(3, "spsolve_factoriser::factorise(): factorisation failed; rcond: ", local_rcond_value); delete_worker(); return false; } @@ -224,7 +224,7 @@ spsolve_factoriser::solve if(worker_ptr == nullptr) { - arma_conform_warn(2, "spsolve_factoriser::solve(): no factorisation available"); + arma_warn(2, "spsolve_factoriser::solve(): no factorisation available"); X.soft_reset(); return false; } @@ -238,7 +238,7 @@ spsolve_factoriser::solve if(type_mismatch) { - arma_conform_warn(1, "spsolve_factoriser::solve(): matrix type mismatch"); + arma_warn(1, "spsolve_factoriser::solve(): matrix type mismatch"); X.soft_reset(); return false; } @@ -248,7 +248,7 @@ spsolve_factoriser::solve if(n_rows != B.n_rows) { - arma_conform_warn(1, "spsolve_factoriser::solve(): matrix size mismatch"); + arma_warn(1, "spsolve_factoriser::solve(): matrix size mismatch"); X.soft_reset(); return false; } @@ -267,7 +267,7 @@ spsolve_factoriser::solve if(status == false) { - arma_conform_warn(3, "spsolve_factoriser::solve(): solution not found"); + arma_warn(3, "spsolve_factoriser::solve(): solution not found"); X.soft_reset(); return false; } diff --git a/inst/include/armadillo_bits/subview_cube_meat.hpp b/inst/include/armadillo_bits/subview_cube_meat.hpp index c90d20ae..a4295aa1 100644 --- a/inst/include/armadillo_bits/subview_cube_meat.hpp +++ b/inst/include/armadillo_bits/subview_cube_meat.hpp @@ -1346,7 +1346,7 @@ subview_cube::is_finite() const { arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_conform_warn(1, "is_finite(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_warn(1, "is_finite(): detection of non-finite values is not reliable in fast math mode"); } const uword local_n_rows = n_rows; const uword local_n_cols = n_cols; @@ -1396,7 +1396,7 @@ subview_cube::has_inf() const { arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_inf(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_warn(1, "has_inf(): detection of non-finite values is not reliable in fast math mode"); } const uword local_n_rows = n_rows; const uword local_n_cols = n_cols; @@ -1422,7 +1422,7 @@ subview_cube::has_nan() const { arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_nan(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_warn(1, "has_nan(): detection of non-finite values is not reliable in fast math mode"); } const uword local_n_rows = n_rows; const uword local_n_cols = n_cols; @@ -1448,7 +1448,7 @@ subview_cube::has_nonfinite() const { arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_nonfinite(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_warn(1, "has_nonfinite(): detection of non-finite values is not reliable in fast math mode"); } const uword local_n_rows = n_rows; const uword local_n_cols = n_cols; diff --git a/inst/include/armadillo_bits/subview_meat.hpp b/inst/include/armadillo_bits/subview_meat.hpp index 6535eb9b..3f03f0d6 100644 --- a/inst/include/armadillo_bits/subview_meat.hpp +++ b/inst/include/armadillo_bits/subview_meat.hpp @@ -1485,7 +1485,7 @@ subview::is_finite() const { arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_conform_warn(1, "is_finite(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_warn(1, "is_finite(): detection of non-finite values is not reliable in fast math mode"); } const uword local_n_rows = n_rows; const uword local_n_cols = n_cols; @@ -1527,7 +1527,7 @@ subview::has_inf() const { arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_inf(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_warn(1, "has_inf(): detection of non-finite values is not reliable in fast math mode"); } const uword local_n_rows = n_rows; const uword local_n_cols = n_cols; @@ -1549,7 +1549,7 @@ subview::has_nan() const { arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_nan(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_warn(1, "has_nan(): detection of non-finite values is not reliable in fast math mode"); } const uword local_n_rows = n_rows; const uword local_n_cols = n_cols; @@ -1571,7 +1571,7 @@ subview::has_nonfinite() const { arma_debug_sigprint(); - if(arma_config::fast_math_warn) { arma_conform_warn(1, "has_nonfinite(): detection of non-finite values is not reliable in fast math mode"); } + if(arma_config::fast_math_warn) { arma_warn(1, "has_nonfinite(): detection of non-finite values is not reliable in fast math mode"); } const uword local_n_rows = n_rows; const uword local_n_cols = n_cols; diff --git a/inst/include/armadillo_bits/unwrap.hpp b/inst/include/armadillo_bits/unwrap.hpp index 9418b4c6..bedd564a 100644 --- a/inst/include/armadillo_bits/unwrap.hpp +++ b/inst/include/armadillo_bits/unwrap.hpp @@ -303,7 +303,7 @@ struct quasi_unwrap< Mat > static constexpr bool has_orig_mem = true; template - arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&M) == void_ptr(&X)); } + arma_inline bool is_alias(const Mat& X) const { return (is_same_type::yes) && (void_ptr(&M) == void_ptr(&X)); } }; @@ -326,7 +326,7 @@ struct quasi_unwrap< Row > static constexpr bool has_orig_mem = true; template - arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&M) == void_ptr(&X)); } + arma_inline bool is_alias(const Mat& X) const { return (is_same_type::yes) && (void_ptr(&M) == void_ptr(&X)); } }; @@ -348,7 +348,7 @@ struct quasi_unwrap< Col > static constexpr bool has_orig_mem = true; template - arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&M) == void_ptr(&X)); } + arma_inline bool is_alias(const Mat& X) const { return (is_same_type::yes) && (void_ptr(&M) == void_ptr(&X)); } }; @@ -372,7 +372,7 @@ struct quasi_unwrap< subview > static constexpr bool has_orig_mem = false; // NOTE: set to false as this is the general case; original memory is only used when the subview is a contiguous chunk template - arma_inline bool is_alias(const Mat& X) const { return ( ((sv.aux_row1 == 0) && (sv.n_rows == sv.m.n_rows)) ? (void_ptr(&(sv.m)) == void_ptr(&X)) : false ); } + arma_inline bool is_alias(const Mat& X) const { return (is_same_type::yes) && ( ((sv.aux_row1 == 0) && (sv.n_rows == sv.m.n_rows)) ? (void_ptr(&(sv.m)) == void_ptr(&X)) : false ); } }; @@ -418,7 +418,7 @@ struct quasi_unwrap< subview_col > static constexpr bool has_orig_mem = true; template - arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&orig) == void_ptr(&X)); } + arma_inline bool is_alias(const Mat& X) const { return (is_same_type::yes) && (void_ptr(&orig) == void_ptr(&X)); } }; @@ -442,7 +442,7 @@ struct quasi_unwrap< subview_cols > static constexpr bool has_orig_mem = true; template - arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&orig) == void_ptr(&X)); } + arma_inline bool is_alias(const Mat& X) const { return (is_same_type::yes) && (void_ptr(&orig) == void_ptr(&X)); } }; @@ -536,7 +536,7 @@ struct quasi_unwrap< Op, op_strans> > static constexpr bool has_orig_mem = true; template - arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&orig) == void_ptr(&X)); } + arma_inline bool is_alias(const Mat& X) const { return (is_same_type::yes) && (void_ptr(&orig) == void_ptr(&X)); } }; @@ -560,7 +560,7 @@ struct quasi_unwrap< Op, op_strans> > static constexpr bool has_orig_mem = true; template - arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&orig) == void_ptr(&X)); } + arma_inline bool is_alias(const Mat& X) const { return (is_same_type::yes) && (void_ptr(&orig) == void_ptr(&X)); } }; @@ -584,7 +584,7 @@ struct quasi_unwrap< Op, op_strans> > static constexpr bool has_orig_mem = true; template - arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&X) == void_ptr(&orig)); } + arma_inline bool is_alias(const Mat& X) const { return (is_same_type::yes) && (void_ptr(&X) == void_ptr(&orig)); } }; @@ -616,7 +616,7 @@ struct quasi_unwrap_Col_htrans< Op, op_htrans> > static constexpr bool has_orig_mem = true; template - arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&orig) == void_ptr(&X)); } + arma_inline bool is_alias(const Mat& X) const { return (is_same_type::yes) && (void_ptr(&orig) == void_ptr(&X)); } }; @@ -680,7 +680,7 @@ struct quasi_unwrap_Row_htrans< Op, op_htrans> > static constexpr bool has_orig_mem = true; template - arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&orig) == void_ptr(&X)); } + arma_inline bool is_alias(const Mat& X) const { return (is_same_type::yes) && (void_ptr(&orig) == void_ptr(&X)); } }; @@ -744,7 +744,7 @@ struct quasi_unwrap_subview_col_htrans< Op, op_htrans> > static constexpr bool has_orig_mem = true; template - arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&orig) == void_ptr(&X)); } + arma_inline bool is_alias(const Mat& X) const { return (is_same_type::yes) && (void_ptr(&orig) == void_ptr(&X)); } }; diff --git a/inst/include/armadillo_bits/unwrap_spmat.hpp b/inst/include/armadillo_bits/unwrap_spmat.hpp index 460b9621..8cd55a32 100644 --- a/inst/include/armadillo_bits/unwrap_spmat.hpp +++ b/inst/include/armadillo_bits/unwrap_spmat.hpp @@ -60,7 +60,7 @@ struct unwrap_spmat< SpMat > const SpMat& M; template - arma_inline bool is_alias(const SpMat& X) const { return (void_ptr(&M) == void_ptr(&X)); } + arma_inline bool is_alias(const SpMat& X) const { return (is_same_type::yes) && (void_ptr(&M) == void_ptr(&X)); } }; @@ -82,7 +82,7 @@ struct unwrap_spmat< SpRow > const SpRow& M; template - arma_inline bool is_alias(const SpMat& X) const { return (void_ptr(&M) == void_ptr(&X)); } + arma_inline bool is_alias(const SpMat& X) const { return (is_same_type::yes) && (void_ptr(&M) == void_ptr(&X)); } }; @@ -104,7 +104,7 @@ struct unwrap_spmat< SpCol > const SpCol& M; template - arma_inline bool is_alias(const SpMat& X) const { return (void_ptr(&M) == void_ptr(&X)); } + arma_inline bool is_alias(const SpMat& X) const { return (is_same_type::yes) && (void_ptr(&M) == void_ptr(&X)); } }; From 169402c573b66e00f2ba98974a0ee785bb38cc85 Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Sun, 23 Jun 2024 07:53:28 -0500 Subject: [PATCH 6/7] Armadillo 14.0.0 rc1 --- inst/include/armadillo_bits/Col_meat.hpp | 12 ++++++++++++ inst/include/armadillo_bits/Cube_meat.hpp | 8 ++++++++ inst/include/armadillo_bits/Mat_meat.hpp | 8 ++++++++ inst/include/armadillo_bits/Row_meat.hpp | 12 ++++++++++++ inst/include/armadillo_bits/arma_version.hpp | 4 ++-- 5 files changed, 42 insertions(+), 2 deletions(-) diff --git a/inst/include/armadillo_bits/Col_meat.hpp b/inst/include/armadillo_bits/Col_meat.hpp index cbbf7c43..bb07f9bb 100644 --- a/inst/include/armadillo_bits/Col_meat.hpp +++ b/inst/include/armadillo_bits/Col_meat.hpp @@ -104,6 +104,10 @@ Col::Col(const uword in_n_elem, const arma_initmode_indicator&) arma_debug_print("Col::constructor: zeroing memory"); arrayops::fill_zeros(Mat::memptr(), Mat::n_elem); } + else + { + arma_debug_print("Col::constructor: not zeroing memory"); + } } @@ -124,6 +128,10 @@ Col::Col(const uword in_n_rows, const uword in_n_cols, const arma_initmode_i arma_debug_print("Col::constructor: zeroing memory"); arrayops::fill_zeros(Mat::memptr(), Mat::n_elem); } + else + { + arma_debug_print("Col::constructor: not zeroing memory"); + } } @@ -144,6 +152,10 @@ Col::Col(const SizeMat& s, const arma_initmode_indicator&) arma_debug_print("Col::constructor: zeroing memory"); arrayops::fill_zeros(Mat::memptr(), Mat::n_elem); } + else + { + arma_debug_print("Col::constructor: not zeroing memory"); + } } diff --git a/inst/include/armadillo_bits/Cube_meat.hpp b/inst/include/armadillo_bits/Cube_meat.hpp index 3caa0153..591c6202 100644 --- a/inst/include/armadillo_bits/Cube_meat.hpp +++ b/inst/include/armadillo_bits/Cube_meat.hpp @@ -129,6 +129,10 @@ Cube::Cube(const uword in_n_rows, const uword in_n_cols, const uword in_n_sl arma_debug_print("Cube::constructor: zeroing memory"); arrayops::fill_zeros(memptr(), n_elem); } + else + { + arma_debug_print("Cube::constructor: not zeroing memory"); + } } @@ -156,6 +160,10 @@ Cube::Cube(const SizeCube& s, const arma_initmode_indicator&) arma_debug_print("Cube::constructor: zeroing memory"); arrayops::fill_zeros(memptr(), n_elem); } + else + { + arma_debug_print("Cube::constructor: not zeroing memory"); + } } diff --git a/inst/include/armadillo_bits/Mat_meat.hpp b/inst/include/armadillo_bits/Mat_meat.hpp index 3afe3536..b738fd27 100644 --- a/inst/include/armadillo_bits/Mat_meat.hpp +++ b/inst/include/armadillo_bits/Mat_meat.hpp @@ -123,6 +123,10 @@ Mat::Mat(const uword in_n_rows, const uword in_n_cols, const arma_initmode_i arma_debug_print("Mat::constructor: zeroing memory"); arrayops::fill_zeros(memptr(), n_elem); } + else + { + arma_debug_print("Mat::constructor: not zeroing memory"); + } } @@ -149,6 +153,10 @@ Mat::Mat(const SizeMat& s, const arma_initmode_indicator&) arma_debug_print("Mat::constructor: zeroing memory"); arrayops::fill_zeros(memptr(), n_elem); } + else + { + arma_debug_print("Mat::constructor: not zeroing memory"); + } } diff --git a/inst/include/armadillo_bits/Row_meat.hpp b/inst/include/armadillo_bits/Row_meat.hpp index 935e7fe3..17ff05b8 100644 --- a/inst/include/armadillo_bits/Row_meat.hpp +++ b/inst/include/armadillo_bits/Row_meat.hpp @@ -104,6 +104,10 @@ Row::Row(const uword in_n_elem, const arma_initmode_indicator&) arma_debug_print("Row::constructor: zeroing memory"); arrayops::fill_zeros(Mat::memptr(), Mat::n_elem); } + else + { + arma_debug_print("Row::constructor: not zeroing memory"); + } } @@ -124,6 +128,10 @@ Row::Row(const uword in_n_rows, const uword in_n_cols, const arma_initmode_i arma_debug_print("Row::constructor: zeroing memory"); arrayops::fill_zeros(Mat::memptr(), Mat::n_elem); } + else + { + arma_debug_print("Row::constructor: not zeroing memory"); + } } @@ -144,6 +152,10 @@ Row::Row(const SizeMat& s, const arma_initmode_indicator&) arma_debug_print("Row::constructor: zeroing memory"); arrayops::fill_zeros(Mat::memptr(), Mat::n_elem); } + else + { + arma_debug_print("Row::constructor: not zeroing memory"); + } } diff --git a/inst/include/armadillo_bits/arma_version.hpp b/inst/include/armadillo_bits/arma_version.hpp index e7bec3e6..54ea18ca 100644 --- a/inst/include/armadillo_bits/arma_version.hpp +++ b/inst/include/armadillo_bits/arma_version.hpp @@ -22,9 +22,9 @@ #define ARMA_VERSION_MAJOR 13 -#define ARMA_VERSION_MINOR 90 +#define ARMA_VERSION_MINOR 91 #define ARMA_VERSION_PATCH 0 -#define ARMA_VERSION_NAME "unstable - not for production use" +#define ARMA_VERSION_NAME "14.0-RC1" From c9d85976698a3025c403e2e6bad55a67c84faabd Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Mon, 24 Jun 2024 06:17:26 -0500 Subject: [PATCH 7/7] Marking as candidate 0.12.8.4.0.14.4 with the 4th 14.0.0 iteration --- ChangeLog | 7 +++++++ DESCRIPTION | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4bb9a796..0461bd14 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2024-06-23 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): RcppArmadillo 0.12.8.4.0.14.4 ie the + fourth test package of the 14.0.0 development branch + + * inst/include/armadillo_bits/: Armadillo 14.0.0 rc1 + 2024-05-30 Dirk Eddelbuettel * DESCRIPTION (Version, Date): RcppArmadillo 0.12.8.4.0 diff --git a/DESCRIPTION b/DESCRIPTION index 01947570..21a43c8c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: RcppArmadillo Type: Package Title: 'Rcpp' Integration for the 'Armadillo' Templated Linear Algebra Library -Version: 0.12.8.4.0.14.3 -Date: 2024-06-21 +Version: 0.12.8.4.0.14.4 +Date: 2024-06-23 Author: Dirk Eddelbuettel, Romain Francois, Doug Bates, Binxiang Ni, and Conrad Sanderson Maintainer: Dirk Eddelbuettel Description: 'Armadillo' is a templated C++ linear algebra library (by Conrad