Skip to content

Commit b635bfa

Browse files
committed
Armadillo 14.4.1
1 parent 8e652b1 commit b635bfa

32 files changed

+167
-137
lines changed

inst/include/armadillo_bits/Cube_meat.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ Cube<eT>::operator-=(const subview_cube<eT>& X)
10191019

10201020

10211021

1022-
//! in-place element-wise cube mutiplication (using a subcube on the right-hand-side)
1022+
//! in-place element-wise cube multiplication (using a subcube on the right-hand-side)
10231023
template<typename eT>
10241024
inline
10251025
Cube<eT>&

inst/include/armadillo_bits/GenCube_meat.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ GenCube<eT, gen_type>::apply(Cube<eT>& out) const
8989
arma_debug_sigprint();
9090

9191
// NOTE: we're assuming that the cube has already been set to the correct size;
92-
// this is done by either the Cube contructor or operator=()
92+
// this is done by either the Cube constructor or operator=()
9393

9494
if(is_same_type<gen_type, gen_zeros>::yes) { out.zeros(); }
9595
else if(is_same_type<gen_type, gen_ones >::yes) { out.ones(); }

inst/include/armadillo_bits/Gen_meat.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Gen<T1, gen_type>::apply(Mat<typename T1::elem_type>& out) const
9191
arma_debug_sigprint();
9292

9393
// NOTE: we're assuming that the matrix has already been set to the correct size;
94-
// this is done by either the Mat contructor or operator=()
94+
// this is done by either the Mat constructor or operator=()
9595

9696
if(is_same_type<gen_type, gen_zeros>::yes) { out.zeros(); }
9797
else if(is_same_type<gen_type, gen_ones >::yes) { out.ones(); }

