Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes | Friends | List of all members
ObjexxFCL::IndexRange Class Reference

IndexRange: Index Range Abstract Base Class. More...

#include <IndexRange.hh>

Inheritance diagram for ObjexxFCL::IndexRange:
Inheritance graph
[legend]

Public Types

typedef std::size_t size_type
 
typedef std::size_t Size
 

Public Member Functions

virtual ~IndexRange ()
 Destructor. More...
 
virtual IndexRangeoperator= (int const u_a)
 Upper Index Assignment. More...
 
virtual IndexRangeoperator= (Star const &)
 Unbounded Upper Index Assignment. More...
 
virtual IndexRangeassign (int const u_a)
 Upper Index Assignment. More...
 
virtual IndexRangeassign (Star const &)
 Unbounded Upper Index Assignment. More...
 
virtual IndexRangeassign (int const l_a, int const u_a)
 Index Range Assignment. More...
 
virtual IndexRangeassign (int const l_a, Star const &)
 Index and Unbounded Upper Index Assignment. More...
 
virtual bool initialized () const
 Initialized? More...
 
virtual bool l_initialized () const
 Lower Initialized? More...
 
virtual bool u_initialized () const
 Upper Initialized? More...
 
virtual bool legal () const
 Legal? More...
 
virtual bool bounded () const
 Bounded? More...
 
bool bounded_value () const
 Bounded? More...
 
virtual bool unbounded () const
 Unbounded? More...
 
bool unbounded_value () const
 Unbounded? More...
 
virtual bool not_unbounded () const
 Not Unbounded? More...
 
virtual bool positive () const
 Bounded with Positive Size? More...
 
bool positive_value () const
 Bounded with Positive Size? More...
 
virtual bool contains (int const i) const
 Contains an Index? More...
 
virtual bool contains (IndexRange const &I) const
 Contains Another IndexRange? More...
 
virtual bool intersects (IndexRange const &I) const
 Intersects Another IndexRange? More...
 
int l () const
 Lower Index. More...
 
int lz () const
 Lower Index (Zero if Uninitialized) More...
 
int u () const
 Upper Index. More...
 
int uz () const
 Upper Index (Zero if Uninitialized) More...
 
size_type size () const
 Size. More...
 
int offset (int const i) const
 Offset of an Index. More...
 
virtual IndexRangel (int const l_a)
 Lower Index Set. More...
 
virtual IndexRangeu (int const u_a)
 Upper Index Set. More...
 
virtual IndexRangeu (Star const &)
 Unbounded Upper Index Set. More...
 
virtual IndexRangecontain (int const i)
 Expand to Contain an Index. More...
 
virtual IndexRangecontain (IndexRange const &I)
 Expand to Contain Another IndexRange. More...
 
virtual IndexRangeintersect (IndexRange const &I)
 Intersect With Another IndexRange. More...
 
virtual IndexRangeclear ()
 Clear. More...
 

Static Public Attributes

static size_type const npos = static_cast< size_type >( -1 )
 
static int const l_min = -( static_cast< int >( ( static_cast< unsigned int >( -1 ) / 2u ) ) - 1 )
 
static int const u_max = static_cast< int >( ( static_cast< unsigned int >( -1 ) / 2u ) )
 

Protected Member Functions

 IndexRange ()
 Default Constructor. More...
 
 IndexRange (IndexRange const &I)
 Copy Constructor. More...
 
 IndexRange (int const u_a)
 Upper Index Constructor. More...
 
 IndexRange (Star const &)
 Unbounded Upper Index Constructor. More...
 
 IndexRange (int const l_a, int const u_a)
 Index Range Constructor. More...
 
 IndexRange (int const l_a, Star const &)
 Index and Unbounded Upper Index Constructor. More...
 
IndexRangeoperator= (IndexRange const &I)
 Copy Assignment. More...
 
bool legal_static () const
 Legal Static Range? More...
 
virtual Dimensionl_dim_clone () const
 Lower Dimension Clone. More...
 
virtual Dimensionu_dim_clone () const
 Upper Dimension Clone. More...
 
void swap (IndexRange &I)
 Swap. More...
 

Private Attributes

int l_
 Lower index. More...
 
int u_
 Upper index. More...
 
