mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-15 01:21:48 +08:00
Disable deprecated warnings in SVD tests.
(cherry picked from commit f0b81fefb7247b3fae48407d7a18614189d5996a)
This commit is contained in:
parent
0a5abc042e
commit
bb1dbb4df6
@ -10,6 +10,13 @@
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/
|
||||
|
||||
// We explicitly disable deprecated declarations for this set of tests
|
||||
// because we purposely verify assertions for the deprecated SVD runtime
|
||||
// option behavior.
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
|
||||
// discard stack allocation as that too bypasses malloc
|
||||
#define EIGEN_STACK_ALLOCATION_LIMIT 0
|
||||
#define EIGEN_RUNTIME_NO_MALLOC
|
||||
@ -49,6 +56,8 @@ void bdcsvd_method()
|
||||
VERIFY_IS_APPROX(m.bdcSvd().singularValues(), RealVecType::Ones());
|
||||
VERIFY_RAISES_ASSERT(m.bdcSvd().matrixU());
|
||||
VERIFY_RAISES_ASSERT(m.bdcSvd().matrixV());
|
||||
|
||||
// Deprecated behavior.
|
||||
VERIFY_IS_APPROX(m.bdcSvd(ComputeFullU|ComputeFullV).solve(m), m);
|
||||
VERIFY_IS_APPROX(m.bdcSvd(ComputeFullU|ComputeFullV).transpose().solve(m), m);
|
||||
VERIFY_IS_APPROX(m.bdcSvd(ComputeFullU|ComputeFullV).adjoint().solve(m), m);
|
||||
|
@ -8,6 +8,13 @@
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// We explicitly disable deprecated declarations for this set of tests
|
||||
// because we purposely verify assertions for the deprecated SVD runtime
|
||||
// option behavior.
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
|
||||
// discard stack allocation as that too bypasses malloc
|
||||
#define EIGEN_STACK_ALLOCATION_LIMIT 0
|
||||
#define EIGEN_RUNTIME_NO_MALLOC
|
||||
|
@ -490,14 +490,16 @@ void svd_verify_assert(const MatrixType& m, bool fullOnly = false)
|
||||
svd.singularValues();
|
||||
VERIFY_RAISES_ASSERT(svd.solve(rhs))
|
||||
|
||||
svd.compute(a, ComputeFullU);
|
||||
svd.matrixU();
|
||||
VERIFY_RAISES_ASSERT(svd.matrixV())
|
||||
VERIFY_RAISES_ASSERT(svd.solve(rhs))
|
||||
svd.compute(a, ComputeFullV);
|
||||
svd.matrixV();
|
||||
VERIFY_RAISES_ASSERT(svd.matrixU())
|
||||
VERIFY_RAISES_ASSERT(svd.solve(rhs))
|
||||
// Deprecated behavior.
|
||||
SvdType svd3(a, ComputeFullU);
|
||||
svd3.matrixU();
|
||||
VERIFY_RAISES_ASSERT(svd3.matrixV())
|
||||
VERIFY_RAISES_ASSERT(svd3.solve(rhs))
|
||||
|
||||
SvdType svd4(a, ComputeFullV);
|
||||
svd4.matrixV();
|
||||
VERIFY_RAISES_ASSERT(svd4.matrixU())
|
||||
VERIFY_RAISES_ASSERT(svd4.solve(rhs))
|
||||
|
||||
if (!fullOnly && ColsAtCompileTime == Dynamic)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user