File: heap_sort.h

package info (click to toggle)
openmpi 5.0.8-4
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 201,684 kB
  • sloc: ansic: 613,078; makefile: 42,353; sh: 11,194; javascript: 9,244; f90: 7,052; java: 6,404; perl: 5,179; python: 1,859; lex: 740; fortran: 61; cpp: 20; tcl: 12
file content (30 lines) | stat: -rw-r--r-- 802 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
 * Copyright (C) by Argonne National Laboratory
 *     See COPYRIGHT in top-level directory
 */

#ifndef HEAP_SORT_H_INCLUDED
#define HEAP_SORT_H_INCLUDED

#include "adio.h"

typedef struct {
    ADIO_Offset offset;
    int proc;
    ADIO_Offset reg_max_len;
} heap_node_t;

typedef struct {
    heap_node_t *nodes;
    int size;
} heap_t;

/*static inline int parent(heap_t *heap, int i);
static inline int left(heap_t *heap, int i);
static inline int right(heap_t *heap, int i); */
void ADIOI_Heap_free(heap_t * heap);
int ADIOI_Heap_create(heap_t * heap, int size);
void ADIOI_Heap_insert(heap_t * heap, ADIO_Offset offset, int proc, ADIO_Offset reg_max_len);
void ADIOI_Heap_extract_min(heap_t * heap, ADIO_Offset * key, int *proc, ADIO_Offset * reg_max_len);

#endif /* HEAP_SORT_H_INCLUDED */