size_type size_
 Size (npos iff unbounded) More...
 

Friends

class StaticIndexRange
 
class DynamicIndexRange
 
bool operator== (IndexRange const &I, IndexRange const &J)
 IndexRange == IndexRange. More...
 
bool operator!= (IndexRange const &I, IndexRange const &J)
 IndexRange != IndexRange. More...
 
bool operator< (IndexRange const &I, IndexRange const &J)
 IndexRange < IndexRange. More...
 
bool operator<= (IndexRange const &I, IndexRange const &J)
 IndexRange <= IndexRange. More...
 
bool operator> (IndexRange const &I, IndexRange const &J)
 IndexRange > IndexRange. More...
 
bool operator>= (IndexRange const &I, IndexRange const &J)
 IndexRange >= IndexRange. More...
 
std::istream & operator>> (std::istream &stream, IndexRange &I)
 Stream Input. More...
 
std::ostream & operator<< (std::ostream &stream, IndexRange const &I)
 Stream Output. More...
 

Detailed Description

IndexRange: Index Range Abstract Base Class.

Remarks
  • Zero-size range is indicated by ( l - 1 == u ) and ( size == 0 )
  • Upper-unbounded range is indicated by ( l - 2 == u ) and ( size == npos )
  • Legal ranges have ( l - 2 <= u ) with l and u in their allowed ranges

Member Typedef Documentation

Constructor & Destructor Documentation

ObjexxFCL::IndexRange::IndexRange ( )
inlineprotected

Default Constructor.

ObjexxFCL::IndexRange::IndexRange ( IndexRange const &  I)
inlineprotected

Copy Constructor.

ObjexxFCL::IndexRange::IndexRange ( int const  u_a)
inlineprotected

Upper Index Constructor.

ObjexxFCL::IndexRange::IndexRange ( Star const &  )
inlineprotected

Unbounded Upper Index Constructor.

ObjexxFCL::IndexRange::IndexRange ( int const  l_a,
int const  u_a 
)
inlineprotected

Index Range Constructor.

ObjexxFCL::IndexRange::IndexRange ( int const  l_a,
Star const &   
)
inlineprotected

Index and Unbounded Upper Index Constructor.

virtual ObjexxFCL::IndexRange::~IndexRange ( )
inlinevirtual

Destructor.

Member Function Documentation

virtual IndexRange& ObjexxFCL::IndexRange::assign ( int const  u_a)
inlinevirtual
virtual IndexRange& ObjexxFCL::IndexRange::assign ( Star const &  )
inlinevirtual

Unbounded Upper Index Assignment.

Reimplemented in ObjexxFCL::DynamicIndexRange, and ObjexxFCL::StaticIndexRange.

References l_, npos, size_, and u_.

virtual IndexRange& ObjexxFCL::IndexRange::assign ( int const  l_a,
int const  u_a 
)
inlinevirtual

Index Range Assignment.

Reimplemented in ObjexxFCL::DynamicIndexRange, and ObjexxFCL::StaticIndexRange.

References l_, size_, and u_.

virtual IndexRange& ObjexxFCL::IndexRange::assign ( int const  l_a,
Star const &   
)
inlinevirtual

Index and Unbounded Upper Index Assignment.

Reimplemented in ObjexxFCL::DynamicIndexRange, and ObjexxFCL::StaticIndexRange.

References l_, npos, size_, and u_.

virtual bool ObjexxFCL::IndexRange::bounded ( ) const
inlinevirtual
bool ObjexxFCL::IndexRange::bounded_value ( ) const
inline
virtual IndexRange& ObjexxFCL::IndexRange::clear ( )
inlinevirtual
virtual IndexRange& ObjexxFCL::IndexRange::contain ( int const  i)
inlinevirtual

Expand to Contain an Index.

Reimplemented in ObjexxFCL::DynamicIndexRange, and ObjexxFCL::StaticIndexRange.

References l_, size_, and u_.

Referenced by ObjexxFCL::StaticIndexRange::contain().

IndexRange & ObjexxFCL::IndexRange::contain ( IndexRange const &  I)
virtual

Expand to Contain Another IndexRange.

Reimplemented in ObjexxFCL::DynamicIndexRange, and ObjexxFCL::StaticIndexRange.

