Skip to content

Commit

Permalink
Merge pull request #431 from RcppCore/feature/arma_12.6.7
Browse files Browse the repository at this point in the history
RcppArmadillo 0.12.6.7.0 with Armadillo 12.6.7
  • Loading branch information
eddelbuettel authored Dec 19, 2023
2 parents 2277661 + 652221a commit 20e4ea3
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 52 deletions.
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2023-12-18 Dirk Eddelbuettel <[email protected]>

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

* inst/include/armadillo_bits/: Armadillo 12.6.7

2023-12-09 Dirk Eddelbuettel <[email protected]>

* inst/tinytest/test_misc.R: Add tests for thread throttling
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: 0.12.6.6.1
Date: 2023-12-03
Version: 0.12.6.7.0
Date: 2023-12-18
Author: Dirk Eddelbuettel, Romain Francois, Doug Bates, Binxiang Ni, and Conrad Sanderson
Maintainer: Dirk Eddelbuettel <[email protected]>
Description: 'Armadillo' is a templated C++ linear algebra library (by Conrad
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.71 for RcppArmadillo 0.12.6.6.1.
# Generated by GNU Autoconf 2.71 for RcppArmadillo 0.12.6.7.0.
#
# Report bugs to <[email protected]>.
#
Expand Down Expand Up @@ -610,8 +610,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='RcppArmadillo'
PACKAGE_TARNAME='rcpparmadillo'
PACKAGE_VERSION='0.12.6.6.1'
PACKAGE_STRING='RcppArmadillo 0.12.6.6.1'
PACKAGE_VERSION='0.12.6.7.0'
PACKAGE_STRING='RcppArmadillo 0.12.6.7.0'
PACKAGE_BUGREPORT='[email protected]'
PACKAGE_URL=''

Expand Down Expand Up @@ -1229,7 +1229,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 0.12.6.6.1 to adapt to many kinds of systems.
\`configure' configures RcppArmadillo 0.12.6.7.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1291,7 +1291,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of RcppArmadillo 0.12.6.6.1:";;
short | recursive ) echo "Configuration of RcppArmadillo 0.12.6.7.0:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1372,7 +1372,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
RcppArmadillo configure 0.12.6.6.1
RcppArmadillo configure 0.12.6.7.0
generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
Expand Down Expand Up @@ -1486,7 +1486,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 0.12.6.6.1, which was
It was created by RcppArmadillo $as_me 0.12.6.7.0, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
Expand Down Expand Up @@ -3944,7 +3944,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 0.12.6.6.1, which was
This file was extended by RcppArmadillo $as_me 0.12.6.7.0, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -3999,7 +3999,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 0.12.6.6.1
RcppArmadillo config.status 0.12.6.7.0
configured by $0, generated by GNU Autoconf 2.71,
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],[0.12.6.6.1],[[email protected]])
AC_INIT([RcppArmadillo],[0.12.6.7.0],[[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 0.12.6.7.0 (2023-12-18)}{
\itemize{
\item Upgraded to Armadillo release 12.6.7 (Cortisol Retox)
\itemize{
\item Fix for saving sparse matrices as CSV files
}
\item Added unit tests for thread throttling
}
}

\section{Changes in RcppArmadillo version 0.12.6.6.1 (2023-12-03)}{
\itemize{
\item Following the extendeded transition in \ghit{391} and \ghit{402},
Expand Down
4 changes: 2 additions & 2 deletions inst/include/armadillo_bits/Mat_meat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7830,7 +7830,7 @@ Mat<eT>::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 mistmach between header and matrix");
arma_debug_warn_level(1, "Mat::save(): size mismatch between header and matrix");
return false;
}
}
Expand Down Expand Up @@ -8114,7 +8114,7 @@ Mat<eT>::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 mistmach between header and matrix");
arma_debug_warn_level(3, "Mat::load(): size mismatch between header and matrix");
}
}

Expand Down
4 changes: 2 additions & 2 deletions inst/include/armadillo_bits/SpMat_meat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4609,7 +4609,7 @@ SpMat<eT>::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 mistmach between header and matrix");
arma_debug_warn_level(1, "SpMat::save(): size mismatch between header and matrix");
return false;
}
}
Expand Down Expand Up @@ -4808,7 +4808,7 @@ SpMat<eT>::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 mistmach between header and matrix");
arma_debug_warn_level(3, "SpMat::load(): size mismatch between header and matrix");
}
}

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 12
#define ARMA_VERSION_MINOR 6
#define ARMA_VERSION_PATCH 6
#define ARMA_VERSION_PATCH 7
#define ARMA_VERSION_NAME "Cortisol Retox"


Expand Down
54 changes: 19 additions & 35 deletions inst/include/armadillo_bits/diskio_meat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,10 +445,10 @@ diskio::convert_token(eT& val, const std::string& token)
{
const size_t N = size_t(token.length());

if(N == 0) { val = eT(0); return true; }

const char* str = token.c_str();

if( (N == 0) || ((N == 1) && (str[0] == '0')) ) { val = eT(0); return true; }

if( (N == 3) || (N == 4) )
{
const bool neg = (str[0] == '-');
Expand Down Expand Up @@ -1075,7 +1075,7 @@ diskio::save_coord_ascii(const Mat< std::complex<T> >& x, std::ostream& f)
for(uword col=0; col < x.n_cols; ++col)
for(uword row=0; row < x.n_rows; ++row)
{
const eT val = x.at(row,col);
const eT& val = x.at(row,col);

if(val != eT_zero)
{
Expand Down Expand Up @@ -1182,11 +1182,6 @@ diskio::save_pgm_binary(const Mat<eT>& x, const std::string& final_name)



//
// TODO:
// add functionality to save the image in a normalised format,
// ie. scaled so that every value falls in the [0,255] range.

//! Save a matrix as a PGM greyscale image
template<typename eT>
inline
Expand Down Expand Up @@ -2221,10 +2216,7 @@ diskio::load_coord_ascii(Mat<eT>& x, std::istream& f, std::string& err_msg)

line_stream >> token;

if(line_stream.fail() == false)
{
diskio::convert_token( val, token );
}
if(line_stream.fail() == false) { diskio::convert_token( val, token ); }

if(val != eT(0)) { tmp(line_row,line_col) = val; }
}
Expand Down Expand Up @@ -2325,18 +2317,11 @@ diskio::load_coord_ascii(Mat< std::complex<T> >& x, std::istream& f, std::string

line_stream >> token_real;

if(line_stream.fail() == false)
{
diskio::convert_token( val_real, token_real );
}

if(line_stream.fail() == false) { diskio::convert_token( val_real, token_real ); }

line_stream >> token_imag;

if(line_stream.fail() == false)
{
diskio::convert_token( val_imag, token_imag );
}
if(line_stream.fail() == false) { diskio::convert_token( val_imag, token_imag ); }

if( (val_real != T(0)) || (val_imag != T(0)) )
{
Expand Down Expand Up @@ -2919,13 +2904,22 @@ diskio::save_csv_ascii(const SpMat<eT>& x, std::ostream& f, const char separator
uword x_n_rows = x.n_rows;
uword x_n_cols = x.n_cols;

const eT eT_zero = eT(0);

for(uword row=0; row < x_n_rows; ++row)
{
for(uword col=0; col < x_n_cols; ++col)
{
const eT val = x.at(row,col);

if(val != eT(0)) { arma_ostream::raw_print_elem(f, val); }
if(val == eT_zero)
{
f.put('0');
}
else
{
arma_ostream::raw_print_elem(f, val);
}

if( col < (x_n_cols-1) ) { f.put(separator); }
}
Expand Down Expand Up @@ -3426,10 +3420,7 @@ diskio::load_coord_ascii(SpMat<eT>& x, std::istream& f, std::string& err_msg)

line_stream >> token;

if(line_stream.fail() == false)
{
diskio::convert_token( val, token );
}
if(line_stream.fail() == false) { diskio::convert_token( val, token ); }

if(val != eT(0)) { tmp(line_row,line_col) = val; }
}
Expand Down Expand Up @@ -3530,18 +3521,11 @@ diskio::load_coord_ascii(SpMat< std::complex<T> >& x, std::istream& f, std::stri

line_stream >> token_real;

if(line_stream.fail() == false)
{
diskio::convert_token( val_real, token_real );
}

if(line_stream.fail() == false) { diskio::convert_token( val_real, token_real ); }

line_stream >> token_imag;

if(line_stream.fail() == false)
{
diskio::convert_token( val_imag, token_imag );
}
if(line_stream.fail() == false) { diskio::convert_token( val_imag, token_imag ); }

if( (val_real != T(0)) || (val_imag != T(0)) )
{
Expand Down

0 comments on commit 20e4ea3

Please sign in to comment.