Changeset 62279
- Timestamp:
- Oct 17, 2014, 8:55:35 AM (10 years ago)
- Location:
- grass/branches/releasebranch_7_0/raster/r.li
- Files:
-
- 7 edited
-
r.li.daemon/avl.c (modified) (2 diffs)
-
r.li.daemon/avl.h (modified) (1 diff)
-
r.li.dominance/dominance.c (modified) (6 diffs)
-
r.li.pielou/pielou.c (modified) (6 diffs)
-
r.li.renyi/renyi.c (modified) (6 diffs)
-
r.li.shannon/shannon.c (modified) (6 diffs)
-
r.li.simpson/simpson.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
grass/branches/releasebranch_7_0/raster/r.li/r.li.daemon/avl.c
r59044 r62279 194 194 195 195 196 long avl_to_array(avl_node * root, long i, AVL_table *a)196 long avl_to_array(avl_node * root, long i, AVL_table a) 197 197 { 198 198 … … 202 202 G_fatal_error("avl, avl_to_array: null value"); 203 203 else { 204 a[i] = G_malloc(sizeof(AVL_tableRow)); 205 a[i]->k = root->key; 206 a[i]->tot = root->counter; 204 a[i].k = root->key; 205 a[i].tot = root->counter; 207 206 i++; 208 207 i = avl_to_array(root->right_child, i, a); -
grass/branches/releasebranch_7_0/raster/r.li/r.li.daemon/avl.h
r59025 r62279 38 38 avl_node *avl_find(const avl_tree root, const generic_cell k); 39 39 int avl_add(avl_tree * root, const generic_cell k, const long n); 40 long avl_to_array(avl_node * root, long i, AVL_table *a);40 long avl_to_array(avl_node * root, long i, AVL_table a); 41 41 long howManyCell(const avl_tree root, const generic_cell k); 42 42 -
grass/branches/releasebranch_7_0/raster/r.li/r.li.dominance/dominance.c
r59170 r62279 124 124 125 125 avl_tree albero = NULL; 126 AVL_table *array;126 AVL_table array; 127 127 generic_cell uc; 128 128 … … 270 270 shannon = 0; 271 271 for (i = 0; i < m; i++) { 272 t = array[i] ->tot;272 t = array[i].tot; 273 273 perc = t / area; 274 274 logarithm = log(perc); … … 311 311 312 312 avl_tree albero = NULL; 313 AVL_table *array;313 AVL_table array; 314 314 generic_cell uc; 315 315 … … 457 457 shannon = 0; 458 458 for (i = 0; i < m; i++) { 459 t = array[i] ->tot;459 t = array[i].tot; 460 460 perc = t / area; 461 461 logarithm = log(perc); … … 498 498 499 499 avl_tree albero = NULL; 500 AVL_table *array;500 AVL_table array; 501 501 generic_cell uc; 502 502 … … 644 644 shannon = 0; 645 645 for (i = 0; i < m; i++) { 646 t = array[i] ->tot;646 t = array[i].tot; 647 647 perc = t / area; 648 648 logarithm = log(perc); -
grass/branches/releasebranch_7_0/raster/r.li/r.li.pielou/pielou.c
r59170 r62279 124 124 125 125 avl_tree albero = NULL; 126 AVL_table *array;126 AVL_table array; 127 127 generic_cell uc; 128 128 … … 270 270 shannon = 0; 271 271 for (i = 0; i < m; i++) { 272 t = array[i] ->tot;272 t = array[i].tot; 273 273 perc = t / area; 274 274 logarithm = log(perc); … … 311 311 312 312 avl_tree albero = NULL; 313 AVL_table *array;313 AVL_table array; 314 314 generic_cell uc; 315 315 … … 457 457 shannon = 0; 458 458 for (i = 0; i < m; i++) { 459 t = array[i] ->tot;459 t = array[i].tot; 460 460 perc = t / area; 461 461 logarithm = log(perc); … … 498 498 499 499 avl_tree albero = NULL; 500 AVL_table *array;500 AVL_table array; 501 501 generic_cell uc; 502 502 … … 644 644 shannon = 0; 645 645 for (i = 0; i < m; i++) { 646 t = array[i] ->tot;646 t = array[i].tot; 647 647 perc = t / area; 648 648 logarithm = log(perc); -
grass/branches/releasebranch_7_0/raster/r.li/r.li.renyi/renyi.c
r59300 r62279 148 148 149 149 avl_tree albero = NULL; 150 AVL_table *array;150 AVL_table array; 151 151 generic_cell uc; 152 152 … … 298 298 sum2 = 0; 299 299 for (i = 0; i < m; i++) { 300 t = array[i] ->tot;300 t = array[i].tot; 301 301 pi = t / area; 302 302 sum += pow(pi, alpha); … … 349 349 350 350 avl_tree albero = NULL; 351 AVL_table *array;351 AVL_table array; 352 352 generic_cell uc; 353 353 … … 499 499 sum2 = 0; 500 500 for (i = 0; i < m; i++) { 501 t = array[i] ->tot;501 t = array[i].tot; 502 502 pi = t / area; 503 503 sum += pow(pi, alpha); … … 550 550 551 551 avl_tree albero = NULL; 552 AVL_table *array;552 AVL_table array; 553 553 generic_cell uc; 554 554 … … 700 700 sum2 = 0; 701 701 for (i = 0; i < m; i++) { 702 t = array[i] ->tot;702 t = array[i].tot; 703 703 pi = t / area; 704 704 sum += pow(pi, alpha); -
grass/branches/releasebranch_7_0/raster/r.li/r.li.shannon/shannon.c
r59170 r62279 124 124 125 125 avl_tree albero = NULL; 126 AVL_table *array;126 AVL_table array; 127 127 generic_cell uc; 128 128 … … 270 270 shannon = 0; 271 271 for (i = 0; i < m; i++) { 272 t = array[i] ->tot;272 t = array[i].tot; 273 273 perc = t / area; 274 274 logarithm = log(perc); … … 311 311 312 312 avl_tree albero = NULL; 313 AVL_table *array;313 AVL_table array; 314 314 generic_cell uc; 315 315 … … 457 457 shannon = 0; 458 458 for (i = 0; i < m; i++) { 459 t = array[i] ->tot;459 t = array[i].tot; 460 460 perc = t / area; 461 461 logarithm = log(perc); … … 498 498 499 499 avl_tree albero = NULL; 500 AVL_table *array;500 AVL_table array; 501 501 generic_cell uc; 502 502 … … 644 644 shannon = 0; 645 645 for (i = 0; i < m; i++) { 646 t = array[i] ->tot;646 t = array[i].tot; 647 647 perc = t / area; 648 648 logarithm = log(perc); -
grass/branches/releasebranch_7_0/raster/r.li/r.li.simpson/simpson.c
r59170 r62279 124 124 125 125 avl_tree albero = NULL; 126 AVL_table *array;126 AVL_table array; 127 127 generic_cell uc; 128 128 … … 270 270 simpson = 0; 271 271 for (i = 0; i < m; i++) { 272 t = (double)(array[i] ->tot);272 t = (double)(array[i].tot); 273 273 p = t / area; 274 274 simpson += (p * p); … … 310 310 311 311 avl_tree albero = NULL; 312 AVL_table *array;312 AVL_table array; 313 313 generic_cell uc; 314 314 … … 456 456 simpson = 0; 457 457 for (i = 0; i < m; i++) { 458 t = (double)(array[i] ->tot);458 t = (double)(array[i].tot); 459 459 p = t / area; 460 460 simpson += (p * p); … … 496 496 497 497 avl_tree albero = NULL; 498 AVL_table *array;498 AVL_table array; 499 499 generic_cell uc; 500 500 … … 642 642 simpson = 0; 643 643 for (i = 0; i < m; i++) { 644 t = (double)(array[i] ->tot);644 t = (double)(array[i].tot); 645 645 p = t / area; 646 646 simpson += (p * p);
Note:
See TracChangeset
for help on using the changeset viewer.
