Skip to content

Commit 0d4ec88

Browse files
committed
Another update to 14.0.0 rc
1 parent c15c3e6 commit 0d4ec88

File tree

80 files changed

+1008
-662
lines changed

Some content is hidden

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

80 files changed

+1008
-662
lines changed

inst/include/armadillo

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ namespace arma
221221
#include "armadillo_bits/OpCube_bones.hpp"
222222
#include "armadillo_bits/SpOp_bones.hpp"
223223
#include "armadillo_bits/SpToDOp_bones.hpp"
224-
#include "armadillo_bits/mtSpToDOp_bones.hpp"
224+
#include "armadillo_bits/mtSpReduceOp_bones.hpp"
225225

226226
#include "armadillo_bits/eOp_bones.hpp"
227227
#include "armadillo_bits/eOpCube_bones.hpp"
@@ -315,6 +315,10 @@ namespace arma
315315
#include "armadillo_bits/op_roots_bones.hpp"
316316
#include "armadillo_bits/op_cond_bones.hpp"
317317
#include "armadillo_bits/op_rcond_bones.hpp"
318+
#include "armadillo_bits/op_powmat_bones.hpp"
319+
#include "armadillo_bits/op_rank_bones.hpp"
320+
#include "armadillo_bits/op_row_as_mat_bones.hpp"
321+
#include "armadillo_bits/op_col_as_mat_bones.hpp"
318322
#include "armadillo_bits/op_sp_plus_bones.hpp"
319323
#include "armadillo_bits/op_sp_minus_bones.hpp"
320324
#include "armadillo_bits/op_sp_sum_bones.hpp"
@@ -325,10 +329,8 @@ namespace arma
325329
#include "armadillo_bits/op_sp_stddev_bones.hpp"
326330
#include "armadillo_bits/op_sp_vecnorm_bones.hpp"
327331
#include "armadillo_bits/op_sp_diagvec_bones.hpp"
328-
#include "armadillo_bits/op_powmat_bones.hpp"
329-
#include "armadillo_bits/op_rank_bones.hpp"
330-
#include "armadillo_bits/op_row_as_mat_bones.hpp"
331-
#include "armadillo_bits/op_col_as_mat_bones.hpp"
332+
#include "armadillo_bits/op_sp_nonzeros_bones.hpp"
333+
#include "armadillo_bits/op_sp_as_dense_bones.hpp"
332334

333335
#include "armadillo_bits/glue_times_bones.hpp"
334336
#include "armadillo_bits/glue_times_misc_bones.hpp"
@@ -623,11 +625,11 @@ namespace arma
623625
#include "armadillo_bits/OpCube_meat.hpp"
624626
#include "armadillo_bits/SpOp_meat.hpp"
625627
#include "armadillo_bits/SpToDOp_meat.hpp"
626-
#include "armadillo_bits/mtSpToDOp_meat.hpp"
627628

628629
#include "armadillo_bits/mtOp_meat.hpp"
629630
#include "armadillo_bits/mtOpCube_meat.hpp"
630631
#include "armadillo_bits/mtSpOp_meat.hpp"
632+
#include "armadillo_bits/mtSpReduceOp_meat.hpp"
631633

632634
#include "armadillo_bits/Glue_meat.hpp"
633635
#include "armadillo_bits/GlueCube_meat.hpp"
@@ -766,6 +768,10 @@ namespace arma
766768
#include "armadillo_bits/op_roots_meat.hpp"
767769
#include "armadillo_bits/op_cond_meat.hpp"
768770
#include "armadillo_bits/op_rcond_meat.hpp"
771+
#include "armadillo_bits/op_powmat_meat.hpp"
772+
#include "armadillo_bits/op_rank_meat.hpp"
773+
#include "armadillo_bits/op_row_as_mat_meat.hpp"
774+
#include "armadillo_bits/op_col_as_mat_meat.hpp"
769775
#include "armadillo_bits/op_sp_plus_meat.hpp"
770776
#include "armadillo_bits/op_sp_minus_meat.hpp"
771777
#include "armadillo_bits/op_sp_sum_meat.hpp"
@@ -776,10 +782,8 @@ namespace arma
776782
#include "armadillo_bits/op_sp_stddev_meat.hpp"
777783
#include "armadillo_bits/op_sp_vecnorm_meat.hpp"
778784
#include "armadillo_bits/op_sp_diagvec_meat.hpp"
779-
#include "armadillo_bits/op_powmat_meat.hpp"
780-
#include "armadillo_bits/op_rank_meat.hpp"
781-
#include "armadillo_bits/op_row_as_mat_meat.hpp"
782-
#include "armadillo_bits/op_col_as_mat_meat.hpp"
785+
#include "armadillo_bits/op_sp_nonzeros_meat.hpp"
786+
#include "armadillo_bits/op_sp_as_dense_meat.hpp"
783787

