[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
matrix_type check
From: |
Jaroslav Hajek |
Subject: |
matrix_type check |
Date: |
Thu, 24 Apr 2008 20:30:21 +0200 |
hello,
please consider the attached changeset. It extends the current
matrix_type check for positive definiteness
(positive diagonal + symmetry) by also checking the necessary
condition a(i,j)*a(j,i) < a(i,i) * a(j,j) for i != j,
which can also be done in one pass through the matrix, and thus does
not impose much additional cost,
while greatly reducing the number of misclassified matrices (for
example `a = rand(10); matrix_type (a+a')'
is almost always wrong).
A minor bug is also fixed: in current version, setting matrix_type via
matrix_type (a, "type") always produces a warning.
Few tests in matrix_type.cc relying on the old more optimistic
behaviour are also fixed.
cheers,
--
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz
matrix_type.diff
Description: Binary data
- matrix_type check,
Jaroslav Hajek <=