-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
About: - Support for AffineSpace in opengen (issue #333) - Print support for SolverStatus - Add .jinja extension to some jinja files (issue #343) - Change hard coding of file names in builder - Fix typo in icasadi_lib.rs Issues: - Addresses #333 #343
- Loading branch information
1 parent
0ab34f7
commit 502c610
Showing
9 changed files
with
76 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ | |
from .finite_set import * | ||
from .halfspace import * | ||
from .simplex import * | ||
from .affine_space import * |
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,40 @@ | ||
import casadi.casadi as cs | ||
import numpy as np | ||
from .constraint import Constraint | ||
import opengen.functions as fn | ||
|
||
|
||
class AffineSpace(Constraint): | ||
"""An affine constraint | ||
A constraint of the form :math:`Ax = b`, where :math:`A` and :math:`b` are | ||
a matrix and a vector of appropriate dimensions | ||
""" | ||
|
||
def __init__(self, A, b): | ||
"""Constructor for an affine space | ||
:return: new instance of AffineSpace | ||
""" | ||
self.__A = A.flatten('C') | ||
self.__b = b | ||
|
||
@property | ||
def matrix_a(self): | ||
return self.__A | ||
|
||
@property | ||
def vector_b(self): | ||
return self.__b | ||
|
||
def distance_squared(self, u): | ||
raise NotImplementedError() | ||
|
||
def project(self, u): | ||
raise NotImplementedError() | ||
|
||
def is_convex(self): | ||
return True | ||
|
||
def is_compact(self): | ||
return False |
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.