vrpRouting  0.3
matrixRows_input.h File Reference
#include <stddef.h>
Include dependency graph for matrixRows_input.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct Matrix_cell_t Matrix_cell_t
 

Functions

void get_matrixRows (char *sql, Matrix_cell_t **rows, size_t *total_rows)
 Get the travel time matrix. More...
 
void get_matrixRows_plain (char *sql, Matrix_cell_t **rows, size_t *total_rows)
 Get the travel time matrix with numerical types. More...
 

Typedef Documentation

◆ Matrix_cell_t

typedef struct Matrix_cell_t Matrix_cell_t

Definition at line 31 of file matrixRows_input.h.

Function Documentation

◆ get_matrixRows()

void get_matrixRows ( char *  sql,
Matrix_cell_t **  rows,
size_t *  total_rows 
)

Get the travel time matrix.

Parameters
[in]sqlSQL query that has the following columns: start_vid, end_vid, agg_cost
[out]rowsC Container that holds all the matrix rows
[out]total_rowsTotal rows recieved

Definition at line 176 of file matrixRows_input.c.

179  {
180  Column_info_t info[3];
181 
182  int i;
183  for (i = 0; i < 3; ++i) {
184  info[i].colNumber = -1;
185  info[i].type = 0;
186  info[i].strict = true;
187  info[i].eType = ANY_INTEGER;
188  }
189  info[0].name = "start_vid";
190  info[1].name = "end_vid";
191  info[2].name = "travel_time";
192 
193  info[2].eType = INTERVAL;
194  get_matrixRows_general(sql, info, 0, rows, total_rows);
195 }

References ANY_INTEGER, Column_info_t::colNumber, Column_info_t::eType, get_matrixRows_general(), INTERVAL, Column_info_t::name, Column_info_t::strict, and Column_info_t::type.

Referenced by process().

◆ get_matrixRows_plain()

void get_matrixRows_plain ( char *  sql,
Matrix_cell_t **  rows,
size_t *  total_rows 
)

Get the travel time matrix with numerical types.

Parameters
[in]sqlSQL query that has the following columns: start_vid, end_vid, agg_cost
[out]rowsC Container that holds all the matrix rows
[out]total_rowsTotal rows recieved

Definition at line 203 of file matrixRows_input.c.

206  {
207  Column_info_t info[3];
208 
209  int i;
210  for (i = 0; i < 3; ++i) {
211  info[i].colNumber = -1;
212  info[i].type = 0;
213  info[i].strict = true;
214  info[i].eType = ANY_INTEGER;
215  }
216  info[0].name = "start_vid";
217  info[1].name = "end_vid";
218  info[2].name = "agg_cost";
219 
220  info[2].eType = ANY_NUMERICAL;
221  get_matrixRows_general(sql, info, 1, rows, total_rows);
222 }

References ANY_INTEGER, ANY_NUMERICAL, Column_info_t::colNumber, Column_info_t::eType, get_matrixRows_general(), Column_info_t::name, Column_info_t::strict, and Column_info_t::type.

Referenced by process().

Column_info_t::colNumber
int colNumber
Definition: column_info_t.h:54
Column_info_t::strict
bool strict
Definition: column_info_t.h:56
Column_info_t::name
char * name
Definition: column_info_t.h:57
INTERVAL
@ INTERVAL
Definition: column_info_t.h:48
Column_info_t::eType
expectType eType
Definition: column_info_t.h:58
ANY_INTEGER
@ ANY_INTEGER
Definition: column_info_t.h:40
get_matrixRows_general
static void get_matrixRows_general(char *sql, Column_info_t *info, const int kind, Matrix_cell_t **rows, size_t *total_rows)
bigint start_vid, bigint end_vid, float agg_cost,
Definition: matrixRows_input.c:90
ANY_NUMERICAL
@ ANY_NUMERICAL
Definition: column_info_t.h:41
Column_info_t::type
uint64_t type
Definition: column_info_t.h:55
Column_info_t
Definition: column_info_t.h:52