v2DM-DOCI  1.0
SUP.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Copyright (C) 2014-2015 Ward Poelmans
5  *
6  * This file is part of v2DM-DOCI.
7  *
8  * v2DM-DOCI is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * Foobar is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with Foobar. If not, see <http://www.gnu.org/licenses/>.
20  *
21  * @END LICENSE
22  */
23 
24 #ifndef SUP_H
25 #define SUP_H
26 
27 #include <iostream>
28 #include <memory>
29 #include <string>
30 
31 #include "include.h"
32 
33 namespace doci2DM
34 {
35 
36 class SUP
37 {
38  friend std::ostream &operator<<(std::ostream &output,doci2DM::SUP &sup);
39 
40  public:
41 
42  SUP(int L, int N);
43 
44  SUP(const SUP &);
45 
46  SUP(SUP &&);
47 
48  virtual ~SUP() = default;
49 
50  SUP& operator=(const SUP &);
51 
52  SUP& operator=(SUP &&);
53 
54  SUP& operator=(double);
55 
56  SUP& operator+=(const SUP &);
57 
58  SUP& operator-=(const SUP &);
59 
60  SUP& operator*=(double);
61 
62  SUP& operator/=(double);
63 
64  void dscal(double);
65 
66  int gN() const;
67 
68  int gL() const;
69 
70  TPM const & getI() const;
71 
72  TPM & getI();
73 
74  TPM const & getQ() const;
75 
76  TPM & getQ();
77 
78  PHM const & getG() const;
79 
80  PHM & getG();
81 
82  void invert();
83 
84  void fill(const TPM &);
85 
86  void sqrt(int);
87 
88  void L_map(const SUP &, const SUP &);
89 
90  int gnr() const;
91 
92  double ddot(const SUP &) const;
93 
94  void daxpy(double, const SUP &);
95 
96  void sep_pm(SUP &, SUP &);
97 
98  void init_S(const Lineq &);
99 
100  void WriteToFile(std::string filename) const;
101 
102  void ReadFromFile(std::string filename);
103 
104  private:
106  int N;
107 
109  int L;
110 
112  std::unique_ptr<TPM> I;
113 
115  std::unique_ptr<TPM> Q;
116 
118  std::unique_ptr<PHM> G;
119 };
120 
121 }
122 
123 #endif /* SUP_H */
124 
125 /* vim: set ts=3 sw=3 expandtab :*/
void daxpy(double, const SUP &)
Definition: SUP.cpp:323
double ddot(const SUP &) const
Definition: SUP.cpp:306
SUP(int L, int N)
Definition: SUP.cpp:28
SUP & operator/=(double)
Definition: SUP.cpp:147
SUP & operator+=(const SUP &)
Definition: SUP.cpp:105
int gnr() const
Definition: SUP.cpp:270
void invert()
Definition: SUP.cpp:214
void WriteToFile(std::string filename) const
Definition: SUP.cpp:366
PHM const & getG() const
Definition: SUP.cpp:204
void L_map(const SUP &, const SUP &)
Definition: SUP.cpp:257
TPM const & getI() const
Definition: SUP.cpp:184
void sqrt(int)
Definition: SUP.cpp:244
void init_S(const Lineq &)
Definition: SUP.cpp:352
int L
the size of the sp DOCI space (there are 2*L sp states)
Definition: SUP.h:109
SUP & operator=(const SUP &)
Definition: SUP.cpp:68
int gL() const
Definition: SUP.cpp:179
void dscal(double)
Definition: SUP.cpp:161
friend std::ostream & operator<<(std::ostream &output, doci2DM::SUP &sup)
Definition: SUP.cpp:287
void sep_pm(SUP &, SUP &)
Definition: SUP.cpp:336
std::unique_ptr< TPM > I
the RDM matrix
Definition: SUP.h:112
std::unique_ptr< PHM > G
the G matrix
Definition: SUP.h:118
int N
number of particles
Definition: SUP.h:106
virtual ~SUP()=default
void fill(const TPM &)
Definition: SUP.cpp:231
SUP & operator*=(double)
Definition: SUP.cpp:133
std::unique_ptr< TPM > Q
the Q matrix
Definition: SUP.h:115
TPM const & getQ() const
Definition: SUP.cpp:194
void ReadFromFile(std::string filename)
Definition: SUP.cpp:412
int gN() const
Definition: SUP.cpp:174
SUP & operator-=(const SUP &)
Definition: SUP.cpp:119