Skip to content

Commit b2b28c8

Browse files
authored
Merge pull request #442 from RcppCore/feature/arma-12.8.rc
RcppArmadillo 0.12.8.3.1 with Armadillo 12.8.4-rc1
2 parents de8f97b + 8c8202c commit b2b28c8

File tree

8 files changed

+64
-26
lines changed

8 files changed

+64
-26
lines changed

ChangeLog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2024-05-29 Dirk Eddelbuettel <[email protected]>
2+
3+
* DESCRIPTION (Version, Date): RcppArmadillo 0.12.8.3.1
4+
* inst/NEWS.Rd: Idem
5+
* configure.ac: Idem
6+
7+
2024-05-26 Dirk Eddelbuettel <[email protected]>
8+
9+
* inst/include/armadillo_bits/: Armadillo 12.8.4-rc1
10+
111
2024-05-17 Dirk Eddelbuettel <[email protected]>
212

313
* DESCRIPTION (Imports): Updated versioned constraint on Rcpp to

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.8.3.0
5-
Date: 2024-05-07
4+
Version: 0.12.8.3.1
5+
Date: 2024-05-26
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.8.3.0.
3+
# Generated by GNU Autoconf 2.71 for RcppArmadillo 0.12.8.3.1.
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.8.3.0'
614-
PACKAGE_STRING='RcppArmadillo 0.12.8.3.0'
613+
PACKAGE_VERSION='0.12.8.3.1'
614+
PACKAGE_STRING='RcppArmadillo 0.12.8.3.1'
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.8.3.0 to adapt to many kinds of systems.
1232+
\`configure' configures RcppArmadillo 0.12.8.3.1 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.8.3.0:";;
1294+
short | recursive ) echo "Configuration of RcppArmadillo 0.12.8.3.1:";;
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.8.3.0
1375+
RcppArmadillo configure 0.12.8.3.1
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.8.3.0, which was
1489+
It was created by RcppArmadillo $as_me 0.12.8.3.1, 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.8.3.0, which was
3947+
This file was extended by RcppArmadillo $as_me 0.12.8.3.1, 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.8.3.0
4002+
RcppArmadillo config.status 0.12.8.3.1
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.8.3.0],[[email protected]])
14+
AC_INIT([RcppArmadillo],[0.12.8.3.1],[[email protected]])
1515

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

inst/include/armadillo

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
#ifndef ARMA_INCLUDES
2020
#define ARMA_INCLUDES
2121

22-
// NOTE: functions that are designed to be user accessible are described in the documentation (docs.html).
23-
// NOTE: all other functions and classes (ie. not explicitly described in the documentation)
24-
// NOTE: are considered as internal implementation details, and may be changed or removed without notice.
22+
// WARNING: the documentation (docs.html) describes the public API (functions, classes, constants);
23+
// WARNING: any functionality which is _not explicitly_ described in the documentation
24+
// WARNING: is considered as internal implementation detail, and may be changed or removed without notice.
2525

2626
#include "armadillo_bits/config.hpp"
2727
#include "armadillo_bits/compiler_check.hpp"

inst/include/armadillo_bits/SpSubview_meat.hpp

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,28 @@ SpSubview<eT>::SpSubview(const SpMat<eT>& in_m, const uword in_row1, const uword
4444

4545
m.sync_csc();
4646

47-
// There must be a O(1) way to do this
48-
uword lend = m.col_ptrs[in_col1 + in_n_cols];
49-
uword lend_row = in_row1 + in_n_rows;
50-
uword count = 0;
47+
// count the number of non-zeros in the subview
48+
uword count = 0;
5149

52-
for(uword i = m.col_ptrs[in_col1]; i < lend; ++i)
50+
if(n_rows == m.n_rows)
5351
{
54-
const uword m_row_indices_i = m.row_indices[i];
52+
count = m.col_ptrs[aux_col1 + n_cols] - m.col_ptrs[aux_col1];
53+
}
54+
else
55+
{
56+
arma_extra_debug_print("counting non-zeros in sparse subview");
5557

56-
const bool condition = (m_row_indices_i >= in_row1) && (m_row_indices_i < lend_row);
58+
uword lend = m.col_ptrs[in_col1 + in_n_cols];
59+
uword lend_row = in_row1 + in_n_rows;
5760

58-
count += condition ? uword(1) : uword(0);
61+
for(uword i = m.col_ptrs[in_col1]; i < lend; ++i)
62+
{
63+
const uword m_row_indices_i = m.row_indices[i];
64+
65+
const bool condition = (m_row_indices_i >= in_row1) && (m_row_indices_i < lend_row);
66+
67+
count += condition ? uword(1) : uword(0);
68+
}
5969
}
6070

6171
access::rw(n_nonzero) = count;

inst/include/armadillo_bits/fn_conv_to.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class conv_to
3030

3131
template<typename in_eT, typename T1>
3232
inline static out_eT from(const Base<in_eT, T1>& in, const typename arma_not_cx<in_eT>::result* junk = nullptr);
33-
33+
3434
template<typename in_eT, typename T1>
3535
inline static out_eT from(const Base<in_eT, T1>& in, const typename arma_cx_only<in_eT>::result* junk = nullptr);
3636

inst/include/armadillo_bits/fn_dot.hpp

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,13 +289,31 @@ dot
289289
{
290290
arma_extra_debug_sigprint();
291291

292+
typedef typename T1::elem_type eT;
293+
294+
if(is_SpSubview_col<T2>::value)
295+
{
296+
// TODO: refactor to use C++17 "if constexpr" to avoid reinterpret_cast shenanigans
297+
298+
const SpSubview_col<eT>& yy = reinterpret_cast< const SpSubview_col<eT>& >(y);
299+
300+
if(yy.n_rows == yy.m.n_rows)
301+
{
302+
arma_extra_debug_print("using sparse column vector specialisation");
303+
304+
const quasi_unwrap<T1> U(x);
305+
306+
arma_debug_assert_same_size(U.M.n_elem, uword(1), yy.n_elem, uword(1), "dot()");
307+
308+
return dense_sparse_helper::dot(U.M.memptr(), yy.m, yy.aux_col1);
309+
}
310+
}
311+
292312
const Proxy<T1> pa(x);
293313
const SpProxy<T2> pb(y);
294314

295315
arma_debug_assert_same_size(pa.get_n_rows(), pa.get_n_cols(), pb.get_n_rows(), pb.get_n_cols(), "dot()");
296316

297-
typedef typename T1::elem_type eT;
298-
299317
eT result = eT(0);
300318

301319
typename SpProxy<T2>::const_iterator_type it = pb.begin();

0 commit comments

Comments
 (0)