Skip to content

Commit 023884d

Browse files
Update to Bandicoot release 1.16.2 (#1)
Co-authored-by: coatless <[email protected]>
1 parent c5a49eb commit 023884d

File tree

281 files changed

+11502
-1022
lines changed

Some content is hidden

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

281 files changed

+11502
-1022
lines changed

inst/include/bandicoot

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
// limitations under the License.
1717
// ------------------------------------------------------------------------
1818

19-
2019
#ifndef BANDICOOT_INCLUDES
2120
#define BANDICOOT_INCLUDES
2221

@@ -93,6 +92,7 @@ namespace coot
9392
#include "bandicoot_bits/promote_type.hpp"
9493
#include "bandicoot_bits/uint_type.hpp"
9594
#include "bandicoot_bits/upgrade_val.hpp"
95+
#include "bandicoot_bits/next_pow2.hpp"
9696
#include "bandicoot_bits/restrictors.hpp"
9797
#include "bandicoot_bits/access.hpp"
9898
#include "bandicoot_bits/span.hpp"
@@ -141,6 +141,9 @@ namespace coot
141141
#include "bandicoot_bits/opencl/random_bones.hpp"
142142
#include "bandicoot_bits/opencl/copy_bones.hpp"
143143
#include "bandicoot_bits/opencl/generic_reduce_bones.hpp"
144+
#include "bandicoot_bits/opencl/generic_reduce_uword_aux_bones.hpp"
145+
#include "bandicoot_bits/opencl/shifted_prefix_sum_bones.hpp"
146+
#include "bandicoot_bits/opencl/shuffle_bones.hpp"
144147
#include "bandicoot_bits/opencl/opencl_misc.hpp"
145148
}
146149

@@ -172,18 +175,26 @@ namespace coot
172175
{
173176
#include "bandicoot_bits/cuda/runtime_bones.hpp"
174177
#include "bandicoot_bits/cuda/kernel_src.hpp"
178+
#include "bandicoot_bits/cuda/kernel_dims.hpp"
175179
#include "bandicoot_bits/cuda/error.hpp"
176180
#include "bandicoot_bits/cuda/type_to_dev_string.hpp"
177181
#include "bandicoot_bits/cuda/cuda_data_type.hpp"
178182
#include "bandicoot_bits/cuda/copy_bones.hpp"
179183
#include "bandicoot_bits/cuda/generic_reduce_bones.hpp"
184+
#include "bandicoot_bits/cuda/generic_reduce_uword_aux_bones.hpp"
185+
#include "bandicoot_bits/cuda/shifted_prefix_sum_bones.hpp"
186+
#include "bandicoot_bits/cuda/shuffle_bones.hpp"
180187
}
181188
#endif
182189

183190
#include "bandicoot_bits/coot_rt_bones.hpp"
184191
#include "bandicoot_bits/coot_init.hpp"
185192
#include "bandicoot_bits/coot_synchronise.hpp"
186193

194+
#include "bandicoot_bits/dev_mem_t_operators.hpp"
195+
#include "bandicoot_bits/memory_overlaps.hpp"
196+
#include "bandicoot_bits/is_alias.hpp"
197+
187198
//
188199
// class prototypes
189200

@@ -234,6 +245,7 @@ namespace coot
234245
#include "bandicoot_bits/op_symmat_bones.hpp"
235246
#include "bandicoot_bits/op_det_bones.hpp"
236247
#include "bandicoot_bits/op_pinv_bones.hpp"
248+
#include "bandicoot_bits/op_shuffle_bones.hpp"
237249

238250
#include "bandicoot_bits/mtop_conv_to_bones.hpp"
239251
#include "bandicoot_bits/mtop_all_bones.hpp"
@@ -244,6 +256,10 @@ namespace coot
244256
#include "bandicoot_bits/mtop_find_finite_bones.hpp"
245257
#include "bandicoot_bits/mtop_find_nonfinite_bones.hpp"
246258
#include "bandicoot_bits/mtop_find_nan_bones.hpp"
259+
#include "bandicoot_bits/mtop_index_min_bones.hpp"
260+
#include "bandicoot_bits/mtop_index_max_bones.hpp"
261+
#include "bandicoot_bits/mtop_real_bones.hpp"
262+
#include "bandicoot_bits/mtop_imag_bones.hpp"
247263

