"""
Isotropic Gaussian mixture model with difference variance for each component.
"""


import numpy as np
cimport numpy as np
cimport cython
import csv

from libc.math cimport exp, log, sqrt
from libc.math cimport M_PI


from cryoem.model.distribution cimport RealDistribution


cdef class IsoDiagonalMixture(RealDistribution):
    """Isotropic Gaussian mixture model, non-constant covariance."""

    def __cinit__(self, means, variances, weights):
        """Initialise mixture.

        Args:
            means: (K, D) array with means for all K components.
            variances: (K, ) array with variance for each component.
            weights: (K, ) array, summing to 1.0.
        """

        self._means = means
        self._variances = variances
        self._weights = weights

        self._num_components = len(means)

    @property
    def means(self):
        return self._means

    @property
    def variances(self):
        return self._variances

    @property
    def weights(self):
        return self._weights

    @property
    def dimension(self):
        return self._means.shape[1]

    @property
    def num_components(self):
        return self._means.shape[0]


cdef class IsoDiagonalMixture3D(IsoDiagonalMixture):
    """3D isotropic mixture model with non-constant variances."""

    pass


