pgRouting
pgRouting extends the PostGIS / PostgreSQL geospatial database to provide geospatial routing functionality.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
tsp2.c File Reference
#include "./tsp.h"
#include <math.h>
#include "postgres.h"
#include "funcapi.h"
#include "catalog/pg_type.h"
#include "utils/array.h"
#include "utils/lsyscache.h"
#include "fmgr.h"
#include "../../common/src/debug_macro.h"

Go to the source code of this file.

Macros

#define D(i, j)   matrix[(i) * num + j]
 
#define TUPLIMIT   1000
 

Functions

static double * get_pgarray (int *num, ArrayType *input)
 
 PG_FUNCTION_INFO_V1 (tsp_matrix)
 
static int solve_tsp (double *matrix, int num, int start, int end, int **results)
 
PGDLLEXPORT Datum tsp_matrix (PG_FUNCTION_ARGS)
 

Macro Definition Documentation

#define D (   i,
 
)    matrix[(i) * num + j]

Definition at line 169 of file tsp2.c.

Referenced by solve_tsp().

#define TUPLIMIT   1000

Definition at line 68 of file tsp2.c.

Function Documentation

static double* get_pgarray ( int *  num,
ArrayType *  input 
)
static

Definition at line 71 of file tsp2.c.

References DTYPE, and PGR_DBG.

Referenced by tsp_matrix().

PG_FUNCTION_INFO_V1 ( tsp_matrix  )
static int solve_tsp ( double *  matrix,
int  num,
int  start,
int  end,
int **  results 
)
static

Definition at line 171 of file tsp2.c.

References D, DTYPE, err_msg, find_tsp_solution(), and PGR_DBG.

Referenced by tsp_matrix().

PGDLLEXPORT Datum tsp_matrix ( PG_FUNCTION_ARGS  )

Definition at line 235 of file tsp2.c.

References DTYPE, get_pgarray(), PGR_DBG, and solve_tsp().