# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

from sys import version_info as _swig_python_version_info
if _swig_python_version_info >= (2, 7, 0):
    def swig_import_helper():
        import importlib
        pkg = __name__.rpartition('.')[0]
        mname = '.'.join((pkg, '_tabu_search')).lstrip('.')
        try:
            return importlib.import_module(mname)
        except ImportError:
            return importlib.import_module('_tabu_search')
    _tabu_search = swig_import_helper()
    del swig_import_helper
elif _swig_python_version_info >= (2, 6, 0):
    def swig_import_helper():
        from os.path import dirname
        import imp
        fp = None
        try:
            fp, pathname, description = imp.find_module('_tabu_search', [dirname(__file__)])
        except ImportError:
            import _tabu_search
            return _tabu_search
        try:
            _mod = imp.load_module('_tabu_search', fp, pathname, description)
        finally:
            if fp is not None:
                fp.close()
        return _mod
    _tabu_search = swig_import_helper()
    del swig_import_helper
else:
    import _tabu_search
del _swig_python_version_info

try:
    _swig_property = property
except NameError:
    pass  # Python < 2.2 doesn't have 'property'.

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
    if (name == "thisown"):
        return self.this.own(value)
    if (name == "this"):
        if type(value).__name__ == 'SwigPyObject':
            self.__dict__[name] = value
            return
    method = class_type.__swig_setmethods__.get(name, None)
    if method:
        return method(self, value)
    if (not static):
        if _newclass:
            object.__setattr__(self, name, value)
        else:
            self.__dict__[name] = value
    else:
        raise AttributeError("You cannot add attributes to %s" % self)


def _swig_setattr(self, class_type, name, value):
    return _swig_setattr_nondynamic(self, class_type, name, value, 0)


def _swig_getattr(self, class_type, name):
    if (name == "thisown"):
        return self.this.own()
    method = class_type.__swig_getmethods__.get(name, None)
    if method:
        return method(self)
    raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))


def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)

try:
    _object = object
    _newclass = 1
except __builtin__.Exception:
    class _object:
        pass
    _newclass = 0

class SwigPyIterator(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, SwigPyIterator, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, SwigPyIterator, name)

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _tabu_search.delete_SwigPyIterator
    __del__ = lambda self: None

    def value(self):
        return _tabu_search.SwigPyIterator_value(self)

    def incr(self, n=1):
        return _tabu_search.SwigPyIterator_incr(self, n)

    def decr(self, n=1):
        return _tabu_search.SwigPyIterator_decr(self, n)

    def distance(self, x):
        return _tabu_search.SwigPyIterator_distance(self, x)

    def equal(self, x):
        return _tabu_search.SwigPyIterator_equal(self, x)

    def copy(self):
        return _tabu_search.SwigPyIterator_copy(self)

    def next(self):
        return _tabu_search.SwigPyIterator_next(self)

    def __next__(self):
        return _tabu_search.SwigPyIterator___next__(self)

    def previous(self):
        return _tabu_search.SwigPyIterator_previous(self)

    def advance(self, n):
        return _tabu_search.SwigPyIterator_advance(self, n)

    def __eq__(self, x):
        return _tabu_search.SwigPyIterator___eq__(self, x)

    def __ne__(self, x):
        return _tabu_search.SwigPyIterator___ne__(self, x)

    def __iadd__(self, n):
        return _tabu_search.SwigPyIterator___iadd__(self, n)

    def __isub__(self, n):
        return _tabu_search.SwigPyIterator___isub__(self, n)

    def __add__(self, n):
        return _tabu_search.SwigPyIterator___add__(self, n)

    def __sub__(self, *args):
        return _tabu_search.SwigPyIterator___sub__(self, *args)
    def __iter__(self):
        return self
SwigPyIterator_swigregister = _tabu_search.SwigPyIterator_swigregister
SwigPyIterator_swigregister(SwigPyIterator)