784788
#include "armadillo_bits/glue_times_meat.hpp"
785789
#include "armadillo_bits/glue_times_misc_meat.hpp"

inst/include/armadillo_bits/Cube_meat.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2264,7 +2264,7 @@ Cube<eT>::shed_slices(const Base<uword, T1>& indices)
22642264
const uword* slices_to_shed_mem = slices_to_shed.memptr();
22652265
const uword N = slices_to_shed.n_elem;
22662266

2267-
if(arma_config::check_conformance)
2267+
if(arma_config::check_conform)
22682268
{
22692269
for(uword i=0; i<N; ++i)
22702270
{

inst/include/armadillo_bits/Mat_bones.hpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ class Mat : public Base< eT, Mat<eT> >
181181
inline Mat& operator+=(const SpSubview<eT>& X);
182182
inline Mat& operator-=(const SpSubview<eT>& X);
183183

184-
inline Mat(const spdiagview<eT>& X);
184+
inline explicit Mat(const spdiagview<eT>& X);
185185
inline Mat& operator= (const spdiagview<eT>& X);
186186
inline Mat& operator+=(const spdiagview<eT>& X);
187187
inline Mat& operator-=(const spdiagview<eT>& X);
@@ -310,8 +310,8 @@ class Mat : public Base< eT, Mat<eT> >
310310
template<typename T1> inline void shed_rows(const Base<uword, T1>& indices);
311311
template<typename T1> inline void shed_cols(const Base<uword, T1>& indices);
312312

313-
arma_deprecated inline void insert_rows(const uword row_num, const uword N, const bool set_to_zero);
314-
arma_deprecated inline void insert_cols(const uword col_num, const uword N, const bool set_to_zero);
313+
arma_frown("use insert_rows(row_num, N) instead") inline void insert_rows(const uword row_num, const uword N, const bool set_to_zero);
314+
arma_frown("use insert_cols(col_num, N) instead") inline void insert_cols(const uword col_num, const uword N, const bool set_to_zero);
315315

316316
inline void insert_rows(const uword row_num, const uword N);
317317
inline void insert_cols(const uword col_num, const uword N);
@@ -368,13 +368,13 @@ class Mat : public Base< eT, Mat<eT> >
368368
template<typename T1, typename op_type> inline Mat& operator%=(const SpToDOp<T1, op_type>& X);
369369
template<typename T1, typename op_type> inline Mat& operator/=(const SpToDOp<T1, op_type>& X);
370370

371-
template<typename T1, typename op_type> inline Mat(const mtSpToDOp<eT, T1, op_type>& X);
372-
template<typename T1, typename op_type> inline Mat& operator= (const mtSpToDOp<eT, T1, op_type>& X);
373-
template<typename T1, typename op_type> inline Mat& operator+=(const mtSpToDOp<eT, T1, op_type>& X);
374-
template<typename T1, typename op_type> inline Mat& operator-=(const mtSpToDOp<eT, T1, op_type>& X);
375-
template<typename T1, typename op_type> inline Mat& operator*=(const mtSpToDOp<eT, T1, op_type>& X);
376-
template<typename T1, typename op_type> inline Mat& operator%=(const mtSpToDOp<eT, T1, op_type>& X);
377-
template<typename T1, typename op_type> inline Mat& operator/=(const mtSpToDOp<eT, T1, op_type>& X);
371+
template<typename T1, typename op_type> inline explicit Mat(const mtSpReduceOp<eT, T1, op_type>& X);
372+
template<typename T1, typename op_type> inline Mat& operator= (const mtSpReduceOp<eT, T1, op_type>& X);
373+
template<typename T1, typename op_type> inline Mat& operator+=(const mtSpReduceOp<eT, T1, op_type>& X);
374+
template<typename T1, typename op_type> inline Mat& operator-=(const mtSpReduceOp<eT, T1, op_type>& X);
375+
template<typename T1, typename op_type> inline Mat& operator*=(const mtSpReduceOp<eT, T1, op_type>& X);
376+
template<typename T1, typename op_type> inline Mat& operator%=(const mtSpReduceOp<eT, T1, op_type>& X);
377+
template<typename T1, typename op_type> inline Mat& operator/=(const mtSpReduceOp<eT, T1, op_type>& X);
378378

379379
template<typename T1, typename T2, typename glue_type> inline Mat(const Glue<T1, T2, glue_type>& X);
380380
template<typename T1, typename T2, typename glue_type> inline Mat& operator= (const Glue<T1, T2, glue_type>& X);
@@ -485,7 +485,7 @@ class Mat : public Base< eT, Mat<eT> >
485485
inline Mat& reshape(const uword new_n_rows, const uword new_n_cols);
486486
inline Mat& reshape(const SizeMat& s);
487487

488-
arma_deprecated inline void reshape(const uword new_n_rows, const uword new_n_cols, const uword dim); //!< NOTE: don't use this form: it will be removed
488+
arma_frown("use reshape(n_rows, n_cols) instead") inline void reshape(const uword new_n_rows, const uword new_n_cols, const uword dim); //!< NOTE: don't use this form: it will be removed
489489

490490

491491
template<typename functor> inline Mat& for_each(functor F);
@@ -558,15 +558,15 @@ class Mat : public Base< eT, Mat<eT> >
558558
arma_cold inline bool load(const csv_name& spec, const file_type type = csv_ascii);
559559
arma_cold inline bool load( std::istream& is, const file_type type = auto_detect);
560560

561-
arma_deprecated inline bool quiet_save(const std::string name, const file_type type = arma_binary) const;
562-
arma_deprecated inline bool quiet_save(const hdf5_name& spec, const file_type type = hdf5_binary) const;
563-
arma_deprecated inline bool quiet_save(const csv_name& spec, const file_type type = csv_ascii) const;
564-
arma_deprecated inline bool quiet_save( std::ostream& os, const file_type type = arma_binary) const;
561+
arma_frown("use save() instead") inline bool quiet_save(const std::string name, const file_type type = arma_binary) const;
562+
arma_frown("use save() instead") inline bool quiet_save(const hdf5_name& spec, const file_type type = hdf5_binary) const;
563+
arma_frown("use save() instead") inline bool quiet_save(const csv_name& spec, const file_type type = csv_ascii) const;
564+
arma_frown("use save() instead") inline bool quiet_save( std::ostream& os, const file_type type = arma_binary) const;
565565

566-
arma_deprecated inline bool quiet_load(const std::string name, const file_type type = auto_detect);
567-
arma_deprecated inline bool quiet_load(const hdf5_name& spec, const file_type type = hdf5_binary);
568-
arma_deprecated inline bool quiet_load(const csv_name& spec, const file_type type = csv_ascii);
569-
arma_deprecated inline bool quiet_load( std::istream& is, const file_type type = auto_detect);
566+
arma_frown("use load() instead") inline bool quiet_load(const std::string name, const file_type type = auto_detect);
567+
arma_frown("use load() instead") inline bool quiet_load(const hdf5_name& spec, const file_type type = hdf5_binary);
568+
arma_frown("use load() instead") inline bool quiet_load(const csv_name& spec, const file_type type = csv_ascii);
569+
arma_frown("use load() instead") inline bool quiet_load( std::istream& is, const file_type type = auto_detect);
570570

571571

572572
// for container-like functionality

inst/include/armadillo_bits/Mat_meat.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4519,7 +4519,7 @@ Mat<eT>::shed_rows(const Base<uword, T1>& indices)
45194519
const uword* rows_to_shed_mem = rows_to_shed.memptr();
45204520
const uword N = rows_to_shed.n_elem;
45214521

4522-
if(arma_config::check_conformance)
4522+
if(arma_config::check_conform)
45234523
{
45244524
for(uword i=0; i<N; ++i)
45254525
{
@@ -4589,7 +4589,7 @@ Mat<eT>::shed_cols(const Base<uword, T1>& indices)
45894589
const uword* cols_to_shed_mem = cols_to_shed.memptr();
45904590
const uword N = cols_to_shed.n_elem;
45914591

4592-
if(arma_config::check_conformance)
4592+
if(arma_config::check_conform)
45934593
{
45944594
for(uword i=0; i<N; ++i)
45954595
{
@@ -5658,7 +5658,7 @@ Mat<eT>::operator/=(const SpToDOp<T1, op_type>& X)
56585658
template<typename eT>
56595659
template<typename T1, typename op_type>
56605660
inline
5661-
Mat<eT>::Mat(const mtSpToDOp<eT, T1, op_type>& X)
5661+
Mat<eT>::Mat(const mtSpReduceOp<eT, T1, op_type>& X)
56625662
: n_rows(0)
56635663
, n_cols(0)
56645664
, n_elem(0)
@@ -5678,7 +5678,7 @@ template<typename eT>
56785678
template<typename T1, typename op_type>
56795679
inline
56805680
Mat<eT>&
5681-
Mat<eT>::operator=(const mtSpToDOp<eT, T1, op_type>& X)
5681+
Mat<eT>::operator=(const mtSpReduceOp<eT, T1, op_type>& X)
56825682
{
56835683
arma_debug_sigprint();
56845684

@@ -5693,7 +5693,7 @@ template<typename eT>
56935693
template<typename T1, typename op_type>
56945694
inline
56955695
Mat<eT>&
5696-
Mat<eT>::operator+=(const mtSpToDOp<eT, T1, op_type>& X)
5696+
Mat<eT>::operator+=(const mtSpReduceOp<eT, T1, op_type>& X)
56975697
{
56985698
arma_debug_sigprint();
56995699

@@ -5708,7 +5708,7 @@ template<typename eT>
57085708
template<typename T1, typename op_type>
57095709
inline
57105710
Mat<eT>&
5711-
Mat<eT>::operator-=(const mtSpToDOp<eT, T1, op_type>& X)
5711+
Mat<eT>::operator-=(const mtSpReduceOp<eT, T1, op_type>& X)
57125712
{
57135713
arma_debug_sigprint();
57145714

@@ -5723,7 +5723,7 @@ template<typename eT>
57235723
template<typename T1, typename op_type>
57245724
inline
57255725
Mat<eT>&
5726-
Mat<eT>::operator*=(const mtSpToDOp<eT, T1, op_type>& X)
5726+
Mat<eT>::operator*=(const mtSpReduceOp<eT, T1, op_type>& X)
57275727
{
57285728
arma_debug_sigprint();
57295729

@@ -5738,7 +5738,7 @@ template<typename eT>
57385738
template<typename T1, typename op_type>
57395739
inline
57405740
Mat<eT>&
5741-
Mat<eT>::operator%=(const mtSpToDOp<eT, T1, op_type>& X)
5741+
Mat<eT>::operator%=(const mtSpReduceOp<eT, T1, op_type>& X)
57425742
{
57435743
arma_debug_sigprint();
57445744

@@ -5753,7 +5753,7 @@ template<typename eT>
57535753
template<typename T1, typename op_type>
57545754
inline
57555755
Mat<eT>&
5756-
Mat<eT>::operator/=(const mtSpToDOp<eT, T1, op_type>& X)
5756+
Mat<eT>::operator/=(const mtSpReduceOp<eT, T1, op_type>& X)
57575757
{
57585758
arma_debug_sigprint();
57595759

inst/include/armadillo_bits/Proxy.hpp

Lines changed: 31 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -22,36 +22,36 @@
2222

2323
// within each specialisation of the Proxy class:
2424
//
25-
// elem_type = the type of the elements obtained from object Q
26-
// pod_type = the underlying type of elements if elem_type is std::complex
27-
// stored_type = the type of the Q object
28-
// ea_type = the type of the object that provides access to elements via operator[i]
29-
// aligned_ea_type = the type of the object that provides access to elements via at_alt(i)
25+
// elem_type = type of the elements obtained from object Q
26+
// pod_type = underlying type of elements if elem_type is std::complex
27+
// stored_type = type of Q object
28+
// ea_type = type of object that provides access to elements via operator[i]
29+
// aligned_ea_type = type of object that provides access to elements via at_alt(i)
3030
//
31-
// use_at = boolean indicating whether at(row,col) must be used to get elements
32-
// use_mp = boolean indicating whether OpenMP can be used while processing elements
33-
// has_subview = boolean indicating whether the Q object has a subview
31+
// use_at = boolean to indicate at(row,col) must be used to get elements
32+
// use_mp = boolean to indicate OpenMP can be used while processing elements
33+
// has_subview = boolean to indicate Q object has a subview
3434
//
35-
// is_row = boolean indicating whether the Q object can be treated a row vector
36-
// is_col = boolean indicating whether the Q object can be treated a column vector
37-
// is_xvec = boolean indicating whether the Q object is a vector with unknown orientation
35+
// is_row = boolean to indicate Q object can be treated a row vector
36+
// is_col = boolean to indicate Q object can be treated a column vector
37+
// is_xvec = boolean to indicate Q object is a vector with unknown orientation
3838
//
39-
// Q = object that can be unwrapped via the unwrap family of classes (ie. Q must be convertible to Mat)
39+
// Q = object that can be unwrapped via unwrap family of classes (ie. Q must be convertible to Mat)
4040
//
41-
// get_n_rows() = return the number of rows in Q
42-
// get_n_cols() = return the number of columns in Q
43-
// get_n_elem() = return the number of elements in Q
41+
// get_n_rows() = return number of rows in Q
42+
// get_n_cols() = return number of columns in Q
43+
// get_n_elem() = return number of elements in Q
4444
//
45-
// operator[i] = linear element accessor; valid only if the 'use_at' boolean is false
46-
// at(row,col) = access elements via (row,col); valid only if the 'use_at' boolean is true
47-
// at_alt(i) = aligned linear element accessor; valid only if the 'use_at' boolean is false and is_aligned() returns true
45+
// operator[i] = linear element accessor; valid only if 'use_at' boolean is false
46+
// at(row,col) = access elements via (row,col); valid only if 'use_at' boolean is true
47+
// at_alt(i) = aligned linear element accessor; valid only if 'use_at' boolean is false and is_aligned() returns true
4848
//
49-
// get_ea() = return the object that provides linear access to elements via operator[i]
50-
// get_aligned_ea() = return the object that provides linear access to elements via at_alt(i); valid only if is_aligned() returns true
49+
// get_ea() = return object that provides linear access to elements via operator[i]
50+
// get_aligned_ea() = return object that provides linear access to elements via at_alt(i); valid only if is_aligned() returns true
5151
//
52-
// is_alias(X) = return true/false indicating whether the Q object aliases matrix X
53-
// has_overlap(X) = return true/false indicating whether the Q object has overlap with subview X
54-
// is_aligned() = return true/false indicating whether the Q object has aligned memory
52+
// is_alias(X) = return true/false to indicate Q object aliases matrix X
53+
// has_overlap(X) = return true/false to indicate Q object has overlap with subview X
54+
// is_aligned() = return true/false to indicate Q object has aligned memory
5555

5656

5757

@@ -880,10 +880,10 @@ struct Proxy< SpToDOp<T1, op_type> >
880880

881881

882882

883-
template<typename T1>
884-
struct Proxy< SpToDOp<T1, op_nonzeros_spmat> >
883+
template<typename eT>
884+
struct Proxy< SpToDOp<SpMat<eT>, op_sp_nonzeros> >
885885
{
886-
typedef typename T1::elem_type elem_type;
886+
typedef eT elem_type;
887887
typedef typename get_pod_type<elem_type>::result pod_type;
888888
typedef Mat<elem_type> stored_type;
889889
typedef const elem_type* ea_type;
@@ -897,12 +897,12 @@ struct Proxy< SpToDOp<T1, op_nonzeros_spmat> >
897897
static constexpr bool is_col = true;
898898
static constexpr bool is_xvec = false;
899899

900-
arma_aligned const unwrap_spmat<T1> U;
901-
arma_aligned const Mat<elem_type> Q;
900+
arma_aligned const SpMat<elem_type>& R;
901+
arma_aligned const Mat<elem_type> Q;
902902

903-
inline explicit Proxy(const SpToDOp<T1, op_nonzeros_spmat>& A)
904-
: U(A.m)
905-
, Q(const_cast<elem_type*>(U.M.values), U.M.n_nonzero, 1, false, true)
903+
inline explicit Proxy(const SpToDOp<SpMat<eT>, op_sp_nonzeros>& A)
904+
: R(A.m)
905+
, Q(const_cast<elem_type*>(R.values), R.n_nonzero, 1, false, true)
906906
{
907907
arma_debug_sigprint();
908908
}
@@ -929,53 +929,6 @@ struct Proxy< SpToDOp<T1, op_nonzeros_spmat> >
929929

930930

931931

932-
template<typename out_eT, typename T1, typename op_type>
933-
struct Proxy< mtSpToDOp<out_eT, T1, op_type> >
934-
{
935-
typedef out_eT elem_type;
936-
typedef typename get_pod_type<out_eT>::result pod_type;
937-
typedef Mat<out_eT> stored_type;
938-
typedef const elem_type* ea_type;
939-
typedef const Mat<out_eT>& aligned_ea_type;
940-
941-
static constexpr bool use_at = false;
942-
static constexpr bool use_mp = false;
943-
static constexpr bool has_subview = false;
944-
945-
static constexpr bool is_row = mtSpToDOp<out_eT, T1, op_type>::is_row;
946-
static constexpr bool is_col = mtSpToDOp<out_eT, T1, op_type>::is_col;
947-
static constexpr bool is_xvec = mtSpToDOp<out_eT, T1, op_type>::is_xvec;
948-
949-
arma_aligned const Mat<out_eT> Q;
950-
951-
inline explicit Proxy(const mtSpToDOp<out_eT, T1, op_type>& A)
952-
: Q(A)
953-
{
954-
arma_debug_sigprint();
955-
}
956-
957-
arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; }
958-
arma_inline uword get_n_cols() const { return is_col ? 1 : Q.n_cols; }
959-
arma_inline uword get_n_elem() const { return Q.n_elem; }
960-
961-
arma_inline elem_type operator[] (const uword i) const { return Q[i]; }
962-
arma_inline elem_type at (const uword r, const uword c) const { return Q.at(r, c); }
963-
arma_inline elem_type at_alt (const uword i) const { return Q.at_alt(i); }
964-
965-
arma_inline ea_type get_ea() const { return Q.memptr(); }
966-
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
967-
968-
template<typename eT2>
969-
constexpr bool is_alias(const Mat<eT2>&) const { return false; }
970-
971-
template<typename eT2>
972-
constexpr bool has_overlap(const subview<eT2>&) const { return false; }
973-
974-
arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr()); }
975-
};
976-
977-
978-
979932
template<typename T1, typename T2, typename glue_type>
980933
struct Proxy< SpToDGlue<T1, T2, glue_type> >
981934
{

inst/include/armadillo_bits/SpBase_bones.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ struct SpBase
109109

110110
arma_warn_unused inline const SpOp<derived,spop_vectorise_col> as_col() const;
111111
arma_warn_unused inline const SpOp<derived,spop_vectorise_row> as_row() const;
112+
113+
arma_warn_unused inline const SpToDOp<derived,op_sp_as_dense> as_dense() const;
112114
};
113115

114116

0 commit comments

Comments
 (0)