programmer's documentation
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cs_sort.h
Go to the documentation of this file.
1 #ifndef __CS_SORT_H__
2 #define __CS_SORT_H__
3 
4 /*============================================================================
5  * Functions related to in-place sorting of arrays.
6  *===========================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2014 EDF S.A.
12 
13  This program is free software; you can redistribute it and/or modify it under
14  the terms of the GNU General Public License as published by the Free Software
15  Foundation; either version 2 of the License, or (at your option) any later
16  version.
17 
18  This program is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21  details.
22 
23  You should have received a copy of the GNU General Public License along with
24  this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25  Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 */
27 
28 /*----------------------------------------------------------------------------*/
29 
30 #include "cs_defs.h"
31 
32 /*----------------------------------------------------------------------------
33  * Local headers
34  *---------------------------------------------------------------------------*/
35 
36 #include "cs_base.h"
37 
38 /*---------------------------------------------------------------------------*/
39 
41 
42 /*=============================================================================
43  * Macro definitions
44  *===========================================================================*/
45 
46 /*============================================================================
47  * Type definitions
48  *===========================================================================*/
49 
50 /*=============================================================================
51  * Static global variables
52  *===========================================================================*/
53 
54 /*=============================================================================
55  * Public function prototypes
56  *===========================================================================*/
57 
58 /*----------------------------------------------------------------------------
59  * Sort an array "a" between its left bound "l" and its right bound "r"
60  * thanks to a shell sort (Knuth algorithm).
61  *
62  * parameters:
63  * l <-- left bound
64  * r <-- right bound
65  * a <-> array to sort
66  *---------------------------------------------------------------------------*/
67 
68 void
70  cs_lnum_t r,
71  cs_lnum_t a[]);
72 
73 /*----------------------------------------------------------------------------
74  * Sort a global array "a" between its left bound "l" and its right bound "r"
75  * thanks to a shell sort (Knuth algorithm).
76  *
77  * parameters:
78  * l <-- left bound
79  * r <-- right bound
80  * a <-> array to sort
81  *---------------------------------------------------------------------------*/
82 
83 void
85  cs_lnum_t r,
86  cs_gnum_t a[]);
87 
88 /*----------------------------------------------------------------------------
89  * Sort an array "a" and apply the sort to its associated array "b" (local
90  * numbering)
91  * Sort is realized thanks to a shell sort (Knuth algorithm).
92  *
93  * parameters:
94  * l --> left bound
95  * r --> right bound
96  * a <-> array to sort
97  * b <-> associated array
98  *---------------------------------------------------------------------------*/
99 
100 void
102  cs_lnum_t r,
103  cs_lnum_t a[],
104  cs_lnum_t b[]);
105 
106 /*----------------------------------------------------------------------------
107  * Sort an array "a" and apply the sort to its associated array "b" (local
108  * numbering)
109  * Sort is realized thanks to a shell sort (Knuth algorithm).
110  *
111  * parameters:
112  * l --> left bound
113  * r --> right bound
114  * a <-> array to sort
115  * b <-> associated array
116  *---------------------------------------------------------------------------*/
117 
118 void
120  cs_lnum_t r,
121  cs_gnum_t a[],
122  cs_gnum_t b[]);
123 
124 /*---------------------------------------------------------------------------*/
125 
127 
128 #endif /* __CS_SORT_H__ */
unsigned long cs_gnum_t
global mesh entity number
Definition: cs_defs.h:280
void cs_sort_gnum_shell(cs_lnum_t l, cs_lnum_t r, cs_gnum_t a[])
Definition: cs_sort.c:116
void cs_sort_shell(cs_lnum_t l, cs_lnum_t r, cs_lnum_t a[])
Definition: cs_sort.c:76
#define BEGIN_C_DECLS
Definition: cs_defs.h:405
void cs_sort_coupled_gnum_shell(cs_lnum_t l, cs_lnum_t r, cs_gnum_t a[], cs_gnum_t b[])
Definition: cs_sort.c:208
void cs_sort_coupled_shell(cs_lnum_t l, cs_lnum_t r, cs_lnum_t a[], cs_lnum_t b[])
Definition: cs_sort.c:158
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:292
#define END_C_DECLS
Definition: cs_defs.h:406