# WARNING: This file is automatically generated. 
# Update pyx_src/static.pyx and pyx_src/dynamic to change.

# Static:

# distutils: language=c++
# cython: language_level=3
from libcpp.string cimport string
from libcpp cimport bool
from libcpp.vector cimport vector
from libcpp.unordered_map cimport unordered_map
from libcpp.utility cimport pair
from libcpp.unordered_set cimport unordered_set

ctypedef unsigned short int ushort
ctypedef unsigned long int ulong
ctypedef unsigned int uint

cdef extern from "include/networkUtility.h":
    cdef cppclass NetworkUtility "NetworkUtility<unsigned long int>":
        NetworkUtility(vector[pair[ulong, ulong]], vector[ulong]) except +
        unordered_set[ulong] getConnectedNetworkNodes() except +


cdef extern from "include/tmxParser.h":
    cdef cppclass tmxTypeReader:
        tmxTypeReader(string) except +
        ushort readUshort() except +


cdef class pyNetworkUtility:
    cdef NetworkUtility *thisptr

    def __cinit__(self, edges, nodes):
        self.thisptr = new NetworkUtility(edges, nodes)

    def __dealloc__(self):
        del self.thisptr

    def getConnectedNetworkNodes(self):
        return self.thisptr.getConnectedNetworkNodes()

cdef class pyTMXTypeReader:
    cdef tmxTypeReader *thisptr
    cdef int tmxVersion
    cdef int rowTypeEnum
    cdef int colTypeEnum
    cdef int valueTypeEnum

    def __cinit__(self, filename):
        self.thisptr = new tmxTypeReader(filename)
        self.tmxVersion = self.thisptr.readUshort()
        self.rowTypeEnum = self.thisptr.readUshort()
        self.colTypeEnum = self.thisptr.readUshort()
        self.valueTypeEnum = self.thisptr.readUshort()

    def __dealloc__(self):
        del self.thisptr

    def get_tmx_version(self):
        return self.tmxVersion

    def get_row_type_enum(self):
        return self.rowTypeEnum

    def get_col_type_enum(self):
        return self.colTypeEnum

    def get_value_type_enum(self):
        return self.valueTypeEnum


# Dynamic Templates: 



cdef extern from "include/transitMatrix.h":
    cdef cppclass transitMatrixIxIxUS "transitMatrix<unsigned long int, unsigned long int,unsigned short int>":


        transitMatrixIxIxUS(bool, bool, unsigned int, unsigned int) except +
        transitMatrixIxIxUS() except +

        void prepareGraphWithVertices(int V) except +
        void addToUserSourceDataContainer(unsigned int, ulong, ushort) except +
        void addToUserDestDataContainer(unsigned int, ulong, ushort) except +
        void addEdgesToGraph(vector[ulong], vector[ulong], vector[ushort], vector[bool]) except +
        void addToCategoryMap(ulong, string) except +
        void setMockDataFrame(vector[vector[ushort]], vector[ulong], vector[ulong]) except +

        void compute(int) except +
        vector[pair[ulong, ushort]] getValuesByDest(ulong, bool) except +
        vector[pair[ulong, ushort]] getValuesBySource(ulong, bool) except +
        unordered_map[ulong, vector[ulong]] getDestsInRange(ushort) except +
        unordered_map[ulong, vector[ulong]] getSourcesInRange(ushort) except +
        ushort timeToNearestDestPerCategory(ulong, string) except +
        ushort countDestsInRangePerCategory(ulong, string, ushort) except +
        ushort timeToNearestDest(ulong) except +
        ushort countDestsInRange(ulong, ushort) except +

        vector[ulong] getColIds() except +
        vector[ulong] getRowIds() except +

        void writeCSV(string) except +
        void writeTMX(string) except +
        void readTMX(string) except +
        void readCSV(string) except +
        void readOTPCSV(string) except +
        void printDataFrame() except +

