Utility Functions

Utility functions

LazySets.sign_cadlagFunction.
sign_cadlag(x::N)::N where {N<:Real}

This function works like the sign function but is $1$ for input $0$.

Input

  • x – real scalar

Output

$1$ if $x ≥ 0$, $-1$ otherwise.

Notes

This is the sign function right-continuous at zero (see càdlàg function). It can be used with vector-valued arguments via the dot operator.

Examples

julia> sign_cadlag.([-0.6, 1.3, 0.0])
3-element Array{Float64,1}:
 -1.0
  1.0
  1.0
source
LazySets.jump2piFunction.
jump2pi(x::Float64)::Float64

Return $x + 2π$ if $x$ is negative, otherwise return $x$.

Input

  • x – real scalar

Output

$x + 2π$ if $x$ is negative, $x$ otherwise.

Examples

julia> jump2pi(0.0)
0.0
julia> jump2pi(-0.5)
5.783185307179586
julia> jump2pi(0.5)
0.5
source
Base.:<=Method.
<=(u::AbstractVector{Float64}, v::AbstractVector{Float64})::Bool

Compares two 2D vectors by their direction.

Input

  • u – first 2D direction

  • v – second 2D direction

Output

True iff $\arg(u) [2π] ≤ \arg(v) [2π]$

Notes

The argument is measured in counter-clockwise fashion, with the 0 being the direction (1, 0).

source