|
OpenMS
2.5.0
|
Go to the documentation of this file.
74 template <
typename Value>
76 protected std::vector<Value>
79 typedef std::vector<Value>
Base;
144 Base::operator=(rhs);
167 return Base::operator[](
index(i, j));
172 return Base::operator[](
index(i, j));
177 Base::operator[](
index(i, j)) = value;
189 values[j] = Base::operator[](
index(i, j));
203 values[j] = Base::operator[](
index(j, i));
231 using Base::capacity;
232 using Base::max_size;
252 rows_ = size_pair.first;
253 cols_ = size_pair.second;
332 "Matrices have different row sizes.");
334 "Matrices have different column sizes.");
346 "Matrices have different row sizes.");
348 "Matrices have different column sizes.");
353 template <
int ROWS,
int COLS>
388 template <
typename Value>
392 for (size_type i = 0; i < matrix.rows(); ++i)
394 for (size_type j = 0; j < matrix.cols(); ++j)
396 os << std::setprecision(6) << std::setw(6) << matrix(i, j) <<
' ';
reference operator()(size_type const i, size_type const j)
Definition: Matrix.h:160
Base::iterator iterator
Definition: Matrix.h:92
pointer Pointer
Definition: Matrix.h:115
void resize(size_type i, size_type j, value_type value=value_type())
Definition: Matrix.h:243
Base container_type
Definition: Matrix.h:85
SizeType cols_
Number of columns (width of a row)
Definition: Matrix.h:378
Matrix(const SizeType rows, const SizeType cols, ValueType value=ValueType())
Definition: Matrix.h:130
Base::reference reference
Definition: Matrix.h:97
Matrix & operator=(const Matrix &rhs)
Definition: Matrix.h:142
Matrix(const Matrix &source)
Definition: Matrix.h:136
container_type col(size_type const i) const
Return the i-th column of the matrix as a vector.
Definition: Matrix.h:195
void setMatrix(const ValueType matrix[ROWS][COLS])
set matrix to 2D arrays values
Definition: Matrix.h:354
Base::const_iterator const_iterator
Definition: Matrix.h:90
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
std::vector< Value > Base
Definition: Matrix.h:79
void assign(char &c_target, AAcid const &source)
Definition: AhoCorasickAmbiguous.h:179
std::pair< Size, Size > sizePair() const
Definition: Matrix.h:269
#define OPENMS_PRECONDITION(condition, message)
Precondition macro.
Definition: openms/include/OpenMS/CONCEPT/Macros.h:136
const_reference getValue(size_type const i, size_type const j) const
Definition: Matrix.h:165
Base::const_reference const_reference
Definition: Matrix.h:95
iterator Iterator
Definition: Matrix.h:111
Base::size_type size_type
Definition: Matrix.h:88
SizeType rowIndex(SizeType index) const
Calculate the row from an index into the underlying vector. Note that Matrix uses the (row,...
Definition: Matrix.h:315
const_reverse_iterator ConstReverseIterator
Definition: Matrix.h:110
container_type row(size_type const i) const
Return the i-th row of the matrix as a vector.
Definition: Matrix.h:181
Base::value_type value_type
Definition: Matrix.h:98
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
reverse_iterator ReverseIterator
Definition: Matrix.h:112
SizeType cols() const
Number of columns.
Definition: Matrix.h:264
A two-dimensional matrix. Similar to std::vector, but uses a binary operator(,) for element access.
Definition: IsobaricQuantitationMethod.h:49
SizeType rows() const
Number of rows.
Definition: Matrix.h:258
Base::allocator_type allocator_type
Definition: Matrix.h:100
const_reference ConstReference
Definition: Matrix.h:114
void clear()
Definition: Matrix.h:236
allocator_type AllocatorType
Definition: Matrix.h:119
const SizeType index(SizeType row, SizeType col) const
Calculate the index into the underlying vector from row and column. Note that Matrix uses the (row,...
Definition: Matrix.h:278
SizeType rows_
Number of rows (height of a column)
Definition: Matrix.h:376
Base::pointer pointer
Definition: Matrix.h:96
Base::const_reverse_iterator const_reverse_iterator
Definition: Matrix.h:91
Matrix()
Definition: Matrix.h:124
Base ContainerType
Definition: Matrix.h:105
reference getValue(size_type const i, size_type const j)
Definition: Matrix.h:170
std::ostream & operator<<(std::ostream &os, const AccurateMassSearchResult &amsr)
void setValue(size_type const i, size_type const j, value_type value)
Definition: Matrix.h:175
Int overflow exception.
Definition: Exception.h:254
const Base & asVector()
Definition: Matrix.h:366
SizeType colIndex(SizeType index) const
Calculate the column from an index into the underlying vector. Note that Matrix uses the (row,...
Definition: Matrix.h:303
reference Reference
Definition: Matrix.h:116
Base::difference_type difference_type
Definition: Matrix.h:87
const_reference operator()(size_type const i, size_type const j) const
Definition: Matrix.h:155
value_type ValueType
Definition: Matrix.h:117
const_iterator ConstIterator
Definition: Matrix.h:109
Base::reverse_iterator reverse_iterator
Definition: Matrix.h:93
difference_type DifferenceType
Definition: Matrix.h:106
size_type SizeType
Definition: Matrix.h:107
bool operator==(Matrix const &rhs) const
Equality comparator.
Definition: Matrix.h:329
const std::pair< Size, Size > indexPair(Size index) const
Calculate the row and column from an index into the underlying vector. Note that Matrix uses the (row...
Definition: Matrix.h:291
~Matrix()
Definition: Matrix.h:150
bool operator<(Matrix const &rhs) const
Less-than comparator. Comparison is done lexicographically: first by row, then by column.
Definition: Matrix.h:343
void resize(std::pair< Size, Size > const &size_pair, value_type value=value_type())
Definition: Matrix.h:250