123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- #ifndef CERES_INTERNAL_SPARSE_CHOLESKY_H_
- #define CERES_INTERNAL_SPARSE_CHOLESKY_H_
- #include "ceres/internal/config.h"
- #include <memory>
- #include "ceres/internal/disable_warnings.h"
- #include "ceres/internal/export.h"
- #include "ceres/linear_solver.h"
- #include "glog/logging.h"
- namespace ceres::internal {
- class CERES_NO_EXPORT SparseCholesky {
- public:
- static std::unique_ptr<SparseCholesky> Create(
- const LinearSolver::Options& options);
- virtual ~SparseCholesky();
-
-
-
-
-
-
-
- virtual CompressedRowSparseMatrix::StorageType StorageType() const = 0;
-
-
-
-
-
-
-
-
- virtual LinearSolverTerminationType Factorize(CompressedRowSparseMatrix* lhs,
- std::string* message) = 0;
-
-
-
- virtual LinearSolverTerminationType Solve(const double* rhs,
- double* solution,
- std::string* message) = 0;
-
-
-
- LinearSolverTerminationType FactorAndSolve(CompressedRowSparseMatrix* lhs,
- const double* rhs,
- double* solution,
- std::string* message);
- };
- class SparseIterativeRefiner;
- class CERES_NO_EXPORT RefinedSparseCholesky final : public SparseCholesky {
- public:
- RefinedSparseCholesky(
- std::unique_ptr<SparseCholesky> sparse_cholesky,
- std::unique_ptr<SparseIterativeRefiner> iterative_refiner);
- ~RefinedSparseCholesky() override;
- CompressedRowSparseMatrix::StorageType StorageType() const override;
- LinearSolverTerminationType Factorize(CompressedRowSparseMatrix* lhs,
- std::string* message) override;
- LinearSolverTerminationType Solve(const double* rhs,
- double* solution,
- std::string* message) override;
- private:
- std::unique_ptr<SparseCholesky> sparse_cholesky_;
- std::unique_ptr<SparseIterativeRefiner> iterative_refiner_;
- CompressedRowSparseMatrix* lhs_ = nullptr;
- };
- }
- #include "ceres/internal/reenable_warnings.h"
- #endif
|