upperbidiagonalization.cpp File Reference
#include "main.h"
#include <Eigen/SVD>

Functions

template<typename MatrixType >
void upperbidiag (const MatrixType &m)
 
 EIGEN_DECLARE_TEST (upperbidiagonalization)
 

Function Documentation

◆ EIGEN_DECLARE_TEST()

EIGEN_DECLARE_TEST ( upperbidiagonalization  )
34  {
35  for (int i = 0; i < g_repeat; i++) {
36  CALL_SUBTEST_1(upperbidiag(MatrixXf(3, 3)));
37  CALL_SUBTEST_2(upperbidiag(MatrixXd(17, 12)));
38  CALL_SUBTEST_3(upperbidiag(MatrixXcf(20, 20)));
39  CALL_SUBTEST_4(upperbidiag(Matrix<std::complex<double>, Dynamic, Dynamic, RowMajor>(16, 15)));
43  }
44 }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
The matrix class, also used for vectors and row-vectors.
Definition: Eigen/Eigen/src/Core/Matrix.h:186
@ RowMajor
Definition: Constants.h:320
static int g_repeat
Definition: main.h:191
const int Dynamic
Definition: Constants.h:25
#define CALL_SUBTEST_6(FUNC)
Definition: split_test_helper.h:34
#define CALL_SUBTEST_3(FUNC)
Definition: split_test_helper.h:16
#define CALL_SUBTEST_1(FUNC)
Definition: split_test_helper.h:4
#define CALL_SUBTEST_5(FUNC)
Definition: split_test_helper.h:28
#define CALL_SUBTEST_2(FUNC)
Definition: split_test_helper.h:10
#define CALL_SUBTEST_7(FUNC)
Definition: split_test_helper.h:40
#define CALL_SUBTEST_4(FUNC)
Definition: split_test_helper.h:22
void upperbidiag(const MatrixType &m)
Definition: upperbidiagonalization.cpp:14

References CALL_SUBTEST_1, CALL_SUBTEST_2, CALL_SUBTEST_3, CALL_SUBTEST_4, CALL_SUBTEST_5, CALL_SUBTEST_6, CALL_SUBTEST_7, Eigen::Dynamic, Eigen::g_repeat, i, Eigen::RowMajor, and upperbidiag().

◆ upperbidiag()

template<typename MatrixType >
void upperbidiag ( const MatrixType m)
14  {
15  const Index rows = m.rows();
16  const Index cols = m.cols();
17 
19  RealMatrixType;
21  TransposeMatrixType;
22 
23  MatrixType a = MatrixType::Random(rows, cols);
24  internal::UpperBidiagonalization<MatrixType> ubd(a);
25  RealMatrixType b(rows, cols);
26  b.setZero();
27  b.block(0, 0, cols, cols) = ubd.bidiagonal();
28  MatrixType c = ubd.householderU() * b * ubd.householderV().adjoint();
30  TransposeMatrixType d = ubd.householderV() * b.adjoint() * ubd.householderU().adjoint();
31  VERIFY_IS_APPROX(a.adjoint(), d);
32 }
int rows
Definition: Tutorial_commainit_02.cpp:1
int cols
Definition: Tutorial_commainit_02.cpp:1
Scalar * b
Definition: benchVecAdd.cpp:17
MatrixXf MatrixType
Definition: benchmark-blocking-sizes.cpp:52
#define VERIFY_IS_APPROX(a, b)
Definition: integer_types.cpp:13
const Scalar * a
Definition: level2_cplx_impl.h:32
int * m
Definition: level2_cplx_impl.h:294
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
int c
Definition: calibrate.py:100

References a, b, calibrate::c, cols, m, rows, and VERIFY_IS_APPROX.

Referenced by EIGEN_DECLARE_TEST().