cdef class  pyTransitMatrixIxIxUS:
    cdef transitMatrixIxIxUS *thisptr

    def __cinit__(self, bool isCompressible=False, bool isSymmetric=False, unsigned int rows=0, unsigned int columns=0):
        if rows == 0 and columns == 0:
            self.thisptr = new transitMatrixIxIxUS()
        else:
            self.thisptr = new transitMatrixIxIxUS(isCompressible, isSymmetric, rows, columns)

    def __dealloc__(self):
        del self.thisptr

    def prepareGraphWithVertices(self, vertices):
        self.thisptr.prepareGraphWithVertices(vertices)


    def addToUserSourceDataContainer(self, networkNodeId, id_, lastMileDistance):
        self.thisptr.addToUserSourceDataContainer(networkNodeId, id_, lastMileDistance)

    def addToUserDestDataContainer(self, networkNodeId, id_, lastMileDistance):
        self.thisptr.addToUserDestDataContainer(networkNodeId, id_, lastMileDistance)

    def addEdgesToGraph(self, from_column, to_column, edge_weight_column, is_bidirectional_column):
        self.thisptr.addEdgesToGraph(from_column, to_column, edge_weight_column, is_bidirectional_column)

    def setMockDataFrame(self, dataset, row_ids, col_ids):
        self.thisptr.setMockDataFrame(dataset, row_ids, col_ids)

    def compute(self, numThreads):
        self.thisptr.compute(numThreads)

    def writeCSV(self, outfile):
        self.thisptr.writeCSV(outfile)

    def writeTMX(self, outfile):
        self.thisptr.writeTMX(outfile)

    def readTMX(self, infile):
        self.thisptr.readTMX(infile)

    def readCSV(self, infile):
        self.thisptr.readCSV(infile)

    def readOTPCSV(self, infile):
        self.thisptr.readOTPCSV(infile)

    def printDataFrame(self):
        self.thisptr.printDataFrame()

    def getValuesBySource(self, source_id, sort):
        return self.thisptr.getValuesBySource(source_id, sort)

    def getValuesByDest(self, dest_id, sort):
        return self.thisptr.getValuesByDest(dest_id, sort)

    def addToCategoryMap(self, dest_id, category):
        self.thisptr.addToCategoryMap(dest_id, category)

    def timeToNearestDestPerCategory(self, source_id, category):
        return self.thisptr.timeToNearestDestPerCategory(source_id, category)

    def countDestsInRangePerCategory(self, source_id, category, range):
        return self.thisptr.countDestsInRangePerCategory(source_id, category, range)

    def timeToNearestDest(self, source_id):
        return self.thisptr.timeToNearestDest(source_id)

    def countDestsInRange(self, source_id, range):
        return self.thisptr.countDestsInRange(source_id, range)

    def getColIds(self):
        return self.thisptr.getColIds()

    def getRowIds(self):
        return self.thisptr.getRowIds()

    def getSourcesInRange(self, range_):
        return self.thisptr.getSourcesInRange(range_)

    def getDestsInRange(self, range_):
        return self.thisptr.getDestsInRange(range_)

cdef extern from "include/transitMatrix.h":
    cdef cppclass transitMatrixIxIxUI "transitMatrix<unsigned long int, unsigned long int,unsigned int>":


        transitMatrixIxIxUI(bool, bool, unsigned int, unsigned int) except +
        transitMatrixIxIxUI() except +

        void prepareGraphWithVertices(int V) except +
        void addToUserSourceDataContainer(unsigned int, ulong, uint) except +
        void addToUserDestDataContainer(unsigned int, ulong, uint) except +
        void addEdgesToGraph(vector[ulong], vector[ulong], vector[uint], vector[bool]) except +
        void addToCategoryMap(ulong, string) except +
        void setMockDataFrame(vector[vector[uint]], vector[ulong], vector[ulong]) except +

        void compute(int) except +
        vector[pair[ulong, uint]] getValuesByDest(ulong, bool) except +
        vector[pair[ulong, uint]] getValuesBySource(ulong, bool) except +
        unordered_map[ulong, vector[ulong]] getDestsInRange(uint) except +
        unordered_map[ulong, vector[ulong]] getSourcesInRange(uint) except +
        uint timeToNearestDestPerCategory(ulong, string) except +
        uint countDestsInRangePerCategory(ulong, string, uint) except +
        uint timeToNearestDest(ulong) except +
        uint countDestsInRange(ulong, uint) except +

        vector[ulong] getColIds() except +
        vector[ulong] getRowIds() except +

        void writeCSV(string) except +
        void writeTMX(string) except +
        void readTMX(string) except +
        void readCSV(string) except +
        void readOTPCSV(string) except +
        void printDataFrame() except +

