SVD removed from Matrix.h
parent
7dca1d76a5
commit
3f4558cacb
|
|
@ -32,6 +32,9 @@
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
|
#include <gtsam/3rdparty/Eigen/Eigen/SVD>
|
||||||
|
#include <gtsam/3rdparty/Eigen/Eigen/LU>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
namespace gtsam {
|
namespace gtsam {
|
||||||
|
|
@ -697,6 +700,19 @@ std::string formatMatrixIndented(const std::string& label, const Matrix& matrix,
|
||||||
return ss.str();
|
return ss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void inplace_QR(Matrix& A){
|
||||||
|
size_t rows = A.rows();
|
||||||
|
size_t cols = A.cols();
|
||||||
|
size_t size = std::min(rows,cols);
|
||||||
|
|
||||||
|
typedef Eigen::internal::plain_diag_type<Matrix>::type HCoeffsType;
|
||||||
|
typedef Eigen::internal::plain_row_type<Matrix>::type RowVectorType;
|
||||||
|
HCoeffsType hCoeffs(size);
|
||||||
|
RowVectorType temp(cols);
|
||||||
|
|
||||||
|
Eigen::internal::householder_qr_inplace_blocked<Matrix, HCoeffsType>::run(A, hCoeffs, 48, temp.data());
|
||||||
|
|
||||||
|
zeroBelowDiagonal(A);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace gtsam
|
} // namespace gtsam
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,8 @@
|
||||||
#include <boost/format.hpp>
|
#include <boost/format.hpp>
|
||||||
#include <boost/tuple/tuple.hpp>
|
#include <boost/tuple/tuple.hpp>
|
||||||
#include <boost/math/special_functions/fpclassify.hpp>
|
#include <boost/math/special_functions/fpclassify.hpp>
|
||||||
|
|
||||||
#include <gtsam/3rdparty/Eigen/Eigen/Core>
|
#include <gtsam/3rdparty/Eigen/Eigen/Core>
|
||||||
#include <gtsam/3rdparty/Eigen/Eigen/Cholesky>
|
#include <gtsam/3rdparty/Eigen/Eigen/Cholesky>
|
||||||
#include <gtsam/3rdparty/Eigen/Eigen/SVD>
|
|
||||||
#include <gtsam/3rdparty/Eigen/Eigen/LU>
|
#include <gtsam/3rdparty/Eigen/Eigen/LU>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -372,21 +370,8 @@ GTSAM_EXPORT std::pair<Matrix,Matrix> qr(const Matrix& A);
|
||||||
* @param A is the input matrix, and is the output
|
* @param A is the input matrix, and is the output
|
||||||
* @param clear_below_diagonal enables zeroing out below diagonal
|
* @param clear_below_diagonal enables zeroing out below diagonal
|
||||||
*/
|
*/
|
||||||
template <class MATRIX>
|
//template <class MATRIX>
|
||||||
void inplace_QR(MATRIX& A) {
|
void inplace_QR(Matrix& A);
|
||||||
size_t rows = A.rows();
|
|
||||||
size_t cols = A.cols();
|
|
||||||
size_t size = std::min(rows,cols);
|
|
||||||
|
|
||||||
typedef Eigen::internal::plain_diag_type<Matrix>::type HCoeffsType;
|
|
||||||
typedef Eigen::internal::plain_row_type<Matrix>::type RowVectorType;
|
|
||||||
HCoeffsType hCoeffs(size);
|
|
||||||
RowVectorType temp(cols);
|
|
||||||
|
|
||||||
Eigen::internal::householder_qr_inplace_blocked<MATRIX, HCoeffsType>::run(A, hCoeffs, 48, temp.data());
|
|
||||||
|
|
||||||
zeroBelowDiagonal(A);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Imperative algorithm for in-place full elimination with
|
* Imperative algorithm for in-place full elimination with
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue