Skip to content

Commit

Permalink
Merge pull request #442 from RcppCore/feature/arma-12.8.rc
Browse files Browse the repository at this point in the history
RcppArmadillo 0.12.8.3.1 with Armadillo 12.8.4-rc1
  • Loading branch information
eddelbuettel authored May 29, 2024
2 parents de8f97b + 8c8202c commit b2b28c8
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 26 deletions.
10 changes: 10 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
2024-05-29 Dirk Eddelbuettel <[email protected]>

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

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

* inst/include/armadillo_bits/: Armadillo 12.8.4-rc1

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

* DESCRIPTION (Imports): Updated versioned constraint on Rcpp to
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.3.0
Date: 2024-05-07
Version: 0.12.8.3.1
Date: 2024-05-26
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.8.3.0.
# Generated by GNU Autoconf 2.71 for RcppArmadillo 0.12.8.3.1.
#
# 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.3.0'
PACKAGE_STRING='RcppArmadillo 0.12.8.3.0'
PACKAGE_VERSION='0.12.8.3.1'
PACKAGE_STRING='RcppArmadillo 0.12.8.3.1'
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.3.0 to adapt to many kinds of systems.
\`configure' configures RcppArmadillo 0.12.8.3.1 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.3.0:";;
short | recursive ) echo "Configuration of RcppArmadillo 0.12.8.3.1:";;
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.3.0
RcppArmadillo configure 0.12.8.3.1
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.3.0, which was
It was created by RcppArmadillo $as_me 0.12.8.3.1, 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.3.0, which was
This file was extended by RcppArmadillo $as_me 0.12.8.3.1, 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.3.0
RcppArmadillo config.status 0.12.8.3.1
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.3.0],[[email protected]])
AC_INIT([RcppArmadillo],[0.12.8.3.1],[[email protected]])

## Set R_HOME, respecting an environment variable if one is set
: ${R_HOME=$(R RHOME)}
Expand Down
6 changes: 3 additions & 3 deletions inst/include/armadillo
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
#ifndef ARMA_INCLUDES
#define ARMA_INCLUDES

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

#include "armadillo_bits/config.hpp"
#include "armadillo_bits/compiler_check.hpp"
Expand Down
26 changes: 18 additions & 8 deletions inst/include/armadillo_bits/SpSubview_meat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,28 @@ SpSubview<eT>::SpSubview(const SpMat<eT>& in_m, const uword in_row1, const uword

m.sync_csc();

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

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

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

count += condition ? uword(1) : uword(0);
for(uword i = m.col_ptrs[in_col1]; i < lend; ++i)
{
const uword m_row_indices_i = m.row_indices[i];

const bool condition = (m_row_indices_i >= in_row1) && (m_row_indices_i < lend_row);

count += condition ? uword(1) : uword(0);
}
}

access::rw(n_nonzero) = count;
Expand Down
2 changes: 1 addition & 1 deletion inst/include/armadillo_bits/fn_conv_to.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class conv_to

template<typename in_eT, typename T1>
inline static out_eT from(const Base<in_eT, T1>& in, const typename arma_not_cx<in_eT>::result* junk = nullptr);

template<typename in_eT, typename T1>
inline static out_eT from(const Base<in_eT, T1>& in, const typename arma_cx_only<in_eT>::result* junk = nullptr);

Expand Down
22 changes: 20 additions & 2 deletions inst/include/armadillo_bits/fn_dot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,31 @@ dot
{
arma_extra_debug_sigprint();

typedef typename T1::elem_type eT;

if(is_SpSubview_col<T2>::value)
{
// TODO: refactor to use C++17 "if constexpr" to avoid reinterpret_cast shenanigans

const SpSubview_col<eT>& yy = reinterpret_cast< const SpSubview_col<eT>& >(y);

if(yy.n_rows == yy.m.n_rows)
{
arma_extra_debug_print("using sparse column vector specialisation");

const quasi_unwrap<T1> U(x);

arma_debug_assert_same_size(U.M.n_elem, uword(1), yy.n_elem, uword(1), "dot()");

return dense_sparse_helper::dot(U.M.memptr(), yy.m, yy.aux_col1);
}
}

const Proxy<T1> pa(x);
const SpProxy<T2> pb(y);

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

typedef typename T1::elem_type eT;

eT result = eT(0);

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

0 comments on commit b2b28c8

Please sign in to comment.