Skip to content

Commit

Permalink
Camel case in elkai.c
Browse files Browse the repository at this point in the history
  • Loading branch information
fikisipi committed May 14, 2019
1 parent a053fb2 commit ac6fae4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions elkai/_elkai.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
// - Make sure camel case is used everywhere
// - Use git submodule instead of a LKH copy

static int elk_invoke_solver(int *matrixBuff, int matrixLen, int runCount, int *tourBuff, int *tourN);
static int InvokeSolver(int *matrixBuff, int matrixLen, int runCount, int *tourBuff, int *tourN);

static PyObject *elk_solve(PyObject *self, PyObject *args)
static PyObject *ElkSolve(PyObject *self, PyObject *args)
{
// *args of a vararg Python function is a tuple
// of unknown length.
Expand Down Expand Up @@ -62,7 +62,7 @@ static PyObject *elk_solve(PyObject *self, PyObject *args)
// TODO: don't lose precision
matrixBuff[i] = justNumber_i;
}
int norm_result = elk_invoke_solver(matrixBuff, pyLen, runCount, tourBuff, &tourN);
int norm_result = InvokeSolver(matrixBuff, pyLen, runCount, tourBuff, &tourN);
free(matrixBuff);
PyObject *list = PyList_New(tourN);
for (i = 0; i < tourN; i++)
Expand All @@ -79,11 +79,11 @@ static char elk_docs[] =
"solve(x): Solve a TSP problem.\n";

static PyMethodDef funcs[] = {
{"solve", (PyCFunction)elk_solve,
{"solve", (PyCFunction) ElkSolve,
METH_VARARGS, elk_docs},
{NULL}};

static struct PyModuleDef hello_module_def = {
static struct PyModuleDef elkDef = {
PyModuleDef_HEAD_INIT,
"_elkai",
"",
Expand All @@ -92,10 +92,10 @@ static struct PyModuleDef hello_module_def = {

PyMODINIT_FUNC PyInit__elkai(void)
{
return PyModule_Create(&hello_module_def);
return PyModule_Create(&elkDef);
}

static void LoadWeightMatrix(int *_wArr);
static void LoadWeightMatrix(int *arr);

void ParseTour(int *outN, int *outBuff, int *Tour)
{
Expand Down Expand Up @@ -481,9 +481,9 @@ void _Reset6();
void _Reset7();
void _Reset8();

// elk_invoke_solver reads the matrix buffer and outputs it into tourBuff and updates
// InvokeSolver reads the matrix buffer and outputs it into tourBuff and updates
// tourN which is the tour length.
static int elk_invoke_solver(int *matrixBuff, int matrixLen, int runCount, int *tourBuff, int *tourN)
static int InvokeSolver(int *matrixBuff, int matrixLen, int runCount, int *tourBuff, int *tourN)
{
_Reset1();
_Reset2();
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
description="A TSP solver for Python without any dependencies.",
long_description=long_description,
long_description_content_type='text/markdown',
url="https://github.com/dimitrovskif/elkai",
version="0.0.4",
url="https://github.com/pyEntropy/elkai",
version="0.0.5",
packages=['elkai'],
author="Filip Dimitrovski",
license="MIT",
Expand Down

0 comments on commit ac6fae4

Please sign in to comment.