WPILibC++ 2025.1.1
Loading...
Searching...
No Matches
sleipnir::Slice Class Reference

#include </home/runner/work/allwpilib/allwpilib/wpimath/src/main/native/thirdparty/sleipnir/include/sleipnir/autodiff/Slice.hpp>

Public Member Functions

constexpr Slice ()=default
 Constructs a Slice.
 
template<typename Stop >
requires std::same_as<Stop, slicing::none_t> || std::convertible_to<Stop, int>
constexpr Slice (Stop stop)
 Constructs a slice.
 
template<typename Start , typename Stop >
requires (std::same_as<Start, slicing::none_t> || std::convertible_to<Start, int>) && (std::same_as<Stop, slicing::none_t> || std::convertible_to<Stop, int>)
constexpr Slice (Start start, Stop stop)
 Constructs a slice.
 
template<typename Start , typename Stop , typename Step >
requires (std::same_as<Start, slicing::none_t> || std::convertible_to<Start, int>) && (std::same_as<Stop, slicing::none_t> || std::convertible_to<Stop, int>) && (std::same_as<Step, slicing::none_t> || std::convertible_to<Step, int>)
constexpr Slice (Start start, Stop stop, Step step)
 Constructs a slice.
 
constexpr int Adjust (int length)
 Adjusts start and end slice indices assuming a sequence of the specified length.
 

Public Attributes

int start = 0
 Start index (inclusive).
 
int stop = 0
 Stop index (exclusive).
 
int step = 1
 Step.
 

Constructor & Destructor Documentation

◆ Slice() [1/4]

sleipnir::Slice::Slice ( )
constexprdefault

Constructs a Slice.

◆ Slice() [2/4]

template<typename Stop >
requires std::same_as<Stop, slicing::none_t> || std::convertible_to<Stop, int>
sleipnir::Slice::Slice ( Stop stop)
inlineconstexpr

Constructs a slice.

Parameters
stopSlice stop index (exclusive).

◆ Slice() [3/4]

template<typename Start , typename Stop >
requires (std::same_as<Start, slicing::none_t> || std::convertible_to<Start, int>) && (std::same_as<Stop, slicing::none_t> || std::convertible_to<Stop, int>)
sleipnir::Slice::Slice ( Start start,
Stop stop )
inlineconstexpr

Constructs a slice.

Parameters
startSlice start index (inclusive).
stopSlice stop index (exclusive).

◆ Slice() [4/4]

template<typename Start , typename Stop , typename Step >
requires (std::same_as<Start, slicing::none_t> || std::convertible_to<Start, int>) && (std::same_as<Stop, slicing::none_t> || std::convertible_to<Stop, int>) && (std::same_as<Step, slicing::none_t> || std::convertible_to<Step, int>)
sleipnir::Slice::Slice ( Start start,
Stop stop,
Step step )
inlineconstexpr

Constructs a slice.

Parameters
startSlice start index (inclusive).
stopSlice stop index (exclusive).
stepSlice step.

Member Function Documentation

◆ Adjust()

int sleipnir::Slice::Adjust ( int length)
inlineconstexpr

Adjusts start and end slice indices assuming a sequence of the specified length.

Parameters
lengthThe sequence length.
Returns
The slice length.

Member Data Documentation

◆ start

int sleipnir::Slice::start = 0

Start index (inclusive).

◆ step

int sleipnir::Slice::step = 1

Step.

◆ stop

int sleipnir::Slice::stop = 0

Stop index (exclusive).


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