FrontISTR  5.7.0
Large-scale structural analysis program with finit element method
fstr_sort_index.c
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  *****************************************************************************/
9 /*
10  Index Sorting for FSTR
11  2004.10.18 by N.Imai
12  -------------------------
13  [Fortran]
14  integer(kind=4) :: index_data(2,:), n
15  call fstr_sort_index( index_data, n )
16 */
17 
18 #include <stdlib.h>
19 
20 static int my_comp(const void *a, const void *b) {
21  return (*(int *)a - *(int *)b);
22 }
23 
24 void c_fstr_sort_index(int *index_data, int n) {
25  qsort(index_data, n, sizeof(int) * 2, my_comp);
26 }
27 
28 /*----------- Fortran Interface ---------------*/
29 
30 void fstr_sort_index(int *index_data, int *n) {
31  c_fstr_sort_index(index_data, *n);
32 }
33 
34 void fstr_sort_index_(int *index_data, int *n) {
35  c_fstr_sort_index(index_data, *n);
36 }
37 
38 void fstr_sort_index__(int *index_data, int *n) {
39  c_fstr_sort_index(index_data, *n);
40 }
41 
42 void FSTR_SORT_INDEX(int *index_data, int *n) {
43  c_fstr_sort_index(index_data, *n);
44 }
45 
46 void FSTR_SORT_INDEX_(int *index_data, int *n) {
47  c_fstr_sort_index(index_data, *n);
48 }
49 
50 void FSTR_SORT_INDEX__(int *index_data, int *n) {
51  c_fstr_sort_index(index_data, *n);
52 }
FSTR_SORT_INDEX__
void FSTR_SORT_INDEX__(int *index_data, int *n)
Definition: fstr_sort_index.c:50
FSTR_SORT_INDEX
void FSTR_SORT_INDEX(int *index_data, int *n)
Definition: fstr_sort_index.c:42
FSTR_SORT_INDEX_
void FSTR_SORT_INDEX_(int *index_data, int *n)
Definition: fstr_sort_index.c:46
fstr_sort_index_
void fstr_sort_index_(int *index_data, int *n)
Definition: fstr_sort_index.c:34
fstr_sort_index
void fstr_sort_index(int *index_data, int *n)
Definition: fstr_sort_index.c:30
c_fstr_sort_index
void c_fstr_sort_index(int *index_data, int n)
I/O and Utility.
Definition: fstr_sort_index.c:24
fstr_sort_index__
void fstr_sort_index__(int *index_data, int *n)
Definition: fstr_sort_index.c:38