Skip to content

Commit

Permalink
Update armadillo version 12.8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
TLCFEM committed May 31, 2024
1 parent a663a03 commit dcc4663
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 16 deletions.
6 changes: 3 additions & 3 deletions Include/armadillo/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 Include/armadillo/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 Include/armadillo/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 3
#define ARMA_VERSION_PATCH 4
#define ARMA_VERSION_NAME "Cortisol Injector"


Expand Down
2 changes: 1 addition & 1 deletion Include/armadillo/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
24 changes: 22 additions & 2 deletions Include/armadillo/armadillo_bits/fn_dot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,33 @@ 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()");

yy.m.sync();

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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ Additional libraries used in **suanPan** are listed as follows.
- [**VTK**](https://vtk.org/) version 9.2.6
- [**CUDA**](https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/) version 12.0
- [**MAGMA**](https://icl.utk.edu/magma/) version 2.8.0
- [**Armadillo**](http://arma.sourceforge.net/) version 12.8.3
- [**Armadillo**](http://arma.sourceforge.net/) version 12.8.4
- [**ensmallen**](https://ensmallen.org/) version 2.21.1
- [**oneMKL**](https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/onemkl.html) version 2024.1.0
- [**Catch2**](https://github.com/catchorg/Catch2) version 3.5.4
Expand Down

0 comments on commit dcc4663

Please sign in to comment.