Mercurial > hg > octave-lojdl
changeset 11048:10c65e01f042
__glpk__.cc: use octave_scalar_map instead of Octave_map
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 29 Sep 2010 04:08:08 -0400 |
parents | 52609f73c7d9 |
children | b0a9450d81c6 |
files | src/ChangeLog src/DLD-FUNCTIONS/__glpk__.cc |
diffstat | 2 files changed, 18 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,7 +1,8 @@ 2010-09-29 John W. Eaton <jwe@octave.org> * DLD-FUNCTIONS/__glpk__.cc (F__glpk__): Use octave_scalar_map - instead of Octave_map. + instead of Octave_map. Use scalar values where appropriate in + call to glpk. (OCTAVE_GLPK_GET_REAL_PARAM, OCTAVE_GLPK_GET_INT_PARAM): Update for octave_scalar_map.
--- a/src/DLD-FUNCTIONS/__glpk__.cc +++ b/src/DLD-FUNCTIONS/__glpk__.cc @@ -813,40 +813,38 @@ //-- Assign pointers to the output parameters ColumnVector xmin (mrowsc, octave_NA); - ColumnVector fmin (1, octave_NA); - ColumnVector status (1); + double fmin = octave_NA; + double status; ColumnVector lambda (mrowsA, octave_NA); ColumnVector redcosts (mrowsc, octave_NA); - ColumnVector time (1); - ColumnVector mem (1); + double time; + double mem; int jmpret = setjmp (mark); if (jmpret == 0) glpk (sense, mrowsc, mrowsA, c, nz, rn.fortran_vec (), cn.fortran_vec (), a.fortran_vec (), b, ctype, - freeLB.fortran_vec (), lb, freeUB.fortran_vec (), - ub, vartype.fortran_vec (), isMIP, lpsolver, - save_pb, xmin.fortran_vec (), fmin.fortran_vec (), - status.fortran_vec (), lambda.fortran_vec (), - redcosts.fortran_vec (), time.fortran_vec (), - mem.fortran_vec ()); + freeLB.fortran_vec (), lb, freeUB.fortran_vec (), ub, + vartype.fortran_vec (), isMIP, lpsolver, save_pb, + xmin.fortran_vec (), &fmin, &status, lambda.fortran_vec (), + redcosts.fortran_vec (), &time, &mem); - Octave_map extra; + octave_scalar_map extra; if (! isMIP) { - extra.assign ("lambda", octave_value (lambda)); - extra.assign ("redcosts", octave_value (redcosts)); + extra.assign ("lambda", lambda); + extra.assign ("redcosts", redcosts); } - extra.assign ("time", octave_value (time)); - extra.assign ("mem", octave_value (mem)); + extra.assign ("time", time); + extra.assign ("mem", mem); retval(3) = extra; - retval(2) = octave_value(status); - retval(1) = octave_value(fmin); - retval(0) = octave_value(xmin); + retval(2) = status; + retval(1) = fmin; + retval(0) = xmin; #else