# Path: soap/semantics/error.py
# class IntegerInterval(Interval):
#     """The interval containing integer values."""
#     def __init__(self, v=None, top=False, bottom=False):
#         super().__init__(v, top=top, bottom=bottom)
#         try:
#             if self.min not in (-inf, inf):
#                 self.min = mpz(self.min)
#             if self.max not in (-inf, inf):
#                 self.max = mpz(self.max)
#         except AttributeError:
#             'The interval is a top or bottom.'
# 
#     def __truediv__(self, other):
#         return FloatInterval(self) / other
# 
# Path: soap/semantics/linalg.py
# class IntegerIntervalArray(MultiDimensionalArray):
#     value_class = IntegerInterval


import itertools
import unittest
from soap.semantics.error import IntegerInterval
from soap.semantics.linalg import IntegerIntervalArray as IntArray



class TestIntArray(unittest.TestCase):
    def _list_elements_to_interval(self, values):
        return [[IntegerInterval(e) for e in l] for l in values]

    def setUp(self):
        self.vector_values = [1, 2, 3]
        self.vector = IntArray(self.vector_values)
        self.matrix_values = self._list_elements_to_interval([
            [[1, 5], [2, 6], [3, 7]],
            [[4, 8], [5, 9], [6, 9]],
            [[7, 9], [8, 9], [9, 9]]])
        self.matrix = IntArray(self.matrix_values)

    def test_matrix_shape(self):
        self.assertEqual(self.vector.shape, (3, ))
        self.assertEqual(self.matrix.shape, (3, 3))

    def test_matrix_content(self):

# Path: soap/semantics/error.py
# class IntegerInterval(Interval):
#     """The interval containing integer values."""
#     def __init__(self, v=None, top=False, bottom=False):
#         super().__init__(v, top=top, bottom=bottom)
#         try:
#             if self.min not in (-inf, inf):
#                 self.min = mpz(self.min)
#             if self.max not in (-inf, inf):
#                 self.max = mpz(self.max)
#         except AttributeError:
#             'The interval is a top or bottom.'
# 
#     def __truediv__(self, other):
#         return FloatInterval(self) / other
# 
# Path: soap/semantics/linalg.py
# class IntegerIntervalArray(MultiDimensionalArray):
#     value_class = IntegerInterval


# Path: tests/test_linalg.py
import itertools
import unittest
from soap.semantics.error import IntegerInterval
from soap.semantics.linalg import IntegerIntervalArray as IntArray




class TestIntArray(unittest.TestCase):
    def _list_elements_to_interval(self, values):
        return [[IntegerInterval(e) for e in l] for l in values]

    def setUp(self):
        self.vector_values = [1, 2, 3]
        self.vector = IntArray(self.vector_values)
        self.matrix_values = self._list_elements_to_interval([
            [[1, 5], [2, 6], [3, 7]],
            [[4, 8], [5, 9], [6, 9]],
            [[7, 9], [8, 9], [9, 9]]])
        self.matrix = IntArray(self.matrix_values)

    def test_matrix_shape(self):
        self.assertEqual(self.vector.shape, (3, ))
        self.assertEqual(self.matrix.shape, (3, 3))

    def test_matrix_content(self):

        intervals = [IntegerInterval(v) for v in self.vector_values]