SheafSystem  0.0.0.0
fiber_bundle::unary_index_space Class Reference

A bounded domain for unary_index objects. More...

#include <unary_index_space.h>

Public Member Functions

bool invariant () const
 Class invariant. More...
 
 unary_index_space ()
 Creates an instance with bound (0,0). More...
 
 unary_index_space (unary_index xct)
 Creates an instance with bound (xct). More...
 
void put_bounds (unary_index xct=0)
 Sets i_size = xct and recomputes size. More...
 
unary_index_space operator+ (const unary_index_space &xother) const
 Sum. More...
 
unary_index_space operator* (const unary_index_space &xother) const
 Cartesian product. More...
 
bool contains (const unary_index &xindex) const
 True if xindex is in this space. More...
 
ragged_array< unary_index > * neighbor_list () const
 Create a ragged array containing the row major offsets of the neighbors of each index in the index space. More...
 

Public Attributes

unary_index i_size
 Upper bound for the i index. More...
 
unary_index size
 Number in the space. More...
 

Detailed Description

A bounded domain for unary_index objects.

Definition at line 45 of file unary_index_space.h.

Constructor & Destructor Documentation

◆ unary_index_space() [1/2]

fiber_bundle::unary_index_space::unary_index_space ( )
inline

Creates an instance with bound (0,0).

Postcondition
  • i_size == 0

Definition at line 72 of file unary_index_space.h.

◆ unary_index_space() [2/2]

fiber_bundle::unary_index_space::unary_index_space ( unary_index  xct)
inline

Creates an instance with bound (xct).

Precondition
  • xct >= 0
Postcondition
  • i_size == xct

Definition at line 93 of file unary_index_space.h.

Member Function Documentation

◆ contains()

bool fiber_bundle::unary_index_space::contains ( const unary_index &  xindex) const
inline

True if xindex is in this space.

Postcondition
  • result == ((0 <= xindex) && (xindex < i_size))

Definition at line 180 of file unary_index_space.h.

◆ invariant()

bool fiber_bundle::unary_index_space::invariant ( ) const
inline

Class invariant.

Invariant
  • i_size >= 0
  • size == i_size

Definition at line 61 of file unary_index_space.h.

◆ neighbor_list()

sheaf::ragged_array< unary_index > * fiber_bundle::unary_index_space::neighbor_list ( ) const

Create a ragged array containing the row major offsets of the neighbors of each index in the index space.

Postcondition
  • result != 0
  • result->row_ct() == size

Definition at line 32 of file unary_index_space.cc.

References sheaf::ragged_array< T >::new_back_row(), fiber_bundle::operator<<(), sheaf::ragged_array< T >::push_back(), and sheaf::ragged_array< T >::row_ct().

◆ operator*()

unary_index_space fiber_bundle::unary_index_space::operator* ( const unary_index_space xother) const
inline

Cartesian product.

Postcondition
  • result.i_size == i_size*xother.i_size

Definition at line 159 of file unary_index_space.h.

References i_size.

◆ operator+()

unary_index_space fiber_bundle::unary_index_space::operator+ ( const unary_index_space xother) const
inline

Sum.

Postcondition
  • result.i_size == i_size+xother.i_size

Definition at line 138 of file unary_index_space.h.

References i_size.

◆ put_bounds()

void fiber_bundle::unary_index_space::put_bounds ( unary_index  xct = 0)
inline

Sets i_size = xct and recomputes size.

Postcondition
  • i_size == xct

Definition at line 116 of file unary_index_space.h.

Member Data Documentation

◆ i_size

unary_index fiber_bundle::unary_index_space::i_size

Upper bound for the i index.

Definition at line 51 of file unary_index_space.h.

Referenced by operator*(), operator+(), and fiber_bundle::operator<<().

◆ size

unary_index fiber_bundle::unary_index_space::size

Number in the space.

Definition at line 56 of file unary_index_space.h.

Referenced by fiber_bundle::operator<<().


The documentation for this class was generated from the following files: