Skip to content

Commit fae8094

Browse files
Update to Bandicoot release 2.1.1 (#4)
Co-authored-by: coatless <[email protected]>
1 parent f387154 commit fae8094

File tree

98 files changed

+5796
-407
lines changed

Some content is hidden

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

98 files changed

+5796
-407
lines changed

inst/include/bandicoot

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ namespace coot
216216
#include "bandicoot_bits/Cube_bones.hpp"
217217
#include "bandicoot_bits/subview_cube_bones.hpp"
218218

219+
#include "bandicoot_bits/diskio_bones.hpp"
220+
219221
#include "bandicoot_bits/eOp_bones.hpp"
220222
#include "bandicoot_bits/eGlue_bones.hpp"
221223
#include "bandicoot_bits/eop_core_bones.hpp"
@@ -228,6 +230,8 @@ namespace coot
228230
#include "bandicoot_bits/mtOpCube_bones.hpp"
229231
#include "bandicoot_bits/eGlueCube_bones.hpp"
230232
#include "bandicoot_bits/mtGlueCube_bones.hpp"
233+
#include "bandicoot_bits/OpCube_bones.hpp"
234+
#include "bandicoot_bits/GlueCube_bones.hpp"
231235
#include "bandicoot_bits/CubeToMatOp_bones.hpp"
232236
#include "bandicoot_bits/coot_rng_bones.hpp"
233237

@@ -642,6 +646,8 @@ namespace coot
642646
#include "bandicoot_bits/Cube_meat.hpp"
643647
#include "bandicoot_bits/subview_cube_meat.hpp"
644648

649+
#include "bandicoot_bits/diskio_meat.hpp"
650+
645651
#include "bandicoot_bits/eOp_meat.hpp"
646652
#include "bandicoot_bits/eGlue_meat.hpp"
647653
#include "bandicoot_bits/eop_core_meat.hpp"
@@ -654,6 +660,8 @@ namespace coot
654660
#include "bandicoot_bits/mtOpCube_meat.hpp"
655661
#include "bandicoot_bits/eGlueCube_meat.hpp"
656662
#include "bandicoot_bits/mtGlueCube_meat.hpp"
663+
#include "bandicoot_bits/OpCube_meat.hpp"
664+
#include "bandicoot_bits/GlueCube_meat.hpp"
657665
#include "bandicoot_bits/CubeToMatOp_meat.hpp"
658666
#include "bandicoot_bits/coot_rng_meat.hpp"
659667

inst/include/bandicoot_bits/BaseCube_bones.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,8 @@ struct BaseCube
6868

6969
coot_warn_unused inline const CubeToMatOp<derived, op_row_as_mat> row_as_mat(const uword in_row) const;
7070
coot_warn_unused inline const CubeToMatOp<derived, op_col_as_mat> col_as_mat(const uword in_col) const;
71+
72+
coot_warn_unused inline bool is_finite() const;
73+
coot_warn_unused inline bool has_inf() const;
74+
coot_warn_unused inline bool has_nan() const;
7175
};

inst/include/bandicoot_bits/BaseCube_meat.hpp

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,69 @@ BaseCube<elem_type, derived>::col_as_mat(const uword in_col) const
233233

234234

235235

