20 #ifndef RAGGED_ARRAY_H 21 #define RAGGED_ARRAY_H 23 #ifndef SHEAF_DLL_SPEC_H 24 #include "SheafSystem/sheaf_dll_spec.h" 28 #include "SheafSystem/rc_any.h" 32 #include "SheafSystem/rc_ptr.h" 36 #include "SheafSystem/block.h" 42 template <
typename T>
class ragged_array;
49 size_t deep_size(
const ragged_array<T>& xra,
bool xinclude_shallow =
true);
55 class SHEAF_DLL_SPEC ragged_array :
public rc_any
58 friend size_t deep_size<T>(
const ragged_array<T>& xra,
bool xinclude_shallow);
94 index_type xcol_cts_ub);
100 ragged_array(
const index_type xrow_ct,
const index_type xvalue_ct);
120 index_type row_ct()
const;
125 index_type col_ct(
const index_type xrow_index)
const;
130 index_type* col_cts()
const;
140 index_type value_ct()
const;
145 T* row(
const index_type xrow_index)
const;
150 T* operator[](
const index_type xrow_index)
const;
160 void reset_rows(
const index_type* xcol_cts,
const index_type xcol_cts_ub);
165 index_type sum_col_cts()
const;
170 index_type sum_col_cts(
const index_type* xcol_cts,
const index_type xcol_cts_ub)
const;
176 void initialize_push_back(index_type xrow_ct, index_type xvalue_ct);
181 index_type back_row()
const;
191 void push_back(
const T& xvalue);
199 void initialize(
const index_type* xcol_cts,
200 index_type xcol_cts_ub);
240 virtual bool invariant()
const;
245 virtual bool is_ancestor_of(
const any* xother)
const;
261 template <
typename T>
262 std::ostream& operator << (std::ostream& xos, const ragged_array<T>& xra);
266 #endif // ifndef RAGGED_ARRAY_H Abstract base class with useful features for all objects.
block< index_type > _col_cts
The number of columns in each row.
SHEAF_DLL_SPEC size_t deep_size(const dof_descriptor_array &xp, bool xinclude_shallow=true)
The deep size of the referenced object of type dof_descriptor_array.
block< T > _values
The values stored in the array.
bool operator==(const singly_linked_list< T, Alloc > &lhs, const singly_linked_list< T, Alloc > &rhs)
Checks if the contents of lhs and rhs are equal, that is, whether lhs.size() == rhs.size() and each element in lhs compares equal with the element in rhs at the same position.
block< index_type > _row_ptrs
Index of the first value in each row.
Namespace for the sheaves component of the sheaf system.
rc_ptr< ragged_array< T > > ptr
Reference counted pointer type.
A two index array with variable length rows.
unsigned long index_type
The integer type used to index this.
An auto_block with a no-initialization initialization policy.
Reference-counted pointer to object of type T. T must be an implementation of concept class rc_any...