[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 0 of 4] Permutation matrices: One bugfix, one enhancement, s
From: |
Jaroslav Hajek |
Subject: |
Re: [PATCH 0 of 4] Permutation matrices: One bugfix, one enhancement, sparse-perm ops, and a use in lu(). |
Date: |
Wed, 11 Mar 2009 07:26:38 +0100 |
On Wed, Mar 11, 2009 at 3:13 AM, Jason Riedy <address@hidden> wrote:
> The bugfix:
> * Make the column permutation vector in sparse LU cols()-long.
>
> The simple enhancement:
> * Add an override to Octave's find() for permutation matrices.
> Seems odd that find takes O(n^2) time on permutation matrices. IIRC,
> it's the only operation to convert a perm. matrix to a perm. vector.
>
Surely not. Try (1:n) * P and P * (1:n)'. In fact using "find" didn't
occur to me at all (but it's a good way as well).
> The operations:
> * Add perm * sparse, perm \ sparse, sparse * perm, and sparse / perm
> operations.
> There might be a way to use the existing indexing ops, but I couldn't
> see it.
Well you could just use Sparse<T>::index. But maybe your approach is
better, because you can use the fact that you know the index is a
permutation. In the case of dense matrices, there is no advantage
(except bypassing a few checks), so it's just done via Array<T>::index
and Array<T>::assign (these are fairly optimized).
> And a future use in lu:
> * sparse-perm-ops Have sparse LU return permutation matrices rather than
> sparse matrices.
> This last one is included mostly because it flushed out the bug, but
> it is a thought for the future.
>
> Jason
>
>
>
--
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz
- [PATCH 0 of 4] Permutation matrices: One bugfix, one enhancement, sparse-perm ops, and a use in lu()., Jason Riedy, 2009/03/10
- [PATCH 1 of 4] Make the column permutation vector in sparse LU cols()-long, Jason Riedy, 2009/03/10
- [PATCH 2 of 4] Add an override to Octave's find() for permutation matrices, Jason Riedy, 2009/03/10
- [PATCH 3 of 4] Add perm * sparse, perm \ sparse, sparse * perm, and sparse / perm operations, Jason Riedy, 2009/03/10
- [PATCH 4 of 4] Have sparse LU return permutation matrices rather than sparse matrices, Jason Riedy, 2009/03/10
- [PATCH 0 of 4] Permutation matrices: One bugfix, one enhancement, sparse-perm ops, and a use in lu()., John W. Eaton, 2009/03/11
- Re: [PATCH 0 of 4] Permutation matrices: One bugfix, one enhancement, sparse-perm ops, and a use in lu().,
Jaroslav Hajek <=