#pragma once #include "Array.h" #include "FullRow.h" namespace MbD { template class RowTypeMatrix : public Array { public: RowTypeMatrix() {} RowTypeMatrix(int m) : Array(m) {} RowTypeMatrix(std::initializer_list list) : Array{ list } {} void copyFrom(std::shared_ptr> x); virtual void zeroSelf() = 0; int nrow() { return (int) this->size(); } int ncol() { return this->at(0)->numberOfElements(); } int numberOfElements() override; }; template inline void RowTypeMatrix::copyFrom(std::shared_ptr> x) { for (int i = 0; i < x->size(); i++) { this->at(i)->copyFrom(x->at(i)); } } template inline int RowTypeMatrix::numberOfElements() { return this->nrow() * this->ncol(); } }