KTLT-Luu Hong Viet
#include
#include
#include
class matrix{
int row; //so hang cua ma tran
int column; //so cot cua ma tran
float **p; //con tro cua con tro tro den cac phan tu cua ma tran
public:
matrix():row(0),column(0),p(0){} //ham tao khong tham so
matrix(int a,int b,float d=0.0); //khai bao ham tao co tham so voi 1 tham so mac dinh
matrix(const matrix &); //khai bao ham tao ban sao
~matrix(); //khai bao ham huy
int getrow(){ //ham thanh vien lay so hang cua ma tran
return row;
}
int getcolumn(){ //ham thanh vien lay so cot cua ma tran
return column;
}
matrix &operator=(const matrix &) ; //khai bao ham nap chong toan tu gan
matrix operator+(const matrix &) const; //khai bao ham cong hai ma tran
matrix operator-(const matrix &) const; //khai bao ham tru hai ma tran
matrix operator*(const matrix &) const; //khai bao ham nhan hai ma tran
matrix operator!() const; //khai bao ham tinh nghich dao ma tran
void putmatrix(); //khai bao ham nhap ma tran
void putsquarematrix(); //khai bao ham nhap ma tran vuong
void display(); //khai bao ham hien thi ma tran
private:
void creatematrix(int a,int b){
row=a;
column=b;
p=new float*[a];
Bạn đang đọc truyện trên: AzTruyen.Top