# Path: aplError.py
# def     assertError(message):
#     """
#     raise an exception so aborting the current operation
#     """
#     raise aplException(message)


import makeQuantity ## makeVector, makePrototype
from aplError import assertError
        try:
            while True:
                S = self._L * C + self._O
                V.append(self._B[S])
                C += 1
        except IndexError:
            if self._O == 0:
                self._R = C
            elif C != self._R:
                assertError("firstAxisIterator: oops")

        self._O += 1

        return makeQuantity.makeVector(V, self._L)

# ------------------------------

class   monadicTranspose(object):
    """
    iterator for the monadic transpose of an array - version for 2x2 matrices
    """
    def __init__(self, B, D):
        self._B = B             # the data
        self._RC = D[0]         # row count (first axis vector length)
        self._CC = D[-1]        # column count (last axis vector length)

        self._RO = 0            # row offset (current row)
        self._CO = 0            # column offset (current column)

        if self._CC <= 0:

# Path: aplError.py
# def     assertError(message):
#     """
#     raise an exception so aborting the current operation
#     """
#     raise aplException(message)


# Path: aplIterators.py
import makeQuantity ## makeVector, makePrototype
from aplError import assertError

        try:
            while True:
                S = self._L * C + self._O
                V.append(self._B[S])
                C += 1
        except IndexError:
            if self._O == 0:
                self._R = C
            elif C != self._R:
                assertError("firstAxisIterator: oops")

        self._O += 1

        return makeQuantity.makeVector(V, self._L)

# ------------------------------

class   monadicTranspose(object):
    """
    iterator for the monadic transpose of an array - version for 2x2 matrices
    """
    def __init__(self, B, D):
        self._B = B             # the data
        self._RC = D[0]         # row count (first axis vector length)
        self._CC = D[-1]        # column count (last axis vector length)

        self._RO = 0            # row offset (current row)
        self._CO = 0            # column offset (current column)

        if self._CC <= 0:

            assertError("monadicTranspose: sheep dip")