[PATCH] Use the inf-norm rather than 2-norm in issymmetric; add ishermitian.
Rolf Fabian
Rolf.Fabian at gmx.de
Fri Dec 7 06:32:22 CST 2007
John W. Eaton wrote:
>
> On 5-Dec-2007, Jason Riedy wrote:
>
> | The current issymmetric uses the very expensive and densifying 2-norm,
> | plus it checks if the matrix is Hermitian rather than symmetric. An
> | inf-norm tolerance probably is good enough. A new routine handles
> | Hermitian cases.
>
> OK, I checked in the new function and applied the patch for
> issymmetric.m.
>
> | Signed-off-by: Jason Riedy <ejr at cs.berkeley.edu>
>
> ?
>
> | Tracking down that issymmetric was running me out of memory was
> | no fun.
>
> I don't understand the point of this comment.
>
> | I'd be shocked if anyone relied on the 2-norm
> | behavior, but symmetric v. Hermitian might run into problems.
> |
> | Also, Which test system is the right one? I added routines to
> | both. If the DejaGnu one is unused, should it be deleted?
>
> the DejaGNU tests are obsolete, but haven't been deleted from the CVS
> archive yet.
>
> New tests should be added to the source files themselves, so I added
> your tests to ishermitian.m and issymmetric.m.
>
> The tests in the test/*.m files were generated from the old DejaGNU
> tests. It would be good to migrate them to the appropriate source
> files as well, but so far no one has taken on the task. It would be
> relatively easy to do, so if someone is looking for a small project...
>
> Thanks,
>
> jwe
>
I strongly argue against most of those changes.
First of all, backward compatibility is an important issue.
After the current change of 'issymmetric'
complex hermitian matrices are not any more considered
to be 'symmetric' as before and many existing programs
fail or return weird results.
Adding 'ishermitian.m' isn't a good idea either, because
there exist many more properties of square matrices
with respect to their internal symmetry which
are not yet implemented into Octave.
Besides the fact that 'skewsymmetric' and 'skewhermitian'
cannot be checked yet, Octave misses a bunch of important
symmetry classes like persymmetry,
bisymmetry, centrosymmetry, symmetric-toeplitz
and symmetric-hankel.
Because each specified exists in a symmetric,
skewsymmetric, hermitian and skewhermitian variant,
we come up with a total of 6*4 = 24 symmetry patterns.
In order to improve Octave's LA capabilities with respect to
symmetry properties, it wouldn't be a good idea to implement
all the mentioned important 24 patterns as individual m-files,
each with its own special handling of tolerances etc.
So I suggest to keep the 'issymmetric.m' function
for backward compatibility, remove the 'ishermitian.m'
again and add a single new function which takes a particular
symmetry pattern as an argument like e.g.
retval = symmetry( x, mode, tol )
where retval is true, if square matrix x pocesses symmetry pattern mode =
'symmetric', 'skewsymmetric', 'hermitian', 'skewhermitian',
'centrosymmetric', ... 'persymmetric', ... 'bisymmetric', ... (24 patterns)
Of course the mode patterns should be also available as short acronyms.
Actually this function exists already since several years as part of my
personal linear algebra Octave toolkit. If interested I'll send it to you.
Rolf Fabian
< r dot fabian at jacobs-university dot de >
-----
Rolf Fabian
<r dot fabian at jacobs-university dot de>
--
View this message in context: http://www.nabble.com/-PATCH--Use-the-inf-norm-rather-than-2-norm-in-issymmetric--add-ishermitian.-tf4953598.html#a14211553
Sent from the Octave - Bugs mailing list archive at Nabble.com.
More information about the Bug-octave
mailing list