# 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, '_core')).lstrip('.')
        try:
            return importlib.import_module(mname)
        except ImportError:
            return importlib.import_module('_core')
    _core = 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('_core', [dirname(__file__)])
        except ImportError:
            import _core
            return _core
        try:
            _mod = imp.load_module('_core', fp, pathname, description)
        finally:
            if fp is not None:
                fp.close()
        return _mod
    _core = swig_import_helper()
    del swig_import_helper
else:
    import _core
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__ = _core.delete_SwigPyIterator
    __del__ = lambda self: None

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    def iterator(self):
        return _core.EdgeVector_iterator(self)
    def __iter__(self):
        return self.iterator()

    def __nonzero__(self):
        return _core.EdgeVector___nonzero__(self)

    def __bool__(self):
        return _core.EdgeVector___bool__(self)

    def __len__(self):
        return _core.EdgeVector___len__(self)

    def __getslice__(self, i, j):
        return _core.EdgeVector___getslice__(self, i, j)

    def __setslice__(self, *args):
        return _core.EdgeVector___setslice__(self, *args)

    def __delslice__(self, i, j):
        return _core.EdgeVector___delslice__(self, i, j)

    def __delitem__(self, *args):
        return _core.EdgeVector___delitem__(self, *args)

    def __getitem__(self, *args):
        return _core.EdgeVector___getitem__(self, *args)

    def __setitem__(self, *args):
        return _core.EdgeVector___setitem__(self, *args)

    def pop(self):
        return _core.EdgeVector_pop(self)

    def append(self, x):
        return _core.EdgeVector_append(self, x)

    def empty(self):
        return _core.EdgeVector_empty(self)

    def size(self):
        return _core.EdgeVector_size(self)

    def swap(self, v):
        return _core.EdgeVector_swap(self, v)

    def begin(self):
        return _core.EdgeVector_begin(self)

    def end(self):
        return _core.EdgeVector_end(self)

    def rbegin(self):
        return _core.EdgeVector_rbegin(self)

    def rend(self):
        return _core.EdgeVector_rend(self)

    def clear(self):
        return _core.EdgeVector_clear(self)

    def get_allocator(self):
        return _core.EdgeVector_get_allocator(self)

    def pop_back(self):
        return _core.EdgeVector_pop_back(self)

    def erase(self, *args):
        return _core.EdgeVector_erase(self, *args)

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

    def push_back(self, x):
        return _core.EdgeVector_push_back(self, x)

    def front(self):
        return _core.EdgeVector_front(self)

    def back(self):
        return _core.EdgeVector_back(self)

    def assign(self, n, x):
        return _core.EdgeVector_assign(self, n, x)

    def resize(self, *args):
        return _core.EdgeVector_resize(self, *args)

    def insert(self, *args):
        return _core.EdgeVector_insert(self, *args)

    def reserve(self, n):
        return _core.EdgeVector_reserve(self, n)

    def capacity(self):
        return _core.EdgeVector_capacity(self)
    __swig_destroy__ = _core.delete_EdgeVector
    __del__ = lambda self: None
EdgeVector_swigregister = _core.EdgeVector_swigregister
EdgeVector_swigregister(EdgeVector)

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 _core.IntVector_iterator(self)
    def __iter__(self):
        return self.iterator()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    def __init__(self, *args):
        this = _core.new_IntIntPair(*args)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_setmethods__["first"] = _core.IntIntPair_first_set
    __swig_getmethods__["first"] = _core.IntIntPair_first_get
    if _newclass:
        first = _swig_property(_core.IntIntPair_first_get, _core.IntIntPair_first_set)
    __swig_setmethods__["second"] = _core.IntIntPair_second_set
    __swig_getmethods__["second"] = _core.IntIntPair_second_get
    if _newclass:
        second = _swig_property(_core.IntIntPair_second_get, _core.IntIntPair_second_set)
    def __len__(self):
        return 2
    def __repr__(self):
        return str((self.first, self.second))
    def __getitem__(self, index): 
        if not (index % 2):
            return self.first
        else:
            return self.second
    def __setitem__(self, index, val):
        if not (index % 2):
            self.first = val
        else:
            self.second = val
    __swig_destroy__ = _core.delete_IntIntPair
    __del__ = lambda self: None
