Analysis Software
Documentation for sPHENIX simulation software
|
A one-dimensional range between two points. More...
#include <acts/blob/sPHENIX/Core/include/Acts/Utilities/Range1D.hpp>
Public Member Functions | |
Range1D () | |
Construct a new degenerate range object. | |
Range1D (Type min, Type max) | |
Construct a new range object from a lower and upper bound. | |
Range1D (const std::pair< Type, Type > &p) | |
Construct a new range object from a pair of bounds. | |
Range1D (const Range1D< Type > &o) | |
Construct a new range object from an existing range. | |
void | setMin (const Type &v) |
Set the minimum value. | |
void | setMax (const Type &v) |
Set the maximum value. | |
void | set (const Type &min, const Type &max) |
Set the minimum and maximum value. | |
void | shrinkMin (const Type &v) |
Shrink a range by increasing the minimum value. | |
void | shrinkMax (const Type &v) |
Shrink a range by decreasing the maximum value. | |
void | shrink (const Type &min, const Type &max) |
Shrink a range on both ends. | |
void | expandMin (const Type &v) |
Expand a range by decreasing the minimum value. | |
void | expandMax (const Type &v) |
Expand a range by increasing the maximum value. | |
void | expand (const Type &min, const Type &max) |
Expand a range on both ends. | |
Type | min (void) const |
Return the minimum value of the range (inclusive) | |
Type | max (void) const |
Return the maximum value of the range (inclusive) | |
Type | size (void) const |
Compute the size of the range. | |
bool | degenerate (void) const |
Determine if this range is degenerate or not. | |
bool | contains (const Type &v) const |
Determine if the range contains a given value. | |
bool | operator&& (const Range1D< Type > &o) const |
Determine whether the range intersects another range. | |
bool | operator== (const Range1D< Type > &o) const |
Determine whether the range is equal to another range. | |
bool | operator<= (const Range1D< Type > &o) const |
Determine whether the left-hand range is a subset of the right-hand range. | |
bool | operator>= (const Range1D< Type > &o) const |
Determine whether the left-hand range is a superset of the right-hand range. | |
Range1D< Type > & | operator= (const Range1D< Type > &o) |
Assignment operator. | |
Range1D< Type > | operator& (const Range1D< Type > &o) const |
Compute the intersection of two ranges. | |
Range1D< Type > & | operator&= (const Range1D< Type > &o) |
Set the range to the intersection of itself and another range. | |
Private Attributes | |
Type | m_min |
Type | m_max |
A one-dimensional range between two points.
This type describes a one-demensional range of values, designed to be used in the construction of more complex multi-dimensional types. The class provides functionality for growing and shrinking the range, as well as some other utilities. These ranges are half-open, including the minimum but excluding the maximum.
Type | The scalar type of the values contained in this range. |
Definition at line 25 of file Range1D.hpp.
View newest version in sPHENIX GitHub at line 25 of file Range1D.hpp
|
inline |
Construct a new degenerate range object.
This constructor coonstructs a degenerate range object with a maximum lower than the minimum. In other words, this range is empty.
Definition at line 31 of file Range1D.hpp.
View newest version in sPHENIX GitHub at line 31 of file Range1D.hpp
|
inline |
Construct a new range object from a lower and upper bound.
Construct a new range object given the values for the minimum and maximum. Note that it is perfectly possible to construct a degenerate range in this way.
min | The minimum value in the range (inclusive) |
max | The maximum value in the range (exclusive) |
Definition at line 43 of file Range1D.hpp.
View newest version in sPHENIX GitHub at line 43 of file Range1D.hpp
|
inline |
Construct a new range object from a pair of bounds.
Construct a new range object from a pair of values, the first of which is taken to be the minimum, and the second of which is taken to be the maximum.
p | The pair of values to use as the minimum and maximum |
Definition at line 52 of file Range1D.hpp.
View newest version in sPHENIX GitHub at line 52 of file Range1D.hpp
|
inline |
Construct a new range object from an existing range.
This simply copies the values from the existing range to the new one. It's the copy constructor.
o | The range to copy |
Definition at line 60 of file Range1D.hpp.
View newest version in sPHENIX GitHub at line 60 of file Range1D.hpp
|
inline |
Determine if the range contains a given value.
A value is inside a range if and only if it is greater than the minimum and smaller than the maximum.
v | The value to check |
Definition at line 212 of file Range1D.hpp.
View newest version in sPHENIX GitHub at line 212 of file Range1D.hpp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().
|
inline |
Determine if this range is degenerate or not.
A degenerate range has a minimum higher than the maximum, and thus cannot contain any values.
Definition at line 201 of file Range1D.hpp.
View newest version in sPHENIX GitHub at line 201 of file Range1D.hpp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().
|
inline |
Expand a range on both ends.
Expand a range by decreasing the minimum value as well as increasing the maximum value. If either of the values are already larger or smaller (respectively) than the proposed values, then that particular boundary of the interval is not expanded.
min | The proposed new minimum for the range |
max | The proposed new maximum for the range |
Definition at line 167 of file Range1D.hpp.
View newest version in sPHENIX GitHub at line 167 of file Range1D.hpp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().
|
inline |
Expand a range by increasing the maximum value.
Expand the range by increasing the maximum value. If the given value is smaller than the current maximum (in other words, if the proposed new range would be smaller than the current range), this is a no-op.
v | The proposed new maximum for the range |
Definition at line 153 of file Range1D.hpp.
View newest version in sPHENIX GitHub at line 153 of file Range1D.hpp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), and Acts::Range1D< ActsScalar >::expand().
|
inline |
Expand a range by decreasing the minimum value.
Expand the range by decreasing the minimum value. If the given value is larger than the current minimum (in other words, if the proposed new range would be smaller than the current range), this is a no-op.
v | The proposed new minimum for the range |
Definition at line 144 of file Range1D.hpp.
View newest version in sPHENIX GitHub at line 144 of file Range1D.hpp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), Acts::Range1D< ActsScalar >::expand(), and Acts::Polyhedron::extent().
|
inline |
Return the maximum value of the range (inclusive)
Definition at line 176 of file Range1D.hpp.
View newest version in sPHENIX GitHub at line 176 of file Range1D.hpp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), Acts::SeedFinderOrthogonal< external_spacepoint_t >::createSeeds(), Acts::SeedFinder< external_spacepoint_t, platform_t >::createSeedsForGroup(), Acts::Extent::extend(), Acts::Range1D< ActsScalar >::operator&(), Acts::Range1D< ActsScalar >::operator&&(), Acts::Range1D< ActsScalar >::operator&=(), Acts::Range1D< ActsScalar >::operator<=(), Acts::Range1D< ActsScalar >::operator=(), Acts::Range1D< ActsScalar >::operator==(), Acts::Range1D< ActsScalar >::operator>=(), Acts::Range1D< ActsScalar >::set(), and Acts::to_json().
|
inline |
Return the minimum value of the range (inclusive)
Definition at line 173 of file Range1D.hpp.
View newest version in sPHENIX GitHub at line 173 of file Range1D.hpp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), Acts::Svg::IndexedSurfacesConverter::convertImpl(), Acts::SeedFinderOrthogonal< external_spacepoint_t >::createSeeds(), Acts::SeedFinder< external_spacepoint_t, platform_t >::createSeedsForGroup(), Acts::Extent::extend(), Acts::Range1D< ActsScalar >::operator&(), Acts::Range1D< ActsScalar >::operator&&(), Acts::Range1D< ActsScalar >::operator&=(), Acts::Range1D< ActsScalar >::operator<=(), Acts::Range1D< ActsScalar >::operator=(), Acts::Range1D< ActsScalar >::operator==(), Acts::Range1D< ActsScalar >::operator>=(), Acts::Range1D< ActsScalar >::set(), and Acts::to_json().
|
inline |
Compute the intersection of two ranges.
The intersection of two ranges is the range containing all values contained in both ranges. If the two ranges do not intersect, the intersection is a degenerate range. This operation is commutative.
o | The range to compute the intersection with |
Definition at line 300 of file Range1D.hpp.
View newest version in sPHENIX GitHub at line 300 of file Range1D.hpp
|
inline |
Determine whether the range intersects another range.
The intersection of a range is the space where both ranges overlap. If the ranges overlap at all, they are said to intersect. This operation is commutative.
o | The other range to check |
Definition at line 224 of file Range1D.hpp.
View newest version in sPHENIX GitHub at line 224 of file Range1D.hpp
|
inline |
Set the range to the intersection of itself and another range.
This is an assignment version of operator&, which updates the range on which it is called to ensure that the new range is the intersection of the old range and the new range.
o | The range to compute the intersection with |
Definition at line 313 of file Range1D.hpp.
View newest version in sPHENIX GitHub at line 313 of file Range1D.hpp
|
inline |
Determine whether the left-hand range is a subset of the right-hand range.
A range is a subset of another range if and only if all values contained in the first range are also contained in the second range.
o | The other range to check |
Definition at line 256 of file Range1D.hpp.
View newest version in sPHENIX GitHub at line 256 of file Range1D.hpp
|
inline |
Assignment operator.
Copy the right-hand range into the left-hand range, which means setting the minimum and maximum to equal the minimum and maximum of the right-hand side.
o | The range of values to copy |
Definition at line 284 of file Range1D.hpp.
View newest version in sPHENIX GitHub at line 284 of file Range1D.hpp
|
inline |
Determine whether the range is equal to another range.
Two ranges are equal if and only if their minima and maxima are the same.
o | The other range to check |
Definition at line 241 of file Range1D.hpp.
View newest version in sPHENIX GitHub at line 241 of file Range1D.hpp
|
inline |
Determine whether the left-hand range is a superset of the right-hand range.
A range is a superset of another range if and only if all values contained in the second range are also contained in the first range.
o | The other range to check |
Definition at line 271 of file Range1D.hpp.
View newest version in sPHENIX GitHub at line 271 of file Range1D.hpp
|
inline |
Set the minimum and maximum value.
Override both the minimum and maximum value of the range, regardless of what they were set to.
min | The new minimum value of the range |
max | The new maximum value of the range |
Definition at line 97 of file Range1D.hpp.
View newest version in sPHENIX GitHub at line 97 of file Range1D.hpp
Referenced by Acts::Test::BOOST_FIXTURE_TEST_CASE(), Acts::DD4hepLayerBuilder::centralLayers(), Acts::DD4hepLayerBuilder::endcapLayers(), Acts::Polyhedron::extent(), and Acts::Extent::set().
|
inline |
Set the maximum value.
Override the maximum value of the range, regardless of what was already set.
v | The value to use as the new maximum |
Definition at line 82 of file Range1D.hpp.
View newest version in sPHENIX GitHub at line 82 of file Range1D.hpp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), and Acts::from_json().
|
inline |
Set the minimum value.
Override the minimum value of the range, regardless of what was already set.
v | The value to use as the new minimum |
Definition at line 71 of file Range1D.hpp.
View newest version in sPHENIX GitHub at line 71 of file Range1D.hpp
Referenced by Acts::Extent::addConstrain(), Acts::Test::BOOST_AUTO_TEST_CASE(), Acts::Polyhedron::extent(), and Acts::from_json().
|
inline |
Shrink a range on both ends.
Shrink a range by increasing the minimum value as well as decreasing the maximum value. If either of the values are already smaller or larger (respectively) than the proposed values, then that particular boundary of the interval is not shrunk.
min | The proposed new minimum for the range |
max | The proposed new maximum for the range |
Definition at line 132 of file Range1D.hpp.
View newest version in sPHENIX GitHub at line 132 of file Range1D.hpp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().
|
inline |
Shrink a range by decreasing the maximum value.
Shrink the range by decreasing the maximum value. If the given value is larger than the current maximum (in other words, if the proposed new range would be larger than the current range), this is a no-op.
v | The proposed new maximum for the range |
Definition at line 118 of file Range1D.hpp.
View newest version in sPHENIX GitHub at line 118 of file Range1D.hpp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), and Acts::Range1D< ActsScalar >::shrink().
|
inline |
Shrink a range by increasing the minimum value.
Shrink the range by increasing the minimum value. If the given value is smaller than the current minimum (in other words, if the proposed new range would be larger than the current range), this is a no-op.
v | The proposed new minimum for the range |
Definition at line 109 of file Range1D.hpp.
View newest version in sPHENIX GitHub at line 109 of file Range1D.hpp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), and Acts::Range1D< ActsScalar >::shrink().
|
inline |
Compute the size of the range.
The size of a range is defined as the difference between the minimum and the maximum. For degenerate ranges, this is zero.
Definition at line 190 of file Range1D.hpp.
View newest version in sPHENIX GitHub at line 190 of file Range1D.hpp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().
|
private |
Definition at line 321 of file Range1D.hpp.
View newest version in sPHENIX GitHub at line 321 of file Range1D.hpp
Referenced by Acts::Range1D< ActsScalar >::contains(), Acts::Range1D< ActsScalar >::degenerate(), Acts::Range1D< ActsScalar >::expandMax(), Acts::Range1D< ActsScalar >::max(), Acts::Range1D< ActsScalar >::operator&(), Acts::Range1D< ActsScalar >::operator&&(), Acts::Range1D< ActsScalar >::operator&=(), Acts::Range1D< ActsScalar >::operator=(), Acts::Range1D< ActsScalar >::set(), Acts::Range1D< ActsScalar >::setMax(), Acts::Range1D< ActsScalar >::shrinkMax(), and Acts::Range1D< ActsScalar >::size().
|
private |
Definition at line 321 of file Range1D.hpp.
View newest version in sPHENIX GitHub at line 321 of file Range1D.hpp
Referenced by Acts::Range1D< ActsScalar >::contains(), Acts::Range1D< ActsScalar >::degenerate(), Acts::Range1D< ActsScalar >::expandMin(), Acts::Range1D< ActsScalar >::min(), Acts::Range1D< ActsScalar >::operator&(), Acts::Range1D< ActsScalar >::operator&&(), Acts::Range1D< ActsScalar >::operator&=(), Acts::Range1D< ActsScalar >::operator=(), Acts::Range1D< ActsScalar >::set(), Acts::Range1D< ActsScalar >::setMin(), Acts::Range1D< ActsScalar >::shrinkMin(), and Acts::Range1D< ActsScalar >::size().