Psi4
dfocc/defines.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-2018 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 
29 #ifndef DEFINES_
30 #define DEFINES_
31 
32 #define ID(x) ints->DPD_ID(x)
33 #define index2(i, j) ((i > j) ? ((i * (i + 1) / 2) + j) : ((j * (j + 1) / 2) + i))
34 #define index4(i, j, k, l) index2(index2(i, j), index2(k, l))
35 #define index3(i, j, k) (i * (i + 1) * (i + 2) / 6) + (j * (j + 1) / 2) + i
36 #define idx2(i, j, Nj) j + (i * Nj)
37 #define idx3(i, j, k, Nj, Nk) k + (j * Nk) + (i * Nj * Nk)
38 #define idx4(i, j, k, l, Nj, Nk, Nl) l + (k * Nl) + (j * Nk * Nl) + (i * Nj * Nk * Nl)
39 #define idx_asym(i, j) ((i > j) ? ((i * (i - 1) / 2) + j) : ((j * (j - 1) / 2) + i))
40 
41 #define MIN0(a, b) (((a) < (b)) ? (a) : (b))
42 #define MAX0(a, b) (((a) > (b)) ? (a) : (b))
43 
44 #define DIIS_MIN_DET 1.0E-16
45 #define DIVERGE 1.0E+3
46 
47 #endif /* DEFINES_ */