Question: #ifndef MATRIX _ T _ #define MATRIX _ T _ #include using std::cerr; #include / / for asset macro template Matrix::Matrix ( RowType loRow, RowType
#ifndef MATRIXT
#define MATRIXT
#include
using std::cerr;
#include for asset macro
template
Matrix::MatrixRowType loRow, RowType hiRow,ColType loCol, ColType hiCol
arrayData new ArrayVloRow hiRow;
for RowType i loRow; i hiRow; i
arrayDatai new ArrayV loCol hiCol;
assertarrayData ;
loRowIndex loRow;
hiRowIndex hiRow;
loColIndex loCol;
hiColIndex hiCol;
template
Matrix::Matrixconst Matrix & initMatrix
loRowIndexinitMatrix.loRowIndex;
hiRowIndexinitMatrix.hiRowIndex;
loColIndexinitMatrix.loColIndex;
hiColIndexinitMatrix.hiColIndex;
arrayData new ArrayVinitMatrixloRowIndex, initMatrix.hiRowIndex;
assertarrayData ;
for RowType i loRowIndex; i hiRowIndex; i
arrayDatai new ArrayV loColIndex hiColIndex;
arrayDataiinitMatrixarrayDatai;
template
void Matrix::operator const Matrix & initMatrix
for RowType i loRowIndex; i hiRowIndex; i
delete arrayDatai;
delete arrayData;
loRowIndexinitMatrix.loRowIndex;
hiRowIndexinitMatrix.hiRowIndex;
loColIndexinitMatrix.loColIndex;
hiColIndexinitMatrix.hiColIndex;
arrayData new ArrayVinitMatrixloRowIndex, initMatrix.hiRowIndex;
assertarrayData ;
for int i loRowIndex; i hiRowIndex; i
arrayDatai new ArrayV loColIndex hiColIndex;
arrayDataiinitMatrixarrayDatai;
template
Matrix::~Matrix
template
bool Matrix::outOfRangeRowType row
if row loRowIndexrow hiRowIndex
cerr "Row Index" row out of range";
returntrue;
else
return false;
template
ArrayV & Matrix::operatorRowType row
assertoutOfRangerow;
return arrayDatarow;
template
RowType Matrix::getLoRowIndex
return loRowIndex;
template
RowType Matrix::getHiRowIndex
return hiRowIndex;
template
ColType Matrix::getLoColIndex
return loColIndex;
template
ColType Matrix::getHiColIndex
return hiColIndex;
template
void Matrix::setLoRowIndexRowType rowLo
loRowIndex rowLo;
template
void Matrix::setHiRowIndexRowType rowHi
hiRowIndex rowHi;
template
void Matrix::setLoColIndexColType colLo
loColIndex colLo;
template
void Matrix::setHiColIndexColType colHi
hiColIndex colHi;
#endif
string getFileName
string fName;
ADD SOME CODE TO GET FILE NAME OF MATRIX DATA FROM TXT FILE
return fName;
void openFilestring nameOf, ifstream& in
inopennameOfcstr ios::in; convert nameOf to cstring; try to open
if infile and test for unsuccessful opening
cerr ERROR: nameOf endl endl;
exit;
ADD CODE FOR OPEN FILE FROM TXT FILE
Write C code to read and display D matrix from txt file using this matrix class function and also provide main cpp drive.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
