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