Psi4
typedefs.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 
28 #ifndef libmints_typedefs_h
29 #define libmints_typedefs_h
30 
31 #include <memory> // for shared_ptr
32 
33 // Handy mints timer macros, requires libqt to be included
34 #ifdef MINTS_TIMER
35 # include "psi4/libqt/qt.h"
36 # define mints_timer_on(a) timer_on((a));
37 # define mints_timer_off(a) timer_off((a));
38 #else
39 # define mints_timer_on(a)
40 # define mints_timer_off(a)
41 #endif
42 
43 // Forward declare psi
44 namespace psi {
45 class Matrix;
46 class Vector;
47 class Wavefunction;
48 using SharedMatrix = std::shared_ptr<Matrix>;
49 using SharedVector = std::shared_ptr<Vector>;
50 using SharedWavefunction = std::shared_ptr<Wavefunction>;
51 
52 // Useful when working with SO-TEIs
53 template<typename T>
54 void swap_index(T& a, T& b) {
55  T temp;
56  temp = b;
57  b = a;
58  a = temp;
59 }
60 
61 #define SWAP_INDEX(a, b) swap_index(a ## abs, b ## abs); swap_index(a ## rel, b ## rel); swap_index(a ## irrep, b ## irrep);
62 
63 }
64 
65 
66 #endif // libmints_typedefs_h
void swap_index(T &a, T &b)
Definition: typedefs.h:54
Header file for the Quantum Trio LibraryDavid Sherrill 1994.
std::shared_ptr< Matrix > SharedMatrix
Definition: adc.h:50
std::shared_ptr< Wavefunction > SharedWavefunction
Definition: typedefs.h:50
Definition: PsiFileImpl.h:39
std::shared_ptr< Vector > SharedVector
Definition: adc.h:52