cdef class  pyTransitMatrixIxIxUI:
    cdef transitMatrixIxIxUI *thisptr

    def __cinit__(self, bool isCompressible=False, bool isSymmetric=False, unsigned int rows=0, unsigned int columns=0):
        if rows == 0 and columns == 0:
            self.thisptr = new transitMatrixIxIxUI()
        else:
            self.thisptr = new transitMatrixIxIxUI(isCompressible, isSymmetric, rows, columns)

    def __dealloc__(self):
        del self.thisptr

    def prepareGraphWithVertices(self, vertices):
        self.thisptr.prepareGraphWithVertices(vertices)


    def addToUserSourceDataContainer(self, networkNodeId, id_, lastMileDistance):
        self.thisptr.addToUserSourceDataContainer(networkNodeId, id_, lastMileDistance)

    def addToUserDestDataContainer(self, networkNodeId, id_, lastMileDistance):
        self.thisptr.addToUserDestDataContainer(networkNodeId, id_, lastMileDistance)

    def addEdgesToGraph(self, from_column, to_column, edge_weight_column, is_bidirectional_column):
        self.thisptr.addEdgesToGraph(from_column, to_column, edge_weight_column, is_bidirectional_column)

    def setMockDataFrame(self, dataset, row_ids, col_ids):
        self.thisptr.setMockDataFrame(dataset, row_ids, col_ids)

    def compute(self, numThreads):
        self.thisptr.compute(numThreads)

    def writeCSV(self, outfile):
        self.thisptr.writeCSV(outfile)

    def writeTMX(self, outfile):
        self.thisptr.writeTMX(outfile)

    def readTMX(self, infile):
        self.thisptr.readTMX(infile)

    def readCSV(self, infile):
        self.thisptr.readCSV(infile)

    def readOTPCSV(self, infile):
        self.thisptr.readOTPCSV(infile)

    def printDataFrame(self):
        self.thisptr.printDataFrame()

    def getValuesBySource(self, source_id, sort):
        return self.thisptr.getValuesBySource(source_id, sort)

    def getValuesByDest(self, dest_id, sort):
        return self.thisptr.getValuesByDest(dest_id, sort)

    def addToCategoryMap(self, dest_id, category):
        self.thisptr.addToCategoryMap(dest_id, category)

    def timeToNearestDestPerCategory(self, source_id, category):
        return self.thisptr.timeToNearestDestPerCategory(source_id, category)

    def countDestsInRangePerCategory(self, source_id, category, range):
        return self.thisptr.countDestsInRangePerCategory(source_id, category, range)

    def timeToNearestDest(self, source_id):
        return self.thisptr.timeToNearestDest(source_id)

    def countDestsInRange(self, source_id, range):
        return self.thisptr.countDestsInRange(source_id, range)

    def getColIds(self):
        return self.thisptr.getColIds()

    def getRowIds(self):
        return self.thisptr.getRowIds()

    def getSourcesInRange(self, range_):
        return self.thisptr.getSourcesInRange(range_)

    def getDestsInRange(self, range_):
        return self.thisptr.getDestsInRange(range_)

cdef extern from "include/transitMatrix.h":
    cdef cppclass transitMatrixIxSxUS "transitMatrix<unsigned long int, string,unsigned short int>":


        transitMatrixIxSxUS(bool, bool, unsigned int, unsigned int) except +
        transitMatrixIxSxUS() except +

        void prepareGraphWithVertices(int V) except +
        void addToUserSourceDataContainer(unsigned int, ulong, ushort) except +
        void addToUserDestDataContainer(unsigned int, string, ushort) except +
        void addEdgesToGraph(vector[ulong], vector[ulong], vector[ushort], vector[bool]) except +
        void addToCategoryMap(string, string) except +
        void setMockDataFrame(vector[vector[ushort]], vector[ulong], vector[string]) except +

        void compute(int) except +
        vector[pair[ulong, ushort]] getValuesByDest(string, bool) except +
        vector[pair[string, ushort]] getValuesBySource(ulong, bool) except +
        unordered_map[ulong, vector[string]] getDestsInRange(ushort) except +
        unordered_map[string, vector[ulong]] getSourcesInRange(ushort) except +
        ushort timeToNearestDestPerCategory(ulong, string) except +
        ushort countDestsInRangePerCategory(ulong, string, ushort) except +
        ushort timeToNearestDest(ulong) except +
        ushort countDestsInRange(ulong, ushort) except +

        vector[string] getColIds() except +
        vector[ulong] getRowIds() except +

        void writeCSV(string) except +
        void writeTMX(string) except +
        void readTMX(string) except +
        void readCSV(string) except +
        void readOTPCSV(string) except +
        void printDataFrame() except +

cdef class  pyTransitMatrixIxSxUS:
    cdef transitMatrixIxSxUS *thisptr

    def __cinit__(self, bool isCompressible=False, bool isSymmetric=False, unsigned int rows=0, unsigned int columns=0):
        if rows == 0 and columns == 0:
            self.thisptr = new transitMatrixIxSxUS()
        else:
            self.thisptr = new transitMatrixIxSxUS(isCompressible, isSymmetric, rows, columns)

    def __dealloc__(self):
        del self.thisptr

    def prepareGraphWithVertices(self, vertices):
        self.thisptr.prepareGraphWithVertices(vertices)


    def addToUserSourceDataContainer(self, networkNodeId, id_, lastMileDistance):
        self.thisptr.addToUserSourceDataContainer(networkNodeId, id_, lastMileDistance)

    def addToUserDestDataContainer(self, networkNodeId, id_, lastMileDistance):
        self.thisptr.addToUserDestDataContainer(networkNodeId, id_, lastMileDistance)

    def addEdgesToGraph(self, from_column, to_column, edge_weight_column, is_bidirectional_column):
        self.thisptr.addEdgesToGraph(from_column, to_column, edge_weight_column, is_bidirectional_column)

    def setMockDataFrame(self, dataset, row_ids, col_ids):
        self.thisptr.setMockDataFrame(dataset, row_ids, col_ids)

    def compute(self, numThreads):
        self.thisptr.compute(numThreads)

    def writeCSV(self, outfile):
        self.thisptr.writeCSV(outfile)

    def writeTMX(self, outfile):
        self.thisptr.writeTMX(outfile)

    def readTMX(self, infile):
        self.thisptr.readTMX(infile)

    def readCSV(self, infile):
        self.thisptr.readCSV(infile)

    def readOTPCSV(self, infile):
        self.thisptr.readOTPCSV(infile)

    def printDataFrame(self):
        self.thisptr.printDataFrame()

    def getValuesBySource(self, source_id, sort):
        return self.thisptr.getValuesBySource(source_id, sort)

    def getValuesByDest(self, dest_id, sort):
        return self.thisptr.getValuesByDest(dest_id, sort)

    def addToCategoryMap(self, dest_id, category):
        self.thisptr.addToCategoryMap(dest_id, category)

    def timeToNearestDestPerCategory(self, source_id, category):
        return self.thisptr.timeToNearestDestPerCategory(source_id, category)

    def countDestsInRangePerCategory(self, source_id, category, range):
        return self.thisptr.countDestsInRangePerCategory(source_id, category, range)

    def timeToNearestDest(self, source_id):
        return self.thisptr.timeToNearestDest(source_id)

    def countDestsInRange(self, source_id, range):
        return self.thisptr.countDestsInRange(source_id, range)

    def getColIds(self):
        return self.thisptr.getColIds()

    def getRowIds(self):
        return self.thisptr.getRowIds()

    def getSourcesInRange(self, range_):
        return self.thisptr.getSourcesInRange(range_)

    def getDestsInRange(self, range_):
        return self.thisptr.getDestsInRange(range_)

