def chck_posdef1(C):
    s="pos"
    i=0
    while i<len(C.rows()):

        ci=C[:i+1,:i+1]
        if det(ci)>0:
            i=i+1
        else:
            s="not pos"
            break    
    print s

A1=matrix([[2,2,0],[2,5,3],[0,3,8]])
chck_posdef1(A1)
out: pos

Strang-329-20-U (last edited 2010-12-18 09:33:16 by rupampy)