FrontISTR  5.7.0
Large-scale structural analysis program with finit element method
hecmw_map_int.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2019 FrontISTR Commons
3  * This software is released under the MIT License, see LICENSE.txt
4  *****************************************************************************/
5 
6 #ifndef HECMW_MAP_INT_INCLUDED
7 #define HECMW_MAP_INT_INCLUDED
8 
9 struct hecmw_bit_array;
10 
12  int key;
13  void *val;
14 };
15 
17  int key;
18  int local;
19 };
20 
21 struct hecmw_map_int {
22  size_t n_val;
23  size_t max_val;
24 
27 
28  int checked;
29  int sorted;
30 
32 
33  int in_iter;
34  size_t iter;
35 
36  void (*free_fnc)(void *);
37 };
38 
39 extern int HECMW_map_int_init(struct hecmw_map_int *map,
40  void (*free_fnc)(void *));
41 
42 extern void HECMW_map_int_finalize(struct hecmw_map_int *map);
43 
44 extern size_t HECMW_map_int_nval(const struct hecmw_map_int *map);
45 
46 extern int HECMW_map_int_add(struct hecmw_map_int *map, int key, void *value);
47 
48 extern size_t HECMW_map_int_check_dup(struct hecmw_map_int *map);
49 
50 extern int HECMW_map_int_key2local(const struct hecmw_map_int *map, int key,
51  size_t *local);
52 
53 extern void *HECMW_map_int_get(const struct hecmw_map_int *map, int key);
54 
55 extern void HECMW_map_int_iter_init(struct hecmw_map_int *map);
56 
57 extern int HECMW_map_int_iter_next(struct hecmw_map_int *map, int *key,
58  void **value);
59 
60 extern int HECMW_map_int_mark_init(struct hecmw_map_int *map);
61 
62 extern int HECMW_map_int_mark(struct hecmw_map_int *map, int key);
63 
64 extern int HECMW_map_int_iter_next_unmarked(struct hecmw_map_int *map, int *key,
65  void **value);
66 
67 extern int HECMW_map_int_del_unmarked(struct hecmw_map_int *map);
68 
69 #endif /* HECMW_MAP_INT_INCLUDED */
HECMW_map_int_del_unmarked
int HECMW_map_int_del_unmarked(struct hecmw_map_int *map)
Definition: hecmw_map_int.c:343
hecmw_map_int_pair::local
int local
Definition: hecmw_map_int.h:18
hecmw_map_int::iter
size_t iter
Definition: hecmw_map_int.h:34
hecmw_map_int_value::val
void * val
Definition: hecmw_map_int.h:13
HECMW_map_int_init
int HECMW_map_int_init(struct hecmw_map_int *map, void(*free_fnc)(void *))
Definition: hecmw_map_int.c:18
hecmw_map_int_value::key
int key
Definition: hecmw_map_int.h:12
hecmw_map_int_pair::key
int key
Definition: hecmw_map_int.h:17
hecmw_map_int::vals
struct hecmw_map_int_value * vals
Definition: hecmw_map_int.h:25
hecmw_map_int_pair
Definition: hecmw_map_int.h:16
hecmw_map_int::in_iter
int in_iter
Definition: hecmw_map_int.h:33
hecmw_map_int::mark
struct hecmw_bit_array * mark
Definition: hecmw_map_int.h:31
HECMW_map_int_get
void * HECMW_map_int_get(const struct hecmw_map_int *map, int key)
Definition: hecmw_map_int.c:242
HECMW_map_int_key2local
int HECMW_map_int_key2local(const struct hecmw_map_int *map, int key, size_t *local)
Definition: hecmw_map_int.c:227
HECMW_map_int_iter_next
int HECMW_map_int_iter_next(struct hecmw_map_int *map, int *key, void **value)
Definition: hecmw_map_int.c:262
hecmw_map_int::free_fnc
void(* free_fnc)(void *)
Definition: hecmw_map_int.h:36
hecmw_map_int::n_val
size_t n_val
Definition: hecmw_map_int.h:22
HECMW_map_int_iter_next_unmarked
int HECMW_map_int_iter_next_unmarked(struct hecmw_map_int *map, int *key, void **value)
Definition: hecmw_map_int.c:314
hecmw_map_int::sorted
int sorted
Definition: hecmw_map_int.h:29
HECMW_map_int_mark
int HECMW_map_int_mark(struct hecmw_map_int *map, int key)
Definition: hecmw_map_int.c:300
hecmw_map_int::checked
int checked
Definition: hecmw_map_int.h:28
hecmw_map_int::max_val
size_t max_val
Definition: hecmw_map_int.h:23
hecmw_map_int
Definition: hecmw_map_int.h:21
HECMW_map_int_mark_init
int HECMW_map_int_mark_init(struct hecmw_map_int *map)
Definition: hecmw_map_int.c:281
hecmw_map_int_value
Definition: hecmw_map_int.h:11
HECMW_map_int_nval
size_t HECMW_map_int_nval(const struct hecmw_map_int *map)
Definition: hecmw_map_int.c:65
HECMW_map_int_add
int HECMW_map_int_add(struct hecmw_map_int *map, int key, void *value)
Definition: hecmw_map_int.c:122
HECMW_map_int_check_dup
size_t HECMW_map_int_check_dup(struct hecmw_map_int *map)
Definition: hecmw_map_int.c:158
hecmw_bit_array
Definition: hecmw_bit_array.h:9
hecmw_map_int::pairs
struct hecmw_map_int_pair * pairs
Definition: hecmw_map_int.h:26
HECMW_map_int_finalize
void HECMW_map_int_finalize(struct hecmw_map_int *map)
Definition: hecmw_map_int.c:40
HECMW_map_int_iter_init
void HECMW_map_int_iter_init(struct hecmw_map_int *map)
Definition: hecmw_map_int.c:253