#ifndef matrix_h #define matrix_h #include using namespace stdtemplate class matrix publicmatrixint rowsint cols arrayrows forauto thisrow array thisrow resizecols )matrixvectorv arrayv matrixvector& arraystd::movev const vector operator[]int row const return arrayrow ]vector operator[]int row return arrayrow ]int numrowsconst return array size)int numcolsconst return numrowsarray size privatevectorarray}#endif figure complete matrix class operator[the idea of operator[is that if we have matrix mthen [ishould return vector corresponding to row of matrix if this is donethen [ ][jwill give the entry in position for vector [ ]using the normal vector indexing operator thusthe matrix operator[returns vector rather than an object