Integrate Refactor solver sources and dual MSVC CMake builds
This commit is contained in:
@@ -1,65 +1,12 @@
|
||||
#ifndef FESA_SOLVERS_EIGEN_MKL_FEAST_EIGEN_SOLVER_H_
|
||||
#define FESA_SOLVERS_EIGEN_MKL_FEAST_EIGEN_SOLVER_H_
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "fesa/core/status.h"
|
||||
#include "fesa/math/matrix.h"
|
||||
#include "fesa/solvers/eigen/eigen_solver.h"
|
||||
|
||||
namespace fesa {
|
||||
|
||||
class SparseMatrix;
|
||||
|
||||
/// @brief Records one deterministic private-backend invocation.
|
||||
struct FeastBackendCall {
|
||||
std::size_t ordinal;
|
||||
std::string kind;
|
||||
std::string purpose;
|
||||
double lower;
|
||||
double upper;
|
||||
std::size_t allocated_m0;
|
||||
int info;
|
||||
bool count_available;
|
||||
std::size_t count;
|
||||
bool loop_available;
|
||||
int loop;
|
||||
bool epsout_available;
|
||||
double epsout;
|
||||
std::string outcome;
|
||||
std::string decision_reason;
|
||||
};
|
||||
|
||||
/// @brief Owns the complete validated FEAST interval result before public N
|
||||
/// selection.
|
||||
struct FeastEigenResult {
|
||||
std::size_t requested_modes;
|
||||
std::vector<double> eigenvalues;
|
||||
Matrix eigenvectors;
|
||||
double operator_scale;
|
||||
std::vector<std::size_t> column_ids;
|
||||
std::vector<bool> backend_res_available;
|
||||
std::vector<double> backend_res;
|
||||
std::vector<double> normalized_eigenvalues;
|
||||
std::vector<double> whitened_residuals;
|
||||
double gram_error;
|
||||
std::vector<FeastBackendCall> backend_calls;
|
||||
std::vector<std::int64_t> base_fpm;
|
||||
std::string runtime_version;
|
||||
std::string integer_abi;
|
||||
std::size_t thread_count;
|
||||
std::uint64_t seed;
|
||||
double enclosure_lower;
|
||||
double enclosure_upper;
|
||||
double solve_lower;
|
||||
double solve_upper;
|
||||
std::string upper_search_termination;
|
||||
};
|
||||
|
||||
/// @brief Adapts standard and symmetric-definite sparse pencils to FEAST.
|
||||
class MklFeastEigenSolver final {
|
||||
class MklFeastEigenSolver final : public EigenSolver {
|
||||
public:
|
||||
/// @brief Computes all validated interval pairs for a requested lowest-mode
|
||||
/// prefix.
|
||||
@@ -74,8 +21,8 @@ class MklFeastEigenSolver final {
|
||||
/// @note The implementation fixes oneMKL local thread count to one during
|
||||
/// every call.
|
||||
Result<FeastEigenResult> Solve(const SparseMatrix& whitened_operator,
|
||||
std::size_t requested_modes,
|
||||
double zero_operator_scale) const;
|
||||
std::size_t requested_modes,
|
||||
double zero_operator_scale) const override;
|
||||
/// @brief Solves the original sparse symmetric definite K/M pencil.
|
||||
/// @param mass_lower_bound Certified positive lower spectral bound of M,
|
||||
/// including floating-point assembly uncertainty; never a diagonal estimate.
|
||||
@@ -86,16 +33,16 @@ class MklFeastEigenSolver final {
|
||||
/// classification_scale, while eigenvalues are returned in physical units.
|
||||
Result<FeastEigenResult> SolveGeneralized(const SparseMatrix& stiffness,
|
||||
const SparseMatrix& mass,
|
||||
std::size_t requested_modes,
|
||||
std::size_t requested_modes,
|
||||
double mass_lower_bound,
|
||||
double classification_scale) const;
|
||||
double classification_scale) const override;
|
||||
|
||||
private:
|
||||
/// @brief Shares deterministic count/search controls without changing
|
||||
/// pencils.
|
||||
Result<FeastEigenResult> SolveImpl(const SparseMatrix& stiffness,
|
||||
const SparseMatrix* mass,
|
||||
std::size_t requested_modes,
|
||||
std::size_t requested_modes,
|
||||
double physical_scale,
|
||||
double mass_lower_bound) const;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user