-
Notifications
You must be signed in to change notification settings - Fork 0
/
matrix.h
46 lines (41 loc) · 2.2 KB
/
matrix.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
/* header file for matrix.c */
/*----------------------------------------------------------------------------
* Copyright (c) 2012, 2013, 2022 Peter Miller
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*--------------------------------------------------------------------------*/
#ifndef _matrix_h
#define _matrix_h
#ifdef __cplusplus
extern "C" {
#endif
typedef long double **matrix_ld; /* long double 2D matrix */
typedef double **matrix_d; /* double 2D matrix */
typedef float **matrix_f; /* float 2Dmatrix */
matrix_ld cr_matrix_ld (size_t numrow, size_t numcol); /* create long double matrix with specified rows*columns by allocating a single space on the heap*/
void fr_matrix_ld (matrix_ld matrix); /* free space for long double matrix */
matrix_d cr_matrix_d (size_t numrow, size_t numcol); /* create double matrix with specified rows*columns by allocating a single space on the heap*/
void fr_matrix_d (matrix_d matrix); /* free space for double matrix */
matrix_f cr_matrix_f (size_t numrow, size_t numcol); /* create float matrix */
void fr_matrix_f (matrix_f matrix); /* free space for float matrix */
#ifdef __cplusplus
}
#endif
#endif