diff --git a/include/armadillo_bits/Cube_bones.hpp b/include/armadillo_bits/Cube_bones.hpp index 7577d3ef..7d60ce85 100644 --- a/include/armadillo_bits/Cube_bones.hpp +++ b/include/armadillo_bits/Cube_bones.hpp @@ -75,6 +75,9 @@ class Cube : public BaseCube< eT, Cube > template inline Cube(const uword in_rows, const uword in_cols, const uword in_slices, const fill::fill_class& f); template inline Cube(const SizeCube& s, const fill::fill_class& f); + inline Cube(const uword in_rows, const uword in_cols, const uword in_slices, const fill::scalar_holder f); + inline Cube(const SizeCube& s, const fill::scalar_holder f); + inline Cube(Cube&& m); inline Cube& operator=(Cube&& m); diff --git a/include/armadillo_bits/Cube_meat.hpp b/include/armadillo_bits/Cube_meat.hpp index 71175a4a..09fb21f8 100644 --- a/include/armadillo_bits/Cube_meat.hpp +++ b/include/armadillo_bits/Cube_meat.hpp @@ -230,6 +230,51 @@ Cube::Cube(const SizeCube& s, const fill::fill_class&) +//! construct the cube to have user specified dimensions and fill with specified value +template +inline +Cube::Cube(const uword in_n_rows, const uword in_n_cols, const uword in_n_slices, const fill::scalar_holder f) + : n_rows(in_n_rows) + , n_cols(in_n_cols) + , n_elem_slice(in_n_rows*in_n_cols) + , n_slices(in_n_slices) + , n_elem(in_n_rows*in_n_cols*in_n_slices) + , n_alloc() + , mem_state(0) + , mem() + , mat_ptrs(nullptr) + { + arma_extra_debug_sigprint_this(this); + + init_cold(); + + (*this).fill(f.scalar); + } + + + +template +inline +Cube::Cube(const SizeCube& s, const fill::scalar_holder f) + : n_rows(s.n_rows) + , n_cols(s.n_cols) + , n_elem_slice(s.n_rows*s.n_cols) + , n_slices(s.n_slices) + , n_elem(s.n_rows*s.n_cols*s.n_slices) + , n_alloc() + , mem_state(0) + , mem() + , mat_ptrs(nullptr) + { + arma_extra_debug_sigprint_this(this); + + init_cold(); + + (*this).fill(f.scalar); + } + + + template inline Cube::Cube(Cube&& in_cube)