Skip to content

Commit

Permalink
Revert "added is_pwl() and is_qp()"
Browse files Browse the repository at this point in the history
This reverts commit e10e836.
  • Loading branch information
Steven Diamond committed Oct 10, 2016
1 parent e10e836 commit f3fa44a
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 42 deletions.
3 changes: 0 additions & 3 deletions cvxpy/atoms/affine/affine_atom.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ def is_decr(self, idx):
def is_quadratic(self):
return all([arg.is_quadratic() for arg in self.args])

def is_pwl(self):
return all([arg.is_pwl() for arg in self.args])

def _grad(self, values):
"""Gives the (sub/super)gradient of the atom w.r.t. each argument.
Expand Down
5 changes: 0 additions & 5 deletions cvxpy/atoms/elementwise/abs.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ def is_decr(self, idx):
"""
return self.args[idx].is_negative()

def is_pwl(self):
"""Is the atom piecewise linear?
"""
return self.args[0].is_pwl()

def _grad(self, values):
"""Gives the (sub/super)gradient of the atom w.r.t. each argument.
Expand Down
5 changes: 0 additions & 5 deletions cvxpy/atoms/elementwise/max_elemwise.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ def is_decr(self, idx):
"""
return False

def is_pwl(self):
"""Is the atom piecewise linear?
"""
return all ([arg.is_pwl() for arg in self.args])

def _grad(self, values):
"""Gives the (sub/super)gradient of the atom w.r.t. each argument.
Expand Down
5 changes: 0 additions & 5 deletions cvxpy/atoms/max_entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ def is_decr(self, idx):
"""
return False

def is_pwl(self):
"""Is the atom piecewise linear?
"""
return self.args[0].is_pwl()

@staticmethod
def graph_implementation(arg_objs, size, data=None):
"""Reduces the atom to an affine expression and list of constraints.
Expand Down
5 changes: 0 additions & 5 deletions cvxpy/atoms/pnorm.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,6 @@ def is_decr(self, idx):
"""
return self.p >= 1 and self.args[0].is_negative()

def is_pwl(self):
"""Is the atom piecewise linear?
"""
return (self.p == 1 or self.p == np.inf) and self.args[0].is_pwl()

def get_data(self):
return [self.p, self.axis]

Expand Down
6 changes: 0 additions & 6 deletions cvxpy/expressions/expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,6 @@ def is_quadratic(self):
# Defaults to false
return False

def is_pwl(self):
"""Is the expression piecewise linear?
"""
# Defaults to false
return False

# Sign properties.

@property
Expand Down
5 changes: 0 additions & 5 deletions cvxpy/expressions/leaf.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,3 @@ def is_quadratic(self):
"""Leaf nodes are always quadratic.
"""
return True

def is_pwl(self):
"""Leaf nodes are always piecewise linear.
"""
return True
8 changes: 0 additions & 8 deletions cvxpy/problems/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
# a circular import (cvxpy.transforms imports Problem). Hence we need to import
# cvxpy here.
import cvxpy
import cvxpy.constraints.eq_constraint as eqc

import multiprocess as multiprocessing
import numpy as np
Expand Down Expand Up @@ -112,13 +111,6 @@ def is_dcp(self):
"""
return all(exp.is_dcp() for exp in self.constraints + [self.objective])

def is_qp(self):
"""Is problem a quadratic program?
"""
return (self.is_dcp() and self.objective.args[0].is_quadratic() and
all([(isinstance(c, eqc.EqConstraint) or c._expr.is_pwl())
for c in self.constraints]))

def canonicalize(self):
"""Computes the graph implementation of the problem.
Expand Down

0 comments on commit f3fa44a

Please sign in to comment.