28 #ifndef mrpt_matrix_adaptors_H
29 #define mrpt_matrix_adaptors_H
41 template<
typename T,
typename U,
bool UIsObject>
class CBinaryRelation;
60 template<
typename T,
typename U,
bool UIsObject,
typename FunctionType>
inline void applyFunction(
CBinaryRelation<T,U,UIsObject> &o, FunctionType fun,
size_t e1,
size_t e2,
const T &T1,
const T &T2);
209 template <
typename MAT>
232 inline const_iterator
begin()
const {
238 inline const_iterator
end()
const {
244 inline const_reverse_iterator
rbegin()
const {
247 inline reverse_iterator
rend() {
250 inline const_reverse_iterator
rend()
const {
254 return m_mat->getColCount();
257 if (N!=
size())
throw std::logic_error(
"Tried to resize a fixed-size vector");
283 ASSERT_(row<mat.getRowCount());
284 howMany=(mat.getColCount()-m_colOffset)/m_elementsSpace;
325 if (N!=
size())
throw std::logic_error(
"Tried to resize a fixed-size vector");
348 ASSERT_(row<mat.getRowCount());
369 return m_mat->getColCount();
372 if (N!=
size())
throw std::logic_error(
"Tried to resize a fixed-size vector");
398 ASSERT_(row<mat.getRowCount());
399 howMany=(mat.getColCount()-m_colOffset)/m_elementsSpace;
423 if (N!=
size())
throw std::logic_error(
"Tried to resize a fixed-size vector");
455 inline const_iterator
begin()
const {
461 inline const_iterator
end()
const {
467 inline const_reverse_iterator
rbegin()
const {
470 inline reverse_iterator
rend() {
473 inline const_reverse_iterator
rend()
const {
477 return m_mat->getRowCount();
480 if (N!=
size())
throw std::logic_error(
"Tried to resize a fixed-size vector");
490 template<
typename MAT>
505 ASSERT_(col<mat.getColCount());
506 howMany=(mat.getRowCount()-m_rowOffset)/m_elementsSpace;
510 return (*
m_mat)(m_rowOffset+(i*m_elementsSpace),m_colInd);
513 return (*
m_mat)(m_rowOffset+(i*m_elementsSpace),m_colInd);
547 if (N!=
size())
throw std::logic_error(
"Tried to resize a fixed-size vector");
569 ASSERT_(colIdx<mat.getColCount());
573 return (*
m_mat)(i,m_colInd);
590 return m_mat->getRowCount();
593 if (N!=
size())
throw std::logic_error(
"Tried to resize a fixed-size vector");
603 template<
typename MAT>
618 ASSERT_(col<mat.getColCount());
619 howMany=(mat.getRowCount()-m_rowOffset)/m_elementsSpace;
623 return (*
m_mat)(m_rowOffset+(i*m_elementsSpace),m_colInd);
643 if (N!=
size())
throw std::logic_error(
"Tried to resize a fixed-size vector");