[GRASS-SVN] r45793 -
grass/tags/release_20110103_grass_6_4_1RC1/raster3d/r3.stats
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Mar 28 03:27:04 EDT 2011
Author: huhabla
Date: 2011-03-28 00:27:04 -0700 (Mon, 28 Mar 2011)
New Revision: 45793
Modified:
grass/tags/release_20110103_grass_6_4_1RC1/raster3d/r3.stats/description.html
grass/tags/release_20110103_grass_6_4_1RC1/raster3d/r3.stats/main.c
Log:
Reverted r45707
Modified: grass/tags/release_20110103_grass_6_4_1RC1/raster3d/r3.stats/description.html
===================================================================
--- grass/tags/release_20110103_grass_6_4_1RC1/raster3d/r3.stats/description.html 2011-03-27 18:50:32 UTC (rev 45792)
+++ grass/tags/release_20110103_grass_6_4_1RC1/raster3d/r3.stats/description.html 2011-03-28 07:27:04 UTC (rev 45793)
@@ -9,7 +9,7 @@
<H2>NOTES</H2>
-As with most GRASS raster3D modules, <EM>r3.stats</EM> operates on the cell
+As with most GRASS raster3D modules, <EM>r3.univar</EM> operates on the cell
array defined by the current 3D region settings, not the original extent and
resolution of the input map. See <em><A HREF="g.region.html">g.region</A></em>.
<P>
Modified: grass/tags/release_20110103_grass_6_4_1RC1/raster3d/r3.stats/main.c
===================================================================
--- grass/tags/release_20110103_grass_6_4_1RC1/raster3d/r3.stats/main.c 2011-03-27 18:50:32 UTC (rev 45792)
+++ grass/tags/release_20110103_grass_6_4_1RC1/raster3d/r3.stats/main.c 2011-03-28 07:27:04 UTC (rev 45793)
@@ -52,16 +52,16 @@
} equal_val_array;
/*prototypes */
-static equal_val_array *alloc_equal_val_array(int count);
-static void free_equal_val_array(equal_val_array * vals);
-static equal_val_array *add_equal_val_to_array(equal_val_array * array, double val);
-static int check_equal_value(equal_val_array * array, double val);
-static stat_table *create_stat_table(int nsteps, equal_val_array * values,
+equal_val_array *alloc_equal_val_array(int count);
+void free_equal_val_array(equal_val_array * vals);
+equal_val_array *add_equal_val_to_array(equal_val_array * array, double val);
+int check_equal_value(equal_val_array * array, double val);
+stat_table *create_stat_table(int nsteps, equal_val_array * values,
double min, double max);
-static void free_stat_table(stat_table * stats);
-static void print_stat_table(stat_table * stats);
-static void update_stat_table(stat_table * stats, G3D_Region * region);
-static void heapsort_eqvals(equal_val_array * data, int n);
+void free_stat_table(stat_table * stats);
+void print_stat_table(stat_table * stats);
+void update_stat_table(stat_table * stats, G3D_Region * region);
+void heapsort_eqvals(equal_val_array * data, int n);
static void downheap_eqvals(equal_val_array * data, int n, int k);
static void check_range_value(stat_table * stats, double value);
static void tree_search_range(stat_table * stats, int left, int right,
@@ -546,14 +546,14 @@
float val_f; /* for misc use */
double val_d; /* for misc use */
- stat_table *stats = NULL;
+ stat_table *stats;
double min, max;
- equal_val_array *eqvals = NULL;
+ equal_val_array *eqvals;
unsigned int n = 0, nsteps;
int map_type;
- char *infile = NULL;
- void *map = NULL;
+ char *infile;
+ void *map;
G3D_Region region;
unsigned int rows, cols, depths;
unsigned int x, y, z;
@@ -660,18 +660,18 @@
}
}
- if (eqvals) {
- /* sort the equal values array */
- G_message(_("Sort non-null values"));
- heapsort_eqvals(eqvals, eqvals->count);
+ /* sort the equal values array */
+ G_message(_("Sort non-null values"));
+ heapsort_eqvals(eqvals, eqvals->count);
- /* create the statistic table with equal values */
- stats = create_stat_table(eqvals->count, eqvals, 0, 0);
- /* compute the number of null values */
- stats->null->count = rows * cols * depths - n;
+ /* create the statistic table with equal values */
+ stats = create_stat_table(eqvals->count, eqvals, 0, 0);
+ /* compute the number of null values */
+ stats->null->count = rows * cols * depths - n;
- free_equal_val_array(eqvals);
- }
+ if (eqvals)
+ free_equal_val_array(eqvals);
+
}
else {
@@ -709,14 +709,11 @@
stats->null->count = rows * cols * depths - n;
}
- if(stats) {
- /* Compute the volume and percentage */
- update_stat_table(stats, ®ion);
- /* Print the statistics to stdout */
- print_stat_table(stats);
+ /* Compute the volume and percentage */
+ update_stat_table(stats, ®ion);
+ /* Print the statistics to stdout */
+ print_stat_table(stats);
- free_stat_table(stats);
- }
-
+ free_stat_table(stats);
exit(EXIT_SUCCESS);
}
More information about the grass-commit
mailing list