Triangles And Trapezoids |
Hereinafter the following convention is used:
– small Greek letters are used to denote scalars;
– small Latin letters are used to denote vectors;
– capital Latin letters are used to denote matrices.
This topic contains the following sections:
Trapezoid is the matrix of the same size with all elements lower/upper the main diagonal equal to zero.
Let us show this operations on matrix A of size 3-by-4:
and of size 4-by-3:
Operation | Description | Performance |
---|---|---|
lower trapezoid | Returns a new matrix of the same size containing the lower trapezoid of this matrix. In case of 3-by-4 matrix: In case of 4-by-3 matrix: | |
upper trapezoid | Returns a new matrix of the same size containing the upper trapezoid of this matrix. In case of 3-by-4 matrix: In case of 4-by-3 matrix: | |
strictly lower trapezoid | Returns a new matrix of the same size containing the strictly lower trapezoid of this matrix (trapezoid with main diagonal elements equal to zero). In case of 3-by-4 matrix: In case of 4-by-3 matrix: | |
strictly upper trapezoid | Returns a new matrix of the same size containing the strictly upper trapezoid of this matrix (trapezoid with main diagonal elements equal to zero). In case of 3-by-4 matrix: In case of 4-by-3 matrix: |
Triangle is the square matrix with all elements lower/upper the main diagonal equal to zero.
Let us show this operations on matrix A of size 3-by-4:
and of size 4-by-3:
The result will be identical for such two matrices.
Operation | Description | Performance |
---|---|---|
lower triangle | Returns a new square matrix containing the lower triangle of this matrix. | |
upper triangle | Returns a new square matrix containing the upper triangle of this matrix. | |
strictly lower triangle | Returns a new square matrix containing the strictly lower triangle of this matrix (triangle with main diagonal elements equal to zero). | |
strictly upper triangle | Returns a new square matrix containing the strictly upper triangle of this matrix (triangle with main diagonal elements equal to zero). |