# Path: glimix_core/_util/_array.py
# def unvec(x, shape):
#     return reshape(x, shape, order="F")
# 
# def vec(x):
#     return reshape(x, (-1,) + x.shape[2:], order="F")


from numpy import asarray, kron, zeros
from optimix import Function, Vector
from glimix_core._util import unvec, vec
        """
        Kronecker mean function.

        Returns
        -------
        𝐦 : ndarray
            (A⊗X)vec(B).
        """
        return self.AX @ self._vecB.value

    def gradient(self):
        """
        Gradient of the linear mean function.

        Returns
        -------
        vecB : ndarray
            Derivative of M over vec(B).
        """
        return {"vecB": self.AX}

    @property
    def B(self):
        """
        Effect-sizes parameter, B.
        """
        return unvec(self._vecB.value, (self.X.shape[1], self.A.shape[0]))

    @B.setter
    def B(self, v):

# Path: glimix_core/_util/_array.py
# def unvec(x, shape):
#     return reshape(x, shape, order="F")
# 
# def vec(x):
#     return reshape(x, (-1,) + x.shape[2:], order="F")


# Path: glimix_core/mean/_kron.py
from numpy import asarray, kron, zeros
from optimix import Function, Vector
from glimix_core._util import unvec, vec

        """
        Kronecker mean function.

        Returns
        -------
        𝐦 : ndarray
            (A⊗X)vec(B).
        """
        return self.AX @ self._vecB.value

    def gradient(self):
        """
        Gradient of the linear mean function.

        Returns
        -------
        vecB : ndarray
            Derivative of M over vec(B).
        """
        return {"vecB": self.AX}

    @property
    def B(self):
        """
        Effect-sizes parameter, B.
        """
        return unvec(self._vecB.value, (self.X.shape[1], self.A.shape[0]))

    @B.setter
    def B(self, v):

        self._vecB.value = vec(asarray(v, float))