[GRASS-SVN] r50030 - grass/trunk/vector/v.surf.bspline

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jan 1 21:45:10 EST 2012


Author: huhabla
Date: 2012-01-01 18:45:10 -0800 (Sun, 01 Jan 2012)
New Revision: 50030

Modified:
   grass/trunk/vector/v.surf.bspline/Makefile
   grass/trunk/vector/v.surf.bspline/main.c
Log:
Added a second highly parallelized solver which may be faster 
in some situtations.


Modified: grass/trunk/vector/v.surf.bspline/Makefile
===================================================================
--- grass/trunk/vector/v.surf.bspline/Makefile	2012-01-02 02:42:39 UTC (rev 50029)
+++ grass/trunk/vector/v.surf.bspline/Makefile	2012-01-02 02:45:10 UTC (rev 50030)
@@ -2,8 +2,8 @@
 
 PGM = v.surf.bspline
 
-LIBES = $(LIDARLIB) $(GMATHLIB) $(VECTORLIB) $(DBMILIB) $(RASTERLIB) $(GISLIB) $(SEGMENTLIB) $(MATHLIB)
-DEPENDENCIES = $(LIDARDEP) $(GMATHDEP) $(VECTORDEP) $(DBMIDEP) $(RASTERDEP) $(SEGMENTDEP) $(GISDEP)
+LIBES = $(LIDARLIB) $(GMATHLIB) $(VECTORLIB) $(DBMILIB) $(RASTERLIB) $(GISLIB) $(SEGMENTLIB) $(MATHLIB) $(GPDELIB)
+DEPENDENCIES = $(LIDARDEP) $(GMATHDEP) $(VECTORDEP) $(DBMIDEP) $(RASTERDEP) $(SEGMENTDEP) $(GISDEP) $(GPDEDEP)
 EXTRA_INC = $(VECT_INC)
 EXTRA_CFLAGS = $(VECT_CFLAGS)
 

Modified: grass/trunk/vector/v.surf.bspline/main.c
===================================================================
--- grass/trunk/vector/v.surf.bspline/main.c	2012-01-02 02:42:39 UTC (rev 50029)
+++ grass/trunk/vector/v.surf.bspline/main.c	2012-01-02 02:45:10 UTC (rev 50030)
@@ -26,6 +26,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include "bspline.h"
+#include <grass/N_pde.h>
 
 #define SEGSIZE 64
 
@@ -68,7 +69,7 @@
     struct GModule *module;
     struct Option *in_opt, *in_ext_opt, *out_opt, *out_map_opt, *stepE_opt,
 	*stepN_opt, *lambda_f_opt, *type_opt, *dfield_opt, *col_opt, *mask_opt,
-	*memory_opt;
+	*memory_opt, *solver, *error, *iter;
     struct Flag *cross_corr_flag, *spline_step_flag, *withz_flag;
 
     struct Reg_dimens dims;
@@ -177,6 +178,14 @@
 	_("Name of attribute column with values to approximate");
     col_opt->guisection = _("Settings");
 
+    solver = N_define_standard_option(N_OPT_SOLVER_SYMM);
+    solver->options = "cholesky,cg";
+    solver->answer = "cholesky";
+
+    iter = N_define_standard_option(N_OPT_MAX_ITERATIONS);
+
+    error = N_define_standard_option(N_OPT_ITERATION_ERROR);
+
     memory_opt = G_define_option();
     memory_opt->key = "memory";
     memory_opt->type = TYPE_INTEGER;
@@ -747,8 +756,12 @@
 		    nCorrectGrad(N, lambda, nsplx, nsply, stepE, stepN);
 		}
 
-		G_math_solver_cholesky_sband(N, parVect, TN, nparameters, BW);
+                if(G_strncasecmp(solver->answer, "cg", 2) == 0)
+                    G_math_solver_cg_sband(N, parVect, TN, nparameters, BW, atoi(iter->answer), atof(error->answer));
+		else
+		    G_math_solver_cholesky_sband(N, parVect, TN, nparameters, BW);
 
+
 		G_free_matrix(N);
 		G_free_vector(TN);
 		G_free_vector(Q);



More information about the grass-commit mailing list