# Path: cmepy/domain.py
# def from_rect(shape, slices=None, origin=None):
# def from_iter(state_iter):
# def from_mapping(state_mapping):
# def to_iter(state_array):
# 
# Path: cmepy/lexarrayset.py
# def unique(las, return_inverse=False):
# def nonunique_member(arr1, las2):
# def member(las1, las2):
# def split(las1, las2):
# def difference(las1, las2):
# def intersection(las1, las2):
# def union(las1, las2):
# def shift(las, offset):
# def empty(dim):
# def create(data, unique_data=False):
#     def __init__(self, data, unique_data=False):
#     def size(self):
#     def member(self, rhs):
#     def split(self, rhs):
#     def difference(self, rhs):
#     def intersection(self, rhs):
#     def union(self, rhs):
#     def shift(self, offset):
#     def difference_update(self, rhs):
#     def intersection_update(self, rhs):
#     def union_update(self, rhs):
#     def shift_update(self, shift):
# class LexArraySet(object):
# 
# Path: cmepy/statistics.py
# @property
# def statistics(self):
#     return {
#         'expectation' : self.expectation,
#         'expected_value' : self.expectation,
#         'variance' : self.variance,
#         'covariance' : self.covariance,
#         'standard_deviation' : self.standard_deviation
#     }


import itertools
import numpy
from cmepy import domain, lexarrayset, statistics
            self.ordered_states = self.unordered_states[:, order]
        else:
            self.ordered_states = self.unordered_states
    
    def extend(self, sigma):
        """
        Adds the states in the array 'sigma' to the state enumeration.
        
        These states must be disjoint to the existing states in this
        enumeration.
        
        The indexing of existing states in this enumeration will be
        unchanged.
        """
        
        sigma_unique = lexarrayset.unique(numpy.asarray(sigma))
        
        self.unordered_states = numpy.hstack((self.unordered_states,
                                              sigma_unique))
        index = numpy.arange(self.size, self.size+sigma_unique.shape[1])
        self.index = numpy.concatenate((self.index, index))
        self.update_ordering()
    
    def reinitialise(self, initial_states):
        """
        reinitialise the StateEnumeration with the given 'initial_states'
        """
        
        initial_states = numpy.asarray(initial_states)
        

# Path: cmepy/domain.py
# def from_rect(shape, slices=None, origin=None):
# def from_iter(state_iter):
# def from_mapping(state_mapping):
# def to_iter(state_array):
# 
# Path: cmepy/lexarrayset.py
# def unique(las, return_inverse=False):
# def nonunique_member(arr1, las2):
# def member(las1, las2):
# def split(las1, las2):
# def difference(las1, las2):
# def intersection(las1, las2):
# def union(las1, las2):
# def shift(las, offset):
# def empty(dim):
# def create(data, unique_data=False):
#     def __init__(self, data, unique_data=False):
#     def size(self):
#     def member(self, rhs):
#     def split(self, rhs):
#     def difference(self, rhs):
#     def intersection(self, rhs):
#     def union(self, rhs):
#     def shift(self, offset):
#     def difference_update(self, rhs):
#     def intersection_update(self, rhs):
#     def union_update(self, rhs):
#     def shift_update(self, shift):
# class LexArraySet(object):
# 
# Path: cmepy/statistics.py
# @property
# def statistics(self):
#     return {
#         'expectation' : self.expectation,
#         'expected_value' : self.expectation,
#         'variance' : self.variance,
#         'covariance' : self.covariance,
#         'standard_deviation' : self.standard_deviation
#     }


# Path: cmepy/state_enum.py
import itertools
import numpy
from cmepy import domain, lexarrayset, statistics

            self.ordered_states = self.unordered_states[:, order]
        else:
            self.ordered_states = self.unordered_states
    
    def extend(self, sigma):
        """
        Adds the states in the array 'sigma' to the state enumeration.
        
        These states must be disjoint to the existing states in this
        enumeration.
        
        The indexing of existing states in this enumeration will be
        unchanged.
        """
        
        sigma_unique = lexarrayset.unique(numpy.asarray(sigma))
        
        self.unordered_states = numpy.hstack((self.unordered_states,
                                              sigma_unique))
        index = numpy.arange(self.size, self.size+sigma_unique.shape[1])
        self.index = numpy.concatenate((self.index, index))
        self.update_ordering()
    
    def reinitialise(self, initial_states):
        """
        reinitialise the StateEnumeration with the given 'initial_states'
        """
        
        initial_states = numpy.asarray(initial_states)
        

        self.unordered_states = lexarrayset.unique(initial_states)