4 * Created on: 13 April. 2013
13 * Matrix class is defined by
21 #include "GenericMatrix.hxx"
25 class Matrix: public GenericMatrix
27 public: //----------------------------------------------------------------
34 * constructor with data
35 * @param dim : The number of rows and columns
40 * constructor with data
41 * @param numberOfRows : The number of rows
42 * @param numberOfColumns : The number of columns
44 Matrix ( int numberOfRows, int numberOfColumns ) ;
48 * @param matrix : The Matrix object to be copied
50 Matrix ( const Matrix& matrix ) ;
53 * deep copy of a matrix (values are copied)
54 * @param matrix : The Matrix object to be copied
56 Matrix deepCopy( ) const;
61 virtual ~Matrix ( void ) ;
63 bool isSparseMatrix( void ) const ;
65 double& operator () ( int i, int j ) ;
67 double operator () ( int i, int j ) const ;
69 Matrix& operator+= (const Matrix& matrix) ;
71 Matrix& operator-= (const Matrix& matrix) ;
73 Matrix& operator*= (double value) ;
75 Matrix& operator*= (const Matrix& matrix) ;
77 Matrix& operator/= (double value) ;
79 Vector operator* (const Vector& vector) const ;
81 Matrix transpose() const ;
83 Matrix partMatrix(int row, int column) const ;
85 double determinant() const ;
87 const Matrix& operator= ( const Matrix& matrix ) ;
89 friend Matrix operator+ (const Matrix& matrix1, const Matrix& matrix2);
91 friend Matrix operator- (const Matrix& matrix1, const Matrix& matrix2);
93 friend Matrix operator* (double value , const Matrix& matrix ) ;
95 friend Matrix operator* (const Matrix& matrix, double value ) ;
97 friend Matrix operator/ (const Matrix& matrix, double value) ;
99 friend Matrix operator*(const Matrix& M, const Matrix& N) ;
101 friend std::ostream& operator<<(std::ostream& out, const Matrix& matrix ) ;
105 #endif /* MATRIX_HXX_ */