/************************************************************************
*
*  lapmain.cpp
   version 1.0 - 4 September 1996
   author: Roy Jonker @ MagicLogic Optimization Inc.
   
   main program file to run and check Jonker-Volgenant LAP code
*
*************************************************************************/
#include "lap2.h"

using namespace std;

int splx_lap(int n, int **c, int  **x)
{
  int k, l;
  cost **assigncost, *u, *v, lapcost;
  row i, *colsol;
  col j, *rowsol;

  assigncost = new cost*[n];
  for (i = 0; i < n; i++)
    assigncost[i] = new cost[n];

  rowsol = new col[n];
  colsol = new row[n];
  u = new cost[n];
  v = new cost[n];


    for (k = 0; k < n; k++)
    {
      for (l = 0; l < n; l++)
        assigncost[k][l] = c[k][l];
    }

    lapcost = lap(n, assigncost, rowsol, colsol, u, v);

    for (k = 0; k < n; k++)
    {
      for (l = 0; l < n; l++)
        c[k][l] = assigncost[k][l];
    }

    //checklap(n, assigncost, rowsol, colsol, u, v);

  delete[] assigncost;
  delete[] rowsol;
  delete[] colsol;
  delete[] u;
  delete[] v;

return lapcost;
}

