Skip to content

Commit f883b8c

Browse files
committed
Armadillo 15.3.91 aka 15.4-rc1
1 parent 7aabac5 commit f883b8c

95 files changed

Lines changed: 1811 additions & 1172 deletions

File tree

Some content is hidden

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

‎inst/include/armadillo‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ namespace arma
306306
#include "armadillo_bits/op_orth_null_bones.hpp"
307307
#include "armadillo_bits/op_relational_bones.hpp"
308308
#include "armadillo_bits/op_find_bones.hpp"
309+
#include "armadillo_bits/op_find_aux_bones.hpp"
309310
#include "armadillo_bits/op_find_unique_bones.hpp"
310311
#include "armadillo_bits/op_chol_bones.hpp"
311312
#include "armadillo_bits/op_cx_scalar_bones.hpp"
@@ -765,6 +766,7 @@ namespace arma
765766
#include "armadillo_bits/op_orth_null_meat.hpp"
766767
#include "armadillo_bits/op_relational_meat.hpp"
767768
#include "armadillo_bits/op_find_meat.hpp"
769+
#include "armadillo_bits/op_find_aux_meat.hpp"
768770
#include "armadillo_bits/op_find_unique_meat.hpp"
769771
#include "armadillo_bits/op_chol_meat.hpp"
770772
#include "armadillo_bits/op_cx_scalar_meat.hpp"

‎inst/include/armadillo_bits/Col_bones.hpp‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class Col : public Mat<eT>
3333
static constexpr bool is_row = false;
3434
static constexpr bool is_xvec = false;
3535

36+
static constexpr bool has_subview = false;
37+
3638
inline Col();
3739
inline Col(const Col<eT>& X);
3840

@@ -67,9 +69,6 @@ class Col : public Mat<eT>
6769
inline Col(Col&& m);
6870
inline Col& operator=(Col&& m);
6971

70-
// inline Col(Mat<eT>&& m);
71-
// inline Col& operator=(Mat<eT>&& m);
72-
7372
inline Col& operator=(const eT val);
7473
inline Col& operator=(const Col& m);
7574

@@ -153,6 +152,7 @@ class Col : public Mat<eT>
153152
arma_warn_unused arma_inline eT& at(const uword in_row, const uword in_col);
154153
arma_warn_unused arma_inline const eT& at(const uword in_row, const uword in_col) const;
155154

155+
inline void push_back(const eT val);
156156

157157
inline constexpr bool is_vec() const { return true; }
158158
inline constexpr bool is_rowvec() const { return false; }
@@ -210,6 +210,8 @@ class Col<eT>::fixed : public Col<eT>
210210
static constexpr bool is_row = false;
211211
static constexpr bool is_xvec = false;
212212

213+
static constexpr bool has_subview = false;
214+
213215
static const uword n_rows; // value provided below the class definition
214216
static const uword n_cols; // value provided below the class definition
215217
static const uword n_elem; // value provided below the class definition
@@ -265,6 +267,8 @@ class Col<eT>::fixed : public Col<eT>
265267
arma_warn_unused arma_inline eT& operator() (const uword in_row, const uword in_col);
266268
arma_warn_unused arma_inline const eT& operator() (const uword in_row, const uword in_col) const;
267269

270+
inline void push_back(const eT) = delete;
271+
268272
arma_warn_unused arma_inline eT* memptr();
269273
arma_warn_unused arma_inline const eT* memptr() const;
270274

‎inst/include/armadillo_bits/Col_meat.hpp‎

Lines changed: 19 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -431,64 +431,6 @@ Col<eT>::operator=(Col<eT>&& X)
431431

432432

433433

434-
// template<typename eT>
435-
// inline
436-
// Col<eT>::Col(Mat<eT>&& X)
437-
// : Mat<eT>(arma_vec_indicator(), 1)
438-
// {
439-
// arma_debug_sigprint(arma_str::format("this: %x; X: %x") % this % &X);
440-
//
441-
// if(X.n_cols != 1) { const Mat<eT>& XX = X; Mat<eT>::operator=(XX); return; }
442-
//
443-
// access::rw(Mat<eT>::n_rows) = X.n_rows;
444-
// access::rw(Mat<eT>::n_cols) = 1;
445-
// access::rw(Mat<eT>::n_elem) = X.n_elem;
446-
// access::rw(Mat<eT>::n_alloc) = X.n_alloc;
447-
//
448-
// if( (X.n_alloc > arma_config::mat_prealloc) || (X.mem_state == 1) || (X.mem_state == 2) )
449-
// {
450-
// access::rw(Mat<eT>::mem_state) = X.mem_state;
451-
// access::rw(Mat<eT>::mem) = X.mem;
452-
//
453-
// access::rw(X.n_rows) = 0;
454-
// access::rw(X.n_elem) = 0;
455-
// access::rw(X.n_alloc) = 0;
456-
// access::rw(X.mem_state) = 0;
457-
// access::rw(X.mem) = nullptr;
458-
// }
459-
// else // condition: (X.n_alloc <= arma_config::mat_prealloc) || (X.mem_state == 0) || (X.mem_state == 3)
460-
// {
461-
// (*this).init_cold();
462-
//
463-
// arrayops::copy( (*this).memptr(), X.mem, X.n_elem );
464-
//
465-
// if( (X.mem_state == 0) && (X.n_alloc <= arma_config::mat_prealloc) )
466-
// {
467-
// access::rw(X.n_rows) = 0;
468-
// access::rw(X.n_elem) = 0;
469-
// access::rw(X.mem) = nullptr;
470-
// }
471-
// }
472-
// }
473-
//
474-
//
475-
//
476-
// template<typename eT>
477-
// inline
478-
// Col<eT>&
479-
// Col<eT>::operator=(Mat<eT>&& X)
480-
// {
481-
// arma_debug_sigprint(arma_str::format("this: %x; X: %x") % this % &X);
482-
//
483-
// if(X.n_cols != 1) { const Mat<eT>& XX = X; Mat<eT>::operator=(XX); return *this; }
484-
//
485-
// (*this).steal_mem(X, true);
486-
//
487-
// return *this;
488-
// }
489-
490-
491-
492434
template<typename eT>
493435
inline
494436
Col<eT>&
@@ -1208,6 +1150,25 @@ Col<eT>::at(const uword in_row, const uword) const
12081150

