Mentions légales du service

Skip to content
Snippets Groups Projects
Commit b476506d authored by hhakim's avatar hhakim
Browse files

Minor doc update/fix in pyfaust ConstraintMat and supp proj.

parent ec72b5ff
No related branches found
No related tags found
No related merge requests found
Pipeline #833917 skipped
......@@ -225,7 +225,8 @@ class ConstraintMat(ConstraintGeneric):
self._cons_value = self.cons_value
if(cons_value_sz == None):
self._cons_value_sz = self._num_cols*self._num_rows
self._cons_value_sz = cons_value_sz
else:
self._cons_value_sz = cons_value_sz
if(normalized == None):
if(self._name.name == ConstraintName.CONST):
# for const proj the default is to not normalize
......@@ -251,23 +252,6 @@ class ConstraintMat(ConstraintGeneric):
self._cons_value_sz,
self.normalized, self.pos)
#class ConstraintMatBlockdiag(ConstraintGeneric):
#
#
# def __init__(self, name, cons_value, normalized=None, pos=False):
# super(ConstraintMatBlockdiag, self).__init__(name, cons_value._shape[0],
# cons_value._shape[1],
# cons_value, normalized, pos)
# from pyfaust.proj import blockdiag
# if(not isinstance(cons_value, blockdiag)):
# raise TypeError("cons_value must be a blockdiag")
# self.normalized = normalized
# self.pos = pos
#
# def project(self, M):
# ConstraintGeneric.project(self, M)
# return self.cons_value(M)
class ConstraintReal(ConstraintGeneric):
"""
......
......@@ -237,11 +237,13 @@ class supp(proj_gen):
Example:
>>> from pyfaust.proj import supp
>>> from numpy.random import rand, zeros
>>> from numpy.random import rand
>>> from numpy import zeros
>>> M = rand(5,5)
>>> S = zeros(5,5)
>>> S = zeros((5,5))
>>> S[M>.5] = 1
>>> p = supp(S)
>>> M
array([[ 0. , 0. , 0.22763947, 0.35813742,
0.32570465],
[ 0. , 0.33306546, 0. , 0. ,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment