Documentation ¶
Overview ¶
gmsk is an unofficial wrapper for MOSEK, the conic optimizer from MOSEK ApS.
gmsk is based on mosek's C api, which must be installed and configured before using gmsk.
Most routines of mosek's C api returns a response code ResCode (which is an enum/uint32) to indicate if the routine is successful or not (MSK_RES_OK or RES_OK or 0 indicates success). Check mosek documentation for more information.
Almost all float point numbers in MOSEK are IEEE-754 64-bit float point number, or double in C/C++/float64 in go.
Most indices associated with variables and A (constraints) matrix are signed 32-bit integers, int32_t in C/C++ and int32 in go. However, indices associated with affine expression (afe) are 64-bit, or int64_t in C/C++ and int64 in go.
Besides response code, MOSEK sometimes needs to return some other information (for example, index of newly created domain). This is achieved in C/C++ by passing in a "destination" pointer. This is not done in go because go supports multiple return values.
For majority of pointer inputs to MOSEK calls (such as below), the pointers can be obtained by take the address of the desired element in a slice/array in golang
MSKrescodee MSK_putafefcol( task MSKtask_t, MSKint32t varidx, MSKint64t numz, MSKint64t *afeidx, MSKrealt *val);
The input to val can be `&val[0]`. That being said, gmsk takes care of this, and most of the pointer inputs in gmsk are slices.
Wrappers for routines accepting C string (or "const char *" type) instead accept go's string. However, this will create a new C.CString (destroy it once it is copied over by mosek).
Note that there is always overhead of calling c functions from go.
Example (AffineConicConstraints_acc1) ¶
Affine conic constraints example 1, reproduced from acc1.c in MOSEK C Api.
Purpose : Tutorial example for affine conic constraints.
Models the problem:
maximize c^T x
subject to sum(x) = 1
gamma >= |Gx+h|_2
package main import ( "fmt" "log" "os" "github.com/fardream/gmsk" ) func main() { /* Input data dimensions */ var n int32 = 3 var k int64 = 2 /* Create the mosek environment. */ env, err := gmsk.MakeEnv() if err != nil { log.Fatal(err) } defer gmsk.DeleteEnv(env) /* Create the optimization task. */ task, err := gmsk.MakeTask(env, 0, 0) if err != nil { log.Fatal(err) } defer gmsk.DeleteTask(task) checkOk := func(err error) { if err != nil { log.Fatalf("failed: %s", err.Error()) } } checkOk(task.LinkFuncToTaskStream(gmsk.STREAM_LOG, os.Stderr)) /* Create n free variables */ checkOk(task.AppendVars(n)) checkOk(task.PutVarBoundSliceConst(0, n, gmsk.BK_FR, -gmsk.INFINITY, gmsk.INFINITY)) /* Set up the objective */ { c := []float64{2.0, 3.0, -1.0} checkOk(task.PutCSlice(0, n, c)) checkOk(task.PutObjSense(gmsk.OBJECTIVE_SENSE_MAXIMIZE)) } /* One linear constraint sum(x) == 1 */ checkOk(task.AppendCons(1)) checkOk(task.PutConBound(0, gmsk.BK_FX, 1, 1)) for i := int32(0); i < n; i++ { checkOk(task.PutAij(0, i, 1)) } /* Append empty AFE rows for affine expression storage */ checkOk(task.AppendAfes(k + 1)) { /* Fill in the affine expression storage with data */ /* F matrix in sparse form */ Fsubi := []int64{1, 1, 2, 2} /* G is placed from row 1 of F */ Fsubj := []int32{0, 1, 0, 2} Fval := []float64{1.5, 0.1, 0.3, 2.1} var numEntries int64 = 4 h := []float64{0, 0.1} var gamma float64 = 0.03 /* Fill in F storage */ checkOk(task.PutAfeFEntryList(numEntries, Fsubi, Fsubj, Fval)) /* Fill in g storage */ checkOk(task.PutAfeG(0, gamma)) checkOk(task.PutAfeGSlice(1, k+1, h)) } /* Define a conic quadratic domain */ quadDom, r := task.AppendQuadraticConeDomain(k + 1) checkOk(r) { /* Create the ACC */ afeidx := []int64{0, 1, 2} checkOk(task.AppendAcc(quadDom, k+1, afeidx, nil)) } /* Begin optimization and fetching the solution */ trmcode, r := task.OptimizeTrm() checkOk(r) /* Print a summary containing information about the solution for debugging purposes*/ task.SolutionSummary(gmsk.STREAM_LOG) // use stream log and direct it to stderr solsta, r := task.GetSolSta(gmsk.SOL_ITR) checkOk(r) switch solsta { case gmsk.SOL_STA_OPTIMAL: /* Fetch the solution */ xx := make([]float64, n) xx, r = task.GetXx( gmsk.SOL_ITR, /* Request the interior solution. */ xx) checkOk(r) fmt.Println("Optimal primal solution") for j := int32(0); j < n; j++ { fmt.Printf("x[%d]: %e\n", j, xx[j]) } /* Fetch the doty dual of the ACC */ doty := make([]float64, k+1) doty, r = task.GetAccDotY( gmsk.SOL_ITR, /* Request the interior solution. */ 0, /* ACC index. */ doty) checkOk(r) fmt.Println("Dual doty of the ACC") for j := int64(0); j < k+1; j++ { fmt.Printf("doty[%d]: %e\n", j, doty[j]) } /* Fetch the activity of the ACC */ activity := make([]float64, k+1) activity, r = task.EvaluateAcc( gmsk.SOL_ITR, /* Request the interior solution. */ 0, /* ACC index. */ activity) checkOk(r) fmt.Println("Activity of the ACC") for j := int64(0); j < k+1; j++ { fmt.Printf("activity[%d]: %e\n", j, activity[j]) } case gmsk.SOL_STA_DUAL_INFEAS_CER: fallthrough case gmsk.SOL_STA_PRIM_INFEAS_CER: fmt.Println("Primal or dual infeasibility certificate found.") case gmsk.SOL_STA_UNKNOWN: fmt.Printf("The status of the solution could not be determined. Termination code: %d.\n", trmcode) default: fmt.Println("Other solution status.") } }
Output: Optimal primal solution x[0]: -7.838011e-02 x[1]: 1.128913e+00 x[2]: -5.053279e-02 Dual doty of the ACC doty[0]: -1.942968e+00 doty[1]: -3.030303e-01 doty[2]: -1.919192e+00 Activity of the ACC activity[0]: 3.000000e-02 activity[1]: -4.678877e-03 activity[2]: -2.963289e-02
Example (AffineConicConstraints_acc2) ¶
Affine conic constraints example 2, reproduced from acc2.c in MOSEK C Api.
Purpose : Tutorial example for affine conic constraints.
Models the problem:
maximize c^T x
subject to sum(x) = 1
gamma >= |Gx+h|_2
This version inputs the linear constraint as an affine conic constraint.
package main import ( "fmt" "log" "os" "github.com/fardream/gmsk" ) func main() { var r error /* Input data dimensions */ var n int32 = 3 var k int64 = 2 /* Create the mosek environment. */ env, err := gmsk.MakeEnv() if err != nil { log.Fatal(err) } defer gmsk.DeleteEnv(env) /* Create the optimization task. */ task, err := gmsk.MakeTask(env, 0, 0) if err != nil { log.Fatal(err) } defer gmsk.DeleteTask(task) checkOk := func(err error) { if err != nil { log.Fatalf("failed: %s", err.Error()) } } checkOk(task.LinkFuncToTaskStream(gmsk.STREAM_LOG, os.Stderr)) /* Create n free variables */ checkOk(task.AppendVars(n)) checkOk(task.PutVarBoundSliceConst(0, n, gmsk.BK_FR, -gmsk.INFINITY, gmsk.INFINITY)) /* Set up the objective */ { c := []float64{2.0, 3.0, -1.0} checkOk(task.PutCSlice(0, n, c)) checkOk(task.PutObjSense(gmsk.OBJECTIVE_SENSE_MAXIMIZE)) } { /* Set AFE rows representing the linear constraint */ checkOk(task.AppendAfes(1)) for i := int32(0); i < n && r == nil; i++ { r = task.PutAfeFEntry(0, i, 1) } checkOk(r) checkOk(task.PutAfeG(0, -1)) } { /* Set AFE rows representing the quadratic constraint */ /* F matrix in sparse form */ Fsubi := []int64{2, 2, 3, 3} /* G is placed from row 2 of F */ Fsubj := []int32{0, 1, 0, 2} Fval := []float64{1.5, 0.1, 0.3, 2.1} var numEntries int64 = 4 /* Other data */ h := []float64{0, 0.1} var gamma float64 = 0.03 checkOk(task.AppendAfes(k + 1)) checkOk(task.PutAfeFEntryList(numEntries, Fsubi, Fsubj, Fval)) checkOk(task.PutAfeG(1, gamma)) checkOk(task.PutAfeGSlice(2, k+2, h)) } zeroDom, r := task.AppendRzeroDomain(1) checkOk(r) /* Define a conic quadratic domain */ quadDom, r := task.AppendQuadraticConeDomain(k + 1) checkOk(r) /* Append affine conic constraints */ { /* Linear constraint */ afeidx := []int64{0} checkOk(task.AppendAcc( zeroDom, /* Domain index */ 1, /* Dimension */ afeidx, /* Indices of AFE rows */ nil), /* Ignored */ ) } { /* Quadratic constraint */ afeidx := []int64{1, 2, 3} checkOk(task.AppendAcc( quadDom, /* Domain index */ k+1, /* Dimension */ afeidx, /* Indices of AFE rows */ nil), /* Ignored */ ) } /* Begin optimization and fetching the solution */ trmcode, r := task.OptimizeTrm() checkOk(r) /* Print a summary containing information about the solution for debugging purposes*/ task.SolutionSummary(gmsk.STREAM_LOG) // use stream log and direct it to stderr solsta, r := task.GetSolSta(gmsk.SOL_ITR) checkOk(r) switch solsta { case gmsk.SOL_STA_OPTIMAL: /* Fetch the primal solution */ xx := make([]float64, n) xx, r = task.GetXx( gmsk.SOL_ITR, /* Request the interior solution. */ xx) checkOk(r) fmt.Println("Optimal primal solution") for j := int32(0); j < n; j++ { fmt.Printf("x[%d]: %e\n", j, xx[j]) } /* Fetch the doty dual of the ACC */ doty := make([]float64, k+1) doty, r = task.GetAccDotY( gmsk.SOL_ITR, /* Request the interior solution. */ 1, /* ACC index of quadratic ACC. */ doty) checkOk(r) fmt.Println("Dual doty of the ACC") for j := int64(0); j < k+1; j++ { fmt.Printf("doty[%d]: %e\n", j, doty[j]) } /* Fetch the activity of the ACC */ activity := make([]float64, k+1) activity, r = task.EvaluateAcc( gmsk.SOL_ITR, /* Request the interior solution. */ 1, /* ACC index. */ activity) checkOk(r) fmt.Println("Activity of the ACC") for j := int64(0); j < k+1; j++ { fmt.Printf("activity[%d]: %e\n", j, activity[j]) } case gmsk.SOL_STA_DUAL_INFEAS_CER: fallthrough case gmsk.SOL_STA_PRIM_INFEAS_CER: fmt.Println("Primal or dual infeasibility certificate found.") case gmsk.SOL_STA_UNKNOWN: fmt.Printf("The status of the solution could not be determined. Termination code: %d.\n", trmcode) default: fmt.Println("Other solution status.") } }
Output: Optimal primal solution x[0]: -7.838011e-02 x[1]: 1.128913e+00 x[2]: -5.053279e-02 Dual doty of the ACC doty[0]: -1.942968e+00 doty[1]: -3.030303e-01 doty[2]: -1.919192e+00 Activity of the ACC activity[0]: 3.000000e-02 activity[1]: -4.678877e-03 activity[2]: -2.963289e-02
Example (Blas_lapack) ¶
Example on how to use included BLAS/LAPACK routines in MOSEK, reproduced from blas_lapack.c in MOSEK C api.
package main import ( "fmt" "log" "github.com/fardream/gmsk" ) func main() { print_matrix := func(s []float64, r, c int32) { var i, j int32 for i = 0; i < r; i++ { for j = 0; j < c; j++ { if j >= c-1 { fmt.Printf("%f\n", s[j*r+i]) } else { fmt.Printf("%f ", s[j*r+i]) } } } } errToCode := func(r error) gmsk.ResCode { me, ok := gmsk.AsMskError(r) if ok && me != nil { return me.ToResCode() } return gmsk.RES_OK } var r error const n, m, k int32 = 3, 2, 3 const alpha, beta float64 = 2.0, 0.5 x := []float64{1.0, 1.0, 1.0} y := []float64{1.0, 2.0, 3.0} z := []float64{1.0, 1.0} A := []float64{1.0, 1.0, 2.0, 2.0, 3.0, 3.0} B := []float64{1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0} C := []float64{1.0, 2.0, 3.0, 4.0, 5.0, 6.0} D := []float64{1.0, 1.0, 1.0, 1.0} Q := []float64{1.0, 0.0, 0.0, 2.0} v := []float64{0.0, 0.0, 0.0} var xy float64 /* BLAS routines*/ env, err := gmsk.MakeEnv() if err != nil { log.Panic(err) } defer gmsk.DeleteEnv(env) fmt.Printf("n=%d m=%d k=%d\n", m, n, k) fmt.Printf("alpha=%f\n", alpha) fmt.Printf("beta=%f\n", beta) xy, r = env.Dot(n, x, y) fmt.Printf("dot results= %f r=%d\n", xy, errToCode(r)) print_matrix(x, 1, n) print_matrix(y, 1, n) r = env.Axpy(n, alpha, x, y) fmt.Println("axpy results is") print_matrix(y, 1, n) r = env.Gemv(gmsk.TRANSPOSE_NO, m, n, alpha, A, x, beta, z) fmt.Printf("gemv results is (r=%d)\n", errToCode(r)) print_matrix(z, 1, m) r = env.Gemm(gmsk.TRANSPOSE_NO, gmsk.TRANSPOSE_NO, m, n, k, alpha, A, B, beta, C) fmt.Printf("gemm results is (r=%d)\n", errToCode(r)) print_matrix(C, m, n) r = env.Syrk(gmsk.UPLO_LO, gmsk.TRANSPOSE_NO, m, k, 1., A, beta, D) fmt.Printf("syrk results is (r=%d)\n", errToCode(r)) print_matrix(D, m, m) /* LAPACK routines*/ r = env.Potrf(gmsk.UPLO_LO, m, Q) fmt.Printf("potrf results is (r=%d)\n", errToCode(r)) print_matrix(Q, m, m) r = env.Syeig(gmsk.UPLO_LO, m, Q, v) fmt.Printf("syeig results is (r=%d)\n", errToCode(r)) print_matrix(v, 1, m) r = env.Syevd(gmsk.UPLO_LO, m, Q, v) fmt.Printf("syevd results is (r=%d)\n", errToCode(r)) print_matrix(v, 1, m) print_matrix(Q, m, m) }
Output: n=2 m=3 k=3 alpha=2.000000 beta=0.500000 dot results= 6.000000 r=0 1.000000 1.000000 1.000000 1.000000 2.000000 3.000000 axpy results is 3.000000 4.000000 5.000000 gemv results is (r=0) 12.500000 12.500000 gemm results is (r=0) 12.500000 13.500000 14.500000 13.000000 14.000000 15.000000 syrk results is (r=0) 14.500000 1.000000 14.500000 14.500000 potrf results is (r=0) 1.000000 0.000000 0.000000 1.414214 syeig results is (r=0) 1.000000 1.414214 syevd results is (r=0) 1.000000 1.414214 1.000000 0.000000 0.000000 1.000000
Example (ConicExponentialOptimization1_ceo1) ¶
Conic exponential optimization, reproduced from ceo1.c in MOSEK C api.
package main import ( "fmt" "log" "os" "github.com/fardream/gmsk" ) func main() { checkOk := func(err error) { if err != nil { log.Fatalf("failed: %s", err.Error()) } } var r error const numvar, numcon int32 = 3, 1 const numafe, f_nnz int64 = 3, 3 bkc := gmsk.BK_FX blc := 1.0 buc := 1.0 bkx := []gmsk.BoundKey{ gmsk.BK_FR, gmsk.BK_FR, gmsk.BK_FR, } blx := []float64{ -gmsk.INFINITY, -gmsk.INFINITY, -gmsk.INFINITY, } bux := []float64{ gmsk.INFINITY, gmsk.INFINITY, gmsk.INFINITY, } c := []float64{ 1, 1, 0, } a := []float64{1, 1, 1} asub := []int32{0, 1, 2} afeidx := []int64{0, 1, 2} varidx := []int32{0, 1, 2} f_val := []float64{1, 1, 1} var domidx int64 = 0 /* Create the mosek environment. */ env, err := gmsk.MakeEnv() if err != nil { log.Panic(err) } defer gmsk.DeleteEnv(env) /* Create the optimization task. */ task, err := env.MakeTask(numcon, numvar) if err != nil { log.Panic(err) } defer gmsk.DeleteTask(task) checkOk(task.LinkFuncToTaskStream(gmsk.STREAM_LOG, os.Stderr)) /* Append 'numcon' empty constraints. The constraints will initially have no bounds. */ checkOk(task.AppendCons(numcon)) /* Append 'numvar' variables. The variables will initially be fixed at zero (x=0). */ checkOk(task.AppendVars(numvar)) /* Append 'numafe' affine expressions. The affine expressions will initially be empty. */ checkOk(task.AppendAfes(numafe)) /* Set up the linear part */ checkOk(task.PutCSlice(0, numvar, c)) checkOk(task.PutARow(0, numvar, asub, a)) checkOk(task.PutConBound(0, bkc, blc, buc)) checkOk(task.PutVarBoundSlice(0, numvar, bkx, blx, bux)) checkOk(task.PutAfeFEntryList(f_nnz, afeidx, varidx, f_val)) domidx, r = task.AppendPrimalExpConeDomain() checkOk(r) checkOk(task.AppendAccSeq(domidx, numafe, 0, nil)) /* Run optimizer */ trmcode, r := task.OptimizeTrm() /* Print a summary containing information about the solution for debugging purposes*/ task.SolutionSummary(gmsk.STREAM_LOG) checkOk(r) solsta, r := task.GetSolSta(gmsk.SOL_ITR) checkOk(r) switch solsta { case gmsk.SOL_STA_OPTIMAL: xx, r := task.GetXx(gmsk.SOL_ITR, nil) if r != nil { checkOk(gmsk.NewErrorFromInt(gmsk.RES_ERR_SPACE)) } fmt.Printf("Optimal primal solution\n") for j := 0; j < 3; j++ { fmt.Printf("x[%d]: %e\n", j, xx[j]) } case gmsk.SOL_STA_DUAL_INFEAS_CER: fallthrough case gmsk.SOL_STA_PRIM_INFEAS_CER: fmt.Printf("Primal or dual infeasibility certificate found.\n") case gmsk.SOL_STA_UNKNOWN: fmt.Printf("The status of the solution could not be determined. Termination code: %d.\n", trmcode) default: fmt.Printf("Other solution status.\n") } }
Output: Optimal primal solution x[0]: 6.117883e-01 x[1]: 1.704000e-01 x[2]: 2.178117e-01
Example (ConicQuadraticOptimization1_cqo1) ¶
Conic Quadratic Optimization, reproduced from cqo1.c in MOSEK example.
package main import ( "fmt" "log" "os" "github.com/fardream/gmsk" ) func main() { checkOk := func(err error) { if err != nil { log.Fatalf("failed: %s", err.Error()) } } var r error const ( numvar = int32(6) numcon = int32(1) numafe = int64(6) numacc = int64(2) f_nnz = int64(6) ) bkc := []gmsk.BoundKey{gmsk.BK_FX} blc := []float64{1} buc := []float64{1} bkx := []gmsk.BoundKey{ gmsk.BK_LO, gmsk.BK_LO, gmsk.BK_LO, gmsk.BK_FR, gmsk.BK_FR, gmsk.BK_FR, } blx := []float64{ 0.0, 0.0, 0.0, -gmsk.INFINITY, -gmsk.INFINITY, -gmsk.INFINITY, } bux := []float64{ +gmsk.INFINITY, +gmsk.INFINITY, +gmsk.INFINITY, +gmsk.INFINITY, +gmsk.INFINITY, +gmsk.INFINITY, } c := []float64{ 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, } var ( aptrb = []int32{0, 1, 2, 3, 3, 3} aptre = []int32{1, 2, 3, 3, 3, 3} asub = []int32{0, 0, 0, 0} aval = []float64{1, 1, 2} ) var ( afeidx = []int64{0, 1, 2, 3, 4, 5} varidx = []int32{3, 0, 1, 4, 5, 2} f_val = []float64{1, 1, 1, 1, 1, 1} ) domidx := []int64{0, 0} /* Create the mosek environment. */ env, err := gmsk.MakeEnv() if err != nil { log.Fatal(err) } defer gmsk.DeleteEnv(env) /* Create the optimization task. */ task, err := gmsk.MakeTask(env, numcon, numvar) if err != nil { log.Fatal(err) } defer gmsk.DeleteTask(task) checkOk(task.LinkFuncToTaskStream(gmsk.STREAM_LOG, os.Stderr)) /* Append 'numcon' empty constraints. The constraints will initially have no bounds. */ checkOk(task.AppendCons(numcon)) /* Append 'numvar' variables. The variables will initially be fixed at zero (x=0). */ checkOk(task.AppendVars(numvar)) /* Append 'numafe' affine expressions. The affine expressions will initially be empty. */ checkOk(task.AppendAfes(numafe)) for j := int32(0); j < numvar && r == nil; j++ { /* Set the linear term c_j in the objective.*/ r = task.PutCJ(j, c[j]) checkOk(r) /* Set the bounds on variable j. blx[j] <= x_j <= bux[j] */ r = task.PutVarBound( j, /* Index of variable.*/ bkx[j], /* Bound key.*/ blx[j], /* Numerical value of lower bound.*/ bux[j]) /* Numerical value of upper bound.*/ checkOk(r) if aptre[j] > aptrb[j] { // looks like go will check if the index is out of range. /* Input column j of A */ r = task.PutACol( j, /* Variable (column) index.*/ aptre[j]-aptrb[j], /* Number of non-zeros in column j.*/ asub[aptrb[j]:aptre[j]], /* Pointer to row indexes of column j.*/ aval[aptrb[j]:aptre[j]]) /* Pointer to Values of column j.*/ } } /* Set the bounds on constraints. for i=1, ...,numcon : blc[i] <= constraint i <= buc[i] */ for i := int32(0); i < numcon && r == nil; i++ { r = task.PutConBound( i, /* Index of constraint.*/ bkc[i], /* Bound key.*/ blc[i], /* Numerical value of lower bound.*/ buc[i]) /* Numerical value of upper bound.*/ } checkOk(r) /* Set the non-zero entries of the F matrix */ checkOk(task.PutAfeFEntryList(f_nnz, afeidx, varidx, f_val)) /* Append quadratic cone domain */ domidx[0], r = task.AppendQuadraticConeDomain(3) checkOk(r) /* Append rotated quadratic cone domain */ domidx[1], r = task.AppendRQuadraticConeDomain(3) checkOk(r) /* Append two ACCs made up of the AFEs and the domains defined above. */ checkOk(task.AppendAccsSeq(numacc, domidx, numafe, afeidx[0], nil)) /* Run optimizer */ trmcode, r := task.OptimizeTrm() task.SolutionSummary(gmsk.STREAM_LOG) checkOk(r) solsta, r := task.GetSolSta(gmsk.SOL_ITR) checkOk(r) switch solsta { case gmsk.SOL_STA_OPTIMAL: xx, r := task.GetXx( gmsk.SOL_ITR, /* Request the interior solution. */ nil) if r != nil { r = gmsk.NewErrorFromInt(gmsk.RES_ERR_SPACE) break } fmt.Print("Optimal primal solution\n") for j := int32(0); j < numvar; j++ { fmt.Printf("x[%d]: %e\n", j, xx[j]) } case gmsk.SOL_STA_DUAL_INFEAS_CER: fallthrough case gmsk.SOL_STA_PRIM_INFEAS_CER: fmt.Printf("Primal or dual infeasibility certificate found.\n") case gmsk.SOL_STA_UNKNOWN: fmt.Printf("The status of the solution could not be determined. Termination code: %d.\n", trmcode) default: fmt.Printf("Other solution status.\n") } }
Output: Optimal primal solution x[0]: 2.609204e-01 x[1]: 2.609204e-01 x[2]: 2.390796e-01 x[3]: 3.689972e-01 x[4]: 1.690548e-01 x[5]: 1.690548e-01
Example (DisjunctiveConstraint_djc1) ¶
Optimization with disjunctive constraints, reproduced from djc1.c in MOSEK C api.
Purpose: Demonstrates how to solve the problem with two disjunctions: minimize 2x0 + x1 + 3x2 + x3 subject to x0 + x1 + x2 + x3 >= -10 (x0-2x1<=-1 and x2=x3=0) or (x2-3x3<=-2 and x1=x2=0) x0=2.5 or x1=2.5 or x2=2.5 or x3=2.5
package main import ( "fmt" "log" "os" "github.com/fardream/gmsk" ) func main() { checkOk := func(err error) { if err != nil { log.Fatalf("failed: %s", err.Error()) } } var r error var j, numvar int32 var numafe, numdjc int64 var zero1, zero2, rminus1 int64 // Domain indices /* Create the mosek environment. */ env, err := gmsk.MakeEnv() if err != nil { log.Panic(err) } defer gmsk.DeleteEnv(env) /* Create the optimization task. */ task, err := env.MakeTask(0, 0) if err != nil { log.Panic(err) } defer gmsk.DeleteTask(task) // Append free variables numvar = 4 checkOk(task.AppendVars(numvar)) checkOk(task.PutVarBoundSliceConst(0, numvar, gmsk.BK_FR, -gmsk.INFINITY, gmsk.INFINITY)) { // The linear part: the linear constraint idx := []int32{0, 1, 2, 3} val := []float64{1, 1, 1, 1} checkOk(task.AppendCons(1)) checkOk(task.PutARow(0, 4, idx, val)) checkOk(task.PutConBound(0, gmsk.BK_LO, -10, -10)) } { // The linear part: objective idx := []int32{0, 1, 2, 3} val := []float64{2, 1, 3, 1} checkOk(task.PutObjSense(gmsk.OBJECTIVE_SENSE_MINIMIZE)) checkOk(task.PutCList(4, idx, val)) } // Fill in the affine expression storage F, g numafe = 10 checkOk(task.AppendAfes(numafe)) fafeidx := []int64{0, 0, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9} fvaridx := []int32{0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3} fval := []float64{1.0, -2.0, 1.0, -3.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0} g := []float64{1.0, 2.0, 0.0, 0.0, 0.0, 0.0, -2.5, -2.5, -2.5, -2.5} checkOk(task.PutAfeFEntryList(12, fafeidx, fvaridx, fval)) checkOk(task.PutAfeGSlice(0, numafe, g)) // Create domains zero1, r = task.AppendRzeroDomain(1) checkOk(r) zero2, r = task.AppendRzeroDomain(2) checkOk(r) rminus1, r = task.AppendRminusDomain(1) checkOk(r) // Append disjunctive constraints numdjc = 2 checkOk(task.AppendDjcs(numdjc)) { // First disjunctive constraint domidxlist := []int64{rminus1, zero2, rminus1, zero2} afeidxlist := []int64{0, 4, 5, 1, 2, 3} termsizelist := []int64{2, 2} checkOk(task.PutDjc( 0, // DJC index 4, domidxlist, 6, afeidxlist, nil, // Unused 2, termsizelist)) } { // Second disjunctive constraint domidxlist := []int64{zero1, zero1, zero1, zero1} afeidxlist := []int64{6, 7, 8, 9} termsizelist := []int64{1, 1, 1, 1} checkOk(task.PutDjc( 1, // DJC index 4, domidxlist, 4, afeidxlist, nil, // Unused 4, termsizelist)) } // Useful for debugging { // Write a human-readable file checkOk(task.WriteDataHandle(os.Stderr, gmsk.DATA_FORMAT_PTF, gmsk.COMPRESS_NONE)) // Directs the log task stream to the 'printstr' function. checkOk(task.LinkFuncToTaskStream(gmsk.STREAM_LOG, os.Stderr)) } // Solve the problem _, r = task.OptimizeTrm() checkOk(r) /* Print a summary containing information about the solution for debugging purposes. */ task.SolutionSummary(gmsk.STREAM_LOG) solsta, r := task.GetSolSta(gmsk.SOL_ITG) checkOk(r) switch solsta { case gmsk.SOL_STA_INTEGER_OPTIMAL: xx := make([]float64, numvar) xx, r = task.GetXx(gmsk.SOL_ITG, xx) fmt.Printf("Optimal primal solution\n") for j = 0; j < numvar; j++ { fmt.Printf("x[%d]: %e\n", j, xx[j]) } default: fmt.Printf("Another solution status.\n") } }
Output: Optimal primal solution x[0]: 0.000000e+00 x[1]: 0.000000e+00 x[2]: -1.250000e+01 x[3]: 2.500000e+00
Example (GeometricProgram1_gp1) ¶
Example of geometric program with exponential cones and log-sum-exp, reproduced from gp1.c in MOSEK C api.
maximize h*w*d subjecto to 2*(h*w + h*d) <= Awall w*d <= Afloor alpha <= h/w <= beta gamma <= d/w <= delta Variable substitutions: h = exp(x), w = exp(y), d = exp(z). maximize x+y+z subject log( exp(x+y+log(2/Awall)) + exp(x+z+log(2/Awall)) ) <= 0 y+z <= log(Afloor) log( alpha ) <= x-y <= log( beta ) log( gamma ) <= z-y <= log( delta )
package main import ( "fmt" "log" "math" "os" "github.com/fardream/gmsk" ) func main() { checkOk := func(err error) { if err != nil { log.Fatalf("failed: %s", err.Error()) } } var r error const Aw float64 = 200.0 const Af float64 = 50.0 const alpha float64 = 2.0 const beta float64 = 10.0 const gamma float64 = 2.0 // const delta float64 = 10.0 hwd := [3]float64{} // max_volume_box - begin ------------------------------------------------ // Basic dimensions of our problem const numvar int32 = 3 // Variables in original problem const numcon int32 = 3 // Linear constraints in original problem // Linear part of the problem involving x, y, z cval := []float64{1, 1, 1} asubi := []int32{0, 0, 1, 1, 2, 2} asubj := []int32{1, 2, 0, 1, 2, 1} const alen int32 = 6 aval := []float64{1, 1, 1, -1, 1, -1} bkc := []gmsk.BoundKey{gmsk.BK_UP, gmsk.BK_RA, gmsk.BK_RA} blc := []float64{-gmsk.INFINITY, math.Log(alpha), math.Log(gamma)} buc := []float64{math.Log(Af), math.Log(beta), math.Log(beta)} // Affine conic constraint data of the problem var expdomidx, rzerodomidx int64 const numafe, f_nnz int64 = 6, 8 afeidx := [8]int64{0, 1, 2, 2, 3, 3, 5, 5} varidx := [8]int32{3, 4, 0, 1, 0, 2, 3, 4} f_val := [8]float64{1, 1, 1, 1, 1, 1, 1, 1} g := [6]float64{0, 0, math.Log(2 / Aw), math.Log(2 / Aw), 1, -1} xyz := make([]float64, 3) task, err := gmsk.MakeTask(nil, 0, 0) if err != nil { log.Panic(err) } defer gmsk.DeleteTask(task) checkOk(task.LinkFuncToTaskStream(gmsk.STREAM_LOG, os.Stderr)) checkOk(task.AppendVars(numvar)) checkOk(task.AppendCons(numcon)) checkOk(task.AppendAfes(numafe)) // Objective is the sum of three first variables checkOk(task.PutObjSense(gmsk.OBJECTIVE_SENSE_MAXIMIZE)) checkOk(task.PutCSlice(0, numvar, cval)) checkOk(task.PutVarBoundSliceConst(0, numvar, gmsk.BK_FR, -gmsk.INFINITY, gmsk.INFINITY)) // Add the three linear constraints checkOk(task.PutAijList(alen, asubi, asubj, aval)) checkOk(task.PutConBoundSlice(0, numvar, bkc, blc, buc)) acc1_afeidx := []int64{0, 4, 2} acc2_afeidx := []int64{1, 4, 3} acc3_afeidx := []int64{5} // Affine expressions appearing in affine conic constraints // in this order: // u1, u2, x+y+log(2/Awall), x+z+log(2/Awall), 1.0, u1+u2-1.0 checkOk(task.AppendVars(2)) checkOk(task.PutVarBoundSliceConst(numvar, numvar+2, gmsk.BK_FR, -gmsk.INFINITY, gmsk.INFINITY)) checkOk(task.PutAfeFEntryList(f_nnz, afeidx[:], varidx[:], f_val[:])) checkOk(task.PutAfeGSlice(0, numafe, g[:])) /* Append the primal exponential cone domain */ expdomidx, r = task.AppendPrimalExpConeDomain() checkOk(r) /* (u1, 1, x+y+log(2/Awall)) \in EXP */ checkOk(task.AppendAcc(expdomidx, 3, acc1_afeidx, nil)) /* (u2, 1, x+z+log(2/Awall)) \in EXP */ checkOk(task.AppendAcc(expdomidx, 3, acc2_afeidx, nil)) /* The constraint u1+u2-1 \in \ZERO is added also as an ACC */ rzerodomidx, r = task.AppendRzeroDomain(1) checkOk(r) checkOk(task.AppendAcc(rzerodomidx, 1, acc3_afeidx, nil)) // Solve and map to original h, w, d trmcode, r := task.OptimizeTrm() checkOk(r) solsta, r := task.GetSolSta(gmsk.SOL_ITR) checkOk(r) if solsta != gmsk.SOL_STA_OPTIMAL { fmt.Printf("Solution not optimal, termination code %d.\n", trmcode) checkOk(gmsk.NewError(trmcode)) } xyz, r = task.GetXxSlice(gmsk.SOL_ITR, 0, numvar, xyz) checkOk(r) for i := 0; i < int(numvar); i++ { hwd[i] = math.Exp(xyz[i]) } // max_volume_box - end ------------------------------------------------ fmt.Printf("Solution h=%.4f w=%.4f d=%.4f\n", hwd[0], hwd[1], hwd[2]) }
Output: Solution h=8.1639 w=4.0819 d=8.1671
Example (Helloworld) ¶
This is reproduced from MOSEK C example hellowworld.c However, the response code is checked here.
package main import ( "fmt" "log" "github.com/fardream/gmsk" ) func main() { checkOk := func(err error) { if err != nil { log.Fatalf("failed: %s", err.Error()) } } task, err := gmsk.MakeTask(nil, 0, 0) if err != nil { log.Fatal(err) } defer gmsk.DeleteTask(task) checkOk(task.AppendVars(1)) checkOk(task.PutCJ(0, 1.0)) checkOk(task.PutVarBound(0, gmsk.BK_RA, 2.0, 3.0)) checkOk(task.PutObjSense(gmsk.OBJECTIVE_SENSE_MINIMIZE)) _, res := task.OptimizeTrm() checkOk(res) result := make([]float64, 1) result, res = task.GetXx(gmsk.SOL_ITR, result) fmt.Printf("Solution x = %.6f\n", result[0]) }
Output: Solution x = 2.000000
Example (LinearOptimization1_lo1) ¶
Linear programming example 1, reproduced from mosek c api example lo1.c
package main import ( "fmt" "log" "os" "github.com/fardream/gmsk" ) func main() { const numvar, numcon int32 = 4, 3 c := []float64{3.0, 1.0, 5.0, 1.0} /* Below is the sparse representation of the A matrix stored by column. */ aptrb := []int32{0, 2, 5, 7} aptre := []int32{2, 5, 7, 9} asub := []int32{ 0, 1, 0, 1, 2, 0, 1, 1, 2, } aval := []float64{ 3, 2, 1, 1, 2, 2, 3, 1, 3, } /* Bounds on constraints. */ bkc := []gmsk.BoundKey{gmsk.BK_FX, gmsk.BK_LO, gmsk.BK_UP} blc := []float64{30, 15, -gmsk.INFINITY} buc := []float64{30, gmsk.INFINITY, 25} /* Bounds on variables. */ bkx := []gmsk.BoundKey{gmsk.BK_LO, gmsk.BK_RA, gmsk.BK_LO, gmsk.BK_LO} blx := []float64{0, 0, 0, 0} bux := []float64{gmsk.INFINITY, 10, gmsk.INFINITY, gmsk.INFINITY} checkOk := func(err error) { if err != nil { log.Fatalf("failed: %s", err.Error()) } } var r error /* Create the optimization task. */ task, err := gmsk.MakeTask(nil, numcon, numvar) if err != nil { log.Fatal(err) } defer gmsk.DeleteTask(task) /* Directs the log task stream to the 'printstr' function. */ // Note here use os.Stderr to prevent the example from failing task.LinkFuncToTaskStream(gmsk.STREAM_LOG, os.Stderr) /* Append 'numcon' empty constraints. The constraints will initially have no bounds. */ checkOk(task.AppendCons(numcon)) /* Append 'numvar' variables. The variables will initially be fixed at zero (x=0). */ checkOk(task.AppendVars(numvar)) for j := int32(0); j < numvar && r == nil; j++ { /* Set the linear term c_j in the objective.*/ r = task.PutCJ(j, c[j]) if r != nil { break } r = task.PutVarBound( j, /* Index of variable.*/ bkx[j], /* Bound key.*/ blx[j], /* Numerical value of lower bound.*/ bux[j]) /* Numerical value of upper bound.*/ if r != nil { break } /* Input column j of A */ r = task.PutACol( j, /* Variable (column) index.*/ aptre[j]-aptrb[j], /* Number of non-zeros in column j.*/ asub[aptrb[j]:aptre[j]], /* Pointer to row indexes of column j.*/ aval[aptrb[j]:aptre[j]]) /* Pointer to Values of column j.*/ } checkOk(r) /* Set the bounds on constraints. for i=1, ...,numcon : blc[i] <= constraint i <= buc[i] */ for i := int32(0); i < numcon && r == nil; i++ { r = task.PutConBound( i, /* Index of constraint.*/ bkc[i], /* Bound key.*/ blc[i], /* Numerical value of lower bound.*/ buc[i]) /* Numerical value of upper bound.*/ } checkOk(r) /* Maximize objective function. */ checkOk(task.PutObjSense(gmsk.OBJECTIVE_SENSE_MAXIMIZE)) var trmcode gmsk.ResCode /* Run optimizer */ trmcode, r = task.OptimizeTrm() checkOk(r) /* Print a summary containing information about the solution for debugging purposes. */ task.SolutionSummary(gmsk.STREAM_LOG) var solsta gmsk.SolSta solsta, r = task.GetSolSta(gmsk.SOL_BAS) switch solsta { case gmsk.SOL_STA_OPTIMAL: xx, r := task.GetXx( gmsk.SOL_BAS, /* Request the basic solution. */ nil) if r != nil { r = gmsk.NewError(gmsk.RES_ERR_SPACE) break } fmt.Print("Optimal primal solution\n") for j := int32(0); j < numvar; j++ { fmt.Printf("x[%d]: %e\n", j, xx[j]) } case gmsk.SOL_STA_DUAL_INFEAS_CER: fallthrough case gmsk.SOL_STA_PRIM_INFEAS_CER: fmt.Printf("Primal or dual infeasibility certificate found.\n") case gmsk.SOL_STA_UNKNOWN: /* If the solutions status is unknown, print the termination code indicating why the optimizer terminated prematurely. */ _, symname, _ := gmsk.GetCodedesc(trmcode) fmt.Printf("The solution status is unknown.\n") fmt.Printf("The optimizer terminitated with code: %s\n", symname) default: fmt.Printf("Other solution status.\n") } if r != nil && gmsk.IsMskError(r) { e, _ := gmsk.AsMskError(r) /* In case of an error print error code and description. */ _, symname, desc := gmsk.GetCodedesc(e.ToResCode()) fmt.Printf("Error %s - '%s'\n", symname, desc) } /* Delete the task and the associated data. */ // but we don't need to because of defer }
Output: Optimal primal solution x[0]: 0.000000e+00 x[1]: 0.000000e+00 x[2]: 1.500000e+01 x[3]: 8.333333e+00
Example (Logistic) ¶
Logistic regression example with MOSEK, reproduced from logistic.c in MOSEK C api.
package main import ( "fmt" "log" "math" "github.com/fardream/gmsk" ) func MSKCALL(r error) { if r == nil { return } log.Panicf("failed: %s", r.Error()) } // Adds ACCs for t_i >= log ( 1 + exp((1-2*y[i]) * theta' * X[i]) ) // Adds auxiliary variables, AFE rows and constraints func softplus(task *gmsk.Task, d int32, n int32, theta int32, t int32, X []float64, y []int32) error { var thetaafe, tafe, z1afe, z2afe, oneafe, expdomain int64 var z1, z2, zcon int32 subi := make([]int32, 2*n) subj := make([]int32, 3*n) aval := make([]float64, 2*n) afeidx := make([]int64, d*n+4*n) varidx := make([]int32, d*n+4*n) fval := make([]float64, d*n+4*n) idx := make([]int64, 3) var k, i, j int32 var res error nvar, res := task.GetNumVar() if res != nil { return res } ncon, res := task.GetNumCon() if res != nil { return res } nafe, res := task.GetNumAfe() if res != nil { return res } MSKCALL(task.AppendVars(2 * n)) // z1, z2 MSKCALL(task.AppendCons(n)) // z1 + z2 = 1 MSKCALL(task.AppendAfes(4 * int64(n))) // theta * X[i] - t[i], -t[i], z1[i], z2[i] z1 = nvar z2 = nvar + n zcon = ncon thetaafe = nafe tafe = nafe + int64(n) z1afe = nafe + int64(2*n) z2afe = nafe + int64(3*n) // Linear constraints k = 0 for i = 0; i < n; i++ { // z1 + z2 = 1 subi[k] = zcon + i subj[k] = z1 + i aval[k] = 1 k++ subi[k] = zcon + i subj[k] = z2 + i aval[k] = 1 k++ } MSKCALL(task.PutAijList(2*n, subi, subj, aval)) MSKCALL(task.PutConBoundSliceConst(zcon, zcon+n, gmsk.BK_FX, 1, 1)) MSKCALL(task.PutVarBoundSliceConst(nvar, nvar+2*n, gmsk.BK_FR, -gmsk.INFINITY, gmsk.INFINITY)) // Affine conic expressions k = 0 // Thetas for i = 0; i < n; i++ { for j = 0; j < d; j++ { afeidx[k] = thetaafe + int64(i) varidx[k] = theta + j if y[i] != 0 { fval[k] = -1 * X[i*d+j] } else { fval[k] = X[i*d+j] } k++ } } // -t[i] for i = 0; i < n; i++ { afeidx[k] = thetaafe + int64(i) varidx[k] = t + i fval[k] = -1 k++ afeidx[k] = tafe + int64(i) varidx[k] = t + i fval[k] = -1 k++ } // z1, z2 for i = 0; i < n; i++ { afeidx[k] = z1afe + int64(i) varidx[k] = z1 + i fval[k] = 1 k++ afeidx[k] = z2afe + int64(i) varidx[k] = z2 + i fval[k] = 1 k++ } // Add the expressions MSKCALL(task.PutAfeFEntryList(int64(d*n+4*n), afeidx, varidx, fval)) // Add a single row with the constant expression "1.0" oneafe, res = task.GetNumAfe() MSKCALL(res) MSKCALL(task.AppendAfes(1)) MSKCALL(task.PutAfeG(oneafe, 1)) // Add an exponential cone domain expdomain, res = task.AppendPrimalExpConeDomain() // Conic constraints for i = 0; i < n; i++ { idx[0] = z1afe + int64(i) idx[1] = oneafe idx[2] = thetaafe + int64(i) MSKCALL(task.AppendAcc(expdomain, 3, idx, nil)) idx[0] = z2afe + int64(i) idx[1] = oneafe idx[2] = tafe + int64(i) MSKCALL(task.AppendAcc(expdomain, 3, idx, nil)) } return res } // Model logistic regression (regularized with full 2-norm of theta) // X - n x d matrix of data points // y - length n vector classifying training points // lamb - regularization parameter func logisticRegression(env *gmsk.Env, n int32, // num samples d int32, // dimension X []float64, y []int32, lamb float64, thetaVal []float64, // result ) error { var res error var nvar int32 = 1 + d + n var r, theta, t int32 = 0, 1, 1 + d var numafe, quadDom int64 var i int32 task, err := env.MakeTask(0, 0) if err != nil { log.Panic(err) } // Variables [r; theta; t] MSKCALL(task.AppendVars(nvar)) MSKCALL(task.PutVarBoundSliceConst(0, nvar, gmsk.BK_FR, -gmsk.INFINITY, gmsk.INFINITY)) // Objective lambda*r + sum(t) MSKCALL(task.PutObjSense(gmsk.OBJECTIVE_SENSE_MINIMIZE)) MSKCALL(task.PutCJ(r, lamb)) for i = 0; i < n && res == nil; i++ { MSKCALL(task.PutCJ(t+i, 1)) } // Softplus function constraints MSKCALL(softplus(task, d, n, theta, t, X, y)) // Regularization // Append a sequence of linear expressions (r, theta) to F numafe, res = task.GetNumAfe() MSKCALL(res) MSKCALL(task.AppendAfes(1 + int64(d))) MSKCALL(task.PutAfeFEntry(numafe, r, 1.0)) for i = 0; i < d; i++ { MSKCALL(task.PutAfeFEntry(numafe+int64(i)+1, theta+i, 1.0)) } // Add the constraint quadDom, res = task.AppendQuadraticConeDomain(1 + int64(d)) MSKCALL(res) MSKCALL(task.AppendAccSeq(quadDom, int64(d)+1, numafe, nil)) _, res = task.OptimizeTrm() MSKCALL(res) MSKCALL(task.SolutionSummary(gmsk.STREAM_LOG)) _, res = task.GetXxSlice(gmsk.SOL_ITR, theta, theta+d, thetaVal) return res } // Logistic regression example with MOSEK, reproduced from logistic.c in MOSEK C api. func main() { env, err := gmsk.MakeEnv() if err != nil { log.Panic(err) } defer gmsk.DeleteEnv(env) const n int32 = 30 X := make([]float64, 6*n*n) Y := make([]int32, n*n) var i, j int32 theta := make([]float64, 6) // Test: detect and approximate a circle using degree 2 polynomials for i = 0; i < n; i++ { for j = 0; j < n; j++ { k := i*n + j var x float64 = -1.0 + 2.0*float64(i)/float64(n-1) var y float64 = -1.0 + 2.0*float64(j)/float64(n-1) X[6*k+0] = 1.0 X[6*k+1] = x X[6*k+2] = y X[6*k+3] = x * y X[6*k+4] = x * x X[6*k+5] = y * y if x*x+y*y >= 0.69 { Y[k] = 1 } else { Y[k] = 0 } } } MSKCALL(logisticRegression(env, n*n, 6, X, Y, 0.1, theta)) for i = 0; i < 6; i++ { if math.Abs(theta[i]) <= 1e-6 { theta[i] = 0 } fmt.Printf("%.2e\n", theta[i]) } }
Output: -5.37e+01 0.00e+00 0.00e+00 0.00e+00 7.72e+01 7.72e+01
Example (MixedIntegeLinearOptimization1_milo1) ¶
Example of mixed integer linear optimization, reproduced from milo1.c in MOSEK C api.
package main import ( "fmt" "log" "os" "github.com/fardream/gmsk" ) func main() { checkOk := func(err error) { if err != nil { log.Fatalf("failed: %s", err.Error()) } } var r error const numvar, numcon int32 = 2, 2 c := []float64{1, 0.64} bkc := []gmsk.BoundKey{gmsk.BK_UP, gmsk.BK_LO} blc := []float64{-gmsk.INFINITY, -4} buc := []float64{250, gmsk.INFINITY} bkx := []gmsk.BoundKey{gmsk.BK_LO, gmsk.BK_LO} blx := []float64{0, 0} bux := []float64{gmsk.INFINITY, gmsk.INFINITY} aptrb := []int32{0, 2} aptre := []int32{2, 4} asub := []int32{0, 1, 0, 1} aval := []float64{50, 3, 31, -2} var i, j int32 /* Create the mosek environment. */ env, err := gmsk.MakeEnv() if err != nil { log.Panic(err) } defer gmsk.DeleteEnv(env) /* Create the optimization task. */ task, err := env.MakeTask(0, 0) if err != nil { log.Panic(err) } defer gmsk.DeleteTask(task) checkOk(task.LinkFuncToTaskStream(gmsk.STREAM_LOG, os.Stderr)) /* Append 'numcon' empty constraints. The constraints will initially have no bounds. */ checkOk(task.AppendCons(numcon)) /* Append 'numvar' variables. The variables will initially be fixed at zero (x=0). */ checkOk(task.AppendVars(numvar)) /* Optionally add a constant term to the objective. */ checkOk(task.PutCfix(0)) for j = 0; j < numvar && r == nil; j++ { /* Set the linear term c_j in the objective.*/ checkOk(task.PutCJ(j, c[j])) /* Set the bounds on variable j. blx[j] <= x_j <= bux[j] */ checkOk(task.PutVarBound( j, /* Index of variable.*/ bkx[j], /* Bound key.*/ blx[j], /* Numerical value of lower bound.*/ bux[j])) /* Numerical value of upper bound.*/ /* Input column j of A */ if aptre[j]-aptrb[j] > 0 { r = task.PutACol( j, /* Variable (column) index.*/ aptre[j]-aptrb[j], /* Number of non-zeros in column j.*/ asub[aptrb[j]:aptre[j]], /* Pointer to row indexes of column j.*/ aval[aptrb[j]:aptre[j]]) /* Pointer to Values of column j.*/ } } checkOk(r) /* Set the bounds on constraints. for i=1, ...,numcon : blc[i] <= constraint i <= buc[i] */ for i = 0; i < numcon && r == nil; i++ { r = task.PutConBound( i, /* Index of constraint.*/ bkc[i], /* Bound key.*/ blc[i], /* Numerical value of lower bound.*/ buc[i]) /* Numerical value of upper bound.*/ } checkOk(r) /* Specify integer variables. */ for j = 0; j < numvar && r == nil; j++ { r = task.PutVarType(j, gmsk.VAR_TYPE_INT) } checkOk(r) checkOk(task.PutObjSense(gmsk.OBJECTIVE_SENSE_MAXIMIZE)) /* Set max solution time */ checkOk(task.PutDouParam(gmsk.DPAR_MIO_MAX_TIME, 60)) /* Run optimizer */ trmcode, r := task.OptimizeTrm() /* Print a summary containing information about the solution for debugging purposes*/ task.SolutionSummary(gmsk.STREAM_LOG) checkOk(r) solsta, r := task.GetSolSta(gmsk.SOL_ITG) checkOk(r) xx := make([]float64, numvar) switch solsta { case gmsk.SOL_STA_INTEGER_OPTIMAL: xx, r = task.GetXx( gmsk.SOL_ITG, /* Request the integer solution. */ xx) checkOk(r) fmt.Printf("Optimal solution.\n") for j = 0; j < numvar; j++ { if xx[j] <= 1e-6 { xx[j] = 0 } fmt.Printf("x[%d]: %e\n", j, xx[j]) } case gmsk.SOL_STA_PRIM_FEAS: /* A feasible but not necessarily optimal solution was located. */ xx, r = task.GetXx(gmsk.SOL_ITG, xx) checkOk(r) fmt.Printf("Feasible solution.\n") for j = 0; j < numvar; j++ { if xx[j] <= 1e-6 { xx[j] = 0 } fmt.Printf("x[%d]: %e\n", j, xx[j]) } case gmsk.SOL_STA_UNKNOWN: prosta, r := task.GetProSta(gmsk.SOL_ITG) checkOk(r) switch prosta { case gmsk.PRO_STA_PRIM_INFEAS_OR_UNBOUNDED: fmt.Printf("Problem status Infeasible or unbounded\n") case gmsk.PRO_STA_PRIM_INFEAS: fmt.Printf("Problem status Infeasible.\n") case gmsk.PRO_STA_UNKNOWN: fmt.Printf("Problem status unknown. Termination code %d.\n", trmcode) default: fmt.Printf("Other problem status.") } default: fmt.Printf("Other solution status.") } }
Output: Optimal solution. x[0]: 5.000000e+00 x[1]: 0.000000e+00
Example (MixedIntegerConicOptimization_mico1) ¶
Mixed integer conic optimization example, reproduced from mico1.c from MOSEK C api.
Purpose : Demonstrates how to solve a small mixed integer conic optimization problem. minimize x^2 + y^2 subject to x >= e^y + 3.8 x, y - integer
package main import ( "fmt" "log" "os" "github.com/fardream/gmsk" ) func main() { checkOk := func(err error) { if err != nil { log.Fatalf("failed: %s", err.Error()) } } var r error var numvar int32 = 3 /* x, y, t */ vart := []gmsk.VariableType{gmsk.VAR_TYPE_INT, gmsk.VAR_TYPE_INT} intsub := []int32{0, 1} env, err := gmsk.MakeEnv() if err != nil { log.Panic(err) } defer gmsk.DeleteEnv(env) task, err := env.MakeTask(0, 0) if err != nil { log.Panic(err) } defer gmsk.DeleteTask(task) checkOk(task.LinkFuncToTaskStream(gmsk.STREAM_LOG, os.Stderr)) checkOk(task.AppendVars(numvar)) checkOk(task.PutVarBoundSliceConst(0, numvar, gmsk.BK_FR, -gmsk.INFINITY, gmsk.INFINITY)) /* Integrality constraints */ checkOk(task.PutVarTypeList(2, intsub, vart)) /* Objective */ checkOk(task.PutObjSense(gmsk.OBJECTIVE_SENSE_MINIMIZE)) checkOk(task.PutCJ(2, 1.0)) /* Minimize t */ /* Set up the affine expressions */ /* x, x-3.8, y, t, 1.0 */ afeidx := []int64{0, 1, 2, 3} varidx := []int32{0, 0, 1, 2} val := []float64{1.0, 1.0, 1.0, 1.0} g := []float64{0.0, -3.8, 0.0, 0.0, 1.0} afeidxExp := []int64{1, 4, 2} afeidxQuad := []int64{3, 0, 2} checkOk(task.AppendAfes(5)) checkOk(task.PutAfeFEntryList(4, afeidx, varidx, val)) checkOk(task.PutAfeGSlice(0, 5, g)) // Add constraint (x-3.8, 1, y) \in \EXP domExp, r := task.AppendPrimalExpConeDomain() checkOk(r) checkOk(task.AppendAcc(domExp, 3, afeidxExp, nil)) // Add constraint (t, x, y) \in \QUAD domQuad, r := task.AppendQuadraticConeDomain(3) checkOk(r) checkOk(task.AppendAcc(domQuad, 3, afeidxQuad, nil)) _, r = task.OptimizeTrm() checkOk(r) xx := make([]float64, 2) xx, r = task.GetXxSlice(gmsk.SOL_ITG, 0, 2, xx) checkOk(r) fmt.Printf("x = %.2f, y = %.2f\n", xx[0], xx[1]) }
Output: x = 4.00, y = -2.00
Example (MixedIntegerProgrammingWithInitialSolution_mioinitsol) ¶
Mixed integer programming with initial solution, reproduced from mioinitsol.c in MOSEK C api.
package main import ( "fmt" "log" "os" "github.com/fardream/gmsk" ) func main() { checkOk := func(err error) { if err != nil { log.Fatalf("failed: %s", err.Error()) } } var r error const numvar int32 = 4 const numcon int32 = 1 const numintvar int32 = 3 c := []float64{7.0, 10.0, 1.0, 5.0} bkc := []gmsk.BoundKey{gmsk.BK_UP} blc := []float64{-gmsk.INFINITY} buc := []float64{2.5} bkx := []gmsk.BoundKey{gmsk.BK_LO, gmsk.BK_LO, gmsk.BK_LO, gmsk.BK_LO} blx := []float64{0.0, 0.0, 0.0, 0.0} bux := []float64{gmsk.INFINITY, gmsk.INFINITY, gmsk.INFINITY, gmsk.INFINITY} ptrb := []int32{0, 1, 2, 3} ptre := []int32{1, 2, 3, 4} asub := []int32{0, 0, 0, 0} aval := []float64{1.0, 1.0, 1.0, 1.0} intsub := []int32{0, 1, 2} var j int32 xx := make([]float64, 4) env, err := gmsk.MakeEnv() if err != nil { log.Panic(err) } defer gmsk.DeleteEnv(env) task, err := env.MakeTask(0, 0) if err != nil { log.Panic(err) } defer gmsk.DeleteTask(task) checkOk(task.LinkFuncToTaskStream(gmsk.STREAM_LOG, os.Stderr)) checkOk(task.InputData( numcon, numvar, numcon, numvar, c, 0, ptrb, ptre, asub, aval, bkc, blc, buc, bkx, blx, bux)) checkOk(task.PutObjSense(gmsk.OBJECTIVE_SENSE_MAXIMIZE)) for j = 0; j < numintvar && r == nil; j++ { r = task.PutVarType(intsub[j], gmsk.VAR_TYPE_INT) } checkOk(r) /* Assign values to integer variables (we only set a slice of xx) */ xxInit := []float64{1, 1, 0} checkOk(task.PutXxSlice(gmsk.SOL_ITG, 0, 3, xxInit)) /* Request constructing the solution from integer variable values */ checkOk(task.PutIntParam(gmsk.IPAR_MIO_CONSTRUCT_SOL, gmsk.ON)) /* solve */ _, r = task.OptimizeTrm() task.SolutionSummary(gmsk.STREAM_LOG) checkOk(r) /* Read back the solution */ xx, r = task.GetXx(gmsk.SOL_ITG, xx) checkOk(r) fmt.Printf("Solution:\n") for j = 0; j < numvar; j++ { if j == numvar-1 { fmt.Printf("%f\n", xx[j]) } else { fmt.Printf("%f ", xx[j]) } } constr, r := task.GetIntInf(gmsk.IINF_MIO_CONSTRUCT_SOLUTION) checkOk(r) constr_obj, r := task.GetDouInf(gmsk.DINF_MIO_CONSTRUCT_SOLUTION_OBJ) checkOk(r) fmt.Printf("Construct solution utilization: %d\nConstruct solution objective: %.3f\n", constr, constr_obj) }
Output: Solution: 0.000000 2.000000 0.000000 0.500000 Construct solution utilization: 1 Construct solution objective: 19.500
Example (Portfolio_1_basic) ¶
Portfolio optimization example, reproduced from portfolio_1_basic.c in MOSEK C api example.
package main import ( "fmt" "log" "os" "github.com/fardream/gmsk" ) func main() { checkOk := func(err error) { if err != nil { log.Fatalf("failed: %s", err.Error()) } } var r error const ( n int32 = 8 gamma float64 = 36 ) mu := []float64{0.07197349, 0.15518171, 0.17535435, 0.0898094, 0.42895777, 0.39291844, 0.32170722, 0.18378628} // GT must have size n rows GT := [...][8]float64{ {0.30758, 0.12146, 0.11341, 0.11327, 0.17625, 0.11973, 0.10435, 0.10638}, {0.00000, 0.25042, 0.09946, 0.09164, 0.06692, 0.08706, 0.09173, 0.08506}, {0.00000, 0.00000, 0.19914, 0.05867, 0.06453, 0.07367, 0.06468, 0.01914}, {0.00000, 0.00000, 0.00000, 0.20876, 0.04933, 0.03651, 0.09381, 0.07742}, {0.00000, 0.00000, 0.00000, 0.00000, 0.36096, 0.12574, 0.10157, 0.0571}, {0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.21552, 0.05663, 0.06187}, {0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.22514, 0.03327}, {0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.2202}, } const k int64 = 8 // this is const MSKint32t k = sizeof(GT) / (n * sizeof(MSKrealt)); x0 := []float64{8.0, 5.0, 3.0, 5.0, 2.0, 9.0, 3.0, 6.0} const w float64 = 59 // Offset of variables into the API variable. var numvar int32 = n var voff_x int32 = 0 // Constraints offsets var numcon int32 = 1 var coff_bud int32 = 0 env, err := gmsk.MakeEnv() if err != nil { log.Fatal(err) } defer gmsk.DeleteEnv(env) task, err := gmsk.MakeTask(env, 0, 0) if err != nil { log.Fatal(err) } defer gmsk.DeleteTask(task) checkOk(task.LinkFuncToTaskStream(gmsk.STREAM_LOG, os.Stderr)) // Holding variable x of length n // No other auxiliary variables are needed in this formulation checkOk(task.AppendVars(numvar)) // Setting up variable x for j := int32(0); j < n; j++ { /* Optionally we can give the variables names */ checkOk(task.PutVarName(voff_x+j, fmt.Sprintf("x[%d]", 1+j))) /* No short-selling - x^l = 0, x^u = inf */ checkOk(task.PutVarBound(voff_x+j, gmsk.BK_LO, 0, gmsk.INFINITY)) } // One linear constraint: total budget checkOk(task.AppendCons(numcon)) checkOk(task.PutConName(coff_bud, "budget")) for j := int32(0); j < n; j++ { /* Coefficients in the first row of A */ checkOk(task.PutAij(coff_bud, voff_x+j, 1)) } totalBudget := w for _, ax0 := range x0 { totalBudget += ax0 } checkOk(task.PutConBound(coff_bud, gmsk.BK_FX, totalBudget, totalBudget)) // Input (gamma, GTx) in the AFE (affine expression) storage // We need k+1 rows checkOk(task.AppendAfes(k + 1)) // The first affine expression = gamma checkOk(task.PutAfeG(0, gamma)) // The remaining k expressions comprise GT*x, we add them row by row // In more realisic scenarios it would be better to extract nonzeros and input in sparse form vslice_x := make([]int32, n) for i := int32(0); i < n; i++ { vslice_x[i] = voff_x + i } for i := int64(0); i < k; i++ { checkOk(task.PutAfeFRow(i+1, n, vslice_x, GT[i][:])) } // Input the affine conic constraint (gamma, GT*x) \in QCone // Add the quadratic domain of dimension k+1 qdom, r := task.AppendQuadraticConeDomain(k + 1) checkOk(r) // Add the constraint checkOk(task.AppendAccSeq(qdom, k+1, 0, nil)) checkOk(task.PutAccName(0, "risk")) // Objective: maximize expected return mu^T x for j := int32(0); j < n; j++ { checkOk(task.PutCJ(voff_x+j, mu[j])) } checkOk(task.PutObjSense(gmsk.OBJECTIVE_SENSE_MAXIMIZE)) /* No log output */ checkOk(task.PutIntParam(gmsk.IPAR_LOG, 0)) /* Dump the problem to a human readable PTF file. */ checkOk(task.WriteDataHandle(os.Stderr, gmsk.DATA_FORMAT_PTF, gmsk.COMPRESS_NONE)) // dump to stderr instead. _, r = task.OptimizeTrm() checkOk(r) var expret float64 for j := int32(0); j < n; j++ { xx, r := task.GetXxSlice(gmsk.SOL_ITR, voff_x+j, voff_x+j+1, nil) checkOk(r) xj := xx[0] expret += mu[j] * xj } /* Read the value of s. This should be gamma. */ fmt.Printf("\nExpected return %e for gamma %e\n", expret, gamma) }
Output: Expected return 4.192247e+01 for gamma 3.600000e+01
Example (Portfolio_2_frontier) ¶
Portfolio frontier optimization, reproduced from portfolio_2_frontier.c in MOSEK C api.
package main import ( "fmt" "log" "math" "os" "strings" "github.com/fardream/gmsk" ) func main() { checkOk := func(err error) { if err != nil { log.Fatalf("failed: %s", err.Error()) } } const n int32 = 8 mu := []float64{0.07197349, 0.15518171, 0.17535435, 0.0898094, 0.42895777, 0.39291844, 0.32170722, 0.18378628} // GT must have size n rows GT := [...][8]float64{ {0.30758, 0.12146, 0.11341, 0.11327, 0.17625, 0.11973, 0.10435, 0.10638}, {0.00000, 0.25042, 0.09946, 0.09164, 0.06692, 0.08706, 0.09173, 0.08506}, {0.00000, 0.00000, 0.19914, 0.05867, 0.06453, 0.07367, 0.06468, 0.01914}, {0.00000, 0.00000, 0.00000, 0.20876, 0.04933, 0.03651, 0.09381, 0.07742}, {0.00000, 0.00000, 0.00000, 0.00000, 0.36096, 0.12574, 0.10157, 0.0571}, {0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.21552, 0.05663, 0.06187}, {0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.22514, 0.03327}, {0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.2202}, } const k int64 = 8 // this is const MSKint32t k = sizeof(GT) / (n * sizeof(MSKrealt)); x0 := []float64{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} const w float64 = 1 alphas := []float64{0.0, 0.01, 0.1, 0.25, 0.30, 0.35, 0.4, 0.45, 0.5, 0.75, 1.0, 1.5, 2.0, 3.0, 10.0} const numalpha int32 = 15 var totalBudget float64 // Offset of variables into the API variable. const numvar int32 = n + 1 const voff_x int32 = 0 const voff_s int32 = n // Constraints offsets var numcon int32 = 1 var coff_bud int32 = 0 env, err := gmsk.MakeEnv() if err != nil { log.Fatal(err) } defer gmsk.DeleteEnv(env) task, err := gmsk.MakeTask(env, 0, 0) if err != nil { log.Fatal(err) } defer gmsk.DeleteTask(task) checkOk(task.LinkFuncToTaskStream(gmsk.STREAM_LOG, os.Stderr)) // Holding variable x of length n checkOk(task.AppendVars(numvar)) for j := int32(0); j < n; j++ { /* Optionally we can give the variables names */ checkOk(task.PutVarName(voff_x+j, fmt.Sprintf("x[%d]", 1+j))) /* No short-selling - x^l = 0, x^u = inf */ checkOk(task.PutVarBound(voff_x+j, gmsk.BK_LO, 0, gmsk.INFINITY)) } checkOk(task.PutVarName(voff_s, "s")) checkOk(task.PutVarBound(voff_s, gmsk.BK_FR, -gmsk.INFINITY, gmsk.INFINITY)) // One linear constraint: total budget checkOk(task.AppendCons(numcon)) checkOk(task.PutConName(coff_bud, "budget")) for j := int32(0); j < n; j++ { /* Coefficients in the first row of A */ checkOk(task.PutAij(coff_bud, voff_x+j, 1)) } totalBudget = w for _, x0i := range x0 { totalBudget += x0i } checkOk(task.PutConBound(coff_bud, gmsk.BK_FX, totalBudget, totalBudget)) // Input (gamma, GTx) in the AFE (affine expression) storage // We build the following F and g for variables [x, s]: // [0, 1] [0 ] // F = [0, 0], g = [0.5] // [GT,0] [0 ] // We need k+2 rows checkOk(task.AppendAfes(k + 2)) // The first affine expression is variable s (last variable, index n) checkOk(task.PutAfeFEntry(0, n, 1)) // The second affine expression is constant 0.5 checkOk(task.PutAfeG(1, 0.5)) // The remaining k expressions comprise GT*x, we add them row by row // In more realisic scenarios it would be better to extract nonzeros and input in sparse form vslice_x := make([]int32, n) for i := int32(0); i < n; i++ { vslice_x[i] = voff_x + i } for i := int64(0); i < k; i++ { checkOk(task.PutAfeFRow(i+2, n, vslice_x, GT[i][:])) } // Input the affine conic constraint (gamma, GT*x) \in QCone // Add the quadratic domain of dimension k+1 rqdom, res := task.AppendRQuadraticConeDomain(k + 2) checkOk(res) // Add the constraint checkOk(task.AppendAccSeq(rqdom, k+2, 0, nil)) checkOk(task.PutAccName(rqdom, "risk")) // Objective: maximize expected return mu^T x for j := int32(0); j < n; j++ { checkOk(task.PutCJ(voff_x+j, mu[j])) } checkOk(task.PutObjSense(gmsk.OBJECTIVE_SENSE_MAXIMIZE)) /* Set the log level */ checkOk(task.PutIntParam(gmsk.IPAR_LOG, 0)) // #define LOGLEVEL 0 fmt.Println(strings.TrimRight(fmt.Sprintf("%-12s %-12s %-12s", "alpha", "exp ret", "std. dev"), " ")) // 3rd column will be width 12, so trim right to match the below output for i := int32(0); i < numalpha; i++ { alpha := alphas[i] /* Sets the objective function coefficient for s. */ checkOk(task.PutCJ(voff_s+0, -alpha)) _, res := task.OptimizeTrm() checkOk(res) solsta, res := task.GetSolSta(gmsk.SOL_ITR) checkOk(res) if solsta != gmsk.SOL_STA_OPTIMAL { fmt.Printf("An error occurred when solving for alpha=%e\n", alpha) } var expret, stddev float64 for j := int32(0); j < n; j++ { xx, res := task.GetXxSlice(gmsk.SOL_ITR, voff_x+j, voff_x+j+1, nil) checkOk(res) xj := xx[0] expret += mu[j] * xj } stddevd, res := task.GetXxSlice(gmsk.SOL_ITR, voff_s, voff_s+1, nil) stddev = stddevd[0] fmt.Println(strings.TrimRight(fmt.Sprintf("%-12.3e %-12.3e %-12.3e", alpha, expret, math.Sqrt(float64(stddev))), " ")) // the last column will be width 12, so we need to trim to match the below output } }
Output: alpha exp ret std. dev 0.000e+00 4.290e-01 1.000e+00 1.000e-02 4.290e-01 4.152e-01 1.000e-01 4.290e-01 4.152e-01 2.500e-01 4.216e-01 3.725e-01 3.000e-01 4.175e-01 3.518e-01 3.500e-01 4.146e-01 3.386e-01 4.000e-01 4.124e-01 3.298e-01 4.500e-01 4.107e-01 3.236e-01 5.000e-01 4.093e-01 3.191e-01 7.500e-01 4.052e-01 3.083e-01 1.000e+00 4.032e-01 3.044e-01 1.500e+00 3.932e-01 2.915e-01 2.000e+00 3.847e-01 2.828e-01 3.000e+00 3.567e-01 2.632e-01 1.000e+01 2.379e-01 2.123e-01
Example (Portfolio_3_impact) ¶
Portfolio optimization example with 3/2 impact. Reproduced from portfolio_3_impact.c in MOSEK C api.
package main import ( "fmt" "log" "os" "github.com/fardream/gmsk" ) func main() { checkOk := func(err error) { if err != nil { log.Fatalf("failed: %s", err.Error()) } } const n int32 = 8 mu := []float64{0.07197, 0.15518, 0.17535, 0.08981, 0.42896, 0.39292, 0.32171, 0.18379} // GT must have size n rows GT := [...][8]float64{ {0.30758, 0.12146, 0.11341, 0.11327, 0.17625, 0.11973, 0.10435, 0.10638}, {0.00000, 0.25042, 0.09946, 0.09164, 0.06692, 0.08706, 0.09173, 0.08506}, {0.00000, 0.00000, 0.19914, 0.05867, 0.06453, 0.07367, 0.06468, 0.01914}, {0.00000, 0.00000, 0.00000, 0.20876, 0.04933, 0.03651, 0.09381, 0.07742}, {0.00000, 0.00000, 0.00000, 0.00000, 0.36096, 0.12574, 0.10157, 0.0571}, {0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.21552, 0.05663, 0.06187}, {0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.22514, 0.03327}, {0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.2202}, } const k int64 = 8 // this is const MSKint32t k = sizeof(GT) / (n * sizeof(MSKrealt)); x0 := []float64{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} const w float64 = 1 const gamma float64 = 0.36 var totalBudget float64 m := make([]float64, n) for i := int32(0); i < n; i++ { m[i] = 0.01 } // Offset of variables into the API variable. const numvar int32 = 3 * n const voff_x int32 = 0 const voff_c int32 = n const voff_z int32 = 2 * n // Offset of constraints. // const numcon int32 = 2*n + 1 const coff_bud int32 = 0 const coff_abs1 int32 = 1 const coff_abs2 int32 = 1 + n var expret float64 var res error /* Initial setup. */ env, err := gmsk.MakeEnv() if err != nil { log.Fatal(err) } defer gmsk.DeleteEnv(env) task, err := gmsk.MakeTask(env, 0, 0) if err != nil { log.Fatal(err) } defer gmsk.DeleteTask(task) checkOk(task.LinkFuncToTaskStream(gmsk.STREAM_LOG, os.Stderr)) checkOk(task.AppendVars(numvar)) for j := int32(0); j < n; j++ { /* Optionally we can give the variables names */ checkOk(task.PutVarName(voff_x+j, fmt.Sprintf("x[%d]", j+1))) checkOk(task.PutVarName(voff_c+j, fmt.Sprintf("c[%d]", j+1))) checkOk(task.PutVarName(voff_z+j, fmt.Sprintf("z[%d]", j+1))) /* Apply variable bounds (x >= 0, c and z free) */ checkOk(task.PutVarBound(voff_x+j, gmsk.BK_LO, 0, gmsk.INFINITY)) checkOk(task.PutVarBound(voff_c+j, gmsk.BK_FR, -gmsk.INFINITY, gmsk.INFINITY)) checkOk(task.PutVarBound(voff_z+j, gmsk.BK_FR, -gmsk.INFINITY, gmsk.INFINITY)) } // Linear constraints // - Total budget checkOk(task.AppendCons(1)) checkOk(task.PutConName(coff_bud, "budget")) for j := int32(0); j < n; j++ { /* Coefficients in the first row of A */ checkOk(task.PutAij(coff_bud, voff_x+j, 1)) checkOk(task.PutAij(coff_bud, voff_c+j, m[j])) } totalBudget = w for i := int32(0); i < n; i++ { totalBudget += x0[i] } checkOk(task.PutConBound(coff_bud, gmsk.BK_FX, totalBudget, totalBudget)) // - Absolute value checkOk(task.AppendCons(2 * n)) for i := int32(0); i < n; i++ { checkOk(task.PutConName(coff_abs1+i, fmt.Sprintf("zabs1[%d]", 1+i))) checkOk(task.PutAij(coff_abs1+i, voff_x+i, -1)) checkOk(task.PutAij(coff_abs1+i, voff_z+i, 1)) checkOk(task.PutConBound(coff_abs1+i, gmsk.BK_LO, -x0[i], gmsk.INFINITY)) checkOk(task.PutConName(coff_abs2+i, fmt.Sprintf("zabs2[%d]", 1+i))) checkOk(task.PutAij(coff_abs2+i, voff_x+i, 1)) checkOk(task.PutAij(coff_abs2+i, voff_z+i, 1)) checkOk(task.PutConBound(coff_abs2+i, gmsk.BK_LO, x0[i], gmsk.INFINITY)) } // ACCs const aoff_q int64 = 0 const aoff_pow int64 = k + 1 // - (gamma, GTx) in Q(k+1) // The part of F and g for variable x: // [0, 0, 0] [gamma] // F = [GT, 0, 0], g = [0 ] checkOk(task.AppendAfes(k + 1)) checkOk(task.PutAfeG(aoff_q, gamma)) vslice_x := make([]int32, n) for i := int32(0); i < n; i++ { vslice_x[i] = voff_x + i } for i := int64(0); i < k; i++ { checkOk(task.PutAfeFRow(aoff_q+i+1, n, vslice_x, GT[i][:])) } qdom, res := task.AppendQuadraticConeDomain(k + 1) checkOk(res) checkOk(task.AppendAccSeq(qdom, k+1, aoff_q, nil)) checkOk(task.PutAccName(aoff_q, "risk")) // - (c_j, 1, z_j) in P3(2/3, 1/3) // The part of F and g for variables [c, z]: // [0, I, 0] [0] // F = [0, 0, I], g = [0] // [0, 0, 0] [1] checkOk(task.AppendAfes(2*int64(n) + 1)) for i := int32(0); i < n; i++ { checkOk(task.PutAfeFEntry(aoff_pow+int64(i), voff_c+i, 1.0)) checkOk(task.PutAfeFEntry(aoff_pow+int64(n+i), voff_z+i, 1.0)) } checkOk(task.PutAfeG(aoff_pow+2*(int64(n)), 1.0)) // We use one row from F and g for both c_j and z_j, and the last row of F and g for the constant 1. // NOTE: Here we reuse the last AFE and the power cone n times, but we store them only once. exponents := []float64{2, 1} powdom, res := task.AppendPrimalPowerConeDomain(3, 2, exponents) checkOk(res) flat_afe_list := make([]int64, 3*n) dom_list := make([]int64, n) for i := int64(0); i < int64(n); i++ { flat_afe_list[3*i+0] = aoff_pow + i flat_afe_list[3*i+1] = aoff_pow + 2*int64(n) flat_afe_list[3*i+2] = aoff_pow + int64(n) + i dom_list[i] = powdom } checkOk(task.AppendAccs(int64(n), dom_list, 3*int64(n), flat_afe_list, nil)) for i := int64(0); i < int64(n); i++ { checkOk(task.PutAccName(i+1, fmt.Sprintf("market_impact[%d]", i))) } // Objective: maximize expected return mu^T x for j := int32(0); j < n; j++ { checkOk(task.PutCJ(voff_x+j, mu[j])) } checkOk(task.PutObjSense(gmsk.OBJECTIVE_SENSE_MAXIMIZE)) /* No log output */ checkOk(task.PutIntParam(gmsk.IPAR_LOG, 0)) /* Dump the problem to a human readable PTF file. */ checkOk(task.WriteDataHandle(os.Stderr, gmsk.DATA_FORMAT_PTF, gmsk.COMPRESS_NONE)) _, res = task.OptimizeTrm() /* Display the solution summary for quick inspection of results. */ checkOk(task.SolutionSummary(gmsk.STREAM_LOG)) checkOk(res) for j := int32(0); j < n; j++ { xx, res := task.GetXxSlice(gmsk.SOL_ITR, voff_x+j, voff_x+j+1, nil) checkOk(res) xj := xx[0] expret += mu[j] * xj } fmt.Printf("\nExpected return %e for gamma %e\n", expret, gamma) }
Output: Expected return 4.165712e-01 for gamma 3.600000e-01
Example (Portfolio_4_transcost) ¶
Portfolio optimization fixed setup costs and transaction costs as a mixed integer problem, reproduced from portfolio_4_transcost.c in MOSEK C api.
package main import ( "fmt" "log" "os" "github.com/fardream/gmsk" ) func main() { checkOk := func(err error) { if err != nil { log.Fatalf("failed: %s", err.Error()) } } const n int32 = 8 mu := []float64{0.07197, 0.15518, 0.17535, 0.08981, 0.42896, 0.39292, 0.32171, 0.18379} // GT must have size n rows GT := [...][8]float64{ {0.30758, 0.12146, 0.11341, 0.11327, 0.17625, 0.11973, 0.10435, 0.10638}, {0.00000, 0.25042, 0.09946, 0.09164, 0.06692, 0.08706, 0.09173, 0.08506}, {0.00000, 0.00000, 0.19914, 0.05867, 0.06453, 0.07367, 0.06468, 0.01914}, {0.00000, 0.00000, 0.00000, 0.20876, 0.04933, 0.03651, 0.09381, 0.07742}, {0.00000, 0.00000, 0.00000, 0.00000, 0.36096, 0.12574, 0.10157, 0.0571}, {0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.21552, 0.05663, 0.06187}, {0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.22514, 0.03327}, {0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.2202}, } const k int64 = 8 // this is const MSKint32t k = sizeof(GT) / (n * sizeof(MSKrealt)); x0 := []float64{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} const w float64 = 1 const gamma float64 = 0.36 f := make([]float64, n) g := make([]float64, n) for i := int32(0); i < n; i++ { f[i] = 0.01 g[i] = 0.001 } // Offset of variables const numvar int32 = 3 * n const voff_x int32 = 0 const voff_z int32 = n const voff_y int32 = 2 * n // Offset of constraints. const numcon int32 = 3*n + 1 _ = numcon // this is not used const coff_bud int32 = 0 const coff_abs1 int32 = 1 const coff_abs2 int32 = 1 + n const coff_swi int32 = 1 + 2*n var expret float64 /* Initial setup. */ env, err := gmsk.MakeEnv() if err != nil { log.Fatal(err) } defer gmsk.DeleteEnv(env) task, err := gmsk.MakeTask(env, 0, 0) if err != nil { log.Fatal(err) } defer gmsk.DeleteTask(task) checkOk(task.LinkFuncToTaskStream(gmsk.STREAM_LOG, os.Stderr)) // Variables (vector of x, z, y) checkOk(task.AppendVars(numvar)) for j := int32(0); j < n; j++ { /* Optionally we can give the variables names */ checkOk(task.PutVarName(voff_x+j, fmt.Sprintf("x[%d]", 1+j))) checkOk(task.PutVarName(voff_z+j, fmt.Sprintf("z[%d]", 1+j))) checkOk(task.PutVarName(voff_y+j, fmt.Sprintf("y[%d]", 1+j))) /* Apply variable bounds (x >= 0, z free, y binary) */ checkOk(task.PutVarBound(voff_x+j, gmsk.BK_LO, 0, gmsk.INFINITY)) checkOk(task.PutVarBound(voff_z+j, gmsk.BK_FR, -gmsk.INFINITY, gmsk.INFINITY)) checkOk(task.PutVarBound(voff_y+j, gmsk.BK_RA, 0, 1)) checkOk(task.PutVarType(voff_y+j, gmsk.VAR_TYPE_INT)) } // Linear constraints // - Total budget checkOk(task.AppendCons(1)) checkOk(task.PutConName(coff_bud, "budget")) for j := int32(0); j < n; j++ { /* Coefficients in the first row of A */ checkOk(task.PutAij(coff_bud, voff_x+j, 1)) checkOk(task.PutAij(coff_bud, voff_z+j, g[j])) checkOk(task.PutAij(coff_bud, voff_y+j, f[j])) } U := w for i := int32(0); i < n; i++ { U += x0[i] } checkOk(task.PutConBound(coff_bud, gmsk.BK_FX, U, U)) // - Absolute value checkOk(task.AppendCons(2 * n)) for i := int32(0); i < n; i++ { checkOk(task.PutConName(coff_abs1+i, fmt.Sprintf("zabs1[%d]", 1+i))) checkOk(task.PutAij(coff_abs1+i, voff_x+i, -1)) checkOk(task.PutAij(coff_abs1+i, voff_z+i, 1)) checkOk(task.PutConBound(coff_abs1+i, gmsk.BK_LO, -x0[i], gmsk.INFINITY)) checkOk(task.PutConName(coff_abs2+i, fmt.Sprintf("zabs2[%d]", 1+i))) checkOk(task.PutAij(coff_abs2+i, voff_x+i, 1)) checkOk(task.PutAij(coff_abs2+i, voff_z+i, 1)) checkOk(task.PutConBound(coff_abs2+i, gmsk.BK_LO, x0[i], gmsk.INFINITY)) } // - Switch checkOk(task.AppendCons(n)) for i := int32(0); i < n; i++ { checkOk(task.PutConName(coff_swi+i, fmt.Sprintf("switch[%d]", i+1))) checkOk(task.PutAij(coff_swi+i, voff_z+i, 1)) checkOk(task.PutAij(coff_swi+i, voff_y+i, -U)) checkOk(task.PutConBound(coff_swi+i, gmsk.BK_UP, -gmsk.INFINITY, 0)) } // ACCs const aoff_q int64 = 0 // - (gamma, GTx) in Q(k+1) // The part of F and g for variable x: // [0, 0, 0] [gamma] // F = [GT, 0, 0], g = [0 ] checkOk(task.AppendAfes(k + 1)) checkOk(task.PutAfeG(aoff_q, gamma)) vslice_x := make([]int32, n) for i := int32(0); i < n; i++ { vslice_x[i] = voff_x + i } for i := int64(0); i < k; i++ { checkOk(task.PutAfeFRow(aoff_q+i+1, n, vslice_x, GT[i][:])) } qdom, res := task.AppendQuadraticConeDomain(k + 1) checkOk(res) checkOk(task.AppendAccSeq(qdom, k+1, aoff_q, nil)) checkOk(task.PutAccName(aoff_q, "risk")) // Objective: maximize expected return mu^T x for j := int32(0); j < n; j++ { checkOk(task.PutCJ(voff_x+j, mu[j])) } checkOk(task.PutObjSense(gmsk.OBJECTIVE_SENSE_MAXIMIZE)) /* No log output */ checkOk(task.PutIntParam(gmsk.IPAR_LOG, 0)) /* Dump the problem to a human readable PTF file. */ checkOk(task.WriteDataHandle(os.Stderr, gmsk.DATA_FORMAT_PTF, gmsk.COMPRESS_NONE)) _, res = task.OptimizeTrm() /* Display the solution summary for quick inspection of results. */ checkOk(task.SolutionSummary(gmsk.STREAM_LOG)) checkOk(res) for j := int32(0); j < n; j++ { xx, res := task.GetXxSlice(gmsk.SOL_ITG, voff_x+j, voff_x+j+1, nil) checkOk(res) xj := xx[0] expret += mu[j] * xj } fmt.Printf("\nExpected return %e for gamma %e\n", expret, gamma) }
Output: Expected return 4.119046e-01 for gamma 3.600000e-01
Example (Portfolio_5_Card) ¶
Portfolio optimization with cardinality constraints on the number of assets traded, reproduced from portfolio_5_card.c in MOSEK C api.
package main import ( "fmt" "log" "os" "github.com/fardream/gmsk" ) func main() { checkOk := func(err error) { if err != nil { log.Fatalf("failed: %s", err.Error()) } } const n int32 = 8 mu := []float64{0.07197, 0.15518, 0.17535, 0.08981, 0.42896, 0.39292, 0.32171, 0.18379} // GT must have size n rows GT := [...][8]float64{ {0.30758, 0.12146, 0.11341, 0.11327, 0.17625, 0.11973, 0.10435, 0.10638}, {0.00000, 0.25042, 0.09946, 0.09164, 0.06692, 0.08706, 0.09173, 0.08506}, {0.00000, 0.00000, 0.19914, 0.05867, 0.06453, 0.07367, 0.06468, 0.01914}, {0.00000, 0.00000, 0.00000, 0.20876, 0.04933, 0.03651, 0.09381, 0.07742}, {0.00000, 0.00000, 0.00000, 0.00000, 0.36096, 0.12574, 0.10157, 0.0571}, {0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.21552, 0.05663, 0.06187}, {0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.22514, 0.03327}, {0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.2202}, } const k int64 = 8 // this is const MSKint32t k = sizeof(GT) / (n * sizeof(MSKrealt)); x0 := []float64{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} const w float64 = 1 const gamma float64 = 0.25 xx := []float64{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} markowitz_with_card := func(K int32) error { // Offset of variables const numvar int32 = 3 * n const voff_x int32 = 0 const voff_z int32 = n const voff_y int32 = 2 * n // Offset of constraints. const numcon int32 = 3*n + 2 _ = numcon // this is not used const coff_bud int32 = 0 const coff_abs1 int32 = 1 const coff_abs2 int32 = 1 + n const coff_swi int32 = 1 + 2*n const coff_card int32 = 1 + 3*n /* Initial setup. */ env, err := gmsk.MakeEnv() if err != nil { log.Fatal(err) } defer gmsk.DeleteEnv(env) task, err := gmsk.MakeTask(env, 0, 0) if err != nil { log.Fatal(err) } defer gmsk.DeleteTask(task) checkOk(task.LinkFuncToTaskStream(gmsk.STREAM_LOG, os.Stderr)) // Variables (vector of x, z, y) checkOk(task.AppendVars(numvar)) for j := int32(0); j < n; j++ { /* Optionally we can give the variables names */ checkOk(task.PutVarName(voff_x+j, fmt.Sprintf("x[%d]", 1+j))) checkOk(task.PutVarName(voff_z+j, fmt.Sprintf("z[%d]", 1+j))) checkOk(task.PutVarName(voff_y+j, fmt.Sprintf("y[%d]", 1+j))) /* Apply variable bounds (x >= 0, z free, y binary) */ checkOk(task.PutVarBound(voff_x+j, gmsk.BK_LO, 0, gmsk.INFINITY)) checkOk(task.PutVarBound(voff_z+j, gmsk.BK_FR, -gmsk.INFINITY, gmsk.INFINITY)) checkOk(task.PutVarBound(voff_y+j, gmsk.BK_RA, 0, 1)) checkOk(task.PutVarType(voff_y+j, gmsk.VAR_TYPE_INT)) } // Linear constraints // - Total budget checkOk(task.AppendCons(1)) checkOk(task.PutConName(coff_bud, "budget")) for j := int32(0); j < n; j++ { /* Coefficients in the first row of A */ checkOk(task.PutAij(coff_bud, voff_x+j, 1)) } U := w for i := int32(0); i < n; i++ { U += x0[i] } checkOk(task.PutConBound(coff_bud, gmsk.BK_FX, U, U)) // - Absolute value checkOk(task.AppendCons(2 * n)) for i := int32(0); i < n; i++ { checkOk(task.PutConName(coff_abs1+i, fmt.Sprintf("zabs1[%d]", 1+i))) checkOk(task.PutAij(coff_abs1+i, voff_x+i, -1)) checkOk(task.PutAij(coff_abs1+i, voff_z+i, 1)) checkOk(task.PutConBound(coff_abs1+i, gmsk.BK_LO, -x0[i], gmsk.INFINITY)) checkOk(task.PutConName(coff_abs2+i, fmt.Sprintf("zabs2[%d]", 1+i))) checkOk(task.PutAij(coff_abs2+i, voff_x+i, 1)) checkOk(task.PutAij(coff_abs2+i, voff_z+i, 1)) checkOk(task.PutConBound(coff_abs2+i, gmsk.BK_LO, x0[i], gmsk.INFINITY)) } // - Switch checkOk(task.AppendCons(n)) for i := int32(0); i < n; i++ { checkOk(task.PutConName(coff_swi+i, fmt.Sprintf("switch[%d]", i+1))) checkOk(task.PutAij(coff_swi+i, voff_z+i, 1)) checkOk(task.PutAij(coff_swi+i, voff_y+i, -U)) checkOk(task.PutConBound(coff_swi+i, gmsk.BK_UP, -gmsk.INFINITY, 0)) } // - Cardinality checkOk(task.AppendCons(1)) checkOk(task.PutConName(coff_card, "cardinality")) for i := int32(0); i < n; i++ { checkOk(task.PutAij(coff_card, voff_y+i, 1)) } checkOk(task.PutConBound(coff_card, gmsk.BK_UP, -gmsk.INFINITY, float64(K))) // ACCs const aoff_q int64 = 0 // - (gamma, GTx) in Q(k+1) // The part of F and g for variable x: // [0, 0, 0] [gamma] // F = [GT, 0, 0], g = [0 ] checkOk(task.AppendAfes(k + 1)) checkOk(task.PutAfeG(aoff_q, gamma)) vslice_x := make([]int32, n) for i := int32(0); i < n; i++ { vslice_x[i] = voff_x + i } for i := int64(0); i < k; i++ { checkOk(task.PutAfeFRow(aoff_q+i+1, n, vslice_x, GT[i][:])) } qdom, res := task.AppendQuadraticConeDomain(k + 1) checkOk(res) checkOk(task.AppendAccSeq(qdom, k+1, aoff_q, nil)) checkOk(task.PutAccName(aoff_q, "risk")) // Objective: maximize expected return mu^T x for j := int32(0); j < n; j++ { checkOk(task.PutCJ(voff_x+j, mu[j])) } checkOk(task.PutObjSense(gmsk.OBJECTIVE_SENSE_MAXIMIZE)) /* No log output */ checkOk(task.PutIntParam(gmsk.IPAR_LOG, 0)) /* Dump the problem to a human readable PTF file. */ checkOk(task.WriteDataHandle(os.Stderr, gmsk.DATA_FORMAT_PTF, gmsk.COMPRESS_NONE)) _, res = task.OptimizeTrm() /* Display the solution summary for quick inspection of results. */ checkOk(task.SolutionSummary(gmsk.STREAM_LOG)) checkOk(res) _, res = task.GetXxSlice(gmsk.SOL_ITG, voff_x, voff_x+n, xx) return res } for K := int32(1); K <= n; K++ { checkOk(markowitz_with_card(K)) var expret float64 = 0 fmt.Printf("Bound %d: x = ", K) for i := int32(0); i < n; i++ { fmt.Printf("%.5f ", xx[i]) expret += xx[i] * mu[i] } fmt.Printf(" Return: %.5f\n", expret) } }
Output: Bound 1: x = 0.00000 0.00000 1.00000 0.00000 0.00000 0.00000 0.00000 0.00000 Return: 0.17535 Bound 2: x = 0.00000 0.00000 0.35691 0.00000 0.00000 0.64309 0.00000 0.00000 Return: 0.31527 Bound 3: x = 0.00000 0.00000 0.19258 0.00000 0.00000 0.54592 0.26150 0.00000 Return: 0.33240 Bound 4: x = 0.00000 0.00000 0.20391 0.00000 0.06710 0.49181 0.23717 0.00000 Return: 0.33408 Bound 5: x = 0.00000 0.03197 0.17028 0.00000 0.07074 0.49551 0.23150 0.00000 Return: 0.33434 Bound 6: x = 0.00000 0.03196 0.17028 0.00000 0.07073 0.49551 0.23152 0.00000 Return: 0.33434 Bound 7: x = 0.00000 0.02703 0.16705 0.00000 0.07125 0.49559 0.22943 0.00966 Return: 0.33436 Bound 8: x = 0.00000 0.02699 0.16706 0.00000 0.07125 0.49559 0.22943 0.00969 Return: 0.33436
Example (Portfolio_6_factor) ¶
Portfolio optimization example with factor model, reproduced from portfolio_6_factor.c in MOSEK C api.
package main import ( "fmt" "log" "math" "os" "github.com/fardream/gmsk" ) func main() { checkOk := func(err error) { if err != nil { log.Fatalf("failed: %s", err.Error()) } } var res error get_nr_nc := func(m [][]float64) (nr int, nc int) { nr = len(m) if nr > 0 { nc = len(m[0]) } return } // array_print := func(a []float64) { // fmt.Print("[") // for _, aj := range a { // fmt.Printf("%f, ", aj) // } // fmt.Print("\b\b]\n") // } // matrix_print := func(m [][]float64) { // var i, j int // nr, nc := get_nr_nc(m) // for i = 0; i < nr; i++ { // array_print(m[i]) // } // } matrix_alloc := func(dim1, dim2 int) [][]float64 { result := make([][]float64, dim1) for i := 0; i < dim1; i++ { result[i] = make([]float64, dim2) } return result } vector_alloc := func(dim int) []float64 { return make([]float64, dim) } // sum := func(x []float64) float64 { // var r float64 // for _, ax := range x { // r += ax // } // return r // } // Vectorize matrix (column-major order) mat_to_vec_c := func(m [][]float64) []float64 { ni, nj := get_nr_nc(m) c := make([]float64, ni*nj) for j := 0; j < nj; j++ { for i := 0; i < ni; i++ { c[j*ni+i] = m[i][j] } } return c } // Reshape vector to matrix (column-major order) vec_to_mat_c := func(c []float64, ni, nj int) [][]float64 { m := matrix_alloc(ni, nj) for j := 0; j < nj; j++ { for i := 0; i < ni; i++ { m[i][j] = c[j*ni+i] } } return m } // Reshape vector to matrix (row-major order) vec_to_mat_r := func(r []float64, ni, nj int) [][]float64 { m := matrix_alloc(ni, nj) for i := 0; i < ni; i++ { for j := 0; j < nj; j++ { m[i][j] = r[i*nj+j] } } return m } cholesky := func(env *gmsk.Env, m [][]float64) [][]float64 { nr, _ := get_nr_nc(m) n := nr vecs := mat_to_vec_c(m) checkOk(env.Potrf(gmsk.UPLO_LO, int32(n), vecs)) s := vec_to_mat_c(vecs, n, n) // Zero out upper triangular part (MSK_potrf does not use it, original matrix values remain there) for i := 0; i < n; i++ { for j := i + 1; j < n; j++ { s[i][j] = 0 } } return s } // Matrix multiplication matrix_mul := func(env *gmsk.Env, a [][]float64, b [][]float64) [][]float64 { anr, _ := get_nr_nc(a) bnr, bnc := get_nr_nc(b) na := anr nb := bnc k := bnr vecm := vector_alloc(na * nb) veca := mat_to_vec_c(a) vecb := mat_to_vec_c(b) checkOk(env.Gemm(gmsk.TRANSPOSE_NO, gmsk.TRANSPOSE_NO, int32(na), int32(nb), int32(k), 1, veca, vecb, 1, vecm)) ab := vec_to_mat_c(vecm, na, nb) return ab } var expret float64 const n int32 = 8 w := 1.0 mu := []float64{0.07197, 0.15518, 0.17535, 0.08981, 0.42896, 0.39292, 0.32171, 0.18379} x0 := []float64{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} /* Initial setup. */ env, err := gmsk.MakeEnv() if err != nil { log.Fatal(err) } defer gmsk.DeleteEnv(env) task, err := gmsk.MakeTask(env, 0, 0) if err != nil { log.Fatal(err) } defer gmsk.DeleteTask(task) checkOk(task.LinkFuncToTaskStream(gmsk.STREAM_LOG, os.Stderr)) // NOTE: Here we specify matrices as vectors (row major order) to avoid having // to initialize them as double(*)[] type, which is incompatible with double**. // Factor exposure matrix vecB := []float64{ 0.4256, 0.1869, 0.2413, 0.3877, 0.2235, 0.3697, 0.1503, 0.4612, 1.5325, -0.2633, 1.2741, -0.2613, 0.6939, 0.2372, 0.5425, 0.2116, } B := vec_to_mat_r(vecB, int(n), 2) // Factor covariance matrix vecS_F := []float64{ 0.0620, 0.0577, 0.0577, 0.0908, } S_F := vec_to_mat_r(vecS_F, 2, 2) // Specific risk components theta := []float64{0.0720, 0.0508, 0.0377, 0.0394, 0.0663, 0.0224, 0.0417, 0.0459} P := cholesky(env, S_F) G_factor := matrix_mul(env, B, P) _, _k := get_nr_nc(G_factor) k := int64(_k) gammas := []float64{0.24, 0.28, 0.32, 0.36, 0.4, 0.44, 0.48} num_gammas := int32(len(gammas)) var totalBudget float64 // Offset of variables into the API variable. const numvar, voff_x int32 = 8, 0 // Constraint offset const coff_bud int32 = 0 // Holding variable x of length n // No other auxiliary variables are needed in this formulation checkOk(task.AppendVars(numvar)) // Setting up variable x for j := int32(0); j < n; j++ { /* Optionally we can give the variables names */ checkOk(task.PutVarName(voff_x+j, fmt.Sprintf("x[%d]", 1+j))) /* No short-selling - x^l = 0, x^u = inf */ checkOk(task.PutVarBound(voff_x+j, gmsk.BK_LO, 0, gmsk.INFINITY)) } // One linear constraint: total budget checkOk(task.AppendCons(1)) checkOk(task.PutConName(0, "budget")) for j := int32(0); j < n; j++ { /* Coefficients in the first row of A */ checkOk(task.PutAij(coff_bud, voff_x+j, 1)) } totalBudget = w for i := int32(0); i < n; i++ { totalBudget += x0[i] } checkOk(task.PutConBound(coff_bud, gmsk.BK_FX, totalBudget, totalBudget)) // Input (gamma, G_factor_T x, diag(sqrt(theta))*x) in the AFE (affine expression) storage // We need k+n+1 rows and we fill them in in three parts task.AppendAfes(k + int64(n) + 1) // 1. The first affine expression = gamma, will be specified later // 2. The next k expressions comprise G_factor_T*x, we add them column by column since // G_factor is stored row-wise and we transpose on the fly afeidx := make([]int64, k) for i := int64(0); i < k; i++ { afeidx[i] = i + 1 } for i := int32(0); i < n; i++ { checkOk(task.PutAfeFCol(i, k, afeidx, G_factor[i][:])) // i-th row of G_factor goes in i-th column of F } // 3. The remaining n rows contain sqrt(theta) on the diagonal for i := int32(0); i < n; i++ { checkOk(task.PutAfeFEntry(k+1+int64(i), voff_x+i, float64(math.Sqrt(float64(theta[i]))))) } // Input the affine conic constraint (gamma, G_factor_T x, diag(sqrt(theta))*x) \in QCone // Add the quadratic domain of dimension k+n+1 qdom, res := task.AppendQuadraticConeDomain(k + 1 + int64(n)) checkOk(res) // Add the constraint checkOk(task.AppendAccSeq(qdom, k+1+int64(n), 0, nil)) checkOk(task.PutAccName(0, "risk")) // Objective: maximize expected return mu^T x for j := int32(0); j < n; j++ { checkOk(task.PutCJ(voff_x+j, mu[j])) } checkOk(task.PutObjSense(gmsk.OBJECTIVE_SENSE_MAXIMIZE)) /* No log output */ checkOk(task.PutIntParam(gmsk.IPAR_LOG, 0)) for i := int32(0); i < num_gammas; i++ { gamma := gammas[i] // Specify gamma in ACC checkOk(task.PutAfeG(0, gamma)) /* Dump the problem to a human readable PTF file. */ checkOk(task.WriteDataHandle(os.Stderr, gmsk.DATA_FORMAT_PTF, gmsk.COMPRESS_NONE)) _, res = task.OptimizeTrm() checkOk(res) /* Display the solution summary for quick inspection of results. */ task.SolutionSummary(gmsk.STREAM_LOG) // not using MSG becasue MSG is going to Stdout right now expret = 0 /* Read the x variables one by one and compute expected return. */ /* Can also be obtained as value of the objective. */ for j := int32(0); j < n; j++ { xx, res := task.GetXxSlice(gmsk.SOL_ITR, voff_x+j, voff_x+j+1, nil) checkOk(res) xj := xx[0] expret += mu[j] * xj } fmt.Printf("\nExpected return %e for gamma %e\n", expret, gamma) } }
Output: Expected return 3.162054e-01 for gamma 2.400000e-01 Expected return 3.776816e-01 for gamma 2.800000e-01 Expected return 4.081833e-01 for gamma 3.200000e-01 Expected return 4.186580e-01 for gamma 3.600000e-01 Expected return 4.264498e-01 for gamma 4.000000e-01 Expected return 4.289600e-01 for gamma 4.400000e-01 Expected return 4.289600e-01 for gamma 4.800000e-01
Example (PowerCone_pow1) ¶
Purpose: Demonstrates how to solve the problem
maximize x^0.2*y^0.8 + z^0.4 - x st x + y + 0.5z = 2 x,y,z >= 0
package main import ( "fmt" "log" "os" "github.com/fardream/gmsk" ) func main() { checkOk := func(err error) { if err != nil { log.Fatalf("failed: %s", err.Error()) } } var r error const numvar, numcon int32 = 5, 1 const numafe, numacc, f_nnz int64 = 6, 2, 5 bkx := [5]gmsk.BoundKey{} blx, bux := [5]float64{}, [5]float64{} val := [3]float64{1, 1, -1} sub := [3]int32{3, 4, 0} aval := [3]float64{1, 1, 0.5} asub := [3]int32{0, 1, 2} afeidx := []int64{0, 1, 2, 3, 5} varidx := []int32{0, 1, 3, 2, 4} f_val := []float64{1, 1, 1, 1, 1} var g float64 = 1.0 alpha_1 := []float64{0.2, 0.8} alpha_2 := []float64{0.4, 0.6} domidx := []int64{0, 0} /* Create the mosek environment. */ env, err := gmsk.MakeEnv() if err != nil { log.Panic(err) } defer gmsk.DeleteEnv(env) /* Create the optimization task. */ task, err := env.MakeTask(0, 0) if err != nil { log.Panic(err) } defer gmsk.DeleteTask(task) checkOk(task.LinkFuncToTaskStream(gmsk.STREAM_LOG, os.Stderr)) /* Append 'numcon' empty constraints. The constraints will initially have no bounds. */ checkOk(task.AppendCons(numcon)) /* Append 'numvar' variables. The variables will initially be fixed at zero (x=0). */ checkOk(task.AppendVars(numvar)) /* Append 'numafe' affine expressions. The affine expressions will initially be empty. */ checkOk(task.AppendAfes(numafe)) /* Set up the linear part */ checkOk(task.PutCList(3, sub[:], val[:])) checkOk(task.PutARow(0, 3, asub[:], aval[:])) checkOk(task.PutConBound(0, gmsk.BK_FX, 2, 2)) for i := 0; i < 5; i++ { bkx[i], blx[i], bux[i] = gmsk.BK_FR, -gmsk.INFINITY, gmsk.INFINITY } checkOk(task.PutVarBoundSlice(0, numvar, bkx[:], blx[:], bux[:])) /* Set the non-zero entries of the F matrix */ checkOk(task.PutAfeFEntryList(f_nnz, afeidx, varidx, f_val)) /* Set the non-zero element of the g vector */ checkOk(task.PutAfeG(4, g)) /* Append the primal power cone domains with their respective parameter values. */ domidx[0], r = task.AppendPrimalPowerConeDomain(3, 2, alpha_1) checkOk(r) domidx[1], r = task.AppendPrimalPowerConeDomain(3, 2, alpha_2) checkOk(r) /* Append two ACCs made up of the AFEs and the domains defined above. */ checkOk(task.AppendAccsSeq(numacc, domidx, numafe, afeidx[0], nil)) checkOk(task.PutObjSense(gmsk.OBJECTIVE_SENSE_MAXIMIZE)) /* Run optimizer */ trmcode, r := task.OptimizeTrm() /* Print a summary containing information about the solution for debugging purposes*/ task.SolutionSummary(gmsk.STREAM_LOG) checkOk(r) solsta, r := task.GetSolSta(gmsk.SOL_ITR) checkOk(r) switch solsta { case gmsk.SOL_STA_OPTIMAL: xx, r := task.GetXx(gmsk.SOL_ITR, nil) if r != nil { checkOk(gmsk.NewError(gmsk.RES_ERR_SPACE)) } fmt.Printf("Optimal primal solution\n") for j := 0; j < 3; j++ { fmt.Printf("x[%d]: %.3e\n", j, xx[j]) } case gmsk.SOL_STA_DUAL_INFEAS_CER: fallthrough case gmsk.SOL_STA_PRIM_INFEAS_CER: fmt.Printf("Primal or dual infeasibility certificate found.\n") case gmsk.SOL_STA_UNKNOWN: fmt.Printf("The status of the solution could not be determined. Termination code: %d.\n", trmcode) default: fmt.Printf("Other solution status.\n") } }
Output: Optimal primal solution x[0]: 6.394e-02 x[1]: 7.833e-01 x[2]: 2.306e+00
Example (QuadraticOptimization_qcqo1) ¶
Quadratic optimization example with quadratic objective and constraints, reproduced from qcqo1.c in MOSEK C api.
Purpose: To demonstrate how to solve a quadratic optimization problem using the MOSEK API. minimize x_1^2 + 0.1 x_2^2 + x_3^2 - x_1 x_3 - x_2 s.t 1 <= x_1 + x_2 + x_3 - x_1^2 - x_2^2 - 0.1 x_3^2 + 0.2 x_1 x_3 x >= 0
package main import ( "fmt" "log" "os" "github.com/fardream/gmsk" ) func main() { checkOk := func(err error) { if err != nil { log.Fatalf("failed: %s", err.Error()) } } var r error const NUMCON = 1 /* Number of constraints. */ const NUMVAR = 3 /* Number of variables. */ const NUMQNZ = 4 /* Number of non-zeros in Q. */ c := []float64{0.0, -1.0, 0.0} bkc := []gmsk.BoundKey{gmsk.BK_LO} blc := []float64{1.0} buc := []float64{+gmsk.INFINITY} bkx := []gmsk.BoundKey{ gmsk.BK_LO, gmsk.BK_LO, gmsk.BK_LO, } blx := []float64{ 0.0, 0.0, 0.0, } bux := []float64{ +gmsk.INFINITY, +gmsk.INFINITY, +gmsk.INFINITY, } aptrb := []int32{0, 1, 2} aptre := []int32{1, 2, 3} asub := []int32{0, 0, 0} aval := []float64{1.0, 1.0, 1.0} qsubi := [NUMQNZ]int32{} qsubj := [NUMQNZ]int32{} qval := [NUMQNZ]float64{} var i, j int32 xx := make([]float64, NUMVAR) /* Create the mosek environment. */ env, err := gmsk.MakeEnv() if err != nil { log.Panic(err) } defer gmsk.DeleteEnv(env) /* Create the optimization task. */ task, err := env.MakeTask(NUMCON, NUMVAR) if err != nil { log.Panic(err) } defer gmsk.DeleteTask(task) checkOk(task.LinkFuncToTaskStream(gmsk.STREAM_LOG, os.Stderr)) /* Append 'NUMCON' empty constraints. The constraints will initially have no bounds. */ checkOk(task.AppendCons(NUMCON)) /* Append 'NUMVAR' variables. The variables will initially be fixed at zero (x=0). */ checkOk(task.AppendVars(NUMVAR)) /* Optionally add a constant term to the objective. */ checkOk(task.PutCfix(0)) for j = 0; j < NUMVAR && r == nil; j++ { /* Set the linear term c_j in the objective.*/ checkOk(task.PutCJ(j, c[j])) /* Set the bounds on variable j. blx[j] <= x_j <= bux[j] */ checkOk( task.PutVarBound( j, /* Index of variable.*/ bkx[j], /* Bound key.*/ blx[j], /* Numerical value of lower bound.*/ bux[i], /* Numerical value of upper bound.*/ )) /* Input column j of A */ r = task.PutACol( j, /* Variable (column) index.*/ aptre[j]-aptrb[j], /* Number of non-zeros in column j.*/ asub[aptrb[j]:aptre[j]], /* Pointer to row indexes of column j.*/ aval[aptrb[j]:aptre[j]]) /* Pointer to Values of column j.*/ } checkOk(r) /* Set the bounds on constraints. for i=1, ...,NUMCON : blc[i] <= constraint i <= buc[i] */ for i = 0; i < NUMCON && r == nil; i++ { r = task.PutConBound( i, /* Index of constraint.*/ bkc[i], /* Bound key.*/ blc[i], /* Numerical value of lower bound.*/ buc[i]) /* Numerical value of upper bound.*/ } checkOk(r) { /* * The lower triangular part of the Q^o * matrix in the objective is specified. */ qsubi[0] = 0 qsubj[0] = 0 qval[0] = 2.0 qsubi[1] = 1 qsubj[1] = 1 qval[1] = 0.2 qsubi[2] = 2 qsubj[2] = 0 qval[2] = -1.0 qsubi[3] = 2 qsubj[3] = 2 qval[3] = 2.0 /* Input the Q^o for the objective. */ checkOk(task.PutQObj(NUMQNZ, qsubi[:], qsubj[:], qval[:])) } { /* * The lower triangular part of the Q^0 * matrix in the first constraint is specified. This corresponds to adding the term - x_1^2 - x_2^2 - 0.1 x_3^2 + 0.2 x_1 x_3 */ qsubi[0] = 0 qsubj[0] = 0 qval[0] = -2.0 qsubi[1] = 1 qsubj[1] = 1 qval[1] = -2.0 qsubi[2] = 2 qsubj[2] = 2 qval[2] = -0.2 qsubi[3] = 2 qsubj[3] = 0 qval[3] = 0.2 /* Put Q^0 in constraint with index 0. */ checkOk(task.PutQConK( 0, 4, qsubi[:], qsubj[:], qval[:])) } checkOk(task.PutObjSense(gmsk.OBJECTIVE_SENSE_MINIMIZE)) /* Run optimizer */ trmcode, r := task.OptimizeTrm() /* Print a summary containing information about the solution for debugging purposes*/ task.SolutionSummary(gmsk.STREAM_LOG) solsta, r := task.GetSolSta(gmsk.SOL_ITR) checkOk(r) switch solsta { case gmsk.SOL_STA_OPTIMAL: xx, r = task.GetXx( gmsk.SOL_ITR, /* Request the interior solution. */ xx) if r != nil { r = gmsk.NewError(gmsk.RES_ERR_SPACE) break } fmt.Print("Optimal primal solution\n") for j = 0; j < NUMVAR; j++ { fmt.Printf("x[%d]: %e\n", j, xx[j]) } case gmsk.SOL_STA_DUAL_INFEAS_CER: fallthrough case gmsk.SOL_STA_PRIM_INFEAS_CER: fmt.Printf("Primal or dual infeasibility certificate found.\n") case gmsk.SOL_STA_UNKNOWN: fmt.Printf("The status of the solution could not be determined. Termination code: %d.\n", trmcode) default: fmt.Printf("Other solution status.\n") } }
Output: Optimal primal solution x[0]: 4.487975e-01 x[1]: 9.319238e-01 x[2]: 6.741147e-01
Example (QuadraticOptimization_qo1) ¶
Quadratic optimization example, reproduced from qo1.c in MOSEK C api.
package main import ( "fmt" "log" "os" "github.com/fardream/gmsk" ) func main() { checkOk := func(err error) { if err != nil { log.Fatalf("failed: %s", err.Error()) } } var r error const NUMCON = 1 /* Number of constraints. */ const NUMVAR = 3 /* Number of variables. */ const NUMQNZ = 4 /* Number of non-zeros in Q. */ c := []float64{0.0, -1.0, 0.0} bkc := []gmsk.BoundKey{gmsk.BK_LO} blc := []float64{1.0} buc := []float64{+gmsk.INFINITY} bkx := []gmsk.BoundKey{ gmsk.BK_LO, gmsk.BK_LO, gmsk.BK_LO, } blx := []float64{ 0.0, 0.0, 0.0, } bux := []float64{ +gmsk.INFINITY, +gmsk.INFINITY, +gmsk.INFINITY, } aptrb := []int32{0, 1, 2} aptre := []int32{1, 2, 3} asub := []int32{0, 0, 0} aval := []float64{1.0, 1.0, 1.0} qsubi := [NUMQNZ]int32{} qsubj := [NUMQNZ]int32{} qval := [NUMQNZ]float64{} var i, j int32 xx := make([]float64, NUMVAR) /* Create the mosek environment. */ env, err := gmsk.MakeEnv() if err != nil { log.Panic(err) } defer gmsk.DeleteEnv(env) /* Create the optimization task. */ task, err := env.MakeTask(NUMCON, NUMVAR) if err != nil { log.Panic(err) } defer gmsk.DeleteTask(task) checkOk(task.LinkFuncToTaskStream(gmsk.STREAM_LOG, os.Stderr)) /* Append 'NUMCON' empty constraints. The constraints will initially have no bounds. */ checkOk(task.AppendCons(NUMCON)) /* Append 'NUMVAR' variables. The variables will initially be fixed at zero (x=0). */ checkOk(task.AppendVars(NUMVAR)) /* Optionally add a constant term to the objective. */ checkOk(task.PutCfix(0)) for j = 0; j < NUMVAR && r == nil; j++ { /* Set the linear term c_j in the objective.*/ checkOk(task.PutCJ(j, c[j])) /* Set the bounds on variable j. blx[j] <= x_j <= bux[j] */ checkOk( task.PutVarBound( j, /* Index of variable.*/ bkx[j], /* Bound key.*/ blx[j], /* Numerical value of lower bound.*/ bux[i], /* Numerical value of upper bound.*/ )) /* Input column j of A */ r = task.PutACol( j, /* Variable (column) index.*/ aptre[j]-aptrb[j], /* Number of non-zeros in column j.*/ asub[aptrb[j]:aptre[j]], /* Pointer to row indexes of column j.*/ aval[aptrb[j]:aptre[j]]) /* Pointer to Values of column j.*/ } checkOk(r) /* Set the bounds on constraints. for i=1, ...,NUMCON : blc[i] <= constraint i <= buc[i] */ for i = 0; i < NUMCON && r == nil; i++ { r = task.PutConBound( i, /* Index of constraint.*/ bkc[i], /* Bound key.*/ blc[i], /* Numerical value of lower bound.*/ buc[i]) /* Numerical value of upper bound.*/ } checkOk(r) /* * The lower triangular part of the Q * matrix in the objective is specified. */ qsubi[0] = 0 qsubj[0] = 0 qval[0] = 2.0 qsubi[1] = 1 qsubj[1] = 1 qval[1] = 0.2 qsubi[2] = 2 qsubj[2] = 0 qval[2] = -1.0 qsubi[3] = 2 qsubj[3] = 2 qval[3] = 2.0 /* Input the Q for the objective. */ checkOk(task.PutQObj(NUMQNZ, qsubi[:], qsubj[:], qval[:])) /* Run optimizer */ trmcode, r := task.OptimizeTrm() /* Print a summary containing information about the solution for debugging purposes*/ task.SolutionSummary(gmsk.STREAM_LOG) solsta, r := task.GetSolSta(gmsk.SOL_ITR) checkOk(r) switch solsta { case gmsk.SOL_STA_OPTIMAL: xx, r = task.GetXx( gmsk.SOL_ITR, /* Request the interior solution. */ xx) if r != nil { r = gmsk.NewError(gmsk.RES_ERR_SPACE) break } fmt.Print("Optimal primal solution\n") for j = 0; j < NUMVAR; j++ { fmt.Printf("x[%d]: %.2e\n", j, xx[j]) } case gmsk.SOL_STA_DUAL_INFEAS_CER: fallthrough case gmsk.SOL_STA_PRIM_INFEAS_CER: fmt.Printf("Primal or dual infeasibility certificate found.\n") case gmsk.SOL_STA_UNKNOWN: fmt.Printf("The status of the solution could not be determined. Termination code: %d.\n", trmcode) default: fmt.Printf("Other solution status.\n") } }
Output: Optimal primal solution x[0]: 1.58e-04 x[1]: 5.00e+00 x[2]: 1.58e-04
Example (Reoptimization) ¶
Reoptimization example, reproduced from reoptimization.c in MOSEK C api.
package main import ( "fmt" "log" "os" "github.com/fardream/gmsk" ) func main() { checkOk := func(err error) { if err != nil { log.Fatalf("failed: %s", err.Error()) } } var r error printres := func(n int32, x []float64) { for i, v := range x { if int32(i) >= n-1 { fmt.Printf("%.3f\n", v) } else { fmt.Printf("%.3f ", v) } } } var numvar int32 = 3 var numcon int32 = 3 var i, j int32 c := []float64{1.5, 2.5, 3.0} ptrb := []int32{0, 3, 6} ptre := []int32{3, 6, 9} asub := []int32{ 0, 1, 2, 0, 1, 2, 0, 1, 2, } aval := []float64{ 2.0, 3.0, 2.0, 4.0, 2.0, 3.0, 3.0, 3.0, 2.0, } bkc := []gmsk.BoundKey{gmsk.BK_UP, gmsk.BK_UP, gmsk.BK_UP} blc := []float64{-gmsk.INFINITY, -gmsk.INFINITY, -gmsk.INFINITY} buc := []float64{100000, 50000, 60000} bkx := []gmsk.BoundKey{gmsk.BK_LO, gmsk.BK_LO, gmsk.BK_LO} blx := []float64{0.0, 0.0, 0.0} bux := []float64{+gmsk.INFINITY, +gmsk.INFINITY, +gmsk.INFINITY} var xx []float64 var varidx, conidx int32 /* Create the mosek environment. */ env, err := gmsk.MakeEnv() if err != nil { log.Panic(err) } defer gmsk.DeleteEnv(env) /* Create the optimization task. */ task, err := env.MakeTask(numcon, numvar) if err != nil { log.Panic(err) } defer gmsk.DeleteTask(task) checkOk(task.LinkFuncToTaskStream(gmsk.STREAM_LOG, os.Stderr)) /* Append the constraints. */ checkOk(task.AppendCons(numcon)) /* Append the variables. */ checkOk(task.AppendVars(numvar)) /* Put C. */ checkOk(task.PutCfix(0)) for j = 0; j < numvar; j++ { checkOk(task.PutCJ(j, c[j])) } /* Put constraint bounds. */ for i = 0; i < numcon; i++ { checkOk(task.PutConBound(i, bkc[i], blc[i], buc[i])) } /* Put variable bounds. */ for j = 0; j < numvar; j++ { checkOk(task.PutVarBound(j, bkx[j], blx[j], bux[j])) } /* Put A. */ if numcon > 0 { for j = 0; j < numvar; j++ { checkOk(task.PutACol( j, ptre[j]-ptrb[j], asub[ptrb[j]:ptre[j]], aval[ptrb[j]:ptre[j]])) } } checkOk(task.PutObjSense(gmsk.OBJECTIVE_SENSE_MAXIMIZE)) _, r = task.OptimizeTrm() checkOk(r) xx = make([]float64, numvar) xx, r = task.GetXx( gmsk.SOL_BAS, /* Basic solution. */ xx) checkOk(r) printres(numvar, xx) /******************** Make a change to the A matrix **********/ checkOk(task.PutAij(0, 0, 3)) _, r = task.OptimizeTrm() checkOk(r) xx, r = task.GetXx( gmsk.SOL_BAS, /* Basic solution. */ xx) checkOk(r) printres(numvar, xx) /*********************** Add a new variable ******************/ /* Get index of new variable, this should be 3 */ varidx, r = task.GetNumVar() /* Append a new variable x_3 to the problem */ checkOk(task.AppendVars(1)) numvar++ /* Set bounds on new variable */ task.PutVarBound( varidx, gmsk.BK_LO, 0, gmsk.INFINITY) /* Change objective */ checkOk(task.PutCJ(varidx, 1)) /* Put new values in the A matrix */ { acolsub := []int32{0, 2} acolval := []float64{4.0, 1.0} checkOk(task.PutACol( varidx, /* column index */ 2, /* num nz in column*/ acolsub, acolval)) } /* Change optimizer to free simplex and reoptimize */ checkOk(task.PutIntParam(gmsk.IPAR_OPTIMIZER, gmsk.OPTIMIZER_FREE_SIMPLEX)) _, r = task.OptimizeTrm() checkOk(r) xx = make([]float64, numvar) xx, r = task.GetXx( gmsk.SOL_BAS, /* Basic solution. */ xx) checkOk(r) printres(numvar, xx) /* **************** Add a new constraint ******************* */ /* Get index of new constraint*/ conidx, r = task.GetNumCon() checkOk(r) /* Append a new constraint */ checkOk(task.AppendCons(1)) numcon++ /* Set bounds on new constraint */ checkOk( task.PutConBound( conidx, gmsk.BK_UP, -gmsk.INFINITY, 30000)) /* Put new values in the A matrix */ { arowsub := []int32{0, 1, 2, 3} arowval := []float64{1.0, 2.0, 1.0, 1.0} checkOk( task.PutARow( conidx, /* row index */ 4, /* num nz in row*/ arowsub, arowval)) } _, r = task.OptimizeTrm() checkOk(r) xx, r = task.GetXx( gmsk.SOL_BAS, /* Basic solution. */ xx) checkOk(r) printres(numvar, xx) /* **************** Change constraint bounds ******************* */ { newbkc := []gmsk.BoundKey{gmsk.BK_UP, gmsk.BK_UP, gmsk.BK_UP, gmsk.BK_UP} newblc := []float64{-gmsk.INFINITY, -gmsk.INFINITY, -gmsk.INFINITY, -gmsk.INFINITY} newbuc := []float64{80000, 40000, 50000, 22000} checkOk(task.PutConBoundSlice(0, numcon, newbkc, newblc, newbuc)) } _, r = task.OptimizeTrm() checkOk(r) xx, r = task.GetXx( gmsk.SOL_BAS, /* Basic solution. */ xx) checkOk(r) printres(numvar, xx) }
Output: 0.000 16000.000 6000.000 0.000 16000.000 6000.000 0.000 12142.857 8571.429 6428.571 0.000 1000.000 16000.000 12000.000 0.000 0.000 13333.333 8666.667
Example (SemidefiniteOptimization_sdo1) ¶
Semidefinite optimization example, reproduced from sdo1.c in MOSEK C api.
minimize Tr [2, 1, 0; 1, 2, 1; 0, 1, 2]*X + x0 subject to Tr [1, 0, 0; 0, 1, 0; 0, 0, 1]*X + x0 = 1 Tr [1, 1, 1; 1, 1, 1; 1, 1, 1]*X + x1 + x2 = 0.5 (x0,x1,x2) \in Q, X \in PSD
package main import ( "fmt" "log" "os" "github.com/fardream/gmsk" ) func main() { const NUMCON = 2 /* Number of constraints. */ const NUMVAR = 3 /* Number of conic quadratic variables */ // const NUMANZ = 3 /* Number of non-zeros in A */ const NUMAFE = 3 /* Number of affine expressions */ const NUMFNZ = 3 /* Number of non-zeros in F */ const NUMBARVAR = 1 /* Number of semidefinite variables */ checkOk := func(err error) { if err != nil { log.Fatalf("failed: %s", err.Error()) } } var r error DIMBARVAR := []int32{3} /* Dimension of semidefinite cone */ LENBARVAR := []int32{3 * (3 + 1) / 2} /* Number of scalar SD variables */ bkc := []gmsk.BoundKey{gmsk.BK_FX, gmsk.BK_FX} blc := []float64{1.0, 0.5} buc := []float64{1.0, 0.5} barc_i := []int32{0, 1, 1, 2, 2} barc_j := []int32{0, 0, 1, 1, 2} barc_v := []float64{2.0, 1.0, 2.0, 1.0, 2.0} aptrb := []int32{0, 1} aptre := []int32{1, 3} asub := []int32{0, 1, 2} /* column subscripts of A */ aval := []float64{1, 1, 1} bara_i := []int32{0, 1, 2, 0, 1, 2, 1, 2, 2} bara_j := []int32{0, 1, 2, 0, 0, 0, 1, 1, 2} bara_v := []float64{1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0} // conesub := []int32{0, 1, 2} afeidx := []int64{0, 1, 2} varidx := []int32{0, 1, 2} f_val := []float64{1, 1, 1} var i, j int32 var idx int64 var falpha float64 = 1 /* Create the mosek environment. */ env, err := gmsk.MakeEnv() if err != nil { log.Panic(err) } defer gmsk.DeleteEnv(env) /* Create the optimization task. */ task, err := env.MakeTask(NUMCON, 0) if err != nil { log.Panic(err) } defer gmsk.DeleteTask(task) checkOk(task.LinkFuncToTaskStream(gmsk.STREAM_LOG, os.Stderr)) /* Append 'NUMCON' empty constraints. The constraints will initially have no bounds. */ checkOk(task.AppendCons(NUMCON)) /* Append 'NUMVAR' variables. The variables will initially be fixed at zero (x=0). */ checkOk(task.AppendVars(NUMVAR)) /* Append 'NUMAFE' affine expressions.*/ checkOk(task.AppendAfes(NUMAFE)) /* Append 'NUMBARVAR' semidefinite variables. */ checkOk(task.AppendBarvars(NUMBARVAR, DIMBARVAR)) /* Optionally add a constant term to the objective. */ checkOk(task.PutCfix(0)) /* Set the linear term c_j in the objective.*/ checkOk(task.PutCJ(0, 1)) for j = 0; j < NUMVAR && r == nil; j++ { r = task.PutVarBound(j, gmsk.BK_FR, -gmsk.INFINITY, gmsk.INFINITY) } checkOk(r) /* Set the linear term barc_j in the objective.*/ idx, r = task.AppendSparseSymMat(DIMBARVAR[0], 5, barc_i, barc_j, barc_v) checkOk(r) checkOk(task.PutBarcJ(0, 1, []int64{idx}, []float64{falpha})) /* Set the bounds on constraints. for i=1, ...,NUMCON : blc[i] <= constraint i <= buc[i] */ for i = 0; i < NUMCON && r == nil; i++ { r = task.PutConBound( i, /* Index of constraint.*/ bkc[i], /* Bound key.*/ blc[i], /* Numerical value of lower bound.*/ buc[i]) /* Numerical value of upper bound.*/ } checkOk(r) /* Input A row by row */ for i = 0; i < NUMCON && r == nil; i++ { ni := aptre[i] - aptrb[i] // need to check zero since go checks if ni <= 0 { continue } r = task.PutARow(i, ni, asub[aptrb[i]:aptre[i]], aval[aptrb[i]:aptre[i]]) } /* Append the affine conic constraint with quadratic cone */ checkOk(task.PutAfeFEntryList(NUMFNZ, afeidx, varidx, f_val)) qdomidx, r := task.AppendQuadraticConeDomain(3) checkOk(r) checkOk(task.AppendAcc(qdomidx, 3, afeidx, nil)) /* Add the first row of barA */ idx, r = task.AppendSparseSymMat(DIMBARVAR[0], 3, bara_i, bara_j, bara_v) checkOk(r) checkOk(task.PutBaraIj(0, 0, 1, []int64{idx}, []float64{falpha})) /* Add the second row of barA */ idx, r = task.AppendSparseSymMat(DIMBARVAR[0], 6, bara_i[3:], bara_j[3:], bara_v[3:]) checkOk(r) checkOk(task.PutBaraIj(1, 0, 1, []int64{idx}, []float64{falpha})) trmcode, r := task.OptimizeTrm() task.SolutionSummary(gmsk.STREAM_LOG) checkOk(r) solsta, r := task.GetSolSta(gmsk.SOL_ITR) switch solsta { case gmsk.SOL_STA_OPTIMAL: xx := make([]float64, NUMVAR) barx := make([]float64, LENBARVAR[0]) xx, r = task.GetXx(gmsk.SOL_ITR, xx) checkOk(r) barx, r = task.GetBarXj(gmsk.SOL_ITR, 0, barx) checkOk(r) fmt.Printf("Optimal primal solution\n") for i = 0; i < NUMVAR; i++ { fmt.Printf("x[%d] : % e\n", i, xx[i]) } for i = 0; i < LENBARVAR[0]; i++ { fmt.Printf("barx[%d]: % e\n", i, barx[i]) } case gmsk.SOL_STA_DUAL_INFEAS_CER: fallthrough case gmsk.SOL_STA_PRIM_INFEAS_CER: fmt.Printf("Primal or dual infeasibility certificate found.\n") case gmsk.SOL_STA_UNKNOWN: fmt.Printf("The status of the solution could not be determined. Termination code: %d.\n", trmcode) default: fmt.Printf("Other solution status.") } }
Output: Optimal primal solution x[0] : 2.544049e-01 x[1] : 1.798914e-01 x[2] : 1.798914e-01 barx[0]: 2.172534e-01 barx[1]: -2.599712e-01 barx[2]: 2.172534e-01 barx[3]: 3.110884e-01 barx[4]: -2.599712e-01 barx[5]: 2.172534e-01
Example (SemidefiniteOptimization_sdo2) ¶
Semidefinite optimization, reproduced from sdo2.c in MOSEK C api.
min <C1,X1> + <C2,X2> st. <A1,X1> + <A2,X2> = b (X2)_{1,2} <= k where X1, X2 are symmetric positive semidefinite, C1, C2, A1, A2 are assumed to be constant symmetric matrices, and b, k are constants.
package main import ( "fmt" "log" "os" "strings" "github.com/fardream/gmsk" ) func main() { checkOk := func(err error) { if err != nil { log.Fatalf("failed: %s", err.Error()) } } var r error /* Input data */ const numbarvar int32 = 2 dimbarvar := []int32{3, 4} /* Dimension of semidefinite variables */ /* Objective coefficients concatenated */ Cj := []int32{0, 0, 1, 1, 1, 1} /* Which symmetric variable (j) */ Ck := []int32{0, 2, 0, 1, 1, 2} /* Which entry (k,l)->v */ Cl := []int32{0, 2, 0, 0, 1, 2} Cv := []float64{1.0, 6.0, 1.0, -3.0, 2.0, 1.0} /* Equality constraints coefficients concatenated */ Ai := []int32{0, 0, 0, 0, 0, 0} /* Which constraint (i = 0) */ Aj := []int32{0, 0, 0, 1, 1, 1} /* Which symmetric variable (j) */ Ak := []int32{0, 2, 2, 1, 1, 3} /* Which entry (k,l)->v */ Al := []int32{0, 0, 2, 0, 1, 3} Av := []float64{1.0, 1.0, 2.0, 1.0, -1.0, -3.0} /* The second constraint - one-term inequality */ var A2i int32 = 1 /* Which constraint (i = 1) */ var A2j int32 = 1 /* Which symmetric variable (j = 1) */ var A2k int32 = 1 /* Which entry A(1,0) = A(0,1) = 0.5 */ var A2l int32 = 0 var A2v float64 = 0.5 /* Constraint bounds and values */ const numcon int32 = 2 bkc := []gmsk.BoundKey{gmsk.BK_FX, gmsk.BK_UP} blc := []float64{23.0, -gmsk.INFINITY} buc := []float64{23.0, -3.0} var i, j, dim int32 // var barx *float64 /* Create the mosek environment. */ env, err := gmsk.MakeEnv() if err != nil { log.Panic(err) } defer gmsk.DeleteEnv(env) /* Create the optimization task. */ task, err := env.MakeTask(0, 0) if err != nil { log.Panic(err) } defer gmsk.DeleteTask(task) checkOk(task.LinkFuncToTaskStream(gmsk.STREAM_LOG, os.Stderr)) /* Append empty constraints. The constraints will initially have no bounds. */ checkOk(task.AppendCons(numcon)) /* Append semidefinite variables. */ checkOk(task.AppendBarvars(numbarvar, dimbarvar)) /* Set objective (6 nonzeros).*/ checkOk(task.PutBarcBlockTriplet(6, Cj, Ck, Cl, Cv)) /* Set the equality constraint (6 nonzeros).*/ checkOk(task.PutBaraBlockTriplet(6, Ai, Aj, Ak, Al, Av)) /* Set the inequality constraint (1 nonzero).*/ checkOk(task.PutBaraBlockTriplet(1, []int32{A2i}, []int32{A2j}, []int32{A2k}, []int32{A2l}, []float64{A2v})) /* Set constraint bounds */ checkOk(task.PutConBoundSlice(0, 2, bkc, blc, buc)) /* Run optimizer */ trmcode, r := task.OptimizeTrm() task.SolutionSummary(gmsk.STREAM_LOG) checkOk(r) solsta, r := task.GetSolSta(gmsk.SOL_ITR) checkOk(r) switch solsta { case gmsk.SOL_STA_OPTIMAL: /* Retrieve the soution for all symmetric variables */ fmt.Printf("Solution (lower triangular part vectorized):\n") for i = 0; i < numbarvar; i++ { var b strings.Builder dim = dimbarvar[i] * (dimbarvar[i] + 1) / 2 barx := make([]float64, dim) barx, r = task.GetBarXj(gmsk.SOL_ITR, i, barx) checkOk(r) fmt.Fprintf(&b, "X%d: ", i+1) for j = 0; j < dim; j++ { fmt.Fprintf(&b, "%.3f ", barx[j]) } fmt.Println(strings.TrimRight(b.String(), " ")) } case gmsk.SOL_STA_DUAL_INFEAS_CER: fallthrough case gmsk.SOL_STA_PRIM_INFEAS_CER: fmt.Printf("Primal or dual infeasibility certificate found.\n") case gmsk.SOL_STA_UNKNOWN: fmt.Printf("The status of the solution could not be determined. Termination code: %d.\n", trmcode) default: fmt.Printf("Other solution status.") } }
Output: Solution (lower triangular part vectorized): X1: 21.047 0.000 4.077 5.534 0.000 0.790 X2: 5.054 -3.000 0.000 0.000 1.781 0.000 0.000 0.000 0.000 0.000
Example (SemidefiniteOptimization_sdo_lmi) ¶
Example of semidefinite matrix with linear matrix inequality, reproduced from sdo_lmi.c in MOSEK C api.
Purpose : To solve a problem with an LMI and an affine conic constrained problem with a PSD term minimize Tr [1, 0; 0, 1]*X + x(1) + x(2) + 1 subject to Tr [0, 1; 1, 0]*X - x(1) - x(2) >= 0 x(1) [0, 1; 1, 3] + x(2) [3, 1; 1, 0] - [1, 0; 0, 1] >> 0 X >> 0
package main import ( "fmt" "log" "math" "os" "github.com/fardream/gmsk" ) func main() { checkOk := func(err error) { if err != nil { log.Fatalf("failed: %s", err.Error()) } } var r error const NUMVAR = 2 /* Number of scalar variables */ const NUMAFE = 4 /* Number of affine expressions */ const NUMFNZ = 6 /* Number of non-zeros in F */ const NUMBARVAR = 1 /* Number of semidefinite variables */ DIMBARVAR := []int32{2} /* Dimension of semidefinite cone */ LENBARVAR := []int64{2 * (2 + 1) / 2} /* Number of scalar SD variables */ barc_j := []int32{0, 0} barc_k := []int32{0, 1} barc_l := []int32{0, 1} barc_v := []float64{1, 1} barf_i := []int64{0, 0} barf_j := []int32{0, 0} barf_k := []int32{0, 1} barf_l := []int32{0, 0} barf_v := []float64{0, 1} afeidx := []int64{0, 0, 1, 2, 2, 3} varidx := []int32{0, 1, 1, 0, 1, 0} f_val := []float64{-1, -1, 3, math.Sqrt(2), math.Sqrt(2), 3} g := []float64{0, -1, 0, -1} var i, j int32 /* Create the mosek environment. */ env, err := gmsk.MakeEnv() if err != nil { log.Panic(err) } defer gmsk.DeleteEnv(env) /* Create the optimization task. */ task, err := env.MakeTask(0, 0) if err != nil { log.Panic(err) } defer gmsk.DeleteTask(task) checkOk(task.LinkFuncToTaskStream(gmsk.STREAM_LOG, os.Stderr)) /* Append 'NUMAFE' empty affine expressions. */ checkOk(task.AppendAfes(NUMAFE)) /* Append 'NUMVAR' scalar variables. The variables will initially be fixed at zero (x=0). */ checkOk(task.AppendVars(NUMVAR)) /* Append 'NUMBARVAR' semidefinite variables. */ checkOk(task.AppendBarvars(NUMBARVAR, DIMBARVAR)) /* Set the constant term in the objective. */ checkOk(task.PutCfix(1)) /* Set c_j and the bounds for each scalar variable*/ for j = 0; j < NUMVAR && r == nil; j++ { r = task.PutCJ(j, 1.0) checkOk(r) r = task.PutVarBound(j, gmsk.BK_FR, -gmsk.INFINITY, gmsk.INFINITY) } checkOk(r) /* Set the linear term barc_j in the objective.*/ checkOk(task.PutBarcBlockTriplet(2, barc_j, barc_k, barc_l, barc_v)) /* Set the F matrix */ checkOk(task.PutAfeFEntryList(NUMFNZ, afeidx, varidx, f_val)) /* Set the g vector */ checkOk(task.PutAfeGSlice(0, NUMAFE, g)) /* Set the barF matrix */ checkOk(task.PutAfeBarfBlockTriplet(2, barf_i, barf_j, barf_k, barf_l, barf_v)) /* Append R+ domain and the corresponding ACC */ acc1_afeidx := []int64{0} rplusdom, r := task.AppendRplusDomain(1) checkOk(r) checkOk(task.AppendAcc(rplusdom, 1, acc1_afeidx, nil)) /* Append the SVEC_PSD domain and the corresponding ACC */ acc2_afeidx := []int64{1, 2, 3} svecpsddom, r := task.AppendSvecPsdConeDomain(3) checkOk(r) checkOk(task.AppendAcc(svecpsddom, 3, acc2_afeidx, nil)) /* Run optimizer */ trmcode, r := task.OptimizeTrm() /* Print a summary containing information about the solution for debugging purposes*/ task.SolutionSummary(gmsk.STREAM_LOG) checkOk(r) solsta, r := task.GetSolSta(gmsk.SOL_ITR) switch solsta { case gmsk.SOL_STA_OPTIMAL: xx := make([]float64, NUMVAR) barx := make([]float64, LENBARVAR[0]) xx, r = task.GetXx(gmsk.SOL_ITR, xx) checkOk(r) barx, r = task.GetBarXj(gmsk.SOL_ITR, 0, barx) checkOk(r) fmt.Printf("Optimal primal solution\n") for i = 0; i < NUMVAR; i++ { fmt.Printf("x[%d] : % e\n", i, xx[i]) } for i = 0; i < int32(LENBARVAR[0]); i++ { fmt.Printf("barx[%d]: % e\n", i, barx[i]) } case gmsk.SOL_STA_DUAL_INFEAS_CER: fallthrough case gmsk.SOL_STA_PRIM_INFEAS_CER: fmt.Printf("Primal or dual infeasibility certificate found.\n") case gmsk.SOL_STA_UNKNOWN: fmt.Printf("The status of the solution could not be determined. Termination code: %d.\n", trmcode) default: fmt.Printf("Other solution status.") } }
Output: Optimal primal solution x[0] : 1.000000e+00 x[1] : 1.000000e+00 barx[0]: 1.000000e+00 barx[1]: 1.000000e+00 barx[2]: 1.000000e+00
Index ¶
- Constants
- func CallbackcodeToStr(code CallbackCode) (callbackcodestr string, r error)
- func DeleteEnv(env *Env) error
- func DeleteTask(task *Task)
- func DinfitemToStr(item DInfItem) (str string, r error)
- func GetBuildInfo() (buildstate, builddate string, r error)
- func GetCodedesc(code ResCode) (symname, str string, r error)
- func GetVersion() (major, minor, revision int32, r error)
- func IinfitemToStr(item IInfItem) (str string, r error)
- func IsMskError(err error) bool
- func Isinfinity(value float64) bool
- func Licensecleanup() error
- func LiinfitemToStr(item LIInfItem) (str string, r error)
- func NewError(code ResCode) error
- func NewErrorFromInt[...](code TInt) error
- func RescodeToStr(c ResCode) (str string, r error)
- func Symnamtovalue(name string, value *byte) bool
- func Utf8towchar(outputlen uint64, len []uint64, conv []uint64, output []int32, input string) error
- func Wchartoutf8(outputlen uint64, len []uint64, conv []uint64, output *byte, input []int32) error
- type BasIndType
- type BoundKey
- type BranchDir
- type CallbackCode
- type CheckConvexityType
- type CompressType
- type ConeType
- type DInfItem
- type DParam
- type DataFormat
- type DomainType
- type Env
- func (env *Env) Axpy(n int32, alpha float64, x []float64, y []float64) error
- func (env *Env) CheckInAll() error
- func (env *Env) CheckInLicense(feature Feature) error
- func (env *Env) CheckMemenv(file string, line int32) error
- func (env *Env) CheckOutLicense(feature Feature) error
- func (env *Env) CheckVersion(major int32, minor int32, revision int32) error
- func (env *Env) Dot(n int32, x []float64, y []float64) (xty float64, r error)
- func (env *Env) EchoIntro(longver int32) error
- func (env *Env) Expirylicenses() (expiry int64, r error)
- func (env *Env) Gemm(transa Transpose, transb Transpose, m int32, n int32, k int32, alpha float64, ...) error
- func (env *Env) Gemv(transa Transpose, m int32, n int32, alpha float64, a []float64, x []float64, ...) error
- func (env *Env) GetSymbcondim(num []int32, maxlen []uint64) error
- func (env *Env) Iparvaltosymnam(whichparam IParam, whichvalue int32, symbolicname *byte) error
- func (env *Env) LinkFiletoenvstream(whichstream StreamType, filename string, append int32) error
- func (env *Env) MakeTask(maxnumcon int32, maxnumvar int32) (*Task, error)
- func (env *Env) Potrf(uplo UpLo, n int32, a []float64) error
- func (env *Env) PutLicenseCode(code []int32) error
- func (env *Env) PutLicenseDebug(licdebug int32) error
- func (env *Env) PutLicensePath(licensepath string) error
- func (env *Env) PutLicenseWait(licwait int32) error
- func (env *Env) ResetExpiryLicenses() error
- func (env *Env) SparseTriangularSolveDense(transposed Transpose, n int32, lnzc []int32, lptrc []int64, lensubnval int64, ...) error
- func (env *Env) Syeig(uplo UpLo, n int32, a []float64, w []float64) error
- func (env *Env) Syevd(uplo UpLo, n int32, a []float64, w []float64) error
- func (env *Env) Syrk(uplo UpLo, trans Transpose, n int32, k int32, alpha float64, a []float64, ...) error
- func (env *Env) UnlinkFuncfromenvstream(whichstream StreamType) error
- type Feature
- type IInfItem
- type IParam
- type InfType
- type IntpntHotstart
- type IoMode
- type LIInfItem
- type MPSFormat
- type Mark
- type MiQcQoReformMethod
- type MioContSolType
- type MioDataPermMethod
- type MioMode
- type MioNodeSelType
- type MioVarSelType
- type MskError
- type NameType
- type ObjectiveSense
- type OnOff
- type OptimizerType
- type OrderingType
- type ParameterType
- type PresolveMode
- type ProSta
- type ProblemItem
- type ProblemType
- type Purify
- type ResCode
- type ResCodeType
- type SParam
- type ScalingMethod
- type ScalingType
- type SensitivityType
- type SimReform
- type SimSelType
- type Simdegen
- type Simdupvec
- type Simhotstart
- type SolFormat
- type SolItem
- type SolSta
- type SolType
- type Solveform
- type StaKey
- type StarPointType
- type StreamType
- type SymmatType
- type Task
- func (task *Task) AnalyzeNames(whichstream StreamType, nametype NameType) error
- func (task *Task) AnalyzeProblem(whichstream StreamType) error
- func (task *Task) AnalyzeSolution(whichstream StreamType, whichsol SolType) error
- func (task *Task) AppendAcc(domidx int64, numafeidx int64, afeidxlist []int64, b []float64) error
- func (task *Task) AppendAccSeq(domidx int64, numafeidx int64, afeidxfirst int64, b []float64) error
- func (task *Task) AppendAccs(numaccs int64, domidxs []int64, numafeidx int64, afeidxlist []int64, ...) error
- func (task *Task) AppendAccsSeq(numaccs int64, domidxs []int64, numafeidx int64, afeidxfirst int64, ...) error
- func (task *Task) AppendAfes(num int64) error
- func (task *Task) AppendBarvars(num int32, dim []int32) error
- func (task *Task) AppendCone(ct ConeType, conepar float64, nummem int32, submem []int32) errordeprecated
- func (task *Task) AppendConeSeq(ct ConeType, conepar float64, nummem int32, j int32) errordeprecated
- func (task *Task) AppendConesSeq(num int32, ct []ConeType, conepar []float64, nummem []int32, j int32) errordeprecated
- func (task *Task) AppendCons(num int32) error
- func (task *Task) AppendDjcs(num int64) error
- func (task *Task) AppendDualExpConeDomain() (domidx int64, r error)
- func (task *Task) AppendDualGeoMeanConeDomain(n int64) (domidx int64, r error)
- func (task *Task) AppendDualPowerConeDomain(n int64, nleft int64, alpha []float64) (domidx int64, r error)
- func (task *Task) AppendPrimalExpConeDomain() (domidx int64, r error)
- func (task *Task) AppendPrimalGeoMeanConeDomain(n int64) (domidx int64, r error)
- func (task *Task) AppendPrimalPowerConeDomain(n int64, nleft int64, alpha []float64) (domidx int64, r error)
- func (task *Task) AppendQuadraticConeDomain(n int64) (domidx int64, r error)
- func (task *Task) AppendRDomain(n int64) (domidx int64, r error)
- func (task *Task) AppendRQuadraticConeDomain(n int64) (domidx int64, r error)
- func (task *Task) AppendRminusDomain(n int64) (domidx int64, r error)
- func (task *Task) AppendRotatedQuadraticConeDomain(n int64) (domidx int64, err error)
- func (task *Task) AppendRplusDomain(n int64) (domidx int64, r error)
- func (task *Task) AppendRzeroDomain(n int64) (domidx int64, r error)
- func (task *Task) AppendSparseSymMat(dim int32, nz int64, subi []int32, subj []int32, valij []float64) (idx int64, r error)
- func (task *Task) AppendSparseSymMatList(num int32, dims []int32, nz []int64, subi []int32, subj []int32, ...) (idx int64, r error)
- func (task *Task) AppendSvecPsdConeDomain(n int64) (domidx int64, r error)
- func (task *Task) AppendVars(num int32) error
- func (task *Task) BasisCond(nrmbasis []float64, nrminvbasis []float64) error
- func (task *Task) BkToStr(bk BoundKey) (str string, r error)
- func (task *Task) CheckMemtask(file string, line int32) error
- func (task *Task) ChgConBound(i int32, lower int32, finite int32, value float64) error
- func (task *Task) ChgVarBound(j int32, lower int32, finite int32, value float64) error
- func (task *Task) CommitChanges() error
- func (task *Task) ConetypeToStr(ct ConeType) (str string, r error)deprecated
- func (task *Task) DeleteSolution(whichsol SolType) error
- func (task *Task) DualSensitivity(numj int32, subj []int32, leftpricej []float64, rightpricej []float64, ...) error
- func (task *Task) EmptyAfeBarfRow(afeidx int64) error
- func (task *Task) EmptyAfeBarfRowList(numafeidx int64, afeidxlist []int64) error
- func (task *Task) EmptyAfeFCol(varidx int32) error
- func (task *Task) EmptyAfeFColList(numvaridx int64, varidx []int32) error
- func (task *Task) EmptyAfeFRow(afeidx int64) error
- func (task *Task) EmptyAfeFRowList(numafeidx int64, afeidx []int64) error
- func (task *Task) EvaluateAcc(whichsol SolType, accidx int64, activity []float64) ([]float64, error)
- func (task *Task) EvaluateAccs(whichsol SolType, activity []float64) error
- func (task *Task) GetACol(j int32, nzj []int32, subj []int32, valj []float64) error
- func (task *Task) GetAColNumNz(i int32) (nzj int32, r error)
- func (task *Task) GetAColSlice(first int32, last int32, maxnumnz int32, ptrb []int32, ptre []int32, ...) error
- func (task *Task) GetAColSlice64(first int32, last int32, maxnumnz int64, ptrb []int64, ptre []int64, ...) error
- func (task *Task) GetAColSliceNumNz(first int32, last int32) (numnz int32, r error)
- func (task *Task) GetAColSliceNumNz64(first int32, last int32) (numnz int64, r error)
- func (task *Task) GetAColSliceTrip(first int32, last int32, maxnumnz int64, subi []int32, subj []int32, ...) error
- func (task *Task) GetAPieceNumNz(firsti int32, lasti int32, firstj int32, lastj int32) (numnz int32, r error)
- func (task *Task) GetARow(i int32, nzi []int32, subi []int32, vali []float64) error
- func (task *Task) GetARowNumNz(i int32) (nzi int32, r error)
- func (task *Task) GetARowSlice(first int32, last int32, maxnumnz int32, ptrb []int32, ptre []int32, ...) error
- func (task *Task) GetARowSlice64(first int32, last int32, maxnumnz int64, ptrb []int64, ptre []int64, ...) error
- func (task *Task) GetARowSliceNumNz(first int32, last int32) (numnz int32, r error)
- func (task *Task) GetARowSliceNumNz64(first int32, last int32) (numnz int64, r error)
- func (task *Task) GetARowSliceTrip(first int32, last int32, maxnumnz int64, subi []int32, subj []int32, ...) error
- func (task *Task) GetATrip(maxnumnz int64, subi []int32, subj []int32, val []float64) error
- func (task *Task) GetATruncateTol(tolzero []float64) error
- func (task *Task) GetAccAfeIdxList(accidx int64, afeidxlist []int64) error
- func (task *Task) GetAccB(accidx int64, b []float64) error
- func (task *Task) GetAccBarfBlockTriplet(maxnumtrip int64, numtrip []int64, acc_afe []int64, bar_var []int32, ...) error
- func (task *Task) GetAccBarfNumBlockTriplets(numtrip []int64) error
- func (task *Task) GetAccDomain(accidx int64) (domidx int64, r error)
- func (task *Task) GetAccDotY(whichsol SolType, accidx int64, doty []float64) ([]float64, error)
- func (task *Task) GetAccDotYS(whichsol SolType, doty []float64) error
- func (task *Task) GetAccFNumnz() (accfnnz int64, r error)
- func (task *Task) GetAccFTrip(frow []int64, fcol []int32, fval []float64) error
- func (task *Task) GetAccGVector(g []float64) error
- func (task *Task) GetAccN(accidx int64) (int64, error)
- func (task *Task) GetAccNTot(n []int64) error
- func (task *Task) GetAccName(accidx int64, sizename int32) (name string, r error)
- func (task *Task) GetAccNameLen(accidx int64) (len int32, r error)
- func (task *Task) GetAccs(domidxlist []int64, afeidxlist []int64, b []float64) error
- func (task *Task) GetAfeBarfBlockTriplet(maxnumtrip int64, numtrip []int64, afeidx []int64, barvaridx []int32, ...) error
- func (task *Task) GetAfeBarfNumBlockTriplets(numtrip []int64) error
- func (task *Task) GetAfeBarfNumRowEntries(afeidx int64, numentr []int32) error
- func (task *Task) GetAfeBarfRow(afeidx int64, barvaridx []int32, ptrterm []int64, numterm []int64, ...) error
- func (task *Task) GetAfeBarfRowInfo(afeidx int64, numentr []int32, numterm []int64) error
- func (task *Task) GetAfeFNumNz() (numnz int64, r error)
- func (task *Task) GetAfeFRow(afeidx int64, numnz []int32, varidx []int32, val []float64) error
- func (task *Task) GetAfeFRowNumNz(afeidx int64) (numnz int32, r error)
- func (task *Task) GetAfeFTrip(afeidx []int64, varidx []int32, val []float64) error
- func (task *Task) GetAfeG(afeidx int64, g []float64) error
- func (task *Task) GetAfeGSlice(first int64, last int64, g []float64) error
- func (task *Task) GetAij(i int32, j int32, aij []float64) error
- func (task *Task) GetBarXj(whichsol SolType, j int32, barxj []float64) ([]float64, error)
- func (task *Task) GetBaraBlockTriplet(maxnum int64, num []int64, subi []int32, subj []int32, subk []int32, ...) error
- func (task *Task) GetBaraIdx(idx int64, maxnum int64, i []int32, j []int32, num []int64, sub []int64, ...) error
- func (task *Task) GetBaraIdxIJ(idx int64, i []int32, j []int32) error
- func (task *Task) GetBaraIdxInfo(idx int64, num []int64) error
- func (task *Task) GetBaraSparsity(maxnumnz int64, numnz []int64, idxij []int64) error
- func (task *Task) GetBarcBlockTriplet(maxnum int64, num []int64, subj []int32, subk []int32, subl []int32, ...) error
- func (task *Task) GetBarcIdx(idx int64, maxnum int64, j []int32, num []int64, sub []int64, ...) error
- func (task *Task) GetBarcIdxInfo(idx int64, num []int64) error
- func (task *Task) GetBarcIdxJ(idx int64, j []int32) error
- func (task *Task) GetBarcSparsity(maxnumnz int64, numnz []int64, idxj []int64) error
- func (task *Task) GetBarsJ(whichsol SolType, j int32, barsj []float64) error
- func (task *Task) GetBarsSlice(whichsol SolType, first int32, last int32, slicesize int64, ...) error
- func (task *Task) GetBarvarName(i int32, sizename int32) (name string, r error)
- func (task *Task) GetBarvarNameIndex(somename string, asgn []int32, index []int32) error
- func (task *Task) GetBarvarNameLen(i int32) (len int32, r error)
- func (task *Task) GetBarxJ(whichsol SolType, j int32, barxj []float64) error
- func (task *Task) GetBarxSlice(whichsol SolType, first int32, last int32, slicesize int64, ...) error
- func (task *Task) GetC(c []float64) error
- func (task *Task) GetCJ(j int32) (cj float64, r error)
- func (task *Task) GetCList(num int32, subj []int32, c []float64) error
- func (task *Task) GetCSlice(first int32, last int32, c []float64) error
- func (task *Task) GetCfix() (cfix float64, r error)
- func (task *Task) GetConBound(i int32, bk []BoundKey, bl []float64, bu []float64) error
- func (task *Task) GetConBoundSlice(first int32, last int32, bk []BoundKey, bl []float64, bu []float64) error
- func (task *Task) GetConName(i int32, sizename int32) (name string, r error)
- func (task *Task) GetConNameIndex(somename string, asgn []int32) (index int32, r error)
- func (task *Task) GetConNameLen(i int32) (len int32, r error)
- func (task *Task) GetCone(k int32, ct []ConeType, conepar []float64, nummem []int32, submem []int32) errordeprecated
- func (task *Task) GetConeInfo(k int32, ct []ConeType, conepar []float64, nummem []int32) errordeprecated
- func (task *Task) GetConeName(i int32, sizename int32) (name string, r error)deprecated
- func (task *Task) GetConeNameIndex(somename string, asgn []int32, index []int32) errordeprecated
- func (task *Task) GetConeNameLen(i int32) (len int32, r error)deprecated
- func (task *Task) GetDimBarvarJ(j int32) (dimbarvarj int32, r error)
- func (task *Task) GetDjcAfeIdxList(djcidx int64, afeidxlist []int64) error
- func (task *Task) GetDjcB(djcidx int64, b []float64) error
- func (task *Task) GetDjcDomainIdxList(djcidx int64, domidxlist []int64) error
- func (task *Task) GetDjcName(djcidx int64, sizename int32) (name string, r error)
- func (task *Task) GetDjcNameLen(djcidx int64) (len int32, r error)
- func (task *Task) GetDjcNumAfe(djcidx int64) (numafe int64, r error)
- func (task *Task) GetDjcNumAfeTot() (numafetot int64, r error)
- func (task *Task) GetDjcNumDomain(djcidx int64) (numdomain int64, r error)
- func (task *Task) GetDjcNumDomainTot() (numdomaintot int64, r error)
- func (task *Task) GetDjcNumTerm(djcidx int64) (numterm int64, r error)
- func (task *Task) GetDjcNumTermTot() (numtermtot int64, r error)
- func (task *Task) GetDjcTermSizeList(djcidx int64, termsizelist []int64) error
- func (task *Task) GetDjcs(domidxlist []int64, afeidxlist []int64, b []float64, termsizelist []int64, ...) error
- func (task *Task) GetDomainN(domidx int64) (n int64, r error)
- func (task *Task) GetDomainName(domidx int64, sizename int32) (name string, r error)
- func (task *Task) GetDomainNameLen(domidx int64) (len int32, r error)
- func (task *Task) GetDomainType(domidx int64) (domtype DomainType, r error)
- func (task *Task) GetDouInf(whichdinf DInfItem) (dvalue float64, r error)
- func (task *Task) GetDouParam(param DParam) (parvalue float64, r error)
- func (task *Task) GetDualObj(whichsol SolType) (dualobj float64, r error)
- func (task *Task) GetDualSolutionNorms(whichsol SolType, nrmy []float64, nrmslc []float64, nrmsuc []float64, ...) error
- func (task *Task) GetDviolAcc(whichsol SolType, numaccidx int64, accidxlist []int64, viol []float64) error
- func (task *Task) GetDviolBarvar(whichsol SolType, num int32, sub []int32, viol []float64) error
- func (task *Task) GetDviolCon(whichsol SolType, num int32, sub []int32, viol []float64) error
- func (task *Task) GetDviolCones(whichsol SolType, num int32, sub []int32, viol []float64) errordeprecated
- func (task *Task) GetDviolVar(whichsol SolType, num int32, sub []int32, viol []float64) error
- func (task *Task) GetInfIndex(inftype InfType, infname string) (infindex int32, r error)
- func (task *Task) GetInfMax(inftype InfType) (infmax int32, r error)
- func (task *Task) GetInfName(inftype InfType, whichinf int32) (infname string, r error)
- func (task *Task) GetIntInf(whichiinf IInfItem) (ivalue int32, r error)
- func (task *Task) GetIntParam(param IParam) (parvalue int32, r error)
- func (task *Task) GetLasterror(lastrescode []ResCode, sizelastmsg int32, lastmsglen []int32, lastmsg *byte) error
- func (task *Task) GetLasterror64(lastrescode []ResCode, sizelastmsg int64, lastmsglen []int64, lastmsg *byte) error
- func (task *Task) GetLenBarvarJ(j int32) (lenbarvarj int64, r error)
- func (task *Task) GetLintInf(whichliinf LIInfItem) (ivalue int64, r error)
- func (task *Task) GetMaxNameLen() (maxlen int32, r error)
- func (task *Task) GetMaxNumANz() (maxnumanz int32, r error)
- func (task *Task) GetMaxNumAnz64() (maxnumanz int64, r error)
- func (task *Task) GetMaxNumBarvar() (maxnumbarvar int32, r error)
- func (task *Task) GetMaxNumCon() (maxnumcon int32, r error)
- func (task *Task) GetMaxNumCone() (maxnumcone int32, r error)deprecated
- func (task *Task) GetMaxNumQNz() (maxnumqnz int32, r error)
- func (task *Task) GetMaxNumQnz64() (maxnumqnz int64, r error)
- func (task *Task) GetMaxNumVar() (maxnumvar int32, r error)
- func (task *Task) GetMemusagetask(meminuse []int64, maxmemuse []int64) error
- func (task *Task) GetNaDouInf(infitemname string, dvalue []float64) error
- func (task *Task) GetNaDouParam(paramname string) (parvalue float64, r error)
- func (task *Task) GetNaIntInf(infitemname string) (ivalue int32, r error)
- func (task *Task) GetNaIntParam(paramname string) (parvalue int32, r error)
- func (task *Task) GetNaStrParam(paramname string, sizeparamname int32) (len int32, parvalue string, r error)
- func (task *Task) GetNumANz() (numanz int32, r error)
- func (task *Task) GetNumANz64() (numanz int64, r error)
- func (task *Task) GetNumAcc() (num int64, r error)
- func (task *Task) GetNumAfe() (numafe int64, r error)
- func (task *Task) GetNumBaraBlockTriplets() (num int64, r error)
- func (task *Task) GetNumBaraNz() (nz int64, r error)
- func (task *Task) GetNumBarcBlockTriplets() (num int64, r error)
- func (task *Task) GetNumBarcNz() (nz int64, r error)
- func (task *Task) GetNumBarvar() (numbarvar int32, r error)
- func (task *Task) GetNumCon() (numcon int32, r error)
- func (task *Task) GetNumCone() (numcone int32, r error)deprecated
- func (task *Task) GetNumConeMem(k int32) (nummem int32, r error)deprecated
- func (task *Task) GetNumDjc() (num int64, r error)
- func (task *Task) GetNumDomain() (numdomain int64, r error)
- func (task *Task) GetNumIntVar() (numintvar int32, r error)
- func (task *Task) GetNumParam(partype ParameterType) (numparam int32, r error)
- func (task *Task) GetNumQConKNz(k int32) (numqcnz int32, r error)
- func (task *Task) GetNumQConKNz64(k int32) (numqcnz int64, r error)
- func (task *Task) GetNumQObjNz() (numqonz int32, r error)
- func (task *Task) GetNumQObjNz64() (numqonz int64, r error)
- func (task *Task) GetNumSymMat() (num int64, r error)
- func (task *Task) GetNumVar() (numvar int32, r error)
- func (task *Task) GetObjName(sizeobjname int32) (objname string, r error)
- func (task *Task) GetObjNameLen() (len int32, r error)
- func (task *Task) GetObjSense() (sense ObjectiveSense, r error)
- func (task *Task) GetParamMax(partype ParameterType) (parammax int32, r error)
- func (task *Task) GetParamName(partype ParameterType, param int32) (parname string, r error)
- func (task *Task) GetPowerDomainAlpha(domidx int64, alpha []float64) error
- func (task *Task) GetPowerDomainInfo(domidx int64, n []int64, nleft []int64) error
- func (task *Task) GetPrimalObj(whichsol SolType) (primalobj float64, r error)
- func (task *Task) GetPrimalSolutionNorms(whichsol SolType, nrmxc []float64, nrmxx []float64, nrmbarx []float64) error
- func (task *Task) GetProSta(whichsol SolType) (problemsta ProSta, r error)
- func (task *Task) GetProbType() (probtype ProblemType, r error)
- func (task *Task) GetPviolAcc(whichsol SolType, numaccidx int64, accidxlist []int64, viol []float64) error
- func (task *Task) GetPviolBarvar(whichsol SolType, num int32, sub []int32, viol []float64) error
- func (task *Task) GetPviolCon(whichsol SolType, num int32, sub []int32, viol []float64) error
- func (task *Task) GetPviolCones(whichsol SolType, num int32, sub []int32, viol []float64) errordeprecated
- func (task *Task) GetPviolDjc(whichsol SolType, numdjcidx int64, djcidxlist []int64, viol []float64) error
- func (task *Task) GetPviolVar(whichsol SolType, num int32, sub []int32, viol []float64) error
- func (task *Task) GetQConK(k int32, maxnumqcnz int32, numqcnz []int32, qcsubi []int32, qcsubj []int32, ...) error
- func (task *Task) GetQConK64(k int32, maxnumqcnz int64, numqcnz []int64, qcsubi []int32, qcsubj []int32, ...) error
- func (task *Task) GetQObj(maxnumqonz int32, numqonz []int32, qosubi []int32, qosubj []int32, ...) error
- func (task *Task) GetQObj64(maxnumqonz int64, numqonz []int64, qosubi []int32, qosubj []int32, ...) error
- func (task *Task) GetQObjIJ(i int32, j int32, qoij []float64) error
- func (task *Task) GetReducedCosts(whichsol SolType, first int32, last int32, redcosts []float64) error
- func (task *Task) GetSkc(whichsol SolType, skc []StaKey) error
- func (task *Task) GetSkcSlice(whichsol SolType, first int32, last int32, skc []StaKey) error
- func (task *Task) GetSkn(whichsol SolType, skn []StaKey) error
- func (task *Task) GetSkx(whichsol SolType, skx []StaKey) error
- func (task *Task) GetSkxSlice(whichsol SolType, first int32, last int32, skx []StaKey) error
- func (task *Task) GetSlc(whichsol SolType, slc []float64) error
- func (task *Task) GetSlcSlice(whichsol SolType, first int32, last int32, slc []float64) error
- func (task *Task) GetSlx(whichsol SolType, slx []float64) error
- func (task *Task) GetSlxSlice(whichsol SolType, first int32, last int32, slx []float64) error
- func (task *Task) GetSnx(whichsol SolType, snx []float64) error
- func (task *Task) GetSnxSlice(whichsol SolType, first int32, last int32, snx []float64) error
- func (task *Task) GetSolSta(whichsol SolType) (solutionsta SolSta, r error)
- func (task *Task) GetSolution(whichsol SolType, problemsta []ProSta, solutionsta []SolSta, skc []StaKey, ...) error
- func (task *Task) GetSolutionInfo(whichsol SolType, pobj []float64, pviolcon []float64, pviolvar []float64, ...) error
- func (task *Task) GetSolutionInfoNew(whichsol SolType, pobj []float64, pviolcon []float64, pviolvar []float64, ...) error
- func (task *Task) GetSolutionNew(whichsol SolType, problemsta []ProSta, solutionsta []SolSta, skc []StaKey, ...) error
- func (task *Task) GetSolutionSlice(whichsol SolType, solitem SolItem, first int32, last int32, values []float64) error
- func (task *Task) GetSparseSymMat(idx int64, maxlen int64, subi []int32, subj []int32, valij []float64) error
- func (task *Task) GetStrParam(param SParam, maxlen int32, len []int32, parvalue *byte) error
- func (task *Task) GetStrParamLen(param SParam) (len int32, r error)
- func (task *Task) GetSuc(whichsol SolType, suc []float64) error
- func (task *Task) GetSucSlice(whichsol SolType, first int32, last int32, suc []float64) error
- func (task *Task) GetSux(whichsol SolType, sux []float64) error
- func (task *Task) GetSuxSlice(whichsol SolType, first int32, last int32, sux []float64) error
- func (task *Task) GetSymMatInfo(idx int64, dim []int32, nz []int64, mattype []SymmatType) error
- func (task *Task) GetSymbCon(i int32, sizevalue int32, name *byte, value []int32) error
- func (task *Task) GetTaskName(sizetaskname int32) (taskname string, r error)
- func (task *Task) GetTaskNameLen() (len int32, r error)
- func (task *Task) GetVarBound(i int32, bk []BoundKey, bl []float64, bu []float64) error
- func (task *Task) GetVarBoundSlice(first int32, last int32, bk []BoundKey, bl []float64, bu []float64) error
- func (task *Task) GetVarName(j int32, sizename int32) (name string, r error)
- func (task *Task) GetVarNameIndex(somename string, asgn []int32) (index int32, r error)
- func (task *Task) GetVarNameLen(i int32) (len int32, r error)
- func (task *Task) GetVarType(j int32) (vartype VariableType, r error)
- func (task *Task) GetVarTypeList(num int32, subj []int32, vartype []VariableType) error
- func (task *Task) GetXc(whichsol SolType, xc []float64) error
- func (task *Task) GetXcSlice(whichsol SolType, first int32, last int32, xc []float64) error
- func (task *Task) GetXx(whichsol SolType, xx []float64) ([]float64, error)
- func (task *Task) GetXxSlice(whichsol SolType, first, last int32, xx []float64) ([]float64, error)
- func (task *Task) GetY(whichsol SolType, y []float64) error
- func (task *Task) GetYSlice(whichsol SolType, first int32, last int32, y []float64) error
- func (task *Task) InfeasibilityReport(whichstream StreamType, whichsol SolType) error
- func (task *Task) InitBasisSolve(basis []int32) error
- func (task *Task) InputData(maxnumcon int32, maxnumvar int32, numcon int32, numvar int32, c []float64, ...) error
- func (task *Task) Inputdata64(maxnumcon int32, maxnumvar int32, numcon int32, numvar int32, c []float64, ...) error
- func (task *Task) IsDouParName(parname string) (param DParam, r error)
- func (task *Task) IsIntParName(parname string) (param IParam, r error)
- func (task *Task) IsStrParName(parname string) (param SParam, r error)
- func (task *Task) LinkFiletotaskstream(whichstream StreamType, filename string, append int32) error
- func (task *Task) LinkFuncToTaskStream(whichstream StreamType, w io.Writer) error
- func (task *Task) OneSolutionSummary(whichstream StreamType, whichsol SolType) error
- func (task *Task) Optimize() error
- func (task *Task) OptimizeRmt(address string, accesstoken string) (trmcode ResCode, r error)
- func (task *Task) OptimizeTrm() (trmcode ResCode, r error)
- func (task *Task) OptimizerSummary(whichstream StreamType) error
- func (task *Task) PrimalRepair(wlc []float64, wuc []float64, wlx []float64, wux []float64) error
- func (task *Task) PrimalSensitivity(numi int32, subi []int32, marki []Mark, numj int32, subj []int32, markj []Mark, ...) error
- func (task *Task) PrintParam() error
- func (task *Task) ProStaToStr(problemsta ProSta) (str string, r error)
- func (task *Task) ProbtypeToStr(probtype ProblemType) (str string, r error)
- func (task *Task) PutACol(j int32, nzj int32, subj []int32, valj []float64) error
- func (task *Task) PutAColList(num int32, sub []int32, ptrb []int32, ptre []int32, asub []int32, ...) error
- func (task *Task) PutAColList64(num int32, sub []int32, ptrb []int64, ptre []int64, asub []int32, ...) error
- func (task *Task) PutAColSlice(first int32, last int32, ptrb []int32, ptre []int32, asub []int32, ...) error
- func (task *Task) PutAColSlice64(first int32, last int32, ptrb []int64, ptre []int64, asub []int32, ...) error
- func (task *Task) PutARow(i int32, nzi int32, subi []int32, vali []float64) error
- func (task *Task) PutARowList(num int32, sub []int32, ptrb []int32, ptre []int32, asub []int32, ...) error
- func (task *Task) PutARowList64(num int32, sub []int32, ptrb []int64, ptre []int64, asub []int32, ...) error
- func (task *Task) PutARowSlice(first int32, last int32, ptrb []int32, ptre []int32, asub []int32, ...) error
- func (task *Task) PutARowSlice64(first int32, last int32, ptrb []int64, ptre []int64, asub []int32, ...) error
- func (task *Task) PutATruncateTol(tolzero float64) error
- func (task *Task) PutAcc(accidx int64, domidx int64, numafeidx int64, afeidxlist []int64, b []float64) error
- func (task *Task) PutAccB(accidx int64, lengthb int64, b []float64) error
- func (task *Task) PutAccBJ(accidx int64, j int64, bj float64) error
- func (task *Task) PutAccDotY(whichsol SolType, accidx int64, doty []float64) error
- func (task *Task) PutAccList(numaccs int64, accidxs []int64, domidxs []int64, numafeidx int64, ...) error
- func (task *Task) PutAccName(accidx int64, name string) error
- func (task *Task) PutAfeBarfBlockTriplet(numtrip int64, afeidx []int64, barvaridx []int32, subk []int32, subl []int32, ...) error
- func (task *Task) PutAfeBarfEntry(afeidx int64, barvaridx int32, numterm int64, termidx []int64, ...) error
- func (task *Task) PutAfeBarfEntryList(numafeidx int64, afeidx []int64, barvaridx []int32, numterm []int64, ...) error
- func (task *Task) PutAfeBarfRow(afeidx int64, numentr int32, barvaridx []int32, numterm []int64, ...) error
- func (task *Task) PutAfeFCol(varidx int32, numnz int64, afeidx []int64, val []float64) error
- func (task *Task) PutAfeFEntry(afeidx int64, varidx int32, value float64) error
- func (task *Task) PutAfeFEntryList(numentr int64, afeidx []int64, varidx []int32, val []float64) error
- func (task *Task) PutAfeFRow(afeidx int64, numnz int32, varidx []int32, val []float64) error
- func (task *Task) PutAfeFRowList(numafeidx int64, afeidx []int64, numnzrow []int32, ptrrow []int64, ...) error
- func (task *Task) PutAfeG(afeidx int64, g float64) error
- func (task *Task) PutAfeGList(numafeidx int64, afeidx []int64, g []float64) error
- func (task *Task) PutAfeGSlice(first int64, last int64, slice []float64) error
- func (task *Task) PutAij(i int32, j int32, aij float64) error
- func (task *Task) PutAijList(num int32, subi []int32, subj []int32, valij []float64) error
- func (task *Task) PutAijList64(num int64, subi []int32, subj []int32, valij []float64) error
- func (task *Task) PutBaraBlockTriplet(num int64, subi []int32, subj []int32, subk []int32, subl []int32, ...) error
- func (task *Task) PutBaraIj(i int32, j int32, num int64, sub []int64, weights []float64) error
- func (task *Task) PutBaraIjList(num int32, subi []int32, subj []int32, alphaptrb []int64, alphaptre []int64, ...) error
- func (task *Task) PutBaraRowList(num int32, subi []int32, ptrb []int64, ptre []int64, subj []int32, ...) error
- func (task *Task) PutBarcBlockTriplet(num int64, subj []int32, subk []int32, subl []int32, valjkl []float64) error
- func (task *Task) PutBarcJ(j int32, num int64, sub []int64, weights []float64) error
- func (task *Task) PutBarsJ(whichsol SolType, j int32, barsj []float64) error
- func (task *Task) PutBarvarName(j int32, name string) error
- func (task *Task) PutBarxJ(whichsol SolType, j int32, barxj []float64) error
- func (task *Task) PutCJ(j int32, cj float64) error
- func (task *Task) PutCList(num int32, subj []int32, val []float64) error
- func (task *Task) PutCSlice(first int32, last int32, slice []float64) error
- func (task *Task) PutCfix(cfix float64) error
- func (task *Task) PutConBound(i int32, bkc BoundKey, blc float64, buc float64) error
- func (task *Task) PutConBoundList(num int32, sub []int32, bkc []BoundKey, blc []float64, buc []float64) error
- func (task *Task) PutConBoundListConst(num int32, sub []int32, bkc BoundKey, blc float64, buc float64) error
- func (task *Task) PutConBoundSlice(first int32, last int32, bkc []BoundKey, blc []float64, buc []float64) error
- func (task *Task) PutConBoundSliceConst(first int32, last int32, bkc BoundKey, blc float64, buc float64) error
- func (task *Task) PutConName(i int32, name string) error
- func (task *Task) PutConSolutionI(i int32, whichsol SolType, sk StaKey, x float64, sl float64, su float64) error
- func (task *Task) PutCone(k int32, ct ConeType, conepar float64, nummem int32, submem []int32) errordeprecated
- func (task *Task) PutConeName(j int32, name string) errordeprecated
- func (task *Task) PutDjc(djcidx int64, numdomidx int64, domidxlist []int64, numafeidx int64, ...) error
- func (task *Task) PutDjcName(djcidx int64, name string) error
- func (task *Task) PutDjcSlice(idxfirst int64, idxlast int64, numdomidx int64, domidxlist []int64, ...) error
- func (task *Task) PutDomainName(domidx int64, name string) error
- func (task *Task) PutDouParam(param DParam, parvalue float64) error
- func (task *Task) PutIntParam(param IParam, parvalue int32) error
- func (task *Task) PutMaxNumANz(maxnumanz int64) error
- func (task *Task) PutMaxNumAcc(maxnumacc int64) error
- func (task *Task) PutMaxNumAfe(maxnumafe int64) error
- func (task *Task) PutMaxNumBarvar(maxnumbarvar int32) error
- func (task *Task) PutMaxNumCon(maxnumcon int32) error
- func (task *Task) PutMaxNumCone(maxnumcone int32) errordeprecated
- func (task *Task) PutMaxNumDjc(maxnumdjc int64) error
- func (task *Task) PutMaxNumDomain(maxnumdomain int64) error
- func (task *Task) PutMaxNumQNz(maxnumqnz int64) error
- func (task *Task) PutMaxNumVar(maxnumvar int32) error
- func (task *Task) PutNaDouParam(paramname string, parvalue float64) error
- func (task *Task) PutNaIntParam(paramname string, parvalue int32) error
- func (task *Task) PutNaStrParam(paramname string, parvalue string) error
- func (task *Task) PutObjName(objname string) error
- func (task *Task) PutObjSense(sense ObjectiveSense) error
- func (task *Task) PutOptserverHost(host string) error
- func (task *Task) PutParam(parname string, parvalue string) error
- func (task *Task) PutQCon(numqcnz int32, qcsubk []int32, qcsubi []int32, qcsubj []int32, qcval []float64) error
- func (task *Task) PutQConK(k int32, numqcnz int32, qcsubi []int32, qcsubj []int32, qcval []float64) error
- func (task *Task) PutQObj(numqonz int32, qosubi []int32, qosubj []int32, qoval []float64) error
- func (task *Task) PutQObjIJ(i int32, j int32, qoij float64) error
- func (task *Task) PutSkc(whichsol SolType, skc []StaKey) error
- func (task *Task) PutSkcSlice(whichsol SolType, first int32, last int32, skc []StaKey) error
- func (task *Task) PutSkx(whichsol SolType, skx []StaKey) error
- func (task *Task) PutSkxSlice(whichsol SolType, first int32, last int32, skx []StaKey) error
- func (task *Task) PutSlc(whichsol SolType, slc []float64) error
- func (task *Task) PutSlcSlice(whichsol SolType, first int32, last int32, slc []float64) error
- func (task *Task) PutSlx(whichsol SolType, slx []float64) error
- func (task *Task) PutSlxSlice(whichsol SolType, first int32, last int32, slx []float64) error
- func (task *Task) PutSnx(whichsol SolType, sux []float64) error
- func (task *Task) PutSnxSlice(whichsol SolType, first int32, last int32, snx []float64) error
- func (task *Task) PutSolution(whichsol SolType, skc []StaKey, skx []StaKey, skn []StaKey, xc []float64, ...) error
- func (task *Task) PutSolutionNew(whichsol SolType, skc []StaKey, skx []StaKey, skn []StaKey, xc []float64, ...) error
- func (task *Task) PutSolutionYI(i int32, whichsol SolType, y float64) error
- func (task *Task) PutStrParam(param SParam, parvalue string) error
- func (task *Task) PutSuc(whichsol SolType, suc []float64) error
- func (task *Task) PutSucSlice(whichsol SolType, first int32, last int32, suc []float64) error
- func (task *Task) PutSux(whichsol SolType, sux []float64) error
- func (task *Task) PutSuxSlice(whichsol SolType, first int32, last int32, sux []float64) error
- func (task *Task) PutTaskName(taskname string) error
- func (task *Task) PutVarBound(j int32, bkx BoundKey, blx float64, bux float64) error
- func (task *Task) PutVarBoundList(num int32, sub []int32, bkx []BoundKey, blx []float64, bux []float64) error
- func (task *Task) PutVarBoundListConst(num int32, sub []int32, bkx BoundKey, blx float64, bux float64) error
- func (task *Task) PutVarBoundSlice(first int32, last int32, bkx []BoundKey, blx []float64, bux []float64) error
- func (task *Task) PutVarBoundSliceConst(first int32, last int32, bkx BoundKey, blx float64, bux float64) error
- func (task *Task) PutVarName(j int32, name string) error
- func (task *Task) PutVarSolutionJ(j int32, whichsol SolType, sk StaKey, x float64, sl float64, su float64, ...) error
- func (task *Task) PutVarType(j int32, vartype VariableType) error
- func (task *Task) PutVarTypeList(num int32, subj []int32, vartype []VariableType) error
- func (task *Task) PutXc(whichsol SolType, xc []float64) error
- func (task *Task) PutXcSlice(whichsol SolType, first int32, last int32, xc []float64) error
- func (task *Task) PutXx(whichsol SolType, xx []float64) error
- func (task *Task) PutXxSlice(whichsol SolType, first int32, last int32, xx []float64) error
- func (task *Task) PutY(whichsol SolType, y []float64) error
- func (task *Task) PutYSlice(whichsol SolType, first int32, last int32, y []float64) error
- func (task *Task) ReadBSolution(filename string, compress CompressType) error
- func (task *Task) ReadData(filename string) error
- func (task *Task) ReadDataFormat(filename string, format DataFormat, compress CompressType) error
- func (task *Task) ReadDataautoformat(filename string) error
- func (task *Task) ReadJsonSol(filename string) error
- func (task *Task) ReadJsonString(data string) error
- func (task *Task) ReadLpString(data string) error
- func (task *Task) ReadOpfString(data string) error
- func (task *Task) ReadParamFile(filename string) error
- func (task *Task) ReadPtfString(data string) error
- func (task *Task) ReadSolution(whichsol SolType, filename string) error
- func (task *Task) ReadSolutionFile(filename string) error
- func (task *Task) ReadSummary(whichstream StreamType) error
- func (task *Task) ReadTask(filename string) error
- func (task *Task) RemoveBarvars(num int32, subset []int32) error
- func (task *Task) RemoveCones(num int32, subset []int32) errordeprecated
- func (task *Task) RemoveCons(num int32, subset []int32) error
- func (task *Task) RemoveVars(num int32, subset []int32) error
- func (task *Task) ResizeTask(maxnumcon int32, maxnumvar int32, maxnumcone int32, maxnumanz int64, ...) error
- func (task *Task) SensitivityReport(whichstream StreamType) error
- func (task *Task) SetDefaults() error
- func (task *Task) SkToStr(sk StaKey) (str string, r error)
- func (task *Task) SolStaToStr(solutionsta SolSta) (str string, r error)
- func (task *Task) SolutionDef(whichsol SolType) (isdef bool, r error)
- func (task *Task) SolutionSummary(whichstream StreamType) error
- func (task *Task) SolveWithBasis(transp bool, numnz int32, sub []int32, val []float64, numnzout []int32) error
- func (task *Task) StrToConeType(str string, conetype []ConeType) errordeprecated
- func (task *Task) StrToSk(str string, sk []StaKey) error
- func (task *Task) Toconic() errordeprecated
- func (task *Task) UnlinkFuncfromtaskstream(whichstream StreamType) error
- func (task *Task) UpdateSolutionInfo(whichsol SolType) error
- func (task *Task) WhichParam(parname string, partype []ParameterType, param []int32) error
- func (task *Task) WriteBSolution(filename string, compress CompressType) error
- func (task *Task) WriteBSolutionHandle(handle io.Writer, compress CompressType) error
- func (task *Task) WriteData(filename string) error
- func (task *Task) WriteDataHandle(handle io.Writer, format DataFormat, compress CompressType) error
- func (task *Task) WriteJsonSol(filename string) error
- func (task *Task) WriteParamFile(filename string) error
- func (task *Task) WriteSolution(whichsol SolType, filename string) error
- func (task *Task) WriteSolutionFile(filename string) error
- func (task *Task) WriteTask(filename string) error
- type Transpose
- type UpLo
- type VariableType
- type XmlWriterOutputType
Examples ¶
- Package (AffineConicConstraints_acc1)
- Package (AffineConicConstraints_acc2)
- Package (Blas_lapack)
- Package (ConicExponentialOptimization1_ceo1)
- Package (ConicQuadraticOptimization1_cqo1)
- Package (DisjunctiveConstraint_djc1)
- Package (GeometricProgram1_gp1)
- Package (Helloworld)
- Package (LinearOptimization1_lo1)
- Package (Logistic)
- Package (MixedIntegeLinearOptimization1_milo1)
- Package (MixedIntegerConicOptimization_mico1)
- Package (MixedIntegerProgrammingWithInitialSolution_mioinitsol)
- Package (Portfolio_1_basic)
- Package (Portfolio_2_frontier)
- Package (Portfolio_3_impact)
- Package (Portfolio_4_transcost)
- Package (Portfolio_5_Card)
- Package (Portfolio_6_factor)
- Package (PowerCone_pow1)
- Package (QuadraticOptimization_qcqo1)
- Package (QuadraticOptimization_qo1)
- Package (Reoptimization)
- Package (SemidefiniteOptimization_sdo1)
- Package (SemidefiniteOptimization_sdo2)
- Package (SemidefiniteOptimization_sdo_lmi)
- Task.WriteDataHandle
Constants ¶
const INFINITY float64 = C.MSK_INFINITY
INFINITY is MSK_INFINITY (which is different from the double's infinity)
const MAX_STR_LEN = C.MSK_MAX_STR_LEN
MSK_MAX_STR_LEN is the max length of strings in mosek
Variables ¶
This section is empty.
Functions ¶
func CallbackcodeToStr ¶ added in v0.2.7
func CallbackcodeToStr( code CallbackCode, ) (callbackcodestr string, r error)
CallbackcodeToStr is wrapping MSK_callbackcodetostr
func DinfitemToStr ¶ added in v0.6.0
DinfitemToStr is wrapping MSK_dinfitemtostr
func GetBuildInfo ¶ added in v0.2.3
GetBuildInfo is wrapping MSK_getbuildinfo
func GetCodedesc ¶ added in v0.2.1
GetCodedesc is wrapping MSK_getcodedesc
func GetVersion ¶ added in v0.2.1
GetVersion is wrapping MSK_getversion
func IinfitemToStr ¶ added in v0.6.0
IinfitemToStr is wrapping MSK_iinfitemtostr
func IsMskError ¶ added in v0.2.10
IsMskError checks if the err wraps MskError
func Isinfinity ¶ added in v0.2.0
Isinfinity is wrapping MSK_isinfinity
func Licensecleanup ¶ added in v0.2.0
func Licensecleanup() error
Licensecleanup is wrapping MSK_licensecleanup
func LiinfitemToStr ¶ added in v0.6.0
LiinfitemToStr is wrapping MSK_liinfitemtostr
func NewError ¶ added in v0.2.10
NewError creates an error from [res.Code]. The returned error will be nil for [res.OK]. The underlying type of the error is a MskError.
func NewErrorFromInt ¶ added in v0.8.0
func RescodeToStr ¶ added in v0.6.0
RescodeToStr is wrapping MSK_rescodetostr
func Symnamtovalue ¶ added in v0.2.0
Symnamtovalue is wrapping MSK_symnamtovalue
func Utf8towchar ¶ added in v0.2.0
func Utf8towchar( outputlen uint64, len []uint64, conv []uint64, output []int32, input string, ) error
Utf8towchar is wrapping MSK_utf8towchar
func Wchartoutf8 ¶ added in v0.2.0
func Wchartoutf8( outputlen uint64, len []uint64, conv []uint64, output *byte, input []int32, ) error
Wchartoutf8 is wrapping MSK_wchartoutf8
Types ¶
type BasIndType ¶ added in v0.2.10
type BasIndType uint32
BasIndType is MSKbasindtype_enum.
Basis identification
const ( BI_NEVER BasIndType = C.MSK_BI_NEVER // Never do basis identification. BI_ALWAYS BasIndType = C.MSK_BI_ALWAYS // Basis identification is always performed even if the interior-point optimizer terminates abnormally. BI_NO_ERROR BasIndType = C.MSK_BI_NO_ERROR // Basis identification is performed if the interior-point optimizer terminates without an error. BI_IF_FEASIBLE BasIndType = C.MSK_BI_IF_FEASIBLE // Basis identification is not performed if the interior-point optimizer terminates with a problem status saying that the problem is primal or dual infeasible. BI_RESERVERED BasIndType = C.MSK_BI_RESERVERED // Not currently in use. )
func (BasIndType) String ¶ added in v0.2.10
func (e BasIndType) String() string
type BoundKey ¶
type BoundKey uint32
BoundKey is MSKboundkey_enum.
Bound keys
const ( BK_LO BoundKey = C.MSK_BK_LO // The constraint or variable has a finite lower bound and an infinite upper bound. BK_UP BoundKey = C.MSK_BK_UP // The constraint or variable has an infinite lower bound and an finite upper bound. BK_FX BoundKey = C.MSK_BK_FX // The constraint or variable is fixed. BK_FR BoundKey = C.MSK_BK_FR // The constraint or variable is free. BK_RA BoundKey = C.MSK_BK_RA // The constraint or variable is ranged. )
type BranchDir ¶ added in v0.2.0
type BranchDir uint32
BranchDir is MSKbranchdir_enum.
Specifies the branching direction.
const ( BRANCH_DIR_FREE BranchDir = C.MSK_BRANCH_DIR_FREE // The mixed-integer optimizer decides which branch to choose. BRANCH_DIR_UP BranchDir = C.MSK_BRANCH_DIR_UP // The mixed-integer optimizer always chooses the up branch first. BRANCH_DIR_DOWN BranchDir = C.MSK_BRANCH_DIR_DOWN // The mixed-integer optimizer always chooses the down branch first. BRANCH_DIR_NEAR BranchDir = C.MSK_BRANCH_DIR_NEAR // Branch in direction nearest to selected fractional variable. BRANCH_DIR_FAR BranchDir = C.MSK_BRANCH_DIR_FAR // Branch in direction farthest from selected fractional variable. BRANCH_DIR_ROOT_LP BranchDir = C.MSK_BRANCH_DIR_ROOT_LP // Chose direction based on root lp value of selected variable. BRANCH_DIR_GUIDED BranchDir = C.MSK_BRANCH_DIR_GUIDED // Branch in direction of current incumbent. BRANCH_DIR_PSEUDOCOST BranchDir = C.MSK_BRANCH_DIR_PSEUDOCOST // Branch based on the pseudocost of the variable. )
type CallbackCode ¶ added in v0.2.0
type CallbackCode uint32
CallbackCode is MSKcallbackcode_enum.
Progress callback codes
const ( CALLBACK_BEGIN_BI CallbackCode = C.MSK_CALLBACK_BEGIN_BI // The basis identification procedure has been started. CALLBACK_BEGIN_CONIC CallbackCode = C.MSK_CALLBACK_BEGIN_CONIC // The callback function is called when the conic optimizer is started. CALLBACK_BEGIN_DUAL_BI CallbackCode = C.MSK_CALLBACK_BEGIN_DUAL_BI // The callback function is called from within the basis identification procedure when the dual phase is started. CALLBACK_BEGIN_DUAL_SENSITIVITY CallbackCode = C.MSK_CALLBACK_BEGIN_DUAL_SENSITIVITY // Dual sensitivity analysis is started. CALLBACK_BEGIN_DUAL_SETUP_BI CallbackCode = C.MSK_CALLBACK_BEGIN_DUAL_SETUP_BI // The callback function is called when the dual BI phase is started. CALLBACK_BEGIN_DUAL_SIMPLEX CallbackCode = C.MSK_CALLBACK_BEGIN_DUAL_SIMPLEX // The callback function is called when the dual simplex optimizer started. CALLBACK_BEGIN_DUAL_SIMPLEX_BI CallbackCode = C.MSK_CALLBACK_BEGIN_DUAL_SIMPLEX_BI // The callback function is called from within the basis identification procedure when the dual simplex clean-up phase is started. CALLBACK_BEGIN_INFEAS_ANA CallbackCode = C.MSK_CALLBACK_BEGIN_INFEAS_ANA // The callback function is called when the infeasibility analyzer is started. CALLBACK_BEGIN_INTPNT CallbackCode = C.MSK_CALLBACK_BEGIN_INTPNT // The callback function is called when the interior-point optimizer is started. CALLBACK_BEGIN_LICENSE_WAIT CallbackCode = C.MSK_CALLBACK_BEGIN_LICENSE_WAIT // Begin waiting for license. CALLBACK_BEGIN_MIO CallbackCode = C.MSK_CALLBACK_BEGIN_MIO // The callback function is called when the mixed-integer optimizer is started. CALLBACK_BEGIN_OPTIMIZER CallbackCode = C.MSK_CALLBACK_BEGIN_OPTIMIZER // The callback function is called when the optimizer is started. CALLBACK_BEGIN_PRESOLVE CallbackCode = C.MSK_CALLBACK_BEGIN_PRESOLVE // The callback function is called when the presolve is started. CALLBACK_BEGIN_PRIMAL_BI CallbackCode = C.MSK_CALLBACK_BEGIN_PRIMAL_BI // The callback function is called from within the basis identification procedure when the primal phase is started. CALLBACK_BEGIN_PRIMAL_REPAIR CallbackCode = C.MSK_CALLBACK_BEGIN_PRIMAL_REPAIR // Begin primal feasibility repair. CALLBACK_BEGIN_PRIMAL_SENSITIVITY CallbackCode = C.MSK_CALLBACK_BEGIN_PRIMAL_SENSITIVITY // Primal sensitivity analysis is started. CALLBACK_BEGIN_PRIMAL_SETUP_BI CallbackCode = C.MSK_CALLBACK_BEGIN_PRIMAL_SETUP_BI // The callback function is called when the primal BI setup is started. CALLBACK_BEGIN_PRIMAL_SIMPLEX CallbackCode = C.MSK_CALLBACK_BEGIN_PRIMAL_SIMPLEX // The callback function is called when the primal simplex optimizer is started. CALLBACK_BEGIN_PRIMAL_SIMPLEX_BI CallbackCode = C.MSK_CALLBACK_BEGIN_PRIMAL_SIMPLEX_BI // The callback function is called from within the basis identification procedure when the primal simplex clean-up phase is started. CALLBACK_BEGIN_QCQO_REFORMULATE CallbackCode = C.MSK_CALLBACK_BEGIN_QCQO_REFORMULATE // Begin QCQO reformulation. CALLBACK_BEGIN_READ CallbackCode = C.MSK_CALLBACK_BEGIN_READ // MOSEK has started reading a problem file. CALLBACK_BEGIN_ROOT_CUTGEN CallbackCode = C.MSK_CALLBACK_BEGIN_ROOT_CUTGEN // The callback function is called when root cut generation is started. CALLBACK_BEGIN_SIMPLEX CallbackCode = C.MSK_CALLBACK_BEGIN_SIMPLEX // The callback function is called when the simplex optimizer is started. CALLBACK_BEGIN_SIMPLEX_BI CallbackCode = C.MSK_CALLBACK_BEGIN_SIMPLEX_BI // The callback function is called from within the basis identification procedure when the simplex clean-up phase is started. CALLBACK_BEGIN_SOLVE_ROOT_RELAX CallbackCode = C.MSK_CALLBACK_BEGIN_SOLVE_ROOT_RELAX // The callback function is called when solution of root relaxation is started. CALLBACK_BEGIN_TO_CONIC CallbackCode = C.MSK_CALLBACK_BEGIN_TO_CONIC // Begin conic reformulation. CALLBACK_BEGIN_WRITE CallbackCode = C.MSK_CALLBACK_BEGIN_WRITE // MOSEK has started writing a problem file. CALLBACK_CONIC CallbackCode = C.MSK_CALLBACK_CONIC // The callback function is called from within the conic optimizer after the information database has been updated. CALLBACK_DUAL_SIMPLEX CallbackCode = C.MSK_CALLBACK_DUAL_SIMPLEX // The callback function is called from within the dual simplex optimizer. CALLBACK_END_BI CallbackCode = C.MSK_CALLBACK_END_BI // The callback function is called when the basis identification procedure is terminated. CALLBACK_END_CONIC CallbackCode = C.MSK_CALLBACK_END_CONIC // The callback function is called when the conic optimizer is terminated. CALLBACK_END_DUAL_BI CallbackCode = C.MSK_CALLBACK_END_DUAL_BI // The callback function is called from within the basis identification procedure when the dual phase is terminated. CALLBACK_END_DUAL_SENSITIVITY CallbackCode = C.MSK_CALLBACK_END_DUAL_SENSITIVITY // Dual sensitivity analysis is terminated. CALLBACK_END_DUAL_SETUP_BI CallbackCode = C.MSK_CALLBACK_END_DUAL_SETUP_BI // The callback function is called when the dual BI phase is terminated. CALLBACK_END_DUAL_SIMPLEX CallbackCode = C.MSK_CALLBACK_END_DUAL_SIMPLEX // The callback function is called when the dual simplex optimizer is terminated. CALLBACK_END_DUAL_SIMPLEX_BI CallbackCode = C.MSK_CALLBACK_END_DUAL_SIMPLEX_BI // The callback function is called from within the basis identification procedure when the dual clean-up phase is terminated. CALLBACK_END_INFEAS_ANA CallbackCode = C.MSK_CALLBACK_END_INFEAS_ANA // The callback function is called when the infeasibility analyzer is terminated. CALLBACK_END_INTPNT CallbackCode = C.MSK_CALLBACK_END_INTPNT // The callback function is called when the interior-point optimizer is terminated. CALLBACK_END_LICENSE_WAIT CallbackCode = C.MSK_CALLBACK_END_LICENSE_WAIT // End waiting for license. CALLBACK_END_MIO CallbackCode = C.MSK_CALLBACK_END_MIO // The callback function is called when the mixed-integer optimizer is terminated. CALLBACK_END_OPTIMIZER CallbackCode = C.MSK_CALLBACK_END_OPTIMIZER // The callback function is called when the optimizer is terminated. CALLBACK_END_PRESOLVE CallbackCode = C.MSK_CALLBACK_END_PRESOLVE // The callback function is called when the presolve is completed. CALLBACK_END_PRIMAL_BI CallbackCode = C.MSK_CALLBACK_END_PRIMAL_BI // The callback function is called from within the basis identification procedure when the primal phase is terminated. CALLBACK_END_PRIMAL_REPAIR CallbackCode = C.MSK_CALLBACK_END_PRIMAL_REPAIR // End primal feasibility repair. CALLBACK_END_PRIMAL_SENSITIVITY CallbackCode = C.MSK_CALLBACK_END_PRIMAL_SENSITIVITY // Primal sensitivity analysis is terminated. CALLBACK_END_PRIMAL_SETUP_BI CallbackCode = C.MSK_CALLBACK_END_PRIMAL_SETUP_BI // The callback function is called when the primal BI setup is terminated. CALLBACK_END_PRIMAL_SIMPLEX CallbackCode = C.MSK_CALLBACK_END_PRIMAL_SIMPLEX // The callback function is called when the primal simplex optimizer is terminated. CALLBACK_END_PRIMAL_SIMPLEX_BI CallbackCode = C.MSK_CALLBACK_END_PRIMAL_SIMPLEX_BI // The callback function is called from within the basis identification procedure when the primal clean-up phase is terminated. CALLBACK_END_QCQO_REFORMULATE CallbackCode = C.MSK_CALLBACK_END_QCQO_REFORMULATE // End QCQO reformulation. CALLBACK_END_READ CallbackCode = C.MSK_CALLBACK_END_READ // MOSEK has finished reading a problem file. CALLBACK_END_ROOT_CUTGEN CallbackCode = C.MSK_CALLBACK_END_ROOT_CUTGEN // The callback function is called when root cut generation is terminated. CALLBACK_END_SIMPLEX CallbackCode = C.MSK_CALLBACK_END_SIMPLEX // The callback function is called when the simplex optimizer is terminated. CALLBACK_END_SIMPLEX_BI CallbackCode = C.MSK_CALLBACK_END_SIMPLEX_BI // The callback function is called from within the basis identification procedure when the simplex clean-up phase is terminated. CALLBACK_END_SOLVE_ROOT_RELAX CallbackCode = C.MSK_CALLBACK_END_SOLVE_ROOT_RELAX // The callback function is called when solution of root relaxation is terminated. CALLBACK_END_TO_CONIC CallbackCode = C.MSK_CALLBACK_END_TO_CONIC // End conic reformulation. CALLBACK_END_WRITE CallbackCode = C.MSK_CALLBACK_END_WRITE // MOSEK has finished writing a problem file. CALLBACK_IM_BI CallbackCode = C.MSK_CALLBACK_IM_BI // The callback function is called from within the basis identification procedure at an intermediate point. CALLBACK_IM_CONIC CallbackCode = C.MSK_CALLBACK_IM_CONIC // The callback function is called at an intermediate stage within the conic optimizer where the information database has not been updated. CALLBACK_IM_DUAL_BI CallbackCode = C.MSK_CALLBACK_IM_DUAL_BI // The callback function is called from within the basis identification procedure at an intermediate point in the dual phase. CALLBACK_IM_DUAL_SENSIVITY CallbackCode = C.MSK_CALLBACK_IM_DUAL_SENSIVITY // The callback function is called at an intermediate stage of the dual sensitivity analysis. CALLBACK_IM_DUAL_SIMPLEX CallbackCode = C.MSK_CALLBACK_IM_DUAL_SIMPLEX // The callback function is called at an intermediate point in the dual simplex optimizer. CALLBACK_IM_INTPNT CallbackCode = C.MSK_CALLBACK_IM_INTPNT // The callback function is called at an intermediate stage within the interior-point optimizer where the information database has not been updated. CALLBACK_IM_LICENSE_WAIT CallbackCode = C.MSK_CALLBACK_IM_LICENSE_WAIT // MOSEK is waiting for a license. CALLBACK_IM_LU CallbackCode = C.MSK_CALLBACK_IM_LU // The callback function is called from within the LU factorization procedure at an intermediate point. CALLBACK_IM_MIO CallbackCode = C.MSK_CALLBACK_IM_MIO // The callback function is called at an intermediate point in the mixed-integer optimizer. CALLBACK_IM_MIO_DUAL_SIMPLEX CallbackCode = C.MSK_CALLBACK_IM_MIO_DUAL_SIMPLEX // The callback function is called at an intermediate point in the mixed-integer optimizer while running the dual simplex optimizer. CALLBACK_IM_MIO_INTPNT CallbackCode = C.MSK_CALLBACK_IM_MIO_INTPNT // The callback function is called at an intermediate point in the mixed-integer optimizer while running the interior-point optimizer. CALLBACK_IM_MIO_PRIMAL_SIMPLEX CallbackCode = C.MSK_CALLBACK_IM_MIO_PRIMAL_SIMPLEX // The callback function is called at an intermediate point in the mixed-integer optimizer while running the primal simplex optimizer. CALLBACK_IM_ORDER CallbackCode = C.MSK_CALLBACK_IM_ORDER // The callback function is called from within the matrix ordering procedure at an intermediate point. CALLBACK_IM_PRESOLVE CallbackCode = C.MSK_CALLBACK_IM_PRESOLVE // The callback function is called from within the presolve procedure at an intermediate stage. CALLBACK_IM_PRIMAL_BI CallbackCode = C.MSK_CALLBACK_IM_PRIMAL_BI // The callback function is called from within the basis identification procedure at an intermediate point in the primal phase. CALLBACK_IM_PRIMAL_SENSIVITY CallbackCode = C.MSK_CALLBACK_IM_PRIMAL_SENSIVITY // The callback function is called at an intermediate stage of the primal sensitivity analysis. CALLBACK_IM_PRIMAL_SIMPLEX CallbackCode = C.MSK_CALLBACK_IM_PRIMAL_SIMPLEX // The callback function is called at an intermediate point in the primal simplex optimizer. CALLBACK_IM_QO_REFORMULATE CallbackCode = C.MSK_CALLBACK_IM_QO_REFORMULATE // The callback function is called at an intermediate stage of the conic quadratic reformulation. CALLBACK_IM_READ CallbackCode = C.MSK_CALLBACK_IM_READ // Intermediate stage in reading. CALLBACK_IM_ROOT_CUTGEN CallbackCode = C.MSK_CALLBACK_IM_ROOT_CUTGEN // The callback is called from within root cut generation at an intermediate stage. CALLBACK_IM_SIMPLEX CallbackCode = C.MSK_CALLBACK_IM_SIMPLEX // The callback function is called from within the simplex optimizer at an intermediate point. CALLBACK_IM_SIMPLEX_BI CallbackCode = C.MSK_CALLBACK_IM_SIMPLEX_BI // The callback function is called from within the basis identification procedure at an intermediate point in the simplex clean-up phase. CALLBACK_INTPNT CallbackCode = C.MSK_CALLBACK_INTPNT // The callback function is called from within the interior-point optimizer after the information database has been updated. CALLBACK_NEW_INT_MIO CallbackCode = C.MSK_CALLBACK_NEW_INT_MIO // The callback function is called after a new integer solution has been located by the mixed-integer optimizer. CALLBACK_PRIMAL_SIMPLEX CallbackCode = C.MSK_CALLBACK_PRIMAL_SIMPLEX // The callback function is called from within the primal simplex optimizer. CALLBACK_READ_OPF CallbackCode = C.MSK_CALLBACK_READ_OPF // The callback function is called from the OPF reader. CALLBACK_READ_OPF_SECTION CallbackCode = C.MSK_CALLBACK_READ_OPF_SECTION // A chunk of Q non-zeros has been read from a problem file. CALLBACK_RESTART_MIO CallbackCode = C.MSK_CALLBACK_RESTART_MIO // The callback function is called when the mixed-integer optimizer is restarted. CALLBACK_SOLVING_REMOTE CallbackCode = C.MSK_CALLBACK_SOLVING_REMOTE // The callback function is called while the task is being solved on a remote server. CALLBACK_UPDATE_DUAL_BI CallbackCode = C.MSK_CALLBACK_UPDATE_DUAL_BI // The callback function is called from within the basis identification procedure at an intermediate point in the dual phase. CALLBACK_UPDATE_DUAL_SIMPLEX CallbackCode = C.MSK_CALLBACK_UPDATE_DUAL_SIMPLEX // The callback function is called in the dual simplex optimizer. CALLBACK_UPDATE_DUAL_SIMPLEX_BI CallbackCode = C.MSK_CALLBACK_UPDATE_DUAL_SIMPLEX_BI // The callback function is called from within the basis identification procedure at an intermediate point in the dual simplex clean-up phase. CALLBACK_UPDATE_PRESOLVE CallbackCode = C.MSK_CALLBACK_UPDATE_PRESOLVE // The callback function is called from within the presolve procedure. CALLBACK_UPDATE_PRIMAL_BI CallbackCode = C.MSK_CALLBACK_UPDATE_PRIMAL_BI // The callback function is called from within the basis identification procedure at an intermediate point in the primal phase. CALLBACK_UPDATE_PRIMAL_SIMPLEX CallbackCode = C.MSK_CALLBACK_UPDATE_PRIMAL_SIMPLEX // The callback function is called in the primal simplex optimizer. CALLBACK_UPDATE_PRIMAL_SIMPLEX_BI CallbackCode = C.MSK_CALLBACK_UPDATE_PRIMAL_SIMPLEX_BI // The callback function is called from within the basis identification procedure at an intermediate point in the primal simplex clean-up phase. CALLBACK_UPDATE_SIMPLEX CallbackCode = C.MSK_CALLBACK_UPDATE_SIMPLEX // The callback function is called from simplex optimizer. CALLBACK_WRITE_OPF CallbackCode = C.MSK_CALLBACK_WRITE_OPF // The callback function is called from the OPF writer. )
func (CallbackCode) String ¶ added in v0.2.10
func (e CallbackCode) String() string
type CheckConvexityType ¶ added in v0.2.0
type CheckConvexityType uint32
CheckConvexityType is MSKcheckconvexitytype_enum.
Types of convexity checks.
const ( CHECK_CONVEXITY_NONE CheckConvexityType = 0 // No convexity check. CHECK_CONVEXITY_SIMPLE CheckConvexityType = 1 // Perform simple and fast convexity check. CHECK_CONVEXITY_FULL CheckConvexityType = 2 // Perform a full convexity check. )
func (CheckConvexityType) String ¶ added in v0.2.10
func (e CheckConvexityType) String() string
type CompressType ¶ added in v0.0.7
type CompressType uint32
CompressType is MSKcompresstype_enum.
Compression types
const ( COMPRESS_NONE CompressType = C.MSK_COMPRESS_NONE // No compression is used. COMPRESS_FREE CompressType = C.MSK_COMPRESS_FREE // The type of compression used is chosen automatically. COMPRESS_GZIP CompressType = C.MSK_COMPRESS_GZIP // The type of compression used is gzip compatible. COMPRESS_ZSTD CompressType = C.MSK_COMPRESS_ZSTD // The type of compression used is zstd compatible. )
func (CompressType) String ¶ added in v0.2.10
func (e CompressType) String() string
type ConeType ¶ added in v0.2.0
type ConeType uint32
ConeType is MSKconetype_enum.
Cone types
const ( CT_QUAD ConeType = C.MSK_CT_QUAD // The cone is a quadratic cone. CT_RQUAD ConeType = C.MSK_CT_RQUAD // The cone is a rotated quadratic cone. CT_PEXP ConeType = C.MSK_CT_PEXP // A primal exponential cone. CT_DEXP ConeType = C.MSK_CT_DEXP // A dual exponential cone. CT_PPOW ConeType = C.MSK_CT_PPOW // A primal power cone. CT_DPOW ConeType = C.MSK_CT_DPOW // A dual power cone. CT_ZERO ConeType = C.MSK_CT_ZERO // The zero cone. )
type DInfItem ¶ added in v0.1.2
type DInfItem uint32
DInfItem is MSKdinfitem_enum.
Double information items
const ( DINF_ANA_PRO_SCALARIZED_CONSTRAINT_MATRIX_DENSITY DInfItem = C.MSK_DINF_ANA_PRO_SCALARIZED_CONSTRAINT_MATRIX_DENSITY // Density percentage of the scalarized constraint matrix. DINF_BI_CLEAN_DUAL_TIME DInfItem = C.MSK_DINF_BI_CLEAN_DUAL_TIME // Time spent within the dual clean-up optimizer of the basis identification procedure since its invocation. DINF_BI_CLEAN_PRIMAL_TIME DInfItem = C.MSK_DINF_BI_CLEAN_PRIMAL_TIME // Time spent within the primal clean-up optimizer of the basis identification procedure since its invocation. DINF_BI_CLEAN_TIME DInfItem = C.MSK_DINF_BI_CLEAN_TIME // Time spent within the clean-up phase of the basis identification procedure since its invocation. DINF_BI_DUAL_TIME DInfItem = C.MSK_DINF_BI_DUAL_TIME // Time spent within the dual phase basis identification procedure since its invocation. DINF_BI_PRIMAL_TIME DInfItem = C.MSK_DINF_BI_PRIMAL_TIME // Time spent within the primal phase of the basis identification procedure since its invocation. DINF_BI_TIME DInfItem = C.MSK_DINF_BI_TIME // Time spent within the basis identification procedure since its invocation. DINF_INTPNT_DUAL_FEAS DInfItem = C.MSK_DINF_INTPNT_DUAL_FEAS // Dual feasibility measure reported by the interior-point optimizer. DINF_INTPNT_DUAL_OBJ DInfItem = C.MSK_DINF_INTPNT_DUAL_OBJ // Dual objective value reported by the interior-point optimizer. DINF_INTPNT_FACTOR_NUM_FLOPS DInfItem = C.MSK_DINF_INTPNT_FACTOR_NUM_FLOPS // An estimate of the number of flops used in the factorization. DINF_INTPNT_OPT_STATUS DInfItem = C.MSK_DINF_INTPNT_OPT_STATUS // A measure of optimality of the solution. DINF_INTPNT_ORDER_TIME DInfItem = C.MSK_DINF_INTPNT_ORDER_TIME // Order time (in seconds). DINF_INTPNT_PRIMAL_FEAS DInfItem = C.MSK_DINF_INTPNT_PRIMAL_FEAS // Primal feasibility measure reported by the interior-point optimizer. DINF_INTPNT_PRIMAL_OBJ DInfItem = C.MSK_DINF_INTPNT_PRIMAL_OBJ // Primal objective value reported by the interior-point optimizer. DINF_INTPNT_TIME DInfItem = C.MSK_DINF_INTPNT_TIME // Time spent within the interior-point optimizer since its invocation. DINF_MIO_CLIQUE_SELECTION_TIME DInfItem = C.MSK_DINF_MIO_CLIQUE_SELECTION_TIME // Selection time for clique cuts. DINF_MIO_CLIQUE_SEPARATION_TIME DInfItem = C.MSK_DINF_MIO_CLIQUE_SEPARATION_TIME // Separation time for clique cuts. DINF_MIO_CMIR_SELECTION_TIME DInfItem = C.MSK_DINF_MIO_CMIR_SELECTION_TIME // Selection time for CMIR cuts. DINF_MIO_CMIR_SEPARATION_TIME DInfItem = C.MSK_DINF_MIO_CMIR_SEPARATION_TIME // Separation time for CMIR cuts. DINF_MIO_CONSTRUCT_SOLUTION_OBJ DInfItem = C.MSK_DINF_MIO_CONSTRUCT_SOLUTION_OBJ // Optimal objective value corresponding to the feasible solution. DINF_MIO_DUAL_BOUND_AFTER_PRESOLVE DInfItem = C.MSK_DINF_MIO_DUAL_BOUND_AFTER_PRESOLVE // Value of the dual bound after presolve but before cut generation. DINF_MIO_GMI_SELECTION_TIME DInfItem = C.MSK_DINF_MIO_GMI_SELECTION_TIME // Selection time for GMI cuts. DINF_MIO_GMI_SEPARATION_TIME DInfItem = C.MSK_DINF_MIO_GMI_SEPARATION_TIME // Separation time for GMI cuts. DINF_MIO_IMPLIED_BOUND_SELECTION_TIME DInfItem = C.MSK_DINF_MIO_IMPLIED_BOUND_SELECTION_TIME // Selection time for implied bound cuts. DINF_MIO_IMPLIED_BOUND_SEPARATION_TIME DInfItem = C.MSK_DINF_MIO_IMPLIED_BOUND_SEPARATION_TIME // Separation time for implied bound cuts. DINF_MIO_INITIAL_FEASIBLE_SOLUTION_OBJ DInfItem = C.MSK_DINF_MIO_INITIAL_FEASIBLE_SOLUTION_OBJ // Optimal objective value corresponding to the user provided initial solution. DINF_MIO_KNAPSACK_COVER_SELECTION_TIME DInfItem = C.MSK_DINF_MIO_KNAPSACK_COVER_SELECTION_TIME // Selection time for knapsack cover. DINF_MIO_KNAPSACK_COVER_SEPARATION_TIME DInfItem = C.MSK_DINF_MIO_KNAPSACK_COVER_SEPARATION_TIME // Separation time for knapsack cover. DINF_MIO_LIPRO_SELECTION_TIME DInfItem = C.MSK_DINF_MIO_LIPRO_SELECTION_TIME // Selection time for lift-and-project cuts. DINF_MIO_LIPRO_SEPARATION_TIME DInfItem = C.MSK_DINF_MIO_LIPRO_SEPARATION_TIME // Separation time for lift-and-project cuts. DINF_MIO_OBJ_ABS_GAP DInfItem = C.MSK_DINF_MIO_OBJ_ABS_GAP // If the mixed-integer optimizer has computed a feasible solution and a bound, this contains the absolute gap. DINF_MIO_OBJ_BOUND DInfItem = C.MSK_DINF_MIO_OBJ_BOUND // The best bound on the objective value known. DINF_MIO_OBJ_INT DInfItem = C.MSK_DINF_MIO_OBJ_INT // The primal objective value corresponding to the best integer feasible solution. DINF_MIO_OBJ_REL_GAP DInfItem = C.MSK_DINF_MIO_OBJ_REL_GAP // If the mixed-integer optimizer has computed a feasible solution and a bound, this contains the relative gap. DINF_MIO_PROBING_TIME DInfItem = C.MSK_DINF_MIO_PROBING_TIME // Total time for probing. DINF_MIO_ROOT_CUT_SELECTION_TIME DInfItem = C.MSK_DINF_MIO_ROOT_CUT_SELECTION_TIME // Total time for cut selection. DINF_MIO_ROOT_CUT_SEPARATION_TIME DInfItem = C.MSK_DINF_MIO_ROOT_CUT_SEPARATION_TIME // Total time for cut separation. DINF_MIO_ROOT_OPTIMIZER_TIME DInfItem = C.MSK_DINF_MIO_ROOT_OPTIMIZER_TIME // Time spent in the contiuous optimizer while processing the root node relaxation. DINF_MIO_ROOT_PRESOLVE_TIME DInfItem = C.MSK_DINF_MIO_ROOT_PRESOLVE_TIME // Time spent presolving the problem at the root node. DINF_MIO_ROOT_TIME DInfItem = C.MSK_DINF_MIO_ROOT_TIME // Time spent processing the root node. DINF_MIO_SYMMETRY_DETECTION_TIME DInfItem = C.MSK_DINF_MIO_SYMMETRY_DETECTION_TIME // Total time for symmetry detection. DINF_MIO_SYMMETRY_FACTOR DInfItem = C.MSK_DINF_MIO_SYMMETRY_FACTOR // Degree to which the problem is affected by detected symmetry. DINF_MIO_TIME DInfItem = C.MSK_DINF_MIO_TIME // Time spent in the mixed-integer optimizer. DINF_MIO_USER_OBJ_CUT DInfItem = C.MSK_DINF_MIO_USER_OBJ_CUT // If the objective cut is used, then this information item has the value of the cut. DINF_OPTIMIZER_TICKS DInfItem = C.MSK_DINF_OPTIMIZER_TICKS // Total number of ticks spent in the optimizer since it was invoked. It is strictly negative if it is not available. DINF_OPTIMIZER_TIME DInfItem = C.MSK_DINF_OPTIMIZER_TIME // Total time spent in the optimizer since it was invoked. DINF_PRESOLVE_ELI_TIME DInfItem = C.MSK_DINF_PRESOLVE_ELI_TIME // Total time spent in the eliminator since the presolve was invoked. DINF_PRESOLVE_LINDEP_TIME DInfItem = C.MSK_DINF_PRESOLVE_LINDEP_TIME // Total time spent in the linear dependency checker since the presolve was invoked. DINF_PRESOLVE_TIME DInfItem = C.MSK_DINF_PRESOLVE_TIME // Total time (in seconds) spent in the presolve since it was invoked. DINF_PRESOLVE_TOTAL_PRIMAL_PERTURBATION DInfItem = C.MSK_DINF_PRESOLVE_TOTAL_PRIMAL_PERTURBATION // Total perturbation of the bounds of the primal problem. DINF_PRIMAL_REPAIR_PENALTY_OBJ DInfItem = C.MSK_DINF_PRIMAL_REPAIR_PENALTY_OBJ // The optimal objective value of the penalty function. DINF_QCQO_REFORMULATE_MAX_PERTURBATION DInfItem = C.MSK_DINF_QCQO_REFORMULATE_MAX_PERTURBATION // Maximum absolute diagonal perturbation occurring during the QCQO reformulation. DINF_QCQO_REFORMULATE_TIME DInfItem = C.MSK_DINF_QCQO_REFORMULATE_TIME // Time spent with conic quadratic reformulation. DINF_QCQO_REFORMULATE_WORST_CHOLESKY_COLUMN_SCALING DInfItem = C.MSK_DINF_QCQO_REFORMULATE_WORST_CHOLESKY_COLUMN_SCALING // Worst Cholesky column scaling. DINF_QCQO_REFORMULATE_WORST_CHOLESKY_DIAG_SCALING DInfItem = C.MSK_DINF_QCQO_REFORMULATE_WORST_CHOLESKY_DIAG_SCALING // Worst Cholesky diagonal scaling. DINF_READ_DATA_TIME DInfItem = C.MSK_DINF_READ_DATA_TIME // Time spent reading the data file. DINF_REMOTE_TIME DInfItem = C.MSK_DINF_REMOTE_TIME // The total real time in seconds spent when optimizing on a server by the process performing the optimization on the server DINF_SIM_DUAL_TIME DInfItem = C.MSK_DINF_SIM_DUAL_TIME // Time spent in the dual simplex optimizer since invoking it. DINF_SIM_FEAS DInfItem = C.MSK_DINF_SIM_FEAS // Feasibility measure reported by the simplex optimizer. DINF_SIM_OBJ DInfItem = C.MSK_DINF_SIM_OBJ // Objective value reported by the simplex optimizer. DINF_SIM_PRIMAL_TIME DInfItem = C.MSK_DINF_SIM_PRIMAL_TIME // Time spent in the primal simplex optimizer since invoking it. DINF_SIM_TIME DInfItem = C.MSK_DINF_SIM_TIME // Time spent in the simplex optimizer since invoking it. DINF_SOL_BAS_DUAL_OBJ DInfItem = C.MSK_DINF_SOL_BAS_DUAL_OBJ // Dual objective value of the basic solution. Updated by the function updatesolutioninfo. DINF_SOL_BAS_DVIOLCON DInfItem = C.MSK_DINF_SOL_BAS_DVIOLCON // Maximal dual bound violation for xx in the basic solution. Updated by the function updatesolutioninfo. DINF_SOL_BAS_DVIOLVAR DInfItem = C.MSK_DINF_SOL_BAS_DVIOLVAR // Maximal dual bound violation for xx in the basic solution. Updated by the function updatesolutioninfo. DINF_SOL_BAS_NRM_BARX DInfItem = C.MSK_DINF_SOL_BAS_NRM_BARX // Infinity norm of barx in the basic solution. DINF_SOL_BAS_NRM_SLC DInfItem = C.MSK_DINF_SOL_BAS_NRM_SLC // Infinity norm of slc in the basic solution. DINF_SOL_BAS_NRM_SLX DInfItem = C.MSK_DINF_SOL_BAS_NRM_SLX // Infinity norm of slx in the basic solution. DINF_SOL_BAS_NRM_SUC DInfItem = C.MSK_DINF_SOL_BAS_NRM_SUC // Infinity norm of suc in the basic solution. DINF_SOL_BAS_NRM_SUX DInfItem = C.MSK_DINF_SOL_BAS_NRM_SUX // Infinity norm of sux in the basic solution. DINF_SOL_BAS_NRM_XC DInfItem = C.MSK_DINF_SOL_BAS_NRM_XC // Infinity norm of xc in the basic solution. DINF_SOL_BAS_NRM_XX DInfItem = C.MSK_DINF_SOL_BAS_NRM_XX // Infinity norm of xx in the basic solution. DINF_SOL_BAS_NRM_Y DInfItem = C.MSK_DINF_SOL_BAS_NRM_Y // Infinity norm of Y in the basic solution. DINF_SOL_BAS_PRIMAL_OBJ DInfItem = C.MSK_DINF_SOL_BAS_PRIMAL_OBJ // Primal objective value of the basic solution. Updated by the function updatesolutioninfo. DINF_SOL_BAS_PVIOLCON DInfItem = C.MSK_DINF_SOL_BAS_PVIOLCON // Maximal primal bound violation for xc in the basic solution. Updated by the function updatesolutioninfo. DINF_SOL_BAS_PVIOLVAR DInfItem = C.MSK_DINF_SOL_BAS_PVIOLVAR // Maximal primal bound violation for xx in the basic solution. Updated by the function updatesolutioninfo. DINF_SOL_ITG_NRM_BARX DInfItem = C.MSK_DINF_SOL_ITG_NRM_BARX // Infinity norm of barx in the integer solution. DINF_SOL_ITG_NRM_XC DInfItem = C.MSK_DINF_SOL_ITG_NRM_XC // Infinity norm of xc in the integer solution. DINF_SOL_ITG_NRM_XX DInfItem = C.MSK_DINF_SOL_ITG_NRM_XX // Infinity norm of xx in the integer solution. DINF_SOL_ITG_PRIMAL_OBJ DInfItem = C.MSK_DINF_SOL_ITG_PRIMAL_OBJ // Primal objective value of the integer solution. Updated by the function updatesolutioninfo. DINF_SOL_ITG_PVIOLACC DInfItem = C.MSK_DINF_SOL_ITG_PVIOLACC // Maximal primal violation for affine conic constraints in the integer solution. Updated by the function updatesolutioninfo. DINF_SOL_ITG_PVIOLBARVAR DInfItem = C.MSK_DINF_SOL_ITG_PVIOLBARVAR // Maximal primal bound violation for barx in the integer solution. Updated by the function updatesolutioninfo. DINF_SOL_ITG_PVIOLCON DInfItem = C.MSK_DINF_SOL_ITG_PVIOLCON // Maximal primal bound violation for xc in the integer solution. Updated by the function updatesolutioninfo. DINF_SOL_ITG_PVIOLCONES DInfItem = C.MSK_DINF_SOL_ITG_PVIOLCONES // Maximal primal violation for primal conic constraints in the integer solution. Updated by the function updatesolutioninfo. DINF_SOL_ITG_PVIOLDJC DInfItem = C.MSK_DINF_SOL_ITG_PVIOLDJC // Maximal primal violation for disjunctive constraints in the integer solution. Updated by the function updatesolutioninfo. DINF_SOL_ITG_PVIOLITG DInfItem = C.MSK_DINF_SOL_ITG_PVIOLITG // Maximal violation for the integer constraints in the integer solution. Updated by the function updatesolutioninfo. DINF_SOL_ITG_PVIOLVAR DInfItem = C.MSK_DINF_SOL_ITG_PVIOLVAR // Maximal primal bound violation for xx in the integer solution. Updated by the function updatesolutioninfo. DINF_SOL_ITR_DUAL_OBJ DInfItem = C.MSK_DINF_SOL_ITR_DUAL_OBJ // Dual objective value of the interior-point solution. Updated by the function updatesolutioninfo. DINF_SOL_ITR_DVIOLACC DInfItem = C.MSK_DINF_SOL_ITR_DVIOLACC // Maximal dual violation for affine conic constraints in the interior-point solution. Updated by the function updatesolutioninfo. DINF_SOL_ITR_DVIOLBARVAR DInfItem = C.MSK_DINF_SOL_ITR_DVIOLBARVAR // Maximal dual bound violation for barx in the interior-point solution. Updated by the function updatesolutioninfo. DINF_SOL_ITR_DVIOLCON DInfItem = C.MSK_DINF_SOL_ITR_DVIOLCON // Maximal dual bound violation for xc in the interior-point solution. Updated by the function updatesolutioninfo. DINF_SOL_ITR_DVIOLCONES DInfItem = C.MSK_DINF_SOL_ITR_DVIOLCONES // Maximal dual violation for conic constraints in the interior-point solution. Updated by the function updatesolutioninfo. DINF_SOL_ITR_DVIOLVAR DInfItem = C.MSK_DINF_SOL_ITR_DVIOLVAR // Maximal dual bound violation for xx in the interior-point solution. Updated by the function updatesolutioninfo. DINF_SOL_ITR_NRM_BARS DInfItem = C.MSK_DINF_SOL_ITR_NRM_BARS // Infinity norm of bars in the interior-point solution. DINF_SOL_ITR_NRM_BARX DInfItem = C.MSK_DINF_SOL_ITR_NRM_BARX // Infinity norm of barx in the interior-point solution. DINF_SOL_ITR_NRM_SLC DInfItem = C.MSK_DINF_SOL_ITR_NRM_SLC // Infinity norm of slc in the interior-point solution. DINF_SOL_ITR_NRM_SLX DInfItem = C.MSK_DINF_SOL_ITR_NRM_SLX // Infinity norm of slx in the interior-point solution. DINF_SOL_ITR_NRM_SNX DInfItem = C.MSK_DINF_SOL_ITR_NRM_SNX // Infinity norm of snx in the interior-point solution. DINF_SOL_ITR_NRM_SUC DInfItem = C.MSK_DINF_SOL_ITR_NRM_SUC // Infinity norm of suc in the interior-point solution. DINF_SOL_ITR_NRM_SUX DInfItem = C.MSK_DINF_SOL_ITR_NRM_SUX // Infinity norm of sux in the interior-point solution. DINF_SOL_ITR_NRM_XC DInfItem = C.MSK_DINF_SOL_ITR_NRM_XC // Infinity norm of xc in the interior-point solution. DINF_SOL_ITR_NRM_XX DInfItem = C.MSK_DINF_SOL_ITR_NRM_XX // Infinity norm of xx in the interior-point solution. DINF_SOL_ITR_NRM_Y DInfItem = C.MSK_DINF_SOL_ITR_NRM_Y // Infinity norm of Y in the interior-point solution. DINF_SOL_ITR_PRIMAL_OBJ DInfItem = C.MSK_DINF_SOL_ITR_PRIMAL_OBJ // Primal objective value of the interior-point solution. DINF_SOL_ITR_PVIOLACC DInfItem = C.MSK_DINF_SOL_ITR_PVIOLACC // Maximal primal violation for affine conic constraints in the interior-point solution. Updated by the function updatesolutioninfo. DINF_SOL_ITR_PVIOLBARVAR DInfItem = C.MSK_DINF_SOL_ITR_PVIOLBARVAR // Maximal primal bound violation for barx in the interior-point solution. Updated by the function updatesolutioninfo. DINF_SOL_ITR_PVIOLCON DInfItem = C.MSK_DINF_SOL_ITR_PVIOLCON // Maximal primal bound violation for xc in the interior-point solution. Updated by the function updatesolutioninfo. DINF_SOL_ITR_PVIOLCONES DInfItem = C.MSK_DINF_SOL_ITR_PVIOLCONES // Maximal primal violation for conic constraints in the interior-point solution. Updated by the function updatesolutioninfo. DINF_SOL_ITR_PVIOLVAR DInfItem = C.MSK_DINF_SOL_ITR_PVIOLVAR // Maximal primal bound violation for xx in the interior-point solution. Updated by the function updatesolutioninfo. DINF_TO_CONIC_TIME DInfItem = C.MSK_DINF_TO_CONIC_TIME // Time spent in the last to conic reformulation. DINF_WRITE_DATA_TIME DInfItem = C.MSK_DINF_WRITE_DATA_TIME // Time spent writing the data file. )
type DParam ¶ added in v0.1.2
type DParam uint32
DParam is MSKdparam_enum.
Double parameters
const ( DPAR_ANA_SOL_INFEAS_TOL DParam = C.MSK_DPAR_ANA_SOL_INFEAS_TOL // If a constraint violates its bound with an amount larger than this value, the constraint name, index and violation will be printed by the solution analyzer. DPAR_BASIS_REL_TOL_S DParam = C.MSK_DPAR_BASIS_REL_TOL_S // Maximum relative dual bound violation allowed in an optimal basic solution. DPAR_BASIS_TOL_S DParam = C.MSK_DPAR_BASIS_TOL_S // Maximum absolute dual bound violation in an optimal basic solution. DPAR_BASIS_TOL_X DParam = C.MSK_DPAR_BASIS_TOL_X // Maximum absolute primal bound violation allowed in an optimal basic solution. DPAR_CHECK_CONVEXITY_REL_TOL DParam = C.MSK_DPAR_CHECK_CONVEXITY_REL_TOL // Convexity check tolerance. DPAR_DATA_SYM_MAT_TOL DParam = C.MSK_DPAR_DATA_SYM_MAT_TOL // Zero tolerance threshold for symmetric matrices. DPAR_DATA_SYM_MAT_TOL_HUGE DParam = C.MSK_DPAR_DATA_SYM_MAT_TOL_HUGE // Data tolerance threshold. DPAR_DATA_SYM_MAT_TOL_LARGE DParam = C.MSK_DPAR_DATA_SYM_MAT_TOL_LARGE // Data tolerance threshold. DPAR_DATA_TOL_AIJ_HUGE DParam = C.MSK_DPAR_DATA_TOL_AIJ_HUGE // Data tolerance threshold. DPAR_DATA_TOL_AIJ_LARGE DParam = C.MSK_DPAR_DATA_TOL_AIJ_LARGE // Data tolerance threshold. DPAR_DATA_TOL_BOUND_INF DParam = C.MSK_DPAR_DATA_TOL_BOUND_INF // Data tolerance threshold. DPAR_DATA_TOL_BOUND_WRN DParam = C.MSK_DPAR_DATA_TOL_BOUND_WRN // Data tolerance threshold. DPAR_DATA_TOL_C_HUGE DParam = C.MSK_DPAR_DATA_TOL_C_HUGE // Data tolerance threshold. DPAR_DATA_TOL_CJ_LARGE DParam = C.MSK_DPAR_DATA_TOL_CJ_LARGE // Data tolerance threshold. DPAR_DATA_TOL_QIJ DParam = C.MSK_DPAR_DATA_TOL_QIJ // Data tolerance threshold. DPAR_DATA_TOL_X DParam = C.MSK_DPAR_DATA_TOL_X // Data tolerance threshold. DPAR_INTPNT_CO_TOL_DFEAS DParam = C.MSK_DPAR_INTPNT_CO_TOL_DFEAS // Dual feasibility tolerance used by the interior-point optimizer for conic problems. DPAR_INTPNT_CO_TOL_INFEAS DParam = C.MSK_DPAR_INTPNT_CO_TOL_INFEAS // Infeasibility tolerance used by the interior-point optimizer for conic problems. DPAR_INTPNT_CO_TOL_MU_RED DParam = C.MSK_DPAR_INTPNT_CO_TOL_MU_RED // Relative complementarity gap tolerance used by the interior-point optimizer for conic problems. DPAR_INTPNT_CO_TOL_NEAR_REL DParam = C.MSK_DPAR_INTPNT_CO_TOL_NEAR_REL // Optimality tolerance used by the interior-point optimizer for conic problems. DPAR_INTPNT_CO_TOL_PFEAS DParam = C.MSK_DPAR_INTPNT_CO_TOL_PFEAS // Primal feasibility tolerance used by the interior-point optimizer for conic problems. DPAR_INTPNT_CO_TOL_REL_GAP DParam = C.MSK_DPAR_INTPNT_CO_TOL_REL_GAP // Relative gap termination tolerance used by the interior-point optimizer for conic problems. DPAR_INTPNT_QO_TOL_DFEAS DParam = C.MSK_DPAR_INTPNT_QO_TOL_DFEAS // Dual feasibility tolerance used by the interior-point optimizer for quadratic problems. DPAR_INTPNT_QO_TOL_INFEAS DParam = C.MSK_DPAR_INTPNT_QO_TOL_INFEAS // Infeasibility tolerance used by the interior-point optimizer for quadratic problems. DPAR_INTPNT_QO_TOL_MU_RED DParam = C.MSK_DPAR_INTPNT_QO_TOL_MU_RED // Relative complementarity gap tolerance used by the interior-point optimizer for quadratic problems. DPAR_INTPNT_QO_TOL_NEAR_REL DParam = C.MSK_DPAR_INTPNT_QO_TOL_NEAR_REL // Optimality tolerance used by the interior-point optimizer for quadratic problems. DPAR_INTPNT_QO_TOL_PFEAS DParam = C.MSK_DPAR_INTPNT_QO_TOL_PFEAS // Primal feasibility tolerance used by the interior-point optimizer for quadratic problems. DPAR_INTPNT_QO_TOL_REL_GAP DParam = C.MSK_DPAR_INTPNT_QO_TOL_REL_GAP // Relative gap termination tolerance used by the interior-point optimizer for quadratic problems. DPAR_INTPNT_TOL_DFEAS DParam = C.MSK_DPAR_INTPNT_TOL_DFEAS // Dual feasibility tolerance used by the interior-point optimizer for linear problems. DPAR_INTPNT_TOL_DSAFE DParam = C.MSK_DPAR_INTPNT_TOL_DSAFE // Controls the interior-point dual starting point. DPAR_INTPNT_TOL_INFEAS DParam = C.MSK_DPAR_INTPNT_TOL_INFEAS // Infeasibility tolerance used by the interior-point optimizer for linear problems. DPAR_INTPNT_TOL_MU_RED DParam = C.MSK_DPAR_INTPNT_TOL_MU_RED // Relative complementarity gap tolerance used by the interior-point optimizer for linear problems. DPAR_INTPNT_TOL_PATH DParam = C.MSK_DPAR_INTPNT_TOL_PATH // Interior-point centering aggressiveness. DPAR_INTPNT_TOL_PFEAS DParam = C.MSK_DPAR_INTPNT_TOL_PFEAS // Primal feasibility tolerance used by the interior-point optimizer for linear problems. DPAR_INTPNT_TOL_PSAFE DParam = C.MSK_DPAR_INTPNT_TOL_PSAFE // Controls the interior-point primal starting point. DPAR_INTPNT_TOL_REL_GAP DParam = C.MSK_DPAR_INTPNT_TOL_REL_GAP // Relative gap termination tolerance used by the interior-point optimizer for linear problems. DPAR_INTPNT_TOL_REL_STEP DParam = C.MSK_DPAR_INTPNT_TOL_REL_STEP // Relative step size to the boundary for linear and quadratic optimization problems. DPAR_INTPNT_TOL_STEP_SIZE DParam = C.MSK_DPAR_INTPNT_TOL_STEP_SIZE // Minimal step size tolerance for the interior-point optimizer. DPAR_LOWER_OBJ_CUT DParam = C.MSK_DPAR_LOWER_OBJ_CUT // Objective bound. DPAR_LOWER_OBJ_CUT_FINITE_TRH DParam = C.MSK_DPAR_LOWER_OBJ_CUT_FINITE_TRH // Objective bound. DPAR_MIO_DJC_MAX_BIGM DParam = C.MSK_DPAR_MIO_DJC_MAX_BIGM // Maximum allowed big-M value when reformulating disjunctive constraints to linear constraints. DPAR_MIO_MAX_TIME DParam = C.MSK_DPAR_MIO_MAX_TIME // Time limit for the mixed-integer optimizer. DPAR_MIO_REL_GAP_CONST DParam = C.MSK_DPAR_MIO_REL_GAP_CONST // This value is used to compute the relative gap for the solution to an integer optimization problem. DPAR_MIO_TOL_ABS_GAP DParam = C.MSK_DPAR_MIO_TOL_ABS_GAP // Absolute optimality tolerance employed by the mixed-integer optimizer. DPAR_MIO_TOL_ABS_RELAX_INT DParam = C.MSK_DPAR_MIO_TOL_ABS_RELAX_INT // Integer feasibility tolerance. DPAR_MIO_TOL_FEAS DParam = C.MSK_DPAR_MIO_TOL_FEAS // Feasibility tolerance for mixed integer solver. DPAR_MIO_TOL_REL_DUAL_BOUND_IMPROVEMENT DParam = C.MSK_DPAR_MIO_TOL_REL_DUAL_BOUND_IMPROVEMENT // Controls cut generation for mixed-integer optimizer. DPAR_MIO_TOL_REL_GAP DParam = C.MSK_DPAR_MIO_TOL_REL_GAP // Relative optimality tolerance employed by the mixed-integer optimizer. DPAR_OPTIMIZER_MAX_TICKS DParam = C.MSK_DPAR_OPTIMIZER_MAX_TICKS // Solver ticks limit. DPAR_OPTIMIZER_MAX_TIME DParam = C.MSK_DPAR_OPTIMIZER_MAX_TIME // Solver time limit. DPAR_PRESOLVE_TOL_ABS_LINDEP DParam = C.MSK_DPAR_PRESOLVE_TOL_ABS_LINDEP // Absolute tolerance employed by the linear dependency checker. DPAR_PRESOLVE_TOL_AIJ DParam = C.MSK_DPAR_PRESOLVE_TOL_AIJ // Absolute zero tolerance employed for constraint coefficients in the presolve. DPAR_PRESOLVE_TOL_PRIMAL_INFEAS_PERTURBATION DParam = C.MSK_DPAR_PRESOLVE_TOL_PRIMAL_INFEAS_PERTURBATION // The presolve is allowed to perturb a bound on a constraint or variable by this amount if it removes an infeasibility. DPAR_PRESOLVE_TOL_REL_LINDEP DParam = C.MSK_DPAR_PRESOLVE_TOL_REL_LINDEP // Relative tolerance employed by the linear dependency checker. DPAR_PRESOLVE_TOL_S DParam = C.MSK_DPAR_PRESOLVE_TOL_S // Absolute zero tolerance employed for slack variables in the presolve. DPAR_PRESOLVE_TOL_X DParam = C.MSK_DPAR_PRESOLVE_TOL_X // Absolute zero tolerance employed for variables in the presolve. DPAR_QCQO_REFORMULATE_REL_DROP_TOL DParam = C.MSK_DPAR_QCQO_REFORMULATE_REL_DROP_TOL // This parameter determines when columns are dropped in incomplete Cholesky factorization during reformulation of quadratic problems. DPAR_SEMIDEFINITE_TOL_APPROX DParam = C.MSK_DPAR_SEMIDEFINITE_TOL_APPROX // Tolerance to define a matrix to be positive semidefinite. DPAR_SIM_LU_TOL_REL_PIV DParam = C.MSK_DPAR_SIM_LU_TOL_REL_PIV // Relative pivot tolerance employed when computing the LU factorization of the basis matrix. DPAR_SIMPLEX_ABS_TOL_PIV DParam = C.MSK_DPAR_SIMPLEX_ABS_TOL_PIV // Absolute pivot tolerance employed by the simplex optimizers. DPAR_UPPER_OBJ_CUT DParam = C.MSK_DPAR_UPPER_OBJ_CUT // Objective bound. DPAR_UPPER_OBJ_CUT_FINITE_TRH DParam = C.MSK_DPAR_UPPER_OBJ_CUT_FINITE_TRH // Objective bound. )
type DataFormat ¶ added in v0.0.7
type DataFormat uint32
DataFormat is MSKdataformat_enum.
Data format types
const ( DATA_FORMAT_EXTENSION DataFormat = C.MSK_DATA_FORMAT_EXTENSION // The file extension is used to determine the data file format. DATA_FORMAT_MPS DataFormat = C.MSK_DATA_FORMAT_MPS // The data file is MPS formatted. DATA_FORMAT_LP DataFormat = C.MSK_DATA_FORMAT_LP // The data file is LP formatted. DATA_FORMAT_OP DataFormat = C.MSK_DATA_FORMAT_OP // The data file is an optimization problem formatted file. DATA_FORMAT_FREE_MPS DataFormat = C.MSK_DATA_FORMAT_FREE_MPS // The data a free MPS formatted file. DATA_FORMAT_TASK DataFormat = C.MSK_DATA_FORMAT_TASK // Generic task dump file. DATA_FORMAT_PTF DataFormat = C.MSK_DATA_FORMAT_PTF // (P)retty (T)ext (F)format. DATA_FORMAT_CB DataFormat = C.MSK_DATA_FORMAT_CB // Conic benchmark format, DATA_FORMAT_JSON_TASK DataFormat = C.MSK_DATA_FORMAT_JSON_TASK // JSON based task format. )
func (DataFormat) String ¶ added in v0.2.10
func (e DataFormat) String() string
type DomainType ¶ added in v0.2.0
type DomainType uint32
DomainType is MSKdomaintype_enum.
Cone types
const ( DOMAIN_R DomainType = C.MSK_DOMAIN_R // R. DOMAIN_RZERO DomainType = C.MSK_DOMAIN_RZERO // The zero vector. DOMAIN_RPLUS DomainType = C.MSK_DOMAIN_RPLUS // The positive orthant. DOMAIN_RMINUS DomainType = C.MSK_DOMAIN_RMINUS // The negative orthant. DOMAIN_QUADRATIC_CONE DomainType = C.MSK_DOMAIN_QUADRATIC_CONE // The quadratic cone. DOMAIN_RQUADRATIC_CONE DomainType = C.MSK_DOMAIN_RQUADRATIC_CONE // The rotated quadratic cone. DOMAIN_PRIMAL_EXP_CONE DomainType = C.MSK_DOMAIN_PRIMAL_EXP_CONE // The primal exponential cone. DOMAIN_DUAL_EXP_CONE DomainType = C.MSK_DOMAIN_DUAL_EXP_CONE // The dual exponential cone. DOMAIN_PRIMAL_POWER_CONE DomainType = C.MSK_DOMAIN_PRIMAL_POWER_CONE // The primal power cone. DOMAIN_DUAL_POWER_CONE DomainType = C.MSK_DOMAIN_DUAL_POWER_CONE // The dual power cone. DOMAIN_PRIMAL_GEO_MEAN_CONE DomainType = C.MSK_DOMAIN_PRIMAL_GEO_MEAN_CONE // The primal geometric mean cone. DOMAIN_DUAL_GEO_MEAN_CONE DomainType = C.MSK_DOMAIN_DUAL_GEO_MEAN_CONE // The dual geometric mean cone. DOMAIN_SVEC_PSD_CONE DomainType = C.MSK_DOMAIN_SVEC_PSD_CONE // The vectorized positive semidefinite cone. )
func (DomainType) String ¶ added in v0.2.10
func (e DomainType) String() string
type Env ¶
type Env struct {
// contains filtered or unexported fields
}
Env wraps mosek environment
func MakeEnv ¶
MakeEnv creates a new mosek environment. dbgfile can be zero or one, error when more than two dbgfile are provided.
Remember the env needs to be deleted.
func (*Env) Axpy ¶ added in v0.1.4
Axpy is wrapping MSK_axpy, performs y = a*x + y where x/y are vectors.
func (*Env) CheckInAll ¶ added in v0.2.2
CheckInAll is wrapping MSK_checkinall, Check in all unused license features to the license token server.
func (*Env) CheckInLicense ¶ added in v0.2.2
CheckInLicense is wrapping MSK_checkinlicense, Check in a license feature back to the license server ahead of time.
Arguments:
- `feature` Feature to check in to the license system.
func (*Env) CheckMemenv ¶ added in v0.2.2
CheckMemenv is wrapping MSK_checkmemenv
func (*Env) CheckOutLicense ¶ added in v0.2.8
CheckOutLicense is wrapping MSK_checkoutlicense, Check out a license feature from the license server ahead of time.
Arguments:
- `feature` Feature to check out from the license system.
func (*Env) CheckVersion ¶ added in v0.2.2
CheckVersion is wrapping MSK_checkversion, Compares a version of the MOSEK DLL with a specified version.
Arguments:
- `major` Major version number.
- `minor` Minor version number.
- `revision` Revision number.
func (*Env) Dot ¶ added in v0.1.4
Dot is wrapping MSK_dot, Computes the inner product of two vectors.
Arguments:
- `n` Length of the vectors.
- `x` The x vector.
- `y` The y vector.
- `xty` The result of the inner product.
func (*Env) EchoIntro ¶ added in v0.2.8
EchoIntro is wrapping MSK_echointro, Prints an intro to message stream.
Arguments:
- `longver` If non-zero, then the intro is slightly longer.
func (*Env) Expirylicenses ¶ added in v0.2.0
Expirylicenses is wrapping MSK_expirylicenses, Reports when the first license feature expires.
Arguments:
- `expiry` If nonnegative, then it is the minimum number days to expiry of any feature that has been checked out.
func (*Env) Gemm ¶ added in v0.1.4
func (env *Env) Gemm( transa Transpose, transb Transpose, m int32, n int32, k int32, alpha float64, a []float64, b []float64, beta float64, c []float64, ) error
Gemm is wrapping MSK_gemm, Performs a dense matrix multiplication.
Arguments:
- `transa` Indicates whether the matrix A must be transposed.
- `transb` Indicates whether the matrix B must be transposed.
- `m` Indicates the number of rows of matrix C.
- `n` Indicates the number of columns of matrix C.
- `k` Specifies the common dimension along which op(A) and op(B) are multiplied.
- `alpha` A scalar value multiplying the result of the matrix multiplication.
- `a` The pointer to the array storing matrix A in a column-major format.
- `b` The pointer to the array storing matrix B in a column-major format.
- `beta` A scalar value that multiplies C.
- `c` The pointer to the array storing matrix C in a column-major format.
func (*Env) Gemv ¶ added in v0.1.4
func (env *Env) Gemv( transa Transpose, m int32, n int32, alpha float64, a []float64, x []float64, beta float64, y []float64, ) error
Gemv is wrapping MSK_gemv, calculates y = aAx + by, where A is matrix, x,y is vector, and a b are scalars.
func (*Env) GetSymbcondim ¶ added in v0.2.1
GetSymbcondim is wrapping MSK_getsymbcondim
func (*Env) Iparvaltosymnam ¶ added in v0.2.0
Iparvaltosymnam is wrapping MSK_iparvaltosymnam
func (*Env) LinkFiletoenvstream ¶ added in v0.2.2
func (env *Env) LinkFiletoenvstream( whichstream StreamType, filename string, append int32, ) error
LinkFiletoenvstream is wrapping MSK_linkfiletoenvstream
func (*Env) Potrf ¶ added in v0.1.4
Potrf is wrapping MSK_potrf, Computes a Cholesky factorization of a dense matrix.
Arguments:
- `uplo` Indicates whether the upper or lower triangular part of the matrix is stored.
- `n` Dimension of the symmetric matrix.
- `a` A symmetric matrix stored in column-major order.
func (*Env) PutLicenseCode ¶ added in v0.2.8
PutLicenseCode is wrapping MSK_putlicensecode, Input a runtime license code.
Arguments:
- `code` A license key string.
func (*Env) PutLicenseDebug ¶ added in v0.2.8
PutLicenseDebug is wrapping MSK_putlicensedebug, Enables debug information for the license system.
Arguments:
- `licdebug` Enable output of license check-out debug information.
func (*Env) PutLicensePath ¶ added in v0.2.8
PutLicensePath is wrapping MSK_putlicensepath, Set the path to the license file.
Arguments:
- `licensepath` A path specifying where to search for the license.
func (*Env) PutLicenseWait ¶ added in v0.2.8
PutLicenseWait is wrapping MSK_putlicensewait, Control whether mosek should wait for an available license if no license is available.
Arguments:
- `licwait` Enable waiting for a license.
func (*Env) ResetExpiryLicenses ¶ added in v0.2.8
ResetExpiryLicenses is wrapping MSK_resetexpirylicenses, Reset the license expiry reporting startpoint.
func (*Env) SparseTriangularSolveDense ¶ added in v0.2.8
func (env *Env) SparseTriangularSolveDense( transposed Transpose, n int32, lnzc []int32, lptrc []int64, lensubnval int64, lsubc []int32, lvalc []float64, b []float64, ) error
SparseTriangularSolveDense is wrapping MSK_sparsetriangularsolvedense, Solves a sparse triangular system of linear equations.
Arguments:
- `transposed` Controls whether the solve is with L or the transposed L.
- `lnzc` lnzc\[j\] is the number of nonzeros in column j.
- `lptrc` lptrc\[j\] is a pointer to the first row index and value in column j.
- `lsubc` Row indexes for each column stored sequentially.
- `lvalc` The value corresponding to row indexed stored lsubc.
- `b` The right-hand side of linear equation system to be solved as a dense vector.
func (*Env) Syeig ¶ added in v0.1.4
Syeig is wrapping MSK_syeig, Computes all eigenvalues of a symmetric dense matrix.
Arguments:
- `uplo` Indicates whether the upper or lower triangular part is used.
- `n` Dimension of the symmetric input matrix.
- `a` Input matrix A.
- `w` Array of length at least n containing the eigenvalues of A.
func (*Env) Syevd ¶ added in v0.1.4
Syevd is wrapping MSK_syevd, Computes all the eigenvalues and eigenvectors of a symmetric dense matrix, and thus its eigenvalue decomposition.
Arguments:
- `uplo` Indicates whether the upper or lower triangular part is used.
- `n` Dimension of the symmetric input matrix.
- `a` Input matrix A.
- `w` Array of length at least n containing the eigenvalues of A.
func (*Env) Syrk ¶ added in v0.1.4
func (env *Env) Syrk( uplo UpLo, trans Transpose, n int32, k int32, alpha float64, a []float64, beta float64, c []float64, ) error
Syrk is wrapping MSK_syrk, Performs a rank-k update of a symmetric matrix.
Arguments:
- `uplo` Indicates whether the upper or lower triangular part of C is used.
- `trans` Indicates whether the matrix A must be transposed.
- `n` Specifies the order of C.
- `k` Indicates the number of rows or columns of A, and its rank.
- `alpha` A scalar value multiplying the result of the matrix multiplication.
- `a` The pointer to the array storing matrix A in a column-major format.
- `beta` A scalar value that multiplies C.
- `c` The pointer to the array storing matrix C in a column-major format.
func (*Env) UnlinkFuncfromenvstream ¶ added in v0.2.2
func (env *Env) UnlinkFuncfromenvstream( whichstream StreamType, ) error
UnlinkFuncfromenvstream is wrapping MSK_unlinkfuncfromenvstream
type Feature ¶ added in v0.2.0
type Feature uint32
Feature is MSKfeature_enum.
License feature
const ( FEATURE_PTS Feature = C.MSK_FEATURE_PTS // Base system. FEATURE_PTON Feature = C.MSK_FEATURE_PTON // Conic extension. )
type IInfItem ¶ added in v0.1.2
type IInfItem uint32
IInfItem is MSKiinfitem_enum.
Integer information items.
const ( IINF_ANA_PRO_NUM_CON IInfItem = C.MSK_IINF_ANA_PRO_NUM_CON // Number of constraints in the problem. IINF_ANA_PRO_NUM_CON_EQ IInfItem = C.MSK_IINF_ANA_PRO_NUM_CON_EQ // Number of equality constraints. IINF_ANA_PRO_NUM_CON_FR IInfItem = C.MSK_IINF_ANA_PRO_NUM_CON_FR // Number of unbounded constraints. IINF_ANA_PRO_NUM_CON_LO IInfItem = C.MSK_IINF_ANA_PRO_NUM_CON_LO // Number of constraints with a lower bound and an infinite upper bound. IINF_ANA_PRO_NUM_CON_RA IInfItem = C.MSK_IINF_ANA_PRO_NUM_CON_RA // Number of constraints with finite lower and upper bounds. IINF_ANA_PRO_NUM_CON_UP IInfItem = C.MSK_IINF_ANA_PRO_NUM_CON_UP // Number of constraints with an upper bound and an infinite lower bound. IINF_ANA_PRO_NUM_VAR IInfItem = C.MSK_IINF_ANA_PRO_NUM_VAR // Number of variables in the problem. IINF_ANA_PRO_NUM_VAR_BIN IInfItem = C.MSK_IINF_ANA_PRO_NUM_VAR_BIN // Number of binary variables. IINF_ANA_PRO_NUM_VAR_CONT IInfItem = C.MSK_IINF_ANA_PRO_NUM_VAR_CONT // Number of continuous variables. IINF_ANA_PRO_NUM_VAR_EQ IInfItem = C.MSK_IINF_ANA_PRO_NUM_VAR_EQ // Number of fixed variables. IINF_ANA_PRO_NUM_VAR_FR IInfItem = C.MSK_IINF_ANA_PRO_NUM_VAR_FR // Number of unbounded constraints. IINF_ANA_PRO_NUM_VAR_INT IInfItem = C.MSK_IINF_ANA_PRO_NUM_VAR_INT // Number of general integer variables. IINF_ANA_PRO_NUM_VAR_LO IInfItem = C.MSK_IINF_ANA_PRO_NUM_VAR_LO // Number of variables with a lower bound and an infinite upper bound. IINF_ANA_PRO_NUM_VAR_RA IInfItem = C.MSK_IINF_ANA_PRO_NUM_VAR_RA // Number of variables with finite lower and upper bounds. IINF_ANA_PRO_NUM_VAR_UP IInfItem = C.MSK_IINF_ANA_PRO_NUM_VAR_UP // Number of variables with an upper bound and an infinite lower bound. IINF_INTPNT_FACTOR_DIM_DENSE IInfItem = C.MSK_IINF_INTPNT_FACTOR_DIM_DENSE // Dimension of the dense sub system in factorization. IINF_INTPNT_ITER IInfItem = C.MSK_IINF_INTPNT_ITER // Number of interior-point iterations since invoking the interior-point optimizer. IINF_INTPNT_NUM_THREADS IInfItem = C.MSK_IINF_INTPNT_NUM_THREADS // Number of threads that the interior-point optimizer is using. IINF_INTPNT_SOLVE_DUAL IInfItem = C.MSK_IINF_INTPNT_SOLVE_DUAL // Non-zero if the interior-point optimizer is solving the dual problem. IINF_MIO_ABSGAP_SATISFIED IInfItem = C.MSK_IINF_MIO_ABSGAP_SATISFIED // Non-zero if absolute gap is within tolerances. IINF_MIO_CLIQUE_TABLE_SIZE IInfItem = C.MSK_IINF_MIO_CLIQUE_TABLE_SIZE // Size of the clique table. IINF_MIO_CONSTRUCT_SOLUTION IInfItem = C.MSK_IINF_MIO_CONSTRUCT_SOLUTION // Informs if MOSEK successfully constructed an initial integer feasible solution. IINF_MIO_INITIAL_FEASIBLE_SOLUTION IInfItem = C.MSK_IINF_MIO_INITIAL_FEASIBLE_SOLUTION // Informs if MOSEK found the solution provided by the user to be feasible IINF_MIO_NODE_DEPTH IInfItem = C.MSK_IINF_MIO_NODE_DEPTH // Depth of the last node solved. IINF_MIO_NUM_ACTIVE_NODES IInfItem = C.MSK_IINF_MIO_NUM_ACTIVE_NODES // Number of active branch and bound nodes. IINF_MIO_NUM_ACTIVE_ROOT_CUTS IInfItem = C.MSK_IINF_MIO_NUM_ACTIVE_ROOT_CUTS // Number of active cuts in the final relaxation after the mixed-integer optimizer's root cut generation. IINF_MIO_NUM_BRANCH IInfItem = C.MSK_IINF_MIO_NUM_BRANCH // Number of branches performed during the optimization. IINF_MIO_NUM_INT_SOLUTIONS IInfItem = C.MSK_IINF_MIO_NUM_INT_SOLUTIONS // Number of integer feasible solutions that have been found. IINF_MIO_NUM_RELAX IInfItem = C.MSK_IINF_MIO_NUM_RELAX // Number of relaxations solved during the optimization. IINF_MIO_NUM_REPEATED_PRESOLVE IInfItem = C.MSK_IINF_MIO_NUM_REPEATED_PRESOLVE // Number of times presolve was repeated at root. IINF_MIO_NUM_RESTARTS IInfItem = C.MSK_IINF_MIO_NUM_RESTARTS // Number of restarts performed during the optimization. IINF_MIO_NUM_ROOT_CUT_ROUNDS IInfItem = C.MSK_IINF_MIO_NUM_ROOT_CUT_ROUNDS // Number of cut separation rounds at the root node of the mixed-integer optimizer. IINF_MIO_NUM_SELECTED_CLIQUE_CUTS IInfItem = C.MSK_IINF_MIO_NUM_SELECTED_CLIQUE_CUTS // Number of clique cuts selected to be included in the relaxation. IINF_MIO_NUM_SELECTED_CMIR_CUTS IInfItem = C.MSK_IINF_MIO_NUM_SELECTED_CMIR_CUTS // Number of Complemented Mixed Integer Rounding (CMIR) cuts selected to be included in the relaxation. IINF_MIO_NUM_SELECTED_GOMORY_CUTS IInfItem = C.MSK_IINF_MIO_NUM_SELECTED_GOMORY_CUTS // Number of Gomory cuts selected to be included in the relaxation. IINF_MIO_NUM_SELECTED_IMPLIED_BOUND_CUTS IInfItem = C.MSK_IINF_MIO_NUM_SELECTED_IMPLIED_BOUND_CUTS // Number of implied bound cuts selected to be included in the relaxation. IINF_MIO_NUM_SELECTED_KNAPSACK_COVER_CUTS IInfItem = C.MSK_IINF_MIO_NUM_SELECTED_KNAPSACK_COVER_CUTS // Number of clique cuts selected to be included in the relaxation. IINF_MIO_NUM_SELECTED_LIPRO_CUTS IInfItem = C.MSK_IINF_MIO_NUM_SELECTED_LIPRO_CUTS // Number of lift-and-project cuts selected to be included in the relaxation. IINF_MIO_NUM_SEPARATED_CLIQUE_CUTS IInfItem = C.MSK_IINF_MIO_NUM_SEPARATED_CLIQUE_CUTS // Number of separated clique cuts. IINF_MIO_NUM_SEPARATED_CMIR_CUTS IInfItem = C.MSK_IINF_MIO_NUM_SEPARATED_CMIR_CUTS // Number of separated Complemented Mixed Integer Rounding (CMIR) cuts. IINF_MIO_NUM_SEPARATED_GOMORY_CUTS IInfItem = C.MSK_IINF_MIO_NUM_SEPARATED_GOMORY_CUTS // Number of separated Gomory cuts. IINF_MIO_NUM_SEPARATED_IMPLIED_BOUND_CUTS IInfItem = C.MSK_IINF_MIO_NUM_SEPARATED_IMPLIED_BOUND_CUTS // Number of separated implied bound cuts. IINF_MIO_NUM_SEPARATED_KNAPSACK_COVER_CUTS IInfItem = C.MSK_IINF_MIO_NUM_SEPARATED_KNAPSACK_COVER_CUTS // Number of separated clique cuts. IINF_MIO_NUM_SEPARATED_LIPRO_CUTS IInfItem = C.MSK_IINF_MIO_NUM_SEPARATED_LIPRO_CUTS // Number of separated lift-and-project cuts. IINF_MIO_NUM_SOLVED_NODES IInfItem = C.MSK_IINF_MIO_NUM_SOLVED_NODES // Number of branch and bounds nodes solved in the main branch and bound tree. IINF_MIO_NUMBIN IInfItem = C.MSK_IINF_MIO_NUMBIN // Number of binary variables in the problem to be solved by the mixed-integer optimizer. IINF_MIO_NUMBINCONEVAR IInfItem = C.MSK_IINF_MIO_NUMBINCONEVAR // Number of binary cone variables in the problem to be solved by the mixed-integer optimizer. IINF_MIO_NUMCON IInfItem = C.MSK_IINF_MIO_NUMCON // Number of constraints in the problem to be solved by the mixed-integer optimizer. IINF_MIO_NUMCONE IInfItem = C.MSK_IINF_MIO_NUMCONE // Number of cones in the problem to be solved by the mixed-integer optimizer. IINF_MIO_NUMCONEVAR IInfItem = C.MSK_IINF_MIO_NUMCONEVAR // Number of cone variables in the problem to be solved by the mixed-integer optimizer. IINF_MIO_NUMCONT IInfItem = C.MSK_IINF_MIO_NUMCONT // Number of continuous variables in the problem to be solved by the mixed-integer optimizer. IINF_MIO_NUMCONTCONEVAR IInfItem = C.MSK_IINF_MIO_NUMCONTCONEVAR // Number of continuous cone variables in the problem to be solved by the mixed-integer optimizer. IINF_MIO_NUMDEXPCONES IInfItem = C.MSK_IINF_MIO_NUMDEXPCONES // Number of dual exponential cones in the problem to be solved by the mixed-integer optimizer. IINF_MIO_NUMDJC IInfItem = C.MSK_IINF_MIO_NUMDJC // Number of disjunctive constraints in the problem to be solved by the mixed-integer optimizer. IINF_MIO_NUMDPOWCONES IInfItem = C.MSK_IINF_MIO_NUMDPOWCONES // Number of dual power cones in the problem to be solved by the mixed-integer optimizer. IINF_MIO_NUMINT IInfItem = C.MSK_IINF_MIO_NUMINT // Number of integer variables in the problem to be solved by the mixed-integer optimizer. IINF_MIO_NUMINTCONEVAR IInfItem = C.MSK_IINF_MIO_NUMINTCONEVAR // Number of integer cone variables in the problem to be solved by the mixed-integer optimizer. IINF_MIO_NUMPEXPCONES IInfItem = C.MSK_IINF_MIO_NUMPEXPCONES // Number of primal exponential cones in the problem to be solved by the mixed-integer optimizer. IINF_MIO_NUMPPOWCONES IInfItem = C.MSK_IINF_MIO_NUMPPOWCONES // Number of primal power cones in the problem to be solved by the mixed-integer optimizer. IINF_MIO_NUMQCONES IInfItem = C.MSK_IINF_MIO_NUMQCONES // Number of quadratic cones in the problem to be solved by the mixed-integer optimizer. IINF_MIO_NUMRQCONES IInfItem = C.MSK_IINF_MIO_NUMRQCONES // Number of rotated quadratic cones in the problem to be solved by the mixed-integer optimizer. IINF_MIO_NUMVAR IInfItem = C.MSK_IINF_MIO_NUMVAR // Number of variables in the problem to be solved by the mixed-integer optimizer. IINF_MIO_OBJ_BOUND_DEFINED IInfItem = C.MSK_IINF_MIO_OBJ_BOUND_DEFINED // Non-zero if a valid objective bound has been found, otherwise zero. IINF_MIO_PRESOLVED_NUMBIN IInfItem = C.MSK_IINF_MIO_PRESOLVED_NUMBIN // Number of binary variables in the problem after the mixed-integer optimizer's presolve. IINF_MIO_PRESOLVED_NUMBINCONEVAR IInfItem = C.MSK_IINF_MIO_PRESOLVED_NUMBINCONEVAR // Number of binary cone variables in the problem after the mixed-integer optimizer's presolve. IINF_MIO_PRESOLVED_NUMCON IInfItem = C.MSK_IINF_MIO_PRESOLVED_NUMCON // Number of constraints in the problem after the mixed-integer optimizer's presolve. IINF_MIO_PRESOLVED_NUMCONE IInfItem = C.MSK_IINF_MIO_PRESOLVED_NUMCONE // Number of cones in the problem after the mixed-integer optimizer's presolve. IINF_MIO_PRESOLVED_NUMCONEVAR IInfItem = C.MSK_IINF_MIO_PRESOLVED_NUMCONEVAR // Number of cone variables in the problem after the mixed-integer optimizer's presolve. IINF_MIO_PRESOLVED_NUMCONT IInfItem = C.MSK_IINF_MIO_PRESOLVED_NUMCONT // Number of continuous variables in the problem after the mixed-integer optimizer's presolve. IINF_MIO_PRESOLVED_NUMCONTCONEVAR IInfItem = C.MSK_IINF_MIO_PRESOLVED_NUMCONTCONEVAR // Number of continuous cone variables in the problem after the mixed-integer optimizer's presolve. IINF_MIO_PRESOLVED_NUMDEXPCONES IInfItem = C.MSK_IINF_MIO_PRESOLVED_NUMDEXPCONES // Number of dual exponential cones in the problem after the mixed-integer optimizer's presolve. IINF_MIO_PRESOLVED_NUMDJC IInfItem = C.MSK_IINF_MIO_PRESOLVED_NUMDJC // Number of disjunctive constraints in the problem after the mixed-integer optimizer's presolve. IINF_MIO_PRESOLVED_NUMDPOWCONES IInfItem = C.MSK_IINF_MIO_PRESOLVED_NUMDPOWCONES // Number of dual power cones in the problem after the mixed-integer optimizer's presolve. IINF_MIO_PRESOLVED_NUMINT IInfItem = C.MSK_IINF_MIO_PRESOLVED_NUMINT // Number of integer variables in the problem after the mixed-integer optimizer's presolve. IINF_MIO_PRESOLVED_NUMINTCONEVAR IInfItem = C.MSK_IINF_MIO_PRESOLVED_NUMINTCONEVAR // Number of integer cone variables in the problem after the mixed-integer optimizer's presolve. IINF_MIO_PRESOLVED_NUMPEXPCONES IInfItem = C.MSK_IINF_MIO_PRESOLVED_NUMPEXPCONES // Number of primal exponential cones in the problem after the mixed-integer optimizer's presolve. IINF_MIO_PRESOLVED_NUMPPOWCONES IInfItem = C.MSK_IINF_MIO_PRESOLVED_NUMPPOWCONES // Number of primal power cones in the problem after the mixed-integer optimizer's presolve. IINF_MIO_PRESOLVED_NUMQCONES IInfItem = C.MSK_IINF_MIO_PRESOLVED_NUMQCONES // Number of quadratic cones in the problem after the mixed-integer optimizer's presolve. IINF_MIO_PRESOLVED_NUMRQCONES IInfItem = C.MSK_IINF_MIO_PRESOLVED_NUMRQCONES // Number of rotated quadratic cones in the problem after the mixed-integer optimizer's presolve. IINF_MIO_PRESOLVED_NUMVAR IInfItem = C.MSK_IINF_MIO_PRESOLVED_NUMVAR // Number of variables in the problem after the mixed-integer optimizer's presolve. IINF_MIO_RELGAP_SATISFIED IInfItem = C.MSK_IINF_MIO_RELGAP_SATISFIED // Non-zero if relative gap is within tolerances. IINF_MIO_TOTAL_NUM_SELECTED_CUTS IInfItem = C.MSK_IINF_MIO_TOTAL_NUM_SELECTED_CUTS // Total number of cuts selected to be included in the relaxation by the mixed-integer optimizer. IINF_MIO_TOTAL_NUM_SEPARATED_CUTS IInfItem = C.MSK_IINF_MIO_TOTAL_NUM_SEPARATED_CUTS // Total number of cuts separated by the mixed-integer optimizer. IINF_MIO_USER_OBJ_CUT IInfItem = C.MSK_IINF_MIO_USER_OBJ_CUT // If it is non-zero, then the objective cut is used. IINF_OPT_NUMCON IInfItem = C.MSK_IINF_OPT_NUMCON // Number of constraints in the problem solved when the optimizer is called. IINF_OPT_NUMVAR IInfItem = C.MSK_IINF_OPT_NUMVAR // Number of variables in the problem solved when the optimizer is called IINF_OPTIMIZE_RESPONSE IInfItem = C.MSK_IINF_OPTIMIZE_RESPONSE // The response code returned by optimize. IINF_PRESOLVE_NUM_PRIMAL_PERTURBATIONS IInfItem = C.MSK_IINF_PRESOLVE_NUM_PRIMAL_PERTURBATIONS // Number perturbations to thhe bounds of the primal problem. IINF_PURIFY_DUAL_SUCCESS IInfItem = C.MSK_IINF_PURIFY_DUAL_SUCCESS // Is nonzero if the dual solution is purified. IINF_PURIFY_PRIMAL_SUCCESS IInfItem = C.MSK_IINF_PURIFY_PRIMAL_SUCCESS // Is nonzero if the primal solution is purified. IINF_RD_NUMBARVAR IInfItem = C.MSK_IINF_RD_NUMBARVAR // Number of symmetric variables read. IINF_RD_NUMCON IInfItem = C.MSK_IINF_RD_NUMCON // Number of constraints read. IINF_RD_NUMCONE IInfItem = C.MSK_IINF_RD_NUMCONE // Number of conic constraints read. IINF_RD_NUMINTVAR IInfItem = C.MSK_IINF_RD_NUMINTVAR // Number of integer-constrained variables read. IINF_RD_NUMQ IInfItem = C.MSK_IINF_RD_NUMQ // Number of nonempty Q matrices read. IINF_RD_NUMVAR IInfItem = C.MSK_IINF_RD_NUMVAR // Number of variables read. IINF_RD_PROTYPE IInfItem = C.MSK_IINF_RD_PROTYPE // Problem type. IINF_SIM_DUAL_DEG_ITER IInfItem = C.MSK_IINF_SIM_DUAL_DEG_ITER // The number of dual degenerate iterations. IINF_SIM_DUAL_HOTSTART IInfItem = C.MSK_IINF_SIM_DUAL_HOTSTART // If 1 then the dual simplex algorithm is solving from an advanced basis. IINF_SIM_DUAL_HOTSTART_LU IInfItem = C.MSK_IINF_SIM_DUAL_HOTSTART_LU // If 1 then a valid basis factorization of full rank was located and used by the dual simplex algorithm. IINF_SIM_DUAL_INF_ITER IInfItem = C.MSK_IINF_SIM_DUAL_INF_ITER // The number of iterations taken with dual infeasibility. IINF_SIM_DUAL_ITER IInfItem = C.MSK_IINF_SIM_DUAL_ITER // Number of dual simplex iterations during the last optimization. IINF_SIM_NUMCON IInfItem = C.MSK_IINF_SIM_NUMCON // Number of constraints in the problem solved by the simplex optimizer. IINF_SIM_NUMVAR IInfItem = C.MSK_IINF_SIM_NUMVAR // Number of variables in the problem solved by the simplex optimizer. IINF_SIM_PRIMAL_DEG_ITER IInfItem = C.MSK_IINF_SIM_PRIMAL_DEG_ITER // The number of primal degenerate iterations. IINF_SIM_PRIMAL_HOTSTART IInfItem = C.MSK_IINF_SIM_PRIMAL_HOTSTART // If 1 then the primal simplex algorithm is solving from an advanced basis. IINF_SIM_PRIMAL_HOTSTART_LU IInfItem = C.MSK_IINF_SIM_PRIMAL_HOTSTART_LU // If 1 then a valid basis factorization of full rank was located and used by the primal simplex algorithm. IINF_SIM_PRIMAL_INF_ITER IInfItem = C.MSK_IINF_SIM_PRIMAL_INF_ITER // The number of iterations taken with primal infeasibility. IINF_SIM_PRIMAL_ITER IInfItem = C.MSK_IINF_SIM_PRIMAL_ITER // Number of primal simplex iterations during the last optimization. IINF_SIM_SOLVE_DUAL IInfItem = C.MSK_IINF_SIM_SOLVE_DUAL // Is non-zero if dual problem is solved. IINF_SOL_BAS_PROSTA IInfItem = C.MSK_IINF_SOL_BAS_PROSTA // Problem status of the basic solution. Updated after each optimization. IINF_SOL_BAS_SOLSTA IInfItem = C.MSK_IINF_SOL_BAS_SOLSTA // Solution status of the basic solution. Updated after each optimization. IINF_SOL_ITG_PROSTA IInfItem = C.MSK_IINF_SOL_ITG_PROSTA // Problem status of the integer solution. Updated after each optimization. IINF_SOL_ITG_SOLSTA IInfItem = C.MSK_IINF_SOL_ITG_SOLSTA // Solution status of the integer solution. Updated after each optimization. IINF_SOL_ITR_PROSTA IInfItem = C.MSK_IINF_SOL_ITR_PROSTA // Problem status of the interior-point solution. Updated after each optimization. IINF_SOL_ITR_SOLSTA IInfItem = C.MSK_IINF_SOL_ITR_SOLSTA // Solution status of the interior-point solution. Updated after each optimization. IINF_STO_NUM_A_REALLOC IInfItem = C.MSK_IINF_STO_NUM_A_REALLOC // Number of times the storage for storing the linear coefficient matrix has been changed. )
type IParam ¶ added in v0.0.9
type IParam uint32
IParam is MSKiparam_enum.
tells what paramete the integer parameter is set for in MSK_putintparam or Task.PutIntParam.
const ( IPAR_ANA_SOL_BASIS IParam = C.MSK_IPAR_ANA_SOL_BASIS // Controls whether the basis matrix is analyzed in solution analyzer. IPAR_ANA_SOL_PRINT_VIOLATED IParam = C.MSK_IPAR_ANA_SOL_PRINT_VIOLATED // Controls whether a list of violated constraints is printed. IPAR_AUTO_SORT_A_BEFORE_OPT IParam = C.MSK_IPAR_AUTO_SORT_A_BEFORE_OPT // Controls whether the elements in each column of A are sorted before an optimization is performed. IPAR_AUTO_UPDATE_SOL_INFO IParam = C.MSK_IPAR_AUTO_UPDATE_SOL_INFO // Controls whether the solution information items are automatically updated after an optimization is performed. IPAR_BASIS_SOLVE_USE_PLUS_ONE IParam = C.MSK_IPAR_BASIS_SOLVE_USE_PLUS_ONE // Controls the sign of the columns in the basis matrix corresponding to slack variables. IPAR_BI_CLEAN_OPTIMIZER IParam = C.MSK_IPAR_BI_CLEAN_OPTIMIZER // Controls which simplex optimizer is used in the clean-up phase. IPAR_BI_IGNORE_MAX_ITER IParam = C.MSK_IPAR_BI_IGNORE_MAX_ITER // Turns on basis identification in case the interior-point optimizer is terminated due to maximum number of iterations. IPAR_BI_IGNORE_NUM_ERROR IParam = C.MSK_IPAR_BI_IGNORE_NUM_ERROR // Turns on basis identification in case the interior-point optimizer is terminated due to a numerical problem. IPAR_BI_MAX_ITERATIONS IParam = C.MSK_IPAR_BI_MAX_ITERATIONS // Maximum number of iterations after basis identification. IPAR_CACHE_LICENSE IParam = C.MSK_IPAR_CACHE_LICENSE // Control license caching. IPAR_COMPRESS_STATFILE IParam = C.MSK_IPAR_COMPRESS_STATFILE // Control compression of stat files. IPAR_INFEAS_GENERIC_NAMES IParam = C.MSK_IPAR_INFEAS_GENERIC_NAMES // Controls the contents of the infeasibility report. IPAR_INFEAS_PREFER_PRIMAL IParam = C.MSK_IPAR_INFEAS_PREFER_PRIMAL // Controls which certificate is used if both primal- and dual- certificate of infeasibility is available. IPAR_INFEAS_REPORT_AUTO IParam = C.MSK_IPAR_INFEAS_REPORT_AUTO // Turns the feasibility report on or off. IPAR_INFEAS_REPORT_LEVEL IParam = C.MSK_IPAR_INFEAS_REPORT_LEVEL // Controls the contents of the infeasibility report. IPAR_INTPNT_BASIS IParam = C.MSK_IPAR_INTPNT_BASIS // Controls whether basis identification is performed. IPAR_INTPNT_DIFF_STEP IParam = C.MSK_IPAR_INTPNT_DIFF_STEP // Controls whether different step sizes are allowed in the primal and dual space. IPAR_INTPNT_HOTSTART IParam = C.MSK_IPAR_INTPNT_HOTSTART // Currently not in use. IPAR_INTPNT_MAX_ITERATIONS IParam = C.MSK_IPAR_INTPNT_MAX_ITERATIONS // Controls the maximum number of iterations allowed in the interior-point optimizer. IPAR_INTPNT_MAX_NUM_COR IParam = C.MSK_IPAR_INTPNT_MAX_NUM_COR // Maximum number of correction steps. IPAR_INTPNT_MAX_NUM_REFINEMENT_STEPS IParam = C.MSK_IPAR_INTPNT_MAX_NUM_REFINEMENT_STEPS // Maximum number of steps to be used by the iterative search direction refinement. IPAR_INTPNT_OFF_COL_TRH IParam = C.MSK_IPAR_INTPNT_OFF_COL_TRH // Controls the aggressiveness of the offending column detection. IPAR_INTPNT_ORDER_GP_NUM_SEEDS IParam = C.MSK_IPAR_INTPNT_ORDER_GP_NUM_SEEDS // This parameter controls the number of random seeds tried. IPAR_INTPNT_ORDER_METHOD IParam = C.MSK_IPAR_INTPNT_ORDER_METHOD // Controls the ordering strategy. IPAR_INTPNT_PURIFY IParam = C.MSK_IPAR_INTPNT_PURIFY // Currently not in use. IPAR_INTPNT_REGULARIZATION_USE IParam = C.MSK_IPAR_INTPNT_REGULARIZATION_USE // Controls whether regularization is allowed. IPAR_INTPNT_SCALING IParam = C.MSK_IPAR_INTPNT_SCALING // Controls how the problem is scaled before the interior-point optimizer is used. IPAR_INTPNT_SOLVE_FORM IParam = C.MSK_IPAR_INTPNT_SOLVE_FORM // Controls whether the primal or the dual problem is solved. IPAR_INTPNT_STARTING_POINT IParam = C.MSK_IPAR_INTPNT_STARTING_POINT // Starting point used by the interior-point optimizer. IPAR_LICENSE_DEBUG IParam = C.MSK_IPAR_LICENSE_DEBUG // Controls the license manager client debugging behavior. IPAR_LICENSE_PAUSE_TIME IParam = C.MSK_IPAR_LICENSE_PAUSE_TIME // Controls license manager client behavior. IPAR_LICENSE_SUPPRESS_EXPIRE_WRNS IParam = C.MSK_IPAR_LICENSE_SUPPRESS_EXPIRE_WRNS // Controls license manager client behavior. IPAR_LICENSE_TRH_EXPIRY_WRN IParam = C.MSK_IPAR_LICENSE_TRH_EXPIRY_WRN // Controls when expiry warnings are issued. IPAR_LICENSE_WAIT IParam = C.MSK_IPAR_LICENSE_WAIT // Controls if MOSEK should queue for a license if none is available. IPAR_LOG IParam = C.MSK_IPAR_LOG // Controls the amount of log information. IPAR_LOG_ANA_PRO IParam = C.MSK_IPAR_LOG_ANA_PRO // Controls amount of output from the problem analyzer. IPAR_LOG_BI IParam = C.MSK_IPAR_LOG_BI // Controls the amount of output printed by the basis identification procedure. A higher level implies that more information is logged. IPAR_LOG_BI_FREQ IParam = C.MSK_IPAR_LOG_BI_FREQ // Controls the logging frequency. IPAR_LOG_CUT_SECOND_OPT IParam = C.MSK_IPAR_LOG_CUT_SECOND_OPT // Controls the reduction in the log levels for the second and any subsequent optimizations. IPAR_LOG_EXPAND IParam = C.MSK_IPAR_LOG_EXPAND // Controls the amount of logging when a data item such as the maximum number constrains is expanded. IPAR_LOG_FEAS_REPAIR IParam = C.MSK_IPAR_LOG_FEAS_REPAIR // Controls the amount of output printed when performing feasibility repair. A value higher than one means extensive logging. IPAR_LOG_FILE IParam = C.MSK_IPAR_LOG_FILE // If turned on, then some log info is printed when a file is written or read. IPAR_LOG_INCLUDE_SUMMARY IParam = C.MSK_IPAR_LOG_INCLUDE_SUMMARY // Controls whether solution summary should be printed by the optimizer. IPAR_LOG_INFEAS_ANA IParam = C.MSK_IPAR_LOG_INFEAS_ANA // Controls log level for the infeasibility analyzer. IPAR_LOG_INTPNT IParam = C.MSK_IPAR_LOG_INTPNT // Controls the amount of log information from the interior-point optimizers. IPAR_LOG_LOCAL_INFO IParam = C.MSK_IPAR_LOG_LOCAL_INFO // Control whether local identifying information is printed to the log. IPAR_LOG_MIO IParam = C.MSK_IPAR_LOG_MIO // Controls the amount of log information from the mixed-integer optimizers. IPAR_LOG_MIO_FREQ IParam = C.MSK_IPAR_LOG_MIO_FREQ // The mixed-integer optimizer logging frequency. IPAR_LOG_ORDER IParam = C.MSK_IPAR_LOG_ORDER // If turned on, then factor lines are added to the log. IPAR_LOG_PRESOLVE IParam = C.MSK_IPAR_LOG_PRESOLVE // Controls amount of output printed by the presolve procedure. A higher level implies that more information is logged. IPAR_LOG_RESPONSE IParam = C.MSK_IPAR_LOG_RESPONSE // Controls amount of output printed when response codes are reported. A higher level implies that more information is logged. IPAR_LOG_SENSITIVITY IParam = C.MSK_IPAR_LOG_SENSITIVITY // Control logging in sensitivity analyzer. IPAR_LOG_SENSITIVITY_OPT IParam = C.MSK_IPAR_LOG_SENSITIVITY_OPT // Control logging in sensitivity analyzer. IPAR_LOG_SIM IParam = C.MSK_IPAR_LOG_SIM // Controls the amount of log information from the simplex optimizers. IPAR_LOG_SIM_FREQ IParam = C.MSK_IPAR_LOG_SIM_FREQ // Controls simplex logging frequency. IPAR_LOG_SIM_MINOR IParam = C.MSK_IPAR_LOG_SIM_MINOR // Currently not in use. IPAR_LOG_STORAGE IParam = C.MSK_IPAR_LOG_STORAGE // Controls the memory related log information. IPAR_MAX_NUM_WARNINGS IParam = C.MSK_IPAR_MAX_NUM_WARNINGS // Each warning is shown a limited number of times controlled by this parameter. A negative value is identical to infinite number of times. IPAR_MIO_BRANCH_DIR IParam = C.MSK_IPAR_MIO_BRANCH_DIR // Controls whether the mixed-integer optimizer is branching up or down by default. IPAR_MIO_CONIC_OUTER_APPROXIMATION IParam = C.MSK_IPAR_MIO_CONIC_OUTER_APPROXIMATION // Toggles outer approximation for conic problems. IPAR_MIO_CONSTRUCT_SOL IParam = C.MSK_IPAR_MIO_CONSTRUCT_SOL // Controls if an initial mixed integer solution should be constructed from the values of the integer variables. IPAR_MIO_CUT_CLIQUE IParam = C.MSK_IPAR_MIO_CUT_CLIQUE // Controls whether clique cuts should be generated. IPAR_MIO_CUT_CMIR IParam = C.MSK_IPAR_MIO_CUT_CMIR // Controls whether mixed integer rounding cuts should be generated. IPAR_MIO_CUT_GMI IParam = C.MSK_IPAR_MIO_CUT_GMI // Controls whether GMI cuts should be generated. IPAR_MIO_CUT_IMPLIED_BOUND IParam = C.MSK_IPAR_MIO_CUT_IMPLIED_BOUND // Controls whether implied bound cuts should be generated. IPAR_MIO_CUT_KNAPSACK_COVER IParam = C.MSK_IPAR_MIO_CUT_KNAPSACK_COVER // Controls whether knapsack cover cuts should be generated. IPAR_MIO_CUT_LIPRO IParam = C.MSK_IPAR_MIO_CUT_LIPRO // Controls whether lift-and-project cuts should be generated. IPAR_MIO_CUT_SELECTION_LEVEL IParam = C.MSK_IPAR_MIO_CUT_SELECTION_LEVEL // Controls how aggressively generated cuts are selected to be included in the relaxation. IPAR_MIO_DATA_PERMUTATION_METHOD IParam = C.MSK_IPAR_MIO_DATA_PERMUTATION_METHOD // Controls what problem data permutation method is appplied to mixed-integer problems. IPAR_MIO_DUAL_RAY_ANALYSIS_LEVEL IParam = C.MSK_IPAR_MIO_DUAL_RAY_ANALYSIS_LEVEL // Controls the amount of dual ray analysis employed by the mixed-integer optimizer in presolve. IPAR_MIO_FEASPUMP_LEVEL IParam = C.MSK_IPAR_MIO_FEASPUMP_LEVEL // Controls the way the Feasibility Pump heuristic is employed by the mixed-integer optimizer. IPAR_MIO_HEURISTIC_LEVEL IParam = C.MSK_IPAR_MIO_HEURISTIC_LEVEL // Controls the heuristic employed by the mixed-integer optimizer to locate an initial integer feasible solution. IPAR_MIO_MAX_NUM_BRANCHES IParam = C.MSK_IPAR_MIO_MAX_NUM_BRANCHES // Maximum number of branches allowed during the branch and bound search. IPAR_MIO_MAX_NUM_RELAXS IParam = C.MSK_IPAR_MIO_MAX_NUM_RELAXS // Maximum number of relaxations in branch and bound search. IPAR_MIO_MAX_NUM_RESTARTS IParam = C.MSK_IPAR_MIO_MAX_NUM_RESTARTS // Maximum number of restarts allowed during the branch and bound search. IPAR_MIO_MAX_NUM_ROOT_CUT_ROUNDS IParam = C.MSK_IPAR_MIO_MAX_NUM_ROOT_CUT_ROUNDS // Maximum number of cut separation rounds at the root node. IPAR_MIO_MAX_NUM_SOLUTIONS IParam = C.MSK_IPAR_MIO_MAX_NUM_SOLUTIONS // Controls how many feasible solutions the mixed-integer optimizer investigates. IPAR_MIO_MEMORY_EMPHASIS_LEVEL IParam = C.MSK_IPAR_MIO_MEMORY_EMPHASIS_LEVEL // Controls how much emphasis is put on reducing memory usage. IPAR_MIO_MIN_REL IParam = C.MSK_IPAR_MIO_MIN_REL // Number of times a variable must have been branched on for its pseudocost to be cosidered reliable. IPAR_MIO_MODE IParam = C.MSK_IPAR_MIO_MODE // Turns on/off the mixed-integer mode. IPAR_MIO_NODE_OPTIMIZER IParam = C.MSK_IPAR_MIO_NODE_OPTIMIZER // Controls which optimizer is employed at the non-root nodes in the mixed-integer optimizer. IPAR_MIO_NODE_SELECTION IParam = C.MSK_IPAR_MIO_NODE_SELECTION // Controls the node selection strategy employed by the mixed-integer optimizer. IPAR_MIO_NUMERICAL_EMPHASIS_LEVEL IParam = C.MSK_IPAR_MIO_NUMERICAL_EMPHASIS_LEVEL // Controls how much emphasis is put on reducing numerical problems IPAR_MIO_PERSPECTIVE_REFORMULATE IParam = C.MSK_IPAR_MIO_PERSPECTIVE_REFORMULATE // Enables or disables perspective reformulation in presolve. IPAR_MIO_PRESOLVE_AGGREGATOR_USE IParam = C.MSK_IPAR_MIO_PRESOLVE_AGGREGATOR_USE // Controls if the aggregator should be used. IPAR_MIO_PROBING_LEVEL IParam = C.MSK_IPAR_MIO_PROBING_LEVEL // Controls the amount of probing employed by the mixed-integer optimizer in presolve. IPAR_MIO_PROPAGATE_OBJECTIVE_CONSTRAINT IParam = C.MSK_IPAR_MIO_PROPAGATE_OBJECTIVE_CONSTRAINT // Use objective domain propagation. IPAR_MIO_QCQO_REFORMULATION_METHOD IParam = C.MSK_IPAR_MIO_QCQO_REFORMULATION_METHOD // Controls what reformulation method is applied to mixed-integer quadratic problems. IPAR_MIO_RINS_MAX_NODES IParam = C.MSK_IPAR_MIO_RINS_MAX_NODES // Maximum number of nodes in each call to RINS. IPAR_MIO_ROOT_OPTIMIZER IParam = C.MSK_IPAR_MIO_ROOT_OPTIMIZER // Controls which optimizer is employed at the root node in the mixed-integer optimizer. IPAR_MIO_ROOT_REPEAT_PRESOLVE_LEVEL IParam = C.MSK_IPAR_MIO_ROOT_REPEAT_PRESOLVE_LEVEL // Controls whether presolve can be repeated at root node. IPAR_MIO_SEED IParam = C.MSK_IPAR_MIO_SEED // Sets the random seed used for randomization in the mixed integer optimizer. IPAR_MIO_SYMMETRY_LEVEL IParam = C.MSK_IPAR_MIO_SYMMETRY_LEVEL // Controls the amount of symmetry detection and handling employed by the mixed-integer optimizer in presolve. IPAR_MIO_VAR_SELECTION IParam = C.MSK_IPAR_MIO_VAR_SELECTION // Controls the variable selection strategy employed by the mixed-integer optimizer. IPAR_MIO_VB_DETECTION_LEVEL IParam = C.MSK_IPAR_MIO_VB_DETECTION_LEVEL // Controls how much effort is put into detecting variable bounds. IPAR_MT_SPINCOUNT IParam = C.MSK_IPAR_MT_SPINCOUNT // Set the number of iterations to spin before sleeping. IPAR_NG IParam = C.MSK_IPAR_NG // Not in use IPAR_NUM_THREADS IParam = C.MSK_IPAR_NUM_THREADS // The number of threads employed by the optimizer. IPAR_OPF_WRITE_HEADER IParam = C.MSK_IPAR_OPF_WRITE_HEADER // Write a text header with date and MOSEK version in an OPF file. IPAR_OPF_WRITE_HINTS IParam = C.MSK_IPAR_OPF_WRITE_HINTS // Write a hint section with problem dimensions in the beginning of an OPF file. IPAR_OPF_WRITE_LINE_LENGTH IParam = C.MSK_IPAR_OPF_WRITE_LINE_LENGTH // Aim to keep lines in OPF files not much longer than this. IPAR_OPF_WRITE_PARAMETERS IParam = C.MSK_IPAR_OPF_WRITE_PARAMETERS // Write a parameter section in an OPF file. IPAR_OPF_WRITE_PROBLEM IParam = C.MSK_IPAR_OPF_WRITE_PROBLEM // Write objective, constraints, bounds etc. to an OPF file. IPAR_OPF_WRITE_SOL_BAS IParam = C.MSK_IPAR_OPF_WRITE_SOL_BAS // Controls what is written to the OPF files. IPAR_OPF_WRITE_SOL_ITG IParam = C.MSK_IPAR_OPF_WRITE_SOL_ITG // Controls what is written to the OPF files. IPAR_OPF_WRITE_SOL_ITR IParam = C.MSK_IPAR_OPF_WRITE_SOL_ITR // Controls what is written to the OPF files. IPAR_OPF_WRITE_SOLUTIONS IParam = C.MSK_IPAR_OPF_WRITE_SOLUTIONS // Enable inclusion of solutions in the OPF files. IPAR_OPTIMIZER IParam = C.MSK_IPAR_OPTIMIZER // Controls which optimizer is used to optimize the task. IPAR_PARAM_READ_CASE_NAME IParam = C.MSK_IPAR_PARAM_READ_CASE_NAME // If turned on, then names in the parameter file are case sensitive. IPAR_PARAM_READ_IGN_ERROR IParam = C.MSK_IPAR_PARAM_READ_IGN_ERROR // If turned on, then errors in parameter settings is ignored. IPAR_PRESOLVE_ELIMINATOR_MAX_FILL IParam = C.MSK_IPAR_PRESOLVE_ELIMINATOR_MAX_FILL // Maximum amount of fill-in created in one pivot during the elimination phase. IPAR_PRESOLVE_ELIMINATOR_MAX_NUM_TRIES IParam = C.MSK_IPAR_PRESOLVE_ELIMINATOR_MAX_NUM_TRIES // Control the maximum number of times the eliminator is tried. IPAR_PRESOLVE_LEVEL IParam = C.MSK_IPAR_PRESOLVE_LEVEL // Currently not used. IPAR_PRESOLVE_LINDEP_ABS_WORK_TRH IParam = C.MSK_IPAR_PRESOLVE_LINDEP_ABS_WORK_TRH // Controls linear dependency check in presolve. IPAR_PRESOLVE_LINDEP_NEW IParam = C.MSK_IPAR_PRESOLVE_LINDEP_NEW // Controls whether whether a new experimental linear dependency checker is employed. IPAR_PRESOLVE_LINDEP_REL_WORK_TRH IParam = C.MSK_IPAR_PRESOLVE_LINDEP_REL_WORK_TRH // Controls linear dependency check in presolve. IPAR_PRESOLVE_LINDEP_USE IParam = C.MSK_IPAR_PRESOLVE_LINDEP_USE // Controls whether the linear constraints are checked for linear dependencies. IPAR_PRESOLVE_MAX_NUM_PASS IParam = C.MSK_IPAR_PRESOLVE_MAX_NUM_PASS // Control the maximum number of times presolve passes over the problem. IPAR_PRESOLVE_MAX_NUM_REDUCTIONS IParam = C.MSK_IPAR_PRESOLVE_MAX_NUM_REDUCTIONS // Controls the maximum number of reductions performed by the presolve. IPAR_PRESOLVE_USE IParam = C.MSK_IPAR_PRESOLVE_USE // Controls whether the presolve is applied to a problem before it is optimized. IPAR_PRIMAL_REPAIR_OPTIMIZER IParam = C.MSK_IPAR_PRIMAL_REPAIR_OPTIMIZER // Controls which optimizer that is used to find the optimal repair. IPAR_PTF_WRITE_PARAMETERS IParam = C.MSK_IPAR_PTF_WRITE_PARAMETERS // Controls whether parameters section is written in PTF files. IPAR_PTF_WRITE_SOLUTIONS IParam = C.MSK_IPAR_PTF_WRITE_SOLUTIONS // Controls whether solution section is written in PTF files. IPAR_PTF_WRITE_TRANSFORM IParam = C.MSK_IPAR_PTF_WRITE_TRANSFORM // Controls if simple transformation are done when writing PTF files. IPAR_READ_DEBUG IParam = C.MSK_IPAR_READ_DEBUG // Turns on additional debugging information when reading files. IPAR_READ_KEEP_FREE_CON IParam = C.MSK_IPAR_READ_KEEP_FREE_CON // Controls whether the free constraints are included in the problem. IPAR_READ_MPS_FORMAT IParam = C.MSK_IPAR_READ_MPS_FORMAT // Controls how strictly the MPS file reader interprets the MPS format. IPAR_READ_MPS_WIDTH IParam = C.MSK_IPAR_READ_MPS_WIDTH // Controls the maximal number of characters allowed in one line of the MPS file. IPAR_READ_TASK_IGNORE_PARAM IParam = C.MSK_IPAR_READ_TASK_IGNORE_PARAM // Controls what information is used from the task files. IPAR_REMOTE_USE_COMPRESSION IParam = C.MSK_IPAR_REMOTE_USE_COMPRESSION // Use compression when sending data to an optimization server IPAR_REMOVE_UNUSED_SOLUTIONS IParam = C.MSK_IPAR_REMOVE_UNUSED_SOLUTIONS // Removes unused solutions before the optimization is performed. IPAR_SENSITIVITY_ALL IParam = C.MSK_IPAR_SENSITIVITY_ALL // Controls sensitivity report behavior. IPAR_SENSITIVITY_OPTIMIZER IParam = C.MSK_IPAR_SENSITIVITY_OPTIMIZER // Controls which optimizer is used for optimal partition sensitivity analysis. IPAR_SENSITIVITY_TYPE IParam = C.MSK_IPAR_SENSITIVITY_TYPE // Controls which type of sensitivity analysis is to be performed. IPAR_SIM_BASIS_FACTOR_USE IParam = C.MSK_IPAR_SIM_BASIS_FACTOR_USE // Controls whether an LU factorization of the basis is used in a hot-start. IPAR_SIM_DEGEN IParam = C.MSK_IPAR_SIM_DEGEN // Controls how aggressively degeneration is handled. IPAR_SIM_DETECT_PWL IParam = C.MSK_IPAR_SIM_DETECT_PWL // Not in use. IPAR_SIM_DUAL_CRASH IParam = C.MSK_IPAR_SIM_DUAL_CRASH // Controls whether crashing is performed in the dual simplex optimizer. IPAR_SIM_DUAL_PHASEONE_METHOD IParam = C.MSK_IPAR_SIM_DUAL_PHASEONE_METHOD // An experimental feature. IPAR_SIM_DUAL_RESTRICT_SELECTION IParam = C.MSK_IPAR_SIM_DUAL_RESTRICT_SELECTION // Controls how aggressively restricted selection is used. IPAR_SIM_DUAL_SELECTION IParam = C.MSK_IPAR_SIM_DUAL_SELECTION // Controls the dual simplex strategy. IPAR_SIM_EXPLOIT_DUPVEC IParam = C.MSK_IPAR_SIM_EXPLOIT_DUPVEC // Controls if the simplex optimizers are allowed to exploit duplicated columns. IPAR_SIM_HOTSTART IParam = C.MSK_IPAR_SIM_HOTSTART // Controls the type of hot-start that the simplex optimizer perform. IPAR_SIM_HOTSTART_LU IParam = C.MSK_IPAR_SIM_HOTSTART_LU // Determines if the simplex optimizer should exploit the initial factorization. IPAR_SIM_MAX_ITERATIONS IParam = C.MSK_IPAR_SIM_MAX_ITERATIONS // Maximum number of iterations that can be used by a simplex optimizer. IPAR_SIM_MAX_NUM_SETBACKS IParam = C.MSK_IPAR_SIM_MAX_NUM_SETBACKS // Controls how many set-backs that are allowed within a simplex optimizer. IPAR_SIM_NON_SINGULAR IParam = C.MSK_IPAR_SIM_NON_SINGULAR // Controls if the simplex optimizer ensures a non-singular basis, if possible. IPAR_SIM_PRIMAL_CRASH IParam = C.MSK_IPAR_SIM_PRIMAL_CRASH // Controls the simplex crash. IPAR_SIM_PRIMAL_PHASEONE_METHOD IParam = C.MSK_IPAR_SIM_PRIMAL_PHASEONE_METHOD // An experimental feature. IPAR_SIM_PRIMAL_RESTRICT_SELECTION IParam = C.MSK_IPAR_SIM_PRIMAL_RESTRICT_SELECTION // Controls how aggressively restricted selection is used. IPAR_SIM_PRIMAL_SELECTION IParam = C.MSK_IPAR_SIM_PRIMAL_SELECTION // Controls the primal simplex strategy. IPAR_SIM_REFACTOR_FREQ IParam = C.MSK_IPAR_SIM_REFACTOR_FREQ // Controls the basis refactoring frequency. IPAR_SIM_REFORMULATION IParam = C.MSK_IPAR_SIM_REFORMULATION // Controls if the simplex optimizers are allowed to reformulate the problem. IPAR_SIM_SAVE_LU IParam = C.MSK_IPAR_SIM_SAVE_LU // Controls if the LU factorization stored should be replaced with the LU factorization corresponding to the initial basis. IPAR_SIM_SCALING IParam = C.MSK_IPAR_SIM_SCALING // Controls how much effort is used in scaling the problem before a simplex optimizer is used. IPAR_SIM_SCALING_METHOD IParam = C.MSK_IPAR_SIM_SCALING_METHOD // Controls how the problem is scaled before a simplex optimizer is used. IPAR_SIM_SEED IParam = C.MSK_IPAR_SIM_SEED // Sets the random seed used for randomization in the simplex optimizers. IPAR_SIM_SOLVE_FORM IParam = C.MSK_IPAR_SIM_SOLVE_FORM // Controls whether the primal or the dual problem is solved by the primal-/dual-simplex optimizer. IPAR_SIM_STABILITY_PRIORITY IParam = C.MSK_IPAR_SIM_STABILITY_PRIORITY // Controls how high priority the numerical stability should be given. IPAR_SIM_SWITCH_OPTIMIZER IParam = C.MSK_IPAR_SIM_SWITCH_OPTIMIZER // Controls the simplex behavior. IPAR_SOL_FILTER_KEEP_BASIC IParam = C.MSK_IPAR_SOL_FILTER_KEEP_BASIC // Control the contents of the solution files. IPAR_SOL_FILTER_KEEP_RANGED IParam = C.MSK_IPAR_SOL_FILTER_KEEP_RANGED // Control the contents of the solution files. IPAR_SOL_READ_NAME_WIDTH IParam = C.MSK_IPAR_SOL_READ_NAME_WIDTH // Controls the input solution file format. IPAR_SOL_READ_WIDTH IParam = C.MSK_IPAR_SOL_READ_WIDTH // Controls the input solution file format. IPAR_SOLUTION_CALLBACK IParam = C.MSK_IPAR_SOLUTION_CALLBACK // Indicates whether solution callbacks will be performed during the optimization. IPAR_TIMING_LEVEL IParam = C.MSK_IPAR_TIMING_LEVEL // Controls the amount of timing performed inside MOSEK. IPAR_WRITE_BAS_CONSTRAINTS IParam = C.MSK_IPAR_WRITE_BAS_CONSTRAINTS // Controls the basic solution file format. IPAR_WRITE_BAS_HEAD IParam = C.MSK_IPAR_WRITE_BAS_HEAD // Controls the basic solution file format. IPAR_WRITE_BAS_VARIABLES IParam = C.MSK_IPAR_WRITE_BAS_VARIABLES // Controls the basic solution file format. IPAR_WRITE_COMPRESSION IParam = C.MSK_IPAR_WRITE_COMPRESSION // Controls output file compression. IPAR_WRITE_DATA_PARAM IParam = C.MSK_IPAR_WRITE_DATA_PARAM // Controls output file data. IPAR_WRITE_FREE_CON IParam = C.MSK_IPAR_WRITE_FREE_CON // Controls the output file data. IPAR_WRITE_GENERIC_NAMES IParam = C.MSK_IPAR_WRITE_GENERIC_NAMES // Controls the output file data. IPAR_WRITE_GENERIC_NAMES_IO IParam = C.MSK_IPAR_WRITE_GENERIC_NAMES_IO // Index origin used in generic names. IPAR_WRITE_IGNORE_INCOMPATIBLE_ITEMS IParam = C.MSK_IPAR_WRITE_IGNORE_INCOMPATIBLE_ITEMS // Controls if the writer ignores incompatible problem items when writing files. IPAR_WRITE_INT_CONSTRAINTS IParam = C.MSK_IPAR_WRITE_INT_CONSTRAINTS // Controls the integer solution file format. IPAR_WRITE_INT_HEAD IParam = C.MSK_IPAR_WRITE_INT_HEAD // Controls the integer solution file format. IPAR_WRITE_INT_VARIABLES IParam = C.MSK_IPAR_WRITE_INT_VARIABLES // Controls the integer solution file format. IPAR_WRITE_JSON_INDENTATION IParam = C.MSK_IPAR_WRITE_JSON_INDENTATION // When set, the JSON task and solution files are written with indentation for better readability. IPAR_WRITE_LP_FULL_OBJ IParam = C.MSK_IPAR_WRITE_LP_FULL_OBJ // Write full linear objective IPAR_WRITE_LP_LINE_WIDTH IParam = C.MSK_IPAR_WRITE_LP_LINE_WIDTH // Controls the LP output file format. IPAR_WRITE_MPS_FORMAT IParam = C.MSK_IPAR_WRITE_MPS_FORMAT // Controls in which format the MPS is written. IPAR_WRITE_MPS_INT IParam = C.MSK_IPAR_WRITE_MPS_INT // Controls the output file data. IPAR_WRITE_SOL_BARVARIABLES IParam = C.MSK_IPAR_WRITE_SOL_BARVARIABLES // Controls the solution file format. IPAR_WRITE_SOL_CONSTRAINTS IParam = C.MSK_IPAR_WRITE_SOL_CONSTRAINTS // Controls the solution file format. IPAR_WRITE_SOL_HEAD IParam = C.MSK_IPAR_WRITE_SOL_HEAD // Controls solution file format. IPAR_WRITE_SOL_IGNORE_INVALID_NAMES IParam = C.MSK_IPAR_WRITE_SOL_IGNORE_INVALID_NAMES // Controls whether the user specified names are employed even if they are invalid names. IPAR_WRITE_SOL_VARIABLES IParam = C.MSK_IPAR_WRITE_SOL_VARIABLES // Controls the solution file format. IPAR_WRITE_TASK_INC_SOL IParam = C.MSK_IPAR_WRITE_TASK_INC_SOL // Controls whether the solutions are stored in the task file too. IPAR_WRITE_XML_MODE IParam = C.MSK_IPAR_WRITE_XML_MODE // Controls if linear coefficients should be written by row or column when writing in the XML file format. )
type InfType ¶ added in v0.2.0
type InfType uint32
InfType is MSKinftype_enum.
Information item types
const ( INF_DOU_TYPE InfType = C.MSK_INF_DOU_TYPE // Is a double information type. INF_INT_TYPE InfType = C.MSK_INF_INT_TYPE // Is an integer. INF_LINT_TYPE InfType = C.MSK_INF_LINT_TYPE // Is a long integer. )
type IntpntHotstart ¶ added in v0.2.0
type IntpntHotstart uint32
IntpntHotstart is MSKintpnthotstart_enum.
Hot-start type employed by the interior-point optimizers.
const ( INTPNT_HOTSTART_NONE IntpntHotstart = C.MSK_INTPNT_HOTSTART_NONE // The interior-point optimizer performs a coldstart. INTPNT_HOTSTART_PRIMAL IntpntHotstart = C.MSK_INTPNT_HOTSTART_PRIMAL // The interior-point optimizer exploits the primal solution only. INTPNT_HOTSTART_DUAL IntpntHotstart = C.MSK_INTPNT_HOTSTART_DUAL // The interior-point optimizer exploits the dual solution only. INTPNT_HOTSTART_PRIMAL_DUAL IntpntHotstart = C.MSK_INTPNT_HOTSTART_PRIMAL_DUAL // The interior-point optimizer exploits both the primal and dual solution. )
func (IntpntHotstart) String ¶ added in v0.2.10
func (e IntpntHotstart) String() string
type IoMode ¶ added in v0.2.0
type IoMode uint32
IoMode is MSKiomode_enum.
Input/output modes
const ( IOMODE_READ IoMode = C.MSK_IOMODE_READ // The file is read-only. IOMODE_WRITE IoMode = C.MSK_IOMODE_WRITE // The file is write-only. If the file exists then it is truncated when it is opened. Otherwise it is created when it is opened. IOMODE_READWRITE IoMode = C.MSK_IOMODE_READWRITE // The file is to read and write. )
type LIInfItem ¶ added in v0.2.0
type LIInfItem uint32
LIInfItem is MSKliinfitem_enum.
Long integer information items.
const ( LIINF_ANA_PRO_SCALARIZED_CONSTRAINT_MATRIX_NUM_COLUMNS LIInfItem = C.MSK_LIINF_ANA_PRO_SCALARIZED_CONSTRAINT_MATRIX_NUM_COLUMNS // Number of columns in the scalarized constraint matrix. LIINF_ANA_PRO_SCALARIZED_CONSTRAINT_MATRIX_NUM_NZ LIInfItem = C.MSK_LIINF_ANA_PRO_SCALARIZED_CONSTRAINT_MATRIX_NUM_NZ // Number of non-zero entries in the scalarized constraint matrix. LIINF_ANA_PRO_SCALARIZED_CONSTRAINT_MATRIX_NUM_ROWS LIInfItem = C.MSK_LIINF_ANA_PRO_SCALARIZED_CONSTRAINT_MATRIX_NUM_ROWS // Number of rows in the scalarized constraint matrix. LIINF_BI_CLEAN_DUAL_DEG_ITER LIInfItem = C.MSK_LIINF_BI_CLEAN_DUAL_DEG_ITER // Number of dual degenerate clean iterations performed in the basis identification. LIINF_BI_CLEAN_DUAL_ITER LIInfItem = C.MSK_LIINF_BI_CLEAN_DUAL_ITER // Number of dual clean iterations performed in the basis identification. LIINF_BI_CLEAN_PRIMAL_DEG_ITER LIInfItem = C.MSK_LIINF_BI_CLEAN_PRIMAL_DEG_ITER // Number of primal degenerate clean iterations performed in the basis identification. LIINF_BI_CLEAN_PRIMAL_ITER LIInfItem = C.MSK_LIINF_BI_CLEAN_PRIMAL_ITER // Number of primal clean iterations performed in the basis identification. LIINF_BI_DUAL_ITER LIInfItem = C.MSK_LIINF_BI_DUAL_ITER // Number of dual pivots performed in the basis identification. LIINF_BI_PRIMAL_ITER LIInfItem = C.MSK_LIINF_BI_PRIMAL_ITER // Number of primal pivots performed in the basis identification. LIINF_INTPNT_FACTOR_NUM_NZ LIInfItem = C.MSK_LIINF_INTPNT_FACTOR_NUM_NZ // Number of non-zeros in factorization. LIINF_MIO_ANZ LIInfItem = C.MSK_LIINF_MIO_ANZ // Number of non-zero entries in the constraint matrix of the problem to be solved by the mixed-integer optimizer. LIINF_MIO_INTPNT_ITER LIInfItem = C.MSK_LIINF_MIO_INTPNT_ITER // Number of interior-point iterations performed by the mixed-integer optimizer. LIINF_MIO_NUM_DUAL_ILLPOSED_CER LIInfItem = C.MSK_LIINF_MIO_NUM_DUAL_ILLPOSED_CER // Number of dual illposed certificates encountered by the mixed-integer optimizer. LIINF_MIO_NUM_PRIM_ILLPOSED_CER LIInfItem = C.MSK_LIINF_MIO_NUM_PRIM_ILLPOSED_CER // Number of primal illposed certificates encountered by the mixed-integer optimizer. LIINF_MIO_PRESOLVED_ANZ LIInfItem = C.MSK_LIINF_MIO_PRESOLVED_ANZ // Number of non-zero entries in the constraint matrix of the problem after the mixed-integer optimizer's presolve. LIINF_MIO_SIMPLEX_ITER LIInfItem = C.MSK_LIINF_MIO_SIMPLEX_ITER // Number of simplex iterations performed by the mixed-integer optimizer. LIINF_RD_NUMACC LIInfItem = C.MSK_LIINF_RD_NUMACC // Number of affince conic constraints. LIINF_RD_NUMANZ LIInfItem = C.MSK_LIINF_RD_NUMANZ // Number of non-zeros in A that is read. LIINF_RD_NUMDJC LIInfItem = C.MSK_LIINF_RD_NUMDJC // Number of disjuncive constraints. LIINF_RD_NUMQNZ LIInfItem = C.MSK_LIINF_RD_NUMQNZ // Number of Q non-zeros. LIINF_SIMPLEX_ITER LIInfItem = C.MSK_LIINF_SIMPLEX_ITER // Number of iterations performed by the simplex optimizer. )
type MPSFormat ¶ added in v0.2.0
type MPSFormat uint32
MPSFormat is MSKmpsformat_enum.
MPS file format type
const ( MPS_FORMAT_STRICT MPSFormat = C.MSK_MPS_FORMAT_STRICT // It is assumed that the input file satisfies the MPS format strictly. MPS_FORMAT_RELAXED MPSFormat = C.MSK_MPS_FORMAT_RELAXED // It is assumed that the input file satisfies a slightly relaxed version of the MPS format. MPS_FORMAT_FREE MPSFormat = C.MSK_MPS_FORMAT_FREE // It is assumed that the input file satisfies the free MPS format. This implies that spaces are not allowed in names. Otherwise the format is free. MPS_FORMAT_CPLEX MPSFormat = C.MSK_MPS_FORMAT_CPLEX // The CPLEX compatible version of the MPS format is employed. )
type Mark ¶ added in v0.2.0
type Mark uint32
Mark is MSKmark_enum.
Mark
const ( MARK_LO Mark = C.MSK_MARK_LO // The lower bound is selected for sensitivity analysis. MARK_UP Mark = C.MSK_MARK_UP // The upper bound is selected for sensitivity analysis. )
type MiQcQoReformMethod ¶ added in v0.2.0
type MiQcQoReformMethod uint32
MiQcQoReformMethod is MSKmiqcqoreformmethod_enum.
Specifies the reformulation method for mixed-integer quadratic problems.
const ( MIO_QCQO_REFORMULATION_METHOD_FREE MiQcQoReformMethod = C.MSK_MIO_QCQO_REFORMULATION_METHOD_FREE // The mixed-integer optimizer decides which reformulation method to apply. MIO_QCQO_REFORMULATION_METHOD_NONE MiQcQoReformMethod = C.MSK_MIO_QCQO_REFORMULATION_METHOD_NONE // No reformulation method is applied. MIO_QCQO_REFORMULATION_METHOD_LINEARIZATION MiQcQoReformMethod = C.MSK_MIO_QCQO_REFORMULATION_METHOD_LINEARIZATION // A reformulation via linearization is applied. MIO_QCQO_REFORMULATION_METHOD_EIGEN_VAL_METHOD MiQcQoReformMethod = C.MSK_MIO_QCQO_REFORMULATION_METHOD_EIGEN_VAL_METHOD // The eigenvalue method is applied. MIO_QCQO_REFORMULATION_METHOD_DIAG_SDP MiQcQoReformMethod = C.MSK_MIO_QCQO_REFORMULATION_METHOD_DIAG_SDP // A perturbation of matrix diagonals via the solution of SDPs is applied. MIO_QCQO_REFORMULATION_METHOD_RELAX_SDP MiQcQoReformMethod = C.MSK_MIO_QCQO_REFORMULATION_METHOD_RELAX_SDP // A Reformulation based on the solution of an SDP-relaxation of the problem is applied. )
func (MiQcQoReformMethod) String ¶ added in v0.2.10
func (e MiQcQoReformMethod) String() string
type MioContSolType ¶ added in v0.2.0
type MioContSolType uint32
MioContSolType is MSKmiocontsoltype_enum.
Continuous mixed-integer solution type
const ( MIO_CONT_SOL_NONE MioContSolType = C.MSK_MIO_CONT_SOL_NONE // No interior-point or basic solution. MIO_CONT_SOL_ROOT MioContSolType = C.MSK_MIO_CONT_SOL_ROOT // Solutions to the root node problem. MIO_CONT_SOL_ITG MioContSolType = C.MSK_MIO_CONT_SOL_ITG // A feasible primal solution. MIO_CONT_SOL_ITG_REL MioContSolType = C.MSK_MIO_CONT_SOL_ITG_REL // A feasible primal solution or a root node solution if the problem is infeasible. )
func (MioContSolType) String ¶ added in v0.2.10
func (e MioContSolType) String() string
type MioDataPermMethod ¶ added in v0.2.0
type MioDataPermMethod uint32
MioDataPermMethod is MSKmiodatapermmethod_enum.
Specifies the problem data permutation method for mixed-integer problems.
const ( MIO_DATA_PERMUTATION_METHOD_NONE MioDataPermMethod = C.MSK_MIO_DATA_PERMUTATION_METHOD_NONE // No problem data permutation is applied. MIO_DATA_PERMUTATION_METHOD_CYCLIC_SHIFT MioDataPermMethod = C.MSK_MIO_DATA_PERMUTATION_METHOD_CYCLIC_SHIFT // A random cyclic shift is applied to permute the problem data. MIO_DATA_PERMUTATION_METHOD_RANDOM MioDataPermMethod = C.MSK_MIO_DATA_PERMUTATION_METHOD_RANDOM // A random permutation is applied to the problem data. )
func (MioDataPermMethod) String ¶ added in v0.2.10
func (e MioDataPermMethod) String() string
type MioMode ¶ added in v0.2.0
type MioMode uint32
MioMode is MSKmiomode_enum.
Integer restrictions
const ( MIO_MODE_IGNORED MioMode = C.MSK_MIO_MODE_IGNORED // The integer constraints are ignored and the problem is solved as a continuous problem. MIO_MODE_SATISFIED MioMode = C.MSK_MIO_MODE_SATISFIED // Integer restrictions should be satisfied. )
type MioNodeSelType ¶ added in v0.2.0
type MioNodeSelType uint32
MioNodeSelType is MSKmionodeseltype_enum.
Mixed-integer node selection types
const ( MIO_NODE_SELECTION_FREE MioNodeSelType = C.MSK_MIO_NODE_SELECTION_FREE // The optimizer decides the node selection strategy. MIO_NODE_SELECTION_FIRST MioNodeSelType = C.MSK_MIO_NODE_SELECTION_FIRST // The optimizer employs a depth first node selection strategy. MIO_NODE_SELECTION_BEST MioNodeSelType = C.MSK_MIO_NODE_SELECTION_BEST // The optimizer employs a best bound node selection strategy. MIO_NODE_SELECTION_PSEUDO MioNodeSelType = C.MSK_MIO_NODE_SELECTION_PSEUDO // The optimizer employs selects the node based on a pseudo cost estimate. )
func (MioNodeSelType) String ¶ added in v0.2.10
func (e MioNodeSelType) String() string
type MioVarSelType ¶ added in v0.6.0
type MioVarSelType uint32
MioVarSelType is MSKmiovarseltype_enum.
Mixed-integer variable selection types
const ( MIO_VAR_SELECTION_FREE MioVarSelType = C.MSK_MIO_VAR_SELECTION_FREE // The optimizer decides the variable selection strategy. MIO_VAR_SELECTION_PSEUDOCOST MioVarSelType = C.MSK_MIO_VAR_SELECTION_PSEUDOCOST // The optimizer employs pseudocost variable selection. MIO_VAR_SELECTION_STRONG MioVarSelType = C.MSK_MIO_VAR_SELECTION_STRONG // The optimizer employs strong branching variable selection. )
func (MioVarSelType) String ¶ added in v0.6.0
func (e MioVarSelType) String() string
type MskError ¶ added in v0.2.10
type MskError struct {
// contains filtered or unexported fields
}
Error wraps the response codes ResCode.
func AsMskError ¶ added in v0.2.10
AsMskError converts an error into a MskError if err wraps a MskError. The second returned bool indicates if the operation is successful.
type NameType ¶ added in v0.2.0
type NameType uint32
NameType is MSKnametype_enum.
Name types
const ( NAME_TYPE_GEN NameType = C.MSK_NAME_TYPE_GEN // General names. However, no duplicate and blank names are allowed. NAME_TYPE_MPS NameType = C.MSK_NAME_TYPE_MPS // MPS type names. NAME_TYPE_LP NameType = C.MSK_NAME_TYPE_LP // LP type names. )
type ObjectiveSense ¶
type ObjectiveSense uint32
ObjectiveSense is MSKobjsense_enum.
Objective sense types
const ( OBJECTIVE_SENSE_MINIMIZE ObjectiveSense = C.MSK_OBJECTIVE_SENSE_MINIMIZE // The problem should be minimized. OBJECTIVE_SENSE_MAXIMIZE ObjectiveSense = C.MSK_OBJECTIVE_SENSE_MAXIMIZE // The problem should be maximized. )
func (ObjectiveSense) String ¶ added in v0.2.10
func (e ObjectiveSense) String() string
type OnOff ¶ added in v0.1.2
type OnOff = int32
OnOff is MSKonoffkey_enum.
This is alias of int32, because golang distinguishes the enum and integers.
type OptimizerType ¶ added in v0.1.3
type OptimizerType = int32
OptimizerType is MSKoptimizertype_enum.
can be set for the integer parameter IPAR_OPTIMIZER
const ( OPTIMIZER_CONIC OptimizerType = C.MSK_OPTIMIZER_CONIC // The optimizer for problems having conic constraints. OPTIMIZER_DUAL_SIMPLEX OptimizerType = C.MSK_OPTIMIZER_DUAL_SIMPLEX // The dual simplex optimizer is used. OPTIMIZER_FREE OptimizerType = C.MSK_OPTIMIZER_FREE // The optimizer is chosen automatically. OPTIMIZER_FREE_SIMPLEX OptimizerType = C.MSK_OPTIMIZER_FREE_SIMPLEX // One of the simplex optimizers is used. OPTIMIZER_INTPNT OptimizerType = C.MSK_OPTIMIZER_INTPNT // The interior-point optimizer is used. OPTIMIZER_MIXED_INT OptimizerType = C.MSK_OPTIMIZER_MIXED_INT // The mixed-integer optimizer. OPTIMIZER_PRIMAL_SIMPLEX OptimizerType = C.MSK_OPTIMIZER_PRIMAL_SIMPLEX // The primal simplex optimizer is used. )
type OrderingType ¶ added in v0.2.0
type OrderingType uint32
OrderingType is MSKorderingtype_enum.
Ordering strategies
const ( ORDER_METHOD_FREE OrderingType = C.MSK_ORDER_METHOD_FREE // The ordering method is chosen automatically. ORDER_METHOD_APPMINLOC OrderingType = C.MSK_ORDER_METHOD_APPMINLOC // Approximate minimum local fill-in ordering is employed. ORDER_METHOD_EXPERIMENTAL OrderingType = C.MSK_ORDER_METHOD_EXPERIMENTAL // This option should not be used. ORDER_METHOD_TRY_GRAPHPAR OrderingType = C.MSK_ORDER_METHOD_TRY_GRAPHPAR // Always try the graph partitioning based ordering. ORDER_METHOD_FORCE_GRAPHPAR OrderingType = C.MSK_ORDER_METHOD_FORCE_GRAPHPAR // Always use the graph partitioning based ordering even if it is worse than the approximate minimum local fill ordering. ORDER_METHOD_NONE OrderingType = C.MSK_ORDER_METHOD_NONE // No ordering is used. Note using this value almost always leads to a significantly slow down. )
func (OrderingType) String ¶ added in v0.2.10
func (e OrderingType) String() string
type ParameterType ¶ added in v0.2.0
type ParameterType uint32
ParameterType is MSKparametertype_enum.
Parameter type
const ( PAR_INVALID_TYPE ParameterType = C.MSK_PAR_INVALID_TYPE // Not a valid parameter. PAR_DOU_TYPE ParameterType = C.MSK_PAR_DOU_TYPE // Is a double parameter. PAR_INT_TYPE ParameterType = C.MSK_PAR_INT_TYPE // Is an integer parameter. PAR_STR_TYPE ParameterType = C.MSK_PAR_STR_TYPE // Is a string parameter. )
func (ParameterType) String ¶ added in v0.2.10
func (e ParameterType) String() string
type PresolveMode ¶ added in v0.2.0
type PresolveMode uint32
PresolveMode is MSKpresolvemode_enum.
Presolve method.
const ( PRESOLVE_MODE_OFF PresolveMode = C.MSK_PRESOLVE_MODE_OFF // The problem is not presolved before it is optimized. PRESOLVE_MODE_ON PresolveMode = C.MSK_PRESOLVE_MODE_ON // The problem is presolved before it is optimized. PRESOLVE_MODE_FREE PresolveMode = C.MSK_PRESOLVE_MODE_FREE // It is decided automatically whether to presolve before the problem is optimized. )
func (PresolveMode) String ¶ added in v0.2.10
func (e PresolveMode) String() string
type ProSta ¶ added in v0.1.2
type ProSta uint32
ProSta is MSKprosta_enum.
Problem status keys
const ( PRO_STA_UNKNOWN ProSta = C.MSK_PRO_STA_UNKNOWN // Unknown problem status. PRO_STA_PRIM_AND_DUAL_FEAS ProSta = C.MSK_PRO_STA_PRIM_AND_DUAL_FEAS // The problem is primal and dual feasible. PRO_STA_PRIM_FEAS ProSta = C.MSK_PRO_STA_PRIM_FEAS // The problem is primal feasible. PRO_STA_DUAL_FEAS ProSta = C.MSK_PRO_STA_DUAL_FEAS // The problem is dual feasible. PRO_STA_PRIM_INFEAS ProSta = C.MSK_PRO_STA_PRIM_INFEAS // The problem is primal infeasible. PRO_STA_DUAL_INFEAS ProSta = C.MSK_PRO_STA_DUAL_INFEAS // The problem is dual infeasible. PRO_STA_PRIM_AND_DUAL_INFEAS ProSta = C.MSK_PRO_STA_PRIM_AND_DUAL_INFEAS // The problem is primal and dual infeasible. PRO_STA_ILL_POSED ProSta = C.MSK_PRO_STA_ILL_POSED // The problem is ill-posed. For example, it may be primal and dual feasible but have a positive duality gap. PRO_STA_PRIM_INFEAS_OR_UNBOUNDED ProSta = C.MSK_PRO_STA_PRIM_INFEAS_OR_UNBOUNDED // The problem is either primal infeasible or unbounded. This may occur for mixed-integer problems. )
type ProblemItem ¶ added in v0.2.0
type ProblemItem uint32
ProblemItem is MSKproblemitem_enum.
Problem data items
const ( PI_VAR ProblemItem = C.MSK_PI_VAR // Item is a variable. PI_CON ProblemItem = C.MSK_PI_CON // Item is a constraint. PI_CONE ProblemItem = C.MSK_PI_CONE // Item is a cone. )
func (ProblemItem) String ¶ added in v0.2.10
func (e ProblemItem) String() string
type ProblemType ¶ added in v0.2.0
type ProblemType uint32
ProblemType is MSKproblemtype_enum.
Problem types
const ( PROBTYPE_LO ProblemType = C.MSK_PROBTYPE_LO // The problem is a linear optimization problem. PROBTYPE_QO ProblemType = C.MSK_PROBTYPE_QO // The problem is a quadratic optimization problem. PROBTYPE_QCQO ProblemType = C.MSK_PROBTYPE_QCQO // The problem is a quadratically constrained optimization problem. PROBTYPE_CONIC ProblemType = C.MSK_PROBTYPE_CONIC // A conic optimization. PROBTYPE_MIXED ProblemType = C.MSK_PROBTYPE_MIXED // General nonlinear constraints and conic constraints. This combination can not be solved by MOSEK. )
func (ProblemType) String ¶ added in v0.2.10
func (e ProblemType) String() string
type Purify ¶ added in v0.2.0
type Purify uint32
Purify is MSKpurify_enum.
Solution purification employed optimizer.
const ( PURIFY_NONE Purify = C.MSK_PURIFY_NONE // The optimizer performs no solution purification. PURIFY_PRIMAL Purify = C.MSK_PURIFY_PRIMAL // The optimizer purifies the primal solution. PURIFY_DUAL Purify = C.MSK_PURIFY_DUAL // The optimizer purifies the dual solution. PURIFY_PRIMAL_DUAL Purify = C.MSK_PURIFY_PRIMAL_DUAL // The optimizer purifies both the primal and dual solution. PURIFY_AUTO Purify = C.MSK_PURIFY_AUTO // TBD )
type ResCode ¶
type ResCode uint32
ResCode is MSKrescode_enum.
Response codes
const ( RES_OK ResCode = C.MSK_RES_OK // No error occurred. RES_WRN_OPEN_PARAM_FILE ResCode = C.MSK_RES_WRN_OPEN_PARAM_FILE // The parameter file could not be opened. RES_WRN_LARGE_BOUND ResCode = C.MSK_RES_WRN_LARGE_BOUND // A numerically large bound value is specified. RES_WRN_LARGE_LO_BOUND ResCode = C.MSK_RES_WRN_LARGE_LO_BOUND // A numerically large lower bound value is specified. RES_WRN_LARGE_UP_BOUND ResCode = C.MSK_RES_WRN_LARGE_UP_BOUND // A numerically large upper bound value is specified. RES_WRN_LARGE_CON_FX ResCode = C.MSK_RES_WRN_LARGE_CON_FX // A equality constraint is fixed to numerically large value. RES_WRN_LARGE_CJ ResCode = C.MSK_RES_WRN_LARGE_CJ // A numerically large value is specified for one element in c. RES_WRN_LARGE_AIJ ResCode = C.MSK_RES_WRN_LARGE_AIJ // A numerically large value is specified for an element in A. RES_WRN_ZERO_AIJ ResCode = C.MSK_RES_WRN_ZERO_AIJ // One or more zero elements are specified in A. RES_WRN_NAME_MAX_LEN ResCode = C.MSK_RES_WRN_NAME_MAX_LEN // A name is longer than the buffer that is supposed to hold it. RES_WRN_SPAR_MAX_LEN ResCode = C.MSK_RES_WRN_SPAR_MAX_LEN // A value for a string parameter is longer than the buffer that is supposed to hold it. RES_WRN_MPS_SPLIT_RHS_VECTOR ResCode = C.MSK_RES_WRN_MPS_SPLIT_RHS_VECTOR // An RHS vector is split into several nonadjacent parts. RES_WRN_MPS_SPLIT_RAN_VECTOR ResCode = C.MSK_RES_WRN_MPS_SPLIT_RAN_VECTOR // A RANGE vector is split into several nonadjacent parts in an MPS file. RES_WRN_MPS_SPLIT_BOU_VECTOR ResCode = C.MSK_RES_WRN_MPS_SPLIT_BOU_VECTOR // A BOUNDS vector is split into several nonadjacent parts in an MPS file. RES_WRN_LP_OLD_QUAD_FORMAT ResCode = C.MSK_RES_WRN_LP_OLD_QUAD_FORMAT // Missing '/2' after quadratic expressions in bound or objective. RES_WRN_LP_DROP_VARIABLE ResCode = C.MSK_RES_WRN_LP_DROP_VARIABLE // Ignore a variable because the variable was not previously defined. RES_WRN_NZ_IN_UPR_TRI ResCode = C.MSK_RES_WRN_NZ_IN_UPR_TRI // Non-zero elements specified in the upper triangle of a matrix were ignored. RES_WRN_DROPPED_NZ_QOBJ ResCode = C.MSK_RES_WRN_DROPPED_NZ_QOBJ // One or more non-zero elements were dropped in the Q matrix in the objective. RES_WRN_IGNORE_INTEGER ResCode = C.MSK_RES_WRN_IGNORE_INTEGER // Ignored integer constraints. RES_WRN_NO_GLOBAL_OPTIMIZER ResCode = C.MSK_RES_WRN_NO_GLOBAL_OPTIMIZER // No global optimizer is available. RES_WRN_MIO_INFEASIBLE_FINAL ResCode = C.MSK_RES_WRN_MIO_INFEASIBLE_FINAL // The final mixed-integer problem with all the integer variables fixed at their optimal values is infeasible. RES_WRN_SOL_FILTER ResCode = C.MSK_RES_WRN_SOL_FILTER // Invalid solution filter is specified. RES_WRN_UNDEF_SOL_FILE_NAME ResCode = C.MSK_RES_WRN_UNDEF_SOL_FILE_NAME // Undefined name occurred in a solution. RES_WRN_SOL_FILE_IGNORED_CON ResCode = C.MSK_RES_WRN_SOL_FILE_IGNORED_CON // One or more lines in the constraint section were ignored when reading a solution file. RES_WRN_SOL_FILE_IGNORED_VAR ResCode = C.MSK_RES_WRN_SOL_FILE_IGNORED_VAR // One or more lines in the variable section were ignored when reading a solution file. RES_WRN_TOO_FEW_BASIS_VARS ResCode = C.MSK_RES_WRN_TOO_FEW_BASIS_VARS // An incomplete basis is specified. RES_WRN_TOO_MANY_BASIS_VARS ResCode = C.MSK_RES_WRN_TOO_MANY_BASIS_VARS // A basis with too many variables is specified. RES_WRN_LICENSE_EXPIRE ResCode = C.MSK_RES_WRN_LICENSE_EXPIRE // The license expires. RES_WRN_LICENSE_SERVER ResCode = C.MSK_RES_WRN_LICENSE_SERVER // The license server is not responding. RES_WRN_EMPTY_NAME ResCode = C.MSK_RES_WRN_EMPTY_NAME // A variable or constraint name is empty. The output file may be invalid. RES_WRN_USING_GENERIC_NAMES ResCode = C.MSK_RES_WRN_USING_GENERIC_NAMES // Generic names are used because a name is invalid for requested format. RES_WRN_INVALID_MPS_NAME ResCode = C.MSK_RES_WRN_INVALID_MPS_NAME // A name e.g. a row name is not a valid MPS name. RES_WRN_INVALID_MPS_OBJ_NAME ResCode = C.MSK_RES_WRN_INVALID_MPS_OBJ_NAME // The objective name is not a valid MPS name. RES_WRN_LICENSE_FEATURE_EXPIRE ResCode = C.MSK_RES_WRN_LICENSE_FEATURE_EXPIRE // The license expires. RES_WRN_PARAM_NAME_DOU ResCode = C.MSK_RES_WRN_PARAM_NAME_DOU // Parameter name not recognized. RES_WRN_PARAM_NAME_INT ResCode = C.MSK_RES_WRN_PARAM_NAME_INT // Parameter name not recognized. RES_WRN_PARAM_NAME_STR ResCode = C.MSK_RES_WRN_PARAM_NAME_STR // Parameter name not recognized. RES_WRN_PARAM_STR_VALUE ResCode = C.MSK_RES_WRN_PARAM_STR_VALUE // A parameter value is not correct. RES_WRN_PARAM_IGNORED_CMIO ResCode = C.MSK_RES_WRN_PARAM_IGNORED_CMIO // A parameter was ignored by the conic mixed integer optimizer. RES_WRN_ZEROS_IN_SPARSE_ROW ResCode = C.MSK_RES_WRN_ZEROS_IN_SPARSE_ROW // One or more (near) zero elements are specified in a sparse row of a matrix. RES_WRN_ZEROS_IN_SPARSE_COL ResCode = C.MSK_RES_WRN_ZEROS_IN_SPARSE_COL // One or more (near) zero elements are specified in a sparse column of a matrix. RES_WRN_INCOMPLETE_LINEAR_DEPENDENCY_CHECK ResCode = C.MSK_RES_WRN_INCOMPLETE_LINEAR_DEPENDENCY_CHECK // The linear dependency check(s) is incomplete. RES_WRN_ELIMINATOR_SPACE ResCode = C.MSK_RES_WRN_ELIMINATOR_SPACE // The eliminator is skipped at least once due to lack of space. RES_WRN_PRESOLVE_OUTOFSPACE ResCode = C.MSK_RES_WRN_PRESOLVE_OUTOFSPACE // The presolve is incomplete due to lack of space. RES_WRN_PRESOLVE_PRIMAL_PERTUBATIONS ResCode = C.MSK_RES_WRN_PRESOLVE_PRIMAL_PERTUBATIONS // The presolve perturbed the bounds of the primal problem. This is an indication that the problem is nearly infeasible. RES_WRN_WRITE_CHANGED_NAMES ResCode = C.MSK_RES_WRN_WRITE_CHANGED_NAMES // Some names were changed because they were invalid for the output file format. RES_WRN_WRITE_DISCARDED_CFIX ResCode = C.MSK_RES_WRN_WRITE_DISCARDED_CFIX // The fixed objective term was discarded in the output file. RES_WRN_DUPLICATE_CONSTRAINT_NAMES ResCode = C.MSK_RES_WRN_DUPLICATE_CONSTRAINT_NAMES // Two constraint names are identical. RES_WRN_DUPLICATE_VARIABLE_NAMES ResCode = C.MSK_RES_WRN_DUPLICATE_VARIABLE_NAMES // Two variable names are identical. RES_WRN_DUPLICATE_BARVARIABLE_NAMES ResCode = C.MSK_RES_WRN_DUPLICATE_BARVARIABLE_NAMES // Two barvariable names are identical. RES_WRN_DUPLICATE_CONE_NAMES ResCode = C.MSK_RES_WRN_DUPLICATE_CONE_NAMES // Two cone names are identical. RES_WRN_WRITE_LP_INVALID_VAR_NAMES ResCode = C.MSK_RES_WRN_WRITE_LP_INVALID_VAR_NAMES // LP file will be written with generic variable names. RES_WRN_WRITE_LP_DUPLICATE_VAR_NAMES ResCode = C.MSK_RES_WRN_WRITE_LP_DUPLICATE_VAR_NAMES // LP file will be written with generic variable names. RES_WRN_WRITE_LP_INVALID_CON_NAMES ResCode = C.MSK_RES_WRN_WRITE_LP_INVALID_CON_NAMES // LP file will be written with generic constraint names. RES_WRN_WRITE_LP_DUPLICATE_CON_NAMES ResCode = C.MSK_RES_WRN_WRITE_LP_DUPLICATE_CON_NAMES // LP file will be written with generic constraint names. RES_WRN_ANA_LARGE_BOUNDS ResCode = C.MSK_RES_WRN_ANA_LARGE_BOUNDS // Warn against very large bounds. RES_WRN_ANA_C_ZERO ResCode = C.MSK_RES_WRN_ANA_C_ZERO // Warn against all objective coefficients being zero. RES_WRN_ANA_EMPTY_COLS ResCode = C.MSK_RES_WRN_ANA_EMPTY_COLS // Warn against empty columns. RES_WRN_ANA_CLOSE_BOUNDS ResCode = C.MSK_RES_WRN_ANA_CLOSE_BOUNDS // Warn against close bounds. RES_WRN_ANA_ALMOST_INT_BOUNDS ResCode = C.MSK_RES_WRN_ANA_ALMOST_INT_BOUNDS // Warn against almost integral bounds. RES_WRN_NO_INFEASIBILITY_REPORT_WHEN_MATRIX_VARIABLES ResCode = C.MSK_RES_WRN_NO_INFEASIBILITY_REPORT_WHEN_MATRIX_VARIABLES // An infeasibility report is not available when the problem contains matrix variables. RES_WRN_NO_DUALIZER ResCode = C.MSK_RES_WRN_NO_DUALIZER // No automatic dualizer is available for the specified problem. RES_WRN_SYM_MAT_LARGE ResCode = C.MSK_RES_WRN_SYM_MAT_LARGE // A numerically large value is specified for an element in E. RES_WRN_MODIFIED_DOUBLE_PARAMETER ResCode = C.MSK_RES_WRN_MODIFIED_DOUBLE_PARAMETER // A double parameter related to solver tolerances has a non-default value. RES_WRN_LARGE_FIJ ResCode = C.MSK_RES_WRN_LARGE_FIJ // A numerically large value is specified for an element in F. RES_ERR_LICENSE ResCode = C.MSK_RES_ERR_LICENSE // Invalid license. RES_ERR_LICENSE_EXPIRED ResCode = C.MSK_RES_ERR_LICENSE_EXPIRED // The license has expired. RES_ERR_LICENSE_VERSION ResCode = C.MSK_RES_ERR_LICENSE_VERSION // Invalid license version. RES_ERR_LICENSE_OLD_SERVER_VERSION ResCode = C.MSK_RES_ERR_LICENSE_OLD_SERVER_VERSION // The license server version is too old. RES_ERR_SIZE_LICENSE ResCode = C.MSK_RES_ERR_SIZE_LICENSE // The problem is bigger than the license. RES_ERR_PROB_LICENSE ResCode = C.MSK_RES_ERR_PROB_LICENSE // The software is not licensed to solve the problem. RES_ERR_FILE_LICENSE ResCode = C.MSK_RES_ERR_FILE_LICENSE // Invalid license file. RES_ERR_MISSING_LICENSE_FILE ResCode = C.MSK_RES_ERR_MISSING_LICENSE_FILE // A license cannot be located. RES_ERR_SIZE_LICENSE_CON ResCode = C.MSK_RES_ERR_SIZE_LICENSE_CON // The problem has too many constraints. RES_ERR_SIZE_LICENSE_VAR ResCode = C.MSK_RES_ERR_SIZE_LICENSE_VAR // The problem has too many variables. RES_ERR_SIZE_LICENSE_INTVAR ResCode = C.MSK_RES_ERR_SIZE_LICENSE_INTVAR // The problem contains too many integer variables. RES_ERR_OPTIMIZER_LICENSE ResCode = C.MSK_RES_ERR_OPTIMIZER_LICENSE // The optimizer required is not licensed. RES_ERR_FLEXLM ResCode = C.MSK_RES_ERR_FLEXLM // The license manager reported an error. RES_ERR_LICENSE_SERVER ResCode = C.MSK_RES_ERR_LICENSE_SERVER // The license server is not responding. RES_ERR_LICENSE_MAX ResCode = C.MSK_RES_ERR_LICENSE_MAX // Maximum number of licenses is reached. RES_ERR_LICENSE_MOSEKLM_DAEMON ResCode = C.MSK_RES_ERR_LICENSE_MOSEKLM_DAEMON // The MOSEKLM license manager daemon is not up and running. RES_ERR_LICENSE_FEATURE ResCode = C.MSK_RES_ERR_LICENSE_FEATURE // A requested feature is not available in the license file(s). RES_ERR_PLATFORM_NOT_LICENSED ResCode = C.MSK_RES_ERR_PLATFORM_NOT_LICENSED // A requested license feature is not available for the required platform. RES_ERR_LICENSE_CANNOT_ALLOCATE ResCode = C.MSK_RES_ERR_LICENSE_CANNOT_ALLOCATE // The license system cannot allocate the memory required. RES_ERR_LICENSE_CANNOT_CONNECT ResCode = C.MSK_RES_ERR_LICENSE_CANNOT_CONNECT // MOSEK cannot connect to the license server. RES_ERR_LICENSE_INVALID_HOSTID ResCode = C.MSK_RES_ERR_LICENSE_INVALID_HOSTID // The host ID specified in the license file does not match the host ID of the computer. RES_ERR_LICENSE_SERVER_VERSION ResCode = C.MSK_RES_ERR_LICENSE_SERVER_VERSION // The version specified in the checkout request is greater than the highest version number the daemon supports. RES_ERR_LICENSE_NO_SERVER_SUPPORT ResCode = C.MSK_RES_ERR_LICENSE_NO_SERVER_SUPPORT // The license server does not support the requested feature. RES_ERR_LICENSE_NO_SERVER_LINE ResCode = C.MSK_RES_ERR_LICENSE_NO_SERVER_LINE // No SERVER lines in license file. RES_ERR_OLDER_DLL ResCode = C.MSK_RES_ERR_OLDER_DLL // The dynamic link library is older than the specified version. RES_ERR_NEWER_DLL ResCode = C.MSK_RES_ERR_NEWER_DLL // The dynamic link library is newer than the specified version. RES_ERR_LINK_FILE_DLL ResCode = C.MSK_RES_ERR_LINK_FILE_DLL // A file cannot be linked to a stream in the DLL version. RES_ERR_THREAD_MUTEX_INIT ResCode = C.MSK_RES_ERR_THREAD_MUTEX_INIT // Could not initialize a mutex. RES_ERR_THREAD_MUTEX_LOCK ResCode = C.MSK_RES_ERR_THREAD_MUTEX_LOCK // Could not lock a mutex. RES_ERR_THREAD_MUTEX_UNLOCK ResCode = C.MSK_RES_ERR_THREAD_MUTEX_UNLOCK // Could not unlock a mutex. RES_ERR_THREAD_CREATE ResCode = C.MSK_RES_ERR_THREAD_CREATE // Could not create a thread. RES_ERR_THREAD_COND_INIT ResCode = C.MSK_RES_ERR_THREAD_COND_INIT // Could not initialize a condition. RES_ERR_UNKNOWN ResCode = C.MSK_RES_ERR_UNKNOWN // Unknown error. RES_ERR_SPACE ResCode = C.MSK_RES_ERR_SPACE // Out of space. RES_ERR_FILE_OPEN ResCode = C.MSK_RES_ERR_FILE_OPEN // An error occurred while opening a file. RES_ERR_FILE_READ ResCode = C.MSK_RES_ERR_FILE_READ // An error occurred while reading file. RES_ERR_FILE_WRITE ResCode = C.MSK_RES_ERR_FILE_WRITE // An error occurred while writing to a file. RES_ERR_DATA_FILE_EXT ResCode = C.MSK_RES_ERR_DATA_FILE_EXT // The data file format cannot be determined from the file name. RES_ERR_INVALID_FILE_NAME ResCode = C.MSK_RES_ERR_INVALID_FILE_NAME // An invalid file name has been specified. RES_ERR_INVALID_SOL_FILE_NAME ResCode = C.MSK_RES_ERR_INVALID_SOL_FILE_NAME // An invalid file name has been specified. RES_ERR_END_OF_FILE ResCode = C.MSK_RES_ERR_END_OF_FILE // End of file reached. RES_ERR_NULL_ENV ResCode = C.MSK_RES_ERR_NULL_ENV // env is a null pointer. RES_ERR_NULL_TASK ResCode = C.MSK_RES_ERR_NULL_TASK // task is a null pointer. RES_ERR_INVALID_STREAM ResCode = C.MSK_RES_ERR_INVALID_STREAM // An invalid stream is referenced. RES_ERR_NO_INIT_ENV ResCode = C.MSK_RES_ERR_NO_INIT_ENV // Environment is not initialized. RES_ERR_INVALID_TASK ResCode = C.MSK_RES_ERR_INVALID_TASK // The task is invalid. RES_ERR_NULL_POINTER ResCode = C.MSK_RES_ERR_NULL_POINTER // An argument to a function is unexpectedly a null pointer. RES_ERR_LIVING_TASKS ResCode = C.MSK_RES_ERR_LIVING_TASKS // Not all tasks associated with the environment have been deleted. RES_ERR_READ_GZIP ResCode = C.MSK_RES_ERR_READ_GZIP // Error encountered in GZIP stream. RES_ERR_READ_ZSTD ResCode = C.MSK_RES_ERR_READ_ZSTD // Error encountered in ZSTD stream. RES_ERR_BLANK_NAME ResCode = C.MSK_RES_ERR_BLANK_NAME // An all blank name has been specified. RES_ERR_DUP_NAME ResCode = C.MSK_RES_ERR_DUP_NAME // Duplicate names specified. RES_ERR_FORMAT_STRING ResCode = C.MSK_RES_ERR_FORMAT_STRING // The name format string is invalid. RES_ERR_SPARSITY_SPECIFICATION ResCode = C.MSK_RES_ERR_SPARSITY_SPECIFICATION // The sparsity included an index that was out of bounds of the shape. RES_ERR_MISMATCHING_DIMENSION ResCode = C.MSK_RES_ERR_MISMATCHING_DIMENSION // Mismatching dimensions specified in arguments RES_ERR_INVALID_OBJ_NAME ResCode = C.MSK_RES_ERR_INVALID_OBJ_NAME // An invalid objective name is specified. RES_ERR_INVALID_CON_NAME ResCode = C.MSK_RES_ERR_INVALID_CON_NAME // An invalid constraint name is used. RES_ERR_INVALID_VAR_NAME ResCode = C.MSK_RES_ERR_INVALID_VAR_NAME // An invalid variable name is used. RES_ERR_INVALID_CONE_NAME ResCode = C.MSK_RES_ERR_INVALID_CONE_NAME // An invalid cone name is used. RES_ERR_INVALID_BARVAR_NAME ResCode = C.MSK_RES_ERR_INVALID_BARVAR_NAME // An invalid symmetric matrix variable name is used. RES_ERR_SPACE_LEAKING ResCode = C.MSK_RES_ERR_SPACE_LEAKING // MOSEK is leaking memory. RES_ERR_SPACE_NO_INFO ResCode = C.MSK_RES_ERR_SPACE_NO_INFO // No available information about the space usage. RES_ERR_DIMENSION_SPECIFICATION ResCode = C.MSK_RES_ERR_DIMENSION_SPECIFICATION // Invalid dimension specification RES_ERR_AXIS_NAME_SPECIFICATION ResCode = C.MSK_RES_ERR_AXIS_NAME_SPECIFICATION // Invalid axis names specification RES_ERR_READ_FORMAT ResCode = C.MSK_RES_ERR_READ_FORMAT // The specified format cannot be read. RES_ERR_MPS_FILE ResCode = C.MSK_RES_ERR_MPS_FILE // An error occurred while reading an MPS file. RES_ERR_MPS_INV_FIELD ResCode = C.MSK_RES_ERR_MPS_INV_FIELD // Invalid field occurred while reading an MPS file. RES_ERR_MPS_INV_MARKER ResCode = C.MSK_RES_ERR_MPS_INV_MARKER // An invalid marker has been specified in the MPS file. RES_ERR_MPS_NULL_CON_NAME ResCode = C.MSK_RES_ERR_MPS_NULL_CON_NAME // An empty constraint name is used in an MPS file. RES_ERR_MPS_NULL_VAR_NAME ResCode = C.MSK_RES_ERR_MPS_NULL_VAR_NAME // An empty variable name is used in an MPS file. RES_ERR_MPS_UNDEF_CON_NAME ResCode = C.MSK_RES_ERR_MPS_UNDEF_CON_NAME // An undefined constraint name occurred in an MPS file. RES_ERR_MPS_UNDEF_VAR_NAME ResCode = C.MSK_RES_ERR_MPS_UNDEF_VAR_NAME // An undefined variable name occurred in an MPS file. RES_ERR_MPS_INVALID_CON_KEY ResCode = C.MSK_RES_ERR_MPS_INVALID_CON_KEY // An invalid constraint key occurred in an MPS file. RES_ERR_MPS_INVALID_BOUND_KEY ResCode = C.MSK_RES_ERR_MPS_INVALID_BOUND_KEY // An invalid bound key occurred in an MPS file. RES_ERR_MPS_INVALID_SEC_NAME ResCode = C.MSK_RES_ERR_MPS_INVALID_SEC_NAME // An invalid section name occurred in an MPS file. RES_ERR_MPS_NO_OBJECTIVE ResCode = C.MSK_RES_ERR_MPS_NO_OBJECTIVE // No objective is defined in an MPS file. RES_ERR_MPS_SPLITTED_VAR ResCode = C.MSK_RES_ERR_MPS_SPLITTED_VAR // The non-zero elements in A corresponding to a variable in an MPS file must be specified consecutively. RES_ERR_MPS_MUL_CON_NAME ResCode = C.MSK_RES_ERR_MPS_MUL_CON_NAME // A constraint name is specified multiple times in the ROWS section in an MPS file. RES_ERR_MPS_MUL_QSEC ResCode = C.MSK_RES_ERR_MPS_MUL_QSEC // Multiple QSECTIONs are specified for a constraint. RES_ERR_MPS_MUL_QOBJ ResCode = C.MSK_RES_ERR_MPS_MUL_QOBJ // The Q term in the objective is specified multiple times. RES_ERR_MPS_INV_SEC_ORDER ResCode = C.MSK_RES_ERR_MPS_INV_SEC_ORDER // The sections in an MPS file is not in the correct order. RES_ERR_MPS_MUL_CSEC ResCode = C.MSK_RES_ERR_MPS_MUL_CSEC // Multiple CSECTIONs are given the same name. RES_ERR_MPS_CONE_TYPE ResCode = C.MSK_RES_ERR_MPS_CONE_TYPE // Invalid cone type specified in a CSECTION. RES_ERR_MPS_CONE_OVERLAP ResCode = C.MSK_RES_ERR_MPS_CONE_OVERLAP // A variable is specified to be a member of several cones. RES_ERR_MPS_CONE_REPEAT ResCode = C.MSK_RES_ERR_MPS_CONE_REPEAT // A variable is repeated within the CSECTION. RES_ERR_MPS_NON_SYMMETRIC_Q ResCode = C.MSK_RES_ERR_MPS_NON_SYMMETRIC_Q // A non symmetric matrix has been speciefied. RES_ERR_MPS_DUPLICATE_Q_ELEMENT ResCode = C.MSK_RES_ERR_MPS_DUPLICATE_Q_ELEMENT // Duplicate elements is specified in a Q matrix. RES_ERR_MPS_INVALID_OBJSENSE ResCode = C.MSK_RES_ERR_MPS_INVALID_OBJSENSE // An invalid objective sense is specified. RES_ERR_MPS_TAB_IN_FIELD2 ResCode = C.MSK_RES_ERR_MPS_TAB_IN_FIELD2 // A tab char occurred in field 2. RES_ERR_MPS_TAB_IN_FIELD3 ResCode = C.MSK_RES_ERR_MPS_TAB_IN_FIELD3 // A tab char occurred in field 3. RES_ERR_MPS_TAB_IN_FIELD5 ResCode = C.MSK_RES_ERR_MPS_TAB_IN_FIELD5 // A tab char occurred in field 5. RES_ERR_MPS_INVALID_OBJ_NAME ResCode = C.MSK_RES_ERR_MPS_INVALID_OBJ_NAME // An invalid objective name is specified. RES_ERR_MPS_INVALID_KEY ResCode = C.MSK_RES_ERR_MPS_INVALID_KEY // An invalid indicator key occurred in an MPS file. RES_ERR_MPS_INVALID_INDICATOR_CONSTRAINT ResCode = C.MSK_RES_ERR_MPS_INVALID_INDICATOR_CONSTRAINT // An invalid indicator constraint is used. It must not be a ranged constraint. RES_ERR_MPS_INVALID_INDICATOR_VARIABLE ResCode = C.MSK_RES_ERR_MPS_INVALID_INDICATOR_VARIABLE // An invalid indicator variable is specfied. It must be a binary variable. RES_ERR_MPS_INVALID_INDICATOR_VALUE ResCode = C.MSK_RES_ERR_MPS_INVALID_INDICATOR_VALUE // An invalid indicator value is specfied. It must be either 0 or 1. RES_ERR_MPS_INVALID_INDICATOR_QUADRATIC_CONSTRAINT ResCode = C.MSK_RES_ERR_MPS_INVALID_INDICATOR_QUADRATIC_CONSTRAINT // A quadratic constraint can be be an indicator constraint. RES_ERR_OPF_SYNTAX ResCode = C.MSK_RES_ERR_OPF_SYNTAX // Syntax error in an OPF file RES_ERR_OPF_PREMATURE_EOF ResCode = C.MSK_RES_ERR_OPF_PREMATURE_EOF // Premature end of file in an OPF file. RES_ERR_OPF_MISMATCHED_TAG ResCode = C.MSK_RES_ERR_OPF_MISMATCHED_TAG // Mismatched end-tag in OPF file RES_ERR_OPF_DUPLICATE_BOUND ResCode = C.MSK_RES_ERR_OPF_DUPLICATE_BOUND // Either upper or lower bound was specified twice in OPF file RES_ERR_OPF_DUPLICATE_CONSTRAINT_NAME ResCode = C.MSK_RES_ERR_OPF_DUPLICATE_CONSTRAINT_NAME // Duplicate constraint name in OPF File RES_ERR_OPF_INVALID_CONE_TYPE ResCode = C.MSK_RES_ERR_OPF_INVALID_CONE_TYPE // Invalid cone type in OPF File RES_ERR_OPF_INCORRECT_TAG_PARAM ResCode = C.MSK_RES_ERR_OPF_INCORRECT_TAG_PARAM // Invalid number of parameters in start-tag in OPF File RES_ERR_OPF_INVALID_TAG ResCode = C.MSK_RES_ERR_OPF_INVALID_TAG // Invalid start-tag in OPF File RES_ERR_OPF_DUPLICATE_CONE_ENTRY ResCode = C.MSK_RES_ERR_OPF_DUPLICATE_CONE_ENTRY // Same variable appears in multiple cones in OPF File RES_ERR_OPF_TOO_LARGE ResCode = C.MSK_RES_ERR_OPF_TOO_LARGE // The problem is too large to be correctly loaded RES_ERR_OPF_DUAL_INTEGER_SOLUTION ResCode = C.MSK_RES_ERR_OPF_DUAL_INTEGER_SOLUTION // Dual solution values are not allowed in OPF File RES_ERR_LP_EMPTY ResCode = C.MSK_RES_ERR_LP_EMPTY // The problem cannot be written to an LP formatted file. RES_ERR_WRITE_MPS_INVALID_NAME ResCode = C.MSK_RES_ERR_WRITE_MPS_INVALID_NAME // An invalid name is created while writing an MPS file. RES_ERR_LP_INVALID_VAR_NAME ResCode = C.MSK_RES_ERR_LP_INVALID_VAR_NAME // A variable name is invalid when used in an LP formatted file. RES_ERR_WRITE_OPF_INVALID_VAR_NAME ResCode = C.MSK_RES_ERR_WRITE_OPF_INVALID_VAR_NAME // Empty variable names cannot be written to OPF files. RES_ERR_LP_FILE_FORMAT ResCode = C.MSK_RES_ERR_LP_FILE_FORMAT // Syntax error in an LP file. RES_ERR_LP_EXPECTED_NUMBER ResCode = C.MSK_RES_ERR_LP_EXPECTED_NUMBER // Expected a number in LP file RES_ERR_READ_LP_MISSING_END_TAG ResCode = C.MSK_RES_ERR_READ_LP_MISSING_END_TAG // Syntax error in LP fil. Possibly missing End tag. RES_ERR_LP_INDICATOR_VAR ResCode = C.MSK_RES_ERR_LP_INDICATOR_VAR // An indicator variable was not declared binary RES_ERR_LP_EXPECTED_OBJECTIVE ResCode = C.MSK_RES_ERR_LP_EXPECTED_OBJECTIVE // Expected an objective section in LP file RES_ERR_LP_EXPECTED_CONSTRAINT_RELATION ResCode = C.MSK_RES_ERR_LP_EXPECTED_CONSTRAINT_RELATION // Expected constraint relation RES_ERR_LP_AMBIGUOUS_CONSTRAINT_BOUND ResCode = C.MSK_RES_ERR_LP_AMBIGUOUS_CONSTRAINT_BOUND // Constraint has ambiguous or invalid bound RES_ERR_LP_DUPLICATE_SECTION ResCode = C.MSK_RES_ERR_LP_DUPLICATE_SECTION // Duplicate section RES_ERR_READ_LP_DELAYED_ROWS_NOT_SUPPORTED ResCode = C.MSK_RES_ERR_READ_LP_DELAYED_ROWS_NOT_SUPPORTED // Duplicate section RES_ERR_WRITING_FILE ResCode = C.MSK_RES_ERR_WRITING_FILE // An error occurred while writing file RES_ERR_INVALID_NAME_IN_SOL_FILE ResCode = C.MSK_RES_ERR_INVALID_NAME_IN_SOL_FILE // An invalid name occurred in a solution file. RES_ERR_JSON_SYNTAX ResCode = C.MSK_RES_ERR_JSON_SYNTAX // Syntax error in an JSON data RES_ERR_JSON_STRING ResCode = C.MSK_RES_ERR_JSON_STRING // Error in JSON string. RES_ERR_JSON_NUMBER_OVERFLOW ResCode = C.MSK_RES_ERR_JSON_NUMBER_OVERFLOW // Invalid number entry - wrong type or value overflow. RES_ERR_JSON_FORMAT ResCode = C.MSK_RES_ERR_JSON_FORMAT // Error in an JSON Task file RES_ERR_JSON_DATA ResCode = C.MSK_RES_ERR_JSON_DATA // Inconsistent data in JSON Task file RES_ERR_JSON_MISSING_DATA ResCode = C.MSK_RES_ERR_JSON_MISSING_DATA // Missing data section in JSON task file. RES_ERR_PTF_INCOMPATIBILITY ResCode = C.MSK_RES_ERR_PTF_INCOMPATIBILITY // Incompatible item RES_ERR_PTF_UNDEFINED_ITEM ResCode = C.MSK_RES_ERR_PTF_UNDEFINED_ITEM // Undefined symbol referenced RES_ERR_PTF_INCONSISTENCY ResCode = C.MSK_RES_ERR_PTF_INCONSISTENCY // Inconsistent size of item RES_ERR_PTF_FORMAT ResCode = C.MSK_RES_ERR_PTF_FORMAT // Syntax error in an PTF file RES_ERR_ARGUMENT_LENNEQ ResCode = C.MSK_RES_ERR_ARGUMENT_LENNEQ // Incorrect length of arguments. RES_ERR_ARGUMENT_TYPE ResCode = C.MSK_RES_ERR_ARGUMENT_TYPE // Incorrect argument type. RES_ERR_NUM_ARGUMENTS ResCode = C.MSK_RES_ERR_NUM_ARGUMENTS // Incorrect number of function arguments. RES_ERR_IN_ARGUMENT ResCode = C.MSK_RES_ERR_IN_ARGUMENT // A function argument is incorrect. RES_ERR_ARGUMENT_DIMENSION ResCode = C.MSK_RES_ERR_ARGUMENT_DIMENSION // A function argument is of incorrect dimension. RES_ERR_SHAPE_IS_TOO_LARGE ResCode = C.MSK_RES_ERR_SHAPE_IS_TOO_LARGE // The size of the n-dimensional shape is too large. RES_ERR_INDEX_IS_TOO_SMALL ResCode = C.MSK_RES_ERR_INDEX_IS_TOO_SMALL // An index in an argument is too small. RES_ERR_INDEX_IS_TOO_LARGE ResCode = C.MSK_RES_ERR_INDEX_IS_TOO_LARGE // An index in an argument is too large. RES_ERR_INDEX_IS_NOT_UNIQUE ResCode = C.MSK_RES_ERR_INDEX_IS_NOT_UNIQUE // An index in an argument is is unique. RES_ERR_PARAM_NAME ResCode = C.MSK_RES_ERR_PARAM_NAME // A parameter name is not correct. RES_ERR_PARAM_NAME_DOU ResCode = C.MSK_RES_ERR_PARAM_NAME_DOU // A parameter name is not correct. RES_ERR_PARAM_NAME_INT ResCode = C.MSK_RES_ERR_PARAM_NAME_INT // A parameter name is not correct. RES_ERR_PARAM_NAME_STR ResCode = C.MSK_RES_ERR_PARAM_NAME_STR // A parameter name is not correct. RES_ERR_PARAM_INDEX ResCode = C.MSK_RES_ERR_PARAM_INDEX // Parameter index is out of range. RES_ERR_PARAM_IS_TOO_LARGE ResCode = C.MSK_RES_ERR_PARAM_IS_TOO_LARGE // A parameter value is too large. RES_ERR_PARAM_IS_TOO_SMALL ResCode = C.MSK_RES_ERR_PARAM_IS_TOO_SMALL // A parameter value is too small. RES_ERR_PARAM_VALUE_STR ResCode = C.MSK_RES_ERR_PARAM_VALUE_STR // A parameter value string is incorrect. RES_ERR_PARAM_TYPE ResCode = C.MSK_RES_ERR_PARAM_TYPE // A parameter type is invalid. RES_ERR_INF_DOU_INDEX ResCode = C.MSK_RES_ERR_INF_DOU_INDEX // A double information index is out of range for the specified type. RES_ERR_INF_INT_INDEX ResCode = C.MSK_RES_ERR_INF_INT_INDEX // An integer information index is out of range for the specified type. RES_ERR_INDEX_ARR_IS_TOO_SMALL ResCode = C.MSK_RES_ERR_INDEX_ARR_IS_TOO_SMALL // An index in an array argument is too small. RES_ERR_INDEX_ARR_IS_TOO_LARGE ResCode = C.MSK_RES_ERR_INDEX_ARR_IS_TOO_LARGE // An index in an array argument is too large. RES_ERR_INF_LINT_INDEX ResCode = C.MSK_RES_ERR_INF_LINT_INDEX // A long integer information index is out of range for the specified type. RES_ERR_ARG_IS_TOO_SMALL ResCode = C.MSK_RES_ERR_ARG_IS_TOO_SMALL // The value of a argument is too small. RES_ERR_ARG_IS_TOO_LARGE ResCode = C.MSK_RES_ERR_ARG_IS_TOO_LARGE // The value of a argument is too large. RES_ERR_INVALID_WHICHSOL ResCode = C.MSK_RES_ERR_INVALID_WHICHSOL // whichsol is invalid. RES_ERR_INF_DOU_NAME ResCode = C.MSK_RES_ERR_INF_DOU_NAME // A double information name is invalid. RES_ERR_INF_INT_NAME ResCode = C.MSK_RES_ERR_INF_INT_NAME // An integer information name is invalid. RES_ERR_INF_TYPE ResCode = C.MSK_RES_ERR_INF_TYPE // The information type is invalid. RES_ERR_INF_LINT_NAME ResCode = C.MSK_RES_ERR_INF_LINT_NAME // A long integer information name is invalid. RES_ERR_INDEX ResCode = C.MSK_RES_ERR_INDEX // An index is out of range. RES_ERR_WHICHSOL ResCode = C.MSK_RES_ERR_WHICHSOL // The solution defined by whichsol does not exists. RES_ERR_SOLITEM ResCode = C.MSK_RES_ERR_SOLITEM // The solution number solemn does not exists. RES_ERR_WHICHITEM_NOT_ALLOWED ResCode = C.MSK_RES_ERR_WHICHITEM_NOT_ALLOWED // whichitem is unacceptable. RES_ERR_MAXNUMCON ResCode = C.MSK_RES_ERR_MAXNUMCON // Invalid maximum number of constraints specified. RES_ERR_MAXNUMVAR ResCode = C.MSK_RES_ERR_MAXNUMVAR // The maximum number of variables limit is too small. RES_ERR_MAXNUMBARVAR ResCode = C.MSK_RES_ERR_MAXNUMBARVAR // The maximum number of semidefinite variables limit is too small. RES_ERR_MAXNUMQNZ ResCode = C.MSK_RES_ERR_MAXNUMQNZ // Too small maximum number of non-zeros for the Q matrices is specified. RES_ERR_TOO_SMALL_MAX_NUM_NZ ResCode = C.MSK_RES_ERR_TOO_SMALL_MAX_NUM_NZ // The maximum number of non-zeros specified is too small. RES_ERR_INVALID_IDX ResCode = C.MSK_RES_ERR_INVALID_IDX // A specified index is invalid. RES_ERR_INVALID_MAX_NUM ResCode = C.MSK_RES_ERR_INVALID_MAX_NUM // A specified index is invalid. RES_ERR_UNALLOWED_WHICHSOL ResCode = C.MSK_RES_ERR_UNALLOWED_WHICHSOL // The value of whichsol is not allowed. RES_ERR_NUMCONLIM ResCode = C.MSK_RES_ERR_NUMCONLIM // Maximum number of constraints limit is exceeded. RES_ERR_NUMVARLIM ResCode = C.MSK_RES_ERR_NUMVARLIM // Maximum number of variables limit is exceeded. RES_ERR_TOO_SMALL_MAXNUMANZ ResCode = C.MSK_RES_ERR_TOO_SMALL_MAXNUMANZ // Too small maximum number of non-zeros in A specified. RES_ERR_INV_APTRE ResCode = C.MSK_RES_ERR_INV_APTRE // aptre\[j\] is strictly smaller than aptrb\[j\] for some j. RES_ERR_MUL_A_ELEMENT ResCode = C.MSK_RES_ERR_MUL_A_ELEMENT // An element in A is defined multiple times. RES_ERR_INV_BK ResCode = C.MSK_RES_ERR_INV_BK // Invalid bound key. RES_ERR_INV_BKC ResCode = C.MSK_RES_ERR_INV_BKC // Invalid bound key is specified for a constraint. RES_ERR_INV_BKX ResCode = C.MSK_RES_ERR_INV_BKX // An invalid bound key is specified for a variable. RES_ERR_INV_VAR_TYPE ResCode = C.MSK_RES_ERR_INV_VAR_TYPE // An invalid variable type is specified for a variable. RES_ERR_SOLVER_PROBTYPE ResCode = C.MSK_RES_ERR_SOLVER_PROBTYPE // Problem type does not match the chosen optimizer. RES_ERR_OBJECTIVE_RANGE ResCode = C.MSK_RES_ERR_OBJECTIVE_RANGE // Empty objective range. RES_ERR_INV_RESCODE ResCode = C.MSK_RES_ERR_INV_RESCODE // Invalid response code. RES_ERR_INV_IINF ResCode = C.MSK_RES_ERR_INV_IINF // Invalid integer information item. RES_ERR_INV_LIINF ResCode = C.MSK_RES_ERR_INV_LIINF // Invalid long integer information item. RES_ERR_INV_DINF ResCode = C.MSK_RES_ERR_INV_DINF // Invalid double information item. RES_ERR_BASIS ResCode = C.MSK_RES_ERR_BASIS // Invalid basis is specified. RES_ERR_INV_SKC ResCode = C.MSK_RES_ERR_INV_SKC // Invalid value in skc encountered. RES_ERR_INV_SKX ResCode = C.MSK_RES_ERR_INV_SKX // Invalid value in skx encountered. RES_ERR_INV_SK_STR ResCode = C.MSK_RES_ERR_INV_SK_STR // Invalid status key string encountered. RES_ERR_INV_SK ResCode = C.MSK_RES_ERR_INV_SK // Invalid status key code encountered. RES_ERR_INV_CONE_TYPE_STR ResCode = C.MSK_RES_ERR_INV_CONE_TYPE_STR // Invalid cone type string encountered. RES_ERR_INV_CONE_TYPE ResCode = C.MSK_RES_ERR_INV_CONE_TYPE // Invalid cone type code encountered. RES_ERR_INV_SKN ResCode = C.MSK_RES_ERR_INV_SKN // Invalid value in skn encountered. RES_ERR_INVALID_SURPLUS ResCode = C.MSK_RES_ERR_INVALID_SURPLUS // Invalid surplus. RES_ERR_INV_NAME_ITEM ResCode = C.MSK_RES_ERR_INV_NAME_ITEM // An invalid name item code is used. RES_ERR_PRO_ITEM ResCode = C.MSK_RES_ERR_PRO_ITEM // An invalid problem item is used. RES_ERR_INVALID_FORMAT_TYPE ResCode = C.MSK_RES_ERR_INVALID_FORMAT_TYPE // Invalid format type. RES_ERR_FIRSTI ResCode = C.MSK_RES_ERR_FIRSTI // Invalid firsti. RES_ERR_LASTI ResCode = C.MSK_RES_ERR_LASTI // Invalid lasti. RES_ERR_FIRSTJ ResCode = C.MSK_RES_ERR_FIRSTJ // Invalid firstj. RES_ERR_LASTJ ResCode = C.MSK_RES_ERR_LASTJ // Invalid lastj. RES_ERR_MAX_LEN_IS_TOO_SMALL ResCode = C.MSK_RES_ERR_MAX_LEN_IS_TOO_SMALL // A maximum length that is too small has been specified. RES_ERR_NONLINEAR_EQUALITY ResCode = C.MSK_RES_ERR_NONLINEAR_EQUALITY // The model contains a nonlinear equality. RES_ERR_NONCONVEX ResCode = C.MSK_RES_ERR_NONCONVEX // The optimization problem is nonconvex. RES_ERR_NONLINEAR_RANGED ResCode = C.MSK_RES_ERR_NONLINEAR_RANGED // The problem contains a nonlinear constraint with inite lower and upper bound. RES_ERR_CON_Q_NOT_PSD ResCode = C.MSK_RES_ERR_CON_Q_NOT_PSD // The quadratic constraint matrix is not PSD. RES_ERR_CON_Q_NOT_NSD ResCode = C.MSK_RES_ERR_CON_Q_NOT_NSD // The quadratic constraint matrix is not NSD. RES_ERR_OBJ_Q_NOT_PSD ResCode = C.MSK_RES_ERR_OBJ_Q_NOT_PSD // The quadratic coefficient matrix in the objective is not PSD. RES_ERR_OBJ_Q_NOT_NSD ResCode = C.MSK_RES_ERR_OBJ_Q_NOT_NSD // The quadratic coefficient matrix in the objective is not NSD. RES_ERR_ARGUMENT_PERM_ARRAY ResCode = C.MSK_RES_ERR_ARGUMENT_PERM_ARRAY // An invalid permutation array is specified. RES_ERR_CONE_INDEX ResCode = C.MSK_RES_ERR_CONE_INDEX // An index of a non-existing cone has been specified. RES_ERR_CONE_SIZE ResCode = C.MSK_RES_ERR_CONE_SIZE // A cone with incorrect number of members is specified. RES_ERR_CONE_OVERLAP ResCode = C.MSK_RES_ERR_CONE_OVERLAP // One or more of variables in the cone to be added is already member of another cone. RES_ERR_CONE_REP_VAR ResCode = C.MSK_RES_ERR_CONE_REP_VAR // A variable is included multiple times in the cone. RES_ERR_MAXNUMCONE ResCode = C.MSK_RES_ERR_MAXNUMCONE // The value specified for maxnumcone is too small. RES_ERR_CONE_TYPE ResCode = C.MSK_RES_ERR_CONE_TYPE // Invalid cone type specified. RES_ERR_CONE_TYPE_STR ResCode = C.MSK_RES_ERR_CONE_TYPE_STR // Invalid cone type specified. RES_ERR_CONE_OVERLAP_APPEND ResCode = C.MSK_RES_ERR_CONE_OVERLAP_APPEND // The cone to be appended has one variable which is already member of another cone. RES_ERR_REMOVE_CONE_VARIABLE ResCode = C.MSK_RES_ERR_REMOVE_CONE_VARIABLE // A variable cannot be removed because it will make a cone invalid. RES_ERR_APPENDING_TOO_BIG_CONE ResCode = C.MSK_RES_ERR_APPENDING_TOO_BIG_CONE // Trying to append a too big cone. RES_ERR_CONE_PARAMETER ResCode = C.MSK_RES_ERR_CONE_PARAMETER // An invalid cone parameter. RES_ERR_SOL_FILE_INVALID_NUMBER ResCode = C.MSK_RES_ERR_SOL_FILE_INVALID_NUMBER // An invalid number is specified in a solution file. RES_ERR_HUGE_C ResCode = C.MSK_RES_ERR_HUGE_C // A huge value in absolute size is specified for an objective coefficient. RES_ERR_HUGE_AIJ ResCode = C.MSK_RES_ERR_HUGE_AIJ // A numerically huge value is specified for an element in A. RES_ERR_DUPLICATE_AIJ ResCode = C.MSK_RES_ERR_DUPLICATE_AIJ // An element in the A matrix is specified twice. RES_ERR_LOWER_BOUND_IS_A_NAN ResCode = C.MSK_RES_ERR_LOWER_BOUND_IS_A_NAN // The lower bound specified is not a number (nan). RES_ERR_UPPER_BOUND_IS_A_NAN ResCode = C.MSK_RES_ERR_UPPER_BOUND_IS_A_NAN // The upper bound specified is not a number (nan). RES_ERR_INFINITE_BOUND ResCode = C.MSK_RES_ERR_INFINITE_BOUND // A numerically huge bound value is specified. RES_ERR_INV_QOBJ_SUBI ResCode = C.MSK_RES_ERR_INV_QOBJ_SUBI // Invalid value %d at qosubi. RES_ERR_INV_QOBJ_SUBJ ResCode = C.MSK_RES_ERR_INV_QOBJ_SUBJ // Invalid value in qosubj. RES_ERR_INV_QOBJ_VAL ResCode = C.MSK_RES_ERR_INV_QOBJ_VAL // Invalid value in qoval. RES_ERR_INV_QCON_SUBK ResCode = C.MSK_RES_ERR_INV_QCON_SUBK // Invalid value in qcsubk. RES_ERR_INV_QCON_SUBI ResCode = C.MSK_RES_ERR_INV_QCON_SUBI // Invalid value in qcsubi. RES_ERR_INV_QCON_SUBJ ResCode = C.MSK_RES_ERR_INV_QCON_SUBJ // Invalid value in qcsubj. RES_ERR_INV_QCON_VAL ResCode = C.MSK_RES_ERR_INV_QCON_VAL // Invalid value in qcval. RES_ERR_QCON_SUBI_TOO_SMALL ResCode = C.MSK_RES_ERR_QCON_SUBI_TOO_SMALL // Invalid value in qcsubi. RES_ERR_QCON_SUBI_TOO_LARGE ResCode = C.MSK_RES_ERR_QCON_SUBI_TOO_LARGE // Invalid value in qcsubi. RES_ERR_QOBJ_UPPER_TRIANGLE ResCode = C.MSK_RES_ERR_QOBJ_UPPER_TRIANGLE // An element in the upper triangle of the quadratic term in the objective is specified. RES_ERR_QCON_UPPER_TRIANGLE ResCode = C.MSK_RES_ERR_QCON_UPPER_TRIANGLE // An element in the upper triangle of the quadratic term in a constraint. RES_ERR_FIXED_BOUND_VALUES ResCode = C.MSK_RES_ERR_FIXED_BOUND_VALUES // A fixed constraint/variable has been specified using the bound keys but the numerical bounds are different. RES_ERR_TOO_SMALL_A_TRUNCATION_VALUE ResCode = C.MSK_RES_ERR_TOO_SMALL_A_TRUNCATION_VALUE // A too small value for the A trucation value is specified. RES_ERR_INVALID_OBJECTIVE_SENSE ResCode = C.MSK_RES_ERR_INVALID_OBJECTIVE_SENSE // An invalid objective sense is specified. RES_ERR_UNDEFINED_OBJECTIVE_SENSE ResCode = C.MSK_RES_ERR_UNDEFINED_OBJECTIVE_SENSE // The objective sense has not been specified before the optimization. RES_ERR_Y_IS_UNDEFINED ResCode = C.MSK_RES_ERR_Y_IS_UNDEFINED // The solution item y is undefined. RES_ERR_NAN_IN_DOUBLE_DATA ResCode = C.MSK_RES_ERR_NAN_IN_DOUBLE_DATA // An invalid floating value was used in some double data. RES_ERR_INF_IN_DOUBLE_DATA ResCode = C.MSK_RES_ERR_INF_IN_DOUBLE_DATA // An infinite floating value was used in some double data. RES_ERR_NAN_IN_BLC ResCode = C.MSK_RES_ERR_NAN_IN_BLC // blc contains an invalid floating point value, i.e. a NaN. RES_ERR_NAN_IN_BUC ResCode = C.MSK_RES_ERR_NAN_IN_BUC // buc contains an invalid floating point value, i.e. a NaN. RES_ERR_INVALID_CFIX ResCode = C.MSK_RES_ERR_INVALID_CFIX // An invalid fixed term in the objective is speficied. RES_ERR_NAN_IN_C ResCode = C.MSK_RES_ERR_NAN_IN_C // c contains an invalid floating point value, i.e. a NaN. RES_ERR_NAN_IN_BLX ResCode = C.MSK_RES_ERR_NAN_IN_BLX // blx contains an invalid floating point value, i.e. a NaN. RES_ERR_NAN_IN_BUX ResCode = C.MSK_RES_ERR_NAN_IN_BUX // bux contains an invalid floating point value, i.e. a NaN. RES_ERR_INVALID_AIJ ResCode = C.MSK_RES_ERR_INVALID_AIJ // a\[i,j\] contains an invalid floating point value, i.e. a NaN or an infinite value. RES_ERR_INVALID_CJ ResCode = C.MSK_RES_ERR_INVALID_CJ // c\[j\] contains an invalid floating point value, i.e. a NaN or an infinite value. RES_ERR_SYM_MAT_INVALID ResCode = C.MSK_RES_ERR_SYM_MAT_INVALID // A symmetric matrix contains an invalid floating point value, i.e. a NaN or an infinite value. RES_ERR_SYM_MAT_HUGE ResCode = C.MSK_RES_ERR_SYM_MAT_HUGE // A numerically huge value is specified for an element in E. RES_ERR_INV_PROBLEM ResCode = C.MSK_RES_ERR_INV_PROBLEM // Invalid problem type. RES_ERR_MIXED_CONIC_AND_NL ResCode = C.MSK_RES_ERR_MIXED_CONIC_AND_NL // The problem contains both conic and nonlinear constraints. RES_ERR_GLOBAL_INV_CONIC_PROBLEM ResCode = C.MSK_RES_ERR_GLOBAL_INV_CONIC_PROBLEM // The global optimizer can only be applied to problems without semidefinite variables. RES_ERR_INV_OPTIMIZER ResCode = C.MSK_RES_ERR_INV_OPTIMIZER // An invalid optimizer has been chosen for the problem. RES_ERR_MIO_NO_OPTIMIZER ResCode = C.MSK_RES_ERR_MIO_NO_OPTIMIZER // No optimizer is available for the current class of integer optimization problems. RES_ERR_NO_OPTIMIZER_VAR_TYPE ResCode = C.MSK_RES_ERR_NO_OPTIMIZER_VAR_TYPE // No optimizer is available for this class of optimization problems. RES_ERR_FINAL_SOLUTION ResCode = C.MSK_RES_ERR_FINAL_SOLUTION // An error occurred during the solution finalization. RES_ERR_FIRST ResCode = C.MSK_RES_ERR_FIRST // Invalid first. RES_ERR_LAST ResCode = C.MSK_RES_ERR_LAST // Invalid last. RES_ERR_SLICE_SIZE ResCode = C.MSK_RES_ERR_SLICE_SIZE // Invalid slice size specified. RES_ERR_NEGATIVE_SURPLUS ResCode = C.MSK_RES_ERR_NEGATIVE_SURPLUS // Negative surplus. RES_ERR_NEGATIVE_APPEND ResCode = C.MSK_RES_ERR_NEGATIVE_APPEND // Cannot append a negative number. RES_ERR_POSTSOLVE ResCode = C.MSK_RES_ERR_POSTSOLVE // An error occurred during the postsolve. RES_ERR_OVERFLOW ResCode = C.MSK_RES_ERR_OVERFLOW // A computation produced an overflow. RES_ERR_NO_BASIS_SOL ResCode = C.MSK_RES_ERR_NO_BASIS_SOL // No basic solution is defined. RES_ERR_BASIS_FACTOR ResCode = C.MSK_RES_ERR_BASIS_FACTOR // The factorization of the basis is invalid. RES_ERR_BASIS_SINGULAR ResCode = C.MSK_RES_ERR_BASIS_SINGULAR // The basis is singular. RES_ERR_FACTOR ResCode = C.MSK_RES_ERR_FACTOR // An error occurred while factorizing a matrix. RES_ERR_FEASREPAIR_CANNOT_RELAX ResCode = C.MSK_RES_ERR_FEASREPAIR_CANNOT_RELAX // An optimization problem cannot be relaxed. RES_ERR_FEASREPAIR_SOLVING_RELAXED ResCode = C.MSK_RES_ERR_FEASREPAIR_SOLVING_RELAXED // The relaxed problem could not be solved to optimality. RES_ERR_FEASREPAIR_INCONSISTENT_BOUND ResCode = C.MSK_RES_ERR_FEASREPAIR_INCONSISTENT_BOUND // The upper bound is less than the lower bound for a variable or a constraint. RES_ERR_REPAIR_INVALID_PROBLEM ResCode = C.MSK_RES_ERR_REPAIR_INVALID_PROBLEM // The feasibility repair does not support the specified problem type. RES_ERR_REPAIR_OPTIMIZATION_FAILED ResCode = C.MSK_RES_ERR_REPAIR_OPTIMIZATION_FAILED // Computation the optimal relaxation failed. RES_ERR_NAME_MAX_LEN ResCode = C.MSK_RES_ERR_NAME_MAX_LEN // A name is longer than the buffer that is supposed to hold it. RES_ERR_NAME_IS_NULL ResCode = C.MSK_RES_ERR_NAME_IS_NULL // The name buffer is a null pointer. RES_ERR_INVALID_COMPRESSION ResCode = C.MSK_RES_ERR_INVALID_COMPRESSION // Invalid compression type. RES_ERR_INVALID_IOMODE ResCode = C.MSK_RES_ERR_INVALID_IOMODE // Invalid io mode. RES_ERR_NO_PRIMAL_INFEAS_CER ResCode = C.MSK_RES_ERR_NO_PRIMAL_INFEAS_CER // A certificate of primal infeasibility is not available. RES_ERR_NO_DUAL_INFEAS_CER ResCode = C.MSK_RES_ERR_NO_DUAL_INFEAS_CER // A certificate of dual infeasibility is not available. RES_ERR_NO_SOLUTION_IN_CALLBACK ResCode = C.MSK_RES_ERR_NO_SOLUTION_IN_CALLBACK // The required solution is not available. RES_ERR_INV_MARKI ResCode = C.MSK_RES_ERR_INV_MARKI // Invalid value in marki. RES_ERR_INV_MARKJ ResCode = C.MSK_RES_ERR_INV_MARKJ // Invalid value in markj. RES_ERR_INV_NUMI ResCode = C.MSK_RES_ERR_INV_NUMI // Invalid numi. RES_ERR_INV_NUMJ ResCode = C.MSK_RES_ERR_INV_NUMJ // Invalid numj. RES_ERR_TASK_INCOMPATIBLE ResCode = C.MSK_RES_ERR_TASK_INCOMPATIBLE // The Task file is incompatible with this platform. RES_ERR_TASK_INVALID ResCode = C.MSK_RES_ERR_TASK_INVALID // The Task file is invalid. RES_ERR_TASK_WRITE ResCode = C.MSK_RES_ERR_TASK_WRITE // Failed to write the task file. RES_ERR_LU_MAX_NUM_TRIES ResCode = C.MSK_RES_ERR_LU_MAX_NUM_TRIES // Could not compute the LU factors of the matrix within the maximum number of allowed tries. RES_ERR_INVALID_UTF8 ResCode = C.MSK_RES_ERR_INVALID_UTF8 // An invalid UTF8 string is encountered. RES_ERR_INVALID_WCHAR ResCode = C.MSK_RES_ERR_INVALID_WCHAR // An invalid wchar string is encountered. RES_ERR_NO_DUAL_FOR_ITG_SOL ResCode = C.MSK_RES_ERR_NO_DUAL_FOR_ITG_SOL // No dual information is available for the integer solution. RES_ERR_NO_SNX_FOR_BAS_SOL ResCode = C.MSK_RES_ERR_NO_SNX_FOR_BAS_SOL // snx is not available for the basis solution. RES_ERR_INTERNAL ResCode = C.MSK_RES_ERR_INTERNAL // An internal error occurred. RES_ERR_API_ARRAY_TOO_SMALL ResCode = C.MSK_RES_ERR_API_ARRAY_TOO_SMALL // An input array was too short. RES_ERR_API_CB_CONNECT ResCode = C.MSK_RES_ERR_API_CB_CONNECT // Failed to connect a callback object. RES_ERR_API_FATAL_ERROR ResCode = C.MSK_RES_ERR_API_FATAL_ERROR // An internal error occurred in the API. Please report this problem. RES_ERR_SEN_FORMAT ResCode = C.MSK_RES_ERR_SEN_FORMAT // Syntax error in sensitivity analysis file. RES_ERR_SEN_UNDEF_NAME ResCode = C.MSK_RES_ERR_SEN_UNDEF_NAME // An undefined name was encountered in the sensitivity analysis file. RES_ERR_SEN_INDEX_RANGE ResCode = C.MSK_RES_ERR_SEN_INDEX_RANGE // Index out of range in the sensitivity analysis file. RES_ERR_SEN_BOUND_INVALID_UP ResCode = C.MSK_RES_ERR_SEN_BOUND_INVALID_UP // Analysis of upper bound requested for an index, where no upper bound exists. RES_ERR_SEN_BOUND_INVALID_LO ResCode = C.MSK_RES_ERR_SEN_BOUND_INVALID_LO // Analysis of lower bound requested for an index, where no lower bound exists. RES_ERR_SEN_INDEX_INVALID ResCode = C.MSK_RES_ERR_SEN_INDEX_INVALID // Invalid range given in the sensitivity file. RES_ERR_SEN_INVALID_REGEXP ResCode = C.MSK_RES_ERR_SEN_INVALID_REGEXP // Syntax error in regexp or regexp longer than 1024. RES_ERR_SEN_SOLUTION_STATUS ResCode = C.MSK_RES_ERR_SEN_SOLUTION_STATUS // No optimal solution found to the original problem given for sensitivity analysis. RES_ERR_SEN_NUMERICAL ResCode = C.MSK_RES_ERR_SEN_NUMERICAL // Numerical difficulties encountered performing the sensitivity analysis. RES_ERR_SEN_UNHANDLED_PROBLEM_TYPE ResCode = C.MSK_RES_ERR_SEN_UNHANDLED_PROBLEM_TYPE // Sensitivity analysis cannot be performed for the specified problem. RES_ERR_UNB_STEP_SIZE ResCode = C.MSK_RES_ERR_UNB_STEP_SIZE // A step-size in an optimizer was unexpectedly unbounded. RES_ERR_IDENTICAL_TASKS ResCode = C.MSK_RES_ERR_IDENTICAL_TASKS // Some tasks related to this function call were identical. Unique tasks were expected. RES_ERR_AD_INVALID_CODELIST ResCode = C.MSK_RES_ERR_AD_INVALID_CODELIST // The code list data was invalid. RES_ERR_INTERNAL_TEST_FAILED ResCode = C.MSK_RES_ERR_INTERNAL_TEST_FAILED // An internal unit test function failed. RES_ERR_XML_INVALID_PROBLEM_TYPE ResCode = C.MSK_RES_ERR_XML_INVALID_PROBLEM_TYPE // The problem type is not supported by the XML format. RES_ERR_INVALID_AMPL_STUB ResCode = C.MSK_RES_ERR_INVALID_AMPL_STUB // Invalid AMPL stub. RES_ERR_INT64_TO_INT32_CAST ResCode = C.MSK_RES_ERR_INT64_TO_INT32_CAST // A 64 bit integer could not be cast to a 32 bit integer. RES_ERR_SIZE_LICENSE_NUMCORES ResCode = C.MSK_RES_ERR_SIZE_LICENSE_NUMCORES // The computer contains more cpu cores than the license allows for. RES_ERR_INFEAS_UNDEFINED ResCode = C.MSK_RES_ERR_INFEAS_UNDEFINED // The requested value is not defined for this solution type. RES_ERR_NO_BARX_FOR_SOLUTION ResCode = C.MSK_RES_ERR_NO_BARX_FOR_SOLUTION // There is no barx available for the solution specified. RES_ERR_NO_BARS_FOR_SOLUTION ResCode = C.MSK_RES_ERR_NO_BARS_FOR_SOLUTION // There is no bars available for the solution specified. RES_ERR_BAR_VAR_DIM ResCode = C.MSK_RES_ERR_BAR_VAR_DIM // The dimension of a symmetric matrix variable has to be greater than 0. RES_ERR_SYM_MAT_INVALID_ROW_INDEX ResCode = C.MSK_RES_ERR_SYM_MAT_INVALID_ROW_INDEX // A row index specified for sparse symmetric matrix is invalid. RES_ERR_SYM_MAT_INVALID_COL_INDEX ResCode = C.MSK_RES_ERR_SYM_MAT_INVALID_COL_INDEX // A column index specified for sparse symmetric matrix is invalid. RES_ERR_SYM_MAT_NOT_LOWER_TRINGULAR ResCode = C.MSK_RES_ERR_SYM_MAT_NOT_LOWER_TRINGULAR // Only the lower triangular part of sparse symmetric matrix should be specified. RES_ERR_SYM_MAT_INVALID_VALUE ResCode = C.MSK_RES_ERR_SYM_MAT_INVALID_VALUE // The numerical value specified in a sparse symmetric matrix is not a floating point value. RES_ERR_SYM_MAT_DUPLICATE ResCode = C.MSK_RES_ERR_SYM_MAT_DUPLICATE // A value in a symmetric matric as been specified more than once. RES_ERR_INVALID_SYM_MAT_DIM ResCode = C.MSK_RES_ERR_INVALID_SYM_MAT_DIM // A sparse symmetric matrix of invalid dimension is specified. RES_ERR_API_INTERNAL ResCode = C.MSK_RES_ERR_API_INTERNAL // An internal fatal error occurred in an interface function. RES_ERR_INVALID_FILE_FORMAT_FOR_SYM_MAT ResCode = C.MSK_RES_ERR_INVALID_FILE_FORMAT_FOR_SYM_MAT // The file format does not support a problem with symmetric matrix variables. RES_ERR_INVALID_FILE_FORMAT_FOR_CFIX ResCode = C.MSK_RES_ERR_INVALID_FILE_FORMAT_FOR_CFIX // The file format does not support a problem with nonzero fixed term in c. RES_ERR_INVALID_FILE_FORMAT_FOR_RANGED_CONSTRAINTS ResCode = C.MSK_RES_ERR_INVALID_FILE_FORMAT_FOR_RANGED_CONSTRAINTS // The file format does not support a problem with ranged constraints. RES_ERR_INVALID_FILE_FORMAT_FOR_FREE_CONSTRAINTS ResCode = C.MSK_RES_ERR_INVALID_FILE_FORMAT_FOR_FREE_CONSTRAINTS // The file format does not support a problem with free constraints. RES_ERR_INVALID_FILE_FORMAT_FOR_CONES ResCode = C.MSK_RES_ERR_INVALID_FILE_FORMAT_FOR_CONES // The file format does not support a problem with the simple cones (deprecated). RES_ERR_INVALID_FILE_FORMAT_FOR_QUADRATIC_TERMS ResCode = C.MSK_RES_ERR_INVALID_FILE_FORMAT_FOR_QUADRATIC_TERMS // The file format does not support a problem with quadratic terms. RES_ERR_INVALID_FILE_FORMAT_FOR_NONLINEAR ResCode = C.MSK_RES_ERR_INVALID_FILE_FORMAT_FOR_NONLINEAR // The file format does not support a problem with nonlinear terms. RES_ERR_INVALID_FILE_FORMAT_FOR_DISJUNCTIVE_CONSTRAINTS ResCode = C.MSK_RES_ERR_INVALID_FILE_FORMAT_FOR_DISJUNCTIVE_CONSTRAINTS // The file format does not support a problem with disjunctive constraints. RES_ERR_INVALID_FILE_FORMAT_FOR_AFFINE_CONIC_CONSTRAINTS ResCode = C.MSK_RES_ERR_INVALID_FILE_FORMAT_FOR_AFFINE_CONIC_CONSTRAINTS // The file format does not support a problem with affine conic constraints. RES_ERR_DUPLICATE_CONSTRAINT_NAMES ResCode = C.MSK_RES_ERR_DUPLICATE_CONSTRAINT_NAMES // Two constraint names are identical. RES_ERR_DUPLICATE_VARIABLE_NAMES ResCode = C.MSK_RES_ERR_DUPLICATE_VARIABLE_NAMES // Two variable names are identical. RES_ERR_DUPLICATE_BARVARIABLE_NAMES ResCode = C.MSK_RES_ERR_DUPLICATE_BARVARIABLE_NAMES // Two barvariable names are identical. RES_ERR_DUPLICATE_CONE_NAMES ResCode = C.MSK_RES_ERR_DUPLICATE_CONE_NAMES // Two cone names are identical. RES_ERR_DUPLICATE_DOMAIN_NAMES ResCode = C.MSK_RES_ERR_DUPLICATE_DOMAIN_NAMES // Two domain names are identical. RES_ERR_DUPLICATE_DJC_NAMES ResCode = C.MSK_RES_ERR_DUPLICATE_DJC_NAMES // Two disjunctive constraint names are identical. RES_ERR_NON_UNIQUE_ARRAY ResCode = C.MSK_RES_ERR_NON_UNIQUE_ARRAY // An array does not contain unique elements. RES_ERR_ARGUMENT_IS_TOO_SMALL ResCode = C.MSK_RES_ERR_ARGUMENT_IS_TOO_SMALL // The value of a function argument is too small. RES_ERR_ARGUMENT_IS_TOO_LARGE ResCode = C.MSK_RES_ERR_ARGUMENT_IS_TOO_LARGE // The value of a function argument is too large. RES_ERR_MIO_INTERNAL ResCode = C.MSK_RES_ERR_MIO_INTERNAL // A fatal error occurred in the mixed integer optimizer. Please contact MOSEK support. RES_ERR_INVALID_PROBLEM_TYPE ResCode = C.MSK_RES_ERR_INVALID_PROBLEM_TYPE // An invalid problem type. RES_ERR_UNHANDLED_SOLUTION_STATUS ResCode = C.MSK_RES_ERR_UNHANDLED_SOLUTION_STATUS // Unhandled solution status. RES_ERR_UPPER_TRIANGLE ResCode = C.MSK_RES_ERR_UPPER_TRIANGLE // An element in the upper triangle of a lower triangular matrix is specified. RES_ERR_LAU_SINGULAR_MATRIX ResCode = C.MSK_RES_ERR_LAU_SINGULAR_MATRIX // A matrix is singular. RES_ERR_LAU_NOT_POSITIVE_DEFINITE ResCode = C.MSK_RES_ERR_LAU_NOT_POSITIVE_DEFINITE // A matrix is not positive definite. RES_ERR_LAU_INVALID_LOWER_TRIANGULAR_MATRIX ResCode = C.MSK_RES_ERR_LAU_INVALID_LOWER_TRIANGULAR_MATRIX // An invalid lower triangular matrix. RES_ERR_LAU_UNKNOWN ResCode = C.MSK_RES_ERR_LAU_UNKNOWN // An unknown error. RES_ERR_LAU_ARG_M ResCode = C.MSK_RES_ERR_LAU_ARG_M // Invalid argument m. RES_ERR_LAU_ARG_N ResCode = C.MSK_RES_ERR_LAU_ARG_N // Invalid argument n. RES_ERR_LAU_ARG_K ResCode = C.MSK_RES_ERR_LAU_ARG_K // Invalid argument k. RES_ERR_LAU_ARG_TRANSA ResCode = C.MSK_RES_ERR_LAU_ARG_TRANSA // Invalid argument transa. RES_ERR_LAU_ARG_TRANSB ResCode = C.MSK_RES_ERR_LAU_ARG_TRANSB // Invalid argument transb. RES_ERR_LAU_ARG_UPLO ResCode = C.MSK_RES_ERR_LAU_ARG_UPLO // Invalid argument uplo. RES_ERR_LAU_ARG_TRANS ResCode = C.MSK_RES_ERR_LAU_ARG_TRANS // Invalid argument trans. RES_ERR_LAU_INVALID_SPARSE_SYMMETRIC_MATRIX ResCode = C.MSK_RES_ERR_LAU_INVALID_SPARSE_SYMMETRIC_MATRIX // An invalid sparse symmetric matrix is specfified. RES_ERR_CBF_PARSE ResCode = C.MSK_RES_ERR_CBF_PARSE // An error occurred while parsing an CBF file. RES_ERR_CBF_OBJ_SENSE ResCode = C.MSK_RES_ERR_CBF_OBJ_SENSE // An invalid objective sense is specified. RES_ERR_CBF_NO_VARIABLES ResCode = C.MSK_RES_ERR_CBF_NO_VARIABLES // An invalid objective sense is specified. RES_ERR_CBF_TOO_MANY_CONSTRAINTS ResCode = C.MSK_RES_ERR_CBF_TOO_MANY_CONSTRAINTS // Too many constraints specified. RES_ERR_CBF_TOO_MANY_VARIABLES ResCode = C.MSK_RES_ERR_CBF_TOO_MANY_VARIABLES // Too many variables specified. RES_ERR_CBF_NO_VERSION_SPECIFIED ResCode = C.MSK_RES_ERR_CBF_NO_VERSION_SPECIFIED // No version specified. RES_ERR_CBF_SYNTAX ResCode = C.MSK_RES_ERR_CBF_SYNTAX // Invalid syntax. RES_ERR_CBF_DUPLICATE_OBJ ResCode = C.MSK_RES_ERR_CBF_DUPLICATE_OBJ // Duplicate OBJ keyword. RES_ERR_CBF_DUPLICATE_CON ResCode = C.MSK_RES_ERR_CBF_DUPLICATE_CON // Duplicate CON keyword. RES_ERR_CBF_DUPLICATE_VAR ResCode = C.MSK_RES_ERR_CBF_DUPLICATE_VAR // Duplicate VAR keyword. RES_ERR_CBF_DUPLICATE_INT ResCode = C.MSK_RES_ERR_CBF_DUPLICATE_INT // Duplicate INT keyword. RES_ERR_CBF_INVALID_VAR_TYPE ResCode = C.MSK_RES_ERR_CBF_INVALID_VAR_TYPE // Invalid variable type. RES_ERR_CBF_INVALID_CON_TYPE ResCode = C.MSK_RES_ERR_CBF_INVALID_CON_TYPE // Invalid constraint type. RES_ERR_CBF_INVALID_DOMAIN_DIMENSION ResCode = C.MSK_RES_ERR_CBF_INVALID_DOMAIN_DIMENSION // Invalid domain dimension. RES_ERR_CBF_DUPLICATE_OBJACOORD ResCode = C.MSK_RES_ERR_CBF_DUPLICATE_OBJACOORD // Duplicate index in OBJCOORD. RES_ERR_CBF_DUPLICATE_BCOORD ResCode = C.MSK_RES_ERR_CBF_DUPLICATE_BCOORD // Duplicate index in BCOORD. RES_ERR_CBF_DUPLICATE_ACOORD ResCode = C.MSK_RES_ERR_CBF_DUPLICATE_ACOORD // Duplicate index in ACOORD. RES_ERR_CBF_TOO_FEW_VARIABLES ResCode = C.MSK_RES_ERR_CBF_TOO_FEW_VARIABLES // Too few variables defined. RES_ERR_CBF_TOO_FEW_CONSTRAINTS ResCode = C.MSK_RES_ERR_CBF_TOO_FEW_CONSTRAINTS // Too few constraints defined. RES_ERR_CBF_TOO_FEW_INTS ResCode = C.MSK_RES_ERR_CBF_TOO_FEW_INTS // Too ints specified. RES_ERR_CBF_TOO_MANY_INTS ResCode = C.MSK_RES_ERR_CBF_TOO_MANY_INTS // Too ints specified. RES_ERR_CBF_INVALID_INT_INDEX ResCode = C.MSK_RES_ERR_CBF_INVALID_INT_INDEX // Invalid INT index. RES_ERR_CBF_UNSUPPORTED ResCode = C.MSK_RES_ERR_CBF_UNSUPPORTED // Unsupported feature is present. RES_ERR_CBF_DUPLICATE_PSDVAR ResCode = C.MSK_RES_ERR_CBF_DUPLICATE_PSDVAR // Duplicate PSDVAR keyword. RES_ERR_CBF_INVALID_PSDVAR_DIMENSION ResCode = C.MSK_RES_ERR_CBF_INVALID_PSDVAR_DIMENSION // Invalid PSDVAR dimension. RES_ERR_CBF_TOO_FEW_PSDVAR ResCode = C.MSK_RES_ERR_CBF_TOO_FEW_PSDVAR // Too few variables defined. RES_ERR_CBF_INVALID_EXP_DIMENSION ResCode = C.MSK_RES_ERR_CBF_INVALID_EXP_DIMENSION // Invalid dimension of a exponential cone. RES_ERR_CBF_DUPLICATE_POW_CONES ResCode = C.MSK_RES_ERR_CBF_DUPLICATE_POW_CONES // Multiple POWCONES specified. RES_ERR_CBF_DUPLICATE_POW_STAR_CONES ResCode = C.MSK_RES_ERR_CBF_DUPLICATE_POW_STAR_CONES // Multiple POW*CONES specified. RES_ERR_CBF_INVALID_POWER ResCode = C.MSK_RES_ERR_CBF_INVALID_POWER // Invalid power specified. RES_ERR_CBF_POWER_CONE_IS_TOO_LONG ResCode = C.MSK_RES_ERR_CBF_POWER_CONE_IS_TOO_LONG // Power cone is too long. RES_ERR_CBF_INVALID_POWER_CONE_INDEX ResCode = C.MSK_RES_ERR_CBF_INVALID_POWER_CONE_INDEX // Invalid power cone index. RES_ERR_CBF_INVALID_POWER_STAR_CONE_INDEX ResCode = C.MSK_RES_ERR_CBF_INVALID_POWER_STAR_CONE_INDEX // Invalid power star cone index. RES_ERR_CBF_UNHANDLED_POWER_CONE_TYPE ResCode = C.MSK_RES_ERR_CBF_UNHANDLED_POWER_CONE_TYPE // An unhandled power cone type. RES_ERR_CBF_UNHANDLED_POWER_STAR_CONE_TYPE ResCode = C.MSK_RES_ERR_CBF_UNHANDLED_POWER_STAR_CONE_TYPE // An unhandled power star cone type. RES_ERR_CBF_POWER_CONE_MISMATCH ResCode = C.MSK_RES_ERR_CBF_POWER_CONE_MISMATCH // The power cone does not match with it definition. RES_ERR_CBF_POWER_STAR_CONE_MISMATCH ResCode = C.MSK_RES_ERR_CBF_POWER_STAR_CONE_MISMATCH // The power star cone does not match with it definition. RES_ERR_CBF_INVALID_NUMBER_OF_CONES ResCode = C.MSK_RES_ERR_CBF_INVALID_NUMBER_OF_CONES // Invalid number of cones. RES_ERR_CBF_INVALID_DIMENSION_OF_CONES ResCode = C.MSK_RES_ERR_CBF_INVALID_DIMENSION_OF_CONES // Invalid number of cones. RES_ERR_CBF_INVALID_NUM_OBJACOORD ResCode = C.MSK_RES_ERR_CBF_INVALID_NUM_OBJACOORD // Invalid number of OBJACOORD. RES_ERR_CBF_INVALID_NUM_OBJFCOORD ResCode = C.MSK_RES_ERR_CBF_INVALID_NUM_OBJFCOORD // Invalid number of OBJFCOORD. RES_ERR_CBF_INVALID_NUM_ACOORD ResCode = C.MSK_RES_ERR_CBF_INVALID_NUM_ACOORD // Invalid number of ACOORD. RES_ERR_CBF_INVALID_NUM_BCOORD ResCode = C.MSK_RES_ERR_CBF_INVALID_NUM_BCOORD // Invalid number of BCOORD. RES_ERR_CBF_INVALID_NUM_FCOORD ResCode = C.MSK_RES_ERR_CBF_INVALID_NUM_FCOORD // Invalid number of FCOORD. RES_ERR_CBF_INVALID_NUM_HCOORD ResCode = C.MSK_RES_ERR_CBF_INVALID_NUM_HCOORD // Invalid number of HCOORD. RES_ERR_CBF_INVALID_NUM_DCOORD ResCode = C.MSK_RES_ERR_CBF_INVALID_NUM_DCOORD // Invalid number of DCOORD. RES_ERR_CBF_EXPECTED_A_KEYWORD ResCode = C.MSK_RES_ERR_CBF_EXPECTED_A_KEYWORD // Expected a key word. RES_ERR_CBF_INVALID_NUM_PSDCON ResCode = C.MSK_RES_ERR_CBF_INVALID_NUM_PSDCON // Invalid number of PSDCON. RES_ERR_CBF_DUPLICATE_PSDCON ResCode = C.MSK_RES_ERR_CBF_DUPLICATE_PSDCON // Duplicate CON keyword. RES_ERR_CBF_INVALID_DIMENSION_OF_PSDCON ResCode = C.MSK_RES_ERR_CBF_INVALID_DIMENSION_OF_PSDCON // Invalid PSDCON dimension. RES_ERR_CBF_INVALID_PSDCON_INDEX ResCode = C.MSK_RES_ERR_CBF_INVALID_PSDCON_INDEX // Invalid PSDCON index. RES_ERR_CBF_INVALID_PSDCON_VARIABLE_INDEX ResCode = C.MSK_RES_ERR_CBF_INVALID_PSDCON_VARIABLE_INDEX // Invalid PSDCON index. RES_ERR_CBF_INVALID_PSDCON_BLOCK_INDEX ResCode = C.MSK_RES_ERR_CBF_INVALID_PSDCON_BLOCK_INDEX // Invalid PSDCON index. RES_ERR_CBF_UNSUPPORTED_CHANGE ResCode = C.MSK_RES_ERR_CBF_UNSUPPORTED_CHANGE // The CHANGE section is not supported. RES_ERR_MIO_INVALID_ROOT_OPTIMIZER ResCode = C.MSK_RES_ERR_MIO_INVALID_ROOT_OPTIMIZER // An invalid root optimizer was selected for the problem type. RES_ERR_MIO_INVALID_NODE_OPTIMIZER ResCode = C.MSK_RES_ERR_MIO_INVALID_NODE_OPTIMIZER // An invalid node optimizer was selected for the problem type. RES_ERR_MPS_WRITE_CPLEX_INVALID_CONE_TYPE ResCode = C.MSK_RES_ERR_MPS_WRITE_CPLEX_INVALID_CONE_TYPE // An invalid cone type occurs when writing a CPLEX formatted MPS file. RES_ERR_TOCONIC_CONSTR_Q_NOT_PSD ResCode = C.MSK_RES_ERR_TOCONIC_CONSTR_Q_NOT_PSD // The matrix defining the quadratric part of constraint is not positive semidefinite. RES_ERR_TOCONIC_CONSTRAINT_FX ResCode = C.MSK_RES_ERR_TOCONIC_CONSTRAINT_FX // The quadratic constraint is an equality, thus not convex. RES_ERR_TOCONIC_CONSTRAINT_RA ResCode = C.MSK_RES_ERR_TOCONIC_CONSTRAINT_RA // The quadratic constraint has finite lower and upper bound, and therefore it is not convex. RES_ERR_TOCONIC_CONSTR_NOT_CONIC ResCode = C.MSK_RES_ERR_TOCONIC_CONSTR_NOT_CONIC // The constraint is not conic representable. RES_ERR_TOCONIC_OBJECTIVE_NOT_PSD ResCode = C.MSK_RES_ERR_TOCONIC_OBJECTIVE_NOT_PSD // The matrix defining the quadratric part of the objective function is not positive semidefinite. RES_ERR_SERVER_CONNECT ResCode = C.MSK_RES_ERR_SERVER_CONNECT // Failed to connect to remote solver server. RES_ERR_SERVER_PROTOCOL ResCode = C.MSK_RES_ERR_SERVER_PROTOCOL // Unexpected message or data from solver server. RES_ERR_SERVER_STATUS ResCode = C.MSK_RES_ERR_SERVER_STATUS // Server returned non-ok status code RES_ERR_SERVER_TOKEN ResCode = C.MSK_RES_ERR_SERVER_TOKEN // Invalid job ID RES_ERR_SERVER_ADDRESS ResCode = C.MSK_RES_ERR_SERVER_ADDRESS // Invalid address RES_ERR_SERVER_CERTIFICATE ResCode = C.MSK_RES_ERR_SERVER_CERTIFICATE // Invalid TLS certificate format or path RES_ERR_SERVER_TLS_CLIENT ResCode = C.MSK_RES_ERR_SERVER_TLS_CLIENT // Failed to create TLS client RES_ERR_SERVER_ACCESS_TOKEN ResCode = C.MSK_RES_ERR_SERVER_ACCESS_TOKEN // Invalid access token RES_ERR_SERVER_PROBLEM_SIZE ResCode = C.MSK_RES_ERR_SERVER_PROBLEM_SIZE // The problem is too large. RES_ERR_DUPLICATE_INDEX_IN_A_SPARSE_MATRIX ResCode = C.MSK_RES_ERR_DUPLICATE_INDEX_IN_A_SPARSE_MATRIX // An element in a sparse matrix is specified twice. RES_ERR_DUPLICATE_INDEX_IN_AFEIDX_LIST ResCode = C.MSK_RES_ERR_DUPLICATE_INDEX_IN_AFEIDX_LIST // An index is specified twice in an affine expression list. RES_ERR_DUPLICATE_FIJ ResCode = C.MSK_RES_ERR_DUPLICATE_FIJ // An element in the F matrix is specified twice. RES_ERR_INVALID_FIJ ResCode = C.MSK_RES_ERR_INVALID_FIJ // f\[i,j\] contains an invalid floating point value, i.e. a NaN or an infinite value. RES_ERR_HUGE_FIJ ResCode = C.MSK_RES_ERR_HUGE_FIJ // A numerically huge value is specified for an element in F. RES_ERR_INVALID_G ResCode = C.MSK_RES_ERR_INVALID_G // g contains an invalid floating point value, i.e. a NaN or an infinite value. RES_ERR_INVALID_B ResCode = C.MSK_RES_ERR_INVALID_B // b contains an invalid floating point value, i.e. a NaN or an infinite value. RES_ERR_DOMAIN_INVALID_INDEX ResCode = C.MSK_RES_ERR_DOMAIN_INVALID_INDEX // A domain index is invalid. RES_ERR_DOMAIN_DIMENSION ResCode = C.MSK_RES_ERR_DOMAIN_DIMENSION // A domain dimension is invalid. RES_ERR_DOMAIN_DIMENSION_PSD ResCode = C.MSK_RES_ERR_DOMAIN_DIMENSION_PSD // A PSD domain dimension is invalid. RES_ERR_NOT_POWER_DOMAIN ResCode = C.MSK_RES_ERR_NOT_POWER_DOMAIN // The function is only applicable to primal and dual power cone domains. RES_ERR_DOMAIN_POWER_INVALID_ALPHA ResCode = C.MSK_RES_ERR_DOMAIN_POWER_INVALID_ALPHA // Alpha contains an invalid floating point value, i.e. a NaN or an infinite value. RES_ERR_DOMAIN_POWER_NEGATIVE_ALPHA ResCode = C.MSK_RES_ERR_DOMAIN_POWER_NEGATIVE_ALPHA // Alpha contains a negative value or zero. RES_ERR_DOMAIN_POWER_NLEFT ResCode = C.MSK_RES_ERR_DOMAIN_POWER_NLEFT // The value of nleft is too small or too large. RES_ERR_AFE_INVALID_INDEX ResCode = C.MSK_RES_ERR_AFE_INVALID_INDEX // An affine expression index is invalid. RES_ERR_ACC_INVALID_INDEX ResCode = C.MSK_RES_ERR_ACC_INVALID_INDEX // A affine conic constraint index is invalid. RES_ERR_ACC_INVALID_ENTRY_INDEX ResCode = C.MSK_RES_ERR_ACC_INVALID_ENTRY_INDEX // The index of an element in an affine conic constraint is invalid. RES_ERR_ACC_AFE_DOMAIN_MISMATCH ResCode = C.MSK_RES_ERR_ACC_AFE_DOMAIN_MISMATCH // There is a mismatch between between the number of affine expressions and total dimension of the domain(s). RES_ERR_DJC_INVALID_INDEX ResCode = C.MSK_RES_ERR_DJC_INVALID_INDEX // A disjunctive constraint index is invalid. RES_ERR_DJC_UNSUPPORTED_DOMAIN_TYPE ResCode = C.MSK_RES_ERR_DJC_UNSUPPORTED_DOMAIN_TYPE // An unsupported domain type has been used in a disjunctive constraint. RES_ERR_DJC_AFE_DOMAIN_MISMATCH ResCode = C.MSK_RES_ERR_DJC_AFE_DOMAIN_MISMATCH // There is a mismatch between the number of affine expressions and total dimension of the domain(s). RES_ERR_DJC_INVALID_TERM_SIZE ResCode = C.MSK_RES_ERR_DJC_INVALID_TERM_SIZE // A termize is invalid. RES_ERR_DJC_DOMAIN_TERMSIZE_MISMATCH ResCode = C.MSK_RES_ERR_DJC_DOMAIN_TERMSIZE_MISMATCH // There is a mismatch between the number of domains and the term sizes. RES_ERR_DJC_TOTAL_NUM_TERMS_MISMATCH ResCode = C.MSK_RES_ERR_DJC_TOTAL_NUM_TERMS_MISMATCH // There total number of terms in all domains does not match. RES_ERR_UNDEF_SOLUTION ResCode = C.MSK_RES_ERR_UNDEF_SOLUTION // The required solution is not defined. RES_ERR_NO_DOTY ResCode = C.MSK_RES_ERR_NO_DOTY // No doty is available. RES_TRM_MAX_ITERATIONS ResCode = C.MSK_RES_TRM_MAX_ITERATIONS // The optimizer terminated at the maximum number of iterations. RES_TRM_MAX_TIME ResCode = C.MSK_RES_TRM_MAX_TIME // The optimizer terminated at the maximum amount of time. RES_TRM_OBJECTIVE_RANGE ResCode = C.MSK_RES_TRM_OBJECTIVE_RANGE // The optimizer terminated with an objective value outside the objective range. RES_TRM_STALL ResCode = C.MSK_RES_TRM_STALL // The optimizer is terminated due to slow progress. RES_TRM_USER_CALLBACK ResCode = C.MSK_RES_TRM_USER_CALLBACK // The user-defined progress callback function terminated the optimization. RES_TRM_MIO_NUM_RELAXS ResCode = C.MSK_RES_TRM_MIO_NUM_RELAXS // The mixed-integer optimizer terminated as the maximum number of relaxations was reached. RES_TRM_MIO_NUM_BRANCHES ResCode = C.MSK_RES_TRM_MIO_NUM_BRANCHES // The mixed-integer optimizer terminated as the maximum number of branches was reached. RES_TRM_NUM_MAX_NUM_INT_SOLUTIONS ResCode = C.MSK_RES_TRM_NUM_MAX_NUM_INT_SOLUTIONS // The mixed-integer optimizer terminated as the maximum number of feasible solutions was reached. RES_TRM_MAX_NUM_SETBACKS ResCode = C.MSK_RES_TRM_MAX_NUM_SETBACKS // The optimizer terminated as the maximum number of set-backs was reached. RES_TRM_NUMERICAL_PROBLEM ResCode = C.MSK_RES_TRM_NUMERICAL_PROBLEM // The optimizer terminated due to a numerical problem. RES_TRM_LOST_RACE ResCode = C.MSK_RES_TRM_LOST_RACE // Lost a race. RES_TRM_INTERNAL ResCode = C.MSK_RES_TRM_INTERNAL // The optimizer terminated due to some internal reason. RES_TRM_INTERNAL_STOP ResCode = C.MSK_RES_TRM_INTERNAL_STOP // The optimizer terminated for internal reasons. )
type ResCodeType ¶ added in v0.2.0
type ResCodeType uint32
ResCodeType is MSKrescodetype_enum.
Response code type
const ( RESPONSE_OK ResCodeType = C.MSK_RESPONSE_OK // The response code is OK. RESPONSE_WRN ResCodeType = C.MSK_RESPONSE_WRN // The response code is a warning. RESPONSE_TRM ResCodeType = C.MSK_RESPONSE_TRM // The response code is an optimizer termination status. RESPONSE_ERR ResCodeType = C.MSK_RESPONSE_ERR // The response code is an error. RESPONSE_UNK ResCodeType = C.MSK_RESPONSE_UNK // The response code does not belong to any class. )
func GetResponseclass ¶ added in v0.2.1
func GetResponseclass( r ResCode, ) (rc ResCodeType, rescode error)
GetResponseclass is wrapping MSK_getresponseclass
func (ResCodeType) String ¶ added in v0.2.10
func (e ResCodeType) String() string
type SParam ¶ added in v0.2.0
type SParam uint32
SParam is MSKsparam_enum.
string parameter.
const ( SPAR_BAS_SOL_FILE_NAME SParam = C.MSK_SPAR_BAS_SOL_FILE_NAME // Name of the bas solution file. SPAR_DATA_FILE_NAME SParam = C.MSK_SPAR_DATA_FILE_NAME // Data are read and written to this file. SPAR_DEBUG_FILE_NAME SParam = C.MSK_SPAR_DEBUG_FILE_NAME // MOSEK debug file. SPAR_INT_SOL_FILE_NAME SParam = C.MSK_SPAR_INT_SOL_FILE_NAME // Name of the int solution file. SPAR_ITR_SOL_FILE_NAME SParam = C.MSK_SPAR_ITR_SOL_FILE_NAME // Name of the itr solution file. SPAR_MIO_DEBUG_STRING SParam = C.MSK_SPAR_MIO_DEBUG_STRING // For internal debugging purposes. SPAR_PARAM_COMMENT_SIGN SParam = C.MSK_SPAR_PARAM_COMMENT_SIGN // Solution file comment character. SPAR_PARAM_READ_FILE_NAME SParam = C.MSK_SPAR_PARAM_READ_FILE_NAME // Modifications to the parameter database is read from this file. SPAR_PARAM_WRITE_FILE_NAME SParam = C.MSK_SPAR_PARAM_WRITE_FILE_NAME // The parameter database is written to this file. SPAR_READ_MPS_BOU_NAME SParam = C.MSK_SPAR_READ_MPS_BOU_NAME // Name of the BOUNDS vector used. An empty name means that the first BOUNDS vector is used. SPAR_READ_MPS_OBJ_NAME SParam = C.MSK_SPAR_READ_MPS_OBJ_NAME // Objective name in the MPS file. SPAR_READ_MPS_RAN_NAME SParam = C.MSK_SPAR_READ_MPS_RAN_NAME // Name of the RANGE vector used. An empty name means that the first RANGE vector is used. SPAR_READ_MPS_RHS_NAME SParam = C.MSK_SPAR_READ_MPS_RHS_NAME // Name of the RHS used. An empty name means that the first RHS vector is used. SPAR_REMOTE_OPTSERVER_HOST SParam = C.MSK_SPAR_REMOTE_OPTSERVER_HOST // URL of the remote optimization server. SPAR_REMOTE_TLS_CERT SParam = C.MSK_SPAR_REMOTE_TLS_CERT // Known server certificates in PEM format SPAR_REMOTE_TLS_CERT_PATH SParam = C.MSK_SPAR_REMOTE_TLS_CERT_PATH // Path to known server certificates in PEM format SPAR_SENSITIVITY_FILE_NAME SParam = C.MSK_SPAR_SENSITIVITY_FILE_NAME // Sensitivity report file name. SPAR_SENSITIVITY_RES_FILE_NAME SParam = C.MSK_SPAR_SENSITIVITY_RES_FILE_NAME // Name of the sensitivity report output file. SPAR_SOL_FILTER_XC_LOW SParam = C.MSK_SPAR_SOL_FILTER_XC_LOW // Solution file filter. SPAR_SOL_FILTER_XC_UPR SParam = C.MSK_SPAR_SOL_FILTER_XC_UPR // Solution file filter. SPAR_SOL_FILTER_XX_LOW SParam = C.MSK_SPAR_SOL_FILTER_XX_LOW // Solution file filter. SPAR_SOL_FILTER_XX_UPR SParam = C.MSK_SPAR_SOL_FILTER_XX_UPR // Solution file filter. SPAR_STAT_KEY SParam = C.MSK_SPAR_STAT_KEY // Key used when writing the summary file. SPAR_STAT_NAME SParam = C.MSK_SPAR_STAT_NAME // Name used when writing the statistics file. SPAR_WRITE_LP_GEN_VAR_NAME SParam = C.MSK_SPAR_WRITE_LP_GEN_VAR_NAME // Added variable names in the LP files. )
type ScalingMethod ¶ added in v0.2.0
type ScalingMethod uint32
ScalingMethod is MSKscalingmethod_enum.
Scaling method
const ( SCALING_METHOD_POW2 ScalingMethod = C.MSK_SCALING_METHOD_POW2 // Scales only with power of 2 leaving the mantissa untouched. SCALING_METHOD_FREE ScalingMethod = C.MSK_SCALING_METHOD_FREE // The optimizer chooses the scaling heuristic. )
func (ScalingMethod) String ¶ added in v0.2.10
func (e ScalingMethod) String() string
type ScalingType ¶ added in v0.2.0
type ScalingType uint32
ScalingType is MSKscalingtype_enum.
Scaling type
const ( SCALING_FREE ScalingType = C.MSK_SCALING_FREE // The optimizer chooses the scaling heuristic. SCALING_NONE ScalingType = C.MSK_SCALING_NONE // No scaling is performed. )
func (ScalingType) String ¶ added in v0.2.10
func (e ScalingType) String() string
type SensitivityType ¶ added in v0.2.0
type SensitivityType uint32
SensitivityType is MSKsensitivitytype_enum.
Sensitivity types
const (
SENSITIVITY_TYPE_BASIS SensitivityType = C.MSK_SENSITIVITY_TYPE_BASIS // Basis sensitivity analysis is performed.
)
func (SensitivityType) String ¶ added in v0.2.10
func (e SensitivityType) String() string
type SimReform ¶ added in v0.2.0
type SimReform uint32
SimReform is MSKsimreform_enum.
Problem reformulation.
const ( SIM_REFORMULATION_OFF SimReform = C.MSK_SIM_REFORMULATION_OFF // Disallow the simplex optimizer to reformulate the problem. SIM_REFORMULATION_ON SimReform = C.MSK_SIM_REFORMULATION_ON // Allow the simplex optimizer to reformulate the problem. SIM_REFORMULATION_FREE SimReform = C.MSK_SIM_REFORMULATION_FREE // The simplex optimizer can choose freely. SIM_REFORMULATION_AGGRESSIVE SimReform = C.MSK_SIM_REFORMULATION_AGGRESSIVE // The simplex optimizer should use an aggressive reformulation strategy. )
type SimSelType ¶ added in v0.2.0
type SimSelType uint32
SimSelType is MSKsimseltype_enum.
Simplex selection strategy
const ( SIM_SELECTION_FREE SimSelType = C.MSK_SIM_SELECTION_FREE // The optimizer chooses the pricing strategy. SIM_SELECTION_FULL SimSelType = C.MSK_SIM_SELECTION_FULL // The optimizer uses full pricing. SIM_SELECTION_ASE SimSelType = C.MSK_SIM_SELECTION_ASE // The optimizer uses approximate steepest-edge pricing. SIM_SELECTION_DEVEX SimSelType = C.MSK_SIM_SELECTION_DEVEX // The optimizer uses devex steepest-edge pricing. SIM_SELECTION_SE SimSelType = C.MSK_SIM_SELECTION_SE // The optimizer uses steepest-edge selection. SIM_SELECTION_PARTIAL SimSelType = C.MSK_SIM_SELECTION_PARTIAL // The optimizer uses a partial selection approach. )
func (SimSelType) String ¶ added in v0.2.10
func (e SimSelType) String() string
type Simdegen ¶ added in v0.2.0
type Simdegen uint32
Simdegen is MSKsimdegen_enum.
Degeneracy strategies
const ( SIM_DEGEN_NONE Simdegen = C.MSK_SIM_DEGEN_NONE // The simplex optimizer should use no degeneration strategy. SIM_DEGEN_FREE Simdegen = C.MSK_SIM_DEGEN_FREE // The simplex optimizer chooses the degeneration strategy. SIM_DEGEN_AGGRESSIVE Simdegen = C.MSK_SIM_DEGEN_AGGRESSIVE // The simplex optimizer should use an aggressive degeneration strategy. SIM_DEGEN_MODERATE Simdegen = C.MSK_SIM_DEGEN_MODERATE // The simplex optimizer should use a moderate degeneration strategy. SIM_DEGEN_MINIMUM Simdegen = C.MSK_SIM_DEGEN_MINIMUM // The simplex optimizer should use a minimum degeneration strategy. )
type Simdupvec ¶ added in v0.2.0
type Simdupvec uint32
Simdupvec is MSKsimdupvec_enum.
Exploit duplicate columns.
const ( SIM_EXPLOIT_DUPVEC_OFF Simdupvec = C.MSK_SIM_EXPLOIT_DUPVEC_OFF // Disallow the simplex optimizer to exploit duplicated columns. SIM_EXPLOIT_DUPVEC_ON Simdupvec = C.MSK_SIM_EXPLOIT_DUPVEC_ON // Allow the simplex optimizer to exploit duplicated columns. SIM_EXPLOIT_DUPVEC_FREE Simdupvec = C.MSK_SIM_EXPLOIT_DUPVEC_FREE // The simplex optimizer can choose freely. )
type Simhotstart ¶ added in v0.2.0
type Simhotstart uint32
Simhotstart is MSKsimhotstart_enum.
Hot-start type employed by the simplex optimizer
const ( SIM_HOTSTART_NONE Simhotstart = C.MSK_SIM_HOTSTART_NONE // The simplex optimizer performs a coldstart. SIM_HOTSTART_FREE Simhotstart = C.MSK_SIM_HOTSTART_FREE // The simplex optimize chooses the hot-start type. SIM_HOTSTART_STATUS_KEYS Simhotstart = C.MSK_SIM_HOTSTART_STATUS_KEYS // Only the status keys of the constraints and variables are used to choose the type of hot-start. )
func (Simhotstart) String ¶ added in v0.2.10
func (e Simhotstart) String() string
type SolFormat ¶ added in v0.2.0
type SolFormat uint32
SolFormat is MSKsolformat_enum.
Data format types
const ( SOL_FORMAT_EXTENSION SolFormat = C.MSK_SOL_FORMAT_EXTENSION // The file extension is used to determine the data file format. SOL_FORMAT_B SolFormat = C.MSK_SOL_FORMAT_B // Simple binary format SOL_FORMAT_TASK SolFormat = C.MSK_SOL_FORMAT_TASK // Tar based format. SOL_FORMAT_JSON_TASK SolFormat = C.MSK_SOL_FORMAT_JSON_TASK // JSON based format. )
type SolItem ¶ added in v0.2.0
type SolItem uint32
SolItem is MSKsolitem_enum.
Solution items
const ( SOL_ITEM_XC SolItem = C.MSK_SOL_ITEM_XC // Solution for the constraints. SOL_ITEM_XX SolItem = C.MSK_SOL_ITEM_XX // Variable solution. SOL_ITEM_Y SolItem = C.MSK_SOL_ITEM_Y // Lagrange multipliers for equations. SOL_ITEM_SLC SolItem = C.MSK_SOL_ITEM_SLC // Lagrange multipliers for lower bounds on the constraints. SOL_ITEM_SUC SolItem = C.MSK_SOL_ITEM_SUC // Lagrange multipliers for upper bounds on the constraints. SOL_ITEM_SLX SolItem = C.MSK_SOL_ITEM_SLX // Lagrange multipliers for lower bounds on the variables. SOL_ITEM_SUX SolItem = C.MSK_SOL_ITEM_SUX // Lagrange multipliers for upper bounds on the variables. SOL_ITEM_SNX SolItem = C.MSK_SOL_ITEM_SNX // Lagrange multipliers corresponding to the conic constraints on the variables. )
type SolSta ¶ added in v0.0.2
type SolSta uint32
SolSta is MSKsolsta_enum.
Solution status keys
const ( SOL_STA_UNKNOWN SolSta = C.MSK_SOL_STA_UNKNOWN // Status of the solution is unknown. SOL_STA_OPTIMAL SolSta = C.MSK_SOL_STA_OPTIMAL // The solution is optimal. SOL_STA_PRIM_FEAS SolSta = C.MSK_SOL_STA_PRIM_FEAS // The solution is primal feasible. SOL_STA_DUAL_FEAS SolSta = C.MSK_SOL_STA_DUAL_FEAS // The solution is dual feasible. SOL_STA_PRIM_AND_DUAL_FEAS SolSta = C.MSK_SOL_STA_PRIM_AND_DUAL_FEAS // The solution is both primal and dual feasible. SOL_STA_PRIM_INFEAS_CER SolSta = C.MSK_SOL_STA_PRIM_INFEAS_CER // The solution is a certificate of primal infeasibility. SOL_STA_DUAL_INFEAS_CER SolSta = C.MSK_SOL_STA_DUAL_INFEAS_CER // The solution is a certificate of dual infeasibility. SOL_STA_PRIM_ILLPOSED_CER SolSta = C.MSK_SOL_STA_PRIM_ILLPOSED_CER // The solution is a certificate that the primal problem is illposed. SOL_STA_DUAL_ILLPOSED_CER SolSta = C.MSK_SOL_STA_DUAL_ILLPOSED_CER // The solution is a certificate that the dual problem is illposed. SOL_STA_INTEGER_OPTIMAL SolSta = C.MSK_SOL_STA_INTEGER_OPTIMAL // The primal solution is integer optimal. )
type SolType ¶
type SolType uint32
SolType is MSKsoltype_enum.
Solution types
const ( SOL_ITR SolType = C.MSK_SOL_ITR // The interior solution. SOL_BAS SolType = C.MSK_SOL_BAS // The basic solution. SOL_ITG SolType = C.MSK_SOL_ITG // The integer solution. )
type Solveform ¶ added in v0.2.0
type Solveform uint32
Solveform is MSKsolveform_enum.
Solve primal or dual form
const ( SOLVE_FREE Solveform = C.MSK_SOLVE_FREE // The optimizer is free to solve either the primal or the dual problem. SOLVE_PRIMAL Solveform = C.MSK_SOLVE_PRIMAL // The optimizer should solve the primal problem. SOLVE_DUAL Solveform = C.MSK_SOLVE_DUAL // The optimizer should solve the dual problem. )
type StaKey ¶ added in v0.2.0
type StaKey uint32
StaKey is MSKstakey_enum.
Status keys
const ( SK_UNK StaKey = C.MSK_SK_UNK // The status for the constraint or variable is unknown. SK_BAS StaKey = C.MSK_SK_BAS // The constraint or variable is in the basis. SK_SUPBAS StaKey = C.MSK_SK_SUPBAS // The constraint or variable is super basic. SK_LOW StaKey = C.MSK_SK_LOW // The constraint or variable is at its lower bound. SK_UPR StaKey = C.MSK_SK_UPR // The constraint or variable is at its upper bound. SK_FIX StaKey = C.MSK_SK_FIX // The constraint or variable is fixed. SK_INF StaKey = C.MSK_SK_INF // The constraint or variable is infeasible in the bounds. )
type StarPointType ¶ added in v0.2.0
type StarPointType uint32
StarPointType is MSKstartpointtype_enum.
Starting point types
const ( STARTING_POINT_FREE StarPointType = C.MSK_STARTING_POINT_FREE // The starting point is chosen automatically. STARTING_POINT_GUESS StarPointType = C.MSK_STARTING_POINT_GUESS // The optimizer guesses a starting point. STARTING_POINT_CONSTANT StarPointType = C.MSK_STARTING_POINT_CONSTANT // The optimizer constructs a starting point by assigning a constant value to all primal and dual variables. This starting point is normally robust. )
func (StarPointType) String ¶ added in v0.2.10
func (e StarPointType) String() string
type StreamType ¶ added in v0.0.4
type StreamType uint32
StreamType is MSKstreamtype_enum.
Stream types
const ( STREAM_LOG StreamType = C.MSK_STREAM_LOG // Log stream. Contains the aggregated contents of all other streams. This means that a message written to any other stream will also be written to this stream. STREAM_MSG StreamType = C.MSK_STREAM_MSG // Message stream. Log information relating to performance and progress of the optimization is written to this stream. STREAM_ERR StreamType = C.MSK_STREAM_ERR // Error stream. Error messages are written to this stream. STREAM_WRN StreamType = C.MSK_STREAM_WRN // Warning stream. Warning messages are written to this stream. )
func (StreamType) String ¶ added in v0.2.10
func (e StreamType) String() string
type SymmatType ¶ added in v0.2.0
type SymmatType uint32
SymmatType is MSKsymmattype_enum.
Cone types
const (
SYMMAT_TYPE_SPARSE SymmatType = C.MSK_SYMMAT_TYPE_SPARSE // Sparse symmetric matrix.
)
func (SymmatType) String ¶ added in v0.2.10
func (e SymmatType) String() string
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
MSKTask holds a MSKtask_t, MOSEK task
func MakeTask ¶
MakeTask is the equivalent of MSK_maketask. To use the global environment, use nil for env
func (*Task) AnalyzeNames ¶ added in v0.2.1
func (task *Task) AnalyzeNames( whichstream StreamType, nametype NameType, ) error
AnalyzeNames is wrapping MSK_analyzenames, Analyze the names and issue an error for the first invalid name.
Arguments:
- `whichstream` Index of the stream.
- `nametype` The type of names e.g. valid in MPS or LP files.
func (*Task) AnalyzeProblem ¶ added in v0.2.1
func (task *Task) AnalyzeProblem( whichstream StreamType, ) error
AnalyzeProblem is wrapping MSK_analyzeproblem, Analyze the data of a task.
Arguments:
- `whichstream` Index of the stream.
func (*Task) AnalyzeSolution ¶ added in v0.2.1
func (task *Task) AnalyzeSolution( whichstream StreamType, whichsol SolType, ) error
AnalyzeSolution is wrapping MSK_analyzesolution, Print information related to the quality of the solution.
Arguments:
- `whichstream` Index of the stream.
- `whichsol` Selects a solution.
func (*Task) AppendAcc ¶ added in v0.0.4
func (task *Task) AppendAcc( domidx int64, numafeidx int64, afeidxlist []int64, b []float64, ) error
AppendAcc is wrapping MSK_appendacc, Appends an affine conic constraint to the task.
Arguments:
- `domidx` Domain index.
- `afeidxlist` List of affine expression indexes.
- `b` The vector of constant terms added to affine expressions. Optional, can be NULL.
func (*Task) AppendAccSeq ¶ added in v0.0.9
func (task *Task) AppendAccSeq( domidx int64, numafeidx int64, afeidxfirst int64, b []float64, ) error
AppendAccSeq is wrapping MSK_appendaccseq, Appends an affine conic constraint to the task.
Arguments:
- `domidx` Domain index.
- `afeidxfirst` Index of the first affine expression.
- `b` The vector of constant terms added to affine expressions. Optional, can be NULL.
func (*Task) AppendAccs ¶ added in v0.0.10
func (task *Task) AppendAccs( numaccs int64, domidxs []int64, numafeidx int64, afeidxlist []int64, b []float64, ) error
AppendAccs is wrapping MSK_appendaccs, Appends a number of affine conic constraint to the task.
Arguments:
- `domidxs` Domain indices.
- `afeidxlist` List of affine expression indexes.
- `b` The vector of constant terms added to affine expressions. Optional, can be NULL.
func (*Task) AppendAccsSeq ¶ added in v0.0.7
func (task *Task) AppendAccsSeq( numaccs int64, domidxs []int64, numafeidx int64, afeidxfirst int64, b []float64, ) error
AppendAccsSeq is wrapping MSK_appendaccsseq, Appends a number of affine conic constraint to the task.
Arguments:
- `domidxs` Domain indices.
- `numafeidx` Number of affine expressions in the affine expression list (must equal the sum of dimensions of the domains).
- `afeidxfirst` Index of the first affine expression.
- `b` The vector of constant terms added to affine expressions. Optional, can be NULL.
func (*Task) AppendAfes ¶ added in v0.0.4
AppendAfes is wrapping MSK_appendafes, Appends a number of empty affine expressions to the optimization task.
Arguments:
- `num` Number of empty affine expressions which should be appended.
func (*Task) AppendBarvars ¶ added in v0.2.1
AppendBarvars is wrapping MSK_appendbarvars, Appends semidefinite variables to the problem.
Arguments:
- `dim` Dimensions of symmetric matrix variables to be added.
func (*Task) AppendCone
deprecated
added in
v0.2.1
AppendCone is wrapping MSK_appendcone, Appends a new conic constraint to the problem.
Arguments:
- `ct` Specifies the type of the cone.
- `conepar` For the power cone it denotes the exponent alpha. For other cone types it is unused and can be set to 0.
- `submem` Variable subscripts of the members in the cone.
Deprecated: MSK_appendcone/AppendCone is deprecated by mosek and will be removed in a future release.
func (*Task) AppendConeSeq
deprecated
added in
v0.2.1
AppendConeSeq is wrapping MSK_appendconeseq, Appends a new conic constraint to the problem.
Arguments:
- `ct` Specifies the type of the cone.
- `conepar` For the power cone it denotes the exponent alpha. For other cone types it is unused and can be set to 0.
- `nummem` Number of member variables in the cone.
- `j` Index of the first variable in the conic constraint.
Deprecated: MSK_appendconeseq/AppendConeSeq is deprecated by mosek and will be removed in a future release.
func (*Task) AppendConesSeq
deprecated
added in
v0.2.1
func (task *Task) AppendConesSeq( num int32, ct []ConeType, conepar []float64, nummem []int32, j int32, ) error
AppendConesSeq is wrapping MSK_appendconesseq, Appends multiple conic constraints to the problem.
Arguments:
- `ct` Specifies the type of the cone.
- `conepar` For the power cone it denotes the exponent alpha. For other cone types it is unused and can be set to 0.
- `nummem` Numbers of member variables in the cones.
- `j` Index of the first variable in the first cone to be appended.
Deprecated: MSK_appendconesseq/AppendConesSeq is deprecated by mosek and will be removed in a future release.
func (*Task) AppendCons ¶ added in v0.0.2
AppendCons is wrapping MSK_appendcons, Appends a number of constraints to the optimization task.
Arguments:
- `num` Number of constraints which should be appended.
func (*Task) AppendDjcs ¶ added in v0.1.3
AppendDjcs is wrapping MSK_appenddjcs, Appends a number of empty disjunctive constraints to the task.
Arguments:
- `num` Number of empty disjunctive constraints which should be appended.
func (*Task) AppendDualExpConeDomain ¶ added in v0.1.4
AppendDualExpConeDomain is wrapping MSK_appenddualexpconedomain, Appends the dual exponential cone domain.
Returns:
- `domidx` Index of the domain.
func (*Task) AppendDualGeoMeanConeDomain ¶ added in v0.1.4
AppendDualGeoMeanConeDomain is wrapping MSK_appenddualgeomeanconedomain, Appends the dual geometric mean cone domain.
Arguments:
- `n` Dimmension of the domain.
Returns:
- `domidx` Index of the domain.
func (*Task) AppendDualPowerConeDomain ¶ added in v0.1.4
func (task *Task) AppendDualPowerConeDomain( n int64, nleft int64, alpha []float64, ) (domidx int64, r error)
AppendDualPowerConeDomain is wrapping MSK_appenddualpowerconedomain, Appends the dual power cone domain.
Arguments:
- `n` Dimension of the domain.
- `alpha` The sequence proportional to exponents. Must be positive.
Returns:
- `domidx` Index of the domain.
func (*Task) AppendPrimalExpConeDomain ¶ added in v0.1.1
AppendPrimalExpConeDomain is wrapping MSK_appendprimalexpconedomain, Appends the primal exponential cone domain.
Returns:
- `domidx` Index of the domain.
func (*Task) AppendPrimalGeoMeanConeDomain ¶ added in v0.1.4
AppendPrimalGeoMeanConeDomain is wrapping MSK_appendprimalgeomeanconedomain, Appends the primal geometric mean cone domain.
Arguments:
- `n` Dimmension of the domain.
Returns:
- `domidx` Index of the domain.
func (*Task) AppendPrimalPowerConeDomain ¶ added in v0.0.10
func (task *Task) AppendPrimalPowerConeDomain( n int64, nleft int64, alpha []float64, ) (domidx int64, r error)
AppendPrimalPowerConeDomain is wrapping MSK_appendprimalpowerconedomain, Appends the primal power cone domain.
Arguments:
- `n` Dimension of the domain.
- `alpha` The sequence proportional to exponents. Must be positive.
Returns:
- `domidx` Index of the domain.
func (*Task) AppendQuadraticConeDomain ¶ added in v0.0.4
AppendQuadraticConeDomain is wrapping MSK_appendquadraticconedomain, Appends the n dimensional quadratic cone domain.
Arguments:
- `n` Dimmension of the domain.
Returns:
- `domidx` Index of the domain.
func (*Task) AppendRDomain ¶ added in v0.1.4
AppendRDomain is wrapping MSK_appendrdomain, Appends the n dimensional real number domain.
Arguments:
- `n` Dimmension of the domain.
Returns:
- `domidx` Index of the domain.
func (*Task) AppendRQuadraticConeDomain ¶ added in v0.0.7
AppendRQuadraticConeDomain is wrapping MSK_appendrquadraticconedomain, Appends the n dimensional rotated quadratic cone domain.
Arguments:
- `n` Dimmension of the domain.
Returns:
- `domidx` Index of the domain.
func (*Task) AppendRminusDomain ¶ added in v0.2.8
AppendRminusDomain is wrapping MSK_appendrminusdomain, Appends the n dimensional negative orthant to the list of domains.
Arguments:
- `n` Dimmension of the domain.
Returns:
- `domidx` Index of the domain.
func (*Task) AppendRotatedQuadraticConeDomain ¶ added in v0.0.7
AppendRotatedQuadraticConeDomain wraps MSK_appendrquadraticconedomain and adds a new *rotated* quadratic cone of size n to the task. returns the index of the domain if successful. This is same as Task.AppendRQuadraticConeDomain, but with the word "rotated" fully spelled out.
func (*Task) AppendRplusDomain ¶ added in v0.2.8
AppendRplusDomain is wrapping MSK_appendrplusdomain, Appends the n dimensional positive orthant to the list of domains.
Arguments:
- `n` Dimmension of the domain.
Returns:
- `domidx` Index of the domain.
func (*Task) AppendRzeroDomain ¶ added in v0.2.8
AppendRzeroDomain is wrapping MSK_appendrzerodomain, Appends the n dimensional 0 domain.
Arguments:
- `n` Dimmension of the domain.
Returns:
- `domidx` Index of the domain.
func (*Task) AppendSparseSymMat ¶ added in v0.2.7
func (task *Task) AppendSparseSymMat( dim int32, nz int64, subi []int32, subj []int32, valij []float64, ) (idx int64, r error)
AppendSparseSymMat is wrapping MSK_appendsparsesymmat, Appends a general sparse symmetric matrix to the storage of symmetric matrices.
Arguments:
- `dim` Dimension of the symmetric matrix that is appended.
- `subi` Row subscript in the triplets.
- `subj` Column subscripts in the triplets.
- `valij` Values of each triplet.
Returns:
- `idx` Unique index assigned to the inputted matrix.
func (*Task) AppendSparseSymMatList ¶ added in v0.2.7
func (task *Task) AppendSparseSymMatList( num int32, dims []int32, nz []int64, subi []int32, subj []int32, valij []float64, ) (idx int64, r error)
AppendSparseSymMatList is wrapping MSK_appendsparsesymmatlist, Appends a general sparse symmetric matrix to the storage of symmetric matrices.
Arguments:
- `dims` Dimensions of the symmetric matrixes.
- `nz` Number of nonzeros for each matrix.
- `subi` Row subscript in the triplets.
- `subj` Column subscripts in the triplets.
- `valij` Values of each triplet.
- `idx` Unique index assigned to the inputted matrix.
func (*Task) AppendSvecPsdConeDomain ¶ added in v0.1.1
AppendSvecPsdConeDomain is wrapping MSK_appendsvecpsdconedomain, Appends the vectorized SVEC PSD cone domain.
Arguments:
- `n` Dimension of the domain.
Returns:
- `domidx` Index of the domain.
func (*Task) AppendVars ¶ added in v0.0.2
AppendVars is wrapping MSK_appendvars, Appends a number of variables to the optimization task.
Arguments:
- `num` Number of variables which should be appended.
func (*Task) BasisCond ¶ added in v0.2.8
BasisCond is wrapping MSK_basiscond, Computes conditioning information for the basis matrix.
Arguments:
- `nrmbasis` An estimate for the 1-norm of the basis.
- `nrminvbasis` An estimate for the 1-norm of the inverse of the basis.
func (*Task) BkToStr ¶ added in v0.2.5
BkToStr is wrapping MSK_bktostr
func (*Task) CheckMemtask ¶ added in v0.2.2
CheckMemtask is wrapping MSK_checkmemtask
func (*Task) ChgConBound ¶ added in v0.2.8
ChgConBound is wrapping MSK_chgconbound, Changes the bounds for one constraint.
Arguments:
- `i` Index of the constraint for which the bounds should be changed.
- `lower` If non-zero, then the lower bound is changed, otherwise the upper bound is changed.
- `finite` If non-zero, then the given value is assumed to be finite.
- `value` New value for the bound.
func (*Task) ChgVarBound ¶ added in v0.2.8
ChgVarBound is wrapping MSK_chgvarbound, Changes the bounds for one variable.
Arguments:
- `j` Index of the variable for which the bounds should be changed.
- `lower` If non-zero, then the lower bound is changed, otherwise the upper bound is changed.
- `finite` If non-zero, then the given value is assumed to be finite.
- `value` New value for the bound.
func (*Task) CommitChanges ¶ added in v0.2.8
CommitChanges is wrapping MSK_commitchanges, Commits all cached problem changes.
func (*Task) ConetypeToStr
deprecated
added in
v0.2.5
ConetypeToStr is wrapping MSK_conetypetostr
Deprecated: MSK_conetypetostr/ConetypeToStr is deprecated by mosek and will be removed in a future release.
func (*Task) DeleteSolution ¶ added in v0.2.6
DeleteSolution is wrapping MSK_deletesolution, Undefine a solution and free the memory it uses.
Arguments:
- `whichsol` Selects a solution.
func (*Task) DualSensitivity ¶ added in v0.2.6
func (task *Task) DualSensitivity( numj int32, subj []int32, leftpricej []float64, rightpricej []float64, leftrangej []float64, rightrangej []float64, ) error
DualSensitivity is wrapping MSK_dualsensitivity, Performs sensitivity analysis on objective coefficients.
Arguments:
- `subj` Indexes of objective coefficients to analyze.
- `leftpricej` Left shadow prices for requested coefficients.
- `rightpricej` Right shadow prices for requested coefficients.
- `leftrangej` Left range for requested coefficients.
- `rightrangej` Right range for requested coefficients.
func (*Task) EmptyAfeBarfRow ¶ added in v0.2.8
EmptyAfeBarfRow is wrapping MSK_emptyafebarfrow, Clears a row in barF
Arguments:
- `afeidx` Row index of barF.
func (*Task) EmptyAfeBarfRowList ¶ added in v0.2.8
EmptyAfeBarfRowList is wrapping MSK_emptyafebarfrowlist, Clears rows in barF.
Arguments:
- `afeidxlist` Indices of rows in barF to clear.
func (*Task) EmptyAfeFCol ¶ added in v0.2.2
EmptyAfeFCol is wrapping MSK_emptyafefcol, Clears a column in F.
Arguments:
- `varidx` Variable index.
func (*Task) EmptyAfeFColList ¶ added in v0.2.2
EmptyAfeFColList is wrapping MSK_emptyafefcollist, Clears columns in F.
Arguments:
- `varidx` Indices of variables in F to clear.
func (*Task) EmptyAfeFRow ¶ added in v0.2.2
EmptyAfeFRow is wrapping MSK_emptyafefrow, Clears a row in F.
Arguments:
- `afeidx` Row index.
func (*Task) EmptyAfeFRowList ¶ added in v0.2.2
EmptyAfeFRowList is wrapping MSK_emptyafefrowlist, Clears rows in F.
Arguments:
- `afeidx` Indices of rows in F to clear.
func (*Task) EvaluateAcc ¶ added in v0.0.4
func (task *Task) EvaluateAcc(whichsol SolType, accidx int64, activity []float64) ([]float64, error)
EvaluateAcc gets the activity of the cone at index accidx
func (*Task) EvaluateAccs ¶ added in v0.2.3
EvaluateAccs is wrapping MSK_evaluateaccs, Evaluates the activities of all affine conic constraints.
Arguments:
- `whichsol` Selects a solution.
- `activity` The activity of affine conic constraints. The array should have length equal to the sum of dimensions of all affine conic constraints.
func (*Task) GetACol ¶ added in v0.2.2
GetACol is wrapping MSK_getacol, Obtains one column of the linear constraint matrix.
Arguments:
- `j` Index of the column.
- `nzj` Number of non-zeros in the column obtained.
- `subj` Row indices of the non-zeros in the column obtained.
- `valj` Numerical values in the column obtained.
func (*Task) GetAColNumNz ¶ added in v0.2.3
GetAColNumNz is wrapping MSK_getacolnumnz, Obtains the number of non-zero elements in one column of the linear constraint matrix
Arguments:
- `i` Index of the column.
Returns:
- `nzj` Number of non-zeros in the j'th column of (A).
func (*Task) GetAColSlice ¶ added in v0.2.2
func (task *Task) GetAColSlice( first int32, last int32, maxnumnz int32, ptrb []int32, ptre []int32, sub []int32, val []float64, ) error
GetAColSlice is wrapping MSK_getacolslice, Obtains a sequence of columns from the coefficient matrix.
Arguments:
- `first` Index of the first column in the sequence.
- `last` Index of the last column in the sequence plus one.
- `ptrb` Column start pointers.
- `ptre` Column end pointers.
- `sub` Contains the row subscripts.
- `val` Contains the coefficient values.
func (*Task) GetAColSlice64 ¶ added in v0.2.2
func (task *Task) GetAColSlice64( first int32, last int32, maxnumnz int64, ptrb []int64, ptre []int64, sub []int32, val []float64, ) error
GetAColSlice64 is wrapping MSK_getacolslice64
func (*Task) GetAColSliceNumNz ¶ added in v0.2.3
GetAColSliceNumNz is wrapping MSK_getacolslicenumnz, Obtains the number of non-zeros in a slice of columns of the coefficient matrix.
Arguments:
- `first` Index of the first column in the sequence.
- `last` Index of the last column plus one in the sequence.
Returns:
- `numnz` Number of non-zeros in the slice.
func (*Task) GetAColSliceNumNz64 ¶ added in v0.2.3
GetAColSliceNumNz64 is wrapping MSK_getacolslicenumnz64
func (*Task) GetAColSliceTrip ¶ added in v0.2.4
func (task *Task) GetAColSliceTrip( first int32, last int32, maxnumnz int64, subi []int32, subj []int32, val []float64, ) error
GetAColSliceTrip is wrapping MSK_getacolslicetrip, Obtains a sequence of columns from the coefficient matrix in triplet format.
Arguments:
- `first` Index of the first column in the sequence.
- `last` Index of the last column in the sequence plus one.
- `subi` Constraint subscripts.
- `subj` Column subscripts.
- `val` Values.
func (*Task) GetAPieceNumNz ¶ added in v0.2.3
func (task *Task) GetAPieceNumNz( firsti int32, lasti int32, firstj int32, lastj int32, ) (numnz int32, r error)
GetAPieceNumNz is wrapping MSK_getapiecenumnz, Obtains the number non-zeros in a rectangular piece of the linear constraint matrix.
Arguments:
- `firsti` Index of the first row in the rectangular piece.
- `lasti` Index of the last row plus one in the rectangular piece.
- `firstj` Index of the first column in the rectangular piece.
- `lastj` Index of the last column plus one in the rectangular piece.
Returns:
- `numnz` Number of non-zero elements in the rectangular piece of the linear constraint matrix.
func (*Task) GetARow ¶ added in v0.2.2
GetARow is wrapping MSK_getarow, Obtains one row of the linear constraint matrix.
Arguments:
- `i` Index of the row.
- `nzi` Number of non-zeros in the row obtained.
- `subi` Column indices of the non-zeros in the row obtained.
- `vali` Numerical values of the row obtained.
func (*Task) GetARowNumNz ¶ added in v0.2.3
GetARowNumNz is wrapping MSK_getarownumnz, Obtains the number of non-zero elements in one row of the linear constraint matrix
Arguments:
- `i` Index of the row.
Returns:
- `nzi` Number of non-zeros in the i'th row of `A`.
func (*Task) GetARowSlice ¶ added in v0.2.2
func (task *Task) GetARowSlice( first int32, last int32, maxnumnz int32, ptrb []int32, ptre []int32, sub []int32, val []float64, ) error
GetARowSlice is wrapping MSK_getarowslice, Obtains a sequence of rows from the coefficient matrix.
Arguments:
- `first` Index of the first row in the sequence.
- `last` Index of the last row in the sequence plus one.
- `ptrb` Row start pointers.
- `ptre` Row end pointers.
- `sub` Contains the column subscripts.
- `val` Contains the coefficient values.
func (*Task) GetARowSlice64 ¶ added in v0.2.2
func (task *Task) GetARowSlice64( first int32, last int32, maxnumnz int64, ptrb []int64, ptre []int64, sub []int32, val []float64, ) error
GetARowSlice64 is wrapping MSK_getarowslice64
func (*Task) GetARowSliceNumNz ¶ added in v0.2.3
GetARowSliceNumNz is wrapping MSK_getarowslicenumnz, Obtains the number of non-zeros in a slice of rows of the coefficient matrix.
Arguments:
- `first` Index of the first row in the sequence.
- `last` Index of the last row plus one in the sequence.
Returns:
- `numnz` Number of non-zeros in the slice.
func (*Task) GetARowSliceNumNz64 ¶ added in v0.2.3
GetARowSliceNumNz64 is wrapping MSK_getarowslicenumnz64
func (*Task) GetARowSliceTrip ¶ added in v0.2.4
func (task *Task) GetARowSliceTrip( first int32, last int32, maxnumnz int64, subi []int32, subj []int32, val []float64, ) error
GetARowSliceTrip is wrapping MSK_getarowslicetrip, Obtains a sequence of rows from the coefficient matrix in sparse triplet format.
Arguments:
- `first` Index of the first row in the sequence.
- `last` Index of the last row in the sequence plus one.
- `subi` Constraint subscripts.
- `subj` Column subscripts.
- `val` Values.
func (*Task) GetATrip ¶ added in v0.2.8
GetATrip is wrapping MSK_getatrip, Obtains the A matrix in sparse triplet format.
Arguments:
- `subi` Constraint subscripts.
- `subj` Column subscripts.
- `val` Values.
func (*Task) GetATruncateTol ¶ added in v0.2.8
GetATruncateTol is wrapping MSK_getatruncatetol, Gets the current A matrix truncation threshold.
Arguments:
- `tolzero` Truncation tolerance.
func (*Task) GetAccAfeIdxList ¶ added in v0.2.8
GetAccAfeIdxList is wrapping MSK_getaccafeidxlist, Obtains the list of affine expressions appearing in the affine conic constraint.
Arguments:
- `accidx` Index of the affine conic constraint.
- `afeidxlist` List of indexes of affine expressions appearing in the constraint.
func (*Task) GetAccB ¶ added in v0.2.8
GetAccB is wrapping MSK_getaccb, Obtains the additional constant term vector appearing in the affine conic constraint.
Arguments:
- `accidx` Index of the affine conic constraint.
- `b` The vector b appearing in the constraint.
func (*Task) GetAccBarfBlockTriplet ¶ added in v0.2.8
func (task *Task) GetAccBarfBlockTriplet( maxnumtrip int64, numtrip []int64, acc_afe []int64, bar_var []int32, blk_row []int32, blk_col []int32, blk_val []float64, ) error
GetAccBarfBlockTriplet is wrapping MSK_getaccbarfblocktriplet, Obtains barF, implied by the ACCs, in block triplet form.
Arguments:
- `acc_afe` Index of the AFE within the concatenated list of AFEs in ACCs.
- `bar_var` Symmetric matrix variable index.
- `blk_row` Block row index.
- `blk_col` Block column index.
- `blk_val` The numerical value associated with each block triplet.
Returns:
- `numtrip` Number of elements in the block triplet form.
func (*Task) GetAccBarfNumBlockTriplets ¶ added in v0.2.8
GetAccBarfNumBlockTriplets is wrapping MSK_getaccbarfnumblocktriplets, Obtains an upper bound on the number of elements in the block triplet form of barf, as used within the ACCs.
Returns:
- `numtrip` An upper bound on the number of elements in the block triplet form of barf, as used within the ACCs.
func (*Task) GetAccDomain ¶ added in v0.2.2
GetAccDomain is wrapping MSK_getaccdomain, Obtains the domain appearing in the affine conic constraint.
Arguments:
- `accidx` The index of the affine conic constraint.
Returns:
- `domidx` The index of domain in the affine conic constraint.
func (*Task) GetAccDotY ¶ added in v0.0.4
GetAccDotY wraps MSK_getaccdoty and returns doty dual result of cone at idnex accidx. doty can be nil, in which case the dimension of the cone will be queried from the task and a new slice will be created.
func (*Task) GetAccDotYS ¶ added in v0.2.8
GetAccDotYS is wrapping MSK_getaccdotys, Obtains the doty vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `doty` The dual values of affine conic constraints. The array should have length equal to the sum of dimensions of all affine conic constraints.
func (*Task) GetAccFNumnz ¶ added in v0.2.8
GetAccFNumnz is wrapping MSK_getaccfnumnz, Obtains the total number of nonzeros in the ACC implied F matrix.
Returns:
- `accfnnz` Number of nonzeros in the F matrix implied by ACCs.
func (*Task) GetAccFTrip ¶ added in v0.2.4
GetAccFTrip is wrapping MSK_getaccftrip, Obtains the F matrix (implied by the AFE ordering within the ACCs) in triplet format.
Arguments:
- `frow` Row indices of nonzeros in the implied F matrix.
- `fcol` Column indices of nonzeros in the implied F matrix.
- `fval` Values of nonzero entries in the implied F matrix.
func (*Task) GetAccGVector ¶ added in v0.2.4
GetAccGVector is wrapping MSK_getaccgvector, The g vector as used within the ACCs.
Arguments:
- `g` The g vector as used within the ACCs.
func (*Task) GetAccN ¶ added in v0.0.4
GetAccN wraps MSK_getaccn and returns the dimension of cone at index accidx.
func (*Task) GetAccNTot ¶ added in v0.2.8
GetAccNTot is wrapping MSK_getaccntot, Obtains the total dimension of all affine conic constraints.
Returns:
- `n` The total dimension of all affine conic constraints.
func (*Task) GetAccName ¶ added in v0.2.2
GetAccName is wrapping MSK_getaccname, Obtains the name of an affine conic constraint.
Arguments:
- `accidx` Index of an affine conic constraint.
Returns:
- `name` Returns the required name.
func (*Task) GetAccNameLen ¶ added in v0.2.3
GetAccNameLen is wrapping MSK_getaccnamelen, Obtains the length of the name of an affine conic constraint.
Arguments:
- `accidx` Index of an affine conic constraint.
Returns:
- `len` Returns the length of the indicated name.
func (*Task) GetAccs ¶ added in v0.2.1
GetAccs is wrapping MSK_getaccs, Obtains full data of all affine conic constraints.
Arguments:
- `domidxlist` The list of domains appearing in all affine conic constraints.
- `afeidxlist` The concatenation of index lists of affine expressions appearing in all affine conic constraints.
- `b` The concatenation of vectors b appearing in all affine conic constraints.
func (*Task) GetAfeBarfBlockTriplet ¶ added in v0.2.8
func (task *Task) GetAfeBarfBlockTriplet( maxnumtrip int64, numtrip []int64, afeidx []int64, barvaridx []int32, subk []int32, subl []int32, valkl []float64, ) error
GetAfeBarfBlockTriplet is wrapping MSK_getafebarfblocktriplet, Obtains barF in block triplet form.
Arguments:
- `afeidx` Constraint index.
- `barvaridx` Symmetric matrix variable index.
- `subk` Block row index.
- `subl` Block column index.
- `valkl` The numerical value associated with each block triplet.
Returns:
- `numtrip` Number of elements in the block triplet form.
func (*Task) GetAfeBarfNumBlockTriplets ¶ added in v0.2.8
GetAfeBarfNumBlockTriplets is wrapping MSK_getafebarfnumblocktriplets, Obtains an upper bound on the number of elements in the block triplet form of barf.
Returns:
- `numtrip` An upper bound on the number of elements in the block triplet form of barf.
func (*Task) GetAfeBarfNumRowEntries ¶ added in v0.2.8
GetAfeBarfNumRowEntries is wrapping MSK_getafebarfnumrowentries, Obtains the number of nonzero entries in a row of barF.
Arguments:
- `afeidx` Row index of barF.
Returns:
- `numentr` Number of nonzero entries in a row of barF.
func (*Task) GetAfeBarfRow ¶ added in v0.2.8
func (task *Task) GetAfeBarfRow( afeidx int64, barvaridx []int32, ptrterm []int64, numterm []int64, termidx []int64, termweight []float64, ) error
GetAfeBarfRow is wrapping MSK_getafebarfrow, Obtains nonzero entries in one row of barF.
Arguments:
- `afeidx` Row index of barF.
- `barvaridx` Semidefinite variable indices.
- `ptrterm` Pointers to the description of entries.
- `numterm` Number of terms in each entry.
- `termidx` Indices of semidefinite matrices from E.
- `termweight` Weights appearing in the weighted sum representation.
func (*Task) GetAfeBarfRowInfo ¶ added in v0.2.8
GetAfeBarfRowInfo is wrapping MSK_getafebarfrowinfo, Obtains information about one row of barF.
Arguments:
- `afeidx` Row index of barF.
- `numentr` Number of nonzero entries in a row of barF.
- `numterm` Number of terms in the weighted sums representation of the row of barF.
func (*Task) GetAfeFNumNz ¶ added in v0.2.3
GetAfeFNumNz is wrapping MSK_getafefnumnz, Obtains the total number of nonzeros in F.
Returns:
- `numnz` Number of nonzeros in F.
func (*Task) GetAfeFRow ¶ added in v0.2.2
GetAfeFRow is wrapping MSK_getafefrow, Obtains one row of F in sparse format.
Arguments:
- `afeidx` Row index.
- `numnz` Number of non-zeros in the row obtained.
- `varidx` Column indices of the non-zeros in the row obtained.
- `val` Values of the non-zeros in the row obtained.
func (*Task) GetAfeFRowNumNz ¶ added in v0.2.3
GetAfeFRowNumNz is wrapping MSK_getafefrownumnz, Obtains the number of nonzeros in a row of F.
Arguments:
- `afeidx` Row index.
Returns:
- `numnz` Number of non-zeros in the row.
func (*Task) GetAfeFTrip ¶ added in v0.2.2
GetAfeFTrip is wrapping MSK_getafeftrip, Obtains the F matrix in triplet format.
Arguments:
- `afeidx` Row indices of nonzeros.
- `varidx` Column indices of nonzeros.
- `val` Values of nonzero entries.
func (*Task) GetAfeG ¶ added in v0.2.2
GetAfeG is wrapping MSK_getafeg, Obtains a single coefficient in g.
Arguments:
- `afeidx` Element index.
Returns:
- `g` The entry in g.
func (*Task) GetAfeGSlice ¶ added in v0.2.2
GetAfeGSlice is wrapping MSK_getafegslice, Obtains a sequence of coefficients from the vector g.
Arguments:
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `g` The slice of g as a dense vector.
func (*Task) GetAij ¶ added in v0.2.1
GetAij is wrapping MSK_getaij, Obtains a single coefficient in linear constraint matrix.
Arguments:
- `i` Row index of the coefficient to be returned.
- `j` Column index of the coefficient to be returned.
Returns:
- `aij` Returns the requested coefficient.
func (*Task) GetBarXj ¶ added in v0.1.1
GetBarxj wraps MSK_getbarxj and retrieves the semi definite matrix at j.
func (*Task) GetBaraBlockTriplet ¶ added in v0.2.8
func (task *Task) GetBaraBlockTriplet( maxnum int64, num []int64, subi []int32, subj []int32, subk []int32, subl []int32, valijkl []float64, ) error
GetBaraBlockTriplet is wrapping MSK_getbarablocktriplet, Obtains barA in block triplet form.
Arguments:
- `subi` Constraint index.
- `subj` Symmetric matrix variable index.
- `subk` Block row index.
- `subl` Block column index.
- `valijkl` The numerical value associated with each block triplet.
Returns:
- `num` Number of elements in the block triplet form.
func (*Task) GetBaraIdx ¶ added in v0.2.8
func (task *Task) GetBaraIdx( idx int64, maxnum int64, i []int32, j []int32, num []int64, sub []int64, weights []float64, ) error
GetBaraIdx is wrapping MSK_getbaraidx, Obtains information about an element in barA.
Arguments:
- `idx` Position of the element in the vectorized form.
- `i` Row index of the element at position idx.
- `j` Column index of the element at position idx.
- `sub` A list indexes of the elements from symmetric matrix storage that appear in the weighted sum.
- `weights` The weights associated with each term in the weighted sum.
Returns:
- `num` Number of terms in weighted sum that forms the element.
func (*Task) GetBaraIdxIJ ¶ added in v0.2.8
GetBaraIdxIJ is wrapping MSK_getbaraidxij, Obtains information about an element in barA.
Arguments:
- `idx` Position of the element in the vectorized form.
- `i` Row index of the element at position idx.
- `j` Column index of the element at position idx.
func (*Task) GetBaraIdxInfo ¶ added in v0.2.8
GetBaraIdxInfo is wrapping MSK_getbaraidxinfo, Obtains the number of terms in the weighted sum that form a particular element in barA.
Arguments:
- `idx` The internal position of the element for which information should be obtained.
Returns:
- `num` Number of terms in the weighted sum that form the specified element in barA.
func (*Task) GetBaraSparsity ¶ added in v0.2.8
GetBaraSparsity is wrapping MSK_getbarasparsity, Obtains the sparsity pattern of the barA matrix.
Arguments:
- `numnz` Number of nonzero elements in barA.
- `idxij` Position of each nonzero element in the vector representation of barA.
func (*Task) GetBarcBlockTriplet ¶ added in v0.2.8
func (task *Task) GetBarcBlockTriplet( maxnum int64, num []int64, subj []int32, subk []int32, subl []int32, valjkl []float64, ) error
GetBarcBlockTriplet is wrapping MSK_getbarcblocktriplet, Obtains barC in block triplet form.
Arguments:
- `subj` Symmetric matrix variable index.
- `subk` Block row index.
- `subl` Block column index.
- `valjkl` The numerical value associated with each block triplet.
Returns:
- `num` Number of elements in the block triplet form.
func (*Task) GetBarcIdx ¶ added in v0.2.8
func (task *Task) GetBarcIdx( idx int64, maxnum int64, j []int32, num []int64, sub []int64, weights []float64, ) error
GetBarcIdx is wrapping MSK_getbarcidx, Obtains information about an element in barc.
Arguments:
- `idx` Index of the element for which information should be obtained.
- `j` Row index in barc.
- `num` Number of terms in the weighted sum.
- `sub` Elements appearing the weighted sum.
- `weights` Weights of terms in the weighted sum.
func (*Task) GetBarcIdxInfo ¶ added in v0.2.8
GetBarcIdxInfo is wrapping MSK_getbarcidxinfo, Obtains information about an element in barc.
Arguments:
- `idx` Index of the element for which information should be obtained. The value is an index of a symmetric sparse variable.
Returns:
- `num` Number of terms that appear in the weighted sum that forms the requested element.
func (*Task) GetBarcIdxJ ¶ added in v0.2.8
GetBarcIdxJ is wrapping MSK_getbarcidxj, Obtains the row index of an element in barc.
Arguments:
- `idx` Index of the element for which information should be obtained.
- `j` Row index in barc.
func (*Task) GetBarcSparsity ¶ added in v0.2.8
GetBarcSparsity is wrapping MSK_getbarcsparsity, Get the positions of the nonzero elements in barc.
Arguments:
- `numnz` Number of nonzero elements in barc.
- `idxj` Internal positions of the nonzeros elements in barc.
func (*Task) GetBarsJ ¶ added in v0.2.8
GetBarsJ is wrapping MSK_getbarsj, Obtains the dual solution for a semidefinite variable.
Arguments:
- `whichsol` Selects a solution.
- `j` Index of the semidefinite variable.
- `barsj` Value of the j'th dual variable of barx.
func (*Task) GetBarsSlice ¶ added in v0.2.1
func (task *Task) GetBarsSlice( whichsol SolType, first int32, last int32, slicesize int64, barsslice []float64, ) error
GetBarsSlice is wrapping MSK_getbarsslice, Obtains the dual solution for a sequence of semidefinite variables.
Arguments:
- `whichsol` Selects a solution.
- `first` Index of the first semidefinite variable in the slice.
- `last` Index of the last semidefinite variable in the slice plus one.
- `slicesize` Denotes the length of the array barsslice.
- `barsslice` Dual solution values of symmetric matrix variables in the slice, stored sequentially.
func (*Task) GetBarvarName ¶ added in v0.2.2
GetBarvarName is wrapping MSK_getbarvarname, Obtains the name of a semidefinite variable.
Arguments:
- `i` Index of the variable.
Returns:
- `name` The requested name is copied to this buffer.
func (*Task) GetBarvarNameIndex ¶ added in v0.2.8
GetBarvarNameIndex is wrapping MSK_getbarvarnameindex, Obtains the index of semidefinite variable from its name.
Arguments:
- `somename` The name of the variable.
- `asgn` Non-zero if the name somename is assigned to some semidefinite variable.
Returns:
- `index` The index of a semidefinite variable with the name somename (if one exists).
func (*Task) GetBarvarNameLen ¶ added in v0.2.3
GetBarvarNameLen is wrapping MSK_getbarvarnamelen, Obtains the length of the name of a semidefinite variable.
Arguments:
- `i` Index of the variable.
Returns:
- `len` Returns the length of the indicated name.
func (*Task) GetBarxJ ¶ added in v0.2.8
GetBarxJ is wrapping MSK_getbarxj, Obtains the primal solution for a semidefinite variable.
Arguments:
- `whichsol` Selects a solution.
- `j` Index of the semidefinite variable.
- `barxj` Value of the j'th variable of barx.
func (*Task) GetBarxSlice ¶ added in v0.2.1
func (task *Task) GetBarxSlice( whichsol SolType, first int32, last int32, slicesize int64, barxslice []float64, ) error
GetBarxSlice is wrapping MSK_getbarxslice, Obtains the primal solution for a sequence of semidefinite variables.
Arguments:
- `whichsol` Selects a solution.
- `first` Index of the first semidefinite variable in the slice.
- `last` Index of the last semidefinite variable in the slice plus one.
- `slicesize` Denotes the length of the array barxslice.
- `barxslice` Solution values of symmetric matrix variables in the slice, stored sequentially.
func (*Task) GetC ¶ added in v0.2.1
GetC is wrapping MSK_getc, Obtains all objective coefficients.
Arguments:
- `c` Linear terms of the objective as a dense vector. The length is the number of variables.
func (*Task) GetCJ ¶ added in v0.2.8
GetCJ is wrapping MSK_getcj, Obtains one objective coefficient.
Arguments:
- `j` Index of the variable for which the c coefficient should be obtained.
- `cj` The c coefficient value.
func (*Task) GetCList ¶ added in v0.2.1
GetCList is wrapping MSK_getclist, Obtains a sequence of coefficients from the objective.
Arguments:
- `subj` A list of variable indexes.
- `c` Linear terms of the requested list of the objective as a dense vector.
func (*Task) GetCSlice ¶ added in v0.2.1
GetCSlice is wrapping MSK_getcslice, Obtains a sequence of coefficients from the objective.
Arguments:
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `c` Linear terms of the requested slice of the objective as a dense vector.
func (*Task) GetCfix ¶ added in v0.2.1
GetCfix is wrapping MSK_getcfix, Obtains the fixed term in the objective.
Returns:
- `cfix` Fixed term in the objective.
func (*Task) GetConBound ¶ added in v0.2.8
GetConBound is wrapping MSK_getconbound, Obtains bound information for one constraint.
Arguments:
- `i` Index of the constraint for which the bound information should be obtained.
- `bk` Bound keys.
- `bl` Values for lower bounds.
- `bu` Values for upper bounds.
func (*Task) GetConBoundSlice ¶ added in v0.2.8
func (task *Task) GetConBoundSlice( first int32, last int32, bk []BoundKey, bl []float64, bu []float64, ) error
GetConBoundSlice is wrapping MSK_getconboundslice, Obtains bounds information for a slice of the constraints.
Arguments:
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `bk` Bound keys.
- `bl` Values for lower bounds.
- `bu` Values for upper bounds.
func (*Task) GetConName ¶ added in v0.2.2
GetConName is wrapping MSK_getconname, Obtains the name of a constraint.
Arguments:
- `i` Index of the constraint.
Returns:
- `name` The required name.
func (*Task) GetConNameIndex ¶ added in v0.2.8
GetConNameIndex is wrapping MSK_getconnameindex, Checks whether the name has been assigned to any constraint.
Arguments:
- `somename` The name which should be checked.
- `asgn` Is non-zero if the name somename is assigned to some constraint.
Returns:
- `index` If the name somename is assigned to a constraint, then return the index of the constraint.
func (*Task) GetConNameLen ¶ added in v0.2.3
GetConNameLen is wrapping MSK_getconnamelen, Obtains the length of the name of a constraint.
Arguments:
- `i` Index of the constraint.
Returns:
- `len` Returns the length of the indicated name.
func (*Task) GetCone
deprecated
added in
v0.2.1
func (task *Task) GetCone( k int32, ct []ConeType, conepar []float64, nummem []int32, submem []int32, ) error
GetCone is wrapping MSK_getcone, Obtains a cone.
Arguments:
- `k` Index of the cone.
- `ct` Specifies the type of the cone.
- `conepar` For the power cone it denotes the exponent alpha. For other cone types it is unused and can be set to 0.
- `nummem` Number of member variables in the cone.
- `submem` Variable subscripts of the members in the cone.
Deprecated: MSK_getcone/GetCone is deprecated by mosek and will be removed in a future release.
func (*Task) GetConeInfo
deprecated
added in
v0.2.4
GetConeInfo is wrapping MSK_getconeinfo, Obtains information about a cone.
Arguments:
- `k` Index of the cone.
- `ct` Specifies the type of the cone.
- `conepar` For the power cone it denotes the exponent alpha. For other cone types it is unused and can be set to 0.
- `nummem` Number of member variables in the cone.
Deprecated: MSK_getconeinfo/GetConeInfo is deprecated by mosek and will be removed in a future release.
func (*Task) GetConeName
deprecated
added in
v0.2.2
GetConeName is wrapping MSK_getconename, Obtains the name of a cone.
Arguments:
- `i` Index of the cone.
Returns:
- `name` The required name.
Deprecated: MSK_getconename/GetConeName is deprecated by mosek and will be removed in a future release.
func (*Task) GetConeNameIndex
deprecated
added in
v0.2.8
GetConeNameIndex is wrapping MSK_getconenameindex, Checks whether the name has been assigned to any cone.
Arguments:
- `somename` The name which should be checked.
- `asgn` Is non-zero if the name somename is assigned to some cone.
Returns:
- `index` If the name somename is assigned to some cone, this is the index of the cone.
Deprecated: MSK_getconenameindex/GetConeNameIndex is deprecated by mosek and will be removed in a future release.
func (*Task) GetConeNameLen
deprecated
added in
v0.2.3
GetConeNameLen is wrapping MSK_getconenamelen, Obtains the length of the name of a cone.
Arguments:
- `i` Index of the cone.
Returns:
- `len` Returns the length of the indicated name.
Deprecated: MSK_getconenamelen/GetConeNameLen is deprecated by mosek and will be removed in a future release.
func (*Task) GetDimBarvarJ ¶ added in v0.2.8
GetDimBarvarJ is wrapping MSK_getdimbarvarj, Obtains the dimension of a symmetric matrix variable.
Arguments:
- `j` Index of the semidefinite variable whose dimension is requested.
Returns:
- `dimbarvarj` The dimension of the j'th semidefinite variable.
func (*Task) GetDjcAfeIdxList ¶ added in v0.2.8
GetDjcAfeIdxList is wrapping MSK_getdjcafeidxlist, Obtains the list of affine expression indexes in a disjunctive constraint.
Arguments:
- `djcidx` Index of the disjunctive constraint.
- `afeidxlist` List of affine expression indexes.
func (*Task) GetDjcB ¶ added in v0.2.8
GetDjcB is wrapping MSK_getdjcb, Obtains the optional constant term vector of a disjunctive constraint.
Arguments:
- `djcidx` Index of the disjunctive constraint.
- `b` The vector b.
func (*Task) GetDjcDomainIdxList ¶ added in v0.2.8
GetDjcDomainIdxList is wrapping MSK_getdjcdomainidxlist, Obtains the list of domain indexes in a disjunctive constraint.
Arguments:
- `djcidx` Index of the disjunctive constraint.
- `domidxlist` List of term sizes.
func (*Task) GetDjcName ¶ added in v0.2.2
GetDjcName is wrapping MSK_getdjcname, Obtains the name of a disjunctive constraint.
Arguments:
- `djcidx` Index of a disjunctive constraint.
Returns:
- `name` Returns the required name.
func (*Task) GetDjcNameLen ¶ added in v0.2.3
GetDjcNameLen is wrapping MSK_getdjcnamelen, Obtains the length of the name of a disjunctive constraint.
Arguments:
- `djcidx` Index of a disjunctive constraint.
Returns:
- `len` Returns the length of the indicated name.
func (*Task) GetDjcNumAfe ¶ added in v0.2.8
GetDjcNumAfe is wrapping MSK_getdjcnumafe, Obtains the number of affine expressions in the disjunctive constraint.
Arguments:
- `djcidx` Index of the disjunctive constraint.
Returns:
- `numafe` Number of affine expressions in the disjunctive constraint.
func (*Task) GetDjcNumAfeTot ¶ added in v0.2.8
GetDjcNumAfeTot is wrapping MSK_getdjcnumafetot, Obtains the number of affine expressions in all disjunctive constraints.
Returns:
- `numafetot` Number of affine expressions in all disjunctive constraints.
func (*Task) GetDjcNumDomain ¶ added in v0.2.8
GetDjcNumDomain is wrapping MSK_getdjcnumdomain, Obtains the number of domains in the disjunctive constraint.
Arguments:
- `djcidx` Index of the disjunctive constraint.
Returns:
- `numdomain` Number of domains in the disjunctive constraint.
func (*Task) GetDjcNumDomainTot ¶ added in v0.2.8
GetDjcNumDomainTot is wrapping MSK_getdjcnumdomaintot, Obtains the number of domains in all disjunctive constraints.
Returns:
- `numdomaintot` Number of domains in all disjunctive constraints.
func (*Task) GetDjcNumTerm ¶ added in v0.2.8
GetDjcNumTerm is wrapping MSK_getdjcnumterm, Obtains the number terms in the disjunctive constraint.
Arguments:
- `djcidx` Index of the disjunctive constraint.
Returns:
- `numterm` Number of terms in the disjunctive constraint.
func (*Task) GetDjcNumTermTot ¶ added in v0.2.8
GetDjcNumTermTot is wrapping MSK_getdjcnumtermtot, Obtains the number of terms in all disjunctive constraints.
Returns:
- `numtermtot` Total number of terms in all disjunctive constraints.
func (*Task) GetDjcTermSizeList ¶ added in v0.2.8
GetDjcTermSizeList is wrapping MSK_getdjctermsizelist, Obtains the list of term sizes in a disjunctive constraint.
Arguments:
- `djcidx` Index of the disjunctive constraint.
- `termsizelist` List of term sizes.
func (*Task) GetDjcs ¶ added in v0.2.1
func (task *Task) GetDjcs( domidxlist []int64, afeidxlist []int64, b []float64, termsizelist []int64, numterms []int64, ) error
GetDjcs is wrapping MSK_getdjcs, Obtains full data of all disjunctive constraints.
Arguments:
- `domidxlist` The concatenation of index lists of domains appearing in all disjunctive constraints.
- `afeidxlist` The concatenation of index lists of affine expressions appearing in all disjunctive constraints.
- `b` The concatenation of vectors b appearing in all disjunctive constraints.
- `termsizelist` The concatenation of lists of term sizes appearing in all disjunctive constraints.
- `numterms` The number of terms in each of the disjunctive constraints.
func (*Task) GetDomainN ¶ added in v0.2.8
GetDomainN is wrapping MSK_getdomainn, Obtains the dimension of the domain.
Arguments:
- `domidx` Index of the domain.
Returns:
- `n` Dimension of the domain.
func (*Task) GetDomainName ¶ added in v0.2.2
GetDomainName is wrapping MSK_getdomainname, Obtains the name of a domain.
Arguments:
- `domidx` Index of a domain.
Returns:
- `name` Returns the required name.
func (*Task) GetDomainNameLen ¶ added in v0.2.3
GetDomainNameLen is wrapping MSK_getdomainnamelen, Obtains the length of the name of a domain.
Arguments:
- `domidx` Index of a domain.
Returns:
- `len` Returns the length of the indicated name.
func (*Task) GetDomainType ¶ added in v0.2.8
func (task *Task) GetDomainType( domidx int64, ) (domtype DomainType, r error)
GetDomainType is wrapping MSK_getdomaintype, Returns the type of the domain.
Arguments:
- `domidx` Index of the domain.
Returns:
- `domtype` The type of the domain.
func (*Task) GetDouInf ¶ added in v0.1.2
GetDouInf is wrapping MSK_getdouinf, Obtains a double information item.
Arguments:
- `whichdinf` Specifies a double information item.
Returns:
- `dvalue` The value of the required double information item.
func (*Task) GetDouParam ¶ added in v0.2.2
GetDouParam is wrapping MSK_getdouparam, Obtains a double parameter.
Arguments:
- `param` Which parameter.
Returns:
- `parvalue` Parameter value.
func (*Task) GetDualObj ¶ added in v0.2.6
GetDualObj is wrapping MSK_getdualobj, Computes the dual objective value associated with the solution.
Arguments:
- `whichsol` Selects a solution.
- `dualobj` Objective value corresponding to the dual solution.
func (*Task) GetDualSolutionNorms ¶ added in v0.2.8
func (task *Task) GetDualSolutionNorms( whichsol SolType, nrmy []float64, nrmslc []float64, nrmsuc []float64, nrmslx []float64, nrmsux []float64, nrmsnx []float64, nrmbars []float64, ) error
GetDualSolutionNorms is wrapping MSK_getdualsolutionnorms, Compute norms of the dual solution.
Arguments:
- `whichsol` Selects a solution.
- `nrmy` The norm of the y vector.
- `nrmslc` The norm of the slc vector.
- `nrmsuc` The norm of the suc vector.
- `nrmslx` The norm of the slx vector.
- `nrmsux` The norm of the sux vector.
- `nrmsnx` The norm of the snx vector.
- `nrmbars` The norm of the bars vector.
func (*Task) GetDviolAcc ¶ added in v0.2.8
func (task *Task) GetDviolAcc( whichsol SolType, numaccidx int64, accidxlist []int64, viol []float64, ) error
GetDviolAcc is wrapping MSK_getdviolacc, Computes the violation of the dual solution for set of affine conic constraints.
Arguments:
- `whichsol` Selects a solution.
- `accidxlist` An array of indexes of conic constraints.
- `viol` List of violations corresponding to sub.
func (*Task) GetDviolBarvar ¶ added in v0.2.8
GetDviolBarvar is wrapping MSK_getdviolbarvar, Computes the violation of dual solution for a set of semidefinite variables.
Arguments:
- `whichsol` Selects a solution.
- `sub` An array of indexes of barx variables.
- `viol` List of violations corresponding to sub.
func (*Task) GetDviolCon ¶ added in v0.2.8
GetDviolCon is wrapping MSK_getdviolcon, Computes the violation of a dual solution associated with a set of constraints.
Arguments:
- `whichsol` Selects a solution.
- `sub` An array of indexes of constraints.
- `viol` List of violations corresponding to sub.
func (*Task) GetDviolCones
deprecated
added in
v0.2.8
GetDviolCones is wrapping MSK_getdviolcones, Computes the violation of a solution for set of dual conic constraints.
Arguments:
- `whichsol` Selects a solution.
- `sub` An array of indexes of conic constraints.
- `viol` List of violations corresponding to sub.
Deprecated: MSK_getdviolcones/GetDviolCones is deprecated by mosek and will be removed in a future release.
func (*Task) GetDviolVar ¶ added in v0.2.8
GetDviolVar is wrapping MSK_getdviolvar, Computes the violation of a dual solution associated with a set of scalar variables.
Arguments:
- `whichsol` Selects a solution.
- `sub` An array of indexes of x variables.
- `viol` List of violations corresponding to sub.
func (*Task) GetInfIndex ¶ added in v0.2.8
GetInfIndex is wrapping MSK_getinfindex, Obtains the index of a named information item.
Arguments:
- `inftype` Type of the information item.
- `infname` Name of the information item.
- `infindex` The item index.
func (*Task) GetInfMax ¶ added in v0.2.8
GetInfMax is wrapping MSK_getinfmax, Obtains the maximum index of an information item of a given type.
Arguments:
- `inftype` Type of the information item.
- `infmax` The maximum index (plus 1) requested.
func (*Task) GetInfName ¶ added in v0.2.2
GetInfName is wrapping MSK_getinfname, Obtains the name of an information item.
Arguments:
- `inftype` Type of the information item.
- `whichinf` An information item.
Returns:
- `infname` Name of the information item.
func (*Task) GetIntInf ¶ added in v0.1.2
GetIntInf is wrapping MSK_getintinf, Obtains an integer information item.
Arguments:
- `whichiinf` Specifies an integer information item.
Returns:
- `ivalue` The value of the required integer information item.
func (*Task) GetIntParam ¶ added in v0.2.2
GetIntParam is wrapping MSK_getintparam, Obtains an integer parameter.
Arguments:
- `param` Which parameter.
Returns:
- `parvalue` Parameter value.
func (*Task) GetLasterror ¶ added in v0.2.1
func (task *Task) GetLasterror( lastrescode []ResCode, sizelastmsg int32, lastmsglen []int32, lastmsg *byte, ) error
GetLasterror is wrapping MSK_getlasterror
func (*Task) GetLasterror64 ¶ added in v0.2.1
func (task *Task) GetLasterror64( lastrescode []ResCode, sizelastmsg int64, lastmsglen []int64, lastmsg *byte, ) error
GetLasterror64 is wrapping MSK_getlasterror64
func (*Task) GetLenBarvarJ ¶ added in v0.2.2
GetLenBarvarJ is wrapping MSK_getlenbarvarj, Obtains the length of one semidefinite variable.
Arguments:
- `j` Index of the semidefinite variable whose length if requested.
Returns:
- `lenbarvarj` Number of scalar elements in the lower triangular part of the semidefinite variable.
func (*Task) GetLintInf ¶ added in v0.2.8
GetLintInf is wrapping MSK_getlintinf, Obtains a long integer information item.
Arguments:
- `whichliinf` Specifies a long information item.
Returns:
- `ivalue` The value of the required long integer information item.
func (*Task) GetMaxNameLen ¶ added in v0.2.3
GetMaxNameLen is wrapping MSK_getmaxnamelen, Obtains the maximum length (not including terminating zero character) of any objective, constraint, variable, domain or cone name.
Arguments:
- `maxlen` The maximum length of any name.
func (*Task) GetMaxNumANz ¶ added in v0.2.8
GetMaxNumANz is wrapping MSK_getmaxnumanz, Obtains number of preallocated non-zeros in the linear constraint matrix.
Returns:
- `maxnumanz` Number of preallocated non-zero linear matrix elements.
func (*Task) GetMaxNumAnz64 ¶ added in v0.2.9
GetMaxNumAnz64 is wrapping MSK_getmaxnumanz64
func (*Task) GetMaxNumBarvar ¶ added in v0.2.8
GetMaxNumBarvar is wrapping MSK_getmaxnumbarvar, Obtains maximum number of symmetric matrix variables for which space is currently preallocated.
Returns:
- `maxnumbarvar` Maximum number of symmetric matrix variables for which space is currently preallocated.
func (*Task) GetMaxNumCon ¶ added in v0.2.8
GetMaxNumCon is wrapping MSK_getmaxnumcon, Obtains the number of preallocated constraints in the optimization task.
Arguments:
- `maxnumcon` Number of preallocated constraints in the optimization task.
func (*Task) GetMaxNumCone
deprecated
added in
v0.2.8
GetMaxNumCone is wrapping MSK_getmaxnumcone, Obtains the number of preallocated cones in the optimization task.
Arguments:
- `maxnumcone` Number of preallocated conic constraints in the optimization task.
Deprecated: MSK_getmaxnumcone/GetMaxNumCone is deprecated by mosek and will be removed in a future release.
func (*Task) GetMaxNumQNz ¶ added in v0.2.8
GetMaxNumQNz is wrapping MSK_getmaxnumqnz, Obtains the number of preallocated non-zeros for all quadratic terms in objective and constraints.
Arguments:
- `maxnumqnz` Number of non-zero elements preallocated in quadratic coefficient matrices.
func (*Task) GetMaxNumQnz64 ¶ added in v0.2.9
GetMaxNumQnz64 is wrapping MSK_getmaxnumqnz64
func (*Task) GetMaxNumVar ¶ added in v0.2.8
GetMaxNumVar is wrapping MSK_getmaxnumvar, Obtains the maximum number variables allowed.
Arguments:
- `maxnumvar` Number of preallocated variables in the optimization task.
func (*Task) GetMemusagetask ¶ added in v0.2.1
GetMemusagetask is wrapping MSK_getmemusagetask
func (*Task) GetNaDouInf ¶ added in v0.2.8
GetNaDouInf is wrapping MSK_getnadouinf, Obtains a named double information item.
Arguments:
- `infitemname` The name of a double information item.
- `dvalue` The value of the required double information item.
func (*Task) GetNaDouParam ¶ added in v0.2.8
GetNaDouParam is wrapping MSK_getnadouparam, Obtains a double parameter.
Arguments:
- `paramname` Name of a parameter.
- `parvalue` Parameter value.
func (*Task) GetNaIntInf ¶ added in v0.2.8
GetNaIntInf is wrapping MSK_getnaintinf, Obtains a named integer information item.
Arguments:
- `infitemname` The name of an integer information item.
- `ivalue` The value of the required integer information item.
func (*Task) GetNaIntParam ¶ added in v0.2.8
GetNaIntParam is wrapping MSK_getnaintparam, Obtains an integer parameter.
Arguments:
- `paramname` Name of a parameter.
- `parvalue` Parameter value.
func (*Task) GetNaStrParam ¶ added in v0.2.8
func (task *Task) GetNaStrParam( paramname string, sizeparamname int32, ) (len int32, parvalue string, r error)
GetNaStrParam is wrapping MSK_getnastrparam, Obtains a string parameter.
Arguments:
- `paramname` Name of a parameter.
- `sizeparamname` Size of the name buffer.
- `len` Returns the length of the parameter value.
Returns:
- `parvalue` Parameter value.
func (*Task) GetNumANz ¶ added in v0.2.8
GetNumANz is wrapping MSK_getnumanz, Obtains the number of non-zeros in the coefficient matrix.
Returns:
- `numanz` Number of non-zero elements in the linear constraint matrix.
func (*Task) GetNumANz64 ¶ added in v0.2.8
GetNumANz64 is wrapping MSK_getnumanz64, Obtains the number of non-zeros in the coefficient matrix.
Returns:
- `numanz` Number of non-zero elements in the linear constraint matrix.
func (*Task) GetNumAcc ¶ added in v0.2.2
GetNumAcc is wrapping MSK_getnumacc, Obtains the number of affine conic constraints.
Returns:
- `num` The number of affine conic constraints.
func (*Task) GetNumAfe ¶ added in v0.1.4
GetNumAfe is wrapping MSK_getnumafe, Obtains the number of affine expressions.
Returns:
- `numafe` Number of affine expressions.
func (*Task) GetNumBaraBlockTriplets ¶ added in v0.2.8
GetNumBaraBlockTriplets is wrapping MSK_getnumbarablocktriplets, Obtains an upper bound on the number of scalar elements in the block triplet form of bara.
Returns:
- `num` An upper bound on the number of elements in the block triplet form of bara.
func (*Task) GetNumBaraNz ¶ added in v0.2.8
GetNumBaraNz is wrapping MSK_getnumbaranz, Get the number of nonzero elements in barA.
Returns:
- `nz` The number of nonzero block elements in barA.
func (*Task) GetNumBarcBlockTriplets ¶ added in v0.2.8
GetNumBarcBlockTriplets is wrapping MSK_getnumbarcblocktriplets, Obtains an upper bound on the number of elements in the block triplet form of barc.
Returns:
- `num` An upper bound on the number of elements in the block triplet form of barc.
func (*Task) GetNumBarcNz ¶ added in v0.2.8
GetNumBarcNz is wrapping MSK_getnumbarcnz, Obtains the number of nonzero elements in barc.
Returns:
- `nz` The number of nonzero elements in barc.
func (*Task) GetNumBarvar ¶ added in v0.2.2
GetNumBarvar is wrapping MSK_getnumbarvar, Obtains the number of semidefinite variables.
Returns:
- `numbarvar` Number of semidefinite variables in the problem.
func (*Task) GetNumCon ¶ added in v0.1.3
GetNumCon is wrapping MSK_getnumcon, Obtains the number of constraints.
Returns:
- `numcon` Number of constraints.
func (*Task) GetNumCone
deprecated
added in
v0.2.2
GetNumCone is wrapping MSK_getnumcone, Obtains the number of cones.
Returns:
- `numcone` Number of conic constraints.
Deprecated: MSK_getnumcone/GetNumCone is deprecated by mosek and will be removed in a future release.
func (*Task) GetNumConeMem
deprecated
added in
v0.2.8
GetNumConeMem is wrapping MSK_getnumconemem, Obtains the number of members in a cone.
Arguments:
- `k` Index of the cone.
- `nummem` Number of member variables in the cone.
Deprecated: MSK_getnumconemem/GetNumConeMem is deprecated by mosek and will be removed in a future release.
func (*Task) GetNumDjc ¶ added in v0.2.2
GetNumDjc is wrapping MSK_getnumdjc, Obtains the number of disjunctive constraints.
Returns:
- `num` The number of disjunctive constraints.
func (*Task) GetNumDomain ¶ added in v0.2.2
GetNumDomain is wrapping MSK_getnumdomain, Obtain the number of domains defined.
Returns:
- `numdomain` Number of domains in the task.
func (*Task) GetNumIntVar ¶ added in v0.2.8
GetNumIntVar is wrapping MSK_getnumintvar, Obtains the number of integer-constrained variables.
Returns:
- `numintvar` Number of integer variables.
func (*Task) GetNumParam ¶ added in v0.2.2
func (task *Task) GetNumParam( partype ParameterType, ) (numparam int32, r error)
GetNumParam is wrapping MSK_getnumparam, Obtains the number of parameters of a given type.
Arguments:
- `partype` Parameter type.
- `numparam` Returns the number of parameters of the requested type.
func (*Task) GetNumQConKNz ¶ added in v0.2.2
GetNumQConKNz is wrapping MSK_getnumqconknz, Obtains the number of non-zero quadratic terms in a constraint.
Arguments:
- `k` Index of the constraint for which the number quadratic terms should be obtained.
Returns:
- `numqcnz` Number of quadratic terms.
func (*Task) GetNumQConKNz64 ¶ added in v0.2.2
GetNumQConKNz64 is wrapping MSK_getnumqconknz64
func (*Task) GetNumQObjNz ¶ added in v0.2.2
GetNumQObjNz is wrapping MSK_getnumqobjnz, Obtains the number of non-zero quadratic terms in the objective.
Returns:
- `numqonz` Number of non-zero elements in the quadratic objective terms.
func (*Task) GetNumQObjNz64 ¶ added in v0.2.2
GetNumQObjNz64 is wrapping MSK_getnumqobjnz64
func (*Task) GetNumSymMat ¶ added in v0.2.8
GetNumSymMat is wrapping MSK_getnumsymmat, Obtains the number of symmetric matrices stored.
Arguments:
- `num` The number of symmetric sparse matrices.
func (*Task) GetNumVar ¶ added in v0.0.2
GetNumVar is wrapping MSK_getnumvar, Obtains the number of variables.
Returns:
- `numvar` Number of variables.
func (*Task) GetObjName ¶ added in v0.2.2
GetObjName is wrapping MSK_getobjname, Obtains the name assigned to the objective function.
Returns:
- `objname` Assigned the objective name.
func (*Task) GetObjNameLen ¶ added in v0.2.3
GetObjNameLen is wrapping MSK_getobjnamelen, Obtains the length of the name assigned to the objective function.
Returns:
- `len` Assigned the length of the objective name.
func (*Task) GetObjSense ¶ added in v0.2.8
func (task *Task) GetObjSense() (sense ObjectiveSense, r error)
GetObjSense is wrapping MSK_getobjsense, Gets the objective sense.
Returns:
- `sense` The returned objective sense.
func (*Task) GetParamMax ¶ added in v0.2.8
func (task *Task) GetParamMax( partype ParameterType, ) (parammax int32, r error)
GetParamMax is wrapping MSK_getparammax, Obtains the maximum index of a parameter of a given type.
Arguments:
- `partype` Parameter type.
- `parammax` The maximum index (plus 1) of the given parameter type.
func (*Task) GetParamName ¶ added in v0.2.2
func (task *Task) GetParamName( partype ParameterType, param int32, ) (parname string, r error)
GetParamName is wrapping MSK_getparamname, Obtains the name of a parameter.
Arguments:
- `partype` Parameter type.
- `param` Which parameter.
Returns:
- `parname` Parameter name.
func (*Task) GetPowerDomainAlpha ¶ added in v0.2.8
GetPowerDomainAlpha is wrapping MSK_getpowerdomainalpha, Obtains the exponent vector of a power domain.
Arguments:
- `domidx` Index of the domain.
- `alpha` The exponent vector of the domain.
func (*Task) GetPowerDomainInfo ¶ added in v0.2.8
GetPowerDomainInfo is wrapping MSK_getpowerdomaininfo, Obtains structural information about a power domain.
Arguments:
- `domidx` Index of the domain.
- `n` Dimension of the domain.
- `nleft` Number of variables on the left hand side.
func (*Task) GetPrimalObj ¶ added in v0.2.6
GetPrimalObj is wrapping MSK_getprimalobj, Computes the primal objective value for the desired solution.
Arguments:
- `whichsol` Selects a solution.
Returns:
- `primalobj` Objective value corresponding to the primal solution.
func (*Task) GetPrimalSolutionNorms ¶ added in v0.2.8
func (task *Task) GetPrimalSolutionNorms( whichsol SolType, nrmxc []float64, nrmxx []float64, nrmbarx []float64, ) error
GetPrimalSolutionNorms is wrapping MSK_getprimalsolutionnorms, Compute norms of the primal solution.
Arguments:
- `whichsol` Selects a solution.
- `nrmxc` The norm of the xc vector.
- `nrmxx` The norm of the xx vector.
- `nrmbarx` The norm of the barX vector.
func (*Task) GetProSta ¶ added in v0.1.2
GetProSta is wrapping MSK_getprosta, Obtains the problem status.
Arguments:
- `whichsol` Selects a solution.
Returns:
- `problemsta` Problem status.
func (*Task) GetProbType ¶ added in v0.2.8
func (task *Task) GetProbType() (probtype ProblemType, r error)
GetProbType is wrapping MSK_getprobtype, Obtains the problem type.
Returns:
- `probtype` The problem type.
func (*Task) GetPviolAcc ¶ added in v0.2.8
func (task *Task) GetPviolAcc( whichsol SolType, numaccidx int64, accidxlist []int64, viol []float64, ) error
GetPviolAcc is wrapping MSK_getpviolacc, Computes the violation of a solution for set of affine conic constraints.
Arguments:
- `whichsol` Selects a solution.
- `accidxlist` An array of indexes of conic constraints.
- `viol` List of violations corresponding to sub.
func (*Task) GetPviolBarvar ¶ added in v0.2.8
GetPviolBarvar is wrapping MSK_getpviolbarvar, Computes the violation of a primal solution for a list of semidefinite variables.
Arguments:
- `whichsol` Selects a solution.
- `sub` An array of indexes of barX variables.
- `viol` List of violations corresponding to sub.
func (*Task) GetPviolCon ¶ added in v0.2.8
GetPviolCon is wrapping MSK_getpviolcon, Computes the violation of a primal solution associated to a constraint.
Arguments:
- `whichsol` Selects a solution.
- `sub` An array of indexes of constraints.
- `viol` List of violations corresponding to sub.
func (*Task) GetPviolCones
deprecated
added in
v0.2.8
GetPviolCones is wrapping MSK_getpviolcones, Computes the violation of a solution for set of conic constraints.
Arguments:
- `whichsol` Selects a solution.
- `sub` An array of indexes of conic constraints.
- `viol` List of violations corresponding to sub.
Deprecated: MSK_getpviolcones/GetPviolCones is deprecated by mosek and will be removed in a future release.
func (*Task) GetPviolDjc ¶ added in v0.2.8
func (task *Task) GetPviolDjc( whichsol SolType, numdjcidx int64, djcidxlist []int64, viol []float64, ) error
GetPviolDjc is wrapping MSK_getpvioldjc, Computes the violation of a solution for set of disjunctive constraints.
Arguments:
- `whichsol` Selects a solution.
- `djcidxlist` An array of indexes of disjunctive constraints.
- `viol` List of violations corresponding to sub.
func (*Task) GetPviolVar ¶ added in v0.2.8
GetPviolVar is wrapping MSK_getpviolvar, Computes the violation of a primal solution for a list of scalar variables.
Arguments:
- `whichsol` Selects a solution.
- `sub` An array of indexes of x variables.
- `viol` List of violations corresponding to sub.
func (*Task) GetQConK ¶ added in v0.2.2
func (task *Task) GetQConK( k int32, maxnumqcnz int32, numqcnz []int32, qcsubi []int32, qcsubj []int32, qcval []float64, ) error
GetQConK is wrapping MSK_getqconk, Obtains all the quadratic terms in a constraint.
Arguments:
- `k` Which constraint.
- `qcsubi` Row subscripts for quadratic constraint matrix.
- `qcsubj` Column subscripts for quadratic constraint matrix.
- `qcval` Quadratic constraint coefficient values.
Returns:
- `numqcnz` Number of quadratic terms.
func (*Task) GetQConK64 ¶ added in v0.2.2
func (task *Task) GetQConK64( k int32, maxnumqcnz int64, numqcnz []int64, qcsubi []int32, qcsubj []int32, qcval []float64, ) error
GetQConK64 is wrapping MSK_getqconk64
func (*Task) GetQObj ¶ added in v0.2.2
func (task *Task) GetQObj( maxnumqonz int32, numqonz []int32, qosubi []int32, qosubj []int32, qoval []float64, ) error
GetQObj is wrapping MSK_getqobj, Obtains all the quadratic terms in the objective.
Arguments:
- `numqonz` Number of non-zero elements in the quadratic objective terms.
- `qosubi` Row subscripts for quadratic objective coefficients.
- `qosubj` Column subscripts for quadratic objective coefficients.
- `qoval` Quadratic objective coefficient values.
func (*Task) GetQObj64 ¶ added in v0.2.2
func (task *Task) GetQObj64( maxnumqonz int64, numqonz []int64, qosubi []int32, qosubj []int32, qoval []float64, ) error
GetQObj64 is wrapping MSK_getqobj64
func (*Task) GetQObjIJ ¶ added in v0.2.8
GetQObjIJ is wrapping MSK_getqobjij, Obtains one coefficient from the quadratic term of the objective
Arguments:
- `i` Row index of the coefficient.
- `j` Column index of coefficient.
- `qoij` The required coefficient.
func (*Task) GetReducedCosts ¶ added in v0.2.8
func (task *Task) GetReducedCosts( whichsol SolType, first int32, last int32, redcosts []float64, ) error
GetReducedCosts is wrapping MSK_getreducedcosts, Obtains the reduced costs for a sequence of variables.
Arguments:
- `whichsol` Selects a solution.
- `first` The index of the first variable in the sequence.
- `last` The index of the last variable in the sequence plus 1.
- `redcosts` Returns the requested reduced costs.
func (*Task) GetSkc ¶ added in v0.2.1
GetSkc is wrapping MSK_getskc, Obtains the status keys for the constraints.
Arguments:
- `whichsol` Selects a solution.
- `skc` Status keys for the constraints.
func (*Task) GetSkcSlice ¶ added in v0.2.1
GetSkcSlice is wrapping MSK_getskcslice, Obtains the status keys for a slice of the constraints.
Arguments:
- `whichsol` Selects a solution.
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `skc` Status keys for the constraints.
func (*Task) GetSkn ¶ added in v0.2.1
GetSkn is wrapping MSK_getskn, Obtains the status keys for the conic constraints.
Arguments:
- `whichsol` Selects a solution.
- `skn` Status keys for the conic constraints.
func (*Task) GetSkx ¶ added in v0.2.1
GetSkx is wrapping MSK_getskx, Obtains the status keys for the scalar variables.
Arguments:
- `whichsol` Selects a solution.
- `skx` Status keys for the variables.
func (*Task) GetSkxSlice ¶ added in v0.2.1
GetSkxSlice is wrapping MSK_getskxslice, Obtains the status keys for a slice of the scalar variables.
Arguments:
- `whichsol` Selects a solution.
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `skx` Status keys for the variables.
func (*Task) GetSlc ¶ added in v0.2.1
GetSlc is wrapping MSK_getslc, Obtains the slc vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `slc` Dual variables corresponding to the lower bounds on the constraints.
func (*Task) GetSlcSlice ¶ added in v0.2.1
GetSlcSlice is wrapping MSK_getslcslice, Obtains a slice of the slc vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `slc` Dual variables corresponding to the lower bounds on the constraints.
func (*Task) GetSlx ¶ added in v0.2.1
GetSlx is wrapping MSK_getslx, Obtains the slx vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `slx` Dual variables corresponding to the lower bounds on the variables.
func (*Task) GetSlxSlice ¶ added in v0.2.1
GetSlxSlice is wrapping MSK_getslxslice, Obtains a slice of the slx vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `slx` Dual variables corresponding to the lower bounds on the variables.
func (*Task) GetSnx ¶ added in v0.2.1
GetSnx is wrapping MSK_getsnx, Obtains the snx vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `snx` Dual variables corresponding to the conic constraints on the variables.
func (*Task) GetSnxSlice ¶ added in v0.2.1
GetSnxSlice is wrapping MSK_getsnxslice, Obtains a slice of the snx vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `snx` Dual variables corresponding to the conic constraints on the variables.
func (*Task) GetSolSta ¶ added in v0.0.2
GetSolSta is wrapping MSK_getsolsta, Obtains the solution status.
Arguments:
- `whichsol` Selects a solution.
Returns:
- `solutionsta` Solution status.
func (*Task) GetSolution ¶ added in v0.2.1
func (task *Task) GetSolution( whichsol SolType, problemsta []ProSta, solutionsta []SolSta, skc []StaKey, skx []StaKey, skn []StaKey, xc []float64, xx []float64, y []float64, slc []float64, suc []float64, slx []float64, sux []float64, snx []float64, ) error
GetSolution is wrapping MSK_getsolution, Obtains the complete solution.
Arguments:
- `whichsol` Selects a solution.
- `problemsta` Problem status.
- `solutionsta` Solution status.
- `skc` Status keys for the constraints.
- `skx` Status keys for the variables.
- `skn` Status keys for the conic constraints.
- `xc` Primal constraint solution.
- `xx` Primal variable solution.
- `y` Vector of dual variables corresponding to the constraints.
- `slc` Dual variables corresponding to the lower bounds on the constraints.
- `suc` Dual variables corresponding to the upper bounds on the constraints.
- `slx` Dual variables corresponding to the lower bounds on the variables.
- `sux` Dual variables corresponding to the upper bounds on the variables.
- `snx` Dual variables corresponding to the conic constraints on the variables.
func (*Task) GetSolutionInfo ¶ added in v0.2.4
func (task *Task) GetSolutionInfo( whichsol SolType, pobj []float64, pviolcon []float64, pviolvar []float64, pviolbarvar []float64, pviolcone []float64, pviolitg []float64, dobj []float64, dviolcon []float64, dviolvar []float64, dviolbarvar []float64, dviolcone []float64, ) error
GetSolutionInfo is wrapping MSK_getsolutioninfo, Obtains information about of a solution.
Arguments:
- `whichsol` Selects a solution.
- `pobj` The primal objective value.
- `pviolcon` Maximal primal bound violation for a xc variable.
- `pviolvar` Maximal primal bound violation for a xx variable.
- `pviolbarvar` Maximal primal bound violation for a barx variable.
- `pviolcone` Maximal primal violation of the solution with respect to the conic constraints.
- `pviolitg` Maximal violation in the integer constraints.
- `dobj` Dual objective value.
- `dviolcon` Maximal dual bound violation for a xc variable.
- `dviolvar` Maximal dual bound violation for a xx variable.
- `dviolbarvar` Maximal dual bound violation for a bars variable.
- `dviolcone` Maximum violation of the dual solution in the dual conic constraints.
func (*Task) GetSolutionInfoNew ¶ added in v0.2.8
func (task *Task) GetSolutionInfoNew( whichsol SolType, pobj []float64, pviolcon []float64, pviolvar []float64, pviolbarvar []float64, pviolcone []float64, pviolacc []float64, pvioldjc []float64, pviolitg []float64, dobj []float64, dviolcon []float64, dviolvar []float64, dviolbarvar []float64, dviolcone []float64, dviolacc []float64, ) error
GetSolutionInfoNew is wrapping MSK_getsolutioninfonew, Obtains information about of a solution.
Arguments:
- `whichsol` Selects a solution.
- `pobj` The primal objective value.
- `pviolcon` Maximal primal bound violation for a xc variable.
- `pviolvar` Maximal primal bound violation for a xx variable.
- `pviolbarvar` Maximal primal bound violation for a barx variable.
- `pviolcone` Maximal primal violation of the solution with respect to the conic constraints.
- `pviolacc` Maximal primal violation of the solution with respect to the affine conic constraints.
- `pvioldjc` Maximal primal violation of the solution with respect to the disjunctive constraints.
- `pviolitg` Maximal violation in the integer constraints.
- `dobj` Dual objective value.
- `dviolcon` Maximal dual bound violation for a xc variable.
- `dviolvar` Maximal dual bound violation for a xx variable.
- `dviolbarvar` Maximal dual bound violation for a bars variable.
- `dviolcone` Maximum violation of the dual solution in the dual conic constraints.
- `dviolacc` Maximum violation of the dual solution in the dual affine conic constraints.
func (*Task) GetSolutionNew ¶ added in v0.2.2
func (task *Task) GetSolutionNew( whichsol SolType, problemsta []ProSta, solutionsta []SolSta, skc []StaKey, skx []StaKey, skn []StaKey, xc []float64, xx []float64, y []float64, slc []float64, suc []float64, slx []float64, sux []float64, snx []float64, doty []float64, ) error
GetSolutionNew is wrapping MSK_getsolutionnew, Obtains the complete solution.
Arguments:
- `whichsol` Selects a solution.
- `problemsta` Problem status.
- `solutionsta` Solution status.
- `skc` Status keys for the constraints.
- `skx` Status keys for the variables.
- `skn` Status keys for the conic constraints.
- `xc` Primal constraint solution.
- `xx` Primal variable solution.
- `y` Vector of dual variables corresponding to the constraints.
- `slc` Dual variables corresponding to the lower bounds on the constraints.
- `suc` Dual variables corresponding to the upper bounds on the constraints.
- `slx` Dual variables corresponding to the lower bounds on the variables.
- `sux` Dual variables corresponding to the upper bounds on the variables.
- `snx` Dual variables corresponding to the conic constraints on the variables.
- `doty` Dual variables corresponding to affine conic constraints.
func (*Task) GetSolutionSlice ¶ added in v0.2.1
func (task *Task) GetSolutionSlice( whichsol SolType, solitem SolItem, first int32, last int32, values []float64, ) error
GetSolutionSlice is wrapping MSK_getsolutionslice, Obtains a slice of the solution.
Arguments:
- `whichsol` Selects a solution.
- `solitem` Which part of the solution is required.
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `values` The values of the requested solution elements.
func (*Task) GetSparseSymMat ¶ added in v0.2.8
func (task *Task) GetSparseSymMat( idx int64, maxlen int64, subi []int32, subj []int32, valij []float64, ) error
GetSparseSymMat is wrapping MSK_getsparsesymmat, Gets a single symmetric matrix from the matrix store.
Arguments:
- `idx` Index of the matrix to retrieve.
- `subi` Row subscripts of the matrix non-zero elements.
- `subj` Column subscripts of the matrix non-zero elements.
- `valij` Coefficients of the matrix non-zero elements.
func (*Task) GetStrParam ¶ added in v0.2.6
GetStrParam is wrapping MSK_getstrparam, Obtains the value of a string parameter.
Arguments:
- `param` Which parameter.
- `len` The length of the parameter value.
Returns:
- `parvalue` If this is not a null pointer, the parameter value is stored here.
func (*Task) GetStrParamLen ¶ added in v0.2.6
GetStrParamLen is wrapping MSK_getstrparamlen, Obtains the length of a string parameter.
Arguments:
- `param` Which parameter.
Returns:
- `len` The length of the parameter value.
func (*Task) GetSuc ¶ added in v0.2.1
GetSuc is wrapping MSK_getsuc, Obtains the suc vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `suc` Dual variables corresponding to the upper bounds on the constraints.
func (*Task) GetSucSlice ¶ added in v0.2.1
GetSucSlice is wrapping MSK_getsucslice, Obtains a slice of the suc vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `suc` Dual variables corresponding to the upper bounds on the constraints.
func (*Task) GetSux ¶ added in v0.2.1
GetSux is wrapping MSK_getsux, Obtains the sux vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `sux` Dual variables corresponding to the upper bounds on the variables.
func (*Task) GetSuxSlice ¶ added in v0.2.1
GetSuxSlice is wrapping MSK_getsuxslice, Obtains a slice of the sux vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `sux` Dual variables corresponding to the upper bounds on the variables.
func (*Task) GetSymMatInfo ¶ added in v0.2.8
GetSymMatInfo is wrapping MSK_getsymmatinfo, Obtains information about a matrix from the symmetric matrix storage.
Arguments:
- `idx` Index of the matrix for which information is requested.
- `dim` Returns the dimension of the requested matrix.
- `nz` Returns the number of non-zeros in the requested matrix.
- `mattype` Returns the type of the requested matrix.
func (*Task) GetSymbCon ¶ added in v0.2.8
GetSymbCon is wrapping MSK_getsymbcon, Obtains a cone type string identifier.
Arguments:
- `i` Index.
- `value` The corresponding value.
Returns:
- `name` Name of the i'th symbolic constant.
func (*Task) GetTaskName ¶ added in v0.2.2
GetTaskName is wrapping MSK_gettaskname, Obtains the task name.
Returns:
- `taskname` Returns the task name.
func (*Task) GetTaskNameLen ¶ added in v0.2.3
GetTaskNameLen is wrapping MSK_gettasknamelen, Obtains the length the task name.
Returns:
- `len` Returns the length of the task name.
func (*Task) GetVarBound ¶ added in v0.2.8
GetVarBound is wrapping MSK_getvarbound, Obtains bound information for one variable.
Arguments:
- `i` Index of the variable for which the bound information should be obtained.
- `bk` Bound keys.
- `bl` Values for lower bounds.
- `bu` Values for upper bounds.
func (*Task) GetVarBoundSlice ¶ added in v0.2.8
func (task *Task) GetVarBoundSlice( first int32, last int32, bk []BoundKey, bl []float64, bu []float64, ) error
GetVarBoundSlice is wrapping MSK_getvarboundslice, Obtains bounds information for a slice of the variables.
Arguments:
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `bk` Bound keys.
- `bl` Values for lower bounds.
- `bu` Values for upper bounds.
func (*Task) GetVarName ¶ added in v0.2.2
GetVarName is wrapping MSK_getvarname, Obtains the name of a variable.
Arguments:
- `j` Index of a variable.
Returns:
- `name` Returns the required name.
func (*Task) GetVarNameIndex ¶ added in v0.2.8
GetVarNameIndex is wrapping MSK_getvarnameindex, Checks whether the name has been assigned to any variable.
Arguments:
- `somename` The name which should be checked.
- `asgn` Is non-zero if the name somename is assigned to a variable.
Returns:
- `index` If the name somename is assigned to a variable, then return the index of the variable.
func (*Task) GetVarNameLen ¶ added in v0.2.3
GetVarNameLen is wrapping MSK_getvarnamelen, Obtains the length of the name of a variable.
Arguments:
- `i` Index of a variable.
Returns:
- `len` Returns the length of the indicated name.
func (*Task) GetVarType ¶ added in v0.2.2
func (task *Task) GetVarType( j int32, ) (vartype VariableType, r error)
GetVarType is wrapping MSK_getvartype, Gets the variable type of one variable.
Arguments:
- `j` Index of the variable.
Returns:
- `vartype` Variable type of variable index j.
func (*Task) GetVarTypeList ¶ added in v0.2.2
func (task *Task) GetVarTypeList( num int32, subj []int32, vartype []VariableType, ) error
GetVarTypeList is wrapping MSK_getvartypelist, Obtains the variable type for one or more variables.
Arguments:
- `subj` A list of variable indexes.
- `vartype` Returns the variables types corresponding the variable indexes requested.
func (*Task) GetXc ¶ added in v0.2.1
GetXc is wrapping MSK_getxc, Obtains the xc vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `xc` Primal constraint solution.
func (*Task) GetXcSlice ¶ added in v0.2.1
GetXcSlice is wrapping MSK_getxcslice, Obtains a slice of the xc vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `xc` Primal constraint solution.
func (*Task) GetXx ¶ added in v0.0.2
GetXx wraps MSK_getxx, which gets the solution from the task. xx can be nil, in which case the number of variables will be queried from the task and a new slice created.
func (*Task) GetXxSlice ¶ added in v0.0.9
GetXxSlice wraps MSK_getxxslice, which gets a slice of the solution. xx can be nil, in which case the number of variables will be last - first and a new slice will be created.
func (*Task) GetY ¶ added in v0.2.1
GetY is wrapping MSK_gety, Obtains the y vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `y` Vector of dual variables corresponding to the constraints.
func (*Task) GetYSlice ¶ added in v0.2.1
GetYSlice is wrapping MSK_getyslice, Obtains a slice of the y vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `y` Vector of dual variables corresponding to the constraints.
func (*Task) InfeasibilityReport ¶ added in v0.2.8
func (task *Task) InfeasibilityReport( whichstream StreamType, whichsol SolType, ) error
InfeasibilityReport is wrapping MSK_infeasibilityreport, Prints the infeasibility report to an output stream.
Arguments:
- `whichstream` Index of the stream.
- `whichsol` Selects a solution.
func (*Task) InitBasisSolve ¶ added in v0.2.8
InitBasisSolve is wrapping MSK_initbasissolve, Prepare a task for basis solver.
Arguments:
- `basis` The array of basis indexes to use.
func (*Task) InputData ¶ added in v0.1.2
func (task *Task) InputData( maxnumcon int32, maxnumvar int32, numcon int32, numvar int32, c []float64, cfix float64, aptrb []int32, aptre []int32, asub []int32, aval []float64, bkc []BoundKey, blc []float64, buc []float64, bkx []BoundKey, blx []float64, bux []float64, ) error
InputData is wrapping MSK_inputdata, Input the linear part of an optimization task in one function call.
Arguments:
- `maxnumcon` Number of preallocated constraints in the optimization task.
- `maxnumvar` Number of preallocated variables in the optimization task.
- `c` Linear terms of the objective as a dense vector. The length is the number of variables.
- `cfix` Fixed term in the objective.
- `aptrb` Row or column start pointers.
- `aptre` Row or column end pointers.
- `asub` Coefficient subscripts.
- `aval` Coefficient values.
- `bkc` Bound keys for the constraints.
- `blc` Lower bounds for the constraints.
- `buc` Upper bounds for the constraints.
- `bkx` Bound keys for the variables.
- `blx` Lower bounds for the variables.
- `bux` Upper bounds for the variables.
func (*Task) Inputdata64 ¶ added in v0.2.0
func (task *Task) Inputdata64( maxnumcon int32, maxnumvar int32, numcon int32, numvar int32, c []float64, cfix float64, aptrb []int64, aptre []int64, asub []int32, aval []float64, bkc []BoundKey, blc []float64, buc []float64, bkx []BoundKey, blx []float64, bux []float64, ) error
Inputdata64 is wrapping MSK_inputdata64
func (*Task) IsDouParName ¶ added in v0.2.8
IsDouParName is wrapping MSK_isdouparname, Checks a double parameter name.
Arguments:
- `parname` Parameter name.
- `param` Returns the parameter corresponding to the name, if one exists.
func (*Task) IsIntParName ¶ added in v0.2.8
IsIntParName is wrapping MSK_isintparname, Checks an integer parameter name.
Arguments:
- `parname` Parameter name.
- `param` Returns the parameter corresponding to the name, if one exists.
func (*Task) IsStrParName ¶ added in v0.2.8
IsStrParName is wrapping MSK_isstrparname, Checks a string parameter name.
Arguments:
- `parname` Parameter name.
- `param` Returns the parameter corresponding to the name, if one exists.
func (*Task) LinkFiletotaskstream ¶ added in v0.2.2
func (task *Task) LinkFiletotaskstream( whichstream StreamType, filename string, append int32, ) error
LinkFiletotaskstream is wrapping MSK_linkfiletotaskstream
func (*Task) LinkFuncToTaskStream ¶ added in v0.0.4
func (task *Task) LinkFuncToTaskStream(whichstream StreamType, w io.Writer) error
LinkFuncToTaskStream wraps MSK_linkfuctotaskstream using io.Writer instead of callbacks.
func (*Task) OneSolutionSummary ¶ added in v0.2.8
func (task *Task) OneSolutionSummary( whichstream StreamType, whichsol SolType, ) error
OneSolutionSummary is wrapping MSK_onesolutionsummary, Prints a short summary of a specified solution.
Arguments:
- `whichstream` Index of the stream.
- `whichsol` Selects a solution.
func (*Task) Optimize ¶ added in v0.2.0
Optimize is wrapping MSK_optimize, Optimizes the problem.
Returns:
- `trmcode` Is either OK or a termination response code.
func (*Task) OptimizeRmt ¶ added in v0.2.6
OptimizeRmt is wrapping MSK_optimizermt, Offload the optimization task to a solver server and wait for the solution.
Arguments:
- `address` Address of the OptServer.
- `accesstoken` Access token.
- `trmcode` Is either OK or a termination response code.
func (*Task) OptimizeTrm ¶ added in v0.2.2
OptimizeTrm is wrapping MSK_optimizetrm, Optimizes the problem.
Returns:
- `trmcode` Is either OK or a termination response code.
func (*Task) OptimizerSummary ¶ added in v0.2.3
func (task *Task) OptimizerSummary( whichstream StreamType, ) error
OptimizerSummary is wrapping MSK_optimizersummary, Prints a short summary with optimizer statistics from last optimization.
Arguments:
- `whichstream` Index of the stream.
func (*Task) PrimalRepair ¶ added in v0.2.6
PrimalRepair is wrapping MSK_primalrepair, Repairs a primal infeasible optimization problem by adjusting the bounds on the constraints and variables.
Arguments:
- `wlc` Weights associated with relaxing lower bounds on the constraints.
- `wuc` Weights associated with relaxing the upper bound on the constraints.
- `wlx` Weights associated with relaxing the lower bounds of the variables.
- `wux` Weights associated with relaxing the upper bounds of variables.
func (*Task) PrimalSensitivity ¶ added in v0.2.6
func (task *Task) PrimalSensitivity( numi int32, subi []int32, marki []Mark, numj int32, subj []int32, markj []Mark, leftpricei []float64, rightpricei []float64, leftrangei []float64, rightrangei []float64, leftpricej []float64, rightpricej []float64, leftrangej []float64, rightrangej []float64, ) error
PrimalSensitivity is wrapping MSK_primalsensitivity, Perform sensitivity analysis on bounds.
Arguments:
- `subi` Indexes of constraints to analyze.
- `marki` Mark which constraint bounds to analyze.
- `subj` Indexes of variables to analyze.
- `markj` Mark which variable bounds to analyze.
- `leftpricei` Left shadow price for constraints.
- `rightpricei` Right shadow price for constraints.
- `leftrangei` Left range for constraints.
- `rightrangei` Right range for constraints.
- `leftpricej` Left shadow price for variables.
- `rightpricej` Right shadow price for variables.
- `leftrangej` Left range for variables.
- `rightrangej` Right range for variables.
func (*Task) PrintParam ¶ added in v0.2.2
PrintParam is wrapping MSK_printparam, Prints the current parameter settings.
func (*Task) ProStaToStr ¶ added in v0.2.5
ProStaToStr is wrapping MSK_prostatostr
func (*Task) ProbtypeToStr ¶ added in v0.2.5
func (task *Task) ProbtypeToStr( probtype ProblemType, ) (str string, r error)
ProbtypeToStr is wrapping MSK_probtypetostr
func (*Task) PutACol ¶ added in v0.0.2
PutACol is wrapping MSK_putacol, Replaces all elements in one column of the linear constraint matrix.
Arguments:
- `j` Column index.
- `subj` Row indexes of non-zero values in column.
- `valj` New non-zero values of column.
func (*Task) PutAColList ¶ added in v0.2.2
func (task *Task) PutAColList( num int32, sub []int32, ptrb []int32, ptre []int32, asub []int32, aval []float64, ) error
PutAColList is wrapping MSK_putacollist, Replaces all elements in several columns the linear constraint matrix.
Arguments:
- `sub` Indexes of columns that should be replaced.
- `ptrb` Array of pointers to the first element in the columns.
- `ptre` Array of pointers to the last element plus one in the columns.
- `asub` Row indexes
- `aval` Coefficient values.
func (*Task) PutAColList64 ¶ added in v0.2.2
func (task *Task) PutAColList64( num int32, sub []int32, ptrb []int64, ptre []int64, asub []int32, aval []float64, ) error
PutAColList64 is wrapping MSK_putacollist64
func (*Task) PutAColSlice ¶ added in v0.2.2
func (task *Task) PutAColSlice( first int32, last int32, ptrb []int32, ptre []int32, asub []int32, aval []float64, ) error
PutAColSlice is wrapping MSK_putacolslice, Replaces all elements in a sequence of columns the linear constraint matrix.
Arguments:
- `first` First column in the slice.
- `last` Last column plus one in the slice.
- `ptrb` Array of pointers to the first element in the columns.
- `ptre` Array of pointers to the last element plus one in the columns.
- `asub` Row indexes
- `aval` Coefficient values.
func (*Task) PutAColSlice64 ¶ added in v0.2.2
func (task *Task) PutAColSlice64( first int32, last int32, ptrb []int64, ptre []int64, asub []int32, aval []float64, ) error
PutAColSlice64 is wrapping MSK_putacolslice64
func (*Task) PutARow ¶ added in v0.1.1
PutARow is wrapping MSK_putarow, Replaces all elements in one row of the linear constraint matrix.
Arguments:
- `i` Row index.
- `subi` Column indexes of non-zero values in row.
- `vali` New non-zero values of row.
func (*Task) PutARowList ¶ added in v0.2.2
func (task *Task) PutARowList( num int32, sub []int32, ptrb []int32, ptre []int32, asub []int32, aval []float64, ) error
PutARowList is wrapping MSK_putarowlist, Replaces all elements in several rows of the linear constraint matrix.
Arguments:
- `sub` Indexes of rows or columns that should be replaced.
- `ptrb` Array of pointers to the first element in the rows.
- `ptre` Array of pointers to the last element plus one in the rows.
- `asub` Variable indexes.
- `aval` Coefficient values.
func (*Task) PutARowList64 ¶ added in v0.2.2
func (task *Task) PutARowList64( num int32, sub []int32, ptrb []int64, ptre []int64, asub []int32, aval []float64, ) error
PutARowList64 is wrapping MSK_putarowlist64
func (*Task) PutARowSlice ¶ added in v0.2.2
func (task *Task) PutARowSlice( first int32, last int32, ptrb []int32, ptre []int32, asub []int32, aval []float64, ) error
PutARowSlice is wrapping MSK_putarowslice, Replaces all elements in several rows the linear constraint matrix.
Arguments:
- `first` First row in the slice.
- `last` Last row plus one in the slice.
- `ptrb` Array of pointers to the first element in the rows.
- `ptre` Array of pointers to the last element plus one in the rows.
- `asub` Column indexes of new elements.
- `aval` Coefficient values.
func (*Task) PutARowSlice64 ¶ added in v0.2.2
func (task *Task) PutARowSlice64( first int32, last int32, ptrb []int64, ptre []int64, asub []int32, aval []float64, ) error
PutARowSlice64 is wrapping MSK_putarowslice64
func (*Task) PutATruncateTol ¶ added in v0.2.8
PutATruncateTol is wrapping MSK_putatruncatetol, Truncates all elements in A below a certain tolerance to zero.
Arguments:
- `tolzero` Truncation tolerance.
func (*Task) PutAcc ¶ added in v0.2.1
func (task *Task) PutAcc( accidx int64, domidx int64, numafeidx int64, afeidxlist []int64, b []float64, ) error
PutAcc is wrapping MSK_putacc, Puts an affine conic constraint.
Arguments:
- `accidx` Affine conic constraint index.
- `domidx` Domain index.
- `afeidxlist` List of affine expression indexes.
- `b` The vector of constant terms added to affine expressions. Optional, can be NULL.
func (*Task) PutAccB ¶ added in v0.2.8
PutAccB is wrapping MSK_putaccb, Puts the constant vector b in an affine conic constraint.
Arguments:
- `accidx` Affine conic constraint index.
- `b` The vector of constant terms added to affine expressions. Optional, can be NULL.
func (*Task) PutAccBJ ¶ added in v0.2.8
PutAccBJ is wrapping MSK_putaccbj, Sets one element in the b vector of an affine conic constraint.
Arguments:
- `accidx` Affine conic constraint index.
- `j` The index of an element in b to change.
- `bj` The new value of b\[j\].
func (*Task) PutAccDotY ¶ added in v0.2.4
PutAccDotY is wrapping MSK_putaccdoty, Puts the doty vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `accidx` The index of the affine conic constraint.
- `doty` The dual values for this affine conic constraint. The array should have length equal to the dimension of the constraint.
func (*Task) PutAccList ¶ added in v0.2.1
func (task *Task) PutAccList( numaccs int64, accidxs []int64, domidxs []int64, numafeidx int64, afeidxlist []int64, b []float64, ) error
PutAccList is wrapping MSK_putacclist, Puts a number of affine conic constraints.
Arguments:
- `accidxs` Affine conic constraint indices.
- `domidxs` Domain indices.
- `afeidxlist` List of affine expression indexes.
- `b` The vector of constant terms added to affine expressions. Optional, can be NULL.
func (*Task) PutAccName ¶ added in v0.0.9
PutAccName is wrapping MSK_putaccname, Sets the name of an affine conic constraint.
Arguments:
- `accidx` Index of the affine conic constraint.
- `name` The name of the affine conic constraint.
func (*Task) PutAfeBarfBlockTriplet ¶ added in v0.2.8
func (task *Task) PutAfeBarfBlockTriplet( numtrip int64, afeidx []int64, barvaridx []int32, subk []int32, subl []int32, valkl []float64, ) error
PutAfeBarfBlockTriplet is wrapping MSK_putafebarfblocktriplet, Inputs barF in block triplet form.
Arguments:
- `afeidx` Constraint index.
- `barvaridx` Symmetric matrix variable index.
- `subk` Block row index.
- `subl` Block column index.
- `valkl` The numerical value associated with each block triplet.
func (*Task) PutAfeBarfEntry ¶ added in v0.2.8
func (task *Task) PutAfeBarfEntry( afeidx int64, barvaridx int32, numterm int64, termidx []int64, termweight []float64, ) error
PutAfeBarfEntry is wrapping MSK_putafebarfentry, Inputs one entry in barF.
Arguments:
- `afeidx` Row index of barF.
- `barvaridx` Semidefinite variable index.
- `termidx` Element indices in matrix storage.
- `termweight` Weights in the weighted sum.
func (*Task) PutAfeBarfEntryList ¶ added in v0.2.8
func (task *Task) PutAfeBarfEntryList( numafeidx int64, afeidx []int64, barvaridx []int32, numterm []int64, ptrterm []int64, lenterm int64, termidx []int64, termweight []float64, ) error
PutAfeBarfEntryList is wrapping MSK_putafebarfentrylist, Inputs a list of entries in barF.
Arguments:
- `afeidx` Row indexes of barF.
- `barvaridx` Semidefinite variable indexes.
- `numterm` Number of terms in the weighted sums.
- `ptrterm` Pointer to the terms forming each entry.
- `termidx` Concatenated element indexes in matrix storage.
- `termweight` Concatenated weights in the weighted sum.
func (*Task) PutAfeBarfRow ¶ added in v0.2.8
func (task *Task) PutAfeBarfRow( afeidx int64, numentr int32, barvaridx []int32, numterm []int64, ptrterm []int64, lenterm int64, termidx []int64, termweight []float64, ) error
PutAfeBarfRow is wrapping MSK_putafebarfrow, Inputs a row of barF.
Arguments:
- `afeidx` Row index of barF.
- `barvaridx` Semidefinite variable indexes.
- `numterm` Number of terms in the weighted sums.
- `ptrterm` Pointer to the terms forming each entry.
- `termidx` Concatenated element indexes in matrix storage.
- `termweight` Concatenated weights in the weighted sum.
func (*Task) PutAfeFCol ¶ added in v0.0.10
PutAfeFCol is wrapping MSK_putafefcol, Replaces all elements in one column of the F matrix in the affine expressions.
Arguments:
- `varidx` Column index.
- `afeidx` Row indexes of non-zero values in the column.
- `val` New non-zero values in the column.
func (*Task) PutAfeFEntry ¶ added in v0.0.6
PutAfeFEntry is wrapping MSK_putafefentry, Replaces one entry in F.
Arguments:
- `afeidx` Row index in F.
- `varidx` Column index in F.
- `value` Value of the entry.
func (*Task) PutAfeFEntryList ¶ added in v0.0.4
func (task *Task) PutAfeFEntryList( numentr int64, afeidx []int64, varidx []int32, val []float64, ) error
PutAfeFEntryList is wrapping MSK_putafefentrylist, Replaces a list of entries in F.
Arguments:
- `afeidx` Row indices in F.
- `varidx` Column indices in F.
- `val` Values of the entries in F.
func (*Task) PutAfeFRow ¶ added in v0.0.9
PutAfeFRow is wrapping MSK_putafefrow, Replaces all elements in one row of the F matrix in the affine expressions.
Arguments:
- `afeidx` Row index.
- `varidx` Column indexes of non-zero values in the row.
- `val` New non-zero values in the row.
func (*Task) PutAfeFRowList ¶ added in v0.2.2
func (task *Task) PutAfeFRowList( numafeidx int64, afeidx []int64, numnzrow []int32, ptrrow []int64, lenidxval int64, varidx []int32, val []float64, ) error
PutAfeFRowList is wrapping MSK_putafefrowlist, Replaces all elements in a number of rows of the F matrix in the affine expressions.
Arguments:
- `afeidx` Row indices.
- `numnzrow` Number of non-zeros in each row.
- `ptrrow` Pointer to the first nonzero in each row.
- `varidx` Column indexes of non-zero values.
- `val` New non-zero values in the rows.
func (*Task) PutAfeG ¶ added in v0.0.4
PutAfeG is wrapping MSK_putafeg, Replaces one element in the g vector in the affine expressions.
Arguments:
- `afeidx` Row index.
- `g` New value for the element of g.
func (*Task) PutAfeGList ¶ added in v0.2.2
PutAfeGList is wrapping MSK_putafeglist, Replaces a list of elements in the g vector in the affine expressions.
Arguments:
- `afeidx` Indices of entries in g.
- `g` New values for the elements of g.
func (*Task) PutAfeGSlice ¶ added in v0.0.4
PutAfeGSlice is wrapping MSK_putafegslice, Modifies a slice of the vector g.
Arguments:
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `slice` The slice of g as a dense vector.
func (*Task) PutAij ¶ added in v0.0.4
PutAij is wrapping MSK_putaij, Changes a single value in the linear coefficient matrix.
Arguments:
- `i` Constraint (row) index.
- `j` Variable (column) index.
- `aij` New coefficient.
func (*Task) PutAijList ¶ added in v0.1.1
PutAijList is wrapping MSK_putaijlist, Changes one or more coefficients in the linear constraint matrix.
Arguments:
- `subi` Constraint (row) indices.
- `subj` Variable (column) indices.
- `valij` New coefficient values.
func (*Task) PutAijList64 ¶ added in v0.2.2
PutAijList64 is wrapping MSK_putaijlist64
func (*Task) PutBaraBlockTriplet ¶ added in v0.2.8
func (task *Task) PutBaraBlockTriplet( num int64, subi []int32, subj []int32, subk []int32, subl []int32, valijkl []float64, ) error
PutBaraBlockTriplet is wrapping MSK_putbarablocktriplet, Inputs barA in block triplet form.
Arguments:
- `subi` Constraint index.
- `subj` Symmetric matrix variable index.
- `subk` Block row index.
- `subl` Block column index.
- `valijkl` The numerical value associated with each block triplet.
func (*Task) PutBaraIj ¶ added in v0.2.8
PutBaraIj is wrapping MSK_putbaraij, Inputs an element of barA.
Arguments:
- `i` Row index of barA.
- `j` Column index of barA.
- `sub` Element indexes in matrix storage.
- `weights` Weights in the weighted sum.
func (*Task) PutBaraIjList ¶ added in v0.2.8
func (task *Task) PutBaraIjList( num int32, subi []int32, subj []int32, alphaptrb []int64, alphaptre []int64, matidx []int64, weights []float64, ) error
PutBaraIjList is wrapping MSK_putbaraijlist, Inputs list of elements of barA.
Arguments:
- `subi` Row index of barA.
- `subj` Column index of barA.
- `alphaptrb` Start entries for terms in the weighted sum.
- `alphaptre` End entries for terms in the weighted sum.
- `matidx` Element indexes in matrix storage.
- `weights` Weights in the weighted sum.
func (*Task) PutBaraRowList ¶ added in v0.2.8
func (task *Task) PutBaraRowList( num int32, subi []int32, ptrb []int64, ptre []int64, subj []int32, nummat []int64, matidx []int64, weights []float64, ) error
PutBaraRowList is wrapping MSK_putbararowlist, Replace a set of rows of barA
Arguments:
- `subi` Row indexes of barA.
- `ptrb` Start of rows in barA.
- `ptre` End of rows in barA.
- `subj` Column index of barA.
- `nummat` Number of entries in weighted sum of matrixes.
- `matidx` Matrix indexes for weighted sum of matrixes.
- `weights` Weights for weighted sum of matrixes.
func (*Task) PutBarcBlockTriplet ¶ added in v0.2.8
func (task *Task) PutBarcBlockTriplet( num int64, subj []int32, subk []int32, subl []int32, valjkl []float64, ) error
PutBarcBlockTriplet is wrapping MSK_putbarcblocktriplet, Inputs barC in block triplet form.
Arguments:
- `subj` Symmetric matrix variable index.
- `subk` Block row index.
- `subl` Block column index.
- `valjkl` The numerical value associated with each block triplet.
func (*Task) PutBarcJ ¶ added in v0.2.8
PutBarcJ is wrapping MSK_putbarcj, Changes one element in barc.
Arguments:
- `j` Index of the element in barc` that should be changed.
- `sub` sub is list of indexes of those symmetric matrices appearing in sum.
- `weights` The weights of the terms in the weighted sum.
func (*Task) PutBarsJ ¶ added in v0.2.8
PutBarsJ is wrapping MSK_putbarsj, Sets the dual solution for a semidefinite variable.
Arguments:
- `whichsol` Selects a solution.
- `j` Index of the semidefinite variable.
- `barsj` Value of the j'th variable of barx.
func (*Task) PutBarvarName ¶ added in v0.2.2
PutBarvarName is wrapping MSK_putbarvarname, Sets the name of a semidefinite variable.
Arguments:
- `j` Index of the variable.
- `name` The variable name.
func (*Task) PutBarxJ ¶ added in v0.2.8
PutBarxJ is wrapping MSK_putbarxj, Sets the primal solution for a semidefinite variable.
Arguments:
- `whichsol` Selects a solution.
- `j` Index of the semidefinite variable.
- `barxj` Value of the j'th variable of barx.
func (*Task) PutCJ ¶ added in v0.2.8
PutCJ is wrapping MSK_putcj, Modifies one linear coefficient in the objective.
Arguments:
- `j` Index of the variable whose objective coefficient should be changed.
- `cj` New coefficient value.
func (*Task) PutCList ¶ added in v0.1.1
PutCList is wrapping MSK_putclist, Modifies a part of the linear objective coefficients.
Arguments:
- `subj` Indices of variables for which objective coefficients should be changed.
- `val` New numerical values for the objective coefficients that should be modified.
func (*Task) PutCSlice ¶ added in v0.0.4
PutCSlice is wrapping MSK_putcslice, Modifies a slice of the linear objective coefficients.
Arguments:
- `first` First element in the slice of c.
- `last` Last element plus 1 of the slice in c to be changed.
- `slice` New numerical values for the objective coefficients that should be modified.
func (*Task) PutCfix ¶ added in v0.2.1
PutCfix is wrapping MSK_putcfix, Replaces the fixed term in the objective.
Arguments:
- `cfix` Fixed term in the objective.
func (*Task) PutConBound ¶ added in v0.0.2
PutConBound is wrapping MSK_putconbound, Changes the bound for one constraint.
Arguments:
- `i` Index of the constraint.
- `bkc` New bound key.
- `blc` New lower bound.
- `buc` New upper bound.
func (*Task) PutConBoundList ¶ added in v0.2.8
func (task *Task) PutConBoundList( num int32, sub []int32, bkc []BoundKey, blc []float64, buc []float64, ) error
PutConBoundList is wrapping MSK_putconboundlist, Changes the bounds of a list of constraints.
Arguments:
- `sub` List of constraint indexes.
- `bkc` Bound keys for the constraints.
- `blc` Lower bounds for the constraints.
- `buc` Upper bounds for the constraints.
func (*Task) PutConBoundListConst ¶ added in v0.2.8
func (task *Task) PutConBoundListConst( num int32, sub []int32, bkc BoundKey, blc float64, buc float64, ) error
PutConBoundListConst is wrapping MSK_putconboundlistconst, Changes the bounds of a list of constraints.
Arguments:
- `sub` List of constraint indexes.
- `bkc` New bound key for all constraints in the list.
- `blc` New lower bound for all constraints in the list.
- `buc` New upper bound for all constraints in the list.
func (*Task) PutConBoundSlice ¶ added in v0.2.8
func (task *Task) PutConBoundSlice( first int32, last int32, bkc []BoundKey, blc []float64, buc []float64, ) error
PutConBoundSlice is wrapping MSK_putconboundslice, Changes the bounds for a slice of the constraints.
Arguments:
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `bkc` Bound keys for the constraints.
- `blc` Lower bounds for the constraints.
- `buc` Upper bounds for the constraints.
func (*Task) PutConBoundSliceConst ¶ added in v0.2.8
func (task *Task) PutConBoundSliceConst( first int32, last int32, bkc BoundKey, blc float64, buc float64, ) error
PutConBoundSliceConst is wrapping MSK_putconboundsliceconst, Changes the bounds for a slice of the constraints.
Arguments:
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `bkc` New bound key for all constraints in the slice.
- `blc` New lower bound for all constraints in the slice.
- `buc` New upper bound for all constraints in the slice.
func (*Task) PutConName ¶ added in v0.0.9
PutConName is wrapping MSK_putconname, Sets the name of a constraint.
Arguments:
- `i` Index of the constraint.
- `name` The name of the constraint.
func (*Task) PutConSolutionI ¶ added in v0.2.8
func (task *Task) PutConSolutionI( i int32, whichsol SolType, sk StaKey, x float64, sl float64, su float64, ) error
PutConSolutionI is wrapping MSK_putconsolutioni, Sets the primal and dual solution information for a single constraint.
Arguments:
- `i` Index of the constraint.
- `whichsol` Selects a solution.
- `sk` Status key of the constraint.
- `x` Primal solution value of the constraint.
- `sl` Solution value of the dual variable associated with the lower bound.
- `su` Solution value of the dual variable associated with the upper bound.
func (*Task) PutCone
deprecated
added in
v0.2.1
func (task *Task) PutCone( k int32, ct ConeType, conepar float64, nummem int32, submem []int32, ) error
PutCone is wrapping MSK_putcone, Replaces a conic constraint.
Arguments:
- `k` Index of the cone.
- `ct` Specifies the type of the cone.
- `conepar` For the power cone it denotes the exponent alpha. For other cone types it is unused and can be set to 0.
- `submem` Variable subscripts of the members in the cone.
Deprecated: MSK_putcone/PutCone is deprecated by mosek and will be removed in a future release.
func (*Task) PutConeName
deprecated
added in
v0.2.2
PutConeName is wrapping MSK_putconename, Sets the name of a cone.
Arguments:
- `j` Index of the cone.
- `name` The name of the cone.
Deprecated: MSK_putconename/PutConeName is deprecated by mosek and will be removed in a future release.
func (*Task) PutDjc ¶ added in v0.1.3
func (task *Task) PutDjc( djcidx int64, numdomidx int64, domidxlist []int64, numafeidx int64, afeidxlist []int64, b []float64, numterms int64, termsizelist []int64, ) error
PutDjc is wrapping MSK_putdjc, Inputs a disjunctive constraint.
Arguments:
- `djcidx` Index of the disjunctive constraint.
- `domidxlist` List of domain indexes.
- `afeidxlist` List of affine expression indexes.
- `b` The vector of constant terms added to affine expressions.
- `termsizelist` List of term sizes.
func (*Task) PutDjcName ¶ added in v0.2.2
PutDjcName is wrapping MSK_putdjcname, Sets the name of a disjunctive constraint.
Arguments:
- `djcidx` Index of the disjunctive constraint.
- `name` The name of the disjunctive constraint.
func (*Task) PutDjcSlice ¶ added in v0.2.1
func (task *Task) PutDjcSlice( idxfirst int64, idxlast int64, numdomidx int64, domidxlist []int64, numafeidx int64, afeidxlist []int64, b []float64, numterms int64, termsizelist []int64, termsindjc []int64, ) error
PutDjcSlice is wrapping MSK_putdjcslice, Inputs a slice of disjunctive constraints.
Arguments:
- `idxfirst` Index of the first disjunctive constraint in the slice.
- `idxlast` Index of the last disjunctive constraint in the slice plus 1.
- `domidxlist` List of domain indexes.
- `afeidxlist` List of affine expression indexes.
- `b` The vector of constant terms added to affine expressions. Optional, may be NULL.
- `termsizelist` List of term sizes.
- `termsindjc` Number of terms in each of the disjunctive constraints in the slice.
func (*Task) PutDomainName ¶ added in v0.2.2
PutDomainName is wrapping MSK_putdomainname, Sets the name of a domain.
Arguments:
- `domidx` Index of the domain.
- `name` The name of the domain.
func (*Task) PutDouParam ¶ added in v0.1.2
PutDouParam is wrapping MSK_putdouparam, Sets a double parameter.
Arguments:
- `param` Which parameter.
- `parvalue` Parameter value.
func (*Task) PutIntParam ¶ added in v0.0.9
PutIntParam is wrapping MSK_putintparam, Sets an integer parameter.
Arguments:
- `param` Which parameter.
- `parvalue` Parameter value.
func (*Task) PutMaxNumANz ¶ added in v0.2.8
PutMaxNumANz is wrapping MSK_putmaxnumanz, Sets the number of preallocated non-zero entries in the linear coefficient matrix.
Arguments:
- `maxnumanz` New size of the storage reserved for storing the linear coefficient matrix.
func (*Task) PutMaxNumAcc ¶ added in v0.2.4
PutMaxNumAcc is wrapping MSK_putmaxnumacc, Sets the number of preallocated affine conic constraints.
Arguments:
- `maxnumacc` Number of preallocated affine conic constraints.
func (*Task) PutMaxNumAfe ¶ added in v0.2.4
PutMaxNumAfe is wrapping MSK_putmaxnumafe, Sets the number of preallocated affine expressions in the optimization task.
Arguments:
- `maxnumafe` Number of preallocated affine expressions.
func (*Task) PutMaxNumBarvar ¶ added in v0.2.4
PutMaxNumBarvar is wrapping MSK_putmaxnumbarvar, Sets the number of preallocated symmetric matrix variables.
Arguments:
- `maxnumbarvar` Number of preallocated symmetric matrix variables.
func (*Task) PutMaxNumCon ¶ added in v0.2.4
PutMaxNumCon is wrapping MSK_putmaxnumcon, Sets the number of preallocated constraints in the optimization task.
Arguments:
- `maxnumcon` Number of preallocated constraints in the optimization task.
func (*Task) PutMaxNumCone
deprecated
added in
v0.2.4
PutMaxNumCone is wrapping MSK_putmaxnumcone, Sets the number of preallocated conic constraints in the optimization task.
Arguments:
- `maxnumcone` Number of preallocated conic constraints in the optimization task.
Deprecated: MSK_putmaxnumcone/PutMaxNumCone is deprecated by mosek and will be removed in a future release.
func (*Task) PutMaxNumDjc ¶ added in v0.2.4
PutMaxNumDjc is wrapping MSK_putmaxnumdjc, Sets the number of preallocated disjunctive constraints.
Arguments:
- `maxnumdjc` Number of preallocated disjunctive constraints in the task.
func (*Task) PutMaxNumDomain ¶ added in v0.2.4
PutMaxNumDomain is wrapping MSK_putmaxnumdomain, Sets the number of preallocated domains in the optimization task.
Arguments:
- `maxnumdomain` Number of preallocated domains.
func (*Task) PutMaxNumQNz ¶ added in v0.2.8
PutMaxNumQNz is wrapping MSK_putmaxnumqnz, Sets the number of preallocated non-zero entries in quadratic terms.
Arguments:
- `maxnumqnz` Number of non-zero elements preallocated in quadratic coefficient matrices.
func (*Task) PutMaxNumVar ¶ added in v0.2.4
PutMaxNumVar is wrapping MSK_putmaxnumvar, Sets the number of preallocated variables in the optimization task.
Arguments:
- `maxnumvar` Number of preallocated variables in the optimization task.
func (*Task) PutNaDouParam ¶ added in v0.2.8
PutNaDouParam is wrapping MSK_putnadouparam, Sets a double parameter.
Arguments:
- `paramname` Name of a parameter.
- `parvalue` Parameter value.
func (*Task) PutNaIntParam ¶ added in v0.2.8
PutNaIntParam is wrapping MSK_putnaintparam, Sets an integer parameter.
Arguments:
- `paramname` Name of a parameter.
- `parvalue` Parameter value.
func (*Task) PutNaStrParam ¶ added in v0.2.8
PutNaStrParam is wrapping MSK_putnastrparam, Sets a string parameter.
Arguments:
- `paramname` Name of a parameter.
- `parvalue` Parameter value.
func (*Task) PutObjName ¶ added in v0.2.2
PutObjName is wrapping MSK_putobjname, Assigns a new name to the objective.
Arguments:
- `objname` Name of the objective.
func (*Task) PutObjSense ¶ added in v0.2.8
func (task *Task) PutObjSense( sense ObjectiveSense, ) error
PutObjSense is wrapping MSK_putobjsense, Sets the objective sense.
Arguments:
- `sense` The objective sense of the task
func (*Task) PutOptserverHost ¶ added in v0.2.8
PutOptserverHost is wrapping MSK_putoptserverhost, Specify an OptServer for remote calls.
Arguments:
- `host` A URL specifying the optimization server to be used.
func (*Task) PutParam ¶ added in v0.2.1
PutParam is wrapping MSK_putparam, Modifies the value of parameter.
Arguments:
- `parname` Parameter name.
- `parvalue` Parameter value.
func (*Task) PutQCon ¶ added in v0.2.8
func (task *Task) PutQCon( numqcnz int32, qcsubk []int32, qcsubi []int32, qcsubj []int32, qcval []float64, ) error
PutQCon is wrapping MSK_putqcon, Replaces all quadratic terms in constraints.
Arguments:
- `qcsubk` Constraint subscripts for quadratic coefficients.
- `qcsubi` Row subscripts for quadratic constraint matrix.
- `qcsubj` Column subscripts for quadratic constraint matrix.
- `qcval` Quadratic constraint coefficient values.
func (*Task) PutQConK ¶ added in v0.1.3
func (task *Task) PutQConK( k int32, numqcnz int32, qcsubi []int32, qcsubj []int32, qcval []float64, ) error
PutQConK is wrapping MSK_putqconk, Replaces all quadratic terms in a single constraint.
Arguments:
- `k` The constraint in which the new quadratic elements are inserted.
- `qcsubi` Row subscripts for quadratic constraint matrix.
- `qcsubj` Column subscripts for quadratic constraint matrix.
- `qcval` Quadratic constraint coefficient values.
func (*Task) PutQObj ¶ added in v0.1.3
PutQObj is wrapping MSK_putqobj, Replaces all quadratic terms in the objective.
Arguments:
- `qosubi` Row subscripts for quadratic objective coefficients.
- `qosubj` Column subscripts for quadratic objective coefficients.
- `qoval` Quadratic objective coefficient values.
func (*Task) PutQObjIJ ¶ added in v0.2.8
PutQObjIJ is wrapping MSK_putqobjij, Replaces one coefficient in the quadratic term in the objective.
Arguments:
- `i` Row index for the coefficient to be replaced.
- `j` Column index for the coefficient to be replaced.
- `qoij` The new coefficient value.
func (*Task) PutSkc ¶ added in v0.2.1
PutSkc is wrapping MSK_putskc, Sets the status keys for the constraints.
Arguments:
- `whichsol` Selects a solution.
- `skc` Status keys for the constraints.
func (*Task) PutSkcSlice ¶ added in v0.2.1
PutSkcSlice is wrapping MSK_putskcslice, Sets the status keys for a slice of the constraints.
Arguments:
- `whichsol` Selects a solution.
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `skc` Status keys for the constraints.
func (*Task) PutSkx ¶ added in v0.2.1
PutSkx is wrapping MSK_putskx, Sets the status keys for the scalar variables.
Arguments:
- `whichsol` Selects a solution.
- `skx` Status keys for the variables.
func (*Task) PutSkxSlice ¶ added in v0.2.1
PutSkxSlice is wrapping MSK_putskxslice, Sets the status keys for a slice of the variables.
Arguments:
- `whichsol` Selects a solution.
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `skx` Status keys for the variables.
func (*Task) PutSlc ¶ added in v0.2.1
PutSlc is wrapping MSK_putslc, Sets the slc vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `slc` Dual variables corresponding to the lower bounds on the constraints.
func (*Task) PutSlcSlice ¶ added in v0.2.1
PutSlcSlice is wrapping MSK_putslcslice, Sets a slice of the slc vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `slc` Dual variables corresponding to the lower bounds on the constraints.
func (*Task) PutSlx ¶ added in v0.2.1
PutSlx is wrapping MSK_putslx, Sets the slx vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `slx` Dual variables corresponding to the lower bounds on the variables.
func (*Task) PutSlxSlice ¶ added in v0.2.1
PutSlxSlice is wrapping MSK_putslxslice, Sets a slice of the slx vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `slx` Dual variables corresponding to the lower bounds on the variables.
func (*Task) PutSnx ¶ added in v0.2.1
PutSnx is wrapping MSK_putsnx, Sets the snx vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `sux` Dual variables corresponding to the upper bounds on the variables.
func (*Task) PutSnxSlice ¶ added in v0.2.1
PutSnxSlice is wrapping MSK_putsnxslice, Sets a slice of the snx vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `snx` Dual variables corresponding to the conic constraints on the variables.
func (*Task) PutSolution ¶ added in v0.2.1
func (task *Task) PutSolution( whichsol SolType, skc []StaKey, skx []StaKey, skn []StaKey, xc []float64, xx []float64, y []float64, slc []float64, suc []float64, slx []float64, sux []float64, snx []float64, ) error
PutSolution is wrapping MSK_putsolution, Inserts a solution.
Arguments:
- `whichsol` Selects a solution.
- `skc` Status keys for the constraints.
- `skx` Status keys for the variables.
- `skn` Status keys for the conic constraints.
- `xc` Primal constraint solution.
- `xx` Primal variable solution.
- `y` Vector of dual variables corresponding to the constraints.
- `slc` Dual variables corresponding to the lower bounds on the constraints.
- `suc` Dual variables corresponding to the upper bounds on the constraints.
- `slx` Dual variables corresponding to the lower bounds on the variables.
- `sux` Dual variables corresponding to the upper bounds on the variables.
- `snx` Dual variables corresponding to the conic constraints on the variables.
func (*Task) PutSolutionNew ¶ added in v0.2.2
func (task *Task) PutSolutionNew( whichsol SolType, skc []StaKey, skx []StaKey, skn []StaKey, xc []float64, xx []float64, y []float64, slc []float64, suc []float64, slx []float64, sux []float64, snx []float64, doty []float64, ) error
PutSolutionNew is wrapping MSK_putsolutionnew, Inserts a solution.
Arguments:
- `whichsol` Selects a solution.
- `skc` Status keys for the constraints.
- `skx` Status keys for the variables.
- `skn` Status keys for the conic constraints.
- `xc` Primal constraint solution.
- `xx` Primal variable solution.
- `y` Vector of dual variables corresponding to the constraints.
- `slc` Dual variables corresponding to the lower bounds on the constraints.
- `suc` Dual variables corresponding to the upper bounds on the constraints.
- `slx` Dual variables corresponding to the lower bounds on the variables.
- `sux` Dual variables corresponding to the upper bounds on the variables.
- `snx` Dual variables corresponding to the conic constraints on the variables.
- `doty` Dual variables corresponding to affine conic constraints.
func (*Task) PutSolutionYI ¶ added in v0.2.8
PutSolutionYI is wrapping MSK_putsolutionyi, Inputs the dual variable of a solution.
Arguments:
- `i` Index of the dual variable.
- `whichsol` Selects a solution.
- `y` Solution value of the dual variable.
func (*Task) PutStrParam ¶ added in v0.2.6
PutStrParam is wrapping MSK_putstrparam, Sets a string parameter.
Arguments:
- `param` Which parameter.
- `parvalue` Parameter value.
func (*Task) PutSuc ¶ added in v0.2.1
PutSuc is wrapping MSK_putsuc, Sets the suc vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `suc` Dual variables corresponding to the upper bounds on the constraints.
func (*Task) PutSucSlice ¶ added in v0.2.1
PutSucSlice is wrapping MSK_putsucslice, Sets a slice of the suc vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `suc` Dual variables corresponding to the upper bounds on the constraints.
func (*Task) PutSux ¶ added in v0.2.1
PutSux is wrapping MSK_putsux, Sets the sux vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `sux` Dual variables corresponding to the upper bounds on the variables.
func (*Task) PutSuxSlice ¶ added in v0.2.1
PutSuxSlice is wrapping MSK_putsuxslice, Sets a slice of the sux vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `sux` Dual variables corresponding to the upper bounds on the variables.
func (*Task) PutTaskName ¶ added in v0.2.2
PutTaskName is wrapping MSK_puttaskname, Assigns a new name to the task.
Arguments:
- `taskname` Name assigned to the task.
func (*Task) PutVarBound ¶ added in v0.2.8
PutVarBound is wrapping MSK_putvarbound, Changes the bounds for one variable.
Arguments:
- `j` Index of the variable.
- `bkx` New bound key.
- `blx` New lower bound.
- `bux` New upper bound.
func (*Task) PutVarBoundList ¶ added in v0.2.8
func (task *Task) PutVarBoundList( num int32, sub []int32, bkx []BoundKey, blx []float64, bux []float64, ) error
PutVarBoundList is wrapping MSK_putvarboundlist, Changes the bounds of a list of variables.
Arguments:
- `sub` List of variable indexes.
- `bkx` Bound keys for the variables.
- `blx` Lower bounds for the variables.
- `bux` Upper bounds for the variables.
func (*Task) PutVarBoundListConst ¶ added in v0.2.8
func (task *Task) PutVarBoundListConst( num int32, sub []int32, bkx BoundKey, blx float64, bux float64, ) error
PutVarBoundListConst is wrapping MSK_putvarboundlistconst, Changes the bounds of a list of variables.
Arguments:
- `sub` List of variable indexes.
- `bkx` New bound key for all variables in the list.
- `blx` New lower bound for all variables in the list.
- `bux` New upper bound for all variables in the list.
func (*Task) PutVarBoundSlice ¶ added in v0.2.8
func (task *Task) PutVarBoundSlice( first int32, last int32, bkx []BoundKey, blx []float64, bux []float64, ) error
PutVarBoundSlice is wrapping MSK_putvarboundslice, Changes the bounds for a slice of the variables.
Arguments:
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `bkx` Bound keys for the variables.
- `blx` Lower bounds for the variables.
- `bux` Upper bounds for the variables.
func (*Task) PutVarBoundSliceConst ¶ added in v0.2.8
func (task *Task) PutVarBoundSliceConst( first int32, last int32, bkx BoundKey, blx float64, bux float64, ) error
PutVarBoundSliceConst is wrapping MSK_putvarboundsliceconst, Changes the bounds for a slice of the variables.
Arguments:
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `bkx` New bound key for all variables in the slice.
- `blx` New lower bound for all variables in the slice.
- `bux` New upper bound for all variables in the slice.
func (*Task) PutVarName ¶ added in v0.0.9
PutVarName is wrapping MSK_putvarname, Sets the name of a variable.
Arguments:
- `j` Index of the variable.
- `name` The variable name.
func (*Task) PutVarSolutionJ ¶ added in v0.2.8
func (task *Task) PutVarSolutionJ( j int32, whichsol SolType, sk StaKey, x float64, sl float64, su float64, sn float64, ) error
PutVarSolutionJ is wrapping MSK_putvarsolutionj, Sets the primal and dual solution information for a single variable.
Arguments:
- `j` Index of the variable.
- `whichsol` Selects a solution.
- `sk` Status key of the variable.
- `x` Primal solution value of the variable.
- `sl` Solution value of the dual variable associated with the lower bound.
- `su` Solution value of the dual variable associated with the upper bound.
- `sn` Solution value of the dual variable associated with the conic constraint.
func (*Task) PutVarType ¶ added in v0.0.10
func (task *Task) PutVarType( j int32, vartype VariableType, ) error
PutVarType is wrapping MSK_putvartype, Sets the variable type of one variable.
Arguments:
- `j` Index of the variable.
- `vartype` The new variable type.
func (*Task) PutVarTypeList ¶ added in v0.1.2
func (task *Task) PutVarTypeList( num int32, subj []int32, vartype []VariableType, ) error
PutVarTypeList is wrapping MSK_putvartypelist, Sets the variable type for one or more variables.
Arguments:
- `subj` A list of variable indexes for which the variable type should be changed.
- `vartype` A list of variable types.
func (*Task) PutXc ¶ added in v0.2.1
PutXc is wrapping MSK_putxc, Sets the xc vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `xc` Primal constraint solution.
func (*Task) PutXcSlice ¶ added in v0.2.1
PutXcSlice is wrapping MSK_putxcslice, Sets a slice of the xc vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `xc` Primal constraint solution.
func (*Task) PutXx ¶ added in v0.2.1
PutXx is wrapping MSK_putxx, Sets the xx vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `xx` Primal variable solution.
func (*Task) PutXxSlice ¶ added in v0.2.1
PutXxSlice is wrapping MSK_putxxslice, Sets a slice of the xx vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `xx` Primal variable solution.
func (*Task) PutY ¶ added in v0.2.1
PutY is wrapping MSK_puty, Sets the y vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `y` Vector of dual variables corresponding to the constraints.
func (*Task) PutYSlice ¶ added in v0.2.1
PutYSlice is wrapping MSK_putyslice, Sets a slice of the y vector for a solution.
Arguments:
- `whichsol` Selects a solution.
- `first` First index in the sequence.
- `last` Last index plus 1 in the sequence.
- `y` Vector of dual variables corresponding to the constraints.
func (*Task) ReadBSolution ¶ added in v0.2.8
func (task *Task) ReadBSolution( filename string, compress CompressType, ) error
ReadBSolution is wrapping MSK_readbsolution, Read a binary dump of the task solution and information items.
Arguments:
- `filename` A valid file name.
- `compress` Data compression type.
func (*Task) ReadData ¶ added in v0.0.7
ReadData is wrapping MSK_readdata, Reads problem data from a file.
Arguments:
- `filename` A valid file name.
func (*Task) ReadDataFormat ¶ added in v0.2.8
func (task *Task) ReadDataFormat( filename string, format DataFormat, compress CompressType, ) error
ReadDataFormat is wrapping MSK_readdataformat, Reads problem data from a file.
Arguments:
- `filename` A valid file name.
- `format` File data format.
- `compress` File compression type.
func (*Task) ReadDataautoformat ¶ added in v0.2.2
ReadDataautoformat is wrapping MSK_readdataautoformat
func (*Task) ReadJsonSol ¶ added in v0.2.8
ReadJsonSol is wrapping MSK_readjsonsol, Reads a solution from a JSOL file.
Arguments:
- `filename` A valid file name.
func (*Task) ReadJsonString ¶ added in v0.2.8
ReadJsonString is wrapping MSK_readjsonstring, Load task data from a string in JSON format.
Arguments:
- `data` Problem data in text format.
func (*Task) ReadLpString ¶ added in v0.2.8
ReadLpString is wrapping MSK_readlpstring, Load task data from a string in LP format.
Arguments:
- `data` Problem data in text format.
func (*Task) ReadOpfString ¶ added in v0.2.8
ReadOpfString is wrapping MSK_readopfstring, Load task data from a string in OPF format.
Arguments:
- `data` Problem data in text format.
func (*Task) ReadParamFile ¶ added in v0.2.3
ReadParamFile is wrapping MSK_readparamfile, Reads a parameter file.
Arguments:
- `filename` A valid file name.
func (*Task) ReadPtfString ¶ added in v0.2.8
ReadPtfString is wrapping MSK_readptfstring, Load task data from a string in PTF format.
Arguments:
- `data` Problem data in text format.
func (*Task) ReadSolution ¶ added in v0.2.2
ReadSolution is wrapping MSK_readsolution, Reads a solution from a file.
Arguments:
- `whichsol` Selects a solution.
- `filename` A valid file name.
func (*Task) ReadSolutionFile ¶ added in v0.2.3
ReadSolutionFile is wrapping MSK_readsolutionfile, Read solution file in format determined by the filename
Arguments:
- `filename` A valid file name.
func (*Task) ReadSummary ¶ added in v0.2.2
func (task *Task) ReadSummary( whichstream StreamType, ) error
ReadSummary is wrapping MSK_readsummary, Prints information about last file read.
Arguments:
- `whichstream` Index of the stream.
func (*Task) ReadTask ¶ added in v0.2.2
ReadTask is wrapping MSK_readtask, Load task data from a file.
Arguments:
- `filename` A valid file name.
func (*Task) RemoveBarvars ¶ added in v0.2.2
RemoveBarvars is wrapping MSK_removebarvars, Removes a number of symmetric matrices.
Arguments:
- `subset` Indexes of symmetric matrices which should be removed.
func (*Task) RemoveCones
deprecated
added in
v0.2.2
RemoveCones is wrapping MSK_removecones, Removes a number of conic constraints from the problem.
Arguments:
- `subset` Indexes of cones which should be removed.
Deprecated: MSK_removecones/RemoveCones is deprecated by mosek and will be removed in a future release.
func (*Task) RemoveCons ¶ added in v0.2.2
RemoveCons is wrapping MSK_removecons, Removes a number of constraints.
Arguments:
- `subset` Indexes of constraints which should be removed.
func (*Task) RemoveVars ¶ added in v0.2.2
RemoveVars is wrapping MSK_removevars, Removes a number of variables.
Arguments:
- `subset` Indexes of variables which should be removed.
func (*Task) ResizeTask ¶ added in v0.2.8
func (task *Task) ResizeTask( maxnumcon int32, maxnumvar int32, maxnumcone int32, maxnumanz int64, maxnumqnz int64, ) error
ResizeTask is wrapping MSK_resizetask, Resizes an optimization task.
Arguments:
- `maxnumcon` New maximum number of constraints.
- `maxnumvar` New maximum number of variables.
- `maxnumcone` New maximum number of cones.
- `maxnumanz` New maximum number of linear non-zero elements.
- `maxnumqnz` New maximum number of quadratic non-zeros elements.
func (*Task) SensitivityReport ¶ added in v0.2.8
func (task *Task) SensitivityReport( whichstream StreamType, ) error
SensitivityReport is wrapping MSK_sensitivityreport, Creates a sensitivity report.
Arguments:
- `whichstream` Index of the stream.
func (*Task) SetDefaults ¶ added in v0.2.3
SetDefaults is wrapping MSK_setdefaults, Resets all parameter values.
func (*Task) SkToStr ¶ added in v0.2.5
SkToStr is wrapping MSK_sktostr
func (*Task) SolStaToStr ¶ added in v0.2.5
SolStaToStr is wrapping MSK_solstatostr
func (*Task) SolutionDef ¶ added in v0.2.3
SolutionDef is wrapping MSK_solutiondef, Checks whether a solution is defined.
Arguments:
- `whichsol` Selects a solution.
Returns:
- `isdef` Is non-zero if the requested solution is defined.
func (*Task) SolutionSummary ¶ added in v0.0.4
func (task *Task) SolutionSummary( whichstream StreamType, ) error
SolutionSummary is wrapping MSK_solutionsummary, Prints a short summary of the current solutions.
Arguments:
- `whichstream` Index of the stream.
func (*Task) SolveWithBasis ¶ added in v0.2.8
func (task *Task) SolveWithBasis( transp bool, numnz int32, sub []int32, val []float64, numnzout []int32, ) error
SolveWithBasis is wrapping MSK_solvewithbasis, Solve a linear equation system involving a basis matrix.
Arguments:
- `transp` Controls which problem formulation is solved.
- `numnz` Input (number of non-zeros in right-hand side).
- `sub` Input (indexes of non-zeros in right-hand side) and output (indexes of non-zeros in solution vector).
- `val` Input (right-hand side values) and output (solution vector values).
Returns:
- `numnzout` Output (number of non-zeros in solution vector).
func (*Task) StrToConeType
deprecated
added in
v0.2.8
StrToConeType is wrapping MSK_strtoconetype, Obtains a cone type code.
Arguments:
- `str` String corresponding to the cone type code.
- `conetype` The cone type corresponding to str.
Deprecated: MSK_strtoconetype/StrToConeType is deprecated by mosek and will be removed in a future release.
func (*Task) StrToSk ¶ added in v0.2.8
StrToSk is wrapping MSK_strtosk, Obtains a status key.
Arguments:
- `str` A status key abbreviation string.
- `sk` Status key corresponding to the string.
func (*Task) Toconic
deprecated
added in
v0.2.0
Toconic is wrapping MSK_toconic, In-place reformulation of a QCQO to a conic quadratic problem.
Deprecated: MSK_toconic/Toconic is deprecated by mosek and will be removed in a future release.
func (*Task) UnlinkFuncfromtaskstream ¶ added in v0.2.2
func (task *Task) UnlinkFuncfromtaskstream( whichstream StreamType, ) error
UnlinkFuncfromtaskstream is wrapping MSK_unlinkfuncfromtaskstream
func (*Task) UpdateSolutionInfo ¶ added in v0.2.8
UpdateSolutionInfo is wrapping MSK_updatesolutioninfo, Update the information items related to the solution.
Arguments:
- `whichsol` Selects a solution.
func (*Task) WhichParam ¶ added in v0.2.8
func (task *Task) WhichParam( parname string, partype []ParameterType, param []int32, ) error
WhichParam is wrapping MSK_whichparam, Checks a parameter name.
Arguments:
- `parname` Parameter name.
- `partype` Parameter type.
- `param` Which parameter.
func (*Task) WriteBSolution ¶ added in v0.2.8
func (task *Task) WriteBSolution( filename string, compress CompressType, ) error
WriteBSolution is wrapping MSK_writebsolution, Write a binary dump of the task solution and information items.
Arguments:
- `filename` A valid file name.
- `compress` Data compression type.
func (*Task) WriteBSolutionHandle ¶ added in v0.6.0
func (task *Task) WriteBSolutionHandle(handle io.Writer, compress CompressType) error
WriteBSolutionHandle wraps [MSK_writebsolutionhandle) and uses io.Writer instead of using callbacks.
func (*Task) WriteData ¶ added in v0.0.7
WriteData is wrapping MSK_writedata, Writes problem data to a file.
Arguments:
- `filename` A valid file name.
func (*Task) WriteDataHandle ¶ added in v0.0.7
func (task *Task) WriteDataHandle(handle io.Writer, format DataFormat, compress CompressType) error
WriteDataHandle wraps MSK_writedatahandle using io.Writer instead of using callbacks.
Example ¶
package main import ( "fmt" "log" "os" "github.com/fardream/gmsk" ) func main() { CheckOk := func(r error) { if r != nil { log.Fatalf("Failed: %#v", r) } } task, err := gmsk.MakeTask(nil, 0, 0) if err != nil { log.Fatal(err) } defer gmsk.DeleteTask(task) CheckOk(task.AppendVars(1)) CheckOk(task.PutCJ(0, 1.0)) CheckOk(task.PutVarBound(0, gmsk.BK_RA, 2.0, 3.0)) CheckOk(task.PutObjSense(gmsk.OBJECTIVE_SENSE_MINIMIZE)) CheckOk(task.WriteDataHandle(os.Stderr, gmsk.DATA_FORMAT_PTF, gmsk.COMPRESS_NONE)) fmt.Println("Done") }
Output: Done
func (*Task) WriteJsonSol ¶ added in v0.2.8
WriteJsonSol is wrapping MSK_writejsonsol, Writes a solution to a JSON file.
Arguments:
- `filename` A valid file name.
func (*Task) WriteParamFile ¶ added in v0.2.3
WriteParamFile is wrapping MSK_writeparamfile, Writes all the parameters to a parameter file.
Arguments:
- `filename` A valid file name.
func (*Task) WriteSolution ¶ added in v0.2.2
WriteSolution is wrapping MSK_writesolution, Write a solution to a file.
Arguments:
- `whichsol` Selects a solution.
- `filename` A valid file name.
func (*Task) WriteSolutionFile ¶ added in v0.2.3
WriteSolutionFile is wrapping MSK_writesolutionfile, Write solution file in format determined by the filename
Arguments:
- `filename` A valid file name.
type Transpose ¶ added in v0.0.10
type Transpose uint32
Transpose is MSKtranspose_enum.
Transposed matrix.
const ( TRANSPOSE_NO Transpose = C.MSK_TRANSPOSE_NO // No transpose is applied. TRANSPOSE_YES Transpose = C.MSK_TRANSPOSE_YES // A transpose is applied. )
type UpLo ¶ added in v0.0.10
type UpLo uint32
UpLo is MSKuplo_enum.
Triangular part of a symmetric matrix.
const ( UPLO_LO UpLo = C.MSK_UPLO_LO // Lower part. UPLO_UP UpLo = C.MSK_UPLO_UP // Upper part. )
type VariableType ¶ added in v0.0.10
type VariableType uint32
VariableType is MSKvariabletype_enum.
Variable types
const ( VAR_TYPE_CONT VariableType = C.MSK_VAR_TYPE_CONT // Is a continuous variable. VAR_TYPE_INT VariableType = C.MSK_VAR_TYPE_INT // Is an integer variable. )
func (VariableType) String ¶ added in v0.2.10
func (e VariableType) String() string
type XmlWriterOutputType ¶ added in v0.2.0
type XmlWriterOutputType uint32
XmlWriterOutputType is MSKxmlwriteroutputtype_enum.
XML writer output mode
const ( WRITE_XML_MODE_ROW XmlWriterOutputType = C.MSK_WRITE_XML_MODE_ROW // Write in row order. WRITE_XML_MODE_COL XmlWriterOutputType = C.MSK_WRITE_XML_MODE_COL // Write in column order. )
func (XmlWriterOutputType) String ¶ added in v0.2.10
func (e XmlWriterOutputType) String() string
Source Files ¶
- basindtype_enum.go
- boundkey_enum.go
- branchdir_enum.go
- callbackcode_enum.go
- capis.go
- checkconvexitytype_enum.go
- compresstype_enum.go
- conetype_enum.go
- dataformat_enum.go
- dinfitem_enum.go
- domaintype_enum.go
- dparam_enum.go
- env.go
- error.go
- feature_enum.go
- iinfitem_enum.go
- inftype_enum.go
- intpnthotstart_enum.go
- iomode_enum.go
- iparam_enum.go
- liinfitem_enum.go
- mark_enum.go
- miocontsoltype_enum.go
- miodatapermmethod_enum.go
- miomode_enum.go
- mionodeseltype_enum.go
- miovarseltype_enum.go
- miqcqoreformmethod_enum.go
- mpsformat_enum.go
- nametype_enum.go
- objsense_enum.go
- onoffkey_enum.go
- optimizertype_enum.go
- orderingtype_enum.go
- other_funcs.go
- parametertype_enum.go
- presolvemode_enum.go
- problemitem_enum.go
- problemtype_enum.go
- prosta_enum.go
- purify_enum.go
- rescodes.go
- rescodetype_enum.go
- scalingmethod_enum.go
- scalingtype_enum.go
- sensitivitytype_enum.go
- simdegen_enum.go
- simdupvec_enum.go
- simhotstart_enum.go
- simreform_enum.go
- simseltype_enum.go
- solformat_enum.go
- solitem_enum.go
- solsta_enum.go
- soltype_enum.go
- solveform_enum.go
- sparam_enum.go
- stakey_enum.go
- startpointtype_enum.go
- streamtype_enum.go
- symmattype_enum.go
- task_apenddomain.go
- task_append.go
- task_get.go
- task_getlist_or_slice.go
- task_getnum.go
- task_getnumnz.go
- task_name.go
- task_other.go
- task_put.go
- task_putlist_or_slice.go
- task_putmaxnum.go
- task_slicetrip.go
- transpose_enum.go
- uplo_enum.go
- variabletype_enum.go
- xmlwriteroutputtype_enum.go