Skip to content

Commit f893610

Browse files
committed
Armadillo 14.5.91 aka 14.6-rc1
1 parent 5a65ecb commit f893610

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+2088
-901
lines changed

inst/include/armadillo

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ namespace arma
304304
#include "armadillo_bits/op_clamp_bones.hpp"
305305
#include "armadillo_bits/op_expmat_bones.hpp"
306306
#include "armadillo_bits/op_nonzeros_bones.hpp"
307+
#include "armadillo_bits/op_omit_bones.hpp"
307308
#include "armadillo_bits/op_diff_bones.hpp"
308309
#include "armadillo_bits/op_norm_bones.hpp"
309310
#include "armadillo_bits/op_vecnorm_bones.hpp"
@@ -377,6 +378,7 @@ namespace arma
377378
#include "armadillo_bits/spop_norm_bones.hpp"
378379
#include "armadillo_bits/spop_shift_bones.hpp"
379380
#include "armadillo_bits/spop_relational_bones.hpp"
381+
#include "armadillo_bits/spop_omit_bones.hpp"
380382

381383
#include "armadillo_bits/spglue_plus_bones.hpp"
382384
#include "armadillo_bits/spglue_minus_bones.hpp"
@@ -564,6 +566,7 @@ namespace arma
564566
#include "armadillo_bits/fn_clamp.hpp"
565567
#include "armadillo_bits/fn_expmat.hpp"
566568
#include "armadillo_bits/fn_nonzeros.hpp"
569+
#include "armadillo_bits/fn_omit.hpp"
567570
#include "armadillo_bits/fn_interp1.hpp"
568571
#include "armadillo_bits/fn_interp2.hpp"
569572
#include "armadillo_bits/fn_qz.hpp"
@@ -590,6 +593,7 @@ namespace arma
590593
#include "armadillo_bits/fn_powmat.hpp"
591594
#include "armadillo_bits/fn_powext.hpp"
592595
#include "armadillo_bits/fn_diags_spdiags.hpp"
596+
#include "armadillo_bits/fn_balance.hpp"
593597

594598
#include "armadillo_bits/fn_speye.hpp"
595599
#include "armadillo_bits/fn_spones.hpp"
@@ -758,6 +762,7 @@ namespace arma
758762
#include "armadillo_bits/op_clamp_meat.hpp"
759763
#include "armadillo_bits/op_expmat_meat.hpp"
760764
#include "armadillo_bits/op_nonzeros_meat.hpp"
765+
#include "armadillo_bits/op_omit_meat.hpp"
761766
#include "armadillo_bits/op_diff_meat.hpp"
762767
#include "armadillo_bits/op_norm_meat.hpp"
763768
#include "armadillo_bits/op_vecnorm_meat.hpp"
@@ -831,6 +836,7 @@ namespace arma
831836
#include "armadillo_bits/spop_norm_meat.hpp"
832837
#include "armadillo_bits/spop_shift_meat.hpp"
833838
#include "armadillo_bits/spop_relational_meat.hpp"
839+
#include "armadillo_bits/spop_omit_meat.hpp"
834840

835841
#include "armadillo_bits/spglue_plus_meat.hpp"
836842
#include "armadillo_bits/spglue_minus_meat.hpp"

inst/include/armadillo_bits/BaseCube_meat.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ BaseCube<elem_type,derived>::is_finite() const
328328
for(uword c=0; c<n_c; ++c)
329329
for(uword r=0; r<n_r; ++r)
330330
{
331-
if( arma_isfinite(P.at(r,c,s)) == false ) { return false; }
331+
if( arma_isnonfinite(P.at(r,c,s)) ) { return false; }
332332
}
333333
}
334334

@@ -436,7 +436,7 @@ BaseCube<elem_type,derived>::has_nonfinite() const
436436
for(uword c=0; c<n_c; ++c)
437437
for(uword r=0; r<n_r; ++r)
438438
{
439-
if(arma_isfinite(P.at(r,c,s)) == false) { return true; }
439+
if(arma_isnonfinite(P.at(r,c,s))) { return true; }
440440
}
441441
}
442442

inst/include/armadillo_bits/Base_meat.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ Base<elem_type,derived>::is_finite() const
685685

686686
for(uword i=0; i<n_elem; ++i)
687687
{
688-
if(arma_isfinite(Pea[i]) == false) { return false; }
688+
if(arma_isnonfinite(Pea[i])) { return false; }
689689
}
690690
}
691691
else
@@ -696,7 +696,7 @@ Base<elem_type,derived>::is_finite() const
696696
for(uword col=0; col<n_cols; ++col)
697697
for(uword row=0; row<n_rows; ++row)
698698
{
699-
if(arma_isfinite(P.at(row,col)) == false) { return false; }
699+
if(arma_isnonfinite(P.at(row,col))) { return false; }
700700
}
701701
}
702702
}
@@ -829,7 +829,7 @@ Base<elem_type,derived>::has_nonfinite() const
829829