236+
template<typename elem_type, typename derived>
237+
inline
238+
bool
239+
BaseCube<elem_type, derived>::is_finite() const
240+
{
241+
coot_extra_debug_sigprint();
242+
243+
// The is_finite kernels only work on contiguous memory.
244+
if (is_non_integral<elem_type>::value)
245+
{
246+
Cube<elem_type> tmp((*this).get_ref());
247+
return tmp.is_finite();
248+
}
249+
else
250+
{
251+
return true;
252+
}
253+
}
254+
255+
256+
257+
template<typename elem_type, typename derived>
258+
inline
259+
bool
260+
BaseCube<elem_type, derived>::has_inf() const
261+
{
262+
coot_extra_debug_sigprint();
263+
264+
// The has_inf kernels only work on contiguous memory.
265+
if (is_non_integral<elem_type>::value)
266+
{
267+
Cube<elem_type> tmp((*this).get_ref());
268+
return tmp.has_inf();
269+
}
270+
else
271+
{
272+
return false;
273+
}
274+
}
275+
276+
277+
278+
template<typename elem_type, typename derived>
279+
inline
280+
bool
281+
BaseCube<elem_type, derived>::has_nan() const
282+
{
283+
coot_extra_debug_sigprint();
284+
285+
// The has_nan kernels only work on contiguous memory.
286+
if (is_non_integral<elem_type>::value)
287+
{
288+
Cube<elem_type> tmp((*this).get_ref());
289+
return tmp.has_nan();
290+
}
291+
else
292+
{
293+
return false;
294+
}
295+
}
296+
297+
298+
236299
//
237300
// extra functions defined in BaseCube_eval_Cube
238301

inst/include/bandicoot_bits/Base_bones.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,8 @@ struct Base
121121

122122
coot_warn_unused inline uword index_min() const;
123123
coot_warn_unused inline uword index_max() const;
124+
125+
coot_warn_unused inline bool is_finite() const;
126+
coot_warn_unused inline bool has_inf() const;
127+
coot_warn_unused inline bool has_nan() const;
124128
};

inst/include/bandicoot_bits/Base_meat.hpp

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,3 +336,66 @@ Base<elem_type,derived>::index_max() const
336336
{
337337
return mtop_index_max::apply_direct( (*this).get_ref() );
338338
}
339+
340+
341+
342+
template<typename elem_type, typename derived>
343+
inline
344+
bool
345+
Base<elem_type, derived>::is_finite() const
346+
{
347+
coot_extra_debug_sigprint();
348+
349+
// The finite kernels only work on contiguous memory.
350+
if (is_non_integral<elem_type>::value)
351+
{
352+
Mat<elem_type> tmp((*this).get_ref());
353+
return tmp.is_finite();
354+
}
355+
else
356+
{
357+
return true;
358+
}
359+
}
360+
361+
362+
363+
template<typename elem_type, typename derived>
364+
inline
365+
bool
366+
Base<elem_type, derived>::has_inf() const
367+
{
368+
coot_extra_debug_sigprint();
369+
370+
// The has_inf kernels only work on contiguous memory.
371+
if (is_non_integral<elem_type>::value)
372+
{
373+
Mat<elem_type> tmp((*this).get_ref());
374+
return tmp.has_inf();
375+
}
376+
else
377+
{
378+
return false;
379+
}
380+
}
381+
382+
383+
384+
template<typename elem_type, typename derived>
385+
inline
386+
bool
387+
Base<elem_type, derived>::has_nan() const
388+
{
389+
coot_extra_debug_sigprint();
390+
391+
// The has_nan kernels only work on contiguous memory.
392+
if (is_non_integral<elem_type>::value)
393+
{
394+
Mat<elem_type> tmp((*this).get_ref());
395+
return tmp.has_nan();
396+
}
397+
else
398+
{
399+
return false;
400+
}
401+
}

inst/include/bandicoot_bits/Col_bones.hpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,17 @@ class Col : public Mat<eT>
5151
inline Col(Col&& X);
5252
inline const Col& operator=(Col&& X);
5353

54-
// TODO: inline Col(Mat<eT>&& m);
55-
// TODO: inline Col& operator=(Mat<eT>&& m);
54+
inline Col(const char* text);
55+
inline Col& operator=(const char* text);
56+
57+
inline Col(const std::string& text);
58+
inline Col& operator=(const std::string& text);
59+
60+
inline Col(const std::vector<eT>& x);
61+
inline Col& operator=(const std::vector<eT>& x);
62+
63+
inline Col(const std::initializer_list<eT>& list);
64+
inline Col& operator=(const std::initializer_list<eT>& list);
5665

5766
template<typename T1> inline Col(const Base<eT, T1>& X);
5867
template<typename T1> inline Col& operator=(const Base<eT, T1>& X);

0 commit comments

Comments
 (0)