PGROUTING  2.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
VRP.c File Reference
#include "./../../common/src/postgres_connection.h"
#include "catalog/pg_type.h"
#include <stdio.h>
#include <stdlib.h>
#include <search.h>
#include <string.h>
#include "./VRP.h"
#include "./../../common/src/pgr_types.h"
#include "../../common/src/debug_macro.h"

Go to the source code of this file.

Classes

struct  distance_columns
 
struct  order_columns
 
struct  vehicle_columns
 

Macros

#define profstart(x)   do { } while (0);
 
#define profstop(n, x)   do { } while (0);
 
#define TUPLIMIT   1000
 

Typedefs

typedef struct distance_columns distance_columns_t
 
typedef struct order_columns order_columns_t
 
typedef struct vehicle_columns vehicle_columns_t
 

Functions

static int conn (int *SPIcode)
 
static void fetch_distance (HeapTuple *tuple, TupleDesc *tupdesc, distance_columns_t *distance_columns, vrp_cost_element_t *dist, size_t t)
 
static int fetch_distance_columns (SPITupleTable *tuptable, distance_columns_t *distance_columns)
 
static void fetch_order (HeapTuple *tuple, TupleDesc *tupdesc, order_columns_t *order_columns, vrp_orders_t *order, size_t t)
 
static int fetch_order_columns (SPITupleTable *tuptable, order_columns_t *order_columns)
 
static void fetch_vehicle (HeapTuple *tuple, TupleDesc *tupdesc, vehicle_columns_t *vehicle_columns, vrp_vehicles_t *vehicle, size_t t)
 
static int fetch_vehicle_columns (SPITupleTable *tuptable, vehicle_columns_t *vehicle_columns)
 
static int finish (int *code)
 
 PG_FUNCTION_INFO_V1 (vrp)
 
static int prepare_query (Portal *SPIportal, char *sql)
 
static int solve_vrp (char *orders_sql, char *vehicles_sql, char *dist_sql, int depot, vrp_result_element_t **path, size_t *path_count)
 
PGDLLEXPORT Datum vrp (PG_FUNCTION_ARGS)
 

Variables

 PG_MODULE_MAGIC
 

Macro Definition Documentation

#define profstart (   x)    do { } while (0);

Definition at line 70 of file VRP.c.

Referenced by solve_vrp(), and vrp().

#define profstop (   n,
 
)    do { } while (0);

Definition at line 71 of file VRP.c.

Referenced by solve_vrp(), and vrp().

#define TUPLIMIT   1000

Definition at line 86 of file VRP.c.

Referenced by solve_vrp().

Typedef Documentation

Function Documentation

static int conn ( int *  SPIcode)
static

Definition at line 395 of file VRP.c.

Referenced by main(), and solve_vrp().

static void fetch_distance ( HeapTuple *  tuple,
TupleDesc *  tupdesc,
distance_columns_t distance_columns,
vrp_cost_element_t dist,
size_t  t 
)
static
static int fetch_distance_columns ( SPITupleTable *  tuptable,
distance_columns_t distance_columns 
)
static
static int fetch_order_columns ( SPITupleTable *  tuptable,
order_columns_t order_columns 
)
static
static void fetch_vehicle ( HeapTuple *  tuple,
TupleDesc *  tupdesc,
vehicle_columns_t vehicle_columns,
vrp_vehicles_t vehicle,
size_t  t 
)
static
static int fetch_vehicle_columns ( SPITupleTable *  tuptable,
vehicle_columns_t vehicle_columns 
)
static

Definition at line 341 of file VRP.c.

References vehicle_columns::capacity, PGR_DBG, and vehicle_columns::vehicle_id.

Referenced by solve_vrp().

static int finish ( int *  code)
static

Definition at line 132 of file VRP.c.

Referenced by solve_vrp().

PG_FUNCTION_INFO_V1 ( vrp  )
static int prepare_query ( Portal *  SPIportal,
char *  sql 
)
static

Definition at line 408 of file VRP.c.

Referenced by solve_vrp().

static int solve_vrp ( char *  orders_sql,
char *  vehicles_sql,
char *  dist_sql,
int  depot,
vrp_result_element_t **  path,
size_t *  path_count 
)
static

Variable Documentation

PG_MODULE_MAGIC

Definition at line 89 of file VRP.c.