Commit Graph

16 Commits

Author SHA1 Message Date
Mizux Seiha
8bb54b04ef Bump Copyright to 2021
FYI:
find ortools \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i 's/\(Copyright 2010\)-2018/\1-2021/g'
2021-04-01 21:00:53 +02:00
Corentin Le Molgat
a40143cdd2 cpp: Migrate int64 to int64_t 2021-04-01 20:20:43 +02:00
Mizux Seiha
d874be2562 dotnet: Add support for vector<vector<CType>> 2021-02-19 16:02:51 +01:00
Corentin Le Molgat
22356ff523 Sync g3 -> gh part_2 2020-03-09 18:34:21 +01:00
Corentin Le Molgat
ed9136bb48 .Net swig refactor 2020-02-17 10:51:57 +01:00
Laurent Perron
f111661e92 remove comment 2019-05-08 16:28:34 +02:00
Laurent Perron
a70ed70563 remove the need for IntArrayHelper.cs; support conversion from type[][] and type[,] to std::vector<std::vector<type>> in C# 2019-05-06 12:55:30 +02:00
Corentin Le Molgat
2f0680127d Backport from g3 to github 2019-03-13 13:51:31 +01:00
Corentin Le Molgat
582805f12b .Net: fix leak in vector.i wrapping
Test.cs:
using System;
using Xunit;
using Google.OrTools.ConstraintSolver;
using static Google.OrTools.ConstraintSolver.operations_research_constraint_solver;

namespace Google.OrTools.Tests {
  public class Tmp {
    [Theory][InlineData(false)][InlineData(true)]
      public void IntVectorToInt64Vector(bool callGC) {
        Console.WriteLine("GC enabled: {0}", callGC);

        Console.WriteLine("initialization...");
        int[] input = new int[100000];
        for(int i=0; i < input.Length; ++i) {
          input[i] = 2*i;
        }
        Console.WriteLine("initialization...DONE");

        for(int i=0; i < 1000000; ++i) {
          long[] output = ToInt64Vector(input);
          Assert.Equal(input.Length, output.Length);
          Assert.Equal(0, output[0]);
          Assert.Equal(2, output[1]);
          Assert.Equal(2*(input.Length-1), output[input.Length-1]);
          if (callGC) {
            GC.Collect();
            GC.WaitForPendingFinalizers();
          }
        }
      }

    [Theory][InlineData(false)][InlineData(true)]
      public void Sequence(bool callGC) {
        Console.WriteLine("GC enabled: {0}", callGC);

        Console.WriteLine("initialization...");
        Solver solver = new Solver("Solver");
        Assignment ass = solver.MakeAssignment();
        IntervalVar[] intervals =
          solver.MakeFixedDurationIntervalVarArray(10, 0, 10, 5, false, "task");
        DisjunctiveConstraint disjunctive = intervals.Disjunctive("Sequence");
        SequenceVar var = disjunctive.SequenceVar();
        ass.Add(var);
        Console.WriteLine("initialization...DONE");

        for(int i=0; i < 1000000; ++i) {
          ass.SetForwardSequence(var, new int[] { 1, 3, 5 });
          int[] seq = ass.ForwardSequence(var);
          Assert.Equal(3, seq.Length);
          Assert.Equal(1, seq[0]);
          Assert.Equal(3, seq[1]);
          Assert.Equal(5, seq[2]);
          if (callGC) {
            GC.Collect();
            GC.WaitForPendingFinalizers();
          }
        }
        GC.KeepAlive(solver);
      }

  }
}  // namespace Google.OrTools.Tests

then
```
make run_test SOURCE=tmp.cs &
htop
```
2019-03-08 14:42:39 +01:00
Corentin Le Molgat
ee8c0a05f6 .Net: Cleanup MATRIX_AS_CSHARP_ARRAY 2019-03-07 17:44:09 +01:00
Corentin Le Molgat
dfa2f640df .Net: Add OUTPUT support in VECTOR_AS_CSHARP_ARRAY 2019-03-07 17:44:09 +01:00
Corentin Le Molgat
22a4a1ea55 .Net: Cleanup VECTOR_AS_CSHARP_ARRAY 2019-03-07 11:10:29 +01:00
Corentin Le Molgat
310ce27f27 .Net: remove uneeded typedef from vector.i
- already in base.i
2019-03-07 11:01:32 +01:00
Corentin Le Molgat
532645d774 csharp: fix RoutingNodeIndex typenames 2019-01-17 13:14:55 +01:00
Laurent Perron
fedf3d4ff4 revamp and simplify swig support, force typed enums for C# and Java for all except the constraint_solver/routing module; port examples; Fix SAT on very large problems 2018-12-11 17:03:03 +01:00
Corentin Le Molgat
b027e57e95 dotnet: Remove reference to dotnet release command
- Currently not implemented...

Add abseil patch

- Add patches/absl-config.cmake

Makefile: Add abseil-cpp on unix

- Force abseil-cpp SHA1 to 45221cc
  note: Just before the PR #136 which break all CMake

Makefile: Add abseil-cpp on windows

- Force abseil-cpp SHA1 to 45221cc
  note: Just before the PR #136 which break all CMake

CMake: Add abseil-cpp

- Force abseil-cpp SHA1 to 45221cc
  note: Just before the PR #136 which break all CMake

port to absl: C++ Part

- Fix warning with the use of ABSL_MUST_USE_RESULT
  > The macro must appear as the very first part of a function
    declaration or definition:
    ...
    Note: past advice was to place the macro after the argument list.
  src: dependencies/sources/abseil-cpp-master/absl/base/attributes.h:418
- Rename enum after windows clash
- Remove non compact table constraints
- Change index type from int64 to int in routing library
- Fix file_nonport compilation on windows
- Fix another naming conflict with windows (NO_ERROR is a macro)
- Cleanup hash containers; work on sat internals
- Add optional_boolean sub-proto

Sync cpp examples with internal code
- reenable issue173 after reducing number of loops

port to absl: Python Part

- Add back cp_model.INT32_MIN|MAX for examples

Update Python examples

- Add random_tsp.py
- Run words_square example
- Run magic_square in python tests

port to absl: Java Part

- Fix compilation of the new routing parameters in java
- Protect some code from SWIG parsing

Update Java Examples

port to absl: .Net Part

Update .Net examples

work on sat internals; Add C++ CP-SAT CpModelBuilder API; update sample code and recipes to use the new API; sync with internal code

Remove VS 2015 in Appveyor-CI

- abseil-cpp does not support VS 2015...

improve tables

upgrade C++ sat examples to use the new API; work on sat internals

update license dates

rewrite jobshop_ft06_distance.py to use the CP-SAT solver

rename last example

revert last commit

more work on SAT internals

fix
2018-11-30 14:48:55 +01:00