Exemplo n.º 1
0
    public static int call(HighsModel model, ref HighsSolution sol, ref HighsBasis bas)
    {
        int nc  = model.colcost.Length;
        int nr  = model.rowlower.Length;
        int nnz = model.avalue.Length;

        return(HighsLpSolver.Highs_call(nc, nr, nnz, model.colcost, model.collower, model.colupper,
                                        model.rowlower, model.rowupper, model.astart, model.aindex, model.avalue,
                                        sol.colvalue, sol.coldual, sol.rowvalue, sol.rowdual, bas.colbasisstatus, bas.rowbasisstatus));
    }
Exemplo n.º 2
0
    public static HighsStatus call(HighsModel model, ref HighsSolution sol, ref HighsBasis bas, ref HighsModelStatus modelstatus)
    {
        int nc  = model.colcost.Length;
        int nr  = model.rowlower.Length;
        int nnz = model.avalue.Length;

        int[] colbasstat = new int[nc];
        int[] rowbasstat = new int[nr];

        int modelstate = 0;

        HighsStatus status = (HighsStatus)HighsLpSolver.Highs_call(nc, nr, nnz, model.colcost, model.collower, model.colupper,
                                                                   model.rowlower, model.rowupper, model.astart, model.aindex, model.avalue,
                                                                   sol.colvalue, sol.coldual, sol.rowvalue, sol.rowdual, colbasstat, rowbasstat, ref modelstate);

        modelstatus = (HighsModelStatus)modelstate;

        bas.colbasisstatus = colbasstat.Select(x => (HighsBasisStatus)x).ToArray();
        bas.rowbasisstatus = rowbasstat.Select(x => (HighsBasisStatus)x).ToArray();

        return(status);
    }