SheafSystem
0.0.0.0
|
A block which can be accessed using two indices, similarly to a two index array. More...
#include <binary_index_block.h>
Public Member Functions | |
binary_index_block & | operator= (const binary_index_block &xother) |
Sets the contents of this to the contents of xother. More... | |
bool | invariant () const |
void | push_back (const binary_index_block &xother) |
Appends xother to the back of this. More... | |
binary_index_block (int xi_ub=0, int xj_ub=0) | |
Default constructor. More... | |
binary_index_block (const binary_index_block &xother) | |
Copy constructor. More... | |
binary_index_block (int xi_ub, int xi_ct, int xj_ub, int xj_ct, const T *xitems) | |
Creates an instance with i_ub() == xi_ub and j_ub() == xj_ub containing xi_ct*xj_ct items copied from xitems. More... | |
~binary_index_block () | |
Destructor. More... | |
int | i_ub () const |
The upper bound for the first index. More... | |
int | j_ub () const |
The upper bound for the second index. More... | |
int | i_ct () const |
The number of i index values currently in use. More... | |
int | j_ct () const |
The number of j index values currently in use. More... | |
T & | item (int xi, int xj) |
The item at index xi, xj (mutable version). More... | |
const T & | item (int xi, int xj) const |
The item at index xi, xj (const version). More... | |
T * | operator[] (int xi) const |
The address of the first item in row xi. /. More... | |
void | force_item (int xi, int xj, const T &xitem) |
Puts the item xitem at index xi,xj, resizing if necessary. More... | |
void | reserve (int xi_ub, int xj_ub) |
Makes i_ub() at least xi_ub and j_ub() at least xj_ub. More... | |
void | set_ct (int xi_ct, int xj_ct) |
Sets i_ct() == xi_ct and j_ct() == xj_ct. More... | |
void | put_item (int xi, int xj, const T &xitem) |
Sets the item xitem at index xi, xj to xitem, but will not resize. More... | |
void | assign (const T &xitem) |
Sets the values of all items to xitem. More... | |
Public Member Functions inherited from sheaf::block< T > | |
block (index_type xub=0) | |
Creates an instance with ub() == xub; storage is uninitialized. More... | |
block (index_type xub, size_type xct, const T *xitems) | |
Creates an instance with ub() == xub; storage is initialized with xct items copied from xitems. More... | |
block (const block &xother) | |
Copy constructor. More... | |
block & | operator= (const block &xother) |
Assignment operator. More... | |
~block () | |
Destructor. More... | |
Public Member Functions inherited from sheaf::auto_block< T, un_block_initialization_policy< T > > | |
pointer_type | base () const |
The underlying storage array. More... | |
size_type | ct () const |
The number of items currently in use. More... | |
bool | invariant () const |
The class invariant. More... | |
reference_type | item (index_type xindex) const |
The item at index xindex. More... | |
reference_type | operator[] (index_type xindex) const |
The item at index xindex. More... | |
index_type | ub () const |
The upper bound on the storage array. The number of items current allocated in the storage array. More... | |
auto_block (index_type xub=0) | |
Creates an instance with ub() == xub; storage is uninitialized. More... | |
auto_block (index_type xub, size_type xct, const T *xitems) | |
Creates an instance with ub() == xub; storage is initialized with xct items copied from xitems. More... | |
auto_block (const auto_block &xother) | |
Copy constructor. More... | |
auto_block & | operator= (const auto_block &xother) |
Assignment operator. More... | |
virtual | ~auto_block () |
Destructor. More... | |
void | force_item (index_type xindex, const_reference_type xitem) |
Puts the item xitem at index xindex, resizing if necessary; any other new storage allocated is uninitialized. More... | |
void | reserve (index_type xub) |
Makes ub() at least xub; if new storage is allocated, it is uninitialized. More... | |
void | set_ct (size_type xct) |
Sets ct() == xct. More... | |
void | set_item (index_type xindex, const_reference_type xitem) |
Puts the item xitem at index xindex, but will not resize. More... | |
void | assign (const_reference_type xitem) |
Sets the values of all items to xitem. More... | |
void | assign (index_type xbegin, index_type xend, const_reference_type xitem) |
Sets the values of items with xbegin <= index < xend to xitem. More... | |
reference_type | back () const |
The last item in the auto_block. More... | |
void | push_back (const_reference_type item) |
Insert item at the end of the items in the auto_block. More... | |
void | push_back (const auto_block &xother) |
Appends xother to the back of this. More... | |
void | pop_back () |
Remove item at the back. More... | |
void | clear () |
Remove all items. More... | |
void | initialize (index_type xindex) |
Invokes the initialization policy on the item at xindex. More... | |
void | initialize (index_type xbegin, index_type xend) |
Invokes the initialization policy on the range [xbegin, xend). More... | |
Protected Attributes | |
int | _i_ub |
The upper bound for the first index. More... | |
int | _j_ub |
The upper bound for the second index. More... | |
int | _i_ct |
The number of i index values currently in use. More... | |
int | _j_ct |
The number of j index values currently in use. More... | |
Protected Attributes inherited from sheaf::auto_block< T, un_block_initialization_policy< T > > | |
pointer_type | _base |
Start of storage for this. More... | |
index_type | _ub |
The index upper bound. More... | |
size_type | _ct |
The number of items currently stored. More... | |
Additional Inherited Members | |
Public Types inherited from sheaf::block< T > | |
typedef auto_block< T, un_block_initialization_policy< T > > | base_type |
typedef base_type::index_type | index_type |
typedef base_type::size_type | size_type |
Public Types inherited from sheaf::auto_block< T, un_block_initialization_policy< T > > | |
typedef T | value_type |
The type of value stored in the container. More... | |
typedef un_block_initialization_policy< T > | initialization_policy |
The value initialization policy. More... | |
typedef T & | reference_type |
A type that behaves as a reference to the container's value type. More... | |
typedef const T & | const_reference_type |
A type that behaves as a const reference to the container's value type. More... | |
typedef T * | pointer_type |
A type that behaves as a pointer to the container's value type. More... | |
typedef const T * | const_pointer_type |
A type that behaves as a const pointer to the container's value type. More... | |
typedef sheaf::pod_index_type | index_type |
The containers index type. More... | |
typedef signed long int | difference_type |
A signed integral type used to represent the difference of two indices or iterators. More... | |
typedef unsigned long int | size_type |
An unsigned integral type used to represent sizes and capacities. More... | |
A block which can be accessed using two indices, similarly to a two index array.
Definition at line 39 of file binary_index_block.h.
sheaf::binary_index_block< T >::binary_index_block | ( | int | xi_ub = 0 , |
int | xj_ub = 0 |
||
) |
Default constructor.
Definition at line 127 of file binary_index_block.impl.h.
Referenced by sheaf::binary_index_block< T >::push_back(), and sheaf::binary_index_block< T >::~binary_index_block().
sheaf::binary_index_block< T >::binary_index_block | ( | const binary_index_block< T > & | xother | ) |
Copy constructor.
Definition at line 168 of file binary_index_block.impl.h.
References sheaf::block< T >::block(), and sheaf::binary_index_block< T >::~binary_index_block().
sheaf::binary_index_block< T >::binary_index_block | ( | int | xi_ub, |
int | xi_ct, | ||
int | xj_ub, | ||
int | xj_ct, | ||
const T * | xitems | ||
) |
Creates an instance with i_ub() == xi_ub and j_ub() == xj_ub containing xi_ct*xj_ct items copied from xitems.
Definition at line 196 of file binary_index_block.impl.h.
References sheaf::auto_block< T, un_block_initialization_policy< T > >::_base, sheaf::auto_block< T, un_block_initialization_policy< T > >::_ct, sheaf::binary_index_block< T >::_i_ct, sheaf::binary_index_block< T >::_i_ub, sheaf::binary_index_block< T >::_j_ct, sheaf::binary_index_block< T >::_j_ub, sheaf::auto_block< T, un_block_initialization_policy< T > >::_ub, sheaf::auto_block< T, un_block_initialization_policy< T > >::base(), sheaf::auto_block< T, un_block_initialization_policy< T > >::ct(), sheaf::binary_index_block< T >::i_ct(), sheaf::binary_index_block< T >::i_ub(), sheaf::binary_index_block< T >::invariant(), sheaf::binary_index_block< T >::j_ct(), sheaf::binary_index_block< T >::j_ub(), fiber_bundle::ed_algebra::length(), and sheaf::binary_index_block< T >::reserve().
sheaf::binary_index_block< T >::~binary_index_block | ( | ) |
Destructor.
Definition at line 190 of file binary_index_block.impl.h.
References sheaf::binary_index_block< T >::binary_index_block().
Referenced by sheaf::binary_index_block< T >::binary_index_block().
void sheaf::binary_index_block< T >::assign | ( | const T & | xitem | ) |
Sets the values of all items to xitem.
Definition at line 537 of file binary_index_block.impl.h.
References sheaf::auto_block< T, un_block_initialization_policy< T > >::_base, sheaf::binary_index_block< T >::i_ct(), sheaf::binary_index_block< T >::invariant(), sheaf::binary_index_block< T >::item(), and sheaf::binary_index_block< T >::j_ct().
Referenced by sheaf::binary_index_block< T >::put_item().
void sheaf::binary_index_block< T >::force_item | ( | int | xi, |
int | xj, | ||
const T & | xitem | ||
) |
Puts the item xitem at index xi,xj, resizing if necessary.
Definition at line 407 of file binary_index_block.impl.h.
References sheaf::binary_index_block< T >::_i_ub, sheaf::binary_index_block< T >::_j_ub, sheaf::binary_index_block< T >::invariant(), sheaf::binary_index_block< T >::item(), sheaf::binary_index_block< T >::put_item(), and sheaf::binary_index_block< T >::reserve().
Referenced by sheaf::binary_index_block< T >::operator[]().
int sheaf::binary_index_block< T >::i_ct | ( | ) | const |
The number of i index values currently in use.
Definition at line 286 of file binary_index_block.impl.h.
References sheaf::binary_index_block< T >::_i_ct, sheaf::binary_index_block< T >::invariant(), and sheaf::binary_index_block< T >::j_ct().
Referenced by sheaf::binary_index_block< T >::assign(), sheaf::binary_index_block< T >::binary_index_block(), sheaf::binary_index_block< T >::j_ub(), sheaf::binary_index_block< T >::reserve(), and sheaf::binary_index_block< T >::set_ct().
int sheaf::binary_index_block< T >::i_ub | ( | ) | const |
The upper bound for the first index.
Definition at line 241 of file binary_index_block.impl.h.
References sheaf::binary_index_block< T >::_i_ub, sheaf::binary_index_block< T >::invariant(), and sheaf::binary_index_block< T >::j_ub().
Referenced by sheaf::binary_index_block< T >::binary_index_block(), sheaf::binary_index_block< T >::item(), sheaf::binary_index_block< T >::operator[](), sheaf::binary_index_block< T >::put_item(), sheaf::binary_index_block< T >::reserve(), and sheaf::binary_index_block< T >::set_ct().
bool sheaf::binary_index_block< T >::invariant | ( | ) | const |
The class invariant.
Definition at line 65 of file binary_index_block.impl.h.
References sheaf::auto_block< T, un_block_initialization_policy< T > >::invariant(), and sheaf::binary_index_block< T >::push_back().
Referenced by sheaf::binary_index_block< T >::assign(), sheaf::binary_index_block< T >::binary_index_block(), sheaf::binary_index_block< T >::force_item(), sheaf::binary_index_block< T >::i_ct(), sheaf::binary_index_block< T >::i_ub(), sheaf::binary_index_block< T >::item(), sheaf::binary_index_block< T >::j_ct(), sheaf::binary_index_block< T >::j_ub(), sheaf::binary_index_block< T >::operator=(), sheaf::binary_index_block< T >::operator[](), sheaf::binary_index_block< T >::put_item(), and sheaf::binary_index_block< T >::reserve().
T & sheaf::binary_index_block< T >::item | ( | int | xi, |
int | xj | ||
) |
The item at index xi, xj (mutable version).
Definition at line 330 of file binary_index_block.impl.h.
References sheaf::auto_block< T, un_block_initialization_policy< T > >::_base, sheaf::binary_index_block< T >::i_ub(), sheaf::binary_index_block< T >::invariant(), and sheaf::binary_index_block< T >::j_ub().
Referenced by sheaf::binary_index_block< T >::assign(), sheaf::binary_index_block< T >::force_item(), sheaf::binary_index_block< T >::j_ct(), sheaf::binary_index_block< T >::push_back(), and sheaf::binary_index_block< T >::put_item().
const T & sheaf::binary_index_block< T >::item | ( | int | xi, |
int | xj | ||
) | const |
The item at index xi, xj (const version).
Definition at line 356 of file binary_index_block.impl.h.
References sheaf::auto_block< T, un_block_initialization_policy< T > >::_base, sheaf::binary_index_block< T >::i_ub(), sheaf::binary_index_block< T >::invariant(), sheaf::binary_index_block< T >::j_ub(), and sheaf::binary_index_block< T >::operator[]().
int sheaf::binary_index_block< T >::j_ct | ( | ) | const |
The number of j index values currently in use.
Definition at line 308 of file binary_index_block.impl.h.
References sheaf::binary_index_block< T >::_j_ct, sheaf::binary_index_block< T >::invariant(), and sheaf::binary_index_block< T >::item().
Referenced by sheaf::binary_index_block< T >::assign(), sheaf::binary_index_block< T >::binary_index_block(), sheaf::binary_index_block< T >::i_ct(), sheaf::binary_index_block< T >::reserve(), and sheaf::binary_index_block< T >::set_ct().
int sheaf::binary_index_block< T >::j_ub | ( | ) | const |
The upper bound for the second index.
Definition at line 264 of file binary_index_block.impl.h.
References sheaf::binary_index_block< T >::_j_ub, sheaf::binary_index_block< T >::i_ct(), and sheaf::binary_index_block< T >::invariant().
Referenced by sheaf::binary_index_block< T >::binary_index_block(), sheaf::binary_index_block< T >::i_ub(), sheaf::binary_index_block< T >::item(), sheaf::binary_index_block< T >::put_item(), sheaf::binary_index_block< T >::reserve(), and sheaf::binary_index_block< T >::set_ct().
binary_index_block< T > & sheaf::binary_index_block< T >::operator= | ( | const binary_index_block< T > & | xother | ) |
Sets the contents of this to the contents of xother.
Definition at line 45 of file binary_index_block.impl.h.
References sheaf::binary_index_block< T >::invariant(), and sheaf::block< T >::operator=().
T * sheaf::binary_index_block< T >::operator[] | ( | int | xi | ) | const |
The address of the first item in row xi. /.
Definition at line 382 of file binary_index_block.impl.h.
References sheaf::auto_block< T, un_block_initialization_policy< T > >::_base, sheaf::binary_index_block< T >::_j_ub, sheaf::binary_index_block< T >::force_item(), sheaf::binary_index_block< T >::i_ub(), and sheaf::binary_index_block< T >::invariant().
Referenced by sheaf::binary_index_block< T >::item().
void sheaf::binary_index_block< T >::push_back | ( | const binary_index_block< T > & | xother | ) |
Appends xother to the back of this.
Definition at line 97 of file binary_index_block.impl.h.
References sheaf::binary_index_block< T >::binary_index_block(), sheaf::auto_block< T, S >::ct(), and sheaf::binary_index_block< T >::item().
Referenced by sheaf::binary_index_block< T >::invariant().
void sheaf::binary_index_block< T >::put_item | ( | int | xi, |
int | xj, | ||
const T & | xitem | ||
) |
Sets the item xitem at index xi, xj to xitem, but will not resize.
Definition at line 513 of file binary_index_block.impl.h.
References sheaf::auto_block< T, un_block_initialization_policy< T > >::_base, sheaf::binary_index_block< T >::assign(), sheaf::binary_index_block< T >::i_ub(), sheaf::binary_index_block< T >::invariant(), sheaf::binary_index_block< T >::item(), and sheaf::binary_index_block< T >::j_ub().
Referenced by sheaf::binary_index_block< T >::force_item(), and sheaf::binary_index_block< T >::set_ct().
void sheaf::binary_index_block< T >::reserve | ( | int | xi_ub, |
int | xj_ub | ||
) |
Makes i_ub() at least xi_ub and j_ub() at least xj_ub.
Definition at line 443 of file binary_index_block.impl.h.
References sheaf::binary_index_block< T >::_i_ct, sheaf::binary_index_block< T >::_i_ub, sheaf::binary_index_block< T >::_j_ct, sheaf::binary_index_block< T >::_j_ub, sheaf::auto_block< T, un_block_initialization_policy< T > >::base(), sheaf::binary_index_block< T >::i_ct(), sheaf::binary_index_block< T >::i_ub(), sheaf::binary_index_block< T >::invariant(), sheaf::binary_index_block< T >::j_ct(), sheaf::binary_index_block< T >::j_ub(), sheaf::binary_index_block< T >::set_ct(), and sheaf::auto_block< T, un_block_initialization_policy< T > >::ub().
Referenced by sheaf::binary_index_block< T >::binary_index_block(), and sheaf::binary_index_block< T >::force_item().
void sheaf::binary_index_block< T >::set_ct | ( | int | xi_ct, |
int | xj_ct | ||
) |
Sets i_ct() == xi_ct and j_ct() == xj_ct.
Definition at line 489 of file binary_index_block.impl.h.
References sheaf::binary_index_block< T >::_i_ct, sheaf::binary_index_block< T >::_j_ct, sheaf::binary_index_block< T >::i_ct(), sheaf::binary_index_block< T >::i_ub(), sheaf::binary_index_block< T >::j_ct(), sheaf::binary_index_block< T >::j_ub(), and sheaf::binary_index_block< T >::put_item().
Referenced by sheaf::binary_index_block< T >::reserve().
|
protected |
The number of i index values currently in use.
Definition at line 187 of file binary_index_block.h.
Referenced by sheaf::binary_index_block< T >::binary_index_block(), sheaf::binary_index_block< T >::i_ct(), sheaf::binary_index_block< T >::reserve(), and sheaf::binary_index_block< T >::set_ct().
|
protected |
The upper bound for the first index.
Definition at line 177 of file binary_index_block.h.
Referenced by sheaf::binary_index_block< T >::binary_index_block(), sheaf::binary_index_block< T >::force_item(), sheaf::binary_index_block< T >::i_ub(), and sheaf::binary_index_block< T >::reserve().
|
protected |
The number of j index values currently in use.
Definition at line 192 of file binary_index_block.h.
Referenced by sheaf::binary_index_block< T >::binary_index_block(), sheaf::binary_index_block< T >::j_ct(), sheaf::binary_index_block< T >::reserve(), and sheaf::binary_index_block< T >::set_ct().
|
protected |
The upper bound for the second index.
Definition at line 182 of file binary_index_block.h.
Referenced by sheaf::binary_index_block< T >::binary_index_block(), sheaf::binary_index_block< T >::force_item(), sheaf::binary_index_block< T >::j_ub(), sheaf::binary_index_block< T >::operator[](), and sheaf::binary_index_block< T >::reserve().