Skip to content

Commit 5176e7d

Browse files
authored
Merge pull request #424 from RcppCore/feature/armadillo_12.6.5
RcppArmadillo 0.12.6.5.0 with Armadillo 12.6.5
2 parents 18ae440 + 276f5ff commit 5176e7d

File tree

8 files changed

+63
-32
lines changed

8 files changed

+63
-32
lines changed

ChangeLog

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2023-10-14 Dirk Eddelbuettel <[email protected]>
2+
3+
* DESCRIPTION (Version, Date): RcppArmadillo 0.12.6.5.0
4+
15
2023-09-06 Dirk Eddelbuettel <[email protected]>
26

37
* DESCRIPTION (Version, Date): RcppArmadillo 0.12.6.4.0
@@ -231,10 +235,6 @@
231235
* configure.ac: Support new location of generated config
232236
* configure: Idem
233237
* cleanup: Idem
234-
2022-10-19 Dirk Eddelbuettel <[email protected]>
235-
236-
* inst/tinytest/test_sparseConversion.R: Refine one conversion as
237-
suggested by the 'Matrix' team
238238

239239
2022-10-10 Dirk Eddelbuettel <[email protected]>
240240

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: RcppArmadillo
22
Type: Package
33
Title: 'Rcpp' Integration for the 'Armadillo' Templated Linear Algebra Library
4-
Version: 0.12.6.4.0
5-
Date: 2023-09-06
4+
Version: 0.12.6.5.0
5+
Date: 2023-10-14
66
Author: Dirk Eddelbuettel, Romain Francois, Doug Bates, Binxiang Ni, and Conrad Sanderson
77
Maintainer: Dirk Eddelbuettel <[email protected]>
88
Description: 'Armadillo' is a templated C++ linear algebra library (by Conrad

configure

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.71 for RcppArmadillo 0.12.6.4.0.
3+
# Generated by GNU Autoconf 2.71 for RcppArmadillo 0.12.6.5.0.
44
#
55
# Report bugs to <[email protected]>.
66
#
@@ -610,8 +610,8 @@ MAKEFLAGS=
610610
# Identity of this package.
611611
PACKAGE_NAME='RcppArmadillo'
612612
PACKAGE_TARNAME='rcpparmadillo'
613-
PACKAGE_VERSION='0.12.6.4.0'
614-
PACKAGE_STRING='RcppArmadillo 0.12.6.4.0'
613+
PACKAGE_VERSION='0.12.6.5.0'
614+
PACKAGE_STRING='RcppArmadillo 0.12.6.5.0'
615615
PACKAGE_BUGREPORT='[email protected]'
616616
PACKAGE_URL=''
617617

@@ -1229,7 +1229,7 @@ if test "$ac_init_help" = "long"; then
12291229
# Omit some internal or obsolete options to make the list less imposing.
12301230
# This message is too long to be a string in the A/UX 3.1 sh.
12311231
cat <<_ACEOF
1232-
\`configure' configures RcppArmadillo 0.12.6.4.0 to adapt to many kinds of systems.
1232+
\`configure' configures RcppArmadillo 0.12.6.5.0 to adapt to many kinds of systems.
12331233
12341234
Usage: $0 [OPTION]... [VAR=VALUE]...
12351235
@@ -1291,7 +1291,7 @@ fi
12911291

12921292
if test -n "$ac_init_help"; then
12931293
case $ac_init_help in
1294-
short | recursive ) echo "Configuration of RcppArmadillo 0.12.6.4.0:";;
1294+
short | recursive ) echo "Configuration of RcppArmadillo 0.12.6.5.0:";;
12951295
esac
12961296
cat <<\_ACEOF
12971297
@@ -1372,7 +1372,7 @@ fi
13721372
test -n "$ac_init_help" && exit $ac_status
13731373
if $ac_init_version; then
13741374
cat <<\_ACEOF
1375-
RcppArmadillo configure 0.12.6.4.0
1375+
RcppArmadillo configure 0.12.6.5.0
13761376
generated by GNU Autoconf 2.71
13771377
13781378
Copyright (C) 2021 Free Software Foundation, Inc.
@@ -1486,7 +1486,7 @@ cat >config.log <<_ACEOF
14861486
This file contains any messages produced by compilers while
14871487
running configure, to aid debugging if configure makes a mistake.
14881488
1489-
It was created by RcppArmadillo $as_me 0.12.6.4.0, which was
1489+
It was created by RcppArmadillo $as_me 0.12.6.5.0, which was
14901490
generated by GNU Autoconf 2.71. Invocation command line was
14911491
14921492
$ $0$ac_configure_args_raw
@@ -3944,7 +3944,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
39443944
# report actual input values of CONFIG_FILES etc. instead of their
39453945
# values after options handling.
39463946
ac_log="
3947-
This file was extended by RcppArmadillo $as_me 0.12.6.4.0, which was
3947+
This file was extended by RcppArmadillo $as_me 0.12.6.5.0, which was
39483948
generated by GNU Autoconf 2.71. Invocation command line was
39493949
39503950
CONFIG_FILES = $CONFIG_FILES
@@ -3999,7 +3999,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
39993999
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
40004000
ac_cs_config='$ac_cs_config_escaped'
40014001
ac_cs_version="\\
4002-
RcppArmadillo config.status 0.12.6.4.0
4002+
RcppArmadillo config.status 0.12.6.5.0
40034003
configured by $0, generated by GNU Autoconf 2.71,
40044004
with options \\"\$ac_cs_config\\"
40054005

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
AC_PREREQ([2.69])
1212

1313
## Process this file with autoconf to produce a configure script.
14-
AC_INIT([RcppArmadillo],[0.12.6.4.0],[[email protected]])
14+
AC_INIT([RcppArmadillo],[0.12.6.5.0],[[email protected]])
1515

1616
## Set R_HOME, respecting an environment variable if one is set
1717
: ${R_HOME=$(R RHOME)}

inst/NEWS.Rd

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@
33
\newcommand{\ghpr}{\href{https://github.com/RcppCore/RcppArmadillo/pull/#1}{##1}}
44
\newcommand{\ghit}{\href{https://github.com/RcppCore/RcppArmadillo/issues/#1}{##1}}
55

6+
\section{Changes in RcppArmadillo version 0.12.6.5.0 (2023-10-14)}{
7+
\itemize{
8+
\item Upgraded to Armadillo release 12.6.5 (Cortisol Retox)
9+
\itemize{
10+
\item Fix for corner-case bug in handling sparse matrices with no
11+
non-zero elements
12+
}
13+
}
14+
}
15+
616
\section{Changes in RcppArmadillo version 0.12.6.4.0 (2023-09-06)}{
717
\itemize{
818
\item Upgraded to Armadillo release 12.6.4 (Cortisol Retox)

inst/include/armadillo_bits/Mat_meat.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2657,6 +2657,8 @@ Mat<eT>::operator=(const SpBase<eT, T1>& m)
26572657

26582658
(*this).zeros(x.n_rows, x_n_cols);
26592659

2660+
if(x.n_nonzero == 0) { return *this; }
2661+
26602662
const eT* x_values = x.values;
26612663
const uword* x_row_indices = x.row_indices;
26622664
const uword* x_col_ptrs = x.col_ptrs;

inst/include/armadillo_bits/SpMat_meat.hpp

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2971,12 +2971,11 @@ SpMat<eT>::swap_cols(const uword in_col1, const uword in_col2)
29712971

29722972
// TODO: this is a rudimentary implementation
29732973

2974-
SpMat<eT> tmp = (*this);
2974+
const SpMat<eT> tmp1 = (*this).col(in_col1);
2975+
const SpMat<eT> tmp2 = (*this).col(in_col2);
29752976

2976-
tmp.col(in_col1) = (*this).col(in_col2);
2977-
tmp.col(in_col2) = (*this).col(in_col1);
2978-
2979-
steal_mem(tmp);
2977+
(*this).col(in_col2) = tmp1;
2978+
(*this).col(in_col1) = tmp2;
29802979

29812980
// for(uword lrow = 0; lrow < n_rows; ++lrow)
29822981
// {
@@ -4099,9 +4098,14 @@ SpMat<eT>::zeros()
40994098
{
41004099
arma_extra_debug_sigprint();
41014100

4102-
const bool already_done = ( (sync_state != 1) && (n_nonzero == 0) );
4103-
4104-
if(already_done == false) { init(n_rows, n_cols); }
4101+
if((n_nonzero == 0) && (values != nullptr))
4102+
{
4103+
invalidate_cache();
4104+
}
4105+
else
4106+
{
4107+
init(n_rows, n_cols);
4108+
}
41054109

41064110
return *this;
41074111
}
@@ -4136,9 +4140,14 @@ SpMat<eT>::zeros(const uword in_rows, const uword in_cols)
41364140
{
41374141
arma_extra_debug_sigprint();
41384142

4139-
const bool already_done = ( (sync_state != 1) && (n_nonzero == 0) && (n_rows == in_rows) && (n_cols == in_cols) );
4140-
4141-
if(already_done == false) { init(in_rows, in_cols); }
4143+
if((n_nonzero == 0) && (n_rows == in_rows) && (n_cols == in_cols) && (values != nullptr))
4144+
{
4145+
invalidate_cache();
4146+
}
4147+
else
4148+
{
4149+
init(in_rows, in_cols);
4150+
}
41424151

41434152
return *this;
41444153
}
@@ -5197,11 +5206,21 @@ SpMat<eT>::init_simple(const SpMat<eT>& x)
51975206

51985207
if(this == &x) { return; }
51995208

5200-
init(x.n_rows, x.n_cols, x.n_nonzero);
5209+
if((x.n_nonzero == 0) && (n_nonzero == 0) && (n_rows == x.n_rows) && (n_cols == x.n_cols) && (values != nullptr))
5210+
{
5211+
invalidate_cache();
5212+
}
5213+
else
5214+
{
5215+
init(x.n_rows, x.n_cols, x.n_nonzero);
5216+
}
52015217

5202-
if(x.values ) { arrayops::copy(access::rwp(values), x.values, x.n_nonzero + 1); }
5203-
if(x.row_indices) { arrayops::copy(access::rwp(row_indices), x.row_indices, x.n_nonzero + 1); }
5204-
if(x.col_ptrs ) { arrayops::copy(access::rwp(col_ptrs), x.col_ptrs, x.n_cols + 1); }
5218+
if(x.n_nonzero != 0)
5219+
{
5220+
if(x.values ) { arrayops::copy(access::rwp(values), x.values, x.n_nonzero + 1); }
5221+
if(x.row_indices) { arrayops::copy(access::rwp(row_indices), x.row_indices, x.n_nonzero + 1); }
5222+
if(x.col_ptrs ) { arrayops::copy(access::rwp(col_ptrs), x.col_ptrs, x.n_cols + 1); }
5223+
}
52055224
}
52065225

52075226

inst/include/armadillo_bits/arma_version.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
#define ARMA_VERSION_MAJOR 12
2525
#define ARMA_VERSION_MINOR 6
26-
#define ARMA_VERSION_PATCH 4
26+
#define ARMA_VERSION_PATCH 5
2727
#define ARMA_VERSION_NAME "Cortisol Retox"
2828

2929

0 commit comments

Comments
 (0)