SVD removed from Matrix.h
parent
7dca1d76a5
commit
3f4558cacb
|
|
@ -32,6 +32,9 @@
|
|||
#include <fstream>
|
||||
#include <limits>
|
||||
|
||||
#include <gtsam/3rdparty/Eigen/Eigen/SVD>
|
||||
#include <gtsam/3rdparty/Eigen/Eigen/LU>
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace gtsam {
|
||||
|
|
@ -697,6 +700,19 @@ std::string formatMatrixIndented(const std::string& label, const Matrix& matrix,
|
|||
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
|
||||
|
|
|
|||
|
|
@ -25,10 +25,8 @@
|
|||
#include <boost/format.hpp>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#include <boost/math/special_functions/fpclassify.hpp>
|
||||
|
||||
#include <gtsam/3rdparty/Eigen/Eigen/Core>
|
||||
#include <gtsam/3rdparty/Eigen/Eigen/Cholesky>
|
||||
#include <gtsam/3rdparty/Eigen/Eigen/SVD>
|
||||
#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 clear_below_diagonal enables zeroing out below diagonal
|
||||
*/
|
||||
template <class MATRIX>
|
||||
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);
|
||||
}
|
||||
//template <class MATRIX>
|
||||
void inplace_QR(Matrix& A);
|
||||
|
||||
/**
|
||||
* Imperative algorithm for in-place full elimination with
|
||||
|
|
|
|||
Loading…
Reference in New Issue