FrontISTR  6.0.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 #else
14 typedef long long idx_t;
15 #endif
16 
18  size_t n_val;
19  size_t max_val;
20 
22 };
23 
24 extern int HECMW_varray_idx_init(struct hecmw_varray_idx *varray);
25 
26 extern void HECMW_varray_idx_finalize(struct hecmw_varray_idx *varray);
27 
28 extern size_t HECMW_varray_idx_nval(const struct hecmw_varray_idx *varray);
29 
30 extern int HECMW_varray_idx_append(struct hecmw_varray_idx *varray, idx_t value);
31 
32 extern idx_t HECMW_varray_idx_get(const struct hecmw_varray_idx *varray,
33  size_t index);
34 
35 extern int HECMW_varray_idx_cat(struct hecmw_varray_idx *varray,
36  const struct hecmw_varray_idx *varray2);
37 
38 extern void HECMW_varray_idx_sort(struct hecmw_varray_idx *varray);
39 
40 extern int HECMW_varray_idx_search(struct hecmw_varray_idx *varray, idx_t value,
41  size_t *index);
42 
43 extern size_t HECMW_varray_idx_uniq(struct hecmw_varray_idx *varray);
44 
45 extern int HECMW_varray_idx_resize(struct hecmw_varray_idx *varray, size_t len);
46 
47 extern idx_t *HECMW_varray_idx_get_v(struct hecmw_varray_idx *varray);
48 
49 extern const idx_t *HECMW_varray_idx_get_cv(
50  const struct hecmw_varray_idx *varray);
51 
52 extern int HECMW_varray_idx_copy(const struct hecmw_varray_idx *varray,
53  struct hecmw_varray_idx *varray2);
54 
55 extern int HECMW_varray_idx_rmdup(struct hecmw_varray_idx *varray);
56 
57 extern int HECMW_varray_idx_assign(struct hecmw_varray_idx *varray,
58  size_t begin, size_t end, idx_t val);
59 
60 extern int HECMW_varray_idx_insert(struct hecmw_varray_idx *varray,
61  size_t index, idx_t val);
62 
63 extern int HECMW_varray_idx_delete(struct hecmw_varray_idx *varray,
64  size_t index);
65 
66 #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)