BEN C ++ DAN ANLAMAYAN BİRİYİM.HİÇ ANLAMADIM.YARDIM EDEBILECEK KIMSE VARMI?
Bu alıştırmada, üye fonksiyonlar için tanımlarını sağlamak gerekiyor
Aşağıdaki Matrix sınıfı. Herhangi bir nedenle bu nasıl bu işlevleri tanımlamak için açık değilse
veya fonksiyon ne yapması gerektiğini anlamakta zorluk var, her zaman bakabilirsiniz
Yardım için eğitmen. Eğer kurucular dinamik bellek ayırma kullanmalısınız
ve dinamik olarak yıkıcı kullanılmayan bellek dönün.
In this exercise, you are supposed to provide the definitions for the member functions of
the following Matrix class. If for any reason it is not obvious how to define these functions
or there is a difficulty in understanding what the function should do, you can always refer to
your instructor for help. You should use dynamic memory allocation in your constructors
and dynamically return unused memory in your destructor.
class Matrix {
friend ostream & operator<<(ostream & , const Matrix &); // stream insertion operator for output
friend istream & operator<<(istream &, Matrix &); // stream extraction operator for input
public :
Matrix(); //Default Constructor
Matrix(int r, int c); //Constructor to create a Matrix object with
// r rows and c columns
Matrix(const Matrix &); //Copy Constructor
~Matrix(); //Destructor
double & operator(int , int); //operator to access entries
int Rows(); //function that returns nRows
int Cols(); //function that returns nCols
void Init(double num); //initialize all entries to given num
Matrix operator+(const Matrix &); //binary addition operator
Matrix operator-(const Matrix &); //binary subtraction operator
Matrix operator*(const Matrix &); //Multiplication function provided sizes match
Matrix & operator=(const Matrix &); //assignment operator
int operator==(const Matrix&); //equality operator
int operator!=(const Matrix&); // inequality operator
Matrix REF(); //This function returns the Row Echelon Form
Matrix RREF(); //This function returns the Reduced Row Echelon Form
double det(); //Returns the determinant if it is a square matrix
Matrix SubMatrix(int i , int j); //Returns the matrix obtained by deleting
//i-th row and j-th column.
private:
int nRows; //number of rows
int nCols; //number of columns
double *data; //pointer to an array of nRows*nCols elements.
}; // end declaration of class Matrix.


Alıntı ile Cevapla
Bu Konuyu Paylaşın !