12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- #ifndef _CHECKEDEMATRIX_BASICMATRIX_H
- #define _CHECKEDEMATRIX_BASICMATRIX_H
- #include "core/vector/RowMatrixT.h"
- namespace NICE {
- template<class ElementType>
- class CheckedRowMatrixT : public RowMatrixT<ElementType> {
- public:
- inline CheckedRowMatrixT() : RowMatrixT<ElementType>() {}
- explicit CheckedRowMatrixT(const size_t rows, const size_t cols)
- : RowMatrixT<ElementType>(rows, cols) {}
- CheckedRowMatrixT(const size_t rows, const size_t cols,
- const ElementType& element)
- : RowMatrixT<ElementType>(rows, cols, element) {}
- CheckedRowMatrixT(const ElementType* _data, const size_t rows, const size_t cols)
- : RowMatrixT<ElementType>(_data, rows, cols) {}
- CheckedRowMatrixT(ElementType* _data, const size_t rows, const size_t cols,
- const typename RowMatrixT<ElementType>::Mode mode
- = MatrixBase::copy)
- : RowMatrixT<ElementType>(_data, rows, cols, mode) {}
- explicit CheckedRowMatrixT(std::istream& input)
- : RowMatrixT<ElementType>(input) {}
- CheckedRowMatrixT(const CheckedRowMatrixT<ElementType>& v)
- : RowMatrixT<ElementType>(v) {}
- CheckedRowMatrixT(const RowMatrixT<ElementType>& v)
- : RowMatrixT<ElementType>(v) {}
-
- inline typename RowMatrixT<ElementType>::reference
- operator()(const ptrdiff_t i, const ptrdiff_t j) {
- if (i < 0 || static_cast<unsigned int>(i) >= this->rows()
- || j < 0 || static_cast<unsigned int>(j) >= this->cols()) {
- throw std::out_of_range("RowMatrixT () access out of range");
- }
- return RowMatrixT<ElementType>::operator()(i, j);
- }
-
- virtual ~CheckedRowMatrixT();
- };
- template<class ElementType> CheckedRowMatrixT<ElementType>::~CheckedRowMatrixT() {
- }
- }
- #endif
|