package osdp

  1. Overview
  2. Docs

Module LinExpr.MakeScalarSource

Gives an interface Scalar.S to linear expressions. Since to_float and div have no meaning for linear expressions, they are implemented as assert false. You should never use them. Simialr behavior for the moment for comparison functions. Moreover, the product of two linear expressions is a linear expression only when at least one of them is a constant. Not_linear is raised otherwise.

Parameters

module L : S

Signature

include Scalar.M with type t = L.t
Sourcetype t = L.t
Sourceval compare : t -> t -> int

A few values.

Sourceval zero : t
Sourceval one : t

Conversion functions.

Sourceval of_float : float -> t
Sourceval to_float : t -> float
Sourceval of_q : Q.t -> t
Sourceval to_q : t -> Q.t

Arithmetic operations.

Sourceval add : t -> t -> t
Sourceval sub : t -> t -> t
Sourceval mult : t -> t -> t
Sourceval div : t -> t -> t

Printing.

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

More conversion functions.

Sourceval of_int : int -> t

More arithmetic operations.

Sourceval neg : t -> t
Sourceval inv : t -> t
Sourceval equal : t -> t -> bool
Sourceval leq : t -> t -> bool
Sourceval geq : t -> t -> bool
Sourceval lt : t -> t -> bool
Sourceval gt : t -> t -> bool
Sourceval sign : t -> int

Returns -1, 0 or 1 when its argument is respectively < 0, 0 or > 0.

Prefix and infix operators.

Sourceval (~-) : t -> t
Sourceval (+) : t -> t -> t
Sourceval (-) : t -> t -> t
Sourceval (*) : t -> t -> t
Sourceval (/) : t -> t -> t
Sourceval (=) : t -> t -> bool
Sourceval (<>) : t -> t -> bool
Sourceval (<=) : t -> t -> bool
Sourceval (>=) : t -> t -> bool
Sourceval (<) : t -> t -> bool
Sourceval (>) : t -> t -> bool