# This code is part of Qiskit.
#
# (C) Copyright IBM 2019, 2020.
#
# obtain a copy of this license in the LICENSE.txt file in the root directory
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

from typing import Union, List, Dict, Tuple, Any

from numpy import ndarray
from scipy.sparse import spmatrix

from .constraint import Constraint, ConstraintSense
from .linear_expression import LinearExpression

""" Representation of a quadratic constraint."""

# Note: added, duplicating in effect that in Constraint, to avoid issues with Sphinx
Sense = ConstraintSense

[ドキュメント]    def __init__(self,
linear: Union[ndarray, spmatrix, List[float], Dict[Union[str, int], float]],
Dict[Tuple[Union[int, str], Union[int, str]], float]],
sense: ConstraintSense,
rhs: float
) -> None:
"""Constructs a quadratic constraint, consisting of a linear and a quadratic term.

Args:
name: The name of the constraint.
linear: The coefficients specifying the linear part of the constraint.
quadratic: The coefficients specifying the linear part of the constraint.
sense: The sense of the constraint.
rhs: The right-hand-side of the constraint.
"""

@property
def linear(self) -> LinearExpression:
"""Returns the linear expression corresponding to the left-hand-side of the constraint.

Returns:
The left-hand-side linear expression.
"""
return self._linear

@linear.setter
def linear(self, linear: Union[ndarray, spmatrix, List[float],
Dict[Union[str, int], float]]) -> None:
"""Sets the linear expression corresponding to the left-hand-side of the constraint.
The coefficients can either be given by an array, a (sparse) 1d matrix, a list or a
dictionary.

Args:
linear: The linear coefficients of the left-hand-side.
"""

@property
"""Returns the quadratic expression corresponding to the left-hand-side of the constraint.

Returns:
"""

Dict[Tuple[Union[int, str], Union[int, str]], float]]) \
-> None:
"""Sets the quadratic expression corresponding to the left-hand-side of the constraint.
The coefficients can either be given by an array, a (sparse) matrix, a list or a
dictionary.

Args:
"""