Code

fixed a bug in sqrt(pwsb).
authorjfbarraud <jfbarraud@users.sourceforge.net>
Wed, 30 Jan 2008 22:59:31 +0000 (22:59 +0000)
committerjfbarraud <jfbarraud@users.sourceforge.net>
Wed, 30 Jan 2008 22:59:31 +0000 (22:59 +0000)
src/2geom/sbasis-math.cpp

index 0140862b56ae51338141610c44d874237f7fe72a..08647959ac55afdfe10f9977a23eb3c325bdd590 100644 (file)
@@ -145,7 +145,9 @@ Piecewise<SBasis> sqrt(SBasis const &f, double tol, int order){
 
 Piecewise<SBasis> sqrt(Piecewise<SBasis> const &f, double tol, int order){
     Piecewise<SBasis> result;
-    Piecewise<SBasis> ff=max(f,Linear(tol*tol));
+    Piecewise<SBasis> zero = Piecewise<SBasis>(Linear(tol*tol));
+    zero.setDomain(f.domain());
+    Piecewise<SBasis> ff=max(f,zero);
 
     for (unsigned i=0; i<ff.size(); i++){
         Piecewise<SBasis> sqrtfi = sqrt_internal(ff.segs[i],tol,order);