Thu 08 Dec 2016 04:23:01 AM UTC, comment #14:
this behavior still exists in 4.2.0
the comment #12 commands just seem to produce full matrices in Matlab 2016b. I'm unaware if matlab stores 'permutation matrices' through any other method or not to address Lachlan's question.

Wed 15 Jun 2016 08:31:19 AM UTC, comment #13:
Is this really a bug?
In terms of Matlab compatibility, is there any sequence of instruction that produces a permutation matrix where Matlab doesn't produce a full matrix? If not, then the behaviour is entirely up to us.
If the programmer wants a sparse matrix, it is easy to convert to sparse before negating. They can't want a permutation matrix if it is negative.
Unless there is a Matlab compatibility issue, I would vote for documenting this behaviour and leaving it asis.

Tue 24 Nov 2015 12:50:18 AM UTC, comment #12:
The behavior of unary minus converting a Permutation Matrix to a Full Matrix has been reintroduced to solve bug #44316. I am reopening this bug report as it is now present on the development branch. Test code

Wed 31 Aug 2011 06:33:17 AM UTC, comment #11:
Thank you.
I'll be waiting for the next release, since I'll be waiting for other updates as well (which I have read about).
I thought I report a bug when I found one.

Tue 30 Aug 2011 11:46:09 PM UTC, comment #10:
This changeset fixes the problem for me:
http://hg.savannah.gnu.org/hgweb/octave/rev/b646413c3d0e
It's a fairly large change I'm not 100% sure about and it's fixing a relatively minor and workaroundable bug, so I pushed it on the default branch.
To see this change, you will need to build from the development sources or wait for our next major stable release.

Tue 30 Aug 2011 03:51:33 PM UTC, comment #9:
Btw, this is enough to reproduce it:
It appears that Qq is a permutation matrix, which is stored sparsely, and attempting to make it negative tries to cast it from a permutation matrix to a full matrix, which is why you run out of memory.
The fix seems to be to make permutation matrices (an internal Octave type) first attempt a cast into sparse matrices into full matrices. I'll look into making this fix.

Tue 30 Aug 2011 03:43:32 PM UTC, comment #8:
Thank you. I can reproduce the problem now. I'll investigate and attempt a fix if someone else doesn't beat me to it.

Tue 30 Aug 2011 02:15:11 PM UTC, comment #7:
and the file... ziped...
(file #23909)

Tue 30 Aug 2011 02:13:48 PM UTC, comment #6:
Ok, I'll try again :P
hopefully both are in this file..

Tue 30 Aug 2011 02:05:38 PM UTC, comment #5:
Sorry to be such a bother, but you seem to have only saved the Y vector...
The save command should be:
and that should produce a rather large file. You should be able to compress it with gzip or similar (please, no rar).

Tue 30 Aug 2011 01:06:18 PM UTC, comment #4:
Oh sorry about that...
I have saved the J and Y in attached files, saved them as binary hope I did it right..
(file #23908)

Tue 30 Aug 2011 12:35:55 PM UTC, comment #3:
You don't mean "crash". A crash is when the operating system sends a signal to a program to termminate immediately, because, for example, the program requested to use memory that the operating system hadn't assigned to it yet. You simply mean "Octave reports an error" or something like that.
The information contained in Q is crucial, because I need to know how much memory it's using, and I also need to know how much memory is available in your system. Please attempt to reproduce this problem with data that you can show me.

Tue 30 Aug 2011 12:13:49 PM UTC, comment #2:
I saw that I forgot the error message..
Can't post all the code and all data sorry, but this is the basics:
[L,U,Pp,Qq,Rr]=lu(J);
Y = ... (a vector)
z1 = Rr\Y;
z2 = L\(Pp*z1);
z3 = U\z2;
dY =(Qq*z3); (this is the step where it crashes)
without ()
dY =Qq*z3;
the following message is posted
error: memory exhausted or requested size too large for range of Octave's index type  trying to return to prompt
I have a sparce matrix J (have a spy as attachment) tried to use just
[L,U]=lu(J);
Y = ...
dY=U\(L\Y);
this does not work good since octave gives
warning: matrix singular to machine precision, rcond = 1
warning: attempting to find minimum norm solution
(file #23907)

Tue 30 Aug 2011 11:57:43 AM UTC, comment #1:
I can't reproduce the problem.
Can you show the actual code that is producing this? What are Q and x?

Tue 30 Aug 2011 11:03:40 AM UTC, original submission:
I have found a strange problem.
I have a big sparse matrix Q (43750 43750) and a vector x
then
Y = Q*x;
gives the error message:
but with
Y = (Q*x);
or
Z = Q*x;
Y = Z;
works fine.. should give same results.
//Mandolin
