Skip to content

Commit

Permalink
[docit] affine space: python docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
alphaville committed Aug 15, 2024
1 parent 6fe3edd commit 23836b0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ rpmalloc = { version = "0.2", features = [
# epigraph of the squared Euclidean norm
roots = "0.0.8"

# Least squares solver
ndarray = { version = "0.16", features = ["approx"] }
# Least squares solver (NOTE: ndarray must be version 0.15 - not 0.16)
# Bug report: https://github.com/argmin-rs/modcholesky/issues/34
ndarray = { version = "0.15", features = ["approx"] }
modcholesky = "0.1"

# jemallocator is an optional feature; it will only be loaded if the feature
Expand Down
16 changes: 16 additions & 0 deletions open-codegen/opengen/constraints/affine_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,36 @@ def __init__(self, A, b):

@property
def matrix_a(self):
"""Matrix A
"""
return self.__A

@property
def vector_b(self):
"""Vector b
"""
return self.__b

def distance_squared(self, u):
"""Squared distance to affine space
Not implemented yet
"""
raise NotImplementedError()

def project(self, u):
"""Projection on affine space
Not implemented yet
"""
raise NotImplementedError()

def is_convex(self):
"""Affine spaces are convex sets
"""
return True

def is_compact(self):
"""Affine spaces are not compact sets
"""
return False

0 comments on commit 23836b0

Please sign in to comment.