Psi4
qr.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 THREE_INDEX_QR
29 #define THREE_INDEX_QR
30 
31 #include "psi4/psi4-dec.h"
32 
33 #include <vector>
34 
35 namespace psi {
36 
37 class Matrix;
38 class Vector;
39 
45 class QR {
46 
47 protected:
49  int print_;
51  int debug_;
52 
54  double delta_;
62  std::vector<int> pivots_;
67 
68  void form_QR();
69  void form_PN();
70 
71 public:
72  QR(SharedMatrix A, double delta);
73  ~QR();
74 
75  void decompose();
76 
77  void set_print(int print) { print_ = print; }
78  void set_debug(int debug) { debug_ = debug; }
79 
80  SharedMatrix A() const { return A_; }
81  SharedMatrix Q() const { return Q_; }
82  SharedMatrix R() const { return R_; }
83  SharedMatrix P() const { return P_; }
84  SharedMatrix N() const { return N_; }
85  const std::vector<int>& pivots() const { return pivots_; }
86 
87 };
88 
89 } // Namespace psi
90 #endif
SharedMatrix A_
Original matrix (untouched)
Definition: qr.h:56
void set_debug(int debug)
Definition: qr.h:78
SharedMatrix R() const
Definition: qr.h:82
void decompose()
Definition: qr.cc:53
void form_QR()
Definition: qr.cc:58
~QR()
Definition: qr.cc:50
int print_
Print flag (defaults to 0)
Definition: qr.h:49
void set_print(int print)
Definition: qr.h:77
Definition: qr.h:45
int debug_
Debug flag (defaults to 0)
Definition: qr.h:51
void form_PN()
Definition: qr.cc:234
SharedMatrix P_
P factor, partial.
Definition: qr.h:64
double delta_
Termination condition.
Definition: qr.h:54
SharedMatrix R_
R factor, full.
Definition: qr.h:60
SharedMatrix P() const
Definition: qr.h:83
std::shared_ptr< Matrix > SharedMatrix
Definition: adc.h:50
int delta(const int i, const int j)
Definition: bend.cc:175
SharedMatrix A() const
Definition: qr.h:80
std::vector< int > pivots_
Pivots.
Definition: qr.h:62
SharedMatrix N() const
Definition: qr.h:84
SharedMatrix Q() const
Definition: qr.h:81
SharedMatrix N_
N factor, partial.
Definition: qr.h:66
SharedMatrix Q_
Q factor, partial.
Definition: qr.h:58
const std::vector< int > & pivots() const
Definition: qr.h:85
QR(SharedMatrix A, double delta)
Definition: qr.cc:42