Design a class to perform various matrix operations. A matrix is a set of numbers arranged in rows and columns. Therefore, every element of a matrix has a row position and a column position. If A is a...


Design a class to perform various matrix operations. A matrix is a set of numbers arranged in rows and columns. Therefore, every element of a matrix has a row position and a column position. If A is a matrix of 5 rows and 6 columns, we say that matrix A isof the size 5 × 6 and sometimes denote it as A5×6. Clearly, a convenient place to store a matrix is in a two-dimensional array. Two matrices can be added and subtracted if they have the same size. Suppose that A = [aij] and B = [bij] are two matrices of the size m × n, where aijdenotes the element of A in the ith row and the jth column, and so on. The sum and difference of A and B is given by: ?+ ?= [???+ ???]?− ?= [???−???]The multiplication of A and B (A * B) is defined only if the number of columns of A are the same as the number of rows of B. If A is of the size m × n and B is of the size n × t, then A * B = [cik] is of the size m × t and the element cikis given by the formula: ???= ??1?1?+ ??2?2?+ ⋯+ ??????Matrices A and B are equal if they are of the same size and elements aij, bij. Have the same values. Design and implement a class matrixType that can store a matrix of any size (dynamic allocation). Your class should have the following attributes: -Number of rows (type integer). -Number of columns (type integer). -A pointer to pointer to store the elements of the matrix (type array) The class should provide the following member functions. -A parametrized constructor to dynamically allocate the matrix on size n × m. the constructor should take two integer values that represent rows and columns as parameters. -A destructor to deallocate the dynamically allocated arrays. -Overload the operators +, -, * and == to perform the addition, subtraction, multiplication, and comparison operations, respectively. -Overload the operators >> to insert a matrix and < to="" output="" a="" matrix.="" also,="" write="" a="" test="" program="" to="" test="" various="" operations="" on="">

Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here