use snake case in knapsack_solver
This commit is contained in:
@@ -28,12 +28,12 @@ using ::py::arg;
|
||||
PYBIND11_MODULE(pywrapknapsack_solver, m) {
|
||||
py::class_<KnapsackSolver>(m, "KnapsackSolver")
|
||||
.def(py::init<KnapsackSolver::SolverType, const std::string&>())
|
||||
.def("Init", &KnapsackSolver::Init, arg("profits"), arg("weights"),
|
||||
.def("init", &KnapsackSolver::Init, arg("profits"), arg("weights"),
|
||||
arg("capacities"))
|
||||
.def("Solve", &KnapsackSolver::Solve)
|
||||
.def("BestSolutionContains", &KnapsackSolver::BestSolutionContains,
|
||||
.def("solve", &KnapsackSolver::Solve)
|
||||
.def("best_solution_contains", &KnapsackSolver::BestSolutionContains,
|
||||
arg("item_id"))
|
||||
.def("IsSolutionOptimal", &KnapsackSolver::IsSolutionOptimal)
|
||||
.def("is_solution_optimal", &KnapsackSolver::IsSolutionOptimal)
|
||||
.def("set_time_limit", &KnapsackSolver::set_time_limit,
|
||||
arg("time_limit_seconds"))
|
||||
.def("set_use_reduction", &KnapsackSolver::set_use_reduction,
|
||||
|
||||
@@ -27,8 +27,8 @@ class PyWrapAlgorithmsKnapsackSolverTest(unittest.TestCase):
|
||||
def RealSolve(self, profits, weights, capacities, solver_type, use_reduction):
|
||||
solver = pywrapknapsack_solver.KnapsackSolver(solver_type, "solver")
|
||||
solver.set_use_reduction(use_reduction)
|
||||
solver.Init(profits, weights, capacities)
|
||||
profit = solver.Solve()
|
||||
solver.init(profits, weights, capacities)
|
||||
profit = solver.solve()
|
||||
|
||||
return profit
|
||||
|
||||
|
||||
Reference in New Issue
Block a user