Skip to content

Release 14.4.3 #467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2025-05-21 Dirk Eddelbuettel <[email protected]>

* DESCRIPTION (Version, Date): RcppArmadillo 14.4.3-1
* inst/NEWS.Rd: Idem
* configure.ac: Idem
* configure: Idem

* inst/include/armadillo_bits/: Sync with Armadillo 14.4.3

2025-04-25 Dirk Eddelbuettel <[email protected]>

* DESCRIPTION (Version, Date): RcppArmadillo 14.4.2-1
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: RcppArmadillo
Type: Package
Title: 'Rcpp' Integration for the 'Armadillo' Templated Linear Algebra Library
Version: 14.4.2-1
Date: 2025-04-25
Version: 14.4.3-1
Date: 2025-05-21
Authors@R: c(person("Dirk", "Eddelbuettel", role = c("aut", "cre"), email = "[email protected]",
comment = c(ORCID = "0000-0001-6419-907X")),
person("Romain", "Francois", role = "aut",
Expand Down
18 changes: 9 additions & 9 deletions configure
Original file line number Diff line number Diff line change
@@ -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.2-1.
# Generated by GNU Autoconf 2.72 for RcppArmadillo 14.4.3-1.
#
# Report bugs to <[email protected]>.
#
Expand Down Expand Up @@ -603,8 +603,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='RcppArmadillo'
PACKAGE_TARNAME='rcpparmadillo'
PACKAGE_VERSION='14.4.2-1'
PACKAGE_STRING='RcppArmadillo 14.4.2-1'
PACKAGE_VERSION='14.4.3-1'
PACKAGE_STRING='RcppArmadillo 14.4.3-1'
PACKAGE_BUGREPORT='[email protected]'
PACKAGE_URL=''

Expand Down Expand Up @@ -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.2-1 to adapt to many kinds of systems.
'configure' configures RcppArmadillo 14.4.3-1 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -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.2-1:";;
short | recursive ) echo "Configuration of RcppArmadillo 14.4.3-1:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1365,7 +1365,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
RcppArmadillo configure 14.4.2-1
RcppArmadillo configure 14.4.3-1
generated by GNU Autoconf 2.72

Copyright (C) 2023 Free Software Foundation, Inc.
Expand Down Expand Up @@ -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.2-1, which was
It was created by RcppArmadillo $as_me 14.4.3-1, which was
generated by GNU Autoconf 2.72. Invocation command line was

$ $0$ac_configure_args_raw
Expand Down Expand Up @@ -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.2-1, which was
This file was extended by RcppArmadillo $as_me 14.4.3-1, which was
generated by GNU Autoconf 2.72. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -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.2-1
RcppArmadillo config.status 14.4.3-1
configured by $0, generated by GNU Autoconf 2.72,
with options \\"\$ac_cs_config\\"

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
AC_PREREQ([2.69])

## Process this file with autoconf to produce a configure script.
AC_INIT([RcppArmadillo],[14.4.2-1],[[email protected]])
AC_INIT([RcppArmadillo],[14.4.3-1],[[email protected]])

## Set R_HOME, respecting an environment variable if one is set
: ${R_HOME=$(R RHOME)}
Expand Down
10 changes: 10 additions & 0 deletions inst/NEWS.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
\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.3-1 (2025-05-21)}{
\itemize{
\item Upgraded to Armadillo release 14.4.3 (Filtered Espresso)
\itemize{
\item Fix for several corner cases involving handling of non-finite
elements by sparse matrices
}
}
}

\section{Changes in RcppArmadillo version 14.4.2-1 (2025-04-25)}{
\itemize{
\item Upgraded to Armadillo release 14.4.2 (Filtered Espresso)
Expand Down
80 changes: 31 additions & 49 deletions inst/include/armadillo_bits/MapMat_meat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -970,18 +970,17 @@ MapMat_val<eT>::operator*=(const eT in_val)

if(it != it_end)
{
if(in_val != eT(0))
{
eT& val = (*it).second;

val *= in_val;

if(val == eT(0)) { map_ref.erase(it); }
}
else
{
map_ref.erase(it);
}
eT& val = (*it).second;

val *= in_val;

if(val == eT(0)) { map_ref.erase(it); }
}
else
{
const eT val = eT(0) * in_val; // in case in_val is inf or nan

if(val != eT(0)) { parent.set_val(index, val); }
}
}

Expand Down Expand Up @@ -1009,9 +1008,7 @@ MapMat_val<eT>::operator/=(const eT in_val)
}
else
{
// silly operation, but included for completeness

const eT val = eT(0) / in_val;
const eT val = eT(0) / in_val; // in case in_val is zero or nan

if(val != eT(0)) { parent.set_val(index, val); }
}
Expand Down Expand Up @@ -1481,38 +1478,27 @@ SpMat_MapMat_val<eT>::mul(const eT in_val)

