Skip to content

Commit

Permalink
Update armadillo version 14.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
TLCFEM committed Dec 6, 2024
1 parent 05a5ede commit 1934549
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 26 deletions.
2 changes: 2 additions & 0 deletions Include/armadillo/armadillo_bits/Col_bones.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ class Col<eT>::fixed : public Col<eT>
{
private:

using Mat<eT>::mem_local;

static constexpr bool use_extra = (fixed_n_elem > arma_config::mat_prealloc);

arma_align_mem eT mem_local_extra[ (use_extra) ? fixed_n_elem : 1 ];
Expand Down
10 changes: 5 additions & 5 deletions Include/armadillo/armadillo_bits/Col_meat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1345,11 +1345,11 @@ Col<eT>::fixed<fixed_n_elem>::fixed(const fill::fill_class<fill_type>&)
{
arma_debug_sigprint_this(this);

if(is_same_type<fill_type, fill::fill_zeros>::yes) { (*this).zeros(); }
if(is_same_type<fill_type, fill::fill_ones >::yes) { (*this).ones(); }
if(is_same_type<fill_type, fill::fill_eye >::yes) { (*this).eye(); }
if(is_same_type<fill_type, fill::fill_randu>::yes) { (*this).randu(); }
if(is_same_type<fill_type, fill::fill_randn>::yes) { (*this).randn(); }
if(is_same_type<fill_type, fill::fill_zeros>::yes) { (*this).zeros(); }
if(is_same_type<fill_type, fill::fill_ones >::yes) { (*this).ones(); }
if(is_same_type<fill_type, fill::fill_eye >::yes) { Mat<eT>::eye(); }
if(is_same_type<fill_type, fill::fill_randu>::yes) { Mat<eT>::randu(); }
if(is_same_type<fill_type, fill::fill_randn>::yes) { Mat<eT>::randn(); }
}


Expand Down
3 changes: 3 additions & 0 deletions Include/armadillo/armadillo_bits/Cube_bones.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,9 @@ class Cube<eT>::fixed : public Cube<eT>
{
private:

using Cube<eT>::mat_ptrs_local;
using Cube<eT>::mem_local;

static constexpr uword fixed_n_elem = fixed_n_rows * fixed_n_cols * fixed_n_slices;
static constexpr uword fixed_n_elem_slice = fixed_n_rows * fixed_n_cols;

Expand Down
8 changes: 4 additions & 4 deletions Include/armadillo/armadillo_bits/Cube_meat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5412,10 +5412,10 @@ Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::fixed(const fill::f

mem_setup();

if(is_same_type<fill_type, fill::fill_zeros>::yes) { (*this).zeros(); }
if(is_same_type<fill_type, fill::fill_ones >::yes) { (*this).ones(); }
if(is_same_type<fill_type, fill::fill_randu>::yes) { (*this).randu(); }
if(is_same_type<fill_type, fill::fill_randn>::yes) { (*this).randn(); }
if(is_same_type<fill_type, fill::fill_zeros>::yes) { Cube<eT>::zeros(); }
if(is_same_type<fill_type, fill::fill_ones >::yes) { Cube<eT>::ones(); }
if(is_same_type<fill_type, fill::fill_randu>::yes) { Cube<eT>::randu(); }
if(is_same_type<fill_type, fill::fill_randn>::yes) { Cube<eT>::randn(); }

arma_static_check( (is_same_type<fill_type, fill::fill_eye>::yes), "Cube::fixed::fixed(): unsupported fill type" );
}
Expand Down
2 changes: 2 additions & 0 deletions Include/armadillo/armadillo_bits/Mat_bones.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,8 @@ class Mat<eT>::fixed : public Mat<eT>
{
private:

using Mat<eT>::mem_local;

static constexpr uword fixed_n_elem = fixed_n_rows * fixed_n_cols;
static constexpr bool use_extra = (fixed_n_elem > arma_config::mat_prealloc);

Expand Down
10 changes: 5 additions & 5 deletions Include/armadillo/armadillo_bits/Mat_meat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9565,11 +9565,11 @@ Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::fixed(const fill::fill_class<fill_ty
{
arma_debug_sigprint_this(this);

if(is_same_type<fill_type, fill::fill_zeros>::yes) { (*this).zeros(); }
if(is_same_type<fill_type, fill::fill_ones >::yes) { (*this).ones(); }
if(is_same_type<fill_type, fill::fill_eye >::yes) { (*this).eye(); }
if(is_same_type<fill_type, fill::fill_randu>::yes) { (*this).randu(); }
if(is_same_type<fill_type, fill::fill_randn>::yes) { (*this).randn(); }
if(is_same_type<fill_type, fill::fill_zeros>::yes) { (*this).zeros(); }
if(is_same_type<fill_type, fill::fill_ones >::yes) { (*this).ones(); }
if(is_same_type<fill_type, fill::fill_eye >::yes) { Mat<eT>::eye(); }
if(is_same_type<fill_type, fill::fill_randu>::yes) { Mat<eT>::randu(); }
if(is_same_type<fill_type, fill::fill_randn>::yes) { Mat<eT>::randn(); }
}


Expand Down
2 changes: 2 additions & 0 deletions Include/armadillo/armadillo_bits/Row_bones.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ class Row<eT>::fixed : public Row<eT>
{
private:

using Mat<eT>::mem_local;

static constexpr bool use_extra = (fixed_n_elem > arma_config::mat_prealloc);

arma_align_mem eT mem_local_extra[ (use_extra) ? fixed_n_elem : 1 ];
Expand Down
10 changes: 5 additions & 5 deletions Include/armadillo/armadillo_bits/Row_meat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1345,11 +1345,11 @@ Row<eT>::fixed<fixed_n_elem>::fixed(const fill::fill_class<fill_type>&)
{
arma_debug_sigprint_this(this);

if(is_same_type<fill_type, fill::fill_zeros>::yes) { (*this).zeros(); }
if(is_same_type<fill_type, fill::fill_ones >::yes) { (*this).ones(); }
if(is_same_type<fill_type, fill::fill_eye >::yes) { (*this).eye(); }
if(is_same_type<fill_type, fill::fill_randu>::yes) { (*this).randu(); }
if(is_same_type<fill_type, fill::fill_randn>::yes) { (*this).randn(); }
if(is_same_type<fill_type, fill::fill_zeros>::yes) { (*this).zeros(); }
if(is_same_type<fill_type, fill::fill_ones >::yes) { (*this).ones(); }
if(is_same_type<fill_type, fill::fill_eye >::yes) { Mat<eT>::eye(); }
if(is_same_type<fill_type, fill::fill_randu>::yes) { Mat<eT>::randu(); }
if(is_same_type<fill_type, fill::fill_randn>::yes) { Mat<eT>::randn(); }
}


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 14
#define ARMA_VERSION_MINOR 2
#define ARMA_VERSION_PATCH 1
#define ARMA_VERSION_PATCH 2
#define ARMA_VERSION_NAME "Smooth Caffeine"


Expand Down
37 changes: 32 additions & 5 deletions Include/armadillo/armadillo_bits/sym_helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,26 @@ guess_sympd_worker(const Mat<eT>& A)
const eT* A_mem = A.memptr();
const eT* A_col = A_mem;

bool diag_below_tol = true;

eT max_diag = eT(0);

for(uword j=0; j < N; ++j)
{
const eT A_jj = A_col[j];

if(A_jj <= eT(0)) { return false; }
if( A_jj <= eT(0)) { return false; }
if(arma_isfinite(A_jj) == false) { return false; }

if(A_jj >= tol) { diag_below_tol = false; }

max_diag = (A_jj > max_diag) ? A_jj : max_diag;

A_col += N;
}

if(diag_below_tol) { return false; } // assume matrix is suspect if all diagonal elements are close to zero

A_col = A_mem;

const uword Nm1 = N-1;
Expand Down Expand Up @@ -128,6 +135,8 @@ guess_sympd_worker(const Mat<eT>& A)
const eT* A_mem = A.memptr();
const eT* A_col = A_mem;

bool diag_below_tol = true;

T max_diag = T(0);

for(uword j=0; j < N; ++j)
Expand All @@ -138,15 +147,21 @@ guess_sympd_worker(const Mat<eT>& A)
const T A_jj_rabs = std::abs(A_jj_r);
const T A_jj_iabs = std::abs(A_jj_i);

if(A_jj_r <= T(0) ) { return false; } // real should be positive
if(A_jj_iabs > tol ) { return false; } // imag should be approx zero
if(A_jj_iabs > A_jj_rabs) { return false; } // corner case: real and imag are close to zero, and imag is dominant
if( A_jj_r <= T(0) ) { return false; } // real should be positive
if(arma_isfinite(A_jj_r) == false) { return false; }

if(A_jj_iabs > tol ) { return false; } // imag should be approx zero
if(A_jj_iabs > A_jj_rabs) { return false; } // corner case: real and imag are close to zero, and imag is dominant

if(A_jj_r >= tol) { diag_below_tol = false; }

max_diag = (A_jj_r > max_diag) ? A_jj_r : max_diag;

A_col += N;
}

if(diag_below_tol) { return false; } // assume matrix is suspect if all diagonal elements are close to zero

const T square_max_diag = max_diag * max_diag;

if(arma_isfinite(square_max_diag) == false) { return false; }
Expand Down Expand Up @@ -264,15 +279,21 @@ is_approx_sym_worker(const Mat<eT>& A)
const eT* A_mem = A.memptr();
const eT* A_col = A_mem;

bool diag_below_tol = true;

for(uword j=0; j < N; ++j)
{
const eT& A_jj = A_col[j];
const eT A_jj = A_col[j];

if(arma_isfinite(A_jj) == false) { return false; }

if(std::abs(A_jj) >= tol) { diag_below_tol = false; }

A_col += N;
}

if(diag_below_tol) { return false; } // assume matrix is suspect if all diagonal elements are close to zero

A_col = A_mem;

const uword Nm1 = N-1;
Expand Down Expand Up @@ -324,6 +345,8 @@ is_approx_sym_worker(const Mat<eT>& A)
const eT* A_mem = A.memptr();
const eT* A_col = A_mem;

bool diag_below_tol = true;

// ensure diagonal has approx real-only elements
for(uword j=0; j < N; ++j)
{
Expand All @@ -338,9 +361,13 @@ is_approx_sym_worker(const Mat<eT>& A)

if(arma_isfinite(A_jj_r) == false) { return false; }

if(A_jj_rabs >= tol) { diag_below_tol = false; }

A_col += N;
}

if(diag_below_tol) { return false; } // assume matrix is suspect if all diagonal elements are close to zero

A_col = A_mem;

const uword Nm1 = N-1;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ Additional libraries used in **suanPan** are listed as follows.
- [**VTK**](https://vtk.org/) version 9.4
- [**CUDA**](https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/) version 12.5
- [**MAGMA**](https://icl.utk.edu/magma/) version 2.8.0
- [**Armadillo**](http://arma.sourceforge.net/) version 14.2.1
- [**Armadillo**](http://arma.sourceforge.net/) version 14.2.2
- [**ensmallen**](https://ensmallen.org/) version 2.21.1
- [**oneMKL**](https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/onemkl.html) version 2025.0.1
- [**Catch2**](https://github.com/catchorg/Catch2) version 3.7.1
Expand Down

0 comments on commit 1934549

Please sign in to comment.