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 file is part of Psi4.
12  *
13  * Psi4 is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU Lesser General Public License as published by
15  * the Free Software Foundation, version 3.
16  *
17  * Psi4 is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License along
23  * with Psi4; if not, write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25  *
26  * @END LICENSE
27  */
28 
33 #ifndef _opt_mem_h_
34 #define _opt_mem_h_
35 
36 namespace opt {
37 
38 void zero_array(double *A, long int n);
39 void zero_int_array(int *A, long int n);
40 
41 double *init_array(long int m);
42 void free_array(double *f);
43 
44 int *init_int_array(int m);
45 void free_int_array(int *f);
46 
47 bool *init_bool_array(int m);
48 void free_bool_array(bool *f);
49 
50 double **init_matrix(long int m, long int n);
51 void free_matrix(double **A);
52 void zero_matrix(double **A, long int m, long int n);
53 
54 int **init_int_matrix(long int m, long int n);
55 void free_int_matrix(int **A);
56 
57 bool **init_bool_matrix(long int m, long int n);
58 void free_bool_matrix(bool **A);
59 
60 double **unit_matrix(long int m);
61 void unit_matrix(double **A, long int m);
62 
63 }
64 
65 // C versions for BLAS/LAPACK C functions in global namespace
66 extern "C" {
67 
68 double *opt_init_array(long int m);
69 void opt_free_array(double *f);
70 
71 double **opt_init_matrix(long int m, long int n);
72 void opt_free_matrix(double **A);
73 
74 void opt_matrix_copy(double **A, double **B, long int m, long int n);
75 
76 }
77 
78 #endif
void opt_free_matrix(double **A)
Definition: mem.cc:245
void zero_array(double *A, long int n)
Definition: mem.cc:39
void zero_matrix(double **A, long int m, long int n)
Definition: mem.cc:44
void opt_free_array(double *f)
Definition: mem.cc:210
void free_int_matrix(int **A)
Definition: mem.cc:164
void opt_matrix_copy(double **from, double **to, long int nr, long int nc)
Definition: mem.cc:215
void free_matrix(double **A)
Definition: mem.cc:138
void zero_int_array(int *A, long int n)
Definition: mem.cc:50
double ** init_matrix(long int m, long int n)
Definition: mem.cc:103
void free_array(double *f)
Definition: mem.cc:89
void free_int_array(int *f)
Definition: mem.cc:94
int * init_int_array(int m)
Definition: mem.cc:70
bool ** init_bool_matrix(long int m, long int n)
Definition: mem.cc:170
double * opt_init_array(long int m)
Definition: mem.cc:200
double * init_array(long int m)
Definition: mem.cc:60
int ** init_int_matrix(long int m, long int n)
Definition: mem.cc:144
double ** opt_init_matrix(long int m, long int n)
Definition: mem.cc:222
void free_bool_matrix(bool **A)
Definition: mem.cc:190
double ** unit_matrix(long int m)
Definition: mem.cc:124
bool * init_bool_array(int m)
Definition: mem.cc:79
void free_bool_array(bool *f)
Definition: mem.cc:98