package ortools

  1. Overview
  2. Docs
On This Page
  1. Utilities
Build and export Google OR-Tools models

Install

dune-project
 Dependency

Authors

Maintainers

Sources

ortools-9.15.0-3.tbz
sha256=2dfa5a221f07e7756afda6f23d066aae8ebb73254e201a44921f24e0491c5f7b
sha512=be451a999703a032444c632e0c87b4e391449cee0daa9f4837b0798fc7b8b1ce10abf7bc11dc7439a381a9281a7fb02b9239c75c3df0e4e70d2c690eeb8ae78c

doc/ortools/Ortools/Sat/LinearExpr/index.html

Module Sat.LinearExprSource

Linear expressions are used in linear constraints and to specify objectives.

Sourcetype t

A linear expression. An integer offset is maintainted in addition to a list of coefficients and variables. This allows both to normalize boolean literals into positive form and to represent constants (see of_int).

Sourceval zero : t

An empty linear expression.

Sourceval sum : t list -> t

A sum of linear expressions.

Sourceval sum_vars : 'a Var.t list -> t

A sum of variables: all coefficients are 1s.

Sourceval weighted_sum : (int * 'a Var.t) list -> t

A weighted sum of variables.

Sourceval scale : int -> t -> t

Multiply all coefficients by an integer.

Sourceval of_int : int -> t

A constant expression.

Sourceval var : 'a Var.t -> t

A single variable.

Sourceval term : (int * 'a Var.t) -> t

A single term. See also (*).

Sourceval neg : t -> t

Negate all coefficients (and the offset).

Sourcemodule L : sig ... end

Operators for building linear expressions. They are also available directly in the Sat module.

Utilities

Sourceval to_string : t -> string

Return a string representing the linear expression.

Sourceval pp : Format.formatter -> t -> unit

Pretty-printer for linear expressions.

Return the protocol buffer representation of a linear expression.

Sourceval to_objective_proto : t -> Cp_model.cp_objective_proto

Return the protocol buffer representation of a linear expression for use as an objective.