v2DM-DOCI  1.0
Lineq.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 LINEQ_H
25 #define LINEQ_H
26 
27 #include <iostream>
28 #include <vector>
29 
30 #include "TPM.h"
31 #include "SUP.h"
32 
33 namespace doci2DM
34 {
35 
43 class Lineq
44 {
50  friend std::ostream &operator<<(std::ostream &output,Lineq &lineq_p);
51 
52  public:
53 
54  Lineq(int L,int N, bool=false);
55 
56  virtual ~Lineq() = default;
57 
58  int gN() const;
59 
60  int gnr() const;
61 
62  int gL() const;
63 
64  const TPM &gE(int) const;
65 
66  double ge(int) const;
67 
68  const TPM &gE_ortho(int) const;
69 
70  double ge_ortho(int) const;
71 
72  const SUP &gu_0(int) const;
73 
74  const SUP &gu_0_ortho(int) const;
75 
76  void check(const TPM &tpm) const;
77 
78  void orthogonalize();
79 
80  private:
81 
82  void constr_u_0();
83 
84  void orthogonalize_u_0();
85 
87  std::vector<TPM> E;
89  std::vector<double> e;
90 
92  std::vector<TPM> E_ortho;
94  std::vector<double> e_ortho;
95 
97  std::vector<SUP> u_0;
98 
100  std::vector<SUP> u_0_ortho;
101 
103  int N;
104 
106  int L;
107 };
108 
109 }
110 
111 #endif /* LINEQ_H */
112 
113 /* vim: set ts=3 sw=3 expandtab :*/
double ge(int) const
Definition: Lineq.cpp:123
std::vector< double > e
pointer of doubles, will contain the values of the projections. (the desired equalities) ...
Definition: Lineq.h:89
virtual ~Lineq()=default
friend std::ostream & operator<<(std::ostream &output, Lineq &lineq_p)
Definition: Lineq.cpp:150
std::vector< TPM > E
double pointer to TPM object, will contain the linear equality constraints
Definition: Lineq.h:87
std::vector< SUP > u_0_ortho
will contain the orthogonalized matrices that span u^0 space
Definition: Lineq.h:100
double ge_ortho(int) const
Definition: Lineq.cpp:143
int gnr() const
Definition: Lineq.cpp:95
int gL() const
Definition: Lineq.cpp:103
void orthogonalize_u_0()
Definition: Lineq.cpp:262
std::vector< SUP > u_0
will contain the matrices that span u^0 space
Definition: Lineq.h:97
std::vector< TPM > E_ortho
orthogonalized constraints, these will be hidden from the public.
Definition: Lineq.h:92
Lineq(int L, int N, bool=false)
Definition: Lineq.cpp:36
int L
nr of sp orbs
Definition: Lineq.h:106
void check(const TPM &tpm) const
Definition: Lineq.cpp:321
void constr_u_0()
Definition: Lineq.cpp:243
int gN() const
Definition: Lineq.cpp:87
const SUP & gu_0(int) const
Definition: Lineq.cpp:224
const TPM & gE(int) const
Definition: Lineq.cpp:113
int N
nr of particles
Definition: Lineq.h:103
const SUP & gu_0_ortho(int) const
Definition: Lineq.cpp:234
void orthogonalize()
Definition: Lineq.cpp:179
const TPM & gE_ortho(int) const
Definition: Lineq.cpp:133
std::vector< double > e_ortho
the values accompanying the orthogonalized constraints
Definition: Lineq.h:94