References bounded(), initialized(), l_, npos, positive(), size_, and u_.

virtual bool ObjexxFCL::IndexRange::contains ( int const  i) const
inlinevirtual
bool ObjexxFCL::IndexRange::contains ( IndexRange const &  I) const
virtual

Contains Another IndexRange?

Reimplemented in ObjexxFCL::DynamicIndexRange.

References initialized(), l_, and u_.

virtual bool ObjexxFCL::IndexRange::initialized ( ) const
inlinevirtual
IndexRange & ObjexxFCL::IndexRange::intersect ( IndexRange const &  I)
virtual
bool ObjexxFCL::IndexRange::intersects ( IndexRange const &  I) const
virtual
int ObjexxFCL::IndexRange::l ( ) const
inline
virtual IndexRange& ObjexxFCL::IndexRange::l ( int const  l_a)
inlinevirtual

Lower Index Set.

Reimplemented in ObjexxFCL::DynamicIndexRange, and ObjexxFCL::StaticIndexRange.

References l_, size_, and u_.

virtual Dimension* ObjexxFCL::IndexRange::l_dim_clone ( ) const
inlineprotectedvirtual
virtual bool ObjexxFCL::IndexRange::l_initialized ( ) const
inlinevirtual

Lower Initialized?

Reimplemented in ObjexxFCL::DynamicIndexRange.

Referenced by l(), and offset().

virtual bool ObjexxFCL::IndexRange::legal ( ) const
inlinevirtual

Legal?

Reimplemented in ObjexxFCL::DynamicIndexRange.

References l_, l_min, and u_.

bool ObjexxFCL::IndexRange::legal_static ( ) const
inlineprotected
int ObjexxFCL::IndexRange::lz ( ) const
inline

Lower Index (Zero if Uninitialized)

References l_.

Referenced by ObjexxFCL::FArray1A< typename >::dimension_argument(), ObjexxFCL::FArray2A< typename >::dimension_argument(), ObjexxFCL::FArray3A< typename >::dimension_argument(), ObjexxFCL::FArray4A< typename >::dimension_argument(), ObjexxFCL::FArray5A< typename >::dimension_argument(), ObjexxFCL::FArray6A< typename >::dimension_argument(), ObjexxFCL::FArray1P< typename >::dimension_proxy(), ObjexxFCL::FArray2P< typename >::dimension_proxy(), ObjexxFCL::FArray3P< typename >::dimension_proxy(), ObjexxFCL::FArray4P< typename >::dimension_proxy(), ObjexxFCL::FArray5P< typename >::dimension_proxy(), ObjexxFCL::FArray6P< typename >::dimension_proxy(), ObjexxFCL::FArray1D< double >::dimension_real(), ObjexxFCL::KeyFArray1D< typename >::dimension_real(), ObjexxFCL::FArray2D< double >::dimension_real(), ObjexxFCL::FArray3D< typename >::dimension_real(), ObjexxFCL::KeyFArray2D< typename >::dimension_real(), ObjexxFCL::KeyFArray3D< typename >::dimension_real(), ObjexxFCL::FArray4D< typename >::dimension_real(), ObjexxFCL::KeyFArray4D< typename >::dimension_real(), ObjexxFCL::FArray5D< typename >::dimension_real(), ObjexxFCL::KeyFArray5D< typename >::dimension_real(), ObjexxFCL::FArray6D< typename >::dimension_real(), ObjexxFCL::KeyFArray6D< typename >::dimension_real(), ObjexxFCL::FArray1D< double >::setup_real(), ObjexxFCL::KeyFArray1D< typename >::setup_real(), ObjexxFCL::FArray2D< double >::setup_real(), ObjexxFCL::FArray3D< typename >::setup_real(), ObjexxFCL::KeyFArray3D< typename >::setup_real(), ObjexxFCL::KeyFArray2D< typename >::setup_real(), ObjexxFCL::FArray4D< typename >::setup_real(), ObjexxFCL::KeyFArray4D< typename >::setup_real(), ObjexxFCL::FArray5D< typename >::setup_real(), ObjexxFCL::KeyFArray5D< typename >::setup_real(), ObjexxFCL::FArray6D< typename >::setup_real(), and ObjexxFCL::KeyFArray6D< typename >::setup_real().