cdef extern from "include/transitMatrix.h":
    cdef cppclass transitMatrixIxSxUI "transitMatrix<unsigned long int, string,unsigned int>":


        transitMatrixIxSxUI(bool, bool, unsigned int, unsigned int) except +
        transitMatrixIxSxUI() except +

        void prepareGraphWithVertices(int V) except +
        void addToUserSourceDataContainer(unsigned int, ulong, uint) except +
        void addToUserDestDataContainer(unsigned int, string, uint) except +
        void addEdgesToGraph(vector[ulong], vector[ulong], vector[uint], vector[bool]) except +
        void addToCategoryMap(string, string) except +
        void setMockDataFrame(vector[vector[uint]], vector[ulong], vector[string]) except +

        void compute(int) except +
        vector[pair[ulong, uint]] getValuesByDest(string, bool) except +
        vector[pair[string, uint]] getValuesBySource(ulong, bool) except +
        unordered_map[ulong, vector[string]] getDestsInRange(uint) except +
        unordered_map[string, vector[ulong]] getSourcesInRange(uint) except +
        uint timeToNearestDestPerCategory(ulong, string) except +
        uint countDestsInRangePerCategory(ulong, string, uint) except +
        uint timeToNearestDest(ulong) except +
        uint countDestsInRange(ulong, uint) except +

        vector[string] getColIds() except +
        vector[ulong] getRowIds() except +

        void writeCSV(string) except +
        void writeTMX(string) except +
        void readTMX(string) except +
        void readCSV(string) except +
        void readOTPCSV(string) except +
        void printDataFrame() except +

cdef class  pyTransitMatrixIxSxUI:
    cdef transitMatrixIxSxUI *thisptr

    def __cinit__(self, bool isCompressible=False, bool isSymmetric=False, unsigned int rows=0, unsigned int columns=0):
        if rows == 0 and columns == 0:
            self.thisptr = new transitMatrixIxSxUI()
        else:
            self.thisptr = new transitMatrixIxSxUI(isCompressible, isSymmetric, rows, columns)

    def __dealloc__(self):
        del self.thisptr

    def prepareGraphWithVertices(self, vertices):
        self.thisptr.prepareGraphWithVertices(vertices)


    def addToUserSourceDataContainer(self, networkNodeId, id_, lastMileDistance):
        self.thisptr.addToUserSourceDataContainer(networkNodeId, id_, lastMileDistance)

    def addToUserDestDataContainer(self, networkNodeId, id_, lastMileDistance):
        self.thisptr.addToUserDestDataContainer(networkNodeId, id_, lastMileDistance)

    def addEdgesToGraph(self, from_column, to_column, edge_weight_column, is_bidirectional_column):
        self.thisptr.addEdgesToGraph(from_column, to_column, edge_weight_column, is_bidirectional_column)

    def setMockDataFrame(self, dataset, row_ids, col_ids):
        self.thisptr.setMockDataFrame(dataset, row_ids, col_ids)

    def compute(self, numThreads):
        self.thisptr.compute(numThreads)

    def writeCSV(self, outfile):
        self.thisptr.writeCSV(outfile)

    def writeTMX(self, outfile):
        self.thisptr.writeTMX(outfile)

    def readTMX(self, infile):
        self.thisptr.readTMX(infile)

    def readCSV(self, infile):
        self.thisptr.readCSV(infile)

    def readOTPCSV(self, infile):
        self.thisptr.readOTPCSV(infile)

    def printDataFrame(self):
        self.thisptr.printDataFrame()

    def getValuesBySource(self, source_id, sort):
        return self.thisptr.getValuesBySource(source_id, sort)

    def getValuesByDest(self, dest_id, sort):
        return self.thisptr.getValuesByDest(dest_id, sort)

    def addToCategoryMap(self, dest_id, category):
        self.thisptr.addToCategoryMap(dest_id, category)

    def timeToNearestDestPerCategory(self, source_id, category):
        return self.thisptr.timeToNearestDestPerCategory(source_id, category)

    def countDestsInRangePerCategory(self, source_id, category, range):
        return self.thisptr.countDestsInRangePerCategory(source_id, category, range)

    def timeToNearestDest(self, source_id):
        return self.thisptr.timeToNearestDest(source_id)

    def countDestsInRange(self, source_id, range):
        return self.thisptr.countDestsInRange(source_id, range)

    def getColIds(self):
        return self.thisptr.getColIds()

    def getRowIds(self):
        return self.thisptr.getRowIds()

    def getSourcesInRange(self, range_):
        return self.thisptr.getSourcesInRange(range_)

    def getDestsInRange(self, range_):
        return self.thisptr.getDestsInRange(range_)