248264
#include "bandicoot_bits/glue_times_bones.hpp"
249265
#include "bandicoot_bits/glue_cov_bones.hpp"
@@ -358,11 +374,14 @@ namespace coot
358374

359375
namespace opencl
360376
{
377+
#include "bandicoot_bits/opencl/kernel_utils.hpp"
361378
#include "bandicoot_bits/opencl/runtime_meat.hpp"
362379
#include "bandicoot_bits/opencl/generic_reduce_meat.hpp"
380+
#include "bandicoot_bits/opencl/generic_reduce_uword_aux_meat.hpp"
363381
#include "bandicoot_bits/opencl/fill.hpp"
364382
#include "bandicoot_bits/opencl/eop.hpp"
365383
#include "bandicoot_bits/opencl/mat_val_proxy.hpp"
384+
#include "bandicoot_bits/opencl/shifted_prefix_sum_meat.hpp"
366385
#include "bandicoot_bits/opencl/random_meat.hpp"
367386
#include "bandicoot_bits/opencl/accu.hpp"
368387
#include "bandicoot_bits/opencl/chol.hpp"
@@ -378,6 +397,7 @@ namespace coot
378397
#include "bandicoot_bits/opencl/max_abs.hpp"
379398
#include "bandicoot_bits/opencl/repmat.hpp"
380399
#include "bandicoot_bits/opencl/linspace.hpp"
400+
#include "bandicoot_bits/opencl/logspace.hpp"
381401
#include "bandicoot_bits/opencl/trans.hpp"
382402
#include "bandicoot_bits/opencl/clamp.hpp"
383403
#include "bandicoot_bits/opencl/norm.hpp"
@@ -404,6 +424,11 @@ namespace coot
404424
#include "bandicoot_bits/opencl/cross.hpp"
405425
#include "bandicoot_bits/opencl/rotate_180.hpp"
406426
#include "bandicoot_bits/opencl/solve.hpp"
427+
#include "bandicoot_bits/opencl/approx_equal.hpp"
428+
#include "bandicoot_bits/opencl/shuffle_meat.hpp"
429+
#include "bandicoot_bits/opencl/index_min.hpp"
430+
#include "bandicoot_bits/opencl/index_max.hpp"
431+
#include "bandicoot_bits/opencl/extract_cx.hpp"
407432
}
408433
#endif
409434

@@ -415,9 +440,11 @@ namespace coot
415440
#include "bandicoot_bits/cuda/runtime_meat.hpp"
416441
#include "bandicoot_bits/cuda/copy_meat.hpp"
417442
#include "bandicoot_bits/cuda/generic_reduce_meat.hpp"
443+
#include "bandicoot_bits/cuda/generic_reduce_uword_aux_meat.hpp"
418444
#include "bandicoot_bits/cuda/fill.hpp"
419445
#include "bandicoot_bits/cuda/eop.hpp"
420446
#include "bandicoot_bits/cuda/mat_val_proxy.hpp"
447+
#include "bandicoot_bits/cuda/shifted_prefix_sum_meat.hpp"
421448
#include "bandicoot_bits/cuda/random_meat.hpp"
422449
#include "bandicoot_bits/cuda/accu.hpp"
423450
#include "bandicoot_bits/cuda/chol.hpp"
@@ -432,6 +459,7 @@ namespace coot
432459
#include "bandicoot_bits/cuda/max_abs.hpp"
433460
#include "bandicoot_bits/cuda/repmat.hpp"
434461
#include "bandicoot_bits/cuda/linspace.hpp"
462+
#include "bandicoot_bits/cuda/logspace.hpp"
435463
#include "bandicoot_bits/cuda/trans.hpp"
436464
#include "bandicoot_bits/cuda/clamp.hpp"
437465
#include "bandicoot_bits/cuda/norm.hpp"
@@ -458,6 +486,11 @@ namespace coot
458486
#include "bandicoot_bits/cuda/cross.hpp"
459487
#include "bandicoot_bits/cuda/rotate_180.hpp"
460488
#include "bandicoot_bits/cuda/solve.hpp"
489+
#include "bandicoot_bits/cuda/approx_equal.hpp"
490+
#include "bandicoot_bits/cuda/shuffle_meat.hpp"
491+
#include "bandicoot_bits/cuda/index_min.hpp"
492+
#include "bandicoot_bits/cuda/index_max.hpp"
493+
#include "bandicoot_bits/cuda/extract_cx.hpp"
461494
}
462495
#endif
463496