class IntVector(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, IntVector, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, IntVector, name)
    __repr__ = _swig_repr

    def iterator(self):
        return _tabu_search.IntVector_iterator(self)
    def __iter__(self):
        return self.iterator()

    def __nonzero__(self):
        return _tabu_search.IntVector___nonzero__(self)

    def __bool__(self):
        return _tabu_search.IntVector___bool__(self)

    def __len__(self):
        return _tabu_search.IntVector___len__(self)

    def __getslice__(self, i, j):
        return _tabu_search.IntVector___getslice__(self, i, j)

    def __setslice__(self, *args):
        return _tabu_search.IntVector___setslice__(self, *args)

    def __delslice__(self, i, j):
        return _tabu_search.IntVector___delslice__(self, i, j)

    def __delitem__(self, *args):
        return _tabu_search.IntVector___delitem__(self, *args)

    def __getitem__(self, *args):
        return _tabu_search.IntVector___getitem__(self, *args)

    def __setitem__(self, *args):
        return _tabu_search.IntVector___setitem__(self, *args)

    def pop(self):
        return _tabu_search.IntVector_pop(self)

    def append(self, x):
        return _tabu_search.IntVector_append(self, x)

    def empty(self):
        return _tabu_search.IntVector_empty(self)

    def size(self):
        return _tabu_search.IntVector_size(self)

    def swap(self, v):
        return _tabu_search.IntVector_swap(self, v)

    def begin(self):
        return _tabu_search.IntVector_begin(self)

    def end(self):
        return _tabu_search.IntVector_end(self)

    def rbegin(self):
        return _tabu_search.IntVector_rbegin(self)

    def rend(self):
        return _tabu_search.IntVector_rend(self)

    def clear(self):
        return _tabu_search.IntVector_clear(self)

    def get_allocator(self):
        return _tabu_search.IntVector_get_allocator(self)

    def pop_back(self):
        return _tabu_search.IntVector_pop_back(self)

    def erase(self, *args):
        return _tabu_search.IntVector_erase(self, *args)

    def __init__(self, *args):
        this = _tabu_search.new_IntVector(*args)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this

    def push_back(self, x):
        return _tabu_search.IntVector_push_back(self, x)

    def front(self):
        return _tabu_search.IntVector_front(self)

    def back(self):
        return _tabu_search.IntVector_back(self)

    def assign(self, n, x):
        return _tabu_search.IntVector_assign(self, n, x)

    def resize(self, *args):
        return _tabu_search.IntVector_resize(self, *args)

    def insert(self, *args):
        return _tabu_search.IntVector_insert(self, *args)

    def reserve(self, n):
        return _tabu_search.IntVector_reserve(self, n)

    def capacity(self):
        return _tabu_search.IntVector_capacity(self)
    __swig_destroy__ = _tabu_search.delete_IntVector
    __del__ = lambda self: None
IntVector_swigregister = _tabu_search.IntVector_swigregister
IntVector_swigregister(IntVector)

class DoubleVector(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, DoubleVector, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, DoubleVector, name)
    __repr__ = _swig_repr

    def iterator(self):
        return _tabu_search.DoubleVector_iterator(self)
    def __iter__(self):
        return self.iterator()

    def __nonzero__(self):
        return _tabu_search.DoubleVector___nonzero__(self)

    def __bool__(self):
        return _tabu_search.DoubleVector___bool__(self)

    def __len__(self):
        return _tabu_search.DoubleVector___len__(self)

    def __getslice__(self, i, j):
        return _tabu_search.DoubleVector___getslice__(self, i, j)

    def __setslice__(self, *args):
        return _tabu_search.DoubleVector___setslice__(self, *args)

    def __delslice__(self, i, j):
        return _tabu_search.DoubleVector___delslice__(self, i, j)

    def __delitem__(self, *args):
        return _tabu_search.DoubleVector___delitem__(self, *args)

    def __getitem__(self, *args):
        return _tabu_search.DoubleVector___getitem__(self, *args)

    def __setitem__(self, *args):
        return _tabu_search.DoubleVector___setitem__(self, *args)

    def pop(self):
        return _tabu_search.DoubleVector_pop(self)

    def append(self, x):
        return _tabu_search.DoubleVector_append(self, x)

    def empty(self):
        return _tabu_search.DoubleVector_empty(self)

    def size(self):
        return _tabu_search.DoubleVector_size(self)

    def swap(self, v):
        return _tabu_search.DoubleVector_swap(self, v)

    def begin(self):
        return _tabu_search.DoubleVector_begin(self)

    def end(self):
        return _tabu_search.DoubleVector_end(self)

    def rbegin(self):
        return _tabu_search.DoubleVector_rbegin(self)

    def rend(self):
        return _tabu_search.DoubleVector_rend(self)

    def clear(self):
        return _tabu_search.DoubleVector_clear(self)

    def get_allocator(self):
        return _tabu_search.DoubleVector_get_allocator(self)

    def pop_back(self):
        return _tabu_search.DoubleVector_pop_back(self)

    def erase(self, *args):
        return _tabu_search.DoubleVector_erase(self, *args)

    def __init__(self, *args):
        this = _tabu_search.new_DoubleVector(*args)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this

    def push_back(self, x):
        return _tabu_search.DoubleVector_push_back(self, x)

    def front(self):
        return _tabu_search.DoubleVector_front(self)

    def back(self):
        return _tabu_search.DoubleVector_back(self)

    def assign(self, n, x):
        return _tabu_search.DoubleVector_assign(self, n, x)

    def resize(self, *args):
        return _tabu_search.DoubleVector_resize(self, *args)

    def insert(self, *args):
        return _tabu_search.DoubleVector_insert(self, *args)

    def reserve(self, n):
        return _tabu_search.DoubleVector_reserve(self, n)

    def capacity(self):
        return _tabu_search.DoubleVector_capacity(self)
    __swig_destroy__ = _tabu_search.delete_DoubleVector
    __del__ = lambda self: None
