Exemplo n.º 1
0
void free_solver_specific_data(SolverOptions* options)
{
  int id = options->solverId;
  if (newton_LSA_check_solverId(id))
  {
    assert(options->solverData);
    assert(options->solverParameters);
    newton_LSA_free_solverOptions(options);
  }
  switch (id)
  {
    case SICONOS_NCP_PATHSEARCH:
      assert(options->solverData);
      free_solverData_PathSearch(options->solverData);
      free(options->solverData);
      options->solverData = NULL;
      break;
    default:
      {
       if (options->solverParameters)
       {
        free(options->solverParameters);
        options->solverParameters = NULL;
       }
      }
      ;
  }
}
Exemplo n.º 2
0
void free_solver_specific_data(SolverOptions* options)
{
  int id = options->solverId;
  switch (id)
  {
    case SICONOS_NCP_PATHSEARCH:
      assert(options->solverData);
      free_solverData_PathSearch(options->solverData);
      free(options->solverData);
      options->solverData = NULL;
      break;
    case SICONOS_FRICTION_3D_GAMS_PATH:
    case SICONOS_FRICTION_3D_GAMS_PATHVI:
    case SICONOS_FRICTION_3D_GAMS_LCP_PATH:
    case SICONOS_FRICTION_3D_GAMS_LCP_PATHVI:
    case SICONOS_GLOBAL_FRICTION_3D_GAMS_PATH:
    case SICONOS_GLOBAL_FRICTION_3D_GAMS_PATHVI:
    {
      deleteGAMSparams((SN_GAMSparams *)options->solverParameters);
      options->solverParameters = NULL;
      break;
    }
    case SICONOS_VI_BOX_AVI_LSA:
    {
     vi_box_AVI_free_solverData(options);
     break;
    }
    default:
      {
       if (options->solverParameters)
       {
         free(options->solverParameters);
         options->solverParameters = NULL;
       }
      }
  }

  if (newton_LSA_check_solverId(id))
  {
    newton_LSA_free_solverOptions(options);
  }
}