Mercurial > hg > smallbox
annotate util/SL_A.m @ 1:7750624e0c73 version0.5
(none)
author | idamnjanovic |
---|---|
date | Thu, 05 Nov 2009 16:36:01 +0000 |
parents | |
children | 33850553b702 |
rev | line source |
---|---|
idamnjanovic@1 | 1 function y = SL_A(mode, m, n, x, I, dim) |
idamnjanovic@1 | 2 % Ivan Damnjanovic 2009 |
idamnjanovic@1 | 3 % This is auxilary function to allow implicit matrices from SPARCO |
idamnjanovic@1 | 4 % to be used with SparsLab solvers |
idamnjanovic@1 | 5 |
idamnjanovic@1 | 6 global SMALL |
idamnjanovic@1 | 7 if (mode == 1) |
idamnjanovic@1 | 8 |
idamnjanovic@1 | 9 u = zeros(dim, 1); |
idamnjanovic@1 | 10 u(I) = x; |
idamnjanovic@1 | 11 y = SMALL.Problem.A(u,1); |
idamnjanovic@1 | 12 |
idamnjanovic@1 | 13 elseif (mode == 2) |
idamnjanovic@1 | 14 |
idamnjanovic@1 | 15 x2 = SMALL.Problem.A(x,2); |
idamnjanovic@1 | 16 y = x2(I); |
idamnjanovic@1 | 17 |
idamnjanovic@1 | 18 end |
idamnjanovic@1 | 19 |
idamnjanovic@1 | 20 end |