Answer this question in C++. Question: Complete the Matrix class, matix.cpp file and call this functions in main.cpp. #include using namespace std; class Matrix { public: Matrix(int , int ); ~Matrix(); Matrix operator +(const Matrix); Matrix operator -(const Matrix); Matrix operator *(const Matrix); ostream& operator << (ostream& out); // << for displaying the matrix istream& operator >> (istream& in); // >> for reading the matrix int operator !(); // !for determinant of a matrix Matrix operator ~(); // ~for transpose of a matrix Matrix operator -(); //o unary – for inverse of a matrix*/ }; #include "Matrix.h" Matrix::Matrix(int rows, int cols){ } Matrix::~Matrix() { } Matrix Matrix::operator +(const Matrix) { } Matrix Matrix::operator -(const Matrix) { } Matrix Matrix::operator *(const Matrix) { } ostream& Matrix::operator << (ostream& out) { } istream& Matrix::operator >> (istream& in) { } int Matrix::operator !() { } Matrix Matrix::operator ~() { } Matrix Matrix::operator -() { } #include "Matrix.h" int main() { return 0; }
Answer this question in C++.
Question: Complete the Matrix class, matix.cpp file and call this functions in main.cpp.
#include <iostream>
using namespace std;
class Matrix
{
public:
Matrix(int , int );
~Matrix();
Matrix operator +(const Matrix);
Matrix operator -(const Matrix);
Matrix operator *(const Matrix);
ostream& operator << (ostream& out); // << for displaying the matrix
istream& operator >> (istream& in); // >> for reading the matrix
int operator !(); // !for determinant of a matrix
Matrix operator ~(); // ~for transpose of a matrix
Matrix operator -(); //o unary – for inverse of a matrix*/
};
#include "Matrix.h"
Matrix::Matrix(int rows, int cols){
}
Matrix::~Matrix() {
}
Matrix Matrix::operator +(const Matrix) {
}
Matrix Matrix::operator -(const Matrix) {
}
Matrix Matrix::operator *(const Matrix) {
}
ostream& Matrix::operator << (ostream& out) {
}
istream& Matrix::operator >> (istream& in) {
}
int Matrix::operator !() {
}
Matrix Matrix::operator ~() {
}
Matrix Matrix::operator -() {
}
#include "Matrix.h"
int main() {
return 0;
}
Step by step
Solved in 7 steps with 5 images