Mercurial > hg > ddm
view lin_solve_dgr_2.m @ 2:e2b116f3b69b
fixed reallocate and pinv_2_fast to work on Octave
added short example very quickly, might not be working properly
author | smusevic |
---|---|
date | Thu, 25 Jul 2013 13:07:07 +0100 |
parents | a4a7e3405062 |
children |
line wrap: on
line source
% solve multiple 2nd degree linear systems at once - no pivoting! function dg2 = lin_solve_dgr_2(A,b,R) nrm = (-A(2,1,:) .* A(1,2,:) + A(1,1,:) .* A(2,2,:)); dg2 = zeros(2,R); dg2(1,:) = -(b(2,1,:) .* A(1,2,:) - b(1,1,:) .* A(2,2,:)) ./ nrm; dg2(2,:) = -(b(1,1,:) .* A(2,1,:) - b(2,1,:) .* A(1,1,:)) ./ nrm; end