IntIntPair_swigregister = _core.IntIntPair_swigregister
IntIntPair_swigregister(IntIntPair)

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

    def __init__(self, *args):
        this = _core.new_LongLongPair(*args)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_setmethods__["first"] = _core.LongLongPair_first_set
    __swig_getmethods__["first"] = _core.LongLongPair_first_get
    if _newclass:
        first = _swig_property(_core.LongLongPair_first_get, _core.LongLongPair_first_set)
    __swig_setmethods__["second"] = _core.LongLongPair_second_set
    __swig_getmethods__["second"] = _core.LongLongPair_second_get
    if _newclass:
        second = _swig_property(_core.LongLongPair_second_get, _core.LongLongPair_second_set)
    def __len__(self):
        return 2
    def __repr__(self):
        return str((self.first, self.second))
    def __getitem__(self, index): 
        if not (index % 2):
            return self.first
        else:
            return self.second
    def __setitem__(self, index, val):
        if not (index % 2):
            self.first = val
        else:
            self.second = val
    __swig_destroy__ = _core.delete_LongLongPair
    __del__ = lambda self: None
LongLongPair_swigregister = _core.LongLongPair_swigregister
LongLongPair_swigregister(LongLongPair)

class Edge(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, Edge, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, Edge, name)
    __repr__ = _swig_repr
    __swig_setmethods__["next"] = _core.Edge_next_set
    __swig_getmethods__["next"] = _core.Edge_next_get
    if _newclass:
        next = _swig_property(_core.Edge_next_get, _core.Edge_next_set)
    __swig_setmethods__["u"] = _core.Edge_u_set
    __swig_getmethods__["u"] = _core.Edge_u_get
    if _newclass:
        u = _swig_property(_core.Edge_u_get, _core.Edge_u_set)
    __swig_setmethods__["v"] = _core.Edge_v_set
    __swig_getmethods__["v"] = _core.Edge_v_get
    if _newclass:
        v = _swig_property(_core.Edge_v_get, _core.Edge_v_set)
    __swig_setmethods__["flow"] = _core.Edge_flow_set
    __swig_getmethods__["flow"] = _core.Edge_flow_get
    if _newclass:
        flow = _swig_property(_core.Edge_flow_get, _core.Edge_flow_set)
    __swig_setmethods__["cost"] = _core.Edge_cost_set
    __swig_getmethods__["cost"] = _core.Edge_cost_get
    if _newclass:
        cost = _swig_property(_core.Edge_cost_get, _core.Edge_cost_set)

    def __init__(self, *args):
        this = _core.new_Edge(*args)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _core.delete_Edge
    __del__ = lambda self: None
Edge_swigregister = _core.Edge_swigregister
Edge_swigregister(Edge)
cvar = _core.cvar

class Graph(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, Graph, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, Graph, name)
    __repr__ = _swig_repr
    __swig_setmethods__["cnt"] = _core.Graph_cnt_set
    __swig_getmethods__["cnt"] = _core.Graph_cnt_get
    if _newclass:
        cnt = _swig_property(_core.Graph_cnt_get, _core.Graph_cnt_set)
    __swig_setmethods__["head"] = _core.Graph_head_set
    __swig_getmethods__["head"] = _core.Graph_head_get
    if _newclass:
        head = _swig_property(_core.Graph_head_get, _core.Graph_head_set)
    __swig_setmethods__["edges"] = _core.Graph_edges_set
    __swig_getmethods__["edges"] = _core.Graph_edges_get
    if _newclass:
        edges = _swig_property(_core.Graph_edges_get, _core.Graph_edges_set)

    def __init__(self, n):
        this = _core.new_Graph(n)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _core.delete_Graph
    __del__ = lambda self: None

    def add_edge(self, u, v, flow, cost=0):
        return _core.Graph_add_edge(self, u, v, flow, cost)
Graph_swigregister = _core.Graph_swigregister
Graph_swigregister(Graph)

