15 #include <OpenMS/config.h>
40 template<
typename Value>
83 for (i = 1; i < j; i++)
128 for (i = 1; i < j; i++)
193 if (i == j) {
return 0; }
194 if (i < j) { std::swap(i, j); }
209 if (i == j) {
return 0; }
210 if (i < j) { std::swap(i, j); }
228 if (i < j) { std::swap(i, j); }
265 if (i < j) { std::swap(i, j); }
396 for (
Size j = 0; j < i; ++j)
444 template<
typename Value>
451 std::streamsize precision_backup = os.precision(6);
452 auto width_backup = os.width(8);
460 os <<
red(matrix(i, j)) <<
'\t';
464 os << matrix(i, j) <<
'\t';
470 os.precision(precision_backup);
471 os.width(width_backup);
A two-dimensional distance matrix, similar to OpenMS::Matrix.
Definition: DistanceMatrix.h:42
SizeType dimensionsize() const
gives the number of rows (i.e. number of columns)
Definition: DistanceMatrix.h:360
Value value_type
Definition: DistanceMatrix.h:46
std::ostream & operator<<(std::ostream &os, const DistanceMatrix< Value > &matrix)
Print the contents to a stream (and colors the diagonal, if the stream is cout/cerr)
Definition: DistanceMatrix.h:445
DistanceMatrix()
default constructor
Definition: DistanceMatrix.h:58
bool operator==(DistanceMatrix< ValueType > const &rhs) const
Equality comparator.
Definition: DistanceMatrix.h:391
void setValue(SizeType i, SizeType j, ValueType value)
sets a value at a given position:
Definition: DistanceMatrix.h:222
void updateMinElement()
keep track of the actual minimum element after altering the matrix
Definition: DistanceMatrix.h:370
std::pair< SizeType, SizeType > getMinElementCoordinates() const
Indexpair of minimal element.
Definition: DistanceMatrix.h:409
const ValueType getValue(SizeType i, SizeType j) const
gets a value at a given position:
Definition: DistanceMatrix.h:189
ValueType getValue(SizeType i, SizeType j)
gets a value at a given position:
Definition: DistanceMatrix.h:205
const ValueType operator()(SizeType i, SizeType j) const
gets a value at a given position (read only):
Definition: DistanceMatrix.h:166
DistanceMatrix(const DistanceMatrix &source)
copy constructor
Definition: DistanceMatrix.h:114
Size SizeType
Definition: DistanceMatrix.h:51
std::pair< SizeType, SizeType > min_element_
index of minimal element(i.e. number in underlying SparseVector)
Definition: DistanceMatrix.h:423
ValueType operator()(SizeType i, SizeType j)
gets a value at a given position (read only):
Definition: DistanceMatrix.h:177
ValueType ** matrix_
sparse element not to be included in base container
Definition: DistanceMatrix.h:417
void setValueQuick(SizeType i, SizeType j, ValueType value)
sets a value at a given position:
Definition: DistanceMatrix.h:259
value_type ValueType
Definition: DistanceMatrix.h:52
~DistanceMatrix()
destructor
Definition: DistanceMatrix.h:151
SizeType init_size_
number of actually stored rows
Definition: DistanceMatrix.h:419
DistanceMatrix(SizeType dimensionsize, Value value=Value())
detailed constructor
Definition: DistanceMatrix.h:69
DistanceMatrix & operator=(const DistanceMatrix &rhs)
assignment operator (unsafe)
Definition: DistanceMatrix.h:427
void clear()
reset all
Definition: DistanceMatrix.h:271
SizeType dimensionsize_
number of accessibly stored rows (i.e. number of columns)
Definition: DistanceMatrix.h:421
void resize(SizeType dimensionsize, Value value=Value())
resizing the container
Definition: DistanceMatrix.h:293
void reduce(SizeType j)
reduces DistanceMatrix by one dimension. first the jth row, then jth column
Definition: DistanceMatrix.h:342
Out of memory exception.
Definition: Exception.h:428
Out of range exception.
Definition: Exception.h:290
unsigned int UInt
Unsigned integer type.
Definition: Types.h:64
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:97
#define OPENMS_PRECONDITION(condition, message)
Precondition macro.
Definition: openms/include/OpenMS/CONCEPT/Macros.h:94
const double k
Definition: Constants.h:132
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19