DoubleVector_swigregister = _tabu_search.DoubleVector_swigregister
DoubleVector_swigregister(DoubleVector)

class IntArray(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, IntArray, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, IntArray, name)
    __repr__ = _swig_repr

    def iterator(self):
        return _tabu_search.IntArray_iterator(self)
    def __iter__(self):
        return self.iterator()

    def __nonzero__(self):
        return _tabu_search.IntArray___nonzero__(self)

    def __bool__(self):
        return _tabu_search.IntArray___bool__(self)

    def __len__(self):
        return _tabu_search.IntArray___len__(self)

    def __getslice__(self, i, j):
        return _tabu_search.IntArray___getslice__(self, i, j)

    def __setslice__(self, *args):
        return _tabu_search.IntArray___setslice__(self, *args)

    def __delslice__(self, i, j):
        return _tabu_search.IntArray___delslice__(self, i, j)

    def __delitem__(self, *args):
        return _tabu_search.IntArray___delitem__(self, *args)

    def __getitem__(self, *args):
        return _tabu_search.IntArray___getitem__(self, *args)

    def __setitem__(self, *args):
        return _tabu_search.IntArray___setitem__(self, *args)

    def pop(self):
        return _tabu_search.IntArray_pop(self)

    def append(self, x):
        return _tabu_search.IntArray_append(self, x)

    def empty(self):
        return _tabu_search.IntArray_empty(self)

    def size(self):
        return _tabu_search.IntArray_size(self)

    def swap(self, v):
        return _tabu_search.IntArray_swap(self, v)

    def begin(self):
        return _tabu_search.IntArray_begin(self)

    def end(self):
        return _tabu_search.IntArray_end(self)

    def rbegin(self):
        return _tabu_search.IntArray_rbegin(self)

    def rend(self):
        return _tabu_search.IntArray_rend(self)

    def clear(self):
        return _tabu_search.IntArray_clear(self)

    def get_allocator(self):
        return _tabu_search.IntArray_get_allocator(self)

    def pop_back(self):
        return _tabu_search.IntArray_pop_back(self)

    def erase(self, *args):
        return _tabu_search.IntArray_erase(self, *args)

    def __init__(self, *args):
        this = _tabu_search.new_IntArray(*args)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this

    def push_back(self, x):
        return _tabu_search.IntArray_push_back(self, x)

    def front(self):
        return _tabu_search.IntArray_front(self)

    def back(self):
        return _tabu_search.IntArray_back(self)

    def assign(self, n, x):
        return _tabu_search.IntArray_assign(self, n, x)

    def resize(self, *args):
        return _tabu_search.IntArray_resize(self, *args)

    def insert(self, *args):
        return _tabu_search.IntArray_insert(self, *args)

    def reserve(self, n):
        return _tabu_search.IntArray_reserve(self, n)

    def capacity(self):
        return _tabu_search.IntArray_capacity(self)
    __swig_destroy__ = _tabu_search.delete_IntArray
    __del__ = lambda self: None
IntArray_swigregister = _tabu_search.IntArray_swigregister
IntArray_swigregister(IntArray)

