Previous Up Next

15.3.10  Computing inertia of a symmetric matrix

The inertia command computes the inertia of a real symmetric matrix, i.e. the number of positive, negative and zero eigenvalues, by performing LDL decomposition (see Section 15.3.9). It can also use the factorization for solving a system of linear equations if certain inertia-related conditions are satisfied.

Examples

A:=[[1,-1,2],[-1,4,3],[2,3,-5]]
     



1−12
−143
23−5



          
inertia(A)
     

2,1,0
          
inertia(A,[[1,2,3],[4,5,6]])
     

2,1,0
,








15
13
8
13
3
13
177
52
71
52
51
52








          

If we set p0=1, then X is not computed.

inertia(A,[[1,2,3],[4,5,6]],1)
     

2,1,0
,

          

Previous Up Next