Psi4
mem.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Psi4: an open-source quantum chemistry software package
5  *
6  * Copyright (c) 2007-2017 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License along
22  * with this program; if not, write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24  *
25  * @END LICENSE
26  */
27 
32 #ifndef _opt_mem_h_
33 #define _opt_mem_h_
34 
35 namespace opt {
36 
37 void zero_array(double *A, long int n);
38 void zero_int_array(int *A, long int n);
39 
40 double *init_array(long int m);
41 void free_array(double *f);
42 
43 int *init_int_array(int m);
44 void free_int_array(int *f);
45 
46 bool *init_bool_array(int m);
47 void free_bool_array(bool *f);
48 
49 double **init_matrix(long int m, long int n);
50 void free_matrix(double **A);
51 void zero_matrix(double **A, long int m, long int n);
52 
53 int **init_int_matrix(long int m, long int n);
54 void free_int_matrix(int **A);
55 
56 bool **init_bool_matrix(long int m, long int n);
57 void free_bool_matrix(bool **A);
58 
59 double **unit_matrix(long int m);
60 void unit_matrix(double **A, long int m);
61 
62 }
63 
64 // C versions for BLAS/LAPACK C functions in global namespace
65 extern "C" {
66 
67 double *opt_init_array(long int m);
68 void opt_free_array(double *f);
69 
70 double **opt_init_matrix(long int m, long int n);
71 void opt_free_matrix(double **A);
72 
73 void opt_matrix_copy(double **A, double **B, long int m, long int n);
74 
75 }
76 
77 #endif
void opt_free_matrix(double **A)
Definition: mem.cc:244
void zero_array(double *A, long int n)
Definition: mem.cc:38
void zero_matrix(double **A, long int m, long int n)
Definition: mem.cc:43
void opt_free_array(double *f)
Definition: mem.cc:209
void free_int_matrix(int **A)
Definition: mem.cc:163
void opt_matrix_copy(double **from, double **to, long int nr, long int nc)
Definition: mem.cc:214
void free_matrix(double **A)
Definition: mem.cc:137
void zero_int_array(int *A, long int n)
Definition: mem.cc:49
double ** init_matrix(long int m, long int n)
Definition: mem.cc:102
void free_array(double *f)
Definition: mem.cc:88
void free_int_array(int *f)
Definition: mem.cc:93
int * init_int_array(int m)
Definition: mem.cc:69
bool ** init_bool_matrix(long int m, long int n)
Definition: mem.cc:169
double * opt_init_array(long int m)
Definition: mem.cc:199
double * init_array(long int m)
Definition: mem.cc:59
int ** init_int_matrix(long int m, long int n)
Definition: mem.cc:143
double ** opt_init_matrix(long int m, long int n)
Definition: mem.cc:221
Definition: PsiFileImpl.h:38
void free_bool_matrix(bool **A)
Definition: mem.cc:189
double ** unit_matrix(long int m)
Definition: mem.cc:123
bool * init_bool_array(int m)
Definition: mem.cc:78
void free_bool_array(bool *f)
Definition: mem.cc:97