-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add 'distance' between vector and set to API
- Loading branch information
Showing
5 changed files
with
38 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
""" | ||
distance(x::AbstractVector, X::LazySet; [p]::Real=2) | ||
distance(X::LazySet, x::AbstractVector; [p]::Real=2) | ||
Compute the standard distance (induced by the ``p``-norm) between a point and a set. | ||
### Input | ||
- `x` -- point/vector | ||
- `X` -- set | ||
- `p` -- (optional; default: `2`) value of the ``p``-norm | ||
### Output | ||
A real number representing the distance between `x` and `X`. | ||
### Notes | ||
The standard distance is zero if the point lies inside the set, and infinite if the set is empty. | ||
Otherwise, it is the ``p``-norm of the shortest line segment between the point and any other point | ||
in the set. Formally, | ||
```math | ||
\\inf_{y ∈ X} \\{ d(x, y) \\}. | ||
``` | ||
""" | ||
function distance(::AbstractVector, ::LazySet; p::Real=2) end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters