diff util/SL_A.m @ 1:7750624e0c73 version0.5

(none)
author idamnjanovic
date Thu, 05 Nov 2009 16:36:01 +0000
parents
children 33850553b702
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/util/SL_A.m	Thu Nov 05 16:36:01 2009 +0000
@@ -0,0 +1,20 @@
+  function y = SL_A(mode, m, n, x, I, dim)
+  % Ivan Damnjanovic 2009
+  % This is auxilary function to allow implicit matrices from SPARCO 
+  % to be used with SparsLab solvers
+  
+  global SMALL
+    if (mode == 1)
+    
+            u = zeros(dim, 1);
+            u(I) = x;
+            y = SMALL.Problem.A(u,1);
+           
+        elseif (mode == 2)
+    
+            x2 = SMALL.Problem.A(x,2);
+            y = x2(I);
+           
+     end
+       
+    end
\ No newline at end of file