Mercurial > hg > smallbox
annotate util/SL_A.m @ 162:88578ec2f94a danieleb
Updated grassmannian function and minor debugs
author | Daniele Barchiesi <daniele.barchiesi@eecs.qmul.ac.uk> |
---|---|
date | Wed, 31 Aug 2011 13:52:23 +0100 |
parents | 8e660fd14774 |
children |
rev | line source |
---|---|
idamnjanovic@24 | 1 function y = SL_A(A, mode, m, n, x, I, dim) |
ivan@128 | 2 %% Sparco to SparseLab implicit matix conversion |
ivan@128 | 3 % This is auxilary function to allow implicit matrices from SPARCO |
ivan@128 | 4 % to be used with SparsLab solvers |
ivan@128 | 5 |
idamnjanovic@24 | 6 % Centre for Digital Music, Queen Mary, University of London. |
idamnjanovic@24 | 7 % This file copyright 2009 Ivan Damnjanovic. |
idamnjanovic@24 | 8 % |
idamnjanovic@24 | 9 % This program is free software; you can redistribute it and/or |
idamnjanovic@24 | 10 % modify it under the terms of the GNU General Public License as |
idamnjanovic@24 | 11 % published by the Free Software Foundation; either version 2 of the |
idamnjanovic@24 | 12 % License, or (at your option) any later version. See the file |
idamnjanovic@24 | 13 % COPYING included with this distribution for more information. |
ivan@128 | 14 %% |
idamnjanovic@24 | 15 |
idamnjanovic@24 | 16 if (mode == 1) |
idamnjanovic@1 | 17 |
idamnjanovic@24 | 18 u = zeros(dim, 1); |
idamnjanovic@24 | 19 u(I) = x; |
idamnjanovic@24 | 20 y = A(u,1); |
idamnjanovic@1 | 21 |
idamnjanovic@24 | 22 elseif (mode == 2) |
idamnjanovic@24 | 23 |
idamnjanovic@24 | 24 x2 = A(x,2); |
idamnjanovic@24 | 25 y = x2(I); |
idamnjanovic@24 | 26 |
idamnjanovic@24 | 27 end |
idamnjanovic@24 | 28 |
idamnjanovic@24 | 29 end |