126 static_assert(D == 2);
177 for (
UInt i = 0; i != D; i++)
179 if (position[i] <
min_[i])
return false;
181 if (position[i] >=
max_[i])
return false;
189 if (x <
min_[0])
return false;
191 if (x >=
max_[0])
return false;
193 if (y <
min_[1])
return false;
195 if (y >=
max_[1])
return false;
210 for (
Size i = 0; i != D; ++i)
212 united_min[i] =
min_[i] < other_min[i] ?
min_[i] : other_min[i];
213 united_max[i] =
max_[i] > other_max[i] ?
max_[i] : other_max[i];
215 united_range.
setMinMax(united_min, united_max);
231 for (
Size i = 0; i != D; i++)
242 for (
Size i = 0; i != D; i++)
251 for (
Size i = 0; i != D; i++)
277 for (
Size i = 0; i != D; i++)
286 for (
Size i = 0; i != D; i++)
315 for (
UInt i = 0; i != D; ++i)
341 for (
UInt i = 0; i != D; ++i)
352 for (
UInt i = 0; i != D; ++i)
355 if (
max_[i] -
min_[i] < min_span[i])
357 extend_by[i] = min_span[i] - (
max_[i] -
min_[i]);
379 for (
UInt i = 0; i != D; ++i)
381 point[i] = std::max(
min_[i], std::min(point[i],
max_[i]));
392 os <<
"--DRANGE BEGIN--\n";
393 os <<
"MIN --> " << area.
min_ <<
'\n';
394 os <<
"MAX --> " << area.
max_ <<
'\n';
395 os <<
"--DRANGE END--\n";
Representation of a coordinate in D-dimensional space.
Definition: DPosition.h:55
A D-dimensional half-open interval.
Definition: DRange.h:62
PositionType min_
lower left point
Definition: DIntervalBase.h:362
bool encloses(const PositionType &position) const
Checks whether this range contains a certain point.
Definition: DRange.h:175
DRange< D > & ensureMinSpan(typename Base::PositionType min_span)
Definition: DRange.h:349
Base::PositionType PositionType
Position type.
Definition: DRange.h:74
DRange< D > & extend(double factor)
Extends the range in all dimensions by a certain multiplier.
Definition: DRange.h:308
PositionType max_
upper right point
Definition: DIntervalBase.h:365
DRangeIntersection
Types that describe the kind of intersection between two ranges.
Definition: DRange.h:79
@ Disjoint
No intersection.
Definition: DRange.h:80
@ Inside
One contains the other.
Definition: DRange.h:82
@ Intersects
Intersection.
Definition: DRange.h:81
DRange united(const DRange< D > &other_range) const
Returns the smallest range containing this range and other_range.
Definition: DRange.h:201
bool encloses(CoordinateType x, CoordinateType y) const
2D-version of encloses for convenience only
Definition: DRange.h:187
DRange()
Default constructor.
Definition: DRange.h:97
bool operator==(const Base &rhs) const
Equality operator.
Definition: DRange.h:164
DRange(const PositionType &lower, const PositionType &upper)
Constructor that takes two Points and constructs a range.
Definition: DRange.h:103
DRange(DRange &&) noexcept=default
Move constructor.
~DRange()
Destructor.
Definition: DRange.h:149
DRange & operator=(const Base &rhs)
Assignment operator for the base class.
Definition: DRange.h:142
DRangeIntersection intersects(const DRange &range) const
Checks how this range intersects with another range.
Definition: DRange.h:225
DRange(const DRange &range)
Copy constructor.
Definition: DRange.h:109
Internal::DIntervalBase< D > Base
Base class type.
Definition: DRange.h:72
Base::CoordinateType CoordinateType
Coordinate type of the positions.
Definition: DRange.h:76
DRange< D > & swapDimensions()
swaps dimensions for 2D data (i.e. x and y coordinates)
Definition: DRange.h:365
DRange(CoordinateType minx, CoordinateType miny, CoordinateType maxx, CoordinateType maxy)
Convenient constructor for DRange<2>
Definition: DRange.h:124
void pullIn(DPosition< D > &point) const
Make sure point is inside the current area.
Definition: DRange.h:377
DRange< D > & extend(typename Base::PositionType addition)
Extends the range in all dimensions by a certain amount.
Definition: DRange.h:336
@ DIMENSION
Definition: DRange.h:70
bool operator==(const DRange &rhs) const
Equality operator.
Definition: DRange.h:158
DRange & operator=(const DRange &rhs)
Assignment operator.
Definition: DRange.h:135
bool isIntersected(const DRange &range) const
Checks whether this range intersects with another range.
Definition: DRange.h:267
Exception indicating that an invalid parameter was handed over to an algorithm.
Definition: Exception.h:341
A base class for D-dimensional interval.
Definition: DIntervalBase.h:56
PositionType min_
lower left point
Definition: DIntervalBase.h:362
DIntervalBase & operator=(const DIntervalBase &rhs)
Assignment operator.
Definition: DIntervalBase.h:96
PositionType::CoordinateType CoordinateType
Coordinate type of the positions.
Definition: DIntervalBase.h:68
PositionType const & maxPosition() const
Accessor to maximum position.
Definition: DIntervalBase.h:130
PositionType max_
upper right point
Definition: DIntervalBase.h:365
bool operator==(const DIntervalBase &rhs) const
Equality operator.
Definition: DIntervalBase.h:195
DPosition< D > PositionType
Position type.
Definition: DIntervalBase.h:66
void setMinMax(PositionType const &min, PositionType const &max)
Mutator for minimum and maximum position.
Definition: DIntervalBase.h:168
void normalize_()
normalization to keep all dimensions in the right geometrical order (min_[X] < max_[X])
Definition: DIntervalBase.h:368
PositionType const & minPosition() const
Accessor to minimum position.
Definition: DIntervalBase.h:124
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:48
std::ostream & operator<<(std::ostream &os, const AccurateMassSearchResult &amsr)