cdef extern from "include/transitMatrix.h":
    cdef cppclass transitMatrixSxIxUS "transitMatrix<string, unsigned long int,unsigned short int>":


        transitMatrixSxIxUS(bool, bool, unsigned int, unsigned int) except +
        transitMatrixSxIxUS() except +

        void prepareGraphWithVertices(int V) except +
        void addToUserSourceDataContainer(unsigned int, string, ushort) except +
        void addToUserDestDataContainer(unsigned int, ulong, ushort) except +
        void addEdgesToGraph(vector[ulong], vector[ulong], vector[ushort], vector[bool]) except +
        void addToCategoryMap(ulong, string) except +
        void setMockDataFrame(vector[vector[ushort]], vector[string], vector[ulong]) except +

        void compute(int) except +
        vector[pair[string, ushort]] getValuesByDest(ulong, bool) except +
        vector[pair[ulong, ushort]] getValuesBySource(string, bool) except +
        unordered_map[string, vector[ulong]] getDestsInRange(ushort) except +
        unordered_map[ulong, vector[string]] getSourcesInRange(ushort) except +
        ushort timeToNearestDestPerCategory(string, string) except +
        ushort countDestsInRangePerCategory(string, string, ushort) except +
        ushort timeToNearestDest(string) except +
        ushort countDestsInRange(string, ushort) except +

        vector[ulong] getColIds() except +
        vector[string] getRowIds() except +

        void writeCSV(string) except +
        void writeTMX(string) except +
        void readTMX(string) except +
        void readCSV(string) except +
        void readOTPCSV(string) except +
        void printDataFrame() except +

cdef class  pyTransitMatrixSxIxUS:
    cdef transitMatrixSxIxUS *thisptr

    def __cinit__(self, bool isCompressible=False, bool isSymmetric=False, unsigned int rows=0, unsigned int columns=0):
        if rows == 0 and columns == 0:
            self.thisptr = new transitMatrixSxIxUS()
        else:
            self.thisptr = new transitMatrixSxIxUS(isCompressible, isSymmetric, rows, columns)

    def __dealloc__(self):
        del self.thisptr

    def prepareGraphWithVertices(self, vertices):
        self.thisptr.prepareGraphWithVertices(vertices)


    def addToUserSourceDataContainer(self, networkNodeId, id_, lastMileDistance):
        self.thisptr.addToUserSourceDataContainer(networkNodeId, id_, lastMileDistance)

    def addToUserDestDataContainer(self, networkNodeId, id_, lastMileDistance):
        self.thisptr.addToUserDestDataContainer(networkNodeId, id_, lastMileDistance)

    def addEdgesToGraph(self, from_column, to_column, edge_weight_column, is_bidirectional_column):
        self.thisptr.addEdgesToGraph(from_column, to_column, edge_weight_column, is_bidirectional_column)

    def setMockDataFrame(self, dataset, row_ids, col_ids):
        self.thisptr.setMockDataFrame(dataset, row_ids, col_ids)

    def compute(self, numThreads):
        self.thisptr.compute(numThreads)

    def writeCSV(self, outfile):
        self.thisptr.writeCSV(outfile)

    def writeTMX(self, outfile):
        self.thisptr.writeTMX(outfile)

    def readTMX(self, infile):
        self.thisptr.readTMX(infile)

    def readCSV(self, infile):
        self.thisptr.readCSV(infile)

    def readOTPCSV(self, infile):
        self.thisptr.readOTPCSV(infile)

    def printDataFrame(self):
        self.thisptr.printDataFrame()

    def getValuesBySource(self, source_id, sort):
        return self.thisptr.getValuesBySource(source_id, sort)

    def getValuesByDest(self, dest_id, sort):
        return self.thisptr.getValuesByDest(dest_id, sort)

    def addToCategoryMap(self, dest_id, category):
        self.thisptr.addToCategoryMap(dest_id, category)

    def timeToNearestDestPerCategory(self, source_id, category):
        return self.thisptr.timeToNearestDestPerCategory(source_id, category)

    def countDestsInRangePerCategory(self, source_id, category, range):
        return self.thisptr.countDestsInRangePerCategory(source_id, category, range)

    def timeToNearestDest(self, source_id):
        return self.thisptr.timeToNearestDest(source_id)

    def countDestsInRange(self, source_id, range):
        return self.thisptr.countDestsInRange(source_id, range)

    def getColIds(self):
        return self.thisptr.getColIds()

    def getRowIds(self):
        return self.thisptr.getRowIds()

    def getSourcesInRange(self, range_):
        return self.thisptr.getSourcesInRange(range_)

    def getDestsInRange(self, range_):
        return self.thisptr.getDestsInRange(range_)