virtual bool ObjexxFCL::IndexRange::not_unbounded ( ) const
inlinevirtual

Not Unbounded?

Reimplemented in ObjexxFCL::DynamicIndexRange.

References l_, and u_.

Referenced by ObjexxFCL::DynamicIndexRange::not_unbounded().

int ObjexxFCL::IndexRange::offset ( int const  i) const
inline

Offset of an Index.

References l_, and l_initialized().

IndexRange& ObjexxFCL::IndexRange::operator= ( IndexRange const &  I)
inlineprotected
virtual IndexRange& ObjexxFCL::IndexRange::operator= ( int const  u_a)
inlinevirtual

Upper Index Assignment.

Reimplemented in ObjexxFCL::DynamicIndexRange, and ObjexxFCL::StaticIndexRange.

References l_, size_, and u_.

virtual IndexRange& ObjexxFCL::IndexRange::operator= ( Star const &  )
inlinevirtual

Unbounded Upper Index Assignment.

Reimplemented in ObjexxFCL::DynamicIndexRange, and ObjexxFCL::StaticIndexRange.

References l_, npos, size_, and u_.

virtual bool ObjexxFCL::IndexRange::positive ( ) const
inlinevirtual
bool ObjexxFCL::IndexRange::positive_value ( ) const
inline

Bounded with Positive Size?

References l_, and u_.

size_type ObjexxFCL::IndexRange::size ( ) const
inline

Size.

References size_.

Referenced by ObjexxFCL::FArray1A< typename >::dimension_argument(), ObjexxFCL::FArray2A< typename >::dimension_argument(), ObjexxFCL::FArray3A< typename >::dimension_argument(), ObjexxFCL::FArray4A< typename >::dimension_argument(), ObjexxFCL::FArray5A< typename >::dimension_argument(), ObjexxFCL::FArray6A< typename >::dimension_argument(), ObjexxFCL::FArray1P< typename >::dimension_proxy(), ObjexxFCL::FArray2P< typename >::dimension_proxy(), ObjexxFCL::FArray3P< typename >::dimension_proxy(), ObjexxFCL::FArray4P< typename >::dimension_proxy(), ObjexxFCL::FArray5P< typename >::dimension_proxy(), ObjexxFCL::FArray6P< typename >::dimension_proxy(), ObjexxFCL::FArray2D< double >::dimension_real(), ObjexxFCL::FArray3D< typename >::dimension_real(), ObjexxFCL::KeyFArray2D< typename >::dimension_real(), ObjexxFCL::KeyFArray3D< typename >::dimension_real(), ObjexxFCL::FArray4D< typename >::dimension_real(), ObjexxFCL::KeyFArray4D< typename >::dimension_real(), ObjexxFCL::FArray5D< typename >::dimension_real(), ObjexxFCL::KeyFArray5D< typename >::dimension_real(), ObjexxFCL::FArray6D< typename >::dimension_real(), ObjexxFCL::KeyFArray6D< typename >::dimension_real(), numeric::fourier::fft(), numeric::fourier::fft2(), numeric::fourier::ifft(), numeric::fourier::ifft2(), ObjexxFCL::FArray2D< double >::setup_real(), ObjexxFCL::FArray3D< typename >::setup_real(), ObjexxFCL::KeyFArray3D< typename >::setup_real(), ObjexxFCL::KeyFArray2D< typename >::setup_real(), ObjexxFCL::FArray4D< typename >::setup_real(), ObjexxFCL::KeyFArray4D< typename >::setup_real(), ObjexxFCL::FArray5D< typename >::setup_real(), ObjexxFCL::KeyFArray5D< typename >::setup_real(), ObjexxFCL::FArray6D< typename >::setup_real(), ObjexxFCL::KeyFArray6D< typename >::setup_real(), ObjexxFCL::FArray1D< double >::size1(), ObjexxFCL::KeyFArray1D< typename >::size1(), ObjexxFCL::FArray1A< typename >::size1(), ObjexxFCL::FArray1P< typename >::size1(), ObjexxFCL::FArray2D< double >::size2(), ObjexxFCL::KeyFArray2D< typename >::size2(), ObjexxFCL::FArray2A< typename >::size2(), ObjexxFCL::FArray2P< typename >::size2(), ObjexxFCL::FArray3D< typename >::size3(), ObjexxFCL::KeyFArray3D< typename >::size3(), ObjexxFCL::FArray3A< typename >::size3(), ObjexxFCL::FArray3P< typename >::size3(), ObjexxFCL::FArray4D< typename >::size4(), ObjexxFCL::KeyFArray4D< typename >::size4(), ObjexxFCL::FArray4A< typename >::size4(), ObjexxFCL::FArray4P< typename >::size4(), ObjexxFCL::FArray5D< typename >::size5(), ObjexxFCL::KeyFArray5D< typename >::size5(), ObjexxFCL::FArray5P< typename >::size5(), ObjexxFCL::FArray5A< typename >::size5(), ObjexxFCL::FArray6D< typename >::size6(), ObjexxFCL::KeyFArray6D< typename >::size6(), ObjexxFCL::FArray6P< typename >::size6(), ObjexxFCL::FArray6A< typename >::size6(), and ObjexxFCL::FArray< T >::size_of().

