コード例 #1
0
EigendecompositionResult generalized_eigendecomposition(const EigenMethod& method, const ComputationStrategy& strategy,
                                                        const EigendecompositionStrategy& eigen_strategy,
                                                        const LMatrixType& lhs, const RMatrixType& rhs, IndexType target_dimension)
{
	LoggingSingleton::instance().message_info(formatting::format("Using the {} eigendecomposition method.",
		get_eigen_method_name(method)));
#ifdef TAPKEE_WITH_ARPACK
	if (method.is(Arpack))
		return generalized_eigendecomposition_impl<LMatrixType, RMatrixType>()
			.arpack(lhs, rhs, strategy, eigen_strategy, target_dimension);
#endif
	if (method.is(Dense))
		return generalized_eigendecomposition_impl<LMatrixType, RMatrixType>()
			.dense(lhs, rhs, strategy, eigen_strategy, target_dimension);
	if (method.is(Randomized))
		throw unsupported_method_error("Randomized method is not supported for generalized eigenproblems");
	return EigendecompositionResult();
}
コード例 #2
0
EigendecompositionResult generalized_eigendecomposition(EigenMethod method, const LMatrixType& lhs,
                                                        const RMatrixType& rhs,
                                                        IndexType target_dimension, unsigned int skip)
{
	LoggingSingleton::instance().message_info("Using the " + get_eigen_method_name(method) + " eigendecomposition method.");
	switch (method)
	{
#ifdef TAPKEE_WITH_ARPACK
		case Arpack: 
			return generalized_eigendecomposition_impl_arpack<LMatrixType, RMatrixType, MatrixOperationType>(lhs, rhs, target_dimension, skip);
#endif
		case Dense:
			return generalized_eigendecomposition_impl_dense<LMatrixType, RMatrixType, MatrixOperationType>(lhs, rhs, target_dimension, skip);
		case Randomized:
			throw unsupported_method_error("Randomized method is not supported for generalized eigenproblems");
			return EigendecompositionResult();
		default: break;
	}
	return EigendecompositionResult();
}
コード例 #3
0
EmbeddingResult generalized_eigen_embedding(TAPKEE_EIGEN_EMBEDDING_METHOD method, const LMatrixType& lhs,
                                            const RMatrixType& rhs,
                                            IndexType target_dimension, unsigned int skip)
{
	switch (method)
	{
#ifdef TAPKEE_WITH_ARPACK
		case ARPACK: 
			return generalized_eigen_embedding_impl<LMatrixType, RMatrixType, MatrixOperationType, 
				ARPACK>().embed(lhs, rhs, target_dimension, skip);
#endif
		case EIGEN_DENSE_SELFADJOINT_SOLVER:
			return generalized_eigen_embedding_impl<LMatrixType, RMatrixType, MatrixOperationType,
				EIGEN_DENSE_SELFADJOINT_SOLVER>().embed(lhs, rhs, target_dimension, skip);
		case RANDOMIZED:
			throw unsupported_method_error("Randomized method is not supported for generalized eigenproblems");
			return EmbeddingResult();
		default: break;
	}
	return EmbeddingResult();
}
コード例 #4
0
	inline void unsupported() const
	{
		throw unsupported_method_error("Unsupported method");
	}