|
ACTS
Experiment-independent tracking
|
An orthogonal range in an arbitrary number of dimensions. More...
#include <Acts/Utilities/RangeXD.hpp>
Public Member Functions | |
| RangeXD () | |
| RangeXD (const std::pair< Type, Type > &p) | |
| Construct a range from a pair of minimum and maximum values. | |
| RangeXD (Type minimum, Type maximum) | |
| Construct a range from a pair of single minimum and maximum values. | |
| RangeXD (Vector< Type, Dims > minima, Vector< Type, Dims > maxima) | |
| Construct a range from a pair of minimum and maximum values. | |
| template<template< typename, std::size_t > typename coordinate_t = std::array> | |
| bool | contains (const coordinate_t< Type, Dims > &v) const |
| Determine whether the range contains a certain point. | |
| bool | degenerate () const |
| Determine whether this range is degenerate. | |
| void | expand (std::size_t i, const Type &min, const Type &max) |
| Expand a range on both ends. | |
| void | expandMax (std::size_t i, const Type &v) |
| Expand a range by increasing the maximum value. | |
| void | expandMin (std::size_t i, const Type &v) |
| Expand a range by decreasing the minimum value. | |
| Type & | max (std::size_t i) |
Return the maximum value of the range i (inclusive). | |
| Type | max (std::size_t i) const |
Return the maximum value of the range i (inclusive). | |
| Type & | min (std::size_t i) |
Return the minimum value of the range i (inclusive). | |
| Type | min (std::size_t i) const |
Return the minimum value of the range i (inclusive). | |
| RangeXD< Dims, Type, Vector > | operator& (const RangeXD< Dims, Type, Vector > &o) const |
| Compute the intersection of this range with another range. | |
| bool | operator&& (const RangeXD< Dims, Type, Vector > &r) const |
| Determine whether this range intersects another. | |
| RangeXD< Dims, Type, Vector > & | operator&= (const RangeXD< Dims, Type, Vector > &o) |
| Update the range to the intersection with another range. | |
| bool | operator<= (const RangeXD< Dims, Type, Vector > &o) const |
| Determine whether one range is a subset of another range. | |
| template<template< typename, std::size_t > typename V> | |
| RangeXD & | operator= (const RangeXD< Dims, Type, V > &o) |
| Assignment operator. | |
| bool | operator== (const RangeXD< Dims, Type, Vector > &o) const |
| Determine whether two ranges are equal. | |
| bool | operator>= (const RangeXD< Dims, Type, Vector > &o) const |
| Determine whether one range is a superset of another range. | |
| RangeXD< 1, Type, SingleElementContainer > | operator[] (const std::size_t &i) |
| Access one of the dimensional ranges of the volume. | |
| RangeXD< 1, Type > | operator[] (const std::size_t &i) const |
| Access one of the dimensional ranges of the volume. | |
| void | set (std::size_t i, const Type &min, const Type &max) |
| Set the minimum and maximum value. | |
| void | setMax (std::size_t i, const Type &v) |
| Set the maximum value. | |
| void | setMin (std::size_t i, const Type &v) |
| Set the minimum value. | |
| void | shrink (std::size_t i, const Type &min, const Type &max) |
| Shrink a range on both ends. | |
| void | shrinkMax (std::size_t i, const Type &v) |
| Shrink a range by decreasing the maximum value. | |
| void | shrinkMin (std::size_t i, const Type &v) |
| Shrink a range by increasing the minimum value. | |
| std::string | toString (void) const |
| Represent the range as a string. | |
| void | expandMin (const Type &v) |
| Methods for manipulating a range of dimension 1. | |
| 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. | |
| 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 | 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. | |
| Type | min () const |
| Return the minimum value of the range (inclusive). | |
| Type & | min () |
| Return the minimum value of the range (inclusive). | |
| Type | max () const |
| Return the maximum value of the range (inclusive). | |
| Type & | max () |
| Return the maximum value of the range (inclusive). | |
| Type | size () const |
| Compute the size of the range. | |
| bool | contains (const Type &v) const |
| Determine if the range contains a given value. | |
An orthogonal range in an arbitrary number of dimensions.
By combining a number one-dimensional ranges we can (under the assumption that our axes are orthogonal) construct an orthogonal range of values. In other words, a hyperrectangular volume in space.
| Dims | The number of dimensions in our range |
| Type | The scalar type of our ranges |
| Vector | The vector type used to define coordinates |
| Acts::RangeXD< Dims, Type, Vector >::RangeXD | ( | ) |
| Acts::RangeXD< Dims, Type, Vector >::RangeXD | ( | Vector< Type, Dims > | minima, |
| Vector< Type, Dims > | maxima ) |
Construct a range from a pair of minimum and maximum values.
| minima | The minimum values of the range |
| maxima | The maximum values of the range |
| Acts::RangeXD< Dims, Type, Vector >::RangeXD | ( | Type | minimum, |
| Type | maximum ) |
Construct a range from a pair of single minimum and maximum values.
| minimum | The minimum value of the range |
| maximum | The maximum value of the range |
|
explicit |
Construct a range from a pair of minimum and maximum values.
| p | The pair of minimum and maximum values |
| bool Acts::RangeXD< Dims, Type, Vector >::contains | ( | const coordinate_t< Type, Dims > & | v | ) | const |
Determine whether the range contains a certain point.
This is true if and only if the range contains the point in all of its dimensions.
| v | The coordinate to check for membership in the range |
| bool Acts::RangeXD< Dims, Type, Vector >::contains | ( | const Type & | v | ) | const |
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 |
| bool Acts::RangeXD< Dims, Type, Vector >::degenerate | ( | ) | const |
Determine whether this range is degenerate.
A degenerate multi-dimensional range has no volume and cannot contain any values. This is the case if any of its dimensions are degenerate.
| void Acts::RangeXD< Dims, Type, Vector >::expand | ( | const Type & | min, |
| const Type & | max ) |
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 |
| void Acts::RangeXD< Dims, Type, Vector >::expand | ( | std::size_t | i, |
| const Type & | min, | ||
| const Type & | max ) |
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.
| i | The index of the dimension to expand |
| min | The proposed new minimum for the range |
| max | The proposed new maximum for the range |
| void Acts::RangeXD< Dims, Type, Vector >::expandMax | ( | const Type & | v | ) |
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 |
| void Acts::RangeXD< Dims, Type, Vector >::expandMax | ( | std::size_t | i, |
| const Type & | v ) |
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.
| i | The index of the dimension to expand |
| v | The proposed new maximum for the range |
| void Acts::RangeXD< Dims, Type, Vector >::expandMin | ( | const Type & | v | ) |
Methods for manipulating a range of dimension 1.
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 |
| void Acts::RangeXD< Dims, Type, Vector >::expandMin | ( | std::size_t | i, |
| const Type & | v ) |
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.
| i | The index of the dimension to expand |
| v | The proposed new minimum for the range |
| Type & Acts::RangeXD< Dims, Type, Vector >::max | ( | ) |
Return the maximum value of the range (inclusive).
| Type Acts::RangeXD< Dims, Type, Vector >::max | ( | ) | const |
Return the maximum value of the range (inclusive).
| Type & Acts::RangeXD< Dims, Type, Vector >::max | ( | std::size_t | i | ) |
Return the maximum value of the range i (inclusive).
| i | The index of the dimension to access |
| Type Acts::RangeXD< Dims, Type, Vector >::max | ( | std::size_t | i | ) | const |
Return the maximum value of the range i (inclusive).
| i | The index of the dimension to access |
| Type & Acts::RangeXD< Dims, Type, Vector >::min | ( | ) |
Return the minimum value of the range (inclusive).
| Type Acts::RangeXD< Dims, Type, Vector >::min | ( | ) | const |
Return the minimum value of the range (inclusive).
| Type & Acts::RangeXD< Dims, Type, Vector >::min | ( | std::size_t | i | ) |
Return the minimum value of the range i (inclusive).
| i | The index of the dimension to access |
| Type Acts::RangeXD< Dims, Type, Vector >::min | ( | std::size_t | i | ) | const |
Return the minimum value of the range i (inclusive).
| i | The index of the dimension to access |
| RangeXD< Dims, Type, Vector > Acts::RangeXD< Dims, Type, Vector >::operator& | ( | const RangeXD< Dims, Type, Vector > & | o | ) | const |
Compute the intersection of this range with another range.
The intersection of one orthogonal range with another orthogonal range is in itself an orthogonal range. This operation is commutative. This intersection between two n-dimensional ranges is defined simply as the intersection in each dimension of the two ranges.
| o | The orthogonal range to compute the intersection with |
| bool Acts::RangeXD< Dims, Type, Vector >::operator&& | ( | const RangeXD< Dims, Type, Vector > & | r | ) | const |
Determine whether this range intersects another.
Two n-dimensional ranges intersect if and only if they intersect in every one of their n dimensions. Otherwise, they are disjoint.
| r | The other range to check |
| RangeXD< Dims, Type, Vector > & Acts::RangeXD< Dims, Type, Vector >::operator&= | ( | const RangeXD< Dims, Type, Vector > & | o | ) |
Update the range to the intersection with another range.
This is the assignment version of the operator& method, meaning that it updates the object on which it is called rather than producing a new range.
| o | The range to compute the intersection with |
| bool Acts::RangeXD< Dims, Type, Vector >::operator<= | ( | const RangeXD< Dims, Type, Vector > & | o | ) | const |
Determine whether one range is a subset of another range.
One range is a subset of another range if and only if all points contained within the first set are also contained within the second set. Alternatively, this is equivalent to each of the first range's one-dimensional ranges being a subset of the second range's equivalent one-dimensional range.
| o | The other range to compare to |
| RangeXD & Acts::RangeXD< Dims, Type, Vector >::operator= | ( | const RangeXD< Dims, Type, V > & | o | ) |
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 |
| bool Acts::RangeXD< Dims, Type, Vector >::operator== | ( | const RangeXD< Dims, Type, Vector > & | o | ) | const |
Determine whether two ranges are equal.
Two n-dimensional ranges are equal if and only if they are equal in each of their n dimensions.
| o | The other range to check for equality |
| bool Acts::RangeXD< Dims, Type, Vector >::operator>= | ( | const RangeXD< Dims, Type, Vector > & | o | ) | const |
Determine whether one range is a superset of another range.
One range is a superset of another range if and only if all points contained within the second range are also contained within the first range. Alternatively, this is equivalent to each of the one-dimensional ranges in the first range being a superset of the corresponding one-dimensional range in the second range.
| o | The other range to compare to |
| RangeXD< 1, Type, SingleElementContainer > Acts::RangeXD< Dims, Type, Vector >::operator[] | ( | const std::size_t & | i | ) |
Access one of the dimensional ranges of the volume.
| i | The index of the dimension to access |
| RangeXD< 1, Type > Acts::RangeXD< Dims, Type, Vector >::operator[] | ( | const std::size_t & | i | ) | const |
Access one of the dimensional ranges of the volume.
| i | The index of the dimension to access |
| void Acts::RangeXD< Dims, Type, Vector >::set | ( | const Type & | min, |
| const Type & | max ) |
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 |
| void Acts::RangeXD< Dims, Type, Vector >::set | ( | std::size_t | i, |
| const Type & | min, | ||
| const Type & | max ) |
Set the minimum and maximum value.
Override both the minimum and maximum value of the range, regardless of what they were set to.
| i | The index of the dimension to set |
| min | The new minimum value of the range |
| max | The new maximum value of the range |
| void Acts::RangeXD< Dims, Type, Vector >::setMax | ( | const Type & | v | ) |
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 |
| void Acts::RangeXD< Dims, Type, Vector >::setMax | ( | std::size_t | i, |
| const Type & | v ) |
Set the maximum value.
Override the maximum value of the range, regardless of what was already set.
| i | The index of the dimension to set |
| v | The value to use as the new maximum |
| void Acts::RangeXD< Dims, Type, Vector >::setMin | ( | const Type & | v | ) |
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 |
| void Acts::RangeXD< Dims, Type, Vector >::setMin | ( | std::size_t | i, |
| const Type & | v ) |
Set the minimum value.
Override the minimum value of the range, regardless of what was already set.
| i | The index of the dimension to set |
| v | The value to use as the new minimum |
| void Acts::RangeXD< Dims, Type, Vector >::shrink | ( | const Type & | min, |
| const Type & | max ) |
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 |
| void Acts::RangeXD< Dims, Type, Vector >::shrink | ( | std::size_t | i, |
| const Type & | min, | ||
| const Type & | max ) |
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.
| i | The index of the dimension to shrink |
| min | The proposed new minimum for the range |
| max | The proposed new maximum for the range |
| void Acts::RangeXD< Dims, Type, Vector >::shrinkMax | ( | const Type & | v | ) |
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 |
| void Acts::RangeXD< Dims, Type, Vector >::shrinkMax | ( | std::size_t | i, |
| const Type & | v ) |
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.
| i | The index of the dimension to shrink |
| v | The proposed new maximum for the range |
| void Acts::RangeXD< Dims, Type, Vector >::shrinkMin | ( | const Type & | v | ) |
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 |
| void Acts::RangeXD< Dims, Type, Vector >::shrinkMin | ( | std::size_t | i, |
| const Type & | v ) |
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.
| i | The index of the dimension to shrink |
| v | The proposed new minimum for the range |
| Type Acts::RangeXD< Dims, Type, Vector >::size | ( | ) | const |
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.
| std::string Acts::RangeXD< Dims, Type, Vector >::toString | ( | void | ) | const |
Represent the range as a string.
This method produces a helpful string that can be used to debug the range if needed. Not really designed to be used in production code.