Skip to content

Commit 20e4ea3

Browse files
authored
Merge pull request #431 from RcppCore/feature/arma_12.6.7
RcppArmadillo 0.12.6.7.0 with Armadillo 12.6.7
2 parents 2277661 + 652221a commit 20e4ea3

File tree

9 files changed

+55
-52
lines changed

9 files changed

+55
-52
lines changed

ChangeLog

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
2023-12-18 Dirk Eddelbuettel <[email protected]>
2+
3+
* DESCRIPTION (Version, Date): RcppArmadillo 0.12.6.7.0
4+
* inst/NEWS.Rd: Idem
5+
* configure.ac: Idem
6+
* configure: Idem
7+
8+
* inst/include/armadillo_bits/: Armadillo 12.6.7
9+
110
2023-12-09 Dirk Eddelbuettel <[email protected]>
211

312
* inst/tinytest/test_misc.R: Add tests for thread throttling

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.6.1
5-
Date: 2023-12-03
4+
Version: 0.12.6.7.0
5+
Date: 2023-12-18
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.6.1.
3+
# Generated by GNU Autoconf 2.71 for RcppArmadillo 0.12.6.7.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.6.1'
614-
PACKAGE_STRING='RcppArmadillo 0.12.6.6.1'
613+
PACKAGE_VERSION='0.12.6.7.0'
614+
PACKAGE_STRING='RcppArmadillo 0.12.6.7.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.6.1 to adapt to many kinds of systems.
1232+
\`configure' configures RcppArmadillo 0.12.6.7.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.6.1:";;
1294+
short | recursive ) echo "Configuration of RcppArmadillo 0.12.6.7.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.6.1
1375+
RcppArmadillo configure 0.12.6.7.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.6.1, which was
1489+
It was created by RcppArmadillo $as_me 0.12.6.7.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.6.1, which was
3947+
This file was extended by RcppArmadillo $as_me 0.12.6.7.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.6.1
4002+
RcppArmadillo config.status 0.12.6.7.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.6.1],[[email protected]])
14+
AC_INIT([RcppArmadillo],[0.12.6.7.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.7.0 (2023-12-18)}{
7+
\itemize{
8+
\item Upgraded to Armadillo release 12.6.7 (Cortisol Retox)
9+
\itemize{
10+
\item Fix for saving sparse matrices as CSV files
11+
}
12+
\item Added unit tests for thread throttling
13+
}
14+
}
15+
616
\section{Changes in RcppArmadillo version 0.12.6.6.1 (2023-12-03)}{
717
\itemize{
818
\item Following the extendeded transition in \ghit{391} and \ghit{402},

inst/include/armadillo_bits/Mat_meat.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7830,7 +7830,7 @@ Mat<eT>::save(const csv_name& spec, const file_type type) const
78307830

78317831
if(spec.header_ro.n_elem != save_n_cols)
78327832
{
7833-
arma_debug_warn_level(1, "Mat::save(): size mistmach between header and matrix");
7833+
arma_debug_warn_level(1, "Mat::save(): size mismatch between header and matrix");
78347834
return false;
78357835
}
78367836
}
@@ -8114,7 +8114,7 @@ Mat<eT>::load(const csv_name& spec, const file_type type)
81148114

81158115
if(with_header && (spec.header_rw.n_elem != load_n_cols))
81168116
{
8117-
arma_debug_warn_level(3, "Mat::load(): size mistmach between header and matrix");
8117+
arma_debug_warn_level(3, "Mat::load(): size mismatch between header and matrix");
81188118
}
81198119
}
81208120

inst/include/armadillo_bits/SpMat_meat.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4609,7 +4609,7 @@ SpMat<eT>::save(const csv_name& spec, const file_type type) const
46094609

46104610
if(spec.header_ro.n_elem != save_n_cols)
46114611
{
4612-
arma_debug_warn_level(1, "SpMat::save(): size mistmach between header and matrix");
4612+
arma_debug_warn_level(1, "SpMat::save(): size mismatch between header and matrix");
46134613
return false;
46144614
}
46154615
}
@@ -4808,7 +4808,7 @@ SpMat<eT>::load(const csv_name& spec, const file_type type)
48084808

48094809
if(with_header && (spec.header_rw.n_elem != load_n_cols))
48104810
{
4811-
arma_debug_warn_level(3, "SpMat::load(): size mistmach between header and matrix");
4811+
arma_debug_warn_level(3, "SpMat::load(): size mismatch between header and matrix");
48124812
}
48134813
}
48144814

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 6
26+
#define ARMA_VERSION_PATCH 7
2727
#define ARMA_VERSION_NAME "Cortisol Retox"
2828

2929

inst/include/armadillo_bits/diskio_meat.hpp

Lines changed: 19 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -445,10 +445,10 @@ diskio::convert_token(eT& val, const std::string& token)
445445
{
446446
const size_t N = size_t(token.length());
447447

448-
if(N == 0) { val = eT(0); return true; }
449-
450448
const char* str = token.c_str();
451449

450+
if( (N == 0) || ((N == 1) && (str[0] == '0')) ) { val = eT(0); return true; }
451+
452452
if( (N == 3) || (N == 4) )
453453
{
454454
const bool neg = (str[0] == '-');
@@ -1075,7 +1075,7 @@ diskio::save_coord_ascii(const Mat< std::complex<T> >& x, std::ostream& f)
10751075
for(uword col=0; col < x.n_cols; ++col)
10761076
for(uword row=0; row < x.n_rows; ++row)
10771077
{
1078-
const eT val = x.at(row,col);
1078+
const eT& val = x.at(row,col);
10791079

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

11831183

11841184

1185-
//
1186-
// TODO:
1187-
// add functionality to save the image in a normalised format,
1188-
// ie. scaled so that every value falls in the [0,255] range.
1189-
11901185
//! Save a matrix as a PGM greyscale image
11911186
template<typename eT>
11921187
inline
@@ -2221,10 +2216,7 @@ diskio::load_coord_ascii(Mat<eT>& x, std::istream& f, std::string& err_msg)
22212216

22222217
line_stream >> token;
22232218

2224-
if(line_stream.fail() == false)
2225-
{
2226-
diskio::convert_token( val, token );
2227-
}
2219+
if(line_stream.fail() == false) { diskio::convert_token( val, token ); }
22282220

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

23262318
line_stream >> token_real;
23272319

2328-
if(line_stream.fail() == false)
2329-
{
2330-
diskio::convert_token( val_real, token_real );
2331-
}
2332-
2320+
if(line_stream.fail() == false) { diskio::convert_token( val_real, token_real ); }
23332321

23342322
line_stream >> token_imag;
23352323

2336-
if(line_stream.fail() == false)
2337-
{
2338-
diskio::convert_token( val_imag, token_imag );
2339-
}
2324+
if(line_stream.fail() == false) { diskio::convert_token( val_imag, token_imag ); }
23402325

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

2907+
const eT eT_zero = eT(0);
2908+
29222909
for(uword row=0; row < x_n_rows; ++row)
29232910
{
29242911
for(uword col=0; col < x_n_cols; ++col)
29252912
{
29262913
const eT val = x.at(row,col);
29272914

2928-
if(val != eT(0)) { arma_ostream::raw_print_elem(f, val); }
2915+
if(val == eT_zero)
2916+
{
2917+
f.put('0');
2918+
}
2919+
else
2920+
{
2921+
arma_ostream::raw_print_elem(f, val);
2922+
}
29292923

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

34273421
line_stream >> token;
34283422

3429-
if(line_stream.fail() == false)
3430-
{
3431-
diskio::convert_token( val, token );
3432-
}
3423+
if(line_stream.fail() == false) { diskio::convert_token( val, token ); }
34333424

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

35313522
line_stream >> token_real;
35323523

3533-
if(line_stream.fail() == false)
3534-
{
3535-
diskio::convert_token( val_real, token_real );
3536-
}
3537-
3524+
if(line_stream.fail() == false) { diskio::convert_token( val_real, token_real ); }
35383525

35393526
line_stream >> token_imag;
35403527

3541-
if(line_stream.fail() == false)
3542-
{
3543-
diskio::convert_token( val_imag, token_imag );
3544-
}
3528+
if(line_stream.fail() == false) { diskio::convert_token( val_imag, token_imag ); }
35453529

35463530
if( (val_real != T(0)) || (val_imag != T(0)) )
35473531
{

0 commit comments

Comments
 (0)