1 // Copyright 2010-2021 Google LLC
2 // Licensed under the Apache License, Version 2.0 (the "License");
3 // you may not use this file except in compliance with the License.
4 // You may obtain a copy of the License at
5 //
6 //     http://www.apache.org/licenses/LICENSE-2.0
7 //
8 // Unless required by applicable law or agreed to in writing, software
9 // distributed under the License is distributed on an "AS IS" BASIS,
10 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 // See the License for the specific language governing permissions and
12 // limitations under the License.
13 
14 // TODO(user): Refactor this file to adhere to the SWIG style guide.
15 
16 %include "enums.swg"
17 
18 %include "ortools/base/base.i"
19 %include "ortools/util/csharp/vector.i"
20 
21 // Include the file we want to wrap a first time.
22 %{
23 #include "ortools/algorithms/knapsack_solver.h"
24 %}
25 
26 // by default vector<vector<int64_t>> is mapped to a jagged array i.e. .Net type long[][]
27 // but here we want a regular matrix i.e. .Net type long[,]
28 REGULAR_MATRIX_AS_CSHARP_ARRAY(int64_t, int64_t, long, Int64VectorVector);
29 
30 %rename (UseReduction) operations_research::KnapsackSolver::use_reduction;
31 %rename (SetUseReduction) operations_research::KnapsackSolver::set_use_reduction;
32 
33 // TODO(user): Replace with %ignoreall/%unignoreall
34 //swiglint: disable include-h-allglobals
35 %include "ortools/algorithms/knapsack_solver.h"
36