Mercurial > hg > octave-terminal
changeset 11046:14993c9e857e
amd.cc, cellfun.cc: use octave_scalar_map instead of Octave_map
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 29 Sep 2010 03:50:36 -0400 |
parents | cc3aad9dd3ef |
children | 52609f73c7d9 |
files | src/ChangeLog src/DLD-FUNCTIONS/amd.cc src/DLD-FUNCTIONS/cellfun.cc |
diffstat | 3 files changed, 20 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2010-09-29 John W. Eaton <jwe@octave.org> + + * DLD-FUNCTIONS/amd.cc (Famd): Use octave_scalar_map instead of + Octave_map. + * DLD-FUNCTIONS/cellfun.cc (get_output_list): Likewise. + 2010-09-29 John W. Eaton <jwe@octave.org> * DLD-FUNCTIONS/dispatch.cc (Fdispatch): Use octave_scalar_map
--- a/src/DLD-FUNCTIONS/amd.cc +++ b/src/DLD-FUNCTIONS/amd.cc @@ -138,27 +138,22 @@ AMD_NAME (_defaults) (Control) ; if (nargin > 1) { - Octave_map arg1 = args(1).map_value (); + octave_scalar_map arg1 = args(1).scalar_map_value (); if (!error_state) { - if (arg1.contains ("dense")) - { - Cell c = arg1.contents ("dense"); - if (c.length() == 1) - Control[AMD_DENSE] = c.elem(0).double_value (); - else - error ("amd: invalid options structure"); - } - if (arg1.contains ("aggressive")) - { - Cell c = arg1.contents ("aggressive"); - if (c.length() == 1) - Control[AMD_AGGRESSIVE] = c.elem(0).double_value (); - else - error ("amd: invalid options structure"); - } + octave_value tmp; + + tmp = arg1.contents ("dense"); + if (tmp.is_defined ()) + Control[AMD_DENSE] = tmp.double_value (); + + tmp = arg1.contents ("aggressive"); + if (tmp.is_defined ()) + Control[AMD_AGGRESSIVE] = tmp.double_value (); } + else + error ("amd: options argument must be a scalar structure"); } if (!error_state)
--- a/src/DLD-FUNCTIONS/cellfun.cc +++ b/src/DLD-FUNCTIONS/cellfun.cc @@ -70,10 +70,10 @@ { if (error_handler.is_defined ()) { - Octave_map msg; + octave_scalar_map msg; msg.assign ("identifier", last_error_id ()); msg.assign ("message", last_error_message ()); - msg.assign ("index", octave_value(double (count + static_cast<octave_idx_type>(1)))); + msg.assign ("index", static_cast<double> (count + static_cast<octave_idx_type>(1))); octave_value_list errlist = inputlist; errlist.prepend (msg); buffer_error_messages--;