master > master: code py - display verbessert
This commit is contained in:
@@ -34,6 +34,10 @@ class Solution(SolutionRaw):
|
||||
def support(self) -> List[float]:
|
||||
return [ i for i, v in enumerate(self.vector) if v > 0 ];
|
||||
|
||||
@property
|
||||
def vector_support(self) -> List[float]:
|
||||
return [ v for v in self.vector if v > 0 ];
|
||||
|
||||
@property
|
||||
def total_weight(self) -> float:
|
||||
return sum([ self.vector[i]*x for (i, x) in zip(self.support, self.weights) ]);
|
||||
|
||||
Reference in New Issue
Block a user