Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

# CVXPY Development Guide

## Quick Reference
Expand Down Expand Up @@ -262,7 +266,7 @@ pytest cvxpy/tests/nlp_tests/

**Reduction chain for DNLP:**
```
Problem → CvxAttr2Constr → Dnlp2Smooth → NLPSolver (IPOPT/Knitro)
Problem → CvxAttr2Constr → DNLP2Smooth → NLPSolver (IPOPT/Knitro)
```

**Key components:**
Expand Down
2 changes: 1 addition & 1 deletion cvxpy/atoms/pnorm.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def is_atom_concave(self) -> bool:
def is_atom_esr(self) -> bool:
"""Is the atom esr?
"""
return self.p > 1
return self.p >= 1

def is_atom_hsr(self) -> bool:
"""Is the atom hsr?
Expand Down
6 changes: 3 additions & 3 deletions cvxpy/problems/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from cvxpy.reductions import InverseData
from cvxpy.reductions.chain import Chain
from cvxpy.reductions.cvx_attr2constr import CvxAttr2Constr
from cvxpy.reductions.dnlp2smooth.dnlp2smooth import Dnlp2Smooth
from cvxpy.reductions.dnlp2smooth.dnlp2smooth import DNLP2Smooth
from cvxpy.reductions.dqcp2dcp import dqcp2dcp
from cvxpy.reductions.eval_params import EvalParams
from cvxpy.reductions.flip_objective import FlipObjective
Expand Down Expand Up @@ -1235,7 +1235,7 @@ def _solve(self,
reductions = [FlipObjective()]
else:
reductions = []
reductions = reductions + [CvxAttr2Constr(reduce_bounds=False), Dnlp2Smooth()]
reductions = reductions + [CvxAttr2Constr(reduce_bounds=False), DNLP2Smooth()]
# instantiate based on user provided solver
# (default to Ipopt)
if solver is s.IPOPT or solver is None:
Expand Down Expand Up @@ -1625,7 +1625,7 @@ def unpack(self, solution) -> None:
def unpack_results(self, solution, chain: SolvingChain, inverse_data) -> None:
"""Updates the problem state given the solver results.

Updates problem.status, problem.value and value ofro
Updates problem.status, problem.value and value of
primal and dual variables.

Arguments
Expand Down
2 changes: 1 addition & 1 deletion cvxpy/reductions/dnlp2smooth/dnlp2smooth.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from cvxpy.reductions.inverse_data import InverseData


class Dnlp2Smooth(Canonicalization):
class DNLP2Smooth(Canonicalization):
"""
Reduce a disciplined nonlinear program to an equivalent smooth program

Expand Down
14 changes: 7 additions & 7 deletions cvxpy/reductions/solvers/nlp_solvers/ipopt_nlpif.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@ def solve_via_data(self, data, warm_start: bool, verbose: bool, solver_opts, sol
verbose=verbose, use_hessian=use_hessian)

nlp = cyipopt.Problem(
n=len(data["x0"]),
m=len(data["cl"]),
problem_obj=oracles,
lb=data["lb"],
ub=data["ub"],
cl=data["cl"],
cu=data["cu"],
n=len(data["x0"]),
m=len(data["cl"]),
problem_obj=oracles,
lb=data["lb"],
ub=data["ub"],
cl=data["cl"],
cu=data["cu"],
)
# Set default IPOPT options, but use solver_opts if provided
default_options = {
Expand Down
6 changes: 3 additions & 3 deletions cvxpy/reductions/solvers/nlp_solvers/nlp_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,13 @@ def __init__(self, problem):
problem : cvxpy.Problem
The CVXPY problem to check derivatives for.
"""
from cvxpy.reductions.dnlp2smooth.dnlp2smooth import Dnlp2Smooth
from cvxpy.reductions.dnlp2smooth.dnlp2smooth import DNLP2Smooth
from cvxpy.reductions.solvers.nlp_solvers.diff_engine import C_problem

self.original_problem = problem

# Apply Dnlp2Smooth to get canonicalized problem
canon = Dnlp2Smooth().apply(problem)
# Apply DNLP2Smooth to get canonicalized problem
canon = DNLP2Smooth().apply(problem)
self.canonicalized_problem = canon[0]

# Construct the C version
Expand Down
2 changes: 1 addition & 1 deletion diff_engine_core
Loading