47#ifndef TEUCHOS_RANGE1D_HPP
48#define TEUCHOS_RANGE1D_HPP
55#include "Teuchos_Assert.hpp"
280TEUCHOSCORE_LIB_DLL_EXPORT
294 : lbound_(0), ubound_(-2)
307 return (lbound_ == 0 && ubound_ == std::numeric_limits<Ordinal>::max()-1);
322 return ubound_ - lbound_ + 1;
327 return lbound_ <=
i &&
i <= ubound_;
332 assert_valid_range( lbound_ +
incr, ubound_ +
incr );
341 assert_valid_range( lbound_ -
incr, ubound_ -
incr );
Defines basic traits for the scalar field type.
Smart reference counting pointer class for automatic garbage collection.
Subregion Index Range Class.
Range1D operator+(const Range1D &rng_rhs, Range1D::Ordinal i)
rng_lhs = rng_rhs + i.
Range1D & operator-=(Ordinal incr)
Deincrement the range by a constant.
Range1D full_range(const Range1D &rng, Range1D::Ordinal lbound, Range1D::Ordinal ubound)
Return a bounded index range from a potentially unbounded index range.
bool full_range() const
Returns true if the range represents the entire region.
Teuchos_Ordinal Index
Deprecated.
Ordinal size() const
Return the size of the range (ubound() - lbound() + 1)
Range1D & operator+=(Ordinal incr)
Increment the range by a constant.
Range1D operator+(Range1D::Ordinal i, const Range1D &rng_rhs)
rng_lhs = i + rng_rhs.
TEUCHOSCORE_LIB_DLL_EXPORT std::ostream & operator<<(std::ostream &out, const Range1D &rng)
Print out to ostream.
Range1D()
Construct a full range.
bool operator!=(const Range1D &rng1, const Range1D &rng2)
rng1 == rng2.
static const Range1D Invalid
Used for Range1D(INVALID)
Ordinal lbound() const
Return lower bound of the range.
bool in_range(Ordinal i) const
Return true if the index is in range.
Teuchos_Ordinal Ordinal
Deprecated.
Range1D operator-(const Range1D &rng_rhs, Range1D::Ordinal i)
rng_lhs = rng_rhs - i.
bool operator==(const Range1D &rng1, const Range1D &rng2)
rng1 == rng2.
Ordinal ubound() const
Return upper bound of the range.
#define TEUCHOS_ASSERT_INEQUALITY(val1, comp, val2)
This macro is checks that an inequality between two numbers is satisified and if not then throws a go...
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...