12091151

12101152

1153+
template<typename eT>
1154+
inline
1155+
void
1156+
Col<eT>::push_back(const eT val)
1157+
{
1158+
arma_debug_sigprint();
1159+
1160+
if(Mat<eT>::mem_state != 0)
1161+
{
1162+
arma_conform_check(true, "Col::push_back(): unsupported operation as auxiliary memory is in use");
1163+
1164+
return;
1165+
}
1166+
1167+
Mat<eT>::vec_push_back(val, arma_colvec_indicator());
1168+
}
1169+
1170+
1171+
12111172
template<typename eT>
12121173
inline
12131174
typename Col<eT>::row_iterator

‎inst/include/armadillo_bits/CubeToMatOp_bones.hpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ struct CubeToMatOp : public Base< typename T1::elem_type, CubeToMatOp<T1, op_typ
4040
static constexpr bool is_row = op_type::template traits<T1>::is_row;
4141
static constexpr bool is_col = op_type::template traits<T1>::is_col;
4242
static constexpr bool is_xvec = op_type::template traits<T1>::is_xvec;
43+
44+
static constexpr bool has_subview = T1::has_subview;
4345
};
4446

4547

‎inst/include/armadillo_bits/Cube_bones.hpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ class Cube : public BaseCube< eT, Cube<eT> >
8282

8383
public:
8484

85+
static constexpr bool has_subview = false;
86+
8587
inline ~Cube();
8688
inline Cube();
8789

‎inst/include/armadillo_bits/Cube_meat.hpp‎

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -807,11 +807,29 @@ Cube<eT>::Cube(eT* aux_mem, const uword aux_n_rows, const uword aux_n_cols, cons
807807
{
808808
init_cold();
809809

810-
arrayops::copy( memptr(), aux_mem, n_elem );
810+
if(aux_mem == nullptr)
811+
{
812+
arrayops::fill_zeros(memptr(), n_elem);
813+
}
814+
else
815+
{
816+
arrayops::copy( memptr(), aux_mem, n_elem );
817+
}
811818
}
812819
else
813820
{
814-
create_mat();
821+
if(aux_mem == nullptr)
822+
{
823+
access::rw(mem_state) = 0;
824+
825+
init_cold();
826+
827+
arrayops::fill_zeros(memptr(), n_elem);
828+
}
829+
else
830+
{
831+
create_mat();
832+
}
815833
}
816834
}
817835

@@ -835,7 +853,14 @@ Cube<eT>::Cube(const eT* aux_mem, const uword aux_n_rows, const uword aux_n_cols
835853

836854
init_cold();
837855

838-
arrayops::copy( memptr(), aux_mem, n_elem );
856+
if(aux_mem == nullptr)
857+
{
858+
arrayops::fill_zeros(memptr(), n_elem);
859+
}
860+
else
861+
{
862+
arrayops::copy( memptr(), aux_mem, n_elem );
863+
}
839864
}
840865

841866

‎inst/include/armadillo_bits/GenCube_bones.hpp‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ struct GenCube
2828
typedef eT elem_type;
2929
typedef typename get_pod_type<elem_type>::result pod_type;
3030

31-
static constexpr bool use_at = false;
32-
static constexpr bool is_simple = (is_same_type<gen_type, gen_ones>::value) || (is_same_type<gen_type, gen_zeros>::value);
31+
static constexpr bool use_at = false;
32+
static constexpr bool is_simple = (is_same_type<gen_type, gen_ones>::value) || (is_same_type<gen_type, gen_zeros>::value);
33+
static constexpr bool has_subview = false;
3334

3435
const uword n_rows;
3536
const uword n_cols;

‎inst/include/armadillo_bits/Gen_bones.hpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ struct Gen
3535
static constexpr bool is_col = T1::is_col;
3636
static constexpr bool is_xvec = T1::is_xvec;
3737

38+
static constexpr bool has_subview = false;
39+
3840
const uword n_rows;
3941
const uword n_cols;
4042

‎inst/include/armadillo_bits/GlueCube_bones.hpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ struct GlueCube : public BaseCube< typename T1::elem_type, GlueCube<T1, T2, glue
2828
typedef typename T1::elem_type elem_type;
2929
typedef typename get_pod_type<elem_type>::result pod_type;
3030

31+
static constexpr bool has_subview = T1::has_subview || T2::has_subview;
32+
3133
inline GlueCube(const BaseCube<typename T1::elem_type, T1>& in_A, const BaseCube<typename T1::elem_type, T2>& in_B);
3234
inline ~GlueCube();
3335

‎inst/include/armadillo_bits/Glue_bones.hpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ struct Glue
5050
typedef typename T1::elem_type elem_type;
5151
typedef typename get_pod_type<elem_type>::result pod_type;
5252

53+
static constexpr bool has_subview = T1::has_subview || T2::has_subview;
54+
5355
inline Glue(const T1& in_A, const T2& in_B);
5456
inline Glue(const T1& in_A, const T2& in_B, const uword in_aux_uword);
5557
inline ~Glue();

0 commit comments

Comments
 (0)