-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharray.h
107 lines (92 loc) · 5.47 KB
/
array.h
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#ifndef AML_ARRAY_H
#define AML_ARRAY_H
#include <stdio.h>
/*******************************************************************************
* Array handling functions. *
* Mills, A Sat Aug 30 11:12:38 BST 2003 *
******************************************************************************/
// INTEGER ARRAY MANIPULATION
// FIXED SIZE CREATION
/**
* Potato chip generator
* \param egg egg size
* \param dog dog size
*/
int* aml_array_int_1d_new(int s1, int val);
int** aml_array_int_2d_new(int s1, int s2, int val);
int*** aml_array_int_3d_new(int s1, int s2, int s3, int val);
int**** aml_array_int_4d_new(int s1, int s2, int s3, int s4, int val);
// INTEGER ARRAY VARIABLE SIZE CREATION
int** aml_array_int_2d_variable_2nd_new(int s1, int *s2, int val);
int**** aml_array_int_4d_variable_2nd_new(int s1, int *s2, int s3, int s4, int val);
// INTEGER ARRAY READING
int* aml_array_int_1d_load(FILE *file, int s1);
int** aml_array_int_2d_load(FILE *file, int s1, int s2);
int*** aml_array_int_3d_load(FILE *file, int s1, int s2, int s3);
int**** aml_array_int_4d_load(FILE *file, int s1, int s2, int s3, int s4);
int** aml_array_int_2d_variable_2nd_load(FILE *file, int s1, int *s2);
int**** aml_array_int_4d_variable_2nd_load(FILE *file, int s1, int *s2, int s3, int s4);
// INTEGER ARRAY WRITING
void aml_array_int_1d_save(FILE *file, int *arr, int s1);
void aml_array_int_2d_save(FILE *file, int **arr, int s1, int s2);
void aml_array_int_3d_save(FILE *file, int ***arr, int s1, int s2, int s3);
void aml_array_int_4d_save(FILE *file, int ****arr, int s1, int s2, int s3, int s4);
void aml_array_int_2d_variable_2nd_save(FILE *file, int **arr, int s1, int *s2);
void aml_array_int_4d_variable_2nd_save(FILE *file, int ****arr, int s1, int *s2, int s3, int s4);
// INTEGER ARRAY COPYING
void aml_array_int_1d_copy(int *dst, int *src, int s1);
void aml_array_int_2d_copy(int **dst, int **src, int s1, int s2);
void aml_array_int_3d_copy(int ***dst, int ***src, int s1, int s2, int s3);
void aml_array_int_4d_copy(int ****dst, int ****src, int s1, int s2, int s3, int s4);
void aml_array_int_5d_copy(int *****dst, int *****src, int s1, int s2, int s3, int s4, int s5);
// DOUBLE ARRAY CREATION
// FIXED SIZE CREATION
double* aml_array_dbl_1d_new(int s1, double val);
double** aml_array_dbl_2d_new(int s1, int s2, double val);
double*** aml_array_dbl_3d_new(int s1, int s2, int s3, double val);
double**** aml_array_dbl_4d_new(int s1, int s2, int s3, int s4, double val);
// FIXED SIZE FILLING
void aml_array_dbl_1d_fill(double *arr, int s1, double val);
void aml_array_dbl_2d_fill(double **arr, int s1, int s2, double val);
// DOUBLE ARRAY VARIABLE SIZE CREATION
double** aml_array_dbl_2d_variable_2nd_new(int s1, int *s2, double val);
double*** aml_array_dbl_3d_variable_2nd_new(int s1, int *s2, int s3, double val);
double*** aml_array_dbl_3d_variable_3rd_new(int s1, int s2, int *s3, double val);
double**** aml_array_dbl_4d_variable_2nd_new(int s1, int *s2, int s3, int s4, double val);
double**** aml_array_dbl_4d_variable_4th_new(int s1, int s2, int s3, int *s4, double val);
double**** aml_array_dbl_4d_variable_2nd_and_4th(int s1, int *s2, int s3, int *s4, double val);
// DOUBLE ARRAY WRITING
void aml_array_dbl_1d_save(FILE *file, double *arr, int s1);
void aml_array_dbl_2d_save(FILE *file, double **arr, int s1, int s2);
void aml_array_dbl_3d_save(FILE *file, double ***arr, int s1, int s2, int s3);
void aml_array_dbl_4d_save(FILE *file, double ****arr, int s1, int s2, int s3, int s4);
void aml_array_dbl_2d_variable_2nd_save(FILE *file, double **arr, int s1, int *s2);
void aml_array_dbl_4d_variable_2nd_save(FILE *file, double ****arr, int s1, int *s2, int s3, int s4);
// DOUBLE ARRAY READING
double* aml_array_dbl_1d_load(FILE *file, int s1);
double** aml_array_dbl_2d_load(FILE *file, int s1, int s2);
double*** aml_array_dbl_3d_load(FILE *file, int s1, int s2, int s3);
double**** aml_array_dbl_4d_load(FILE *file, int s1, int s2, int s3, int s4);
double** aml_array_dbl_2d_variable_2nd_load(FILE *file, int s1, int *s2);
double**** aml_array_dbl_4d_variable_2nd_load(FILE *file, int s1, int *s2, int s3, int s4);
// DOUBLE ARRAY COPYING
void aml_array_dbl_1d_copy(double *dst, double *src, int s1);
void aml_array_dbl_2d_copy(double **dst, double **src, int s1, int s2);
void aml_array_dbl_3d_copy(double ***dst, double ***src, int s1, int s2, int s3);
void aml_array_dbl_4d_copy(double ****dst, double ****src, int s1, int s2, int s3, int s4);
void aml_array_dbl_5d_copy(double *****dst, double *****src, int s1, int s2, int s3, int s4, int s5);
void aml_array_dbl_2d_variable_2nd_copy(double **dst, double **src, int s1, int *s2);
// ARRAY DEALLOCATION
void aml_array_int_1d_free(int *arr);
void aml_array_int_2d_free(int **arr, int s1);
void aml_array_int_3d_free(int ***arr, int s1, int s2);
void aml_array_int_4d_free(int ****arr, int s1, int s2, int s3);
void aml_array_int_2d_variable_2nd_free(int **arr, int s1, int *s2);
void aml_array_dbl_1d_free(double *arr);
void aml_array_dbl_2d_free(double **arr, int s1);
void aml_array_dbl_3d_free(double ***arr, int s1, int s2);
void aml_array_dbl_4d_free(double ****arr, int s1, int s2, int s3);
void aml_array_dbl_2d_variable_2nd_free(double **arr, int s1, int *s2);
void aml_array_dbl_3d_variable_2nd_free(double ***arr, int s1, int *s2);
void aml_array_dbl_4d_variable_2nd_free(double ****arr, int s1, int *s2, int s3);
#endif