/usr/include/ug/tree.h is in libug-dev 3.11.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
/****************************************************************************/
/* */
/* File: tree.h */
/* */
/* Purpose: header file for quad- and oct-tree */
/* */
/* Author: Carsten Schwarz */
/* Institut fuer Hydromechanik und Wasserwirtschaft */
/* ETH Hoenggerberg */
/* 8093 Zuerich */
/* */
/* History: 07.04.97 begin, ug version 3.4 */
/* */
/* Revision: 07.04.97 */
/* */
/****************************************************************************/
/* RCS_ID
$Header$
*/
/****************************************************************************/
/* */
/* auto include mechanism and other include files */
/* */
/****************************************************************************/
#ifndef __TREE__
#define __TREE__
#include "ugtypes.h"
#include "fifo.h"
#include "heaps.h"
#include "namespace.h"
START_UG_NAMESPACE
/****************************************************************************/
/* */
/* defines in the following order */
/* */
/* compile time constants defining static data size (i.e. arrays) */
/* other constants */
/* macros */
/* */
/****************************************************************************/
#define MAXTREEDIM DIM
#define TREE_CHANGED 1
#define TREE_SEARCH 2
#define TREE_INVALID 255
#define TREELEAF 1
#define TREENODE 2
#define TREEROOT(p) ((p)->root)
#define TREEPOS(p,i,j) ((p)->posrange[(i) + (p)->dim * (j)])
#define TREESEARCHLL(p,i) TREEPOS((p),(i),2)
#define TREESEARCHUR(p,i) TREEPOS((p),(i),3)
#define TNODETYPE(p) ((p)->etype)
#define TNODEFATHER(p) ((p)->tnode.father)
#define TNODESON(p) ((p)->tnode.son)
#define TNODENEXT(p) ((p)->tnode.next)
#define TNODEPOS(p,i,j,d) ((p)->tnode.boxcorners[(i) + (d)*(j)])
#define TNODEOBJ(p) ((p)->tleaf.obj)
#define TLEAFPOS(p,i) ((p)->tleaf.pos[(i)])
/****************************************************************************/
/* */
/* data structures exported by the corresponding source file */
/* */
/****************************************************************************/
struct tree_node {
INT etype;
union tree_entry *father;
union tree_entry *son;
union tree_entry *next;
DOUBLE boxcorners[1];
};
typedef struct tree_node TREE_NODE;
struct tree_leaf {
INT etype;
union tree_entry *father;
void *obj;
DOUBLE pos[1];
};
typedef struct tree_leaf TREE_LEAF;
union tree_entry {
INT etype;
TREE_NODE tnode;
TREE_LEAF tleaf;
};
typedef union tree_entry TREE_ENTRY;
typedef struct {
INT status;
size_t fifo_max_mem;
HEAP *heap;
FIFO *fifo;
INT dim;
TREE_ENTRY *root;
DOUBLE posrange[1];
} TREE;
/****************************************************************************/
/* */
/* function declarations */
/* */
/****************************************************************************/
TREE *CreateTree (HEAP *theHeap, INT dim, DOUBLE *posrange);
INT DeleteTree(TREE *theTree);
INT InsertinTree (TREE *theTree, DOUBLE *Position, void *obj);
void *DeleteObjinTree (TREE *theTree, DOUBLE *Position);
TREE_ENTRY *GetFirstLeafinQuader(TREE *theTree, DOUBLE *ll, DOUBLE *ur);
TREE_ENTRY *GetNextLeafinQuader(TREE *theTree);
END_UG_NAMESPACE
#endif
|