#ifndef __Matrix_h__
#define __Matrix_h__
//Matrix class .h file Brian Jahns cs252 c1999
#include <iostream.h>
class Matrix
{
//friend declaration so the i/o stream has access to the privates
friend ostream& operator << (ostream&, const Matrix&);
friend istream& operator >> (istream&, Matrix&);
public:
Matrix(); //default constructor
Matrix(const Matrix&); //copy constructor
Matrix(int, int); //creats a matrix with defined rows and cols
~Matrix(); //destructor
//overloaded "-" for subtracting matrices
Matrix operator - (const Matrix&);
//overloaded "*" for multiplying matrices
Matrix operator * (const Matrix&);
//overloaded "~" (transpose) to change the rows to columns
Matrix operator ~ ();
private:
int rows; //number of rows in the matrix
int columns; //number of columns in the matrix
double** matrix; //double pointer to the matrix double values
// Dynamic memory allocation for a matrix, returns pointer to pointer to
// double.
double** allocate(int rws, int cols);
// Takes two matrices and calculates the product, working with **'s
Matrix mult(const Matrix& matrix2);
// Takes two matrices and calculates the difference
Matrix sub(const Matrix& matrix2);
//takes one matrix and transposes it
Matrix trans();
};
#endif __Matrix_h__