~grass/grass/releasebranch_7_0

« back to all changes in this revision

Viewing changes to raster/r.univar/globals.h

  • Committer: glynn
  • Date: 2008-08-16 11:51:17 UTC
  • Revision ID: svn-v4:15284696-431f-4ddb-bdfa-cd5b030d7da7:grass/trunk:32813
Rename directories r.univar2 -> r.univar, r.grow2 -> r.grow, r.cats -> r.category
Remove r.proj

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Calculates univariate statistics from the non-null cells
 
3
 *
 
4
 *   Copyright (C) 2004-2007 by the GRASS Development Team
 
5
 *   Author(s): Soeren Gebbert
 
6
 *              Based on r.univar from Hamish Bowman, University of Otago, New Zealand
 
7
 *              and Martin Landa
 
8
 *
 
9
 *      This program is free software under the GNU General Public
 
10
 *      License (>=v2). Read the file COPYING that comes with GRASS
 
11
 *      for details.
 
12
 *
 
13
 */
 
14
 
 
15
#ifndef _GLOBALS_H_
 
16
#define _GLOBALS_H_
 
17
 
 
18
#include <stdio.h>
 
19
#include <stdlib.h>
 
20
#include <math.h>
 
21
#include <grass/gis.h>
 
22
#include <grass/G3d.h>
 
23
#include <grass/glocale.h>
 
24
 
 
25
/*- Parameters and global variables -----------------------------------------*/
 
26
typedef struct
 
27
{
 
28
    double sum;
 
29
    double sumsq;
 
30
    double min;
 
31
    double max;
 
32
    unsigned int n_perc;
 
33
    int *perc;
 
34
    double sum_abs;
 
35
    int n;
 
36
    int size;
 
37
    DCELL *dcell_array;
 
38
    FCELL *fcell_array;
 
39
    CELL *cell_array;
 
40
    int map_type;
 
41
} univar_stat;
 
42
 
 
43
/* command line options are the same for raster and raster3d maps */
 
44
typedef struct
 
45
{
 
46
    struct Option *inputfile, *percentile;
 
47
    struct Flag *shell_style, *extended;
 
48
} param_type;
 
49
 
 
50
extern param_type param;
 
51
 
 
52
/* fn prototypes */
 
53
void heapsort_double(double *data, int n);
 
54
void heapsort_float(float *data, int n);
 
55
void heapsort_int(int *data, int n);
 
56
int print_stats(univar_stat * stats);
 
57
univar_stat *create_univar_stat_struct(int map_type, int size, int n_perc);
 
58
void free_univar_stat_struct(univar_stat * stats);
 
59
 
 
60
#endif