cdef extern from "include/transitMatrix.h":
    cdef cppclass transitMatrixSxIxUI "transitMatrix<string, unsigned long int,unsigned int>":


        transitMatrixSxIxUI(bool, bool, unsigned int, unsigned int) except +
        transitMatrixSxIxUI() except +

        void prepareGraphWithVertices(int V) except +
        void addToUserSourceDataContainer(unsigned int, string, uint) except +
        void addToUserDestDataContainer(unsigned int, ulong, uint) except +
        void addEdgesToGraph(vector[ulong], vector[ulong], vector[uint], vector[bool]) except +
        void addToCategoryMap(ulong, string) except +
        void setMockDataFrame(vector[vector[uint]], vector[string], vector[ulong]) except +

        void compute(int) except +
        vector[pair[string, uint]] getValuesByDest(ulong, bool) except +
        vector[pair[ulong, uint]] getValuesBySource(string, bool) except +
        unordered_map[string, vector[ulong]] getDestsInRange(uint) except +
        unordered_map[ulong, vector[string]] getSourcesInRange(uint) except +
        uint timeToNearestDestPerCategory(string, string) except +
        uint countDestsInRangePerCategory(string, string, uint) except +
        uint timeToNearestDest(string) except +
        uint countDestsInRange(string, uint) except +

        vector[ulong] getColIds() except +
        vector[string] getRowIds() except +

        void writeCSV(string) except +
        void writeTMX(string) except +
        void readTMX(string) except +
        void readCSV(string) except +
        void readOTPCSV(string) except +
        void printDataFrame() except +

cdef class  pyTransitMatrixSxIxUI:
    cdef transitMatrixSxIxUI *thisptr

    def __cinit__(self, bool isCompressible=False, bool isSymmetric=False, unsigned int rows=0, unsigned int columns=0):
        if rows == 0 and columns == 0:
            self.thisptr = new transitMatrixSxIxUI()
        else:
            self.thisptr = new transitMatrixSxIxUI(isCompressible, isSymmetric, rows, columns)

    def __dealloc__(self):
        del self.thisptr

    def prepareGraphWithVertices(self, vertices):
        self.thisptr.prepareGraphWithVertices(vertices)


    def addToUserSourceDataContainer(self, networkNodeId, id_, lastMileDistance):
        self.thisptr.addToUserSourceDataContainer(networkNodeId, id_, lastMileDistance)

    def addToUserDestDataContainer(self, networkNodeId, id_, lastMileDistance):
        self.thisptr.addToUserDestDataContainer(networkNodeId, id_, lastMileDistance)

    def addEdgesToGraph(self, from_column, to_column, edge_weight_column, is_bidirectional_column):
        self.thisptr.addEdgesToGraph(from_column, to_column, edge_weight_column, is_bidirectional_column)

    def setMockDataFrame(self, dataset, row_ids, col_ids):
        self.thisptr.setMockDataFrame(dataset, row_ids, col_ids)

    def compute(self, numThreads):
        self.thisptr.compute(numThreads)

    def writeCSV(self, outfile):
        self.thisptr.writeCSV(outfile)

    def writeTMX(self, outfile):
        self.thisptr.writeTMX(outfile)

    def readTMX(self, infile):
        self.thisptr.readTMX(infile)

    def readCSV(self, infile):
        self.thisptr.readCSV(infile)

    def readOTPCSV(self, infile):
        self.thisptr.readOTPCSV(infile)

    def printDataFrame(self):
        self.thisptr.printDataFrame()

    def getValuesBySource(self, source_id, sort):
        return self.thisptr.getValuesBySource(source_id, sort)

    def getValuesByDest(self, dest_id, sort):
        return self.thisptr.getValuesByDest(dest_id, sort)

    def addToCategoryMap(self, dest_id, category):
        self.thisptr.addToCategoryMap(dest_id, category)

    def timeToNearestDestPerCategory(self, source_id, category):
        return self.thisptr.timeToNearestDestPerCategory(source_id, category)

    def countDestsInRangePerCategory(self, source_id, category, range):
        return self.thisptr.countDestsInRangePerCategory(source_id, category, range)

    def timeToNearestDest(self, source_id):
        return self.thisptr.timeToNearestDest(source_id)

    def countDestsInRange(self, source_id, range):
        return self.thisptr.countDestsInRange(source_id, range)

    def getColIds(self):
        return self.thisptr.getColIds()

    def getRowIds(self):
        return self.thisptr.getRowIds()

    def getSourcesInRange(self, range_):
        return self.thisptr.getSourcesInRange(range_)

    def getDestsInRange(self, range_):
        return self.thisptr.getDestsInRange(range_)

