40 #include <OpenMS/config.h>
66 template <
typename Value>
108 for (i = 1; i < j; i++)
152 for (i = 1; i < j; i++)
460 for (
Size j = 0; j < i; ++j)
514 template <
typename Value>
519 std::ios_base::fmtflags flag_backup = os.setf(std::ios::scientific);
520 std::streamsize precision_backup = os.precision();
529 os << matrix(i, j) <<
'\t';
533 os.flags(flag_backup);
534 os.precision(precision_backup);
A two-dimensional distance matrix, similar to OpenMS::Matrix.
Definition: DistanceMatrix.h:68
SizeType dimensionsize() const
gives the number of rows (i.e. number of columns)
Definition: DistanceMatrix.h:418
Value value_type
Definition: DistanceMatrix.h:73
std::ostream & operator<<(std::ostream &os, const DistanceMatrix< Value > &matrix)
Print the contents to a stream.
Definition: DistanceMatrix.h:515
DistanceMatrix()
default constructor
Definition: DistanceMatrix.h:85
bool operator==(DistanceMatrix< ValueType > const &rhs) const
Equality comparator.
Definition: DistanceMatrix.h:455
void setValue(SizeType i, SizeType j, ValueType value)
sets a value at a given position:
Definition: DistanceMatrix.h:263
void updateMinElement()
keep track of the actual minimum element after altering the matrix
Definition: DistanceMatrix.h:428
std::pair< SizeType, SizeType > getMinElementCoordinates() const
Indexpair of minimal element.
Definition: DistanceMatrix.h:476
const ValueType getValue(SizeType i, SizeType j) const
gets a value at a given position:
Definition: DistanceMatrix.h:212
ValueType getValue(SizeType i, SizeType j)
gets a value at a given position:
Definition: DistanceMatrix.h:237
const ValueType operator()(SizeType i, SizeType j) const
gets a value at a given position (read only):
Definition: DistanceMatrix.h:189
DistanceMatrix(const DistanceMatrix &source)
copy constructor
Definition: DistanceMatrix.h:138
Size SizeType
Definition: DistanceMatrix.h:78
std::pair< SizeType, SizeType > min_element_
index of minimal element(i.e. number in underlying SparseVector)
Definition: DistanceMatrix.h:493
ValueType operator()(SizeType i, SizeType j)
gets a value at a given position (read only):
Definition: DistanceMatrix.h:200
ValueType ** matrix_
sparse element not to be included in base container
Definition: DistanceMatrix.h:487
void setValueQuick(SizeType i, SizeType j, ValueType value)
sets a value at a given position:
Definition: DistanceMatrix.h:309
value_type ValueType
Definition: DistanceMatrix.h:79
~DistanceMatrix()
destructor
Definition: DistanceMatrix.h:174
SizeType init_size_
number of actually stored rows
Definition: DistanceMatrix.h:489
DistanceMatrix(SizeType dimensionsize, Value value=Value())
detailed constructor
Definition: DistanceMatrix.h:97
DistanceMatrix & operator=(const DistanceMatrix &rhs)
assignment operator (unsafe)
Definition: DistanceMatrix.h:497
void clear()
reset all
Definition: DistanceMatrix.h:327
SizeType dimensionsize_
number of accessibly stored rows (i.e. number of columns)
Definition: DistanceMatrix.h:491
void resize(SizeType dimensionsize, Value value=Value())
resizing the container
Definition: DistanceMatrix.h:349
void reduce(SizeType j)
reduces DistanceMatrix by one dimension. first the jth row, then jth column
Definition: DistanceMatrix.h:397
Out of memory exception.
Definition: Exception.h:461
Out of range exception.
Definition: Exception.h:313
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
#define OPENMS_PRECONDITION(condition, message)
Precondition macro.
Definition: openms/include/OpenMS/CONCEPT/Macros.h:120
const double k
Definition: Constants.h:153
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
constexpr Int writtenDigits< double >(const double &)
Number of digits commonly used for writing a double (a.k.a. precision).
Definition: Types.h:219