830830
for(uword i=0; i<n_elem; ++i)
831831
{
832-
if(arma_isfinite(Pea[i]) == false) { return true; }
832+
if(arma_isnonfinite(Pea[i])) { return true; }
833833
}
834834
}
835835
else
@@ -840,7 +840,7 @@ Base<elem_type,derived>::has_nonfinite() const
840840
for(uword col=0; col<n_cols; ++col)
841841
for(uword row=0; row<n_rows; ++row)
842842
{
843-
if(arma_isfinite(P.at(row,col)) == false) { return true; }
843+
if(arma_isnonfinite(P.at(row,col))) { return true; }
844844
}
845845
}
846846
}

inst/include/armadillo_bits/Cube_meat.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,10 @@ Cube<eT>::operator=(const Cube<eT>& x)
784784

785785
arrayops::copy( memptr(), x.mem, n_elem );
786786
}
787+
else
788+
{
789+
arma_debug_print("Cube::operator=(): copy omitted");
790+
}
787791

788792
return *this;
789793
}

inst/include/armadillo_bits/MapMat_meat.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,12 @@ MapMat<eT>::operator=(const MapMat<eT>& x)
106106
{
107107
arma_debug_sigprint();
108108

109-
if(this == &x) { return; }
109+
if(this == &x)
110+
{
111+
arma_debug_print("MapMat::operator=(): copy omitted");
112+
113+
return;
114+
}
110115

111116
access::rw(n_rows) = x.n_rows;
112117
access::rw(n_cols) = x.n_cols;

inst/include/armadillo_bits/Mat_meat.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,10 @@ Mat<eT>::operator=(const Mat<eT>& in_mat)
915915

916916
arrayops::copy( memptr(), in_mat.mem, in_mat.n_elem );
917917
}
918+
else
919+
{
920+
arma_debug_print("Mat::operator=(): copy omitted");
921+
}
918922

919923
return *this;
920924
}

inst/include/armadillo_bits/SpBase_meat.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ SpBase<elem_type,derived>::is_finite() const
748748

749749
while(it != it_end)
750750
{
751-
if(arma_isfinite(*it) == false) { return false; }
751+
if(arma_isnonfinite(*it)) { return false; }
752752
++it;
753753
}
754754
}
@@ -850,7 +850,7 @@ SpBase<elem_type,derived>::has_nonfinite() const
850850

851851
while(it != it_end)
852852
{
853-
if(arma_isfinite(*it) == false) { return true; }
853+
if(arma_isnonfinite(*it)) { return true; }
854854
++it;
855855
}
856856
}

inst/include/armadillo_bits/SpMat_meat.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5124,7 +5124,12 @@ SpMat<eT>::init(const SpMat<eT>& x)
51245124
{
51255125
arma_debug_sigprint();
51265126

5127-
if(this == &x) { return; }
5127+
if(this == &x)
5128+
{
5129+
arma_debug_print("SpMat::init(): copy omitted");
5130+
5131+
return;
5132+
}
51285133

51295134
bool init_done = false;
51305135

inst/include/armadillo_bits/arma_cmath.hpp

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,48 @@ arma_isfinite(const std::complex<T>& x)
6565
}
6666

6767

68+
//
69+
70+
71+
template<typename eT>
72+
inline
73+
bool
74+
arma_isnonfinite(eT)
75+
{
76+
return false;
77+
}
78+
79+
80+
81+
template<>
82+
inline
83+
bool
84+
arma_isnonfinite(float x)
85+
{
86+
return (std::isfinite(x) == false);
87+
}
88+
89+
90+
91+
template<>
92+
inline
93+
bool
94+
arma_isnonfinite(double x)
95+
{
96+
return (std::isfinite(x) == false);
97+
}
98+
99+
100+
101+
template<typename T>
102+
inline
103+
bool
104+
arma_isnonfinite(const std::complex<T>& x)
105+
{
106+
return ( (std::isfinite(x.real()) == false) || (std::isfinite(x.imag()) == false) );
107+
}
108+
109+
68110

69111
//
70112
// wrappers for isinf

inst/include/armadillo_bits/arma_forward.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ class op_vectorise_row;
9393
class op_vectorise_col;
9494
class op_symmatu;
9595
class op_symmatl;
96+
class op_omit;
9697

9798
class op_row_as_mat;
9899
class op_col_as_mat;
@@ -361,6 +362,7 @@ struct arma_zeros_indicator : public arma_initmode_indicator<true > {};
361362
struct arma_nozeros_indicator : public arma_initmode_indicator<false> {};
362363

363364

365+
364366
//! \addtogroup injector
365367
//! @{
366368

0 commit comments

Comments
 (0)