From f989552d704c10a0958dca3ad55bc5856514eaf1 Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Wed, 23 Apr 2025 07:03:43 -0500 Subject: [PATCH 1/4] Armadillo 14.4.2 rc --- inst/include/armadillo_bits/config.hpp | 12 +++ inst/include/armadillo_bits/def_superlu.hpp | 24 ++--- .../armadillo_bits/glue_times_meat.hpp | 34 +++++++ .../armadillo_bits/include_superlu.hpp | 97 ++++++++++--------- .../include/armadillo_bits/op_expmat_meat.hpp | 25 ++++- .../include/armadillo_bits/sp_auxlib_meat.hpp | 30 +++--- .../armadillo_bits/translate_superlu.hpp | 12 +-- 7 files changed, 154 insertions(+), 80 deletions(-) diff --git a/inst/include/armadillo_bits/config.hpp b/inst/include/armadillo_bits/config.hpp index 46d77bc2..955dbc13 100644 --- a/inst/include/armadillo_bits/config.hpp +++ b/inst/include/armadillo_bits/config.hpp @@ -303,6 +303,18 @@ #undef ARMA_64BIT_WORD #endif +#if (defined(ARMA_BLAS_LONG_LONG) && defined(ARMA_USE_WRAPPER)) + #pragma message ("WARNING: use of ARMA_BLAS_LONG_LONG in conjunction with ARMA_USE_WRAPPER is not supported") +#endif + +#if (defined(ARMA_BLAS_64BIT_INT) && defined(ARMA_USE_WRAPPER)) + #pragma message ("WARNING: use of ARMA_BLAS_64BIT_INT in conjunction with ARMA_USE_WRAPPER is not supported") +#endif + +#if (defined(ARMA_SUPERLU_64BIT_INT) && defined(ARMA_USE_WRAPPER)) + #pragma message ("WARNING: use of ARMA_SUPERLU_64BIT_INT in conjunction with ARMA_USE_WRAPPER is not supported") +#endif + // for compatibility with earlier versions of Armadillo #if defined(ARMA_BLAS_LONG) || defined(ARMA_BLAS_LONG_LONG) #undef ARMA_BLAS_64BIT_INT diff --git a/inst/include/armadillo_bits/def_superlu.hpp b/inst/include/armadillo_bits/def_superlu.hpp index 81f6ac39..ca48ad2c 100644 --- a/inst/include/armadillo_bits/def_superlu.hpp +++ b/inst/include/armadillo_bits/def_superlu.hpp @@ -19,20 +19,20 @@ extern "C" { - extern void arma_wrapper(sgssv)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, int*); - extern void arma_wrapper(dgssv)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, int*); - extern void arma_wrapper(cgssv)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, int*); - extern void arma_wrapper(zgssv)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, int*); + extern void arma_wrapper(sgssv)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, superlu::int_t*); + extern void arma_wrapper(dgssv)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, superlu::int_t*); + extern void arma_wrapper(cgssv)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, superlu::int_t*); + extern void arma_wrapper(zgssv)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, superlu::int_t*); - extern void arma_wrapper(sgssvx)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, int*, char*, float*, float*, superlu::SuperMatrix*, superlu::SuperMatrix*, void*, int, superlu::SuperMatrix*, superlu::SuperMatrix*, float*, float*, float*, float*, superlu::GlobalLU_t*, superlu::mem_usage_t*, superlu::SuperLUStat_t*, int*); - extern void arma_wrapper(dgssvx)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, int*, char*, double*, double*, superlu::SuperMatrix*, superlu::SuperMatrix*, void*, int, superlu::SuperMatrix*, superlu::SuperMatrix*, double*, double*, double*, double*, superlu::GlobalLU_t*, superlu::mem_usage_t*, superlu::SuperLUStat_t*, int*); - extern void arma_wrapper(cgssvx)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, int*, char*, float*, float*, superlu::SuperMatrix*, superlu::SuperMatrix*, void*, int, superlu::SuperMatrix*, superlu::SuperMatrix*, float*, float*, float*, float*, superlu::GlobalLU_t*, superlu::mem_usage_t*, superlu::SuperLUStat_t*, int*); - extern void arma_wrapper(zgssvx)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, int*, char*, double*, double*, superlu::SuperMatrix*, superlu::SuperMatrix*, void*, int, superlu::SuperMatrix*, superlu::SuperMatrix*, double*, double*, double*, double*, superlu::GlobalLU_t*, superlu::mem_usage_t*, superlu::SuperLUStat_t*, int*); + extern void arma_wrapper(sgssvx)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, int*, char*, float*, float*, superlu::SuperMatrix*, superlu::SuperMatrix*, void*, superlu::int_t, superlu::SuperMatrix*, superlu::SuperMatrix*, float*, float*, float*, float*, superlu::GlobalLU_t*, superlu::mem_usage_t*, superlu::SuperLUStat_t*, superlu::int_t*); + extern void arma_wrapper(dgssvx)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, int*, char*, double*, double*, superlu::SuperMatrix*, superlu::SuperMatrix*, void*, superlu::int_t, superlu::SuperMatrix*, superlu::SuperMatrix*, double*, double*, double*, double*, superlu::GlobalLU_t*, superlu::mem_usage_t*, superlu::SuperLUStat_t*, superlu::int_t*); + extern void arma_wrapper(cgssvx)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, int*, char*, float*, float*, superlu::SuperMatrix*, superlu::SuperMatrix*, void*, superlu::int_t, superlu::SuperMatrix*, superlu::SuperMatrix*, float*, float*, float*, float*, superlu::GlobalLU_t*, superlu::mem_usage_t*, superlu::SuperLUStat_t*, superlu::int_t*); + extern void arma_wrapper(zgssvx)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, int*, char*, double*, double*, superlu::SuperMatrix*, superlu::SuperMatrix*, void*, superlu::int_t, superlu::SuperMatrix*, superlu::SuperMatrix*, double*, double*, double*, double*, superlu::GlobalLU_t*, superlu::mem_usage_t*, superlu::SuperLUStat_t*, superlu::int_t*); - extern void arma_wrapper(sgstrf)(superlu::superlu_options_t*, superlu::SuperMatrix*, int, int, int*, void*, int, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::GlobalLU_t*, superlu::SuperLUStat_t*, int*); - extern void arma_wrapper(dgstrf)(superlu::superlu_options_t*, superlu::SuperMatrix*, int, int, int*, void*, int, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::GlobalLU_t*, superlu::SuperLUStat_t*, int*); - extern void arma_wrapper(cgstrf)(superlu::superlu_options_t*, superlu::SuperMatrix*, int, int, int*, void*, int, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::GlobalLU_t*, superlu::SuperLUStat_t*, int*); - extern void arma_wrapper(zgstrf)(superlu::superlu_options_t*, superlu::SuperMatrix*, int, int, int*, void*, int, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::GlobalLU_t*, superlu::SuperLUStat_t*, int*); + extern void arma_wrapper(sgstrf)(superlu::superlu_options_t*, superlu::SuperMatrix*, int, int, int*, void*, superlu::int_t, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::GlobalLU_t*, superlu::SuperLUStat_t*, superlu::int_t*); + extern void arma_wrapper(dgstrf)(superlu::superlu_options_t*, superlu::SuperMatrix*, int, int, int*, void*, superlu::int_t, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::GlobalLU_t*, superlu::SuperLUStat_t*, superlu::int_t*); + extern void arma_wrapper(cgstrf)(superlu::superlu_options_t*, superlu::SuperMatrix*, int, int, int*, void*, superlu::int_t, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::GlobalLU_t*, superlu::SuperLUStat_t*, superlu::int_t*); + extern void arma_wrapper(zgstrf)(superlu::superlu_options_t*, superlu::SuperMatrix*, int, int, int*, void*, superlu::int_t, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::GlobalLU_t*, superlu::SuperLUStat_t*, superlu::int_t*); extern void arma_wrapper(sgstrs)(superlu::trans_t, superlu::SuperMatrix*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, int*); extern void arma_wrapper(dgstrs)(superlu::trans_t, superlu::SuperMatrix*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, int*); diff --git a/inst/include/armadillo_bits/glue_times_meat.hpp b/inst/include/armadillo_bits/glue_times_meat.hpp index 28f5ec4b..bd508d0f 100644 --- a/inst/include/armadillo_bits/glue_times_meat.hpp +++ b/inst/include/armadillo_bits/glue_times_meat.hpp @@ -104,6 +104,40 @@ glue_times_redirect2_helper::apply(Mat& out, const const strip_inv A_strip(X.A); + typedef typename strip_inv::stored_type T1_stripped; + + if( (is_cx::no) && (strip_inv::do_inv_gen) && (is_Mat::value) && (is_Mat::value) ) + { + const unwrap UA(A_strip.M); + const unwrap UB(X.B); + + const typename unwrap::stored_type& A = UA.M; + const typename unwrap::stored_type& B = UB.M; + + const uword N = A.n_rows; + + if( (N > 0) && (N <= uword(3)) && (N == A.n_cols) && (N == B.n_rows) && (void_ptr(&out) != void_ptr(&B)) ) + { + arma_debug_print("glue_times_redirect<2>::apply(): inv tiny matrix optimisation"); + + Mat AA(N, N, arma_nozeros_indicator()); + + arrayops::copy(AA.memptr(), A.memptr(), AA.n_elem); + + bool inv_status = false; + + if(N == 1) { const eT a = AA[0]; AA[0] = eT(1) / a; inv_status = (a != eT(0)); } + if(N == 2) { inv_status = op_inv_gen_full::apply_tiny_2x2(AA); } + if(N == 3) { inv_status = op_inv_gen_full::apply_tiny_3x3(AA); } + + if(inv_status) { glue_times::apply(out, AA, B, eT(0)); return; } + + arma_debug_print("glue_times_redirect<2>::apply(): inv tiny matrix optimisation failed"); + + // fallthrough if optimisation failed + } + } + Mat A = A_strip.M; arma_conform_check( (A.is_square() == false), "inv(): given matrix must be square sized" ); diff --git a/inst/include/armadillo_bits/include_superlu.hpp b/inst/include/armadillo_bits/include_superlu.hpp index 0ce6c7bb..9c6fd653 100644 --- a/inst/include/armadillo_bits/include_superlu.hpp +++ b/inst/include/armadillo_bits/include_superlu.hpp @@ -16,7 +16,7 @@ // // ------------------------------------------------------------------------ // -// This file includes portions of SuperLU 5.2 software, +// This file includes portions of SuperLU 7.0 software, // licensed under the following conditions. // // Copyright (c) 2003, The Regents of the University of California, through @@ -64,16 +64,23 @@ // and manually specify a few SuperLU structures and function prototypes. // // CAVEAT: -// This code requires SuperLU version 5.2, -// and assumes that newer 5.x versions will have no API changes. +// This code requires SuperLU version 7.0, and assumes that newer 7.x versions have no API changes. namespace arma { namespace superlu { - // slu_*defs.h has int typedefed to int_t. - // I'll just write it as int for simplicity, where I can, but supermatrix.h needs int_t. - typedef int int_t; + // superlu_config.h uses either int or int64_t as int_t + + #if defined(ARMA_SUPERLU_64BIT_INT) + #if defined(INT64_MAX) + typedef std::int64_t int_t; + #else + typedef long long int_t; + #endif + #else + typedef int int_t; + #endif } } @@ -84,7 +91,7 @@ namespace arma namespace superlu { // Include supermatrix.h. This gives us SuperMatrix. - // Put it in the slu namespace. + // Put it in the superlu namespace. // For versions of SuperLU I am familiar with, supermatrix.h does not include any other files. // Therefore, putting it in the superlu namespace is reasonably safe. // This same reasoning is true for superlu_enum_consts.h. @@ -120,7 +127,7 @@ namespace superlu #undef ARMA_SLU_STR1 #undef ARMA_SLU_STR2 - + #undef ARMA_SLU_HEADER_A #undef ARMA_SLU_HEADER_B @@ -130,7 +137,7 @@ namespace superlu { int* panel_histo; double* utime; - float* ops; + float* ops; // NOTE: orig definition is flops_t* ops, where flops_t = float int TinyPivots; int RefineSteps; int expansions; @@ -174,16 +181,16 @@ namespace superlu typedef struct e_node { - int size; + int_t size; void* mem; } ExpHeader; typedef struct { - int size; - int used; - int top1; - int top2; + int_t size; + int_t used; + int_t top1; + int_t top2; void* array; } LU_stack_t; @@ -191,16 +198,16 @@ namespace superlu { int* xsup; int* supno; - int* lsub; - int* xlsub; + int_t* lsub; + int_t* xlsub; void* lusup; - int* xlusup; + int_t* xlusup; void* ucol; - int* usub; - int* xusub; - int nzlmax; - int nzumax; - int nzlumax; + int_t* usub; + int_t* xusub; + int_t nzlmax; + int_t nzumax; + int_t nzlumax; int n; LU_space_t MemModel; int num_expansions; @@ -283,23 +290,23 @@ namespace superlu { int* panel_histo; double* utime; - float* ops; + float* ops; // NOTE: orig definition is flops_t* ops, where flops_t = float int TinyPivots; int RefineSteps; int expansions; } SuperLUStat_t; - typedef enum {NO, YES} yes_no_t; + typedef enum {NO, YES} yes_no_t; typedef enum {DOFACT, SamePattern, SamePattern_SameRowPerm, FACTORED} fact_t; - typedef enum {NOROWPERM, LargeDiag, MY_PERMR} rowperm_t; + typedef enum {NOROWPERM, LargeDiag_MC64, LargeDiag_HWPM, MY_PERMR} rowperm_t; typedef enum {NATURAL, MMD_ATA, MMD_AT_PLUS_A, COLAMD, - METIS_AT_PLUS_A, PARMETIS, ZOLTAN, MY_PERMC} colperm_t; - typedef enum {NOTRANS, TRANS, CONJ} trans_t; - typedef enum {NOREFINE, SLU_SINGLE=1, SLU_DOUBLE, SLU_EXTRA} IterRefine_t; - typedef enum {SYSTEM, USER} LU_space_t; - typedef enum {ONE_NORM, TWO_NORM, INF_NORM} norm_t; - typedef enum {SILU, SMILU_1, SMILU_2, SMILU_3} milu_t; - + METIS_AT_PLUS_A, PARMETIS, METIS_ATA, ZOLTAN, MY_PERMC} colperm_t; + typedef enum {NOTRANS, TRANS, CONJ} trans_t; + typedef enum {NOREFINE, SLU_SINGLE=1, SLU_DOUBLE, SLU_EXTRA} IterRefine_t; + typedef enum {SYSTEM, USER} LU_space_t; + typedef enum {ONE_NORM, TWO_NORM, INF_NORM} norm_t; + typedef enum {SILU, SMILU_1, SMILU_2, SMILU_3} milu_t; + typedef struct { fact_t Fact; @@ -352,16 +359,16 @@ namespace superlu typedef struct e_node { - int size; + int_t size; void* mem; } ExpHeader; typedef struct { - int size; - int used; - int top1; - int top2; + int_t size; + int_t used; + int_t top1; + int_t top2; void* array; } LU_stack_t; @@ -369,16 +376,16 @@ namespace superlu { int* xsup; int* supno; - int* lsub; - int* xlsub; + int_t* lsub; + int_t* xlsub; void* lusup; - int* xlusup; + int_t* xlusup; void* ucol; - int* usub; - int* xusub; - int nzlmax; - int nzumax; - int nzlumax; + int_t* usub; + int_t* xusub; + int_t nzlmax; + int_t nzumax; + int_t nzlumax; int n; LU_space_t MemModel; int num_expansions; diff --git a/inst/include/armadillo_bits/op_expmat_meat.hpp b/inst/include/armadillo_bits/op_expmat_meat.hpp index 7278cabc..9377d8e1 100644 --- a/inst/include/armadillo_bits/op_expmat_meat.hpp +++ b/inst/include/armadillo_bits/op_expmat_meat.hpp @@ -104,15 +104,29 @@ op_expmat::apply_direct(Mat& out, const Base::yes) ? (std::abs(diag_shift) > T(0)) : (access::tmp_real(diag_shift) > T(0)) ); + + if(do_trace_reduction) + { + arma_debug_print("op_expmat: diag_shift: ", diag_shift); + + A.diag() -= diag_shift; + } + const T norm_val = arma::norm(A, "inf"); if(arma_isfinite(norm_val) == false) { return false; } - const double log2_val = (norm_val > T(0)) ? double(eop_aux::log2(norm_val)) : double(0); + int exponent = int(0); std::frexp(norm_val, &exponent); - int exponent = int(0); std::frexp(log2_val, &exponent); + const uword s = (std::min)( uword( (std::max)(int(0), exponent) ), uword(1023) ); - const uword s = uword( (std::max)(int(0), exponent + int(1)) ); + arma_debug_print("op_expmat: s: ", s); A /= eT(eop_aux::pow(double(2), double(s))); @@ -125,7 +139,7 @@ op_expmat::apply_direct(Mat& out, const Base& out, const Base& 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); // Process the return code. - if( (info > 0) && (info <= int(A.n_cols)) ) + if( (info > 0) && (info <= superlu::int_t(A.n_cols)) ) { // std::ostringstream tmp; // tmp << "spsolve(): could not solve system; LU factorisation completed, but detected zero in U(" << (info-1) << ',' << (info-1) << ')'; // arma_warn(1, tmp.str()); } else - if(info > int(A.n_cols)) + if(info > superlu::int_t(A.n_cols)) { arma_warn(1, "spsolve(): memory allocation failure"); } @@ -1381,10 +1381,11 @@ sp_auxlib::spsolve_refine(Mat& X, typename T1::pod_type& char equed[8] = {}; // extra characters for paranoia T rpg = T(0); T rcond = T(0); - int info = int(0); // Return code. - char work[8] = {}; - int lwork = int(0); // 0 means superlu will allocate memory + char work[8] = {}; + superlu::int_t lwork = 0; // 0 means superlu will allocate memory + + superlu::int_t info = 0; // Return code. 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); @@ -1396,20 +1397,20 @@ sp_auxlib::spsolve_refine(Mat& X, typename T1::pod_type& { status = true; } - if( (info > 0) && (info <= int(A.n_cols)) ) + if( (info > 0) && (info <= superlu::int_t(A.n_cols)) ) { // std::ostringstream tmp; // tmp << "spsolve(): could not solve system; LU factorisation completed, but detected zero in U(" << (info-1) << ',' << (info-1) << ')'; // arma_warn(1, tmp.str()); } else - if( (info == int(A.n_cols+1)) && (user_opts.allow_ugly) ) + if( (info == superlu::int_t(A.n_cols+1)) && (user_opts.allow_ugly) ) { arma_warn(2, "spsolve(): system is singular to working precision (rcond: ", rcond, ")"); status = true; } else - if(info > int(A.n_cols+1)) + if(info > superlu::int_t(A.n_cols+1)) { arma_warn(1, "spsolve(): memory allocation failure"); } @@ -2123,7 +2124,7 @@ sp_auxlib::run_aupd_shiftinvert superlu_opts superlu_opts_default; superlu::superlu_options_t options; sp_auxlib::set_superlu_opts(options, superlu_opts_default); - int lwork = 0; + superlu::trans_t trans = superlu::NOTRANS; superlu::GlobalLU_t Glu; /* Not needed on return. */ @@ -2176,7 +2177,9 @@ sp_auxlib::run_aupd_shiftinvert int panel_size = superlu::sp_ispec_environ(1); int relax = superlu::sp_ispec_environ(2); - int slu_info = 0; // Return code. + + superlu::int_t lwork = 0; + superlu::int_t slu_info = 0; // Return code. arma_debug_print("superlu::gstrf()"); superlu::get_permutation_c(options.ColPerm, x.get_ptr(), perm_c.get_ptr()); @@ -2704,8 +2707,9 @@ superlu_worker::factorise(typename get_pod_type::result& out_rcond, cons int panel_size = superlu::sp_ispec_environ(1); int relax = superlu::sp_ispec_environ(2); - int lwork = 0; - int info = 0; + + superlu::int_t lwork = 0; + superlu::int_t info = 0; arma_debug_print("superlu::superlu::get_permutation_c()"); superlu::get_permutation_c(options.ColPerm, AA.get_ptr(), perm_c.get_ptr()); diff --git a/inst/include/armadillo_bits/translate_superlu.hpp b/inst/include/armadillo_bits/translate_superlu.hpp index b99c0050..1f9eb956 100644 --- a/inst/include/armadillo_bits/translate_superlu.hpp +++ b/inst/include/armadillo_bits/translate_superlu.hpp @@ -26,7 +26,7 @@ namespace superlu template inline void - gssv(superlu_options_t* options, SuperMatrix* A, int* perm_c, int* perm_r, SuperMatrix* L, SuperMatrix* U, SuperMatrix* B, SuperLUStat_t* stat, int* info) + gssv(superlu_options_t* options, SuperMatrix* A, int* perm_c, int* perm_r, SuperMatrix* L, SuperMatrix* U, SuperMatrix* B, SuperLUStat_t* stat, superlu::int_t* info) { arma_type_check(( is_supported_blas_type::value == false )); @@ -63,11 +63,11 @@ namespace superlu int* etree, char* equed, typename get_pod_type::result* R, typename get_pod_type::result* C, SuperMatrix* L, SuperMatrix* U, - void* work, int lwork, + void* work, superlu::int_t lwork, SuperMatrix* B, SuperMatrix* X, typename get_pod_type::result* rpg, typename get_pod_type::result* rcond, typename get_pod_type::result* ferr, typename get_pod_type::result* berr, - GlobalLU_t* glu, mem_usage_t* mu, SuperLUStat_t* stat, int* info + GlobalLU_t* glu, mem_usage_t* mu, SuperLUStat_t* stat, superlu::int_t* info ) { arma_type_check(( is_supported_blas_type::value == false )); @@ -105,11 +105,11 @@ namespace superlu gstrf(superlu_options_t* options, SuperMatrix* A, int relax, - int panel_size, int *etree, - void *work, int lwork, + int panel_size, int* etree, + void* work, superlu::int_t lwork, int* perm_c, int* perm_r, SuperMatrix* L, SuperMatrix* U, - GlobalLU_t* Glu, SuperLUStat_t* stat, int* info + GlobalLU_t* Glu, SuperLUStat_t* stat, superlu::int_t* info ) { arma_type_check(( is_supported_blas_type::value == false )); From 4f520415998240a195cb3b5e2ef7a87edd2ee2b7 Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Fri, 25 Apr 2025 10:01:22 -0500 Subject: [PATCH 2/4] Second sync --- ChangeLog | 12 ++++++++++++ DESCRIPTION | 4 ++-- inst/include/armadillo_bits/op_sp_sum_bones.hpp | 8 ++++---- inst/include/armadillo_bits/op_sp_sum_meat.hpp | 12 ++++++------ 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index f60fded5..0d857669 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2025-04-24 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): RcppArmadillo 14.4.1-3 + + * inst/include/armadillo_bits/: Sync again with Armadillo 14.4.2 rc + +2025-04-23 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): RcppArmadillo 14.4.1-2 + + * inst/include/armadillo_bits/: Sync with Armadillo 14.4.2 rc + 2025-04-14 Dirk Eddelbuettel * inst/tinytest/test_sparse.R: Remove a redundant duplicate require diff --git a/DESCRIPTION b/DESCRIPTION index 3ea20f70..5d44b578 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: RcppArmadillo Type: Package Title: 'Rcpp' Integration for the 'Armadillo' Templated Linear Algebra Library -Version: 14.4.1-1 -Date: 2025-03-27 +Version: 14.4.1-3 +Date: 2025-04-24 Authors@R: c(person("Dirk", "Eddelbuettel", role = c("aut", "cre"), email = "edd@debian.org", comment = c(ORCID = "0000-0001-6419-907X")), person("Romain", "Francois", role = "aut", diff --git a/inst/include/armadillo_bits/op_sp_sum_bones.hpp b/inst/include/armadillo_bits/op_sp_sum_bones.hpp index 63db4566..1b524d72 100644 --- a/inst/include/armadillo_bits/op_sp_sum_bones.hpp +++ b/inst/include/armadillo_bits/op_sp_sum_bones.hpp @@ -25,11 +25,11 @@ class op_sp_sum { public: - template - inline static void apply(Mat& out, const mtSpReduceOp& in); + template + inline static void apply(Mat& out, const mtSpReduceOp& in); - template - inline static void apply(Mat& out, const mtSpReduceOp, op_sp_sum>& in); + template + inline static void apply(Mat& out, const mtSpReduceOp, op_sp_sum>& in); }; diff --git a/inst/include/armadillo_bits/op_sp_sum_meat.hpp b/inst/include/armadillo_bits/op_sp_sum_meat.hpp index 539242d9..384ab14a 100644 --- a/inst/include/armadillo_bits/op_sp_sum_meat.hpp +++ b/inst/include/armadillo_bits/op_sp_sum_meat.hpp @@ -21,14 +21,14 @@ -template +template inline void -op_sp_sum::apply(Mat& out, const mtSpReduceOp& in) +op_sp_sum::apply(Mat& out, const mtSpReduceOp& in) { arma_debug_sigprint(); - typedef typename T1::elem_type eT; + // NOTE: assuming that eT is the same as T1::elem_type const uword dim = in.aux_uword_a; @@ -83,14 +83,14 @@ op_sp_sum::apply(Mat& out, const mtSpReduceOp +template inline void -op_sp_sum::apply(Mat& out, const mtSpReduceOp, op_sp_sum>& in) +op_sp_sum::apply(Mat& out, const mtSpReduceOp, op_sp_sum>& in) { arma_debug_sigprint(); - typedef typename T1::elem_type eT; + // NOTE: assuming that eT is the same as T1::elem_type const uword dim = in.aux_uword_a; From cf258d5e0f5e7820151c16a15cc832d8e9594685 Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Fri, 25 Apr 2025 10:01:34 -0500 Subject: [PATCH 3/4] Armadillo 14.4.2 --- inst/include/armadillo_bits/arma_version.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/include/armadillo_bits/arma_version.hpp b/inst/include/armadillo_bits/arma_version.hpp index db43e9ec..44249a71 100644 --- a/inst/include/armadillo_bits/arma_version.hpp +++ b/inst/include/armadillo_bits/arma_version.hpp @@ -23,7 +23,7 @@ #define ARMA_VERSION_MAJOR 14 #define ARMA_VERSION_MINOR 4 -#define ARMA_VERSION_PATCH 1 +#define ARMA_VERSION_PATCH 2 #define ARMA_VERSION_NAME "Filtered Espresso" From 62814132ec6bab34399cc9ce4a18bb68004d0518 Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Fri, 25 Apr 2025 13:26:53 -0500 Subject: [PATCH 4/4] RcppArmadillo 14.4.2-1 --- ChangeLog | 9 +++++++++ DESCRIPTION | 4 ++-- configure | 18 +++++++++--------- configure.ac | 2 +- inst/NEWS.Rd | 9 +++++++++ 5 files changed, 30 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0d857669..3acc9519 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2025-04-25 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): RcppArmadillo 14.4.2-1 + * inst/NEWS.Rd: Idem + * configure.ac: Idem + * configure: Idem + + * inst/include/armadillo_bits/: Final sync with Armadillo 14.4.2 + 2025-04-24 Dirk Eddelbuettel * DESCRIPTION (Version, Date): RcppArmadillo 14.4.1-3 diff --git a/DESCRIPTION b/DESCRIPTION index 5d44b578..ee4fd06d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: RcppArmadillo Type: Package Title: 'Rcpp' Integration for the 'Armadillo' Templated Linear Algebra Library -Version: 14.4.1-3 -Date: 2025-04-24 +Version: 14.4.2-1 +Date: 2025-04-25 Authors@R: c(person("Dirk", "Eddelbuettel", role = c("aut", "cre"), email = "edd@debian.org", comment = c(ORCID = "0000-0001-6419-907X")), person("Romain", "Francois", role = "aut", diff --git a/configure b/configure index 2e81b4f3..b5c5309d 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.72 for RcppArmadillo 14.4.1-1. +# Generated by GNU Autoconf 2.72 for RcppArmadillo 14.4.2-1. # # Report bugs to . # @@ -603,8 +603,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='RcppArmadillo' PACKAGE_TARNAME='rcpparmadillo' -PACKAGE_VERSION='14.4.1-1' -PACKAGE_STRING='RcppArmadillo 14.4.1-1' +PACKAGE_VERSION='14.4.2-1' +PACKAGE_STRING='RcppArmadillo 14.4.2-1' PACKAGE_BUGREPORT='edd@debian.org' PACKAGE_URL='' @@ -1222,7 +1222,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -'configure' configures RcppArmadillo 14.4.1-1 to adapt to many kinds of systems. +'configure' configures RcppArmadillo 14.4.2-1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1284,7 +1284,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of RcppArmadillo 14.4.1-1:";; + short | recursive ) echo "Configuration of RcppArmadillo 14.4.2-1:";; esac cat <<\_ACEOF @@ -1365,7 +1365,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -RcppArmadillo configure 14.4.1-1 +RcppArmadillo configure 14.4.2-1 generated by GNU Autoconf 2.72 Copyright (C) 2023 Free Software Foundation, Inc. @@ -1481,7 +1481,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by RcppArmadillo $as_me 14.4.1-1, which was +It was created by RcppArmadillo $as_me 14.4.2-1, which was generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw @@ -3980,7 +3980,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by RcppArmadillo $as_me 14.4.1-1, which was +This file was extended by RcppArmadillo $as_me 14.4.2-1, which was generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4035,7 +4035,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -RcppArmadillo config.status 14.4.1-1 +RcppArmadillo config.status 14.4.2-1 configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 6629ea8b..5be33ea2 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ AC_PREREQ([2.69]) ## Process this file with autoconf to produce a configure script. -AC_INIT([RcppArmadillo],[14.4.1-1],[edd@debian.org]) +AC_INIT([RcppArmadillo],[14.4.2-1],[edd@debian.org]) ## Set R_HOME, respecting an environment variable if one is set : ${R_HOME=$(R RHOME)} diff --git a/inst/NEWS.Rd b/inst/NEWS.Rd index 4ac7878c..5c7f81ca 100644 --- a/inst/NEWS.Rd +++ b/inst/NEWS.Rd @@ -3,6 +3,15 @@ \newcommand{\ghpr}{\href{https://github.com/RcppCore/RcppArmadillo/pull/#1}{##1}} \newcommand{\ghit}{\href{https://github.com/RcppCore/RcppArmadillo/issues/#1}{##1}} +\section{Changes in RcppArmadillo version 14.4.2-1 (2025-04-25)}{ + \itemize{ + \item Upgraded to Armadillo release 14.4.2 (Filtered Espresso) + \itemize{ + \item Micro-cleanup in one test file + } + } +} + \section{Changes in RcppArmadillo version 14.4.1-1 (2025-03-27)}{ \itemize{ \item Upgraded to Armadillo release 14.4.1 (Filtered Espresso)