-
#include "tensorstore/index_interval.h"
-
class tensorstore::OptionallyImplicitIndexInterval
: public IndexInterval; Represents an IndexInterval where the lower/upper bounds may be “implicit”.
When slicing, implicit bounds are used as the default bound if a
start
/stop
/size
value ofkImplicit
is specified, but do not constrain explicitly specifiedstart
/stop
/size
values.Constructors¶
- constexpr OptionallyImplicitIndexInterval();
Constructs an infinite interval with implicit bounds.
-
constexpr OptionallyImplicitIndexInterval(IndexInterval interval,
bool implicit_lower,
bool implicit_upper); Constructs an interval with the specified bounds.
Accessors¶
- const IndexInterval& interval() const;
- IndexInterval& interval();
Returns the base interval.
- bool implicit_lower() const;
- bool& implicit_lower();
Indicates if the lower bound of
interval
is “implicit”.
- bool implicit_upper() const;
- bool& implicit_upper();
Indicates if the upper bound of
interval
is “implicit”.
- IndexInterval effective_interval() const;
Returns the interval containing the effective bounds.
Friend functions¶
-
friend std::ostream&
operator<<(std::ostream& os,
const OptionallyImplicitIndexInterval& x);
-
friend bool operator==(const OptionallyImplicitIndexInterval& a,
const OptionallyImplicitIndexInterval& b); -
friend bool operator!=(const OptionallyImplicitIndexInterval& a,
const OptionallyImplicitIndexInterval& b); Compares two intervals for equality.
Related Functions¶
-
OptionallyImplicitIndexInterval
tensorstore::Hull(OptionallyImplicitIndexInterval a,
OptionallyImplicitIndexInterval b); Computes the hull of two index intervals.
-
OptionallyImplicitIndexInterval
tensorstore::Intersect(OptionallyImplicitIndexInterval a,
OptionallyImplicitIndexInterval b); Intersects two index intervals.
-
OptionallyImplicitIndexInterval
tensorstore::IntersectPreferringExplicit(
OptionallyImplicitIndexInterval a,
OptionallyImplicitIndexInterval b); Intersects two index intervals, preferring explicit bounds when implicit flags mismatch.
-
Result<OptionallyImplicitIndexInterval>
tensorstore::MergeOptionallyImplicitIndexIntervals(
OptionallyImplicitIndexInterval a,
OptionallyImplicitIndexInterval b); Merges two index intervals.
-
Result<std::pair<OptionallyImplicitIndexInterval, Index>>
tensorstore::ExtractHalfOpenStridedSlice(
OptionallyImplicitIndexInterval orig,
Index start,
Index stop,
Index stride); Extracts a strided half-open interval from a containing interval.
-
Result<std::pair<OptionallyImplicitIndexInterval, Index>>
tensorstore::ExtractClosedStridedSlice(
OptionallyImplicitIndexInterval orig,
Index start,
Index stop,
Index stride); Extracts a strided closed interval from a containing interval.
-
Result<std::pair<OptionallyImplicitIndexInterval, Index>>
tensorstore::ExtractSizedStridedSlice(
OptionallyImplicitIndexInterval orig,
Index start,
Index size,
Index stride); Extracts a strided interval of the specified size from a containing interval.
-
Result<std::pair<OptionallyImplicitIndexInterval, Index>>
tensorstore::ExtractStridedSlice(OptionallyImplicitIndexInterval orig,
IntervalForm interval_form,
Index start,
Index stop_or_size,
Index stride); Equivalent to
ExtractHalfOpenStridedSlice
,ExtractHalfOpenStridedSlice
, orExtractHalfOpenStridedSlice
depending on the value ofinterval_form
.
-
absl::Status tensorstore::ComputeStridedSliceMap(
OptionallyImplicitIndexInterval orig,
IntervalForm interval_form,
Index translate_origin_to,
Index start,
Index stop_or_size,
Index stride,
OptionallyImplicitIndexInterval* new_domain,
Index* output_offset); Computes a mapping from the specified interval back to the original domain.
-
Result<OptionallyImplicitIndexInterval>
tensorstore::GetAffineTransformRange(
OptionallyImplicitIndexInterval interval,
Index offset,
Index multiplier); Same as above, but also propagates
interval.implicit_lower()
andinterval.implicit_upper()
to the output space.