Skip to content

Commit

Permalink
Merge pull request #436 from RcppCore/feature/armadillo_12.8.2
Browse files Browse the repository at this point in the history
RcppArmadillo 0.12.8.2.0 with Armadillo 12.8.2
  • Loading branch information
eddelbuettel authored Apr 5, 2024
2 parents ca8b294 + 1db44ba commit b8ca6f9
Show file tree
Hide file tree
Showing 14 changed files with 111 additions and 110 deletions.
18 changes: 18 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
2024-04-02 Dirk Eddelbuettel <[email protected]>

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

* inst/include/armadillo_bits/: Armadillo 12.8.2

2024-03-05 Dirk Eddelbuettel <[email protected]>

* README.md: Correct a badge URL

2024-03-03 Dirk Eddelbuettel <[email protected]>

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

* inst/include/armadillo_bits/: Armadillo 12.8.1

2024-02-19 Dirk Eddelbuettel <[email protected]>

* DESCRIPTION (Version, Date): Increment version counter
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.8.1.0
Date: 2024-03-02
Version: 0.12.8.2.0
Date: 2024-04-02
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
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
[![CRAN use](https://jangorecki.gitlab.io/rdeps/RcppArmadillo/CRAN_usage.svg?sanitize=true)](https://cran.r-project.org/package=RcppArmadillo)
[![CRAN indirect](https://jangorecki.gitlab.io/rdeps/RcppArmadillo/indirect_usage.svg?sanitize=true)](https://cran.r-project.org/package=RcppArmadillo)
[![BioConductor use](https://jangorecki.gitlab.io/rdeps/RcppArmadillo/BioC_usage.svg?sanitize=true)](https://cran.r-project.org/package=RcppArmadillo)
[![StackOverflow](https://img.shields.io/badge/stackoverflow-rcpp-orange.svg)](https://stackoverflow.com/questions/tagged/rcpp)
[![CSDA](https://img.shields.io/badge/CSDA-10.1016%2Fj.csda.2013.02.005-brightgreen)](https://doi.org/10.1016/j.csda.2013.02.005)

### Synopsis
Expand Down Expand Up @@ -67,7 +66,7 @@ the switch saves about 15% of total compilation time.
The package is mature yet under active development with releases to [CRAN][cran] about once every
other month, and widely-used by other CRAN packages as can be seen from the [CRAN package page][cran
pkg]. As of February 2024, there are 1118 CRAN packages using RcppArmadillo.
pkg]. As of April 2024, there are 1135 CRAN packages using RcppArmadillo.
### Documentation
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.8.1.0.
# Generated by GNU Autoconf 2.71 for RcppArmadillo 0.12.8.2.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.8.1.0'
PACKAGE_STRING='RcppArmadillo 0.12.8.1.0'
PACKAGE_VERSION='0.12.8.2.0'
PACKAGE_STRING='RcppArmadillo 0.12.8.2.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.8.1.0 to adapt to many kinds of systems.
\`configure' configures RcppArmadillo 0.12.8.2.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.8.1.0:";;
short | recursive ) echo "Configuration of RcppArmadillo 0.12.8.2.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.8.1.0
RcppArmadillo configure 0.12.8.2.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.8.1.0, which was
It was created by RcppArmadillo $as_me 0.12.8.2.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.8.1.0, which was
This file was extended by RcppArmadillo $as_me 0.12.8.2.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.8.1.0
RcppArmadillo config.status 0.12.8.2.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.8.1.0],[[email protected]])
AC_INIT([RcppArmadillo],[0.12.8.2.0],[[email protected]])

## Set R_HOME, respecting an environment variable if one is set
: ${R_HOME=$(R RHOME)}
Expand Down
12 changes: 12 additions & 0 deletions inst/NEWS.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
\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.8.2.0 (2024-04-02)}{
\itemize{
\item Upgraded to Armadillo release 12.8.2 (Cortisol Injector)
\itemize{
\item Workaround for FFTW3 header clash
\item Workaround in testing framework for issue under macOS
\item Minor cleanups to reduce code bloat
\item Improved documentation
}
}
}

\section{Changes in RcppArmadillo version 0.12.8.1.0 (2024-03-02)}{
\itemize{
\item Upgraded to Armadillo release 12.8.1 (Cortisol Injector)
Expand Down
56 changes: 19 additions & 37 deletions inst/include/armadillo_bits/Mat_meat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -942,11 +942,19 @@ Mat<eT>::init(const std::initializer_list< std::initializer_list<eT> >& list)

uword x_n_rows = uword(list.size());
uword x_n_cols = 0;
uword x_n_elem = 0;

auto it = list.begin();
auto it_end = list.end();

for(; it != it_end; ++it) { x_n_cols = (std::max)(x_n_cols, uword((*it).size())); }
for(; it != it_end; ++it)
{
const uword x_n_cols_new = uword((*it).size());

x_n_elem += x_n_cols_new;

x_n_cols = (std::max)(x_n_cols, x_n_cols_new);
}

Mat<eT>& t = (*this);

Expand All @@ -959,6 +967,9 @@ Mat<eT>::init(const std::initializer_list< std::initializer_list<eT> >& list)
t.set_size(x_n_rows, x_n_cols);
}

// if the inner lists have varying number of elements, treat missing elements as zeros
if(t.n_elem != x_n_elem) { t.zeros(); }

uword row_num = 0;

auto row_it = list.begin();
Expand All @@ -977,11 +988,6 @@ Mat<eT>::init(const std::initializer_list< std::initializer_list<eT> >& list)
++col_num;
}

for(uword c=col_num; c < x_n_cols; ++c)
{
t.at(row_num, c) = eT(0);
}

++row_num;
}
}
Expand Down Expand Up @@ -6796,21 +6802,10 @@ Mat<eT>::set_size(const uword new_n_elem)
{
arma_extra_debug_sigprint();

switch(vec_state)
{
case 0:
// fallthrough
case 1:
init_warm(new_n_elem, 1);
break;

case 2:
init_warm(1, new_n_elem);
break;

default:
;
}
const uword new_n_rows = (vec_state == 2) ? uword(1 ) : uword(new_n_elem);
const uword new_n_cols = (vec_state == 2) ? uword(new_n_elem) : uword(1 );

init_warm(new_n_rows, new_n_cols);

return *this;
}
Expand Down Expand Up @@ -6854,23 +6849,10 @@ Mat<eT>::resize(const uword new_n_elem)
{
arma_extra_debug_sigprint();

switch(vec_state)
{
case 0:
// fallthrough
case 1:
(*this).resize(new_n_elem, 1);
break;

case 2:
(*this).resize(1, new_n_elem);
break;

default:
;
}
const uword new_n_rows = (vec_state == 2) ? uword(1 ) : uword(new_n_elem);
const uword new_n_cols = (vec_state == 2) ? uword(new_n_elem) : uword(1 );

return *this;
return (*this).resize(new_n_rows, new_n_cols);
}


Expand Down
2 changes: 1 addition & 1 deletion inst/include/armadillo_bits/SpMat_bones.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class SpMat : public SpBase< eT, SpMat<eT> >
template<typename T1> inline SpMat& operator*=(const Op<T1, op_diagmat>& expr);
template<typename T1> inline SpMat& operator/=(const Op<T1, op_diagmat>& expr);
template<typename T1> inline SpMat& operator%=(const Op<T1, op_diagmat>& expr);

//! explicit specification of sparse +/- scalar
template<typename T1, typename op_type> inline explicit SpMat(const SpToDOp<T1, op_type>& expr);

Expand Down
39 changes: 12 additions & 27 deletions inst/include/armadillo_bits/SpMat_meat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3701,21 +3701,14 @@ SpMat<eT>::copy_size(const Mat<eT2>& m)
template<typename eT>
inline
SpMat<eT>&
SpMat<eT>::set_size(const uword in_elem)
SpMat<eT>::set_size(const uword new_n_elem)
{
arma_extra_debug_sigprint();

// If this is a row vector, we resize to a row vector.
if(vec_state == 2)
{
set_size(1, in_elem);
}
else
{
set_size(in_elem, 1);
}
const uword new_n_rows = (vec_state == 2) ? uword(1 ) : uword(new_n_elem);
const uword new_n_cols = (vec_state == 2) ? uword(new_n_elem) : uword(1 );

return *this;
return set_size(new_n_rows, new_n_cols);
}


Expand Down Expand Up @@ -4115,20 +4108,14 @@ SpMat<eT>::zeros()
template<typename eT>
inline
SpMat<eT>&
SpMat<eT>::zeros(const uword in_elem)
SpMat<eT>::zeros(const uword new_n_elem)
{
arma_extra_debug_sigprint();

if(vec_state == 2)
{
zeros(1, in_elem); // Row vector
}
else
{
zeros(in_elem, 1);
}
const uword new_n_rows = (vec_state == 2) ? uword(1 ) : uword(new_n_elem);
const uword new_n_cols = (vec_state == 2) ? uword(new_n_elem) : uword(1 );

return *this;
return zeros(new_n_rows, new_n_cols);
}


Expand Down Expand Up @@ -4432,12 +4419,10 @@ SpMat<eT>::reset()
{
arma_extra_debug_sigprint();

switch(vec_state)
{
default: init(0, 0); break;
case 1: init(0, 1); break;
case 2: init(1, 0); break;
}
const uword new_n_rows = (vec_state == 2) ? 1 : 0;
const uword new_n_cols = (vec_state == 1) ? 1 : 0;

init(new_n_rows, new_n_cols);
}


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 8
#define ARMA_VERSION_PATCH 1
#define ARMA_VERSION_PATCH 2
#define ARMA_VERSION_NAME "Cortisol Injector"


Expand Down
29 changes: 18 additions & 11 deletions inst/include/armadillo_bits/def_fftw3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,38 @@
// ------------------------------------------------------------------------


#if defined(ARMA_USE_FFTW3)
#if defined(ARMA_USE_FFTW3) && !defined(FFTW3_H)


// prefix for single precision: fftwf_
// prefix for double precision: fftw_


typedef void fftwf_complex;
typedef void fftw_complex;

typedef void_ptr fftwf_plan;
typedef void_ptr fftw_plan;


extern "C"
{
// function prefix for single precision: fftwf_
// function prefix for double precision: fftw_


// single precision (float)

void_ptr fftwf_plan_dft_1d(int N, void* input, void* output, int fftw3_sign, unsigned int fftw3_flags);
fftwf_plan fftwf_plan_dft_1d(int N, fftwf_complex* input, fftwf_complex* output, int fftw3_sign, unsigned int fftw3_flags);

void fftwf_execute(void_ptr plan);
void fftwf_destroy_plan(void_ptr plan);
void fftwf_execute(fftwf_plan plan);
void fftwf_destroy_plan(fftwf_plan plan);

void fftwf_cleanup();


// double precision (double)

void_ptr fftw_plan_dft_1d(int N, void* input, void* output, int fftw3_sign, unsigned int fftw3_flags);
fftw_plan fftw_plan_dft_1d(int N, fftw_complex* input, fftw_complex* output, int fftw3_sign, unsigned int fftw3_flags);

void fftw_execute(void_ptr plan);
void fftw_destroy_plan(void_ptr plan);
void fftw_execute(fftw_plan plan);
void fftw_destroy_plan(fftw_plan plan);

void fftw_cleanup();
}
Expand Down
Loading

0 comments on commit b8ca6f9

Please sign in to comment.