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, Matrix_test.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 ^([1]) of numbers, symbols, or expressions,
arranged in rows and columns. ^([2][3]) The dimensions of matrix (1) are 2xx3(read "two by three"), because there are two rows and three columns.
A 2 by 3 matrix of integers
Matrices are very useful and represent a fundamental tool for simulating real-world 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 (x,y)- 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 (x,y)- 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 (0,0) of the new matrix. Any storage allocated for the old matrix should be released.
float *getMatrix()- return a pointer to the element at [0,0]
float *getRow (x)- a function that will return a pointer to the beginning of row x in the matrix element x_(l)[x,0]
float *getColumn - a function that will return a pointer to the beginning of column y in the matrix element[[0,y].
Matrix()- a destructor function that de-allocates 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 Matrix_test.cpp. The
working environment for this assignment should contain 3 files:
Matrix.h - the interface header file where your class is defined.
Matrix.cpp - the implementation file where your class implemented.
Matrix_test.cpp - the test driver file that creates and tests instances of your class.
In order to assure what is called "good test coverage" your Matrix_Test driver should test the following conditions:
Calculate the address of the first position M[0,0] in the Matrix (boundary condition)
Calculate the address of the last position M[n,m] for an n by m matrix (boundary condition)
Calculate the address of an entry inside the matrix M[3,4] where n >3 and m >4(interior condition)
Calculate the address of an entry outside the lower bound M[-1,-1](out of lower bound)
Calculate the address of an entry outside the upper bound M[n+1,m+1](out of upper bound)
The out-of-bound values should not return a legitimate address, but a value that clearly indicates there was an error in the indices specified. 1. Matrix.h - the interface header file where your class is defined.
2. Matrix.cpp - the implementation file where your class implemented.
3. Matrix_test.cpp - the test driver file that creates and tests instances of your class.
order to assure what is called "good test coverage" your Matrix_Test driver should test the following conditions:
1. Calculate the address of the first position \(\mathrm{M}[0,0]\) in the Matrix (boundary condition)
2. Calculate the address of the last position \( M[\mathrm{n},\mathrm{m}]\) for an n by m matrix (boundary condition)
3. Calculate the address of an entry inside the matrix \( M[3,4]\) where \( n>3\) and \( m>4\)(interior condition)
4. Calculate the address of an entry outside the lower bound M[-1,-1](out of lower bound)
5. Calculate the address of an entry outside the upper bound \( M[n+1, m+1]\)(out of upper bound)
he out-of-bound values should not return a legitimate address, but a value that clearly indicates there was an error in the indices specified. 1. Matrix.h - the interface header file where your class is defined.
2. Matrix.cpp - the implementation file where your class implemented.
3. Matrix_test.cpp - the test driver file that creates and tests instances of your class.
In order to assure what is called "good test coverage" your Matrix_Test driver should test the following conditions:
1. Calculate the address of the first position \(\mathrm{M}[0,0]\) in the Matrix (boundary condition)
2. Calculate the address of the last position \( M[n, m]\) for an \( n \) by matrix (boundary condition)
3. Calculate the address of an entry inside the matrix \( M[3,4]\) where \( n>3\) and \( m>4\)(interior condition)
4. Calculate the address of an entry outside the lower bound \(\mathrm{M}[-1,-1]\)(out of lower bound)
5. Calculate the address of an entry outside the upper bound \( M[n+1, m+1]\)(out of upper bound)
The out-of-bound 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!