void ObjexxFCL::IndexRange::swap ( IndexRange I)
inlineprotected
int ObjexxFCL::IndexRange::u ( ) const
inline
virtual IndexRange& ObjexxFCL::IndexRange::u ( int const  u_a)
inlinevirtual

Upper Index Set.

Reimplemented in ObjexxFCL::DynamicIndexRange, and ObjexxFCL::StaticIndexRange.

References l_, size_, and u_.

virtual IndexRange& ObjexxFCL::IndexRange::u ( Star const &  )
inlinevirtual

Unbounded Upper Index Set.

Reimplemented in ObjexxFCL::DynamicIndexRange, and ObjexxFCL::StaticIndexRange.

References l_, npos, size_, and u_.

virtual Dimension* ObjexxFCL::IndexRange::u_dim_clone ( ) const
inlineprotectedvirtual
virtual bool ObjexxFCL::IndexRange::u_initialized ( ) const
inlinevirtual

Upper Initialized?

Reimplemented in ObjexxFCL::DynamicIndexRange.

Referenced by u().

virtual bool ObjexxFCL::IndexRange::unbounded ( ) const
inlinevirtual

Unbounded?

Reimplemented in ObjexxFCL::DynamicIndexRange.

References l_, and u_.

Referenced by ObjexxFCL::DynamicIndexRange::unbounded().

bool ObjexxFCL::IndexRange::unbounded_value ( ) const
inline

Unbounded?

References l_, and u_.

int ObjexxFCL::IndexRange::uz ( ) const
inline

Upper Index (Zero if Uninitialized)

References u_.

Friends And Related Function Documentation

friend class DynamicIndexRange
friend
bool operator!= ( IndexRange const &  I,
IndexRange const &  J 
)
friend
bool operator< ( IndexRange const &  I,
IndexRange const &  J 
)
friend
std::ostream& operator<< ( std::ostream &  stream,
IndexRange const &  I 
)
friend

Stream Output.

bool operator<= ( IndexRange const &  I,
IndexRange const &  J 
)
friend
bool operator== ( IndexRange const &  I,
IndexRange const &  J 
)
friend
bool operator> ( IndexRange const &  I,
IndexRange const &  J 
)
friend
bool operator>= ( IndexRange const &  I,
IndexRange const &  J 
)
friend
std::istream& operator>> ( std::istream &  stream,
IndexRange I 
)
friend

Stream Input.

friend class StaticIndexRange
friend

Member Data Documentation

int ObjexxFCL::IndexRange::l_
private
int const ObjexxFCL::IndexRange::l_min = -( static_cast< int >( ( static_cast< unsigned int >( -1 ) / 2u ) ) - 1 )
static
IndexRange::size_type const ObjexxFCL::IndexRange::npos = static_cast< size_type >( -1 )
static
size_type ObjexxFCL::IndexRange::size_
private
int ObjexxFCL::IndexRange::u_
private
int const ObjexxFCL::IndexRange::u_max = static_cast< int >( ( static_cast< unsigned int >( -1 ) / 2u ) )
static

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