idamnjanovic@24: function y = SL_A(A, mode, m, n, x, I, dim) ivan@128: %% Sparco to SparseLab implicit matix conversion ivan@128: % This is auxilary function to allow implicit matrices from SPARCO ivan@128: % to be used with SparsLab solvers ivan@128: idamnjanovic@24: % Centre for Digital Music, Queen Mary, University of London. idamnjanovic@24: % This file copyright 2009 Ivan Damnjanovic. idamnjanovic@24: % idamnjanovic@24: % This program is free software; you can redistribute it and/or idamnjanovic@24: % modify it under the terms of the GNU General Public License as idamnjanovic@24: % published by the Free Software Foundation; either version 2 of the idamnjanovic@24: % License, or (at your option) any later version. See the file idamnjanovic@24: % COPYING included with this distribution for more information. ivan@128: %% idamnjanovic@24: idamnjanovic@24: if (mode == 1) idamnjanovic@1: idamnjanovic@24: u = zeros(dim, 1); idamnjanovic@24: u(I) = x; idamnjanovic@24: y = A(u,1); idamnjanovic@1: idamnjanovic@24: elseif (mode == 2) idamnjanovic@24: idamnjanovic@24: x2 = A(x,2); idamnjanovic@24: y = x2(I); idamnjanovic@24: idamnjanovic@24: end idamnjanovic@24: idamnjanovic@24: end