cdef extern from "include/transitMatrix.h":
    cdef cppclass transitMatrixSxSxUS "transitMatrix<string, string,unsigned short int>":


        transitMatrixSxSxUS(bool, bool, unsigned int, unsigned int) except +
        transitMatrixSxSxUS() except +

        void prepareGraphWithVertices(int V) except +
        void addToUserSourceDataContainer(unsigned int, string, ushort) except +
        void addToUserDestDataContainer(unsigned int, string, ushort) except +
        void addEdgesToGraph(vector[ulong], vector[ulong], vector[ushort], vector[bool]) except +
        void addToCategoryMap(string, string) except +
        void setMockDataFrame(vector[vector[ushort]], vector[string], vector[string]) except +

        void compute(int) except +
        vector[pair[string, ushort]] getValuesByDest(string, bool) except +
        vector[pair[string, ushort]] getValuesBySource(string, bool) except +
        unordered_map[string, vector[string]] getDestsInRange(ushort) except +
        unordered_map[string, vector[string]] getSourcesInRange(ushort) except +
        ushort timeToNearestDestPerCategory(string, string) except +
        ushort countDestsInRangePerCategory(string, string, ushort) except +
        ushort timeToNearestDest(string) except +
        ushort countDestsInRange(string, ushort) except +

        vector[string] getColIds() except +
        vector[string] getRowIds() except +

        void writeCSV(string) except +
        void writeTMX(string) except +
        void readTMX(string) except +
        void readCSV(string) except +
        void readOTPCSV(string) except +
        void printDataFrame() except +

cdef class  pyTransitMatrixSxSxUS:
    cdef transitMatrixSxSxUS *thisptr

    def __cinit__(self, bool isCompressible=False, bool isSymmetric=False, unsigned int rows=0, unsigned int columns=0):
        if rows == 0 and columns == 0:
            self.thisptr = new transitMatrixSxSxUS()
        else:
            self.thisptr = new transitMatrixSxSxUS(isCompressible, isSymmetric, rows, columns)

    def __dealloc__(self):
        del self.thisptr

    def prepareGraphWithVertices(self, vertices):
        self.thisptr.prepareGraphWithVertices(vertices)


    def addToUserSourceDataContainer(self, networkNodeId, id_, lastMileDistance):
        self.thisptr.addToUserSourceDataContainer(networkNodeId, id_, lastMileDistance)

    def addToUserDestDataContainer(self, networkNodeId, id_, lastMileDistance):
        self.thisptr.addToUserDestDataContainer(networkNodeId, id_, lastMileDistance)

    def addEdgesToGraph(self, from_column, to_column, edge_weight_column, is_bidirectional_column):
        self.thisptr.addEdgesToGraph(from_column, to_column, edge_weight_column, is_bidirectional_column)

    def setMockDataFrame(self, dataset, row_ids, col_ids):
        self.thisptr.setMockDataFrame(dataset, row_ids, col_ids)

    def compute(self, numThreads):
        self.thisptr.compute(numThreads)

    def writeCSV(self, outfile):
        self.thisptr.writeCSV(outfile)

    def writeTMX(self, outfile):
        self.thisptr.writeTMX(outfile)

    def readTMX(self, infile):
        self.thisptr.readTMX(infile)

    def readCSV(self, infile):
        self.thisptr.readCSV(infile)

    def readOTPCSV(self, infile):
        self.thisptr.readOTPCSV(infile)

    def printDataFrame(self):
        self.thisptr.printDataFrame()

    def getValuesBySource(self, source_id, sort):
        return self.thisptr.getValuesBySource(source_id, sort)

    def getValuesByDest(self, dest_id, sort):
        return self.thisptr.getValuesByDest(dest_id, sort)

    def addToCategoryMap(self, dest_id, category):
        self.thisptr.addToCategoryMap(dest_id, category)

    def timeToNearestDestPerCategory(self, source_id, category):
        return self.thisptr.timeToNearestDestPerCategory(source_id, category)

    def countDestsInRangePerCategory(self, source_id, category, range):
        return self.thisptr.countDestsInRangePerCategory(source_id, category, range)

    def timeToNearestDest(self, source_id):
        return self.thisptr.timeToNearestDest(source_id)

    def countDestsInRange(self, source_id, range):
        return self.thisptr.countDestsInRange(source_id, range)

    def getColIds(self):
        return self.thisptr.getColIds()

    def getRowIds(self):
        return self.thisptr.getRowIds()

    def getSourcesInRange(self, range_):
        return self.thisptr.getSourcesInRange(range_)

    def getDestsInRange(self, range_):
        return self.thisptr.getDestsInRange(range_)

