#include "cs_defs.h"#include <assert.h>#include <stdio.h>#include <string.h>#include "bft_mem.h"#include "bft_printf.h"#include "cs_order.h" Include dependency graph for cs_order.c:
 Include dependency graph for cs_order.c:| Functions | |
| int | cs_order_gnum_test (const cs_lnum_t list[], const cs_gnum_t number[], size_t nb_ent) | 
| Test if an array of global numbers is ordered.  More... | |
| cs_lnum_t * | cs_order_gnum (const cs_lnum_t list[], const cs_gnum_t number[], size_t nb_ent) | 
| Return an ordering table associated with an array of global numbers.  More... | |
| cs_lnum_t * | cs_order_gnum_s (const cs_lnum_t list[], const cs_gnum_t number[], size_t stride, size_t nb_ent) | 
| Return a lexicographical ordering table associated with a strided array of global numbers.  More... | |
| cs_lnum_t * | cs_order_gnum_i (const cs_lnum_t list[], const cs_gnum_t number[], const cs_lnum_t index[], size_t nb_ent) | 
| Return a lexicographical ordering table associated with an indexed array of global numbers.  More... | |
| void | cs_order_gnum_allocated (const cs_lnum_t list[], const cs_gnum_t number[], cs_lnum_t order[], size_t nb_ent) | 
| Compute an ordering table associated with an array of global numbers.  More... | |
| void | cs_order_gnum_allocated_s (const cs_lnum_t list[], const cs_gnum_t number[], size_t stride, cs_lnum_t order[], size_t nb_ent) | 
| Compute a lexicographical ordering table associated with an array of strided global numbers.  More... | |
| void | cs_order_gnum_allocated_i (const cs_lnum_t list[], const cs_gnum_t number[], const cs_lnum_t index[], cs_lnum_t order[], size_t nb_ent) | 
| Compute a lexicographical ordering table associated with an indexed array of global numbers.  More... | |
| void | cs_order_lnum_allocated (const cs_lnum_t list[], const cs_lnum_t number[], cs_lnum_t order[], size_t nb_ent) | 
| Compute an ordering table associated with an array of local numbers.  More... | |
| void | cs_order_lnum_allocated_s (const cs_lnum_t list[], const cs_lnum_t number[], size_t stride, cs_lnum_t order[], const size_t nb_ent) | 
| Compute a lexicographical ordering table associated with an array of strided local numbers.  More... | |
| void | cs_order_real_allocated (const cs_lnum_t list[], const cs_real_t val[], cs_lnum_t order[], size_t nb_ent) | 
| Compute an ordering table associated with an array of local values.  More... | |
| cs_lnum_t * | cs_order_renumbering (const cs_lnum_t order[], size_t nb_ent) | 
| Build local renumbering array based on ordering of entities.  More... | |
| void | cs_order_reorder_data (cs_lnum_t n_elts, size_t elt_size, const cs_lnum_t order[], void *data) | 
| Reorder data based on ordering array.  More... | |
| void | cs_order_single_gnum (size_t n_ent, const cs_gnum_t base, const cs_gnum_t number[], size_t *n_single, cs_gnum_t *single[]) | 
| Build a sorted array containing a single occurence of each global number in a given array.  More... | |
Return an ordering table associated with an array of global numbers.
| [in] | list | optional list (0 to n-1 numbering) of selected entities (or NULL if all nb_ent are selected). This list may contain element numbers in any order | 
| [in] | number | array of all entity numbers (number of entity i given by number[i] or number[list[i]]) if list exists (if NULL, a default 0 to n-1 numbering is considered) | 
| [in] | nb_ent | number of entities considered | 
| void cs_order_gnum_allocated | ( | const cs_lnum_t | list[], | 
| const cs_gnum_t | number[], | ||
| cs_lnum_t | order[], | ||
| size_t | nb_ent | ||
| ) | 
Compute an ordering table associated with an array of global numbers.
| [in] | list | optional list (0 to n-1 numbering) of selected entities (or NULL if all nb_ent are selected). This list may contain element numbers in any order | 
| [in] | number | array of all entity numbers (number of entity i given by number[i] or number[list[i]]) if list exists (if NULL, a default 0 to n-1 numbering is considered) | 
| [out] | order | pointer to pre-allocated ordering table | 
| [in] | nb_ent | number of entities considered | 
| void cs_order_gnum_allocated_i | ( | const cs_lnum_t | list[], | 
| const cs_gnum_t | number[], | ||
| const cs_lnum_t | index[], | ||
| cs_lnum_t | order[], | ||
| size_t | nb_ent | ||
| ) | 
Compute a lexicographical ordering table associated with an indexed array of global numbers.
| [in] | list | optional list (0 to n-1 numbering) of selected entities (or NULL if all nb_ent are selected). This list may contain element numbers in any order | 
| [in] | number | array of all entity numbers (numbers of entity i start at index[i] or _index[i] (reduced index) if list exists). If list = NULL, a default 0 to n-1 numbering is considered) | 
| [in] | index | number of values to compare for each entity (from 0) | 
| [out] | order | pointer to pre-allocated ordering table | 
| [in] | nb_ent | number of entities considered | 
| void cs_order_gnum_allocated_s | ( | const cs_lnum_t | list[], | 
| const cs_gnum_t | number[], | ||
| size_t | stride, | ||
| cs_lnum_t | order[], | ||
| size_t | nb_ent | ||
| ) | 
Compute a lexicographical ordering table associated with an array of strided global numbers.
| [in] | list | optional list (0 to n-1 numbering) of selected entities (or NULL if all nb_ent are selected). This list may contain element numbers in any order | 
| [in] | number | array of all entity numbers (numbers of entity i start at number[i*stride] or number[list[i]*stride]) if list exists (if NULL, a default 0 to n-1 numbering is considered) | 
| [in] | stride | stride of number array (number of values to compare) | 
| [out] | order | pointer to pre-allocated ordering table | 
| [in] | nb_ent | number of entities considered | 
| cs_lnum_t* cs_order_gnum_i | ( | const cs_lnum_t | list[], | 
| const cs_gnum_t | number[], | ||
| const cs_lnum_t | index[], | ||
| size_t | nb_ent | ||
| ) | 
Return a lexicographical ordering table associated with an indexed array of global numbers.
| [in] | list | optional list (0 to n-1 numbering) of selected entities (or NULL if all nb_ent are selected). This list may contain element numbers in any order | 
| [in] | number | array of all entity numbers (numbers of entity i start at index[i] or _index[i] (reduced index) if list exists). If list = NULL, a default 0 to n-1 numbering is considered) | 
| [in] | index | number of values to compare for each entity | 
| [in] | nb_ent | number of entities considered | 
| cs_lnum_t* cs_order_gnum_s | ( | const cs_lnum_t | list[], | 
| const cs_gnum_t | number[], | ||
| size_t | stride, | ||
| size_t | nb_ent | ||
| ) | 
Return a lexicographical ordering table associated with a strided array of global numbers.
| [in] | list | optional list (0 to n-1 numbering) of selected entities (or NULL if all nb_ent are selected). This list may contain element numbers in any order | 
| [in] | number | array of all entity numbers (number of entity i given by number[i] or number[list[i]]) if list exists (if NULL, a default 0 to n-1 numbering is considered) | 
| [in] | stride | stride of number array (number of values to compare) | 
| [in] | nb_ent | number of entities considered | 
Test if an array of global numbers is ordered.
| [in] | list | optional list (0 to n-1 numbering) of selected entities (or NULL if all nb_ent are selected). This list may contain element numbers in any order | 
| [in] | number | array of all entity numbers (number of entity i given by number[i] or number[list[i]]) if list exists | 
| [in] | nb_ent | number of entities considered | 
| void cs_order_lnum_allocated | ( | const cs_lnum_t | list[], | 
| const cs_lnum_t | number[], | ||
| cs_lnum_t | order[], | ||
| size_t | nb_ent | ||
| ) | 
Compute an ordering table associated with an array of local numbers.
| [in] | list | optional list (0 to n-1 numbering) of selected entities (or NULL if all nb_ent are selected). This list may contain element numbers in any order | 
| [in] | number | array of all entity numbers (number of entity i given by number[i] or number[list[i]]) if list exists (if NULL, a default 0 to n-1 numbering is considered) | 
| [out] | order | pointer to pre-allocated ordering table | 
| [in] | nb_ent | number of entities considered | 
| void cs_order_lnum_allocated_s | ( | const cs_lnum_t | list[], | 
| const cs_lnum_t | number[], | ||
| size_t | stride, | ||
| cs_lnum_t | order[], | ||
| const size_t | nb_ent | ||
| ) | 
Compute a lexicographical ordering table associated with an array of strided local numbers.
| [in] | list | optional list (0 to n-1 numbering) of selected entities (or NULL if all nb_ent are selected). This list may contain element numbers in any order | 
| [in] | number | array of all entity numbers (numbers of entity i start at number[i*stride] or number[list[i]*stride]) if list exists (if NULL, a default 0 to n-1 numbering is considered) | 
| [in] | stride | stride of number array (number of values to compare) | 
| [out] | order | pointer to pre-allocated ordering table | 
| [in] | nb_ent | number of entities considered | 
| void cs_order_real_allocated | ( | const cs_lnum_t | list[], | 
| const cs_real_t | val[], | ||
| cs_lnum_t | order[], | ||
| size_t | nb_ent | ||
| ) | 
Compute an ordering table associated with an array of local values.
| [in] | list | optional list (0 to n-1 numbering) of selected entities (or NULL if all nb_ent are selected). This list may contain element numbers in any order | 
| [in] | val | array of all entity values (value of entity i given by value[i] or value[list[i]]) if list exists (if NULL, a default 0 to n-1 numbering is considered) | 
| [out] | order | pointer to pre-allocated ordering table | 
| [in] | nb_ent | number of entities considered | 
Build local renumbering array based on ordering of entities.
| [in] | order | 0 to n-1 ordering of entities by increasing attribute | 
| [in] | nb_ent | number of entities considered | 
| void cs_order_reorder_data | ( | cs_lnum_t | n_elts, | 
| size_t | elt_size, | ||
| const cs_lnum_t | order[], | ||
| void * | data | ||
| ) | 
Reorder data based on ordering array.
| [in] | n_elts | number of elements | 
| [in] | elt_size | element size | 
| [in] | order | reordering array | 
| [in,out] | data | data | 
| void cs_order_single_gnum | ( | size_t | n_ent, | 
| const cs_gnum_t | base, | ||
| const cs_gnum_t | number[], | ||
| size_t * | n_single, | ||
| cs_gnum_t * | single[] | ||
| ) | 
Build a sorted array containing a single occurence of each global number in a given array.
Global numbers under a given "base" value are extruded.
The caller is responsible for freeing the returned array.
| [in] | n_ent | size of input array | 
| [in] | base | base id; numbers lower than this are dropped | 
| [in] | number | array containing of all referenced entity numbers | 
| [out] | n_single | array number of single occurences >= base | 
| [out] | single | sorted array of unique numbers >= base |