[GRASS-SVN] r53173 - in grass/branches/releasebranch_6_4/vector/lidar: lidarlib v.lidar.correction v.lidar.edgedetection v.outlier v.surf.bspline

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Sep 12 11:52:30 PDT 2012


Author: neteler
Date: 2012-09-12 11:52:29 -0700 (Wed, 12 Sep 2012)
New Revision: 53173

Modified:
   grass/branches/releasebranch_6_4/vector/lidar/lidarlib/PolimiFunct.h
   grass/branches/releasebranch_6_4/vector/lidar/lidarlib/TcholBand.c
   grass/branches/releasebranch_6_4/vector/lidar/v.lidar.correction/main.c
   grass/branches/releasebranch_6_4/vector/lidar/v.lidar.edgedetection/main.c
   grass/branches/releasebranch_6_4/vector/lidar/v.outlier/main.c
   grass/branches/releasebranch_6_4/vector/lidar/v.surf.bspline/crosscorr.c
   grass/branches/releasebranch_6_4/vector/lidar/v.surf.bspline/main.c
Log:
calm down G_percent() in cross-validation mode

Modified: grass/branches/releasebranch_6_4/vector/lidar/lidarlib/PolimiFunct.h
===================================================================
--- grass/branches/releasebranch_6_4/vector/lidar/lidarlib/PolimiFunct.h	2012-09-12 13:23:46 UTC (rev 53172)
+++ grass/branches/releasebranch_6_4/vector/lidar/lidarlib/PolimiFunct.h	2012-09-12 18:52:29 UTC (rev 53173)
@@ -161,13 +161,13 @@
 
 /*----------------------------------------------------------------------------------------------------------*/
 /*tcholBand */
-void tcholDec(double **N, double **T, int n, int BW);
-void tcholSolve(double **N, double *TN, double *parVect, int n, int BW);
+void tcholDec(double **N, double **T, int n, int BW, int CV);
+void tcholSolve(double **N, double *TN, double *parVect, int n, int BW, int CV);
 void tcholSolve2(double **N, double *TN, double **T, double *parVect, int n,
 		 int BW);
-void tcholInv(double **N, double *invNdiag, int n, int BW);
+void tcholInv(double **N, double *invNdiag, int n, int BW, int CV);
 void tcholSolveInv(double **N, double *TN, double *invNdiag, double *parVect,
-		   int n, int BW);
+		   int n, int BW, int CV);
 
 /*---------------------------------------------------------------------------------------*/
 /*interpSpline */

Modified: grass/branches/releasebranch_6_4/vector/lidar/lidarlib/TcholBand.c
===================================================================
--- grass/branches/releasebranch_6_4/vector/lidar/lidarlib/TcholBand.c	2012-09-12 13:23:46 UTC (rev 53172)
+++ grass/branches/releasebranch_6_4/vector/lidar/lidarlib/TcholBand.c	2012-09-12 18:52:29 UTC (rev 53173)
@@ -5,9 +5,9 @@
 #include <grass/PolimiFunct.h>
 
 /*--------------------------------------------------------------------------------------*/
-/* Tcholetsky decomposition -> T= Lower Triangular Matrix */
+/* Cholesky decomposition -> T= Lower Triangular Matrix */
 
-void tcholDec(double **N, double **T, int n, int BW)
+void tcholDec(double **N, double **T, int n, int BW, int CV)
 {
     int i, j, k, end;
     double somma;
@@ -15,7 +15,7 @@
     G_debug(2, "tcholDec(): n=%d  BW=%d", n, BW);
 
     for (i = 0; i < n; i++) {
-	G_percent(i, n, 2);
+	if (CV == 0) G_percent(i, n, 2);
 	for (j = 0; j < BW; j++) {
 	    somma = N[i][j];
 	    /* start = 1 */
@@ -33,14 +33,14 @@
 	}
     }
 
-    G_percent(i, n, 2);
+    if (CV == 0) G_percent(i, n, 2);
     return;
 }
 
 /*--------------------------------------------------------------------------------------*/
-/* Tcholetsky matrix solution */
+/* Cholesky matrix solution */
 
