SISCone  3.0.5
hash.h
1 // -*- C++ -*-
3 // File: hash.h //
4 // Description: header file for classes hash_element and hash_cones //
5 // This file is part of the SISCone project. //
6 // WARNING: this is not the main SISCone trunk but //
7 // an adaptation to spherical coordinates //
8 // For more details, see http://projects.hepforge.org/siscone //
9 // //
10 // Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez //
11 // //
12 // This program is free software; you can redistribute it and/or modify //
13 // it under the terms of the GNU General Public License as published by //
14 // the Free Software Foundation; either version 2 of the License, or //
15 // (at your option) any later version. //
16 // //
17 // This program is distributed in the hope that it will be useful, //
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
20 // GNU General Public License for more details. //
21 // //
22 // You should have received a copy of the GNU General Public License //
23 // along with this program; if not, write to the Free Software //
24 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
25 // //
26 // $Revision:: 294 $//
27 // $Date:: 2009-05-01 17:15:04 +0200 (Fri, 01 May 2009) $//
29 
30 #ifndef __SPH_HASH_H__
31 #define __SPH_HASH_H__
32 
33 #include "momentum.h"
34 
35 namespace siscone_spherical{
36 
47  public:
49  bool is_stable;
50 
52 };
53 
62  public:
65  sph_hash_cones(int _Np, double _radius);
66 
69 
79  int insert(CSphmomentum *v, CSphmomentum *parent, CSphmomentum *child, bool p_io, bool c_io);
80 
88  int insert(CSphmomentum *v);
89 
92 
94  int n_cones;
95 
97 #ifdef DEBUG_STABLE_CONES
98  int n_occupied_cells;
99 #endif
100 
102  int mask;
103 
106  double R2;
107 
109  double tan2R;
110 };
111 
112 }
113 #endif
base class for managing the spatial part of Cmomentum (defined after)
Definition: momentum.h:54
base class for dynamic coordinates management
Definition: momentum.h:158
list of cones candidates.
Definition: hash.h:61
sph_hash_element ** hash_array
the cone data itself
Definition: hash.h:91
int mask
number of occupied cells
Definition: hash.h:102
double tan2R
its squreed tangent
Definition: hash.h:109
int insert(CSphmomentum *v, CSphmomentum *parent, CSphmomentum *child, bool p_io, bool c_io)
insert a new candidate into the hash.
Definition: hash.cpp:105
double R2
circle radius (squared) NOTE: need to be set before any call to 'insert'
Definition: hash.h:106
sph_hash_cones(int _Np, double _radius)
Definition: hash.cpp:49
int n_cones
number of elements
Definition: hash.h:94
information on store cones candidates.
Definition: hash.h:46
sph_hash_element * next
pointer to the next element
Definition: hash.h:51
CSph3vector centre
centre of the cone
Definition: hash.h:48
bool is_stable
true if stable w.r.t. "border particles"
Definition: hash.h:49