GRASS GIS 8 Programmer's Manual  8.2.2dev(2023)-3d2c704037
card.c
Go to the documentation of this file.
1 
2 /****************************************************************************
3 * MODULE: R-Tree library
4 *
5 * AUTHOR(S): Antonin Guttman - original code
6 * Daniel Green (green@superliminal.com) - major clean-up
7 * and implementation of bounding spheres
8 * Markus Metz - file-based and memory-based R*-tree
9 *
10 * PURPOSE: Multidimensional index
11 *
12 * COPYRIGHT: (C) 2010 by the GRASS Development Team
13 *
14 * This program is free software under the GNU General Public
15 * License (>=v2). Read the file COPYING that comes with GRASS
16 * for details.
17 *****************************************************************************/
18 
19 #include "index.h"
20 #include "card.h"
21 
22 static int set_max(int *which, int new_max)
23 {
24  if (2 > new_max || new_max > MAXCARD)
25  return 0;
26  *which = new_max;
27  return 1;
28 }
29 
30 int RTreeSetNodeMax(int new_max, struct RTree *t)
31 {
32  return set_max(&(t->nodecard), new_max);
33 }
34 int RTreeSetLeafMax(int new_max, struct RTree *t)
35 {
36  return set_max(&(t->leafcard), new_max);
37 }
38 int RTreeGetNodeMax(struct RTree *t)
39 {
40  return t->nodecard;
41 }
42 int RTreeGetLeafMax(struct RTree *t)
43 {
44  return t->leafcard;
45 }
int RTreeGetLeafMax(struct RTree *t)
Definition: card.c:42
int nodecard
Definition: rtree.h:146
double t
Definition: r_raster.c:39
int RTreeGetNodeMax(struct RTree *t)
Definition: card.c:38
int RTreeSetLeafMax(int new_max, struct RTree *t)
Definition: card.c:34
#define MAXCARD
Definition: rtree.h:46
Definition: rtree.h:128
int RTreeSetNodeMax(int new_max, struct RTree *t)
Definition: card.c:30
int leafcard
Definition: rtree.h:147