class DoubleArray(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, DoubleArray, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, DoubleArray, name)
    __repr__ = _swig_repr

    def iterator(self):
        return _tabu_search.DoubleArray_iterator(self)
    def __iter__(self):
        return self.iterator()

    def __nonzero__(self):
        return _tabu_search.DoubleArray___nonzero__(self)

    def __bool__(self):
        return _tabu_search.DoubleArray___bool__(self)

    def __len__(self):
        return _tabu_search.DoubleArray___len__(self)

    def __getslice__(self, i, j):
        return _tabu_search.DoubleArray___getslice__(self, i, j)

    def __setslice__(self, *args):
        return _tabu_search.DoubleArray___setslice__(self, *args)

    def __delslice__(self, i, j):
        return _tabu_search.DoubleArray___delslice__(self, i, j)

    def __delitem__(self, *args):
        return _tabu_search.DoubleArray___delitem__(self, *args)

    def __getitem__(self, *args):
        return _tabu_search.DoubleArray___getitem__(self, *args)

    def __setitem__(self, *args):
        return _tabu_search.DoubleArray___setitem__(self, *args)

    def pop(self):
        return _tabu_search.DoubleArray_pop(self)

    def append(self, x):
        return _tabu_search.DoubleArray_append(self, x)

    def empty(self):
        return _tabu_search.DoubleArray_empty(self)

    def size(self):
        return _tabu_search.DoubleArray_size(self)

    def swap(self, v):
        return _tabu_search.DoubleArray_swap(self, v)

    def begin(self):
        return _tabu_search.DoubleArray_begin(self)

    def end(self):
        return _tabu_search.DoubleArray_end(self)

    def rbegin(self):
        return _tabu_search.DoubleArray_rbegin(self)

    def rend(self):
        return _tabu_search.DoubleArray_rend(self)

    def clear(self):
        return _tabu_search.DoubleArray_clear(self)

    def get_allocator(self):
        return _tabu_search.DoubleArray_get_allocator(self)

    def pop_back(self):
        return _tabu_search.DoubleArray_pop_back(self)

    def erase(self, *args):
        return _tabu_search.DoubleArray_erase(self, *args)

    def __init__(self, *args):
        this = _tabu_search.new_DoubleArray(*args)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this

    def push_back(self, x):
        return _tabu_search.DoubleArray_push_back(self, x)

    def front(self):
        return _tabu_search.DoubleArray_front(self)

    def back(self):
        return _tabu_search.DoubleArray_back(self)

    def assign(self, n, x):
        return _tabu_search.DoubleArray_assign(self, n, x)

    def resize(self, *args):
        return _tabu_search.DoubleArray_resize(self, *args)

    def insert(self, *args):
        return _tabu_search.DoubleArray_insert(self, *args)

    def reserve(self, n):
        return _tabu_search.DoubleArray_reserve(self, n)

    def capacity(self):
        return _tabu_search.DoubleArray_capacity(self)
    __swig_destroy__ = _tabu_search.delete_DoubleArray
    __del__ = lambda self: None
DoubleArray_swigregister = _tabu_search.DoubleArray_swigregister
DoubleArray_swigregister(DoubleArray)

class TabuSearch(_object):
    """
    Tabu Search

    handler = TabuSearch(q, init_solution, tenure, scaleFactor, timeout)

        Args:
            q: QUBO as a list of list, or numpy matrix of double (float64) values.
               q must be symmetric.
            init_solution: List of 0/1 values, which defines the initial state of each variable.
            tenure: Tabu tenure. min(20, num_vars / 4) seems to be a good choice.
            scaleFactor: Scaling factor for elements of q. The elements of q are stored as long ints using
                         internal_q = long int (q * scaleFactor).
            timeout: Total running time in milliseconds.

    energy = handler.bestEnergy()

    solution = handler.bestSolution()
    """

    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, TabuSearch, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, TabuSearch, name)
    __repr__ = _swig_repr

    def __init__(self, Q, initSol, tenure, scaleFactor, timeout):
        """
        Tabu Search

        handler = TabuSearch(q, init_solution, tenure, scaleFactor, timeout)

            Args:
                q: QUBO as a list of list, or numpy matrix of double (float64) values.
                   q must be symmetric.
                init_solution: List of 0/1 values, which defines the initial state of each variable.
                tenure: Tabu tenure. min(20, num_vars / 4) seems to be a good choice.
                scaleFactor: Scaling factor for elements of q. The elements of q are stored as long ints using
                             internal_q = long int (q * scaleFactor).
                timeout: Total running time in milliseconds.

        energy = handler.bestEnergy()

        solution = handler.bestSolution()
        """
        this = _tabu_search.new_TabuSearch(Q, initSol, tenure, scaleFactor, timeout)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this

    def bestEnergy(self):
        return _tabu_search.TabuSearch_bestEnergy(self)

    def bestSolution(self):
        return _tabu_search.TabuSearch_bestSolution(self)
    __swig_destroy__ = _tabu_search.delete_TabuSearch
    __del__ = lambda self: None
TabuSearch_swigregister = _tabu_search.TabuSearch_swigregister
TabuSearch_swigregister(TabuSearch)

class Exception(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, Exception, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, Exception, name)
    __repr__ = _swig_repr

    def __init__(self, error):
        this = _tabu_search.new_Exception(error)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _tabu_search.delete_Exception
    __del__ = lambda self: None

    def what(self):
        return _tabu_search.Exception_what(self)
Exception_swigregister = _tabu_search.Exception_swigregister
Exception_swigregister(Exception)

# This file is compatible with both classic and new-style classes.


