다음 코드 조각에 문제가 있습니다. 몇 가지 조사를 한 후에 별도의 줄에서 문제를 찾아 냈지만 지금 해결 방법을 모르겠습니다.Eigen Sparse LU solver 반환 값
typedef double ComplexType;
typedef std::complex<ComplexType> Complex;
typedef Eigen::SparseMatrix<Complex, Eigen::ColMajor, long long> SparseMatrixT;
typedef Eigen::SparseVector<Complex, Eigen::ColMajor, long long> SparseVectorC;
typedef Eigen::SparseLU<SparseMatrixT, Eigen::COLAMDOrdering< long long>> SolverT;
SparseVectorC Solve(const Eigen::Ref<const SparseVectorC>& Rhs)
{
auto _Result = m_LU.solve(Rhs); //SolverT m_LU; defined and "prepared" elsewhere
SparseVectorC Result = _Result; // cause error C2512
return Result;
}
오류 표시
\ 고유 \ SRC \ 코어 \의 solve.h (125) : 오류 C2512 : '아이겐 :: 내부 :: 평가자 < 아이겐 :: 스파 스 벡터 < 컴플렉스, 0, 오래 오래>> ':
가 없습니다 적절한 기본 생성자 내가 조밀 한 벡터의 스파 스 중 하나의 결과를 얻을 수있는 방법 (그것이 우 달리 스파 스 있어야되지 않기 때문에). 행렬 크기가 너무 커서 추가 복사본이 불쾌 할 수 있습니다.
_Result 변수가 드문 드문 드문 드문 드문 드문 있지만 sparse 또는 dense 벡터 (사용 가능성이있는 메서드 인 toDense()가 사본을 생성 할 수 있음)를 지정하지 않아도 작동하지 않습니다.