mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Avoid I as an identifier, since it may clash with the C-header complex.h
This commit is contained in:
@@ -10,11 +10,11 @@
|
||||
#include "sparse_solver.h"
|
||||
#include <Eigen/IterativeLinearSolvers>
|
||||
|
||||
template<typename T, typename I> void test_bicgstab_T()
|
||||
template<typename T, typename I_> void test_bicgstab_T()
|
||||
{
|
||||
BiCGSTAB<SparseMatrix<T,0,I>, DiagonalPreconditioner<T> > bicgstab_colmajor_diag;
|
||||
BiCGSTAB<SparseMatrix<T,0,I>, IdentityPreconditioner > bicgstab_colmajor_I;
|
||||
BiCGSTAB<SparseMatrix<T,0,I>, IncompleteLUT<T,I> > bicgstab_colmajor_ilut;
|
||||
BiCGSTAB<SparseMatrix<T,0,I_>, DiagonalPreconditioner<T> > bicgstab_colmajor_diag;
|
||||
BiCGSTAB<SparseMatrix<T,0,I_>, IdentityPreconditioner > bicgstab_colmajor_I;
|
||||
BiCGSTAB<SparseMatrix<T,0,I_>, IncompleteLUT<T,I_> > bicgstab_colmajor_ilut;
|
||||
//BiCGSTAB<SparseMatrix<T>, SSORPreconditioner<T> > bicgstab_colmajor_ssor;
|
||||
|
||||
bicgstab_colmajor_diag.setTolerance(NumTraits<T>::epsilon()*4);
|
||||
|
||||
@@ -66,6 +66,7 @@
|
||||
#undef isnan
|
||||
#undef isinf
|
||||
#undef isfinite
|
||||
#undef I
|
||||
|
||||
#include <boost/multiprecision/cpp_dec_float.hpp>
|
||||
#include <boost/multiprecision/number.hpp>
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
#include "sparse_solver.h"
|
||||
#include <Eigen/IterativeLinearSolvers>
|
||||
|
||||
template<typename T, typename I> void test_conjugate_gradient_T()
|
||||
template<typename T, typename I_> void test_conjugate_gradient_T()
|
||||
{
|
||||
typedef SparseMatrix<T,0,I> SparseMatrixType;
|
||||
typedef SparseMatrix<T,0,I_> SparseMatrixType;
|
||||
ConjugateGradient<SparseMatrixType, Lower > cg_colmajor_lower_diag;
|
||||
ConjugateGradient<SparseMatrixType, Upper > cg_colmajor_upper_diag;
|
||||
ConjugateGradient<SparseMatrixType, Lower|Upper> cg_colmajor_loup_diag;
|
||||
|
||||
@@ -12,14 +12,14 @@
|
||||
#include <Eigen/IterativeLinearSolvers>
|
||||
#include <unsupported/Eigen/IterativeSolvers>
|
||||
|
||||
template<typename T, typename I> void test_incomplete_cholesky_T()
|
||||
template<typename T, typename I_> void test_incomplete_cholesky_T()
|
||||
{
|
||||
typedef SparseMatrix<T,0,I> SparseMatrixType;
|
||||
ConjugateGradient<SparseMatrixType, Lower, IncompleteCholesky<T, Lower, AMDOrdering<I> > > cg_illt_lower_amd;
|
||||
ConjugateGradient<SparseMatrixType, Lower, IncompleteCholesky<T, Lower, NaturalOrdering<I> > > cg_illt_lower_nat;
|
||||
ConjugateGradient<SparseMatrixType, Upper, IncompleteCholesky<T, Upper, AMDOrdering<I> > > cg_illt_upper_amd;
|
||||
ConjugateGradient<SparseMatrixType, Upper, IncompleteCholesky<T, Upper, NaturalOrdering<I> > > cg_illt_upper_nat;
|
||||
ConjugateGradient<SparseMatrixType, Upper|Lower, IncompleteCholesky<T, Lower, AMDOrdering<I> > > cg_illt_uplo_amd;
|
||||
typedef SparseMatrix<T,0,I_> SparseMatrixType;
|
||||
ConjugateGradient<SparseMatrixType, Lower, IncompleteCholesky<T, Lower, AMDOrdering<I_> > > cg_illt_lower_amd;
|
||||
ConjugateGradient<SparseMatrixType, Lower, IncompleteCholesky<T, Lower, NaturalOrdering<I_> > > cg_illt_lower_nat;
|
||||
ConjugateGradient<SparseMatrixType, Upper, IncompleteCholesky<T, Upper, AMDOrdering<I_> > > cg_illt_upper_amd;
|
||||
ConjugateGradient<SparseMatrixType, Upper, IncompleteCholesky<T, Upper, NaturalOrdering<I_> > > cg_illt_upper_nat;
|
||||
ConjugateGradient<SparseMatrixType, Upper|Lower, IncompleteCholesky<T, Lower, AMDOrdering<I_> > > cg_illt_uplo_amd;
|
||||
|
||||
|
||||
CALL_SUBTEST( check_sparse_spd_solving(cg_illt_lower_amd) );
|
||||
|
||||
@@ -335,8 +335,8 @@ void check_indexed_view()
|
||||
VERIFY_IS_APPROX( A(B.RowsAtCompileTime, 1), A(4,1) );
|
||||
VERIFY_IS_APPROX( A(B.RowsAtCompileTime-1, B.ColsAtCompileTime-1), A(3,3) );
|
||||
VERIFY_IS_APPROX( A(B.RowsAtCompileTime, B.ColsAtCompileTime), A(4,4) );
|
||||
const Index I = 3, J = 4;
|
||||
VERIFY_IS_APPROX( A(I,J), A(3,4) );
|
||||
const Index I_ = 3, J_ = 4;
|
||||
VERIFY_IS_APPROX( A(I_,J_), A(3,4) );
|
||||
}
|
||||
|
||||
// check extended block API
|
||||
|
||||
@@ -97,6 +97,8 @@
|
||||
#define FORBIDDEN_IDENTIFIER (this_identifier_is_forbidden_to_avoid_clashes) this_identifier_is_forbidden_to_avoid_clashes
|
||||
// B0 is defined in POSIX header termios.h
|
||||
#define B0 FORBIDDEN_IDENTIFIER
|
||||
// `I` may be defined by complex.h:
|
||||
#define I FORBIDDEN_IDENTIFIER
|
||||
|
||||
// Unit tests calling Eigen's blas library must preserve the default blocking size
|
||||
// to avoid troubles.
|
||||
|
||||
@@ -9,17 +9,17 @@
|
||||
|
||||
#include "sparse_solver.h"
|
||||
|
||||
template<typename T, typename I> void test_simplicial_cholesky_T()
|
||||
template<typename T, typename I_> void test_simplicial_cholesky_T()
|
||||
{
|
||||
typedef SparseMatrix<T,0,I> SparseMatrixType;
|
||||
typedef SparseMatrix<T,0,I_> SparseMatrixType;
|
||||
SimplicialCholesky<SparseMatrixType, Lower> chol_colmajor_lower_amd;
|
||||
SimplicialCholesky<SparseMatrixType, Upper> chol_colmajor_upper_amd;
|
||||
SimplicialLLT< SparseMatrixType, Lower> llt_colmajor_lower_amd;
|
||||
SimplicialLLT< SparseMatrixType, Upper> llt_colmajor_upper_amd;
|
||||
SimplicialLDLT< SparseMatrixType, Lower> ldlt_colmajor_lower_amd;
|
||||
SimplicialLDLT< SparseMatrixType, Upper> ldlt_colmajor_upper_amd;
|
||||
SimplicialLDLT< SparseMatrixType, Lower, NaturalOrdering<I> > ldlt_colmajor_lower_nat;
|
||||
SimplicialLDLT< SparseMatrixType, Upper, NaturalOrdering<I> > ldlt_colmajor_upper_nat;
|
||||
SimplicialLDLT< SparseMatrixType, Lower, NaturalOrdering<I_> > ldlt_colmajor_lower_nat;
|
||||
SimplicialLDLT< SparseMatrixType, Upper, NaturalOrdering<I_> > ldlt_colmajor_upper_nat;
|
||||
|
||||
check_sparse_spd_solving(chol_colmajor_lower_amd);
|
||||
check_sparse_spd_solving(chol_colmajor_upper_amd);
|
||||
|
||||
Reference in New Issue
Block a user