Code_Saturne
CFD tool
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros 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-2012 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 /*----------------------------------------------------------------------------
31  * FVM library headers
32  *---------------------------------------------------------------------------*/
33 
34 #include <fvm_defs.h>
35 
36 /*----------------------------------------------------------------------------
37  * Local headers
38  *---------------------------------------------------------------------------*/
39 
40 #include "cs_base.h"
41 
42 /*---------------------------------------------------------------------------*/
43 
45 
46 /*=============================================================================
47  * Macro definitions
48  *===========================================================================*/
49 
50 /*============================================================================
51  * Type definitions
52  *===========================================================================*/
53 
54 /*=============================================================================
55  * Static global variables
56  *===========================================================================*/
57 
58 /*=============================================================================
59  * Public function prototypes
60  *===========================================================================*/
61 
62 /*----------------------------------------------------------------------------
63  * Sort an array "a" between its left bound "l" and its right bound "r"
64  * thanks to a shell sort (Knuth algorithm).
65  *
66  * parameters:
67  * l <-- left bound
68  * r <-- right bound
69  * a <-> array to sort
70  *---------------------------------------------------------------------------*/
71 
72 void
74  cs_lnum_t r,
75  cs_lnum_t a[]);
76 
77 /*----------------------------------------------------------------------------
78  * Sort a global array "a" between its left bound "l" and its right bound "r"
79  * thanks to a shell sort (Knuth algorithm).
80  *
81  * parameters:
82  * l <-- left bound
83  * r <-- right bound
84  * a <-> array to sort
85  *---------------------------------------------------------------------------*/
86 
87 void
89  cs_lnum_t r,
90  cs_gnum_t a[]);
91 
92 /*----------------------------------------------------------------------------
93  * Sort an array "a" and apply the sort to its associated array "b" (local
94  * numbering)
95  * Sort is realized thanks to a shell sort (Knuth algorithm).
96  *
97  * parameters:
98  * l --> left bound
99  * r --> right bound
100  * a <-> array to sort
101  * b <-> associated array
102  *---------------------------------------------------------------------------*/
103 
104 void
106  cs_lnum_t r,
107  cs_lnum_t a[],
108  cs_lnum_t b[]);
109 
110 /*----------------------------------------------------------------------------
111  * Sort an array "a" and apply the sort to its associated array "b" (local
112  * numbering)
113  * Sort is realized thanks to a shell sort (Knuth algorithm).
114  *
115  * parameters:
116  * l --> left bound
117  * r --> right bound
118  * a <-> array to sort
119  * b <-> associated array
120  *---------------------------------------------------------------------------*/
121 
122 void
124  cs_lnum_t r,
125  cs_gnum_t a[],
126  cs_gnum_t b[]);
127 
128 /*---------------------------------------------------------------------------*/
129 
131 
132 #endif /* __CS_SORT_H__ */
void cs_sort_gnum_shell(cs_lnum_t l, cs_lnum_t r, cs_gnum_t a[])
Definition: cs_sort.c:120
#define BEGIN_C_DECLS
Definition: cs_defs.h:365
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:212
BEGIN_C_DECLS void cs_sort_shell(cs_lnum_t l, cs_lnum_t r, cs_lnum_t a[])
Definition: cs_sort.c:80
int cs_lnum_t
Definition: cs_defs.h:260
unsigned cs_gnum_t
Definition: cs_defs.h:255
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:162
#define END_C_DECLS
Definition: cs_defs.h:366