openModeller  Version 1.4.0
Utilities.h File Reference
#include <openmodeller/Exceptions.hh>
#include <math.h>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
Include dependency graph for Utilities.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  GarpException
class  GarpUtil
class  BioclimHistogram

Defines

#define Maxflag   1
#define BETTER(X, Y)   (Maxflag ? (X) > (Y) : (X) < (Y))
#define MAX_BYTE   255
#define MAKEWORD(a, b)   ((WORD)(((BYTE)(a)) | ((WORD)((BYTE)(b))) << 8))
#define MAKELONG(a, b)   ((LONG)(((WORD)(a)) | ((DWORD)((WORD)(b))) << 16))
#define LOWORD(l)   ((WORD)(l))
#define HIWORD(l)   ((WORD)(((DWORD)(l) >> 16) & 0xFFFF))
#define LOBYTE(w)   ((BYTE)(w))
#define HIBYTE(w)   ((BYTE)(((WORD)(w) >> 8) & 0xFF))

Typedefs

typedef unsigned char BYTE
typedef unsigned long DWORD
typedef int BOOL
typedef unsigned short WORD

Functions

int getFileSize (char *strFilename)

Variables

const int CHAR_ARRAY_SIZE = 256
const int FILE_CHUNK = 1024
const double EPS = 0.000001
const int MASK = 2147483647
const int PRIME = 65539
const double SCALE = 0.4656612875e-9
const int MAX_ENV_LAYERS = 256
const int MAX_PRESENCE_POINTS = 100000
const int MAX_RULES = 256
const int MIN_SCALED_VALUE = 1
const int MAX_SCALED_VALUE = 254
const int SCALED_VALUE_RANGE = MAX_SCALED_VALUE - MIN_SCALED_VALUE
const int MAX_MUTATION_TEMPERATURE = (int) SCALED_VALUE_RANGE
const int MIN_SIG_NO = 4
const BYTE MASK_VALUE = 255
const BYTE MISSING_VALUE = 254
const BYTE PRESENCE = 1
const BYTE ABSENCE = 0
unsigned long Seed
unsigned long OrigSeed

Define Documentation

#define BETTER (   X,
 
)    (Maxflag ? (X) > (Y) : (X) < (Y))

Definition at line 43 of file Utilities.h.

Referenced by GarpAlgorithm::evaluate(), and GarpAlgorithm::measure().

#define HIBYTE (   w)    ((BYTE)(((WORD)(w) >> 8) & 0xFF))

Definition at line 89 of file Utilities.h.

#define HIWORD (   l)    ((WORD)(((DWORD)(l) >> 16) & 0xFFFF))

Definition at line 87 of file Utilities.h.

#define LOBYTE (   w)    ((BYTE)(w))

Definition at line 88 of file Utilities.h.

#define LOWORD (   l)    ((WORD)(l))

Definition at line 86 of file Utilities.h.

#define MAKELONG (   a,
 
)    ((LONG)(((WORD)(a)) | ((DWORD)((WORD)(b))) << 16))

Definition at line 85 of file Utilities.h.

#define MAKEWORD (   a,
 
)    ((WORD)(((BYTE)(a)) | ((WORD)((BYTE)(b))) << 8))

Definition at line 84 of file Utilities.h.

#define MAX_BYTE   255

Definition at line 80 of file Utilities.h.

Referenced by GarpAlgorithm::join().

#define Maxflag   1

Definition at line 42 of file Utilities.h.

Referenced by GarpAlgorithm::select().


Typedef Documentation

typedef int BOOL

Definition at line 76 of file Utilities.h.

typedef unsigned char BYTE

Definition at line 36 of file Utilities.h.

typedef unsigned long DWORD

Definition at line 75 of file Utilities.h.

typedef unsigned short WORD

Definition at line 78 of file Utilities.h.


Function Documentation

int getFileSize ( char *  strFilename)

Returns the first element child that matches the given name. Includes the parent in search. Remember that XML names are case-sensitive.

Returns:
the first element that matches the given name, NULL if not found.

Definition at line 39 of file Utilities.cpp.


Variable Documentation

const BYTE ABSENCE = 0

Definition at line 68 of file Utilities.h.

const int CHAR_ARRAY_SIZE = 256

Definition at line 45 of file Utilities.h.

const double EPS = 0.000001

Definition at line 48 of file Utilities.h.

const int FILE_CHUNK = 1024

Definition at line 46 of file Utilities.h.

const int MASK = 2147483647

Definition at line 49 of file Utilities.h.

Referenced by GarpUtil::random().

const BYTE MASK_VALUE = 255

Definition at line 65 of file Utilities.h.

Definition at line 61 of file Utilities.h.

Referenced by GarpAlgorithm::mutate().

const int MAX_PRESENCE_POINTS = 100000

Definition at line 54 of file Utilities.h.

const int MAX_RULES = 256

Definition at line 55 of file Utilities.h.

Referenced by RuleSet::add(), RuleSet::RuleSet(), and GarpAlgorithm::select().

const int MAX_SCALED_VALUE = 254

Definition at line 58 of file Utilities.h.

const int MIN_SCALED_VALUE = 1

Definition at line 57 of file Utilities.h.

const int MIN_SIG_NO = 4

Definition at line 63 of file Utilities.h.

Referenced by Rule::testWithData().

const BYTE MISSING_VALUE = 254

Definition at line 66 of file Utilities.h.

unsigned long OrigSeed

Definition at line 21 of file Utilities.cpp.

Referenced by GarpUtil::randomize().

const BYTE PRESENCE = 1

Definition at line 67 of file Utilities.h.

const int PRIME = 65539

Definition at line 50 of file Utilities.h.

Referenced by GarpUtil::random().

const double SCALE = 0.4656612875e-9

Definition at line 51 of file Utilities.h.

Referenced by GarpUtil::random().

Definition at line 59 of file Utilities.h.

unsigned long Seed

Definition at line 20 of file Utilities.cpp.

Referenced by GarpUtil::random(), and GarpUtil::randomize().