MPQC  3.0.0-alpha
util.h
1 
2 /*
3  * Copyright 2009 Sandia Corporation. Under the terms of Contract
4  * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government
5  * retains certain rights in this software.
6  *
7  * This file is a part of the MPQC LMP2 library.
8  *
9  * The MPQC LMP2 library is free software: you can redistribute it
10  * and/or modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation, either
12  * version 3 of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this program. If not, see
21  * <http://www.gnu.org/licenses/>.
22  *
23  */
24 
25 #ifndef _chemistry_qc_lmp2_util_h
26 #define _chemistry_qc_lmp2_util_h
27 
28 #include <stdlib.h>
29 #include <iostream>
30 
31 namespace sc {
32 
33 namespace sma2 {
34 
36 template <class T1, class T2, class T3>
37 struct triplet {
39  T1 a;
41  T2 b;
43  T3 c;
44 
45  triplet() {}
46  triplet(const sma2::triplet<T1, T2, T3>&t):a(t.a),b(t.b),c(t.c) {}
47  triplet(const T1&a_,const T2&b_,const T3&c_):a(a_),b(b_),c(c_) {}
48  bool operator == (const sma2::triplet<T1, T2, T3> &t)const {
49  return a==t.a && b==t.b && c=t.c;
50  }
51  bool operator < (const sma2::triplet<T1, T2, T3> &t)const {
52  if (a<t.a) return true;
53  else if (a>t.a) return false;
54  if (b<t.b) return true;
55  else if (b>t.b) return false;
56  if (c<t.c) return true;
57  return false;
58  }
59 
60 };
61 
62 template <class T1, class T2, class T3>
63 sma2::triplet<T1, T2, T3> make_triplet(const T1&a,const T2&b, const T3&c)
64 {
65  return triplet<T1, T2, T3>(a,b,c);
66 }
67 
68 }
69 
70 }
71 
72 #endif
sc::sma2::triplet::b
T2 b
The second member of the triplet.
Definition: util.h:41
sc::sma2::triplet
Stores a triplet of data.
Definition: util.h:37
sc::sma2::triplet::a
T1 a
The first member of the triplet.
Definition: util.h:39
sc
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
sc::sma2::triplet::c
T3 c
The third member of the triplet.
Definition: util.h:43

Generated at Sun Jan 26 2020 23:23:58 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.16.