#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 of kImplicit is specified, but do not constrain explicitly specified start/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 IndexIntervalinterval() const;
IndexIntervalinterval();

Returns the base interval.

bool implicit_lower() const;
boolimplicit_lower();

Indicates if the lower bound of interval is “implicit”.

bool implicit_upper() const;
boolimplicit_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::ostreamos,
           
const OptionallyImplicitIndexIntervalx);

Prints a string representation of x to os.

friend bool operator==(const OptionallyImplicitIndexIntervala,
                       
const OptionallyImplicitIndexIntervalb);
friend bool operator!=(const OptionallyImplicitIndexIntervala,
                       
const OptionallyImplicitIndexIntervalb);

Compares two intervals for equality.

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, or ExtractHalfOpenStridedSlice depending on the value of interval_form.

absl::Status tensorstore::ComputeStridedSliceMap(
    
OptionallyImplicitIndexInterval orig,
    
IntervalForm interval_form,
    
Index translate_origin_to,
    
Index start,
    
Index stop_or_size,
    
Index stride,
    
OptionallyImplicitIndexIntervalnew_domain,
    
Indexoutput_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() and interval.implicit_upper() to the output space.