inst/include/armadillo_bits/MapMat_meat.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ MapMat_val<eT>::operator/=(const eT in_val)
10091009
}
10101010
else
10111011
{
1012-
// silly operation, but included for completness
1012+
// silly operation, but included for completeness
10131013

10141014
const eT val = eT(0) / in_val;
10151015

inst/include/armadillo_bits/Mat_meat.hpp

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2067,7 +2067,7 @@ Mat<eT>::operator-=(const subview<eT>& X)
20672067

20682068

20692069

2070-
//! in-place matrix mutiplication (using a submatrix on the right-hand-side)
2070+
//! in-place matrix multiplication (using a submatrix on the right-hand-side)
20712071
template<typename eT>
20722072
inline
20732073
Mat<eT>&
@@ -2082,7 +2082,7 @@ Mat<eT>::operator*=(const subview<eT>& X)
20822082

20832083

20842084

2085-
//! in-place element-wise matrix mutiplication (using a submatrix on the right-hand-side)
2085+
//! in-place element-wise matrix multiplication (using a submatrix on the right-hand-side)
20862086
template<typename eT>
20872087
inline
20882088
Mat<eT>&
@@ -2257,7 +2257,7 @@ Mat<eT>::operator-=(const subview_cube<eT>& X)
22572257

22582258

22592259

2260-
//! in-place matrix mutiplication (using a single-slice subcube on the right-hand-side)
2260+
//! in-place matrix multiplication (using a single-slice subcube on the right-hand-side)
22612261
template<typename eT>
22622262
inline
22632263
Mat<eT>&
@@ -2274,7 +2274,7 @@ Mat<eT>::operator*=(const subview_cube<eT>& X)
22742274

22752275

22762276

2277-
//! in-place element-wise matrix mutiplication (using a single-slice subcube on the right-hand-side)
2277+
//! in-place element-wise matrix multiplication (using a single-slice subcube on the right-hand-side)
22782278
template<typename eT>
22792279
inline
22802280
Mat<eT>&
@@ -2383,7 +2383,7 @@ Mat<eT>::operator-=(const diagview<eT>& X)
23832383

23842384

23852385

2386-
//! in-place matrix mutiplication (using a diagview on the right-hand-side)
2386+
//! in-place matrix multiplication (using a diagview on the right-hand-side)
23872387
template<typename eT>
23882388
inline
23892389
Mat<eT>&
@@ -2398,7 +2398,7 @@ Mat<eT>::operator*=(const diagview<eT>& X)
23982398

23992399

24002400

2401-
//! in-place element-wise matrix mutiplication (using a diagview on the right-hand-side)
2401+
//! in-place element-wise matrix multiplication (using a diagview on the right-hand-side)
24022402
template<typename eT>
24032403
inline
24042404
Mat<eT>&
@@ -2862,6 +2862,8 @@ Mat<eT>::operator=(const SpSubview<eT>& X)
28622862

28632863
if(X.n_rows == X.m.n_rows)
28642864
{
2865+
arma_debug_print("access via arrays");
2866+
28652867
X.m.sync();
28662868

28672869
const uword sv_col_start = X.aux_col1;
@@ -2889,6 +2891,8 @@ Mat<eT>::operator=(const SpSubview<eT>& X)
28892891
}
28902892
else
28912893
{
2894+
arma_debug_print("access via iterators");
2895+
28922896
typename SpSubview<eT>::const_iterator it = X.begin();
28932897
typename SpSubview<eT>::const_iterator it_end = X.end();
28942898

@@ -2913,6 +2917,8 @@ Mat<eT>::operator+=(const SpSubview<eT>& X)
29132917

29142918
if(X.n_rows == X.m.n_rows)
29152919
{
2920+
arma_debug_print("access via arrays");
2921+
29162922
X.m.sync();
29172923

29182924
const uword sv_col_start = X.aux_col1;
@@ -2940,6 +2946,8 @@ Mat<eT>::operator+=(const SpSubview<eT>& X)
29402946
}
29412947
else
29422948
{
2949+
arma_debug_print("access via iterators");
2950+
29432951
typename SpSubview<eT>::const_iterator it = X.begin();
29442952
typename SpSubview<eT>::const_iterator it_end = X.end();
29452953

@@ -2964,6 +2972,8 @@ Mat<eT>::operator-=(const SpSubview<eT>& X)
29642972

29652973
if(X.n_rows == X.m.n_rows)
29662974
{
2975+
arma_debug_print("access via arrays");
2976+
29672977
X.m.sync();
29682978

29692979
const uword sv_col_start = X.aux_col1;
@@ -2991,6 +3001,8 @@ Mat<eT>::operator-=(const SpSubview<eT>& X)
29913001
}
29923002
else
29933003
{
3004+
arma_debug_print("access via iterators");
3005+
29943006
typename SpSubview<eT>::const_iterator it = X.begin();
29953007
typename SpSubview<eT>::const_iterator it_end = X.end();
29963008

@@ -6674,7 +6686,7 @@ Mat<eT>::is_colvec() const
66746686

66756687

66766688

6677-
//! returns true if the object has the same number of non-zero rows and columnns
6689+
//! returns true if the object has the same number of non-zero rows and columns
66786690
template<typename eT>
66796691
arma_inline
66806692
bool

inst/include/armadillo_bits/SpMat_meat.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3126,7 +3126,7 @@ SpMat<eT>::shed_rows(const uword in_row1, const uword in_row2)
31263126
arma_conform_check_bounds
31273127
(
31283128
(in_row1 > in_row2) || (in_row2 >= n_rows),
3129-
"SpMat::shed_rows(): indices out of bounds or incorectly used"
3129+
"SpMat::shed_rows(): indices out of bounds or incorrectly used"
31303130
);
31313131

31323132
sync_csc();
@@ -3288,7 +3288,7 @@ SpMat<eT>::shed_cols(const uword in_col1, const uword in_col2)
32883288

32893289

32903290
/**
3291-
* Element access; acces the i'th element (works identically to the Mat accessors).
3291+
* Element access; access the i'th element (works identically to the Mat accessors).
32923292
* If there is nothing at element i, 0 is returned.
32933293
*/
32943294

@@ -3484,7 +3484,7 @@ SpMat<eT>::is_colvec() const
34843484

34853485

34863486

3487-
//! returns true if the object has the same number of non-zero rows and columnns
3487+
//! returns true if the object has the same number of non-zero rows and columns
34883488
template<typename eT>
34893489
arma_inline
34903490
bool
@@ -5202,7 +5202,7 @@ SpMat<eT>::init(const MapMat<eT>& x)
52025202
const uword x_index = x_entry.first;
52035203
const eT x_val = x_entry.second;
52045204

5205-
// have we gone past the curent column?
5205+
// have we gone past the current column?
52065206
if(x_index >= x_col_index_endp1)
52075207
{
52085208
x_col = x_index / x_n_rows;
@@ -5481,7 +5481,7 @@ SpMat<eT>::init_batch_add(const Mat<uword>& locs, const Mat<eT>& vals, const boo
54815481

54825482
uvec sorted_indices = sort_index(abslocs); // Ascending sort.
54835483

5484-
// work out the number of unique elments
5484+
// work out the number of unique elements
54855485
uword n_unique = 1; // first element is unique
54865486

54875487
for(uword i=1; i < sorted_indices.n_elem; ++i)
@@ -5536,7 +5536,7 @@ SpMat<eT>::init_batch_add(const Mat<uword>& locs, const Mat<eT>& vals, const boo
55365536

55375537
if( (sort_locations == false) || (actually_sorted == true) )
55385538
{
5539-
// work out the number of unique elments
5539+
// work out the number of unique elements
55405540
uword n_unique = 1; // first element is unique
55415541

55425542
for(uword i=1; i < locs.n_cols; ++i)
@@ -5918,7 +5918,7 @@ SpMat<eT>::init_xform_mt(const SpBase<eT2,T1>& A, const Functor& func)
59185918
{
59195919
eT& t_values_i = t_values[i];
59205920

5921-
t_values_i = func(x_values[i]); // NOTE: func() must produce a value of type eT (ie. act as a convertor between eT2 and eT)
5921+
t_values_i = func(x_values[i]); // NOTE: func() must produce a value of type eT (ie. act as a converter between eT2 and eT)
59225922

59235923
if(t_values_i == eT(0)) { has_zero = true; }
59245924
}
@@ -5936,7 +5936,7 @@ SpMat<eT>::init_xform_mt(const SpBase<eT2,T1>& A, const Functor& func)
59365936

59375937
while(it != it_end)
59385938
{
5939-
const eT val = func(*it); // NOTE: func() must produce a value of type eT (ie. act as a convertor between eT2 and eT)
5939+
const eT val = func(*it); // NOTE: func() must produce a value of type eT (ie. act as a converter between eT2 and eT)
59405940

59415941
if(val == eT(0)) { has_zero = true; }
59425942

inst/include/armadillo_bits/SpSubview_iterators_meat.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ SpSubview<eT>::const_row_iterator::operator++()
816816
else if((*pos_ptr) == next_min_row + aux_row && col < next_min_col && (*pos_ptr) < aux_row + iterator_base::M->n_rows)
817817
{
818818
// The first element in this column is in a subsequent row that we
819-
// already have another elemnt for, but the column index is less so
819+
// already have another element for, but the column index is less so
820820
// this element will come first.
821821
next_min_col = col;
822822
next_actual_pos = col_offset + (pos_ptr - start_ptr);

inst/include/armadillo_bits/arma_version.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
#define ARMA_VERSION_MAJOR 14
2525
#define ARMA_VERSION_MINOR 4
26-
#define ARMA_VERSION_PATCH 0
26+
#define ARMA_VERSION_PATCH 1
2727
#define ARMA_VERSION_NAME "Filtered Espresso"
2828

2929

inst/include/armadillo_bits/band_helper.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ compress(Mat<eT>& AB, const Mat<eT>& A, const uword KL, const uword KU, const bo
242242
// http://www.netlib.org/lapack/lug/node124.html
243243

244244
// for ?gbsv, matrix AB size: 2*KL+KU+1 x N; band representation of A stored in rows KL+1 to 2*KL+KU+1 (note: fortran counts from 1)
245-
// for ?gbsvx, matrix AB size: KL+KU+1 x N; band representaiton of A stored in rows 1 to KL+KU+1 (note: fortran counts from 1)
245+
// for ?gbsvx, matrix AB size: KL+KU+1 x N; band representation of A stored in rows 1 to KL+KU+1 (note: fortran counts from 1)
246246
//
247247
// the +1 in the above formulas is to take into account the main diagonal
248248

inst/include/armadillo_bits/diagview_meat.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ diagview<eT>::extract(Mat<eT>& out, const diagview<eT>& in)
586586
arma_debug_sigprint();
587587

588588
// NOTE: we're assuming that the matrix has already been set to the correct size and there is no aliasing;
589-
// size setting and alias checking is done by either the Mat contructor or operator=()
589+
// size setting and alias checking is done by either the Mat constructor or operator=()
590590

591591
const Mat<eT>& in_m = in.m;
592592

inst/include/armadillo_bits/diskio_meat.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ diskio::guess_file_type_internal(std::istream& f)
336336

337337
// ssv_ascii has to be before csv_ascii;
338338
// if the data has semicolons, it suggests a CSV file with semicolon as the separating character;
339-
// the semicolon may be used to allow the comma character to represent the decimal seperator (eg. 1,2345 vs 1.2345)
339+
// the semicolon may be used to allow the comma character to represent the decimal separator (eg. 1,2345 vs 1.2345)
340340

341341
if(has_semicolon && (has_bracket == false)) { return ssv_ascii; }
342342

@@ -479,7 +479,7 @@ diskio::convert_token(eT& val, const std::string& token)
479479
// {
480480
// // std::from_chars() doesn't handle leading whitespace
481481
// // std::from_chars() doesn't handle leading + sign
482-
// // std::from_chars() handles only the decimal point (.) as the decimal seperator
482+
// // std::from_chars() handles only the decimal point (.) as the decimal separator
483483
//
484484
// const char str0 = str[0];
485485
// const bool start_ok = ((str0 != ' ') && (str0 != '\t') && (str0 != '+'));
@@ -3690,7 +3690,7 @@ diskio::load_arma_binary(SpMat<eT>& x, std::istream& f, std::string& err_msg)
36903690
{
36913691
arma_debug_print("detected inconsistent data while loading; re-reading integer parts as u32");
36923692

3693-
// inconstency could be due to a different uword size used during saving,
3693+
// inconsistency could be due to a different uword size used during saving,
36943694
// so try loading the row_indices and col_ptrs under the assumption of 32 bit unsigned integers
36953695

36963696
f.clear();
@@ -4483,7 +4483,7 @@ diskio::load_hdf5_binary(Cube<eT>& x, const hdf5_name& spec, std::string& err_ms
44834483
return false;
44844484
}
44854485

4486-
if(ndims == 1) { dims[1] = 1; dims[2] = 1; } // Vector case; one row/colum, several slices
4486+
if(ndims == 1) { dims[1] = 1; dims[2] = 1; } // Vector case; one row/column, several slices
44874487
if(ndims == 2) { dims[2] = 1; } // Matrix case; one column, several rows/slices
44884488

44894489
try { x.set_size(dims[2], dims[1], dims[0]); } catch(...) { err_msg = "not enough memory"; return false; }

inst/include/armadillo_bits/eglue_core_meat.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ eglue_core<eglue_type>::apply(outT& out, const eGlue<T1, T2, eglue_type>& x)
267267
constexpr bool use_mp = (Proxy<T1>::use_mp || Proxy<T2>::use_mp) && (arma_config::openmp);
268268

269269
// NOTE: we're assuming that the matrix has already been set to the correct size and there is no aliasing;
270-
// size setting and alias checking is done by either the Mat contructor or operator=()
270+
// size setting and alias checking is done by either the Mat constructor or operator=()
271271

272272

273273
eT* out_mem = out.memptr();
@@ -759,7 +759,7 @@ eglue_core<eglue_type>::apply(Cube<typename T1::elem_type>& out, const eGlueCube
759759
constexpr bool use_mp = (ProxyCube<T1>::use_mp || ProxyCube<T2>::use_mp) && (arma_config::openmp);
760760

761761
// NOTE: we're assuming that the cube has already been set to the correct size and there is no aliasing;
762-
// size setting and alias checking is done by either the Cube contructor or operator=()
762+
// size setting and alias checking is done by either the Cube constructor or operator=()
763763

764764

765765
eT* out_mem = out.memptr();

inst/include/armadillo_bits/eop_aux.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ class eop_aux
158158
{
159159
//arma_debug_sigprint();
160160

161-
// acording to IEEE Standard for Floating-Point Arithmetic (IEEE 754)
161+
// according to IEEE Standard for Floating-Point Arithmetic (IEEE 754)
162162
// the mantissa length for double is 53 bits = std::numeric_limits<double>::digits
163163
// the mantissa length for float is 24 bits = std::numeric_limits<float >::digits
164164

inst/include/armadillo_bits/eop_core_meat.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ eop_core<eop_type>::apply(outT& out, const eOp<T1, eop_type>& x)
250250
typedef typename T1::elem_type eT;
251251

252252
// NOTE: we're assuming that the matrix has already been set to the correct size and there is no aliasing;
253-
// size setting and alias checking is done by either the Mat contructor or operator=()
253+
// size setting and alias checking is done by either the Mat constructor or operator=()
254254

255255
const eT k = x.aux;
256256
eT* out_mem = out.memptr();
@@ -626,7 +626,7 @@ eop_core<eop_type>::apply(Cube<typename T1::elem_type>& out, const eOpCube<T1, e
626626
typedef typename T1::elem_type eT;
627627

628628
// NOTE: we're assuming that the matrix has already been set to the correct size and there is no aliasing;
629-
// size setting and alias checking is done by either the Mat contructor or operator=()
629+
// size setting and alias checking is done by either the Mat constructor or operator=()
630630

631631
const eT k = x.aux;
632632
eT* out_mem = out.memptr();

inst/include/armadillo_bits/fft_engine_fftw3.hpp

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,48 @@ class fft_engine_fftw3
5050
podarray<cx_type> Y_work; // for storing output
5151

5252
inline
53-
~fft_engine_fftw3()
53+
void
54+
finish()
5455
{
5556
arma_debug_sigprint();
5657

57-
if(fftw3_plan != nullptr) { fftw3::destroy_plan<cx_type>(fftw3_plan); }
58+
if(fftw3_plan != nullptr)
59+
{
60+
arma_debug_print("fft_engine_fftw3::finish(): destroying plan");
61+
fftw3::destroy_plan<cx_type>(fftw3_plan);
62+
}
5863

64+
// arma_debug_print("fft_engine_fftw3::finish(): cleanup");
5965
// fftw3::cleanup<cx_type>(); // NOTE: this also removes any wisdom acquired by FFTW3
6066
}
6167

68+
inline
69+
~fft_engine_fftw3()
70+
{
71+
arma_debug_sigprint();
72+
73+
#if defined(ARMA_USE_OPENMP)
74+
{
75+
#pragma omp critical (arma_fft_engine_fftw3)
76+
{
77+
(*this).finish();
78+
}
79+
}
80+
#elif defined(ARMA_USE_STD_MUTEX)
81+
{
82+
std::mutex& plan_mutex = fft_engine_fftw3_aux::get_plan_mutex();
83+
84+
const std::lock_guard<std::mutex> lock(plan_mutex);
85+
86+
(*this).finish();
87+
}
88+
#else
89+
{
90+
(*this).finish();
91+
}
92+
#endif
93+
}
94+
6295
inline
6396
fft_engine_fftw3(const uword in_N)
6497
: N (in_N )

0 commit comments

Comments
 (0)