Kernel Quantum Probability Library
The KQP library aims at providing tools for working with quantums probabilities
evd_update.hpp
1 /*
2  This file is part of the Kernel Quantum Probability library (KQP).
3 
4  KQP is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  KQP is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with KQP. If not, see <http://www.gnu.org/licenses/>.
16  */
17 #ifndef __KQP_FASTRANKONEUPDATE_H__
18 #define __KQP_FASTRANKONEUPDATE_H__
19 
20 #include <boost/shared_ptr.hpp>
21 #include <boost/shared_ptr.hpp>
22 
23 #include <kqp/kqp.hpp>
24 #include <Eigen/Core>
25 #include <kqp/rank_selector.hpp>
26 
27 namespace kqp {
28 
34  template <typename scalar> class EvdUpdateResult {
35  public:
36  typedef typename Eigen::NumTraits<scalar>::Real Real;
37 
41  Eigen::Matrix<Real,Dynamic,1> mD;
42 
46  Eigen::Matrix<scalar,Dynamic,Dynamic> mQ;
47  };
48 
49 
58  template <typename Scalar>
63  double gamma;
64 
65  public:
66  typedef typename Eigen::NumTraits<Scalar>::Real Real;
67  typedef Eigen::Matrix<Real,Dynamic,1> RealVector;
68  typedef Eigen::Matrix<Real,Dynamic,1> ScalarVector;
69  typedef Eigen::Matrix<Scalar,Dynamic,Dynamic> ScalarMatrix;
70 
75 
90  void update(const RealVector & D,
91  double rho, const Eigen::Matrix<Scalar,Dynamic,1> & z,
92  bool computeEigenvectors, const Selector<Real> *selector, bool keep,
94  ScalarMatrix * Z = 0);
95 
96 
97  };
98 };
99 
100 #include <kqp/evd_update.inc.hpp>
101 #endif