@@ -526,6 +559,7 @@ namespace coot
526559
#include "bandicoot_bits/fn_resize.hpp"
527560
#include "bandicoot_bits/fn_reshape.hpp"
528561
#include "bandicoot_bits/fn_linspace.hpp"
562+
#include "bandicoot_bits/fn_logspace.hpp"
529563
#include "bandicoot_bits/fn_vectorise.hpp"
530564
#include "bandicoot_bits/fn_clamp.hpp"
531565
#include "bandicoot_bits/fn_size.hpp"
@@ -555,6 +589,10 @@ namespace coot
555589
#include "bandicoot_bits/fn_cross.hpp"
556590
#include "bandicoot_bits/fn_conv.hpp"
557591
#include "bandicoot_bits/fn_solve.hpp"
592+
#include "bandicoot_bits/fn_approx_equal.hpp"
593+
#include "bandicoot_bits/fn_shuffle.hpp"
594+
#include "bandicoot_bits/fn_index_min.hpp"
595+
#include "bandicoot_bits/fn_index_max.hpp"
558596

559597

560598
//
@@ -610,6 +648,7 @@ namespace coot
610648
#include "bandicoot_bits/op_symmat_meat.hpp"
611649
#include "bandicoot_bits/op_det_meat.hpp"
612650
#include "bandicoot_bits/op_pinv_meat.hpp"
651+
#include "bandicoot_bits/op_shuffle_meat.hpp"
613652

614653
#include "bandicoot_bits/mtop_conv_to_meat.hpp"
615654
#include "bandicoot_bits/mtop_all_meat.hpp"
@@ -620,6 +659,10 @@ namespace coot
620659
#include "bandicoot_bits/mtop_find_finite_meat.hpp"
621660
#include "bandicoot_bits/mtop_find_nonfinite_meat.hpp"
622661
#include "bandicoot_bits/mtop_find_nan_meat.hpp"
662+
#include "bandicoot_bits/mtop_index_min_meat.hpp"
663+
#include "bandicoot_bits/mtop_index_max_meat.hpp"
664+
#include "bandicoot_bits/mtop_real_meat.hpp"
665+
#include "bandicoot_bits/mtop_imag_meat.hpp"
623666

624667
#include "bandicoot_bits/glue_times_meat.hpp"
625668
#include "bandicoot_bits/glue_cov_meat.hpp"

inst/include/bandicoot_bits/Base_bones.hpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,15 @@ struct Base
110110
inline void raw_print( const std::string extra_text = "") const;
111111
inline void raw_print(std::ostream& user_stream, const std::string extra_text = "") const;
112112

113-
// coot_warn_unused inline elem_type min() const;
114-
// coot_warn_unused inline elem_type max() const;
115-
//
116-
// coot_warn_unused inline uword index_min() const;
117-
// coot_warn_unused inline uword index_max() const;
113+
coot_warn_unused inline elem_type min() const;
114+
coot_warn_unused inline elem_type max() const;
115+
116+
inline elem_type min(uword& index_of_min_val) const;
117+
inline elem_type max(uword& index_of_max_val) const;
118+
119+
inline elem_type min(uword& row_of_min_val, uword& col_of_min_val) const;
120+
inline elem_type max(uword& row_of_max_val, uword& col_of_max_val) const;
121+
122+
coot_warn_unused inline uword index_min() const;
123+
coot_warn_unused inline uword index_max() const;
118124
};

