Diagonal matrix: Difference between revisions
(Created page with "{{square matrix property}} ==Definition== A '''diagonal matrix''' is a square matrix for which all the off-diagonal entries are zero, or equivalently, all nonzero entrie...") |
No edit summary |
||
Line 7: | Line 7: | ||
==Encoding== | ==Encoding== | ||
{ | A matrix that is ''known'' to be diagonal may simply be encoded using an ordered list of its diagonal entries. For a <math>n \times n</math> matrix, this requires space for <math>n</math> entries (in contrast with space for <math>n^2</math> entries for an arbitrary square matrix). | ||
==Matrix operations== | |||
Unless otherwise specified, diagonal matrices are <math>n \times n</math> diagonal matrices. | |||
{| class="sortable" border="1" | |||
! Matrix operation !! Arithmetic complexity: number of additions !! Arithmetic complexity: number of multiplications | |||
|- | |||
| Computation of the [[trace]] || <math>n - 1</math> || 0 | |||
|- | |||
| Computation of the [[determinant]] || 0 || <math>n - 1</math> | |||
|- | |||
| Addition of two such matrices || <math>n</math> || 0 | |||
|- | |||
| Multiplication of two such matrices || 0 || <math>n</math> | |||
|- | |||
| Multiplication by a <math>n \times p</math> rectangular matrix (we allow <math>n = p</math>) || 0 || <math>np</math> | |||
|} |
Revision as of 02:58, 29 April 2014
This article defines a property that can be evaluated for a square matrix. In other words, given a square matrix (a matrix with an equal number of rows and columns) the matrix either satisfies or does not satisfy the property.
View other properties of square matrices
Definition
A diagonal matrix is a square matrix for which all the off-diagonal entries are zero, or equivalently, all nonzero entries are on the diagonal. Note that it is also possible that some (or even all) the diagonal entries are zero.
Encoding
A matrix that is known to be diagonal may simply be encoded using an ordered list of its diagonal entries. For a matrix, this requires space for entries (in contrast with space for entries for an arbitrary square matrix).
Matrix operations
Unless otherwise specified, diagonal matrices are diagonal matrices.
Matrix operation | Arithmetic complexity: number of additions | Arithmetic complexity: number of multiplications |
---|---|---|
Computation of the trace | 0 | |
Computation of the determinant | 0 | |
Addition of two such matrices | 0 | |
Multiplication of two such matrices | 0 | |
Multiplication by a rectangular matrix (we allow ) | 0 |