octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #47415] out of memory negating a permutation m


From: Lachlan Andrew
Subject: [Octave-bug-tracker] [bug #47415] out of memory negating a permutation matrix
Date: Fri, 25 Mar 2016 02:19:20 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Follow-up Comment #25, bug #47415 (project octave):

It was Carlo, not me, who suggested the sign bit.

I don't see the need to get rid of permutation and diagonal matrices over this
issue.  (As you say, code size is another matter entirely.)

I'm just worried about sequences like


A = eye(3);
A = -A(end:-1:1, :);
A(1,1,2) = 1;


My understanding is that if the second command causes A to be sparse, then the
third command will cause an error.  That level of incompatibility is
problematic.  Getting the sign of zero to agree with Matlab is much less
important, even if people then divide by it.

Is it documented anywhere how diagonal and permutation matrices are formed?  I
assume that diagonal matrices are much more common.  (Contrary to what Carlo
said, permutations are not a generalisation of diagonal matrices, since
permutations are 0/1 matrices.) Rather than adding a sign to a permutation
matrix, how about allowing exactly one *arbitrary* value in each row/column. 
That way they are actually generalisations of diagonal matrices.  They would
be slower and consume more memory than now, but that may be more than
compensated for by being more widely used.

Another option would be to drop permutation matrices, and keep diagonal
matrices.  That presumably saves half the lines of code, but still optimises a
very common class of matrices.  Out of interest, why were permutation matrices
chosen to optimise, rather than, say, tridiagonal matrices, triangular
matrices or Hermitian matrices?  They all seem more common and allow more
efficient algorithms to be chosen.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?47415>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]