From 9dfc460f7825213034351f413616137f8b299217 Mon Sep 17 00:00:00 2001 From: treecity Date: Fri, 22 Apr 2011 09:51:28 +0000 Subject: [PATCH] [src] Mex und Matlab machen das gleiche git-svn-id: https://drops.fb12.tu-berlin.de/svn/bacc/trunk@14 26120e32-c555-405d-b3e1-1f783fb42516 --- src/G00.m | 8 +++++--- src/build_A.cpp | 18 ++++++++++++------ src/g0.m | 21 +++++++++++---------- src/test_solve.m | 2 +- 4 files changed, 29 insertions(+), 20 deletions(-) diff --git a/src/G00.m b/src/G00.m index 1112d9f..b725d43 100644 --- a/src/G00.m +++ b/src/G00.m @@ -1,6 +1,6 @@ function sol = G00(p,y1,y2,x1,x2,l) - -% sol = nan; +% fprintf('%.1f | %.1f %.1f | %.1f %.1f | %.1f +',p,x1,x2,y1,y2,l); + sol = 0; if(p==-1.5) if(l==0) sol = -sqrt((y1-x1)^2+(y2-x2)^2)/((y1-x1)*(y2-x2)); @@ -10,7 +10,9 @@ function sol = G00(p,y1,y2,x1,x2,l) /(((y1-x1)^2+l^2)*((y2-x2)^2+l^2))+1); end elseif(p==-0.5) - sol = 2*p*l^2*G00(p-1,y1,y2,x1,x2,l); + if(l~=0) + sol = 2*p*l^2*G00(p-1,y1,y2,x1,x2,l); + end if((y1-x1)~=0) sol = sol + (y1-x1)*g0(p,y2,x2,sqrt((y1-x1)^2+l^2)); end diff --git a/src/build_A.cpp b/src/build_A.cpp index 3fb7295..5896472 100644 --- a/src/build_A.cpp +++ b/src/build_A.cpp @@ -133,7 +133,7 @@ for (int j=0;j