From 555b86a309d49b19149ed89f5cea758feb1df686 Mon Sep 17 00:00:00 2001 From: Corentin Le Molgat Date: Mon, 10 Jul 2023 09:56:50 +0200 Subject: [PATCH] linear_solver: format .cs --- ortools/linear_solver/csharp/LinearExpr.cs | 4 ++-- ortools/linear_solver/csharp/LinearSolverTests.cs | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ortools/linear_solver/csharp/LinearExpr.cs b/ortools/linear_solver/csharp/LinearExpr.cs index 58eaa27418..0654dfb491 100644 --- a/ortools/linear_solver/csharp/LinearExpr.cs +++ b/ortools/linear_solver/csharp/LinearExpr.cs @@ -194,7 +194,7 @@ class ProductCst : LinearExpr { return expr_.SolutionValue() * coeff_; } - + private LinearExpr expr_; private double coeff_; } @@ -223,7 +223,7 @@ class SumCst : LinearExpr return 0.0; } } - + public override double SolutionValue() { return expr_.SolutionValue() + coeff_; diff --git a/ortools/linear_solver/csharp/LinearSolverTests.cs b/ortools/linear_solver/csharp/LinearSolverTests.cs index 273ff042ab..fcd41835e5 100644 --- a/ortools/linear_solver/csharp/LinearSolverTests.cs +++ b/ortools/linear_solver/csharp/LinearSolverTests.cs @@ -446,16 +446,17 @@ public class LinearSolverTest [Fact] static void Given_a_LinearExpr_and_a_solution_When_SolutionValue_is_called_then_the_result_is_correct() { - Console.WriteLine(nameof(Given_a_LinearExpr_and_a_solution_When_SolutionValue_is_called_then_the_result_is_correct)); + Console.WriteLine( + nameof(Given_a_LinearExpr_and_a_solution_When_SolutionValue_is_called_then_the_result_is_correct)); Solver solver = Solver.CreateSolver("glop"); // x, y and z are fixed; we don't want to test the solver here. Variable x = solver.MakeIntVar(3, 3, "x"); Variable y = solver.MakeIntVar(4, 4, "y"); Variable z = solver.MakeIntVar(5, 5, "z"); - LinearExpr part1 = x * 2; // 6 - LinearExpr part2 = y * 3 + z + 4; // 21 - LinearExpr objective = part1 + part2; // 27 + LinearExpr part1 = x * 2; // 6 + LinearExpr part2 = y * 3 + z + 4; // 21 + LinearExpr objective = part1 + part2; // 27 LinearExpr anew = new(); solver.Maximize(objective); solver.Solve();