-void tcholSolve(double **N, double *TN, double *parVect, int n, int BW)
+void tcholSolve(double **N, double *TN, double *parVect, int n, int BW, int CV)
 {
 
     double **T;
@@ -50,7 +50,7 @@
     T = G_alloc_matrix(n, BW);
 
 	/*--------------------------------------*/
-    tcholDec(N, T, n, BW);	/* T computation                */
+    tcholDec(N, T, n, BW, CV);	/* T computation                */
 
     /* Forward substitution */
     parVect[0] = TN[0] / T[0][0];
@@ -83,7 +83,7 @@
 
 
 /*--------------------------------------------------------------------------------------*/
-/* Soluzione con Tcholetsky -> la matrice T triangolare viene passata come paramtero e 
+/* Soluzione con Cholesky -> la matrice T triangolare viene passata come paramtero e 
    non calcolata internamente alla procedura -> T = dmatrix (0, n-1, 0, BW-1) */
 
 void tcholSolve2(double **N, double *TN, double **T, double *parVect, int n,
@@ -119,9 +119,9 @@
 }
 
 /*--------------------------------------------------------------------------------------*/
-/* Tcholetsky matrix invertion */
+/* Cholesky matrix inversion */
 
-void tcholInv(double **N, double *invNdiag, int n, int BW)
+void tcholInv(double **N, double *invNdiag, int n, int BW, int CV)
 {
     double **T = NULL;
     double *vect = NULL;
@@ -133,7 +133,7 @@
     vect = G_alloc_vector(n);
 
     /* T computation                */
-    tcholDec(N, T, n, BW);
+    tcholDec(N, T, n, BW, CV);
 
     /* T Diagonal invertion */
     for (i = 0; i < n; i++) {
@@ -165,10 +165,10 @@
 }
 
 /*--------------------------------------------------------------------------------------*/
-/* Tcholetsky matrix solution and invertion */
+/* Cholesky matrix solution and inversion */
 
 void tcholSolveInv(double **N, double *TN, double *invNdiag, double *parVect,
-		   int n, int BW)
+		   int n, int BW, int CV)
 {
 
     double **T = NULL;
@@ -181,7 +181,7 @@
     vect = G_alloc_vector(n);
 
     /* T computation                */
-    tcholDec(N, T, n, BW);
+    tcholDec(N, T, n, BW, CV);
 
     /* Forward substitution */
     parVect[0] = TN[0] / T[0][0];

Modified: grass/branches/releasebranch_6_4/vector/lidar/v.lidar.correction/main.c
===================================================================
--- grass/branches/releasebranch_6_4/vector/lidar/v.lidar.correction/main.c	2012-09-12 13:23:46 UTC (rev 53172)
+++ grass/branches/releasebranch_6_4/vector/lidar/v.lidar.correction/main.c	2012-09-12 18:52:29 UTC (rev 53173)
@@ -406,7 +406,7 @@
 			       elaboration_reg.south, nterrain, nparameters,
 			       BW);
 		nCorrectGrad(N, lambda, nsplx, nsply, passoE, passoN);
-		tcholSolve(N, TN, parVect, nparameters, BW);
+		tcholSolve(N, TN, parVect, nparameters, BW, 0);
 
 		G_free_matrix(N);
 		G_free_vector(TN);

Modified: grass/branches/releasebranch_6_4/vector/lidar/v.lidar.edgedetection/main.c
===================================================================
--- grass/branches/releasebranch_6_4/vector/lidar/v.lidar.edgedetection/main.c	2012-09-12 13:23:46 UTC (rev 53172)
+++ grass/branches/releasebranch_6_4/vector/lidar/v.lidar.edgedetection/main.c	2012-09-12 18:52:29 UTC (rev 53173)
@@ -420,7 +420,7 @@
 			       elaboration_reg.south, npoints, nparameters,
 			       BW);
 		nCorrectGrad(N, lambda_B, nsplx, nsply, passoE, passoN);
-		tcholSolve(N, TN, parVect_bilin, nparameters, BW);
+		tcholSolve(N, TN, parVect_bilin, nparameters, BW, 0);
 
 		G_free_matrix(N);
 		for (tn = 0; tn < nparameters; tn++)
@@ -437,7 +437,7 @@
 				 elaboration_reg.south, npoints, nparameters,
 				 BW);
 		nCorrectLapl(N, lambda_F, nsplx, nsply, passoE, passoN);
-		tcholSolve(N, TN, parVect_bicub, nparameters, BW);
+		tcholSolve(N, TN, parVect_bicub, nparameters, BW, 0);
 
 		G_free_matrix(N);
 		G_free_vector(TN);

Modified: grass/branches/releasebranch_6_4/vector/lidar/v.outlier/main.c
===================================================================
--- grass/branches/releasebranch_6_4/vector/lidar/v.outlier/main.c	2012-09-12 13:23:46 UTC (rev 53172)
+++ grass/branches/releasebranch_6_4/vector/lidar/v.outlier/main.c	2012-09-12 18:52:29 UTC (rev 53173)
@@ -396,7 +396,7 @@
 			       elaboration_reg.south, npoints, nparameters,
 			       BW);
 		nCorrectGrad(N, lambda, nsplx, nsply, passoE, passoN);
-		tcholSolve(N, TN, parVect, nparameters, BW);
+		tcholSolve(N, TN, parVect, nparameters, BW, 0);
 
 		G_free_matrix(N);
 		G_free_vector(TN);

Modified: grass/branches/releasebranch_6_4/vector/lidar/v.surf.bspline/crosscorr.c
===================================================================
--- grass/branches/releasebranch_6_4/vector/lidar/v.surf.bspline/crosscorr.c	2012-09-12 13:23:46 UTC (rev 53172)
+++ grass/branches/releasebranch_6_4/vector/lidar/v.surf.bspline/crosscorr.c	2012-09-12 18:52:29 UTC (rev 53173)
@@ -257,7 +257,7 @@
 		   if (bilin) interpolation (&interp, P_BILINEAR);
 		   else interpolation (&interp, P_BICUBIC);
 		 */
-		tcholSolve(N, TN, parVect, nparam_spl, BW);
+		tcholSolve(N, TN, parVect, nparam_spl, BW, 1);
 
 		/* Estimation of j-point */
 		if (bilin)

Modified: grass/branches/releasebranch_6_4/vector/lidar/v.surf.bspline/main.c
===================================================================
--- grass/branches/releasebranch_6_4/vector/lidar/v.surf.bspline/main.c	2012-09-12 13:23:46 UTC (rev 53172)
+++ grass/branches/releasebranch_6_4/vector/lidar/v.surf.bspline/main.c	2012-09-12 18:52:29 UTC (rev 53173)
@@ -610,7 +610,7 @@
 		    nCorrectGrad(N, lambda, nsplx, nsply, passoE, passoN);
 		}
 
-		tcholSolve(N, TN, parVect, nparameters, BW);
+		tcholSolve(N, TN, parVect, nparameters, BW, cross_corr_flag->answer);
 
 		G_free_matrix(N);
 		G_free_vector(TN);



More information about the grass-commit mailing list