.. (לתיקייה המכילה) | ||
What is the result of adding a triangular matrix to a scalar? | |
The result is a matrix (not a derived class) with all the elements (including those above and below the main diagonal) of the triangular matrix increased by the scalar value. |
What is the difference between resize() and reshape()? | |
reshape - Saves the linear index of the elements in the new matrix. No new elements are created or removed. resize - Saves the row and column index of elements in the new matrix. Elements can be created (they receive the value val) or removed. |
Does resize() on upper Triangular matrix changes values for elements under the matrix main diagonal? | |
No. It only gives the value for elements on and above the main diagonal, the rest recieve 0 (for lower triangular matrix, the elements on the matrix main digonal and below it recieve the value). |
Reading/writing elements in triangular matrix | |
Legal elements in a triangular matrix (meaning elements on the main diagonal and above it, in the case of upper diagonal matrix) can be read and written into. Illegal elements in a triangular matrix (meaning elements below the main diagonal, in the case of upper diagonal matrix) can only be read into. In the exercise, the read process would only be done by constant references/pointers to a triangular matrix object. |
What is the results of any mathematical operation of a class derived from matrix with another matrix/derived class? | |
The result is a standard matrix. |
Do we need to support adding/subtracting/etc. between matrices with different data types? | |
No |
What is the result of trying to write element in a triangular matrix which shouldn't be written into? | |
The result is that the aptly named "AccessIllegalElement" exception needs to be thrown |
Should a normal iterator run on all elements in a triangular matrix or only legal ones? | |
This particular case won't be checked, so both cases of accessing the elements or skipping them is fine. |
What happens when you combine a row vector of size 1 with a columns vector of size 1? | |
While this particular case won't be checked, the response should be an exception of DimensionMismatch. |
Can you resize/reshape a derived matrix class? | |
You cannot reshape a derived matrix class (an exception will always be thrown). You can resize it as long as the new matrix is still rectangular (same num of columns and rows). |
How should the output look like? | |
The output needs to match the one in main_out |