
    bik
                     >    d Z ddlZddlmZ ddlmZ  G d de      Zy)a/  
Copyright 2017 Robin Verschueren

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
    N)settings)	Reductionc                       e Zd ZdZdZdZdZdZdZdZ	dZ
dZej                  d        Zej                  d	        Zd
efdZej                  ddedefd       Zej                  d        ZdedefdZy)SolverzAGeneric interface for a solver that uses reduction semantics
    dimsFvar_iddual_var_id	eq_constrother_constrc                     t               )z The name of the solver.
        NotImplementedErrorselfs    Z/home/cdr/jupyterlab/.venv/lib/python3.12/site-packages/cvxpy/reductions/solvers/solver.pynamezSolver.name,        "##    c                     t               )zImports the solver.
        r   r   s    r   import_solverzSolver.import_solver2   r   r   returnc                     	 | j                          y# t        $ rW}t        |t              s=t        j
                  j                  d| j                          dt        |      z          Y d}~yd}~ww xY w)z!Is the solver installed?
        Tz2Encountered unexpected exception importing solver z:
NF)	r   	Exception
isinstanceModuleNotFoundErrorsLOGGERwarningr   repr)r   es     r   is_installedzSolver.is_installed8   sg    		  	a!45  HUXY1g 	s    	A3AA..A3N
warm_startverbosec                     t               )zASolve a problem represented by data returned from apply.
        r   )r   datar"   r#   solver_optssolver_caches         r   solve_via_datazSolver.solve_via_dataF   r   r   c                     t               )z/Return bibtex citation for the solver.
        r   )r   r%   s     r   citezSolver.citeL   r   r   c                 v    | j                  |      \  }}| j                  ||||      }| j                  ||      S )z8Solve the problem and return a Solution object.
        )applyr(   invert)r   problemr"   r#   r&   r%   inv_datasolutions           r   solvezSolver.solveR   s=     G,h&&tZ+N{{8X..r   )N)__name__
__module____qualname____doc__DIMSMIP_CAPABLEBOUNDED_VARIABLESSOC_DIM3_ONLYVAR_IDDUAL_VAR_ID	EQ_CONSTR
NEQ_CONSTRabcabstractmethodr   r   boolr!   r(   r*   r1    r   r   r   r      s     D KM FKIJ$ $
 	$ $
d  	$t $d $ $
 	$ $
/ / /r   r   )r5   r>   cvxpyr   r   cvxpy.reductions.reductionr   r   rA   r   r   <module>rD      s#       0@/Y @/r   