subject

In the Matrix class called Matrix. cs:

- matrix is a 2D array of double

- Cols is a read-only property that returns the number of columns in the matrix

- Rows is a read-only property that returns the number of rows in the matrix

- Create an indexer for a matrix. Note that for a matrix you need this[int i, int j] for both dimensions.

- Matrix is a constructor the instantiates the matrix of desired size.

- Create add, subtract and multiply methods that perform their respective operation on two matrices, called A and B matrices, returning a C result matrix. Note that they are called as C = A. add(B);

- The colsEqual, rowsEqual and dimsEqual methods compare the number of columns, rows and dimensions between two matrices for equality. Note bool b = A. dimsEqual(B); returns true if the matrices have the same dimensions.

- Equals is an override method that compares two matrices for equality. They are equal if both are null, or both have the same numeric values in the same element positions.

- GetHashCode is an override method that is implemented as:

// Overrides the GetHashCode method

public override int GetHashCode()

{

// Use sum for hash code

return sum().GetHashCode(); // Note that double overrides this too

}

- sum calculates the sum of all elements in the matrix.

- makeId makes an n x n identity matrix.

- clone returns a copy of this matrix.

- copy accepts a matrix and copied its elements to this.

- populateRand populates this matrix with random doubles.

- populateOrd populates this matrix with sequential doubles from 1.0 in the first element to d in the last, as traversed by a nested loop.

- The operator methods overload the operators to work with matrices.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:50
Assume that you have an sorted array of records. assume that the length of the array (n) is known. give two different methods to search for a specific value in this array. you can use english or pseudo-code for your algorithm. what is the time complexity for each algorithm and why?
Answers: 1
question
Computers and Technology, 23.06.2019 00:00
What engine component is shown in the above figure?
Answers: 1
question
Computers and Technology, 23.06.2019 01:00
Petrică, tânăr licean în clasa a ix-a, a primit în dar de la părinţii săi un cont bancar pentru micile sale cheltuieli curente. el este pasionat de internet banking şi îşi verifică cu grijă toate tranzacţiile efectuate. pentru creşterea securităţii tranzacţiilor online, banca îi furnizează lui petrică un număr pe care el va trebui să îl modifice, obţinând un număr tan – număr de autentificare a tranzacţiei (transaction authentication number). regula de obţinere a numărului tan este următoarea: se formează cel mai mic număr par din toate cifrele numărului furnizat de bancă. cerinţă cunoscând numărul n furnizat de bancă, să se determine numărul tan obţinut de petrică. date de intrare fişierul tan.in conţine pe prima linie numărul natural n cu semnificaţia din enunţ. date de ieşire fişierul de ieşire tan.out va conţine o singură linie pe care va fi scris numărul tan cerut. restricţii • 0 < n < 18*1018 • n are cel puţin o cifră pară • numărul tan obţinut nu poate conţine zerouri nesemnificative
Answers: 2
question
Computers and Technology, 23.06.2019 05:20
Which operating system is a version of linux?
Answers: 1
You know the right answer?
In the Matrix class called Matrix. cs:

- matrix is a 2D array of double

- Co...
Questions
question
Physics, 03.03.2021 21:40
question
Mathematics, 03.03.2021 21:40
question
Mathematics, 03.03.2021 21:40
question
Mathematics, 03.03.2021 21:40
question
Spanish, 03.03.2021 21:40
question
Mathematics, 03.03.2021 21:40
Questions on the website: 13722360