26#if ! defined (octave_ovl_h)
29#include "octave-config.h"
33#include <initializer_list>
48 : m_data (n), m_names () { }
51 : m_data (n, val), m_names () { }
54 : m_data (1, tc), m_names () { }
56 template<
template <
typename...>
class OV_Container>
58 : m_data (args.begin (), args.end ()), m_names () { }
61 : m_data (a.
numel ()), m_names ()
68 : m_data (c.
numel ()), m_names ()
92 if (! m_data.empty ())
97 retval.
xelem (i) = m_data[i];
113 bool empty ()
const {
return length () == 0; }
117 m_data.resize (n, rfv);
135 std::vector<octave_value> slice_data (tlen);
136 auto beg = m_data.begin () + offset;
137 auto end = beg +
len;
138 std::copy (beg, end, slice_data.begin ());
142 if (tags &&
len > 0 && m_names.numel () > 0)
153 bool all_strings_p ()
const;
155 bool all_scalars ()
const;
157 bool any_cell ()
const;
159 bool has_magic_colon ()
const;
167 void make_storable_values ();
176 return m_data.front ();
183 std::vector<octave_value> m_data;
215template<
typename... OV_Args>
217ovl (
const OV_Args& ... args)
N Dimensional Array with copy-on-write semantics.
T & xelem(octave_idx_type n)
Size of the specified dimension.
void resize(const dim_vector &dv, const T &rfv)
Size of the specified dimension.
octave_idx_type numel() const
Number of elements in the array.
Vector representing the dimensions (size) of an Array.
octave_value_list(const OV_Container< octave_value > &args)
octave_value_list(const octave_value_list &obj)=default
void resize(octave_idx_type n, const octave_value &rfv=octave_value())
void stash_name_tags(const string_vector &nm)
~octave_value_list()=default
Array< octave_value > array_value() const
octave_value_list(const Cell &c)
octave_value_list()=default
octave_value_list(octave_idx_type n, const octave_value &val)
octave_value_list(octave_idx_type n)
octave_value_list(octave_value_list &&obj)=default
octave_value_list(const octave_value &tc)
octave_value & xelem(octave_idx_type i)
octave_value first_or_nil_ov() const
string_vector name_tags() const
octave_value_list slice(octave_idx_type offset, octave_idx_type len, bool tags=false) const
octave_value_list(const Array< octave_value > &a)
octave_idx_type length() const
string_vector linear_slice(octave_idx_type lo, octave_idx_type up) const
T::size_type numel(const T &str)
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.