# Path: MSMBuilder/lumping/lumper.py
# class EigenvectorLumper(Lumper):
# 
#     def __init__(self, T, num_macrostates, flux_cutoff=None):
#         """Base class for PCCA and PCCA+.
# 
#         Parameters
#         ----------
#         T : csr sparse matrix
#             Transition matrix
#         num_macrostates : int
#             Desired number of macrostates
#         flux_cutoff : float, optional
#             Can be set to discard low-flux eigenvectors.
#         """
# 
#         self.T = T
#         self.num_macrostates = num_macrostates
# 
#         self.eigenvalues, self.left_eigenvectors = msm_analysis.get_eigenvectors(T, self.num_macrostates)
#         utils.normalize_left_eigenvectors(self.left_eigenvectors)
# 
#         if flux_cutoff != None:
#             self.eigenvalues, self.left_eigenvectors = utils.trim_eigenvectors_by_flux(
#                 self.eigenvalues, self.left_eigenvectors, flux_cutoff)
#             self.num_macrostates = len(self.eigenvalues)
# 
#         self.populations = self.left_eigenvectors[:, 0]
#         self.num_microstates = len(self.populations)
# 
#         # Construct properly normalized right eigenvectors
#         self.right_eigenvectors = utils.construct_right_eigenvectors(
#             self.left_eigenvectors, self.populations, self.num_macrostates)  


import numpy as np
import logging
from .lumper import EigenvectorLumper
        3.  Pick the macrostate with the largest eigenvector spread.
        4.  Split the macrostate based on the sign of the eigenvector.

        Parameters
        ----------
        T : csr sparse matrix
            A transition matrix
        num_macrostates : int
            The desired number of states.
        tolerance : float, optional
            Specifies the numerical cutoff to use when splitting states based on sign.
        flux_cutoff : float, optional
            If enabled, discard eigenvectors with flux below this value.

        Returns
        -------
        microstate_mapping : ndarray
            mapping from the Microstate indices to the Macrostate indices

        Notes
        -------
        To construct a Macrostate MSM, you then need to map your Assignment data to
        the new states (e.g. MSMLib.apply_mapping_to_assignments).

        References
        ----------
        .. [1]  Deuflhard P, et al.  "Identification of almost invariant
        aggregates in reversible nearly uncoupled markov chains,"
        Linear Algebra Appl., vol 315 pp 39-59, 2000.
        """

# Path: MSMBuilder/lumping/lumper.py
# class EigenvectorLumper(Lumper):
# 
#     def __init__(self, T, num_macrostates, flux_cutoff=None):
#         """Base class for PCCA and PCCA+.
# 
#         Parameters
#         ----------
#         T : csr sparse matrix
#             Transition matrix
#         num_macrostates : int
#             Desired number of macrostates
#         flux_cutoff : float, optional
#             Can be set to discard low-flux eigenvectors.
#         """
# 
#         self.T = T
#         self.num_macrostates = num_macrostates
# 
#         self.eigenvalues, self.left_eigenvectors = msm_analysis.get_eigenvectors(T, self.num_macrostates)
#         utils.normalize_left_eigenvectors(self.left_eigenvectors)
# 
#         if flux_cutoff != None:
#             self.eigenvalues, self.left_eigenvectors = utils.trim_eigenvectors_by_flux(
#                 self.eigenvalues, self.left_eigenvectors, flux_cutoff)
#             self.num_macrostates = len(self.eigenvalues)
# 
#         self.populations = self.left_eigenvectors[:, 0]
#         self.num_microstates = len(self.populations)
# 
#         # Construct properly normalized right eigenvectors
#         self.right_eigenvectors = utils.construct_right_eigenvectors(
#             self.left_eigenvectors, self.populations, self.num_macrostates)  


# Path: MSMBuilder/lumping/pcca.py
import numpy as np
import logging
from .lumper import EigenvectorLumper

        3.  Pick the macrostate with the largest eigenvector spread.
        4.  Split the macrostate based on the sign of the eigenvector.

        Parameters
        ----------
        T : csr sparse matrix
            A transition matrix
        num_macrostates : int
            The desired number of states.
        tolerance : float, optional
            Specifies the numerical cutoff to use when splitting states based on sign.
        flux_cutoff : float, optional
            If enabled, discard eigenvectors with flux below this value.

        Returns
        -------
        microstate_mapping : ndarray
            mapping from the Microstate indices to the Macrostate indices

        Notes
        -------
        To construct a Macrostate MSM, you then need to map your Assignment data to
        the new states (e.g. MSMLib.apply_mapping_to_assignments).

        References
        ----------
        .. [1]  Deuflhard P, et al.  "Identification of almost invariant
        aggregates in reversible nearly uncoupled markov chains,"
        Linear Algebra Appl., vol 315 pp 39-59, 2000.
        """

        EigenvectorLumper.__init__(self, T, num_macrostates, flux_cutoff=None)