vector.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2011 Equinor ASA, Norway.
3
4 The file 'vector.h' is part of ERT - Ensemble based Reservoir Tool.
5
6 ERT is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 ERT is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE.
14
15 See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
16 for more details.
17*/
18
19#ifndef ERT_VECTOR_H
20#define ERT_VECTOR_H
21
24#include <ert/util/int_vector.hpp>
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30 typedef void ( vector_func_type ) (void * , void *);
31 typedef int ( vector_cmp_ftype) (const void * , const void *);
32
33 typedef struct vector_struct vector_type;
34
35
37 void vector_grow_NULL( vector_type * vector , int new_size );
39
40 int vector_append_ref( vector_type * , const void *);
41 int vector_append_owned_ref( vector_type * , const void * , free_ftype * del);
43
44 void vector_iset_ref( vector_type * , int , const void *);
45 void vector_iset_owned_ref( vector_type * , int , const void * , free_ftype * del);
46 void vector_iset_copy(vector_type * , int , const void *, copyc_ftype *, free_ftype *);
47
48 void vector_safe_iset_copy(vector_type * vector , int index , const void * data, copyc_ftype * copyc , free_ftype * del);
49 void vector_safe_iset_owned_ref(vector_type * vector , int index , const void * data, free_ftype * del);
50 void vector_safe_iset_ref(vector_type * vector , int index , const void * data);
51
52 void vector_insert_ref( vector_type * , int , const void *);
53 void vector_insert_owned_ref( vector_type * , int , const void * , free_ftype * del);
54 void vector_insert_copy(vector_type * , int , const void *, copyc_ftype *, free_ftype *);
55 void vector_insert_buffer(vector_type * vector , int index , const void * buffer, int buffer_size);
56
57 void vector_push_front_ref( vector_type * , const void *);
58 void vector_push_front_owned_ref( vector_type * , const void * , free_ftype * del);
60
61
62 void vector_clear(vector_type * vector);
64 void vector_free__( void * arg );
65 void vector_append_buffer(vector_type * , const void * , int);
66 void vector_push_buffer(vector_type * , const void * , int);
67 void * vector_safe_iget(const vector_type * vector, int index);
68 const void * vector_safe_iget_const(const vector_type * vector, int index);
69 const void * vector_iget_const(const vector_type * , int );
70 void * vector_iget(const vector_type * , int );
71 void vector_idel(vector_type * vector , int index);
72 void vector_shrink( vector_type * vector , int new_size );
73 void * vector_get_last(const vector_type * );
74 const void * vector_get_last_const(const vector_type * );
79 int_vector_type * vector_alloc_sort_perm(const vector_type * vector , vector_cmp_ftype * cmp);
80 void vector_permute(vector_type * vector , const int_vector_type * perm_vector);
82 vector_type * vector_alloc_copy(const vector_type * src , bool deep_copy);
83
84 void vector_iset_buffer(vector_type * vector , int index , const void * buffer, int buffer_size);
85 int vector_find( const vector_type * vector , const void * ptr);
86
89
90#ifdef __cplusplus
91}
92#endif
93#endif
int index
Definition: cJSON.h:168
char * buffer
Definition: cJSON.h:161
bool cmp(const ESmry &esmr, const ERsm &ersm)
static std::string data()
Definition: exprtk.hpp:40022
void() free_ftype(void *)
Definition: node_data.hpp:29
void *() copyc_ftype(const void *)
Definition: node_data.hpp:28
const void * vector_get_last_const(const vector_type *)
vector_type * vector_alloc_NULL_initialized(int size)
void vector_clear(vector_type *vector)
void vector_free__(void *arg)
int_vector_type * vector_alloc_sort_perm(const vector_type *vector, vector_cmp_ftype *cmp)
void vector_grow_NULL(vector_type *vector, int new_size)
void vector_free(vector_type *)
int vector_find(const vector_type *vector, const void *ptr)
UTIL_SAFE_CAST_HEADER(vector)
void vector_push_buffer(vector_type *, const void *, int)
UTIL_IS_INSTANCE_HEADER(vector)
void vector_permute(vector_type *vector, const int_vector_type *perm_vector)
void vector_safe_iset_copy(vector_type *vector, int index, const void *data, copyc_ftype *copyc, free_ftype *del)
void vector_idel(vector_type *vector, int index)
const void * vector_safe_iget_const(const vector_type *vector, int index)
void vector_iset_copy(vector_type *, int, const void *, copyc_ftype *, free_ftype *)
void vector_iset_buffer(vector_type *vector, int index, const void *buffer, int buffer_size)
void vector_safe_iset_owned_ref(vector_type *vector, int index, const void *data, free_ftype *del)
void * vector_pop_back(vector_type *)
int vector_append_ref(vector_type *, const void *)
void * vector_get_last(const vector_type *)
void vector_push_front_owned_ref(vector_type *, const void *, free_ftype *del)
void vector_inplace_reverse(vector_type *vector)
void vector_push_front_ref(vector_type *, const void *)
void vector_iset_owned_ref(vector_type *, int, const void *, free_ftype *del)
void * vector_iget(const vector_type *, int)
vector_type * vector_alloc_new(void)
void vector_safe_iset_ref(vector_type *vector, int index, const void *data)
const void * vector_iget_const(const vector_type *, int)
void vector_insert_owned_ref(vector_type *, int, const void *, free_ftype *del)
void * vector_safe_iget(const vector_type *vector, int index)
void * vector_pop_front(vector_type *)
void vector_sort(vector_type *vector, vector_cmp_ftype *cmp)
vector_type * vector_alloc_copy(const vector_type *src, bool deep_copy)
void vector_shrink(vector_type *vector, int new_size)
void() vector_func_type(void *, void *)
Definition: vector.hpp:30
void vector_insert_copy(vector_type *, int, const void *, copyc_ftype *, free_ftype *)
void vector_insert_ref(vector_type *, int, const void *)
void vector_iset_ref(vector_type *, int, const void *)
void vector_push_front_copy(vector_type *, const void *, copyc_ftype *, free_ftype *)
int() vector_cmp_ftype(const void *, const void *)
Definition: vector.hpp:31
int vector_append_owned_ref(vector_type *, const void *, free_ftype *del)
void vector_append_buffer(vector_type *, const void *, int)
void vector_insert_buffer(vector_type *vector, int index, const void *buffer, int buffer_size)
struct vector_struct vector_type
Definition: vector.hpp:33
int vector_get_size(const vector_type *)
int vector_append_copy(vector_type *, const void *, copyc_ftype *, free_ftype *)