14 #include <OpenMS/config.h>
40 template <
typename Value>
82 for (i = 1; i < j; i++)
126 for (i = 1; i < j; i++)
434 for (
Size j = 0; j < i; ++j)
488 template <
typename Value>
493 std::ios_base::fmtflags flag_backup = os.setf(std::ios::scientific);
494 std::streamsize precision_backup = os.precision();
503 os << matrix(i, j) <<
'\t';
507 os.flags(flag_backup);
508 os.precision(precision_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:392
Value value_type
Definition: DistanceMatrix.h:47
std::ostream & operator<<(std::ostream &os, const DistanceMatrix< Value > &matrix)
Print the contents to a stream.
Definition: DistanceMatrix.h:489
DistanceMatrix()
default constructor
Definition: DistanceMatrix.h:59
bool operator==(DistanceMatrix< ValueType > const &rhs) const
Equality comparator.
Definition: DistanceMatrix.h:429
void setValue(SizeType i, SizeType j, ValueType value)
sets a value at a given position:
Definition: DistanceMatrix.h:237
void updateMinElement()
keep track of the actual minimum element after altering the matrix
Definition: DistanceMatrix.h:402
std::pair< SizeType, SizeType > getMinElementCoordinates() const
Indexpair of minimal element.
Definition: DistanceMatrix.h:450
const ValueType getValue(SizeType i, SizeType j) const
gets a value at a given position:
Definition: DistanceMatrix.h:186
ValueType getValue(SizeType i, SizeType j)
gets a value at a given position:
Definition: DistanceMatrix.h:211
const ValueType operator()(SizeType i, SizeType j) const
gets a value at a given position (read only):
Definition: DistanceMatrix.h:163
DistanceMatrix(const DistanceMatrix &source)
copy constructor
Definition: DistanceMatrix.h:112
Size SizeType
Definition: DistanceMatrix.h:52
std::pair< SizeType, SizeType > min_element_
index of minimal element(i.e. number in underlying SparseVector)
Definition: DistanceMatrix.h:467
ValueType operator()(SizeType i, SizeType j)
gets a value at a given position (read only):
Definition: DistanceMatrix.h:174
ValueType ** matrix_
sparse element not to be included in base container
Definition: DistanceMatrix.h:461
void setValueQuick(SizeType i, SizeType j, ValueType value)
sets a value at a given position:
Definition: DistanceMatrix.h:283
value_type ValueType
Definition: DistanceMatrix.h:53
~DistanceMatrix()
destructor
Definition: DistanceMatrix.h:148
SizeType init_size_
number of actually stored rows
Definition: DistanceMatrix.h:463
DistanceMatrix(SizeType dimensionsize, Value value=Value())
detailed constructor
Definition: DistanceMatrix.h:71
DistanceMatrix & operator=(const DistanceMatrix &rhs)
assignment operator (unsafe)
Definition: DistanceMatrix.h:471
void clear()
reset all
Definition: DistanceMatrix.h:301
SizeType dimensionsize_
number of accessibly stored rows (i.e. number of columns)
Definition: DistanceMatrix.h:465
void resize(SizeType dimensionsize, Value value=Value())
resizing the container
Definition: DistanceMatrix.h:323
void reduce(SizeType j)
reduces DistanceMatrix by one dimension. first the jth row, then jth column
Definition: DistanceMatrix.h:371
Out of memory exception.
Definition: Exception.h:435
Out of range exception.
Definition: Exception.h:287
unsigned int UInt
Unsigned integer type.
Definition: Types.h:68
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:101
#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: FeatureDeconvolution.h:22
constexpr Int writtenDigits< double >(const double &)
Number of digits commonly used for writing a double (a.k.a. precision).
Definition: Types.h:193