Type error in ternary operator in Eigen
问题 I'm doing a class in c++ to generalize two sparse matrix solvers (SparseLU and Sparse Cholesky). When I try to use the ternary operator it says that the operand types are incompatible, but if I use the If statement, the code compiles. Error 2 error: operand types are incompatible ("const Eigen::Solve < Eigen::SimplicialLDLT < Eigen::SparseMatrix < double, 0, int > , 1, Eigen::AMDOrdering < int > > , Eigen::Matrix < double, -1, 1, 0, -1, 1 > > " and "const Eigen::Solve < Eigen::SparseLU <