class BaseNetwork(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, BaseNetwork, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, BaseNetwork, name)
    __repr__ = _swig_repr
    __swig_setmethods__["n"] = _core.BaseNetwork_n_set
    __swig_getmethods__["n"] = _core.BaseNetwork_n_get
    if _newclass:
        n = _swig_property(_core.BaseNetwork_n_get, _core.BaseNetwork_n_set)
    __swig_setmethods__["dist"] = _core.BaseNetwork_dist_set
    __swig_getmethods__["dist"] = _core.BaseNetwork_dist_get
    if _newclass:
        dist = _swig_property(_core.BaseNetwork_dist_get, _core.BaseNetwork_dist_set)
    __swig_setmethods__["graph"] = _core.BaseNetwork_graph_set
    __swig_getmethods__["graph"] = _core.BaseNetwork_graph_get
    if _newclass:
        graph = _swig_property(_core.BaseNetwork_graph_get, _core.BaseNetwork_graph_set)

    def __init__(self, n):
        this = _core.new_BaseNetwork(n)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _core.delete_BaseNetwork
    __del__ = lambda self: None
BaseNetwork_swigregister = _core.BaseNetwork_swigregister
BaseNetwork_swigregister(BaseNetwork)

class MaximumFlow(BaseNetwork):
    __swig_setmethods__ = {}
    for _s in [BaseNetwork]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, MaximumFlow, name, value)
    __swig_getmethods__ = {}
    for _s in [BaseNetwork]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, MaximumFlow, name)
    __repr__ = _swig_repr
    __swig_setmethods__["cur"] = _core.MaximumFlow_cur_set
    __swig_getmethods__["cur"] = _core.MaximumFlow_cur_get
    if _newclass:
        cur = _swig_property(_core.MaximumFlow_cur_get, _core.MaximumFlow_cur_set)

    def __init__(self, n):
        this = _core.new_MaximumFlow(n)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _core.delete_MaximumFlow
    __del__ = lambda self: None

    def bfs(self, S, T):
        return _core.MaximumFlow_bfs(self, S, T)

    def dfs(self, *args):
        return _core.MaximumFlow_dfs(self, *args)

    def run(self, S, T):
        return _core.MaximumFlow_run(self, S, T)
MaximumFlow_swigregister = _core.MaximumFlow_swigregister
MaximumFlow_swigregister(MaximumFlow)

class MinimumCostFlow(BaseNetwork):
    __swig_setmethods__ = {}
    for _s in [BaseNetwork]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, MinimumCostFlow, name, value)
    __swig_getmethods__ = {}
    for _s in [BaseNetwork]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, MinimumCostFlow, name)
    __repr__ = _swig_repr
    __swig_setmethods__["pre"] = _core.MinimumCostFlow_pre_set
    __swig_getmethods__["pre"] = _core.MinimumCostFlow_pre_get
    if _newclass:
        pre = _swig_property(_core.MinimumCostFlow_pre_get, _core.MinimumCostFlow_pre_set)
    __swig_setmethods__["low"] = _core.MinimumCostFlow_low_set
    __swig_getmethods__["low"] = _core.MinimumCostFlow_low_get
    if _newclass:
        low = _swig_property(_core.MinimumCostFlow_low_get, _core.MinimumCostFlow_low_set)
    __swig_setmethods__["vis"] = _core.MinimumCostFlow_vis_set
    __swig_getmethods__["vis"] = _core.MinimumCostFlow_vis_get
    if _newclass:
        vis = _swig_property(_core.MinimumCostFlow_vis_get, _core.MinimumCostFlow_vis_set)
    __swig_setmethods__["clk"] = _core.MinimumCostFlow_clk_set
    __swig_getmethods__["clk"] = _core.MinimumCostFlow_clk_get
    if _newclass:
        clk = _swig_property(_core.MinimumCostFlow_clk_get, _core.MinimumCostFlow_clk_set)

    def __init__(self, n):
        this = _core.new_MinimumCostFlow(n)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _core.delete_MinimumCostFlow
    __del__ = lambda self: None

    def bfs(self, S, T):
        return _core.MinimumCostFlow_bfs(self, S, T)

    def run(self, S, T):
        return _core.MinimumCostFlow_run(self, S, T)
MinimumCostFlow_swigregister = _core.MinimumCostFlow_swigregister
MinimumCostFlow_swigregister(MinimumCostFlow)

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


