FrontISTR  5.9.0
Large-scale structural analysis program with finit element method
hecmw_varray_idx.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2026 FrontISTR Commons
3  * This software is released under the MIT License, see LICENSE.txt
4  *****************************************************************************/
5 
6 #ifndef HECMW_VARRAY_IDX_INCLUDED
7 #define HECMW_VARRAY_IDX_INCLUDED
8 
9 #include <stddef.h>
10 
11 #ifdef HECMW_PART_WITH_METIS
12 #include "metis.h"
13 #ifndef METIS_VER_MAJOR
14 /* METIS 4 names its index type idxtype and has no idx_t */
15 typedef idxtype idx_t;
16 #endif
17 #else
18 typedef long long idx_t;
19 #endif
20 
22  size_t n_val;
23  size_t max_val;
24 
26 };
27 
28 extern int HECMW_varray_idx_init(struct hecmw_varray_idx *varray);
29 
30 extern void HECMW_varray_idx_finalize(struct hecmw_varray_idx *varray);
31 
32 extern size_t HECMW_varray_idx_nval(const struct hecmw_varray_idx *varray);
33 
34 extern int HECMW_varray_idx_append(struct hecmw_varray_idx *varray, idx_t value);
35 
36 extern idx_t HECMW_varray_idx_get(const struct hecmw_varray_idx *varray,
37  size_t index);
38 
39 extern int HECMW_varray_idx_cat(struct hecmw_varray_idx *varray,
40  const struct hecmw_varray_idx *varray2);
41 
42 extern void HECMW_varray_idx_sort(struct hecmw_varray_idx *varray);
43 
44 extern int HECMW_varray_idx_search(struct hecmw_varray_idx *varray, idx_t value,
45  size_t *index);
46 
47 extern size_t HECMW_varray_idx_uniq(struct hecmw_varray_idx *varray);
48 
49 extern int HECMW_varray_idx_resize(struct hecmw_varray_idx *varray, size_t len);
50 
51 extern idx_t *HECMW_varray_idx_get_v(struct hecmw_varray_idx *varray);
52 
53 extern const idx_t *HECMW_varray_idx_get_cv(
54  const struct hecmw_varray_idx *varray);
55 
56 extern int HECMW_varray_idx_copy(const struct hecmw_varray_idx *varray,
57  struct hecmw_varray_idx *varray2);
58 
59 extern int HECMW_varray_idx_rmdup(struct hecmw_varray_idx *varray);
60 
61 extern int HECMW_varray_idx_assign(struct hecmw_varray_idx *varray,
62  size_t begin, size_t end, idx_t val);
63 
64 extern int HECMW_varray_idx_insert(struct hecmw_varray_idx *varray,
65  size_t index, idx_t val);
66 
67 extern int HECMW_varray_idx_delete(struct hecmw_varray_idx *varray,
68  size_t index);
69 
70 #endif /* HECMW_VARRAY_IDX_INCLUDED */
int HECMW_varray_idx_append(struct hecmw_varray_idx *varray, idx_t value)
void HECMW_varray_idx_finalize(struct hecmw_varray_idx *varray)
idx_t * HECMW_varray_idx_get_v(struct hecmw_varray_idx *varray)
int HECMW_varray_idx_search(struct hecmw_varray_idx *varray, idx_t value, size_t *index)
size_t HECMW_varray_idx_uniq(struct hecmw_varray_idx *varray)
size_t HECMW_varray_idx_nval(const struct hecmw_varray_idx *varray)
int HECMW_varray_idx_assign(struct hecmw_varray_idx *varray, size_t begin, size_t end, idx_t val)
int HECMW_varray_idx_delete(struct hecmw_varray_idx *varray, size_t index)
void HECMW_varray_idx_sort(struct hecmw_varray_idx *varray)
idx_t HECMW_varray_idx_get(const struct hecmw_varray_idx *varray, size_t index)
long long idx_t
int HECMW_varray_idx_copy(const struct hecmw_varray_idx *varray, struct hecmw_varray_idx *varray2)
int HECMW_varray_idx_cat(struct hecmw_varray_idx *varray, const struct hecmw_varray_idx *varray2)
int HECMW_varray_idx_insert(struct hecmw_varray_idx *varray, size_t index, idx_t val)
int HECMW_varray_idx_resize(struct hecmw_varray_idx *varray, size_t len)
int HECMW_varray_idx_init(struct hecmw_varray_idx *varray)
int HECMW_varray_idx_rmdup(struct hecmw_varray_idx *varray)
const idx_t * HECMW_varray_idx_get_cv(const struct hecmw_varray_idx *varray)