27 #ifndef CDPL_MATH_MATRIXADAPTER_HPP
28 #define CDPL_MATH_MATRIXADAPTER_HPP
30 #include <type_traits>
49 static typename M::ConstReference
get(
const M&
m,
typename M::SizeType i,
typename M::SizeType j)
52 return m.getData()(i, j);
62 static typename M::ConstReference
get(
const M&
m,
typename M::SizeType i,
typename M::SizeType j)
68 return m.getData()(i, j);
78 static typename M::ConstReference
get(
const M&
m,
typename M::SizeType i,
typename M::SizeType j)
81 return m.getData()(i, j);
91 static typename M::ConstReference
get(
const M&
m,
typename M::SizeType i,
typename M::SizeType j)
97 return m.getData()(i, j);
103 template <
typename M,
typename Tri>
121 typedef typename std::conditional<std::is_const<M>::value,
122 typename M::ConstReference,
124 typedef typename std::conditional<std::is_const<M>::value,
125 typename M::ConstClosureType,
136 return TriangularType::template get<SelfType>(*
this, i, j);
141 return data.getSize1();
146 return data.getSize2();
161 return (data.getSize1() == 0 || data.getSize2() == 0);
170 template <
typename M,
typename Tri>
173 template <
typename M,
typename Tri>
176 template <
typename M,
typename Tri>
180 template <
typename M,
typename Tri>
184 template <
typename M,
typename Tri>
188 template <
typename M,
typename Tri>
192 template <
typename Tri,
typename E>
199 template <
typename Tri,
typename E>
200 TriangularAdapter<const E, Tri>
Definition of basic expression types.
Definition of type traits.
Definition: Expression.hpp:76
Definition: MatrixAdapter.hpp:105
Range< SizeType > RangeType
Definition: MatrixAdapter.hpp:129
const SelfType ConstClosureType
Definition: MatrixAdapter.hpp:127
M MatrixType
Definition: MatrixAdapter.hpp:115
M::DifferenceType DifferenceType
Definition: MatrixAdapter.hpp:118
M::ValueType ValueType
Definition: MatrixAdapter.hpp:119
SizeType getSize2() const
Definition: MatrixAdapter.hpp:144
MatrixClosureType & getData()
Definition: MatrixAdapter.hpp:149
M::SizeType SizeType
Definition: MatrixAdapter.hpp:117
bool isEmpty() const
Definition: MatrixAdapter.hpp:159
M::ConstReference ConstReference
Definition: MatrixAdapter.hpp:120
SelfType ClosureType
Definition: MatrixAdapter.hpp:128
TriangularAdapter(MatrixType &m)
Definition: MatrixAdapter.hpp:131
ConstReference operator()(SizeType i, SizeType j) const
Definition: MatrixAdapter.hpp:134
Tri TriangularType
Definition: MatrixAdapter.hpp:116
const MatrixClosureType & getData() const
Definition: MatrixAdapter.hpp:154
std::conditional< std::is_const< M >::value, typename M::ConstReference, typename M::Reference >::type Reference
Definition: MatrixAdapter.hpp:123
std::conditional< std::is_const< M >::value, typename M::ConstClosureType, typename M::ClosureType >::type MatrixClosureType
Definition: MatrixAdapter.hpp:126
SizeType getSize1() const
Definition: MatrixAdapter.hpp:139
constexpr unsigned int M
A generic type that covers any element that is a metal.
Definition: AtomType.hpp:657
constexpr unsigned int m
Specifies that the stereocenter has m configuration.
Definition: CIPDescriptor.hpp:116
TriangularAdapter< E, Tri > triang(MatrixExpression< E > &e)
Definition: MatrixAdapter.hpp:194
The namespace of the Chemical Data Processing Library.
Definition: MatrixAdapter.hpp:46
static M::ConstReference get(const M &m, typename M::SizeType i, typename M::SizeType j)
Definition: MatrixAdapter.hpp:49
Definition: TypeTraits.hpp:186
Definition: MatrixAdapter.hpp:59
static M::ConstReference get(const M &m, typename M::SizeType i, typename M::SizeType j)
Definition: MatrixAdapter.hpp:62
Definition: MatrixAdapter.hpp:88
static M::ConstReference get(const M &m, typename M::SizeType i, typename M::SizeType j)
Definition: MatrixAdapter.hpp:91
Definition: MatrixAdapter.hpp:75
static M::ConstReference get(const M &m, typename M::SizeType i, typename M::SizeType j)
Definition: MatrixAdapter.hpp:78
Definition: TypeTraits.hpp:179