Question: D Requested files: Matrix.h , Matrix.cpp , Matrix _ test.cpp ( Download ) Type of work: Theta Individual work A matrix is a two dimensional
D Requested files: Matrix.h Matrix.cpp Matrixtest.cpp Download
Type of work: Theta Individual work
A matrix is a two dimensional array. In mathematics, a matrix plural matrices is a rectangular array of numbers, symbols, or expressions,
arranged in rows and columns. The dimensions of matrix are xxread "two by three" because there are two rows and three columns.
A by matrix of integers
Matrices are very useful and represent a fundamental tool for simulating realworld systems. A major branch of numerical analysis is devoted to the
development of efficient algorithms for matrix computations, a subject that is centuries old and is today an expanding area of research.
Your program will implement a class that implements a matrix object that stores floats. The matrix can be of any size and will provide the following
interfaces:
Matrix a constructor that creates a matrix with no rows and no column.
Matrix xy A constructor that creates a matrix of floats with x rows and y columns. This two dimensional array should be public so it contents
are accessible outside the class.
float setSize xy a function that will set the size of the matrix object to x rows and y column. If the matrix already has a size, a new matrix will
be allocated and the elements of the old matrix copied to the elements of the new matrix. The new size must be larger than the old size. The
function return a pointer to element of the new matrix. Any storage allocated for the old matrix should be released.
float getMatrix return a pointer to the element at
float getRow x a function that will return a pointer to the beginning of row x in the matrix element xlx
float getColumn a function that will return a pointer to the beginning of column y in the matrix elementy
Matrix a destructor function that deallocates any memory used by the matrix.
Your Matrix class should not contain a main method. The main method used to test your program should be in a file named Matrixtest.cpp The
working environment for this assignment should contain files:
Matrix.h the interface header file where your class is defined.
Matrix.cpp the implementation file where your class implemented.
Matrixtest.cpp the test driver file that creates and tests instances of your class.
In order to assure what is called "good test coverage" your MatrixTest driver should test the following conditions:
Calculate the address of the first position M in the Matrix boundary condition
Calculate the address of the last position Mnm for an n by m matrix boundary condition
Calculate the address of an entry inside the matrix M where n and m interior condition
Calculate the address of an entry outside the lower bound Mout of lower bound
Calculate the address of an entry outside the upper bound Mnmout of upper bound
The outofbound values should not return a legitimate address, but a value that clearly indicates there was an error in the indices specified. Matrix.h the interface header file where your class is defined.
Matrix.cpp the implementation file where your class implemented.
Matrixtest.cpp the test driver file that creates and tests instances of your class.
order to assure what is called "good test coverage" your MatrixTest driver should test the following conditions:
Calculate the address of the first position mathrmM in the Matrix boundary condition
Calculate the address of the last position Mmathrmnmathrmm for an n by m matrix boundary condition
Calculate the address of an entry inside the matrix M where n and minterior condition
Calculate the address of an entry outside the lower bound Mout of lower bound
Calculate the address of an entry outside the upper bound Mn mout of upper bound
he outofbound values should not return a legitimate address, but a value that clearly indicates there was an error in the indices specified. Matrix.h the interface header file where your class is defined.
Matrix.cpp the implementation file where your class implemented.
Matrixtest.cpp the test driver file that creates and tests instances of your class.
In order to assure what is called "good test coverage" your MatrixTest driver should test the following conditions:
Calculate the address of the first position mathrmM in the Matrix boundary condition
Calculate the address of the last position Mn m for an n by matrix boundary condition
Calculate the address of an entry inside the matrix M where n and minterior condition
Calculate the address of an entry outside the lower bound mathrmMout of lower bound
Calculate the address of an entry outside the upper bound Mn mout of upper bound
The outofbound values should not return a legitimate address, but a value that clearly indic
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
