octave-maintainers
[Top][All Lists]
Advanced

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

[PATCH] Fix conversion from PermMatrix to SparseMatrix.


From: John W. Eaton
Subject: [PATCH] Fix conversion from PermMatrix to SparseMatrix.
Date: Tue, 10 Mar 2009 15:44:53 -0400

On 10-Mar-2009, Jason Riedy wrote:

| # HG changeset patch
| # User Jason Riedy <address@hidden>
| # Date 1236708805 14400
| # Node ID c12f52b84321d53731a0d536d01f3439b09f11ab
| # Parent  42e24f4ebc8c70db07d0fcfd08d70b7a40e5519c
| [PATCH] Fix conversion from PermMatrix to SparseMatrix.
| 
| >From 76c98628f1943d583d5813321ec0a3c684d7ac84 Mon Sep 17 00:00:00 2001
| Date: Tue, 10 Mar 2009 14:12:59 -0400
| The result was transposed and missing its values.  Also add a test case.

I applied this changeset.  To allow the new test to run, I had to change
the line

  %! test

to be

  %!test

But then it failed.  Running it by hand:

  octave:1>  n = 7;
  octave:2>  P = eye (n) (:, randperm (n));
  octave:3>  sP = sparse (P);
  octave:4>  assert (full (sP), full (P));
  octave:5>  assert (size (find (sP), 1), n);
  octave:6>  assert (all (find (sP) (:, 3) == 1));
  error: A(I): Index exceeds matrix dimension.

I omitted the last assert.  What is the intent of that test?

Thanks,

jwe


reply via email to

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