linalg::isPosDef -- test a
matrix for positive definiteness
Introductionlinalg::isPosDef(A) checks whether the
matrix A is positive definite, so that transpose(x)*A*x
> 0 for arbitrary vectors x <> 0.
Call(s)linalg::isPosDef(A)
ParametersA |
- | a matrix of a domain of category Cat::Matrix |
Returnseither TRUE or FALSE.
Side
EffectsProperties of identifiers are taken into account.
Related
Functionslinalg::factorCholesky,
linalg::isHermitean
DetailsA must be a field, i.e., a
domain of category Cat::Field.A are symbolic).
Example
1Here is an example of a positive definite matrix:
>> MatR := Dom::Matrix( Dom::Real ): A := MatR([[14, 6, 9], [6, 17, -4], [9, -4, 13]])
+- -+
| 14, 6, 9 |
| |
| 6, 17, -4 |
| |
| 9, -4, 13 |
+- -+
>> linalg::isPosDef(A)
TRUE
The following matrix is not positive definite:
>> B := MatR([[1, 2, 3], [2, 3, 4], [5, 6, 7]])
+- -+
| 1, 2, 3 |
| |
| 2, 3, 4 |
| |
| 5, 6, 7 |
+- -+
>> linalg::isPosDef(B)
FALSE
Example
2linalg::isPosDef in general does not work
for matrices with symbolic entries. It may respond with an error
message (because the system in general cannot decide whether a symbolic
component is positive), such as for the following matrix:
>> delete a, b: C := matrix([[a, b], [b, a]])
+- -+
| a, b |
| |
| b, a |
+- -+
>> linalg::isPosDef(C)
Error: cannot check whether matrix component is positive \
[linalg::factorCholesky]
However, properties of identifiers are taken into
account, so that, for example, linalg::isPosDef is able to
perform the test correctly for the following matrix:
>> assume(a > 1): C := matrix([[a, 1], [1, a]]):
>> linalg::isPosDef(C)
TRUE
Note that such computations depend on the power of the
underlying property mechanism implemented in the library property.