-
Notifications
You must be signed in to change notification settings - Fork 384
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Julien Jerphanion <[email protected]>
- Loading branch information
Showing
10 changed files
with
775 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#pragma once | ||
|
||
#include "mamba/core/error_handling.hpp" | ||
#include "mamba/solver/request.hpp" | ||
#include "mamba/solver/resolvo/database.hpp" | ||
#include "mamba/solver/resolvo/unsolvable.hpp" | ||
#include "mamba/solver/solution.hpp" | ||
#include "mamba/util/variant_cmp.hpp" | ||
|
||
namespace mamba::solver::resolvo | ||
{ | ||
|
||
class Solver | ||
{ | ||
public: | ||
|
||
using Outcome = std::variant<Solution, UnSolvable>; | ||
|
||
[[nodiscard]] auto solve(PackageDatabase& pool, Request&& request) -> expected_t<Outcome>; | ||
[[nodiscard]] auto | ||
solve(PackageDatabase& pool, const Request& request) -> expected_t<Outcome>; | ||
|
||
private: | ||
|
||
auto solve_impl(PackageDatabase& pool, const Request& request) -> expected_t<Outcome>; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Copyright (c) 2023, QuantStack and Mamba Contributors | ||
// | ||
// Distributed under the terms of the BSD 3-Clause License. | ||
// | ||
// The full license is in the file LICENSE, distributed with this software. | ||
|
||
#pragma once | ||
|
||
#include <iosfwd> | ||
#include <memory> | ||
#include <string> | ||
#include <vector> | ||
|
||
#include "mamba/solver/problems_graph.hpp" | ||
|
||
namespace mamba | ||
{ | ||
class Palette; | ||
} | ||
|
||
namespace mamba::solver::resolvo | ||
{ | ||
class Solver; | ||
class PackageDatabase; | ||
|
||
class UnSolvable | ||
{ | ||
public: | ||
|
||
UnSolvable(std::string reason); | ||
|
||
UnSolvable(UnSolvable&&); | ||
|
||
~UnSolvable(); | ||
|
||
auto operator=(UnSolvable&&) -> UnSolvable&; | ||
|
||
[[nodiscard]] auto problems(PackageDatabase& pool) const -> std::vector<std::string>; | ||
|
||
[[nodiscard]] auto problems_to_str(PackageDatabase& pool) const -> std::string; | ||
|
||
[[nodiscard]] auto all_problems_to_str(PackageDatabase& pool) const -> std::string; | ||
|
||
[[nodiscard]] auto problems_graph(const PackageDatabase& pool) const -> ProblemsGraph; | ||
|
||
auto explain_problems_to( // | ||
PackageDatabase& pool, | ||
std::ostream& out, | ||
const ProblemsMessageFormat& format | ||
) const -> std::ostream&; | ||
|
||
[[nodiscard]] auto | ||
explain_problems(PackageDatabase& pool, const ProblemsMessageFormat& format) const -> std::string; | ||
|
||
private: | ||
|
||
std::string m_reason; | ||
|
||
friend class Solver; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.