cdef extern from "include/transitMatrix.h":
    cdef cppclass transitMatrixSxSxUI "transitMatrix<string, string,unsigned int>":


        transitMatrixSxSxUI(bool, bool, unsigned int, unsigned int) except +
        transitMatrixSxSxUI() except +

        void prepareGraphWithVertices(int V) except +
        void addToUserSourceDataContainer(unsigned int, string, uint) except +
        void addToUserDestDataContainer(unsigned int, string, uint) except +
        void addEdgesToGraph(vector[ulong], vector[ulong], vector[uint], vector[bool]) except +
        void addToCategoryMap(string, string) except +
        void setMockDataFrame(vector[vector[uint]], vector[string], vector[string]) except +

        void compute(int) except +
        vector[pair[string, uint]] getValuesByDest(string, bool) except +
        vector[pair[string, uint]] getValuesBySource(string, bool) except +
        unordered_map[string, vector[string]] getDestsInRange(uint) except +
        unordered_map[string, vector[string]] getSourcesInRange(uint) except +
        uint timeToNearestDestPerCategory(string, string) except +
        uint countDestsInRangePerCategory(string, string, uint) except +
        uint timeToNearestDest(string) except +
        uint countDestsInRange(string, uint) except +

        vector[string] getColIds() except +
        vector[string] getRowIds() except +

        void writeCSV(string) except +
        void writeTMX(string) except +
        void readTMX(string) except +
        void readCSV(string) except +
        void readOTPCSV(string) except +
        void printDataFrame() except +

cdef class  pyTransitMatrixSxSxUI:
    cdef transitMatrixSxSxUI *thisptr

    def __cinit__(self, bool isCompressible=False, bool isSymmetric=False, unsigned int rows=0, unsigned int columns=0):
        if rows == 0 and columns == 0:
            self.thisptr = new transitMatrixSxSxUI()
        else:
            self.thisptr = new transitMatrixSxSxUI(isCompressible, isSymmetric, rows, columns)

    def __dealloc__(self):
        del self.thisptr

    def prepareGraphWithVertices(self, vertices):
        self.thisptr.prepareGraphWithVertices(vertices)


    def addToUserSourceDataContainer(self, networkNodeId, id_, lastMileDistance):
        self.thisptr.addToUserSourceDataContainer(networkNodeId, id_, lastMileDistance)

    def addToUserDestDataContainer(self, networkNodeId, id_, lastMileDistance):
        self.thisptr.addToUserDestDataContainer(networkNodeId, id_, lastMileDistance)

    def addEdgesToGraph(self, from_column, to_column, edge_weight_column, is_bidirectional_column):
        self.thisptr.addEdgesToGraph(from_column, to_column, edge_weight_column, is_bidirectional_column)

    def setMockDataFrame(self, dataset, row_ids, col_ids):
        self.thisptr.setMockDataFrame(dataset, row_ids, col_ids)

    def compute(self, numThreads):
        self.thisptr.compute(numThreads)

    def writeCSV(self, outfile):
        self.thisptr.writeCSV(outfile)

    def writeTMX(self, outfile):
        self.thisptr.writeTMX(outfile)

    def readTMX(self, infile):
        self.thisptr.readTMX(infile)

    def readCSV(self, infile):
        self.thisptr.readCSV(infile)

    def readOTPCSV(self, infile):
        self.thisptr.readOTPCSV(infile)

    def printDataFrame(self):
        self.thisptr.printDataFrame()

    def getValuesBySource(self, source_id, sort):
        return self.thisptr.getValuesBySource(source_id, sort)

    def getValuesByDest(self, dest_id, sort):
        return self.thisptr.getValuesByDest(dest_id, sort)

    def addToCategoryMap(self, dest_id, category):
        self.thisptr.addToCategoryMap(dest_id, category)

    def timeToNearestDestPerCategory(self, source_id, category):
        return self.thisptr.timeToNearestDestPerCategory(source_id, category)

    def countDestsInRangePerCategory(self, source_id, category, range):
        return self.thisptr.countDestsInRangePerCategory(source_id, category, range)

    def timeToNearestDest(self, source_id):
        return self.thisptr.timeToNearestDest(source_id)

    def countDestsInRange(self, source_id, range):
        return self.thisptr.countDestsInRange(source_id, range)

    def getColIds(self):
        return self.thisptr.getColIds()

    def getRowIds(self):
        return self.thisptr.getRowIds()

    def getSourcesInRange(self, range_):
        return self.thisptr.getSourcesInRange(range_)

    def getDestsInRange(self, range_):
        return self.thisptr.getDestsInRange(range_)