if(it != it_end)
{
if(in_val != eT(0))
{
eT& val = (*it).second;

val *= in_val;

if(val == eT(0)) { map_ref.erase(it); }
}
else
{
map_ref.erase(it);
}
eT& val = (*it).second;

val *= in_val;

if(val == eT(0)) { map_ref.erase(it); }

s_parent.sync_state = 1;

access::rw(s_parent.n_nonzero) = m_parent.get_n_nonzero();
}
else
{
// element not found, ie. it's zero; zero multiplied by anything is zero, except for nan and inf
if(arma_isfinite(in_val) == false)
const eT result = eT(0) * in_val; // in case in_val is inf or nan

if(result != eT(0))
{
const eT result = eT(0) * in_val;
m_parent.set_val(index, result);

s_parent.sync_state = 1;

if(result != eT(0)) // paranoia, in case compiling with -ffast-math
{
m_parent.set_val(index, result);

s_parent.sync_state = 1;

access::rw(s_parent.n_nonzero) = m_parent.get_n_nonzero();
}
access::rw(s_parent.n_nonzero) = m_parent.get_n_nonzero();
}
}
}
Expand Down Expand Up @@ -1554,19 +1540,15 @@ SpMat_MapMat_val<eT>::div(const eT in_val)
}
else
{
// element not found, ie. it's zero; zero divided by anything is zero, except for zero and nan
if( (in_val == eT(0)) || (arma_isnan(in_val)) )
const eT result = eT(0) / in_val; // in case in_val is zero or nan

if(result != eT(0))
{
const eT result = eT(0) / in_val;
m_parent.set_val(index, result);

s_parent.sync_state = 1;

if(result != eT(0)) // paranoia, in case compiling with -ffast-math
{
m_parent.set_val(index, result);

s_parent.sync_state = 1;

access::rw(s_parent.n_nonzero) = m_parent.get_n_nonzero();
}
access::rw(s_parent.n_nonzero) = m_parent.get_n_nonzero();
}
}
}
Expand Down
37 changes: 15 additions & 22 deletions inst/include/armadillo_bits/SpMat_meat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -612,33 +612,26 @@ SpMat<eT>::operator*=(const eT val)
{
arma_debug_sigprint();

if(val != eT(0))
sync_csc();
invalidate_cache();

const uword n_nz = n_nonzero;

eT* vals = access::rwp(values);

bool has_zero = false;

for(uword i=0; i<n_nz; ++i)
{
sync_csc();
invalidate_cache();

const uword n_nz = n_nonzero;

eT* vals = access::rwp(values);

bool has_zero = false;
eT& vals_i = vals[i];

for(uword i=0; i<n_nz; ++i)
{
eT& vals_i = vals[i];

vals_i *= val;

if(vals_i == eT(0)) { has_zero = true; }
}
vals_i *= val;

if(has_zero) { remove_zeros(); }
}
else
{
(*this).zeros();
if(vals_i == eT(0)) { has_zero = true; }
}

if(has_zero) { remove_zeros(); }

return *this;
}

Expand Down
2 changes: 0 additions & 2 deletions inst/include/armadillo_bits/SpSubview_col_list_meat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,6 @@ SpSubview_col_list<eT,T1>::operator*= (const eT val)
{
arma_debug_sigprint();

if(val == eT(0)) { (*this).zeros(); return; }

SpMat<eT>& m_local = const_cast< SpMat<eT>& >(m);

const umat& ci = U_ci.M;
Expand Down
2 changes: 0 additions & 2 deletions inst/include/armadillo_bits/SpSubview_meat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,6 @@ SpSubview<eT>::operator*=(const eT val)
{
arma_debug_sigprint();

if(val == eT(0)) { (*this).zeros(); return *this; }

if((n_elem == 0) || (n_nonzero == 0)) { return *this; }

m.sync_csc();
Expand Down
55 changes: 14 additions & 41 deletions inst/include/armadillo_bits/SpValProxy_meat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,24 +148,17 @@ inline
SpValProxy<T1>&
SpValProxy<T1>::operator*=(const eT rhs)
{
if(rhs != eT(0))
if(val_ptr)
{
if(val_ptr)
{
// The value already exists and merely needs to be updated.
*val_ptr *= rhs;
parent.invalidate_cache();
check_zero();
}
*val_ptr *= rhs;
parent.invalidate_cache();
check_zero();
}
else
{
if(val_ptr)
{
// Since we are multiplying by zero, the value can be deleted.
parent.delete_element(row, col);
val_ptr = nullptr;
}
const eT val = eT(0) * rhs; // in case rhs is inf or nan

if(val != eT(0)) { val_ptr = &parent.insert_element(row, col, val); }
}

return *this;
Expand All @@ -178,37 +171,17 @@ inline
SpValProxy<T1>&
SpValProxy<T1>::operator/=(const eT rhs)
{
if(rhs != eT(0)) // I hope this is true!
if(val_ptr)
{
if(val_ptr)
{
*val_ptr /= rhs;
parent.invalidate_cache();
check_zero();
}
*val_ptr /= rhs;
parent.invalidate_cache();
check_zero();
}
else
{
if(val_ptr)
{
*val_ptr /= rhs; // That is where it gets ugly.
// Now check if it's 0.
if(*val_ptr == eT(0))
{
parent.delete_element(row, col);
val_ptr = nullptr;
}
}
else
{
eT val = eT(0) / rhs; // This may vary depending on type and implementation.

if(val != eT(0))
{
// Ok, now we have to insert it.
val_ptr = &parent.insert_element(row, col, val);
}
}
const eT val = eT(0) / rhs; // in case rhs is zero or nan

if(val != eT(0)) { val_ptr = &parent.insert_element(row, col, val); }
}

return *this;
Expand Down
2 changes: 1 addition & 1 deletion inst/include/armadillo_bits/arma_version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#define ARMA_VERSION_MAJOR 14
#define ARMA_VERSION_MINOR 4
#define ARMA_VERSION_PATCH 2
#define ARMA_VERSION_PATCH 3
#define ARMA_VERSION_NAME "Filtered Espresso"


Expand Down
Loading