inst/include/bandicoot_bits/Base_meat.hpp

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,3 +293,112 @@ Base_trans_default<derived>::st() const
293293
{
294294
return Op<derived, op_htrans>( static_cast<const derived&>(*this) );
295295
}
296+
297+
298+
299+
template<typename elem_type, typename derived>
300+
inline
301+
elem_type
302+
Base<elem_type,derived>::min() const
303+
{
304+
return op_min::apply_direct( (*this).get_ref() );
305+
}
306+
307+
308+
309+
template<typename elem_type, typename derived>
310+
inline
311+
elem_type
312+
Base<elem_type,derived>::max() const
313+
{
314+
return op_max::apply_direct( (*this).get_ref() );
315+
}
316+
317+
318+
319+
template<typename elem_type, typename derived>
320+
inline
321+
elem_type
322+
Base<elem_type,derived>::min(uword& index_of_min_val) const
323+
{
324+
// We have to actually unwrap and evaluate.
325+
const unwrap<derived> U( (*this).get_ref() );
326+
327+
index_of_min_val = mtop_index_min::apply_direct(U.M);
328+
329+
return U.M.at(index_of_min_val);
330+
}
331+
332+
333+
334+
template<typename elem_type, typename derived>
335+
inline
336+
elem_type
337+
Base<elem_type,derived>::max(uword& index_of_max_val) const
338+
{
339+
// We have to actually unwrap and evaluate.
340+
const unwrap<derived> U( (*this).get_ref() );
341+
342+
index_of_max_val = mtop_index_max::apply_direct(U.M);
343+
344+
return U.M.at(index_of_max_val);
345+
}
346+
347+
348+
349+
template<typename elem_type, typename derived>
350+
inline
351+
elem_type
352+
Base<elem_type,derived>::min(uword& row_of_min_val, uword& col_of_min_val) const
353+
{
354+
const unwrap<derived> U( (*this).get_ref() );
355+
356+
uword index = mtop_index_min::apply_direct(U.M);
357+
358+
const uword local_n_rows = U.M.n_rows;
359+
360+
row_of_min_val = index % local_n_rows;
361+
col_of_min_val = index / local_n_rows;
362+
363+
return U.M.at(index);
364+
}
365+
366+
367+
368+
template<typename elem_type, typename derived>
369+
inline
370+
elem_type
371+
Base<elem_type,derived>::max(uword& row_of_max_val, uword& col_of_max_val) const
372+
{
373+
374+
const unwrap<derived> U( (*this).get_ref() );
375+
376+
uword index = mtop_index_max::apply_direct(U.M);
377+
378+
const uword local_n_rows = U.M.n_rows;
379+
380+
row_of_max_val = index % local_n_rows;
381+
col_of_max_val = index / local_n_rows;
382+
383+
return U.M.at(index);
384+
}
385+
386+
387+
388+
template<typename elem_type, typename derived>
389+
inline
390+
uword
391+
Base<elem_type,derived>::index_min() const
392+
{
393+
return mtop_index_min::apply_direct( (*this).get_ref() );
394+
}
395+
396+
397+
398+
template<typename elem_type, typename derived>
399+
inline
400+
uword
401+
Base<elem_type,derived>::index_max() const
402+
{
403+
return mtop_index_max::apply_direct( (*this).get_ref() );
404+
}

inst/include/bandicoot_bits/Mat_bones.hpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,15 @@ class Mat : public Base< eT, Mat<eT> >
191191
inline void reshape(const uword new_n_rows, const uword new_n_cols);
192192
inline void reshape(const SizeMat& s);
193193

194+
coot_warn_unused inline eT min() const;
195+
coot_warn_unused inline eT max() const;
196+
197+
coot_warn_unused inline eT min(uword& index_of_min_val) const;
198+
coot_warn_unused inline eT max(uword& index_of_max_val) const;
199+
200+
coot_warn_unused inline eT min(uword& row_of_min_val, uword& col_of_min_val) const;
201+
coot_warn_unused inline eT max(uword& row_of_max_val, uword& col_of_max_val) const;
202+
194203
coot_warn_unused inline bool is_vec() const;
195204
coot_warn_unused inline bool is_colvec() const;
196205
coot_warn_unused inline bool is_rowvec() const;
@@ -267,6 +276,12 @@ class Mat : public Base< eT, Mat<eT> >
267276
inline subview<eT> tail_cols(const uword N);
268277
inline const subview<eT> tail_cols(const uword N) const;
269278

279+
inline void clear();
280+
inline bool empty() const;
281+
inline uword size() const;
282+
283+
coot_warn_unused inline eT front() const;
284+
coot_warn_unused inline eT back() const;
270285

271286
protected:
272287

0 commit comments

Comments
 (0)