const octave_value& next() { if (i < args.length()) { return args(i++); } else { throw std::invalid_argument("Expected an additional argument"); } }
void COctaveInterface::reset(octave_value_list prhs, int32_t nlhs) { CSGInterface::reset(); m_nlhs=nlhs; m_nrhs=prhs.length(); m_lhs=octave_value_list(); m_rhs=prhs; }
virtual string get_string_argument(vector<double>* more_out = 0) { if (more_out && i < args.length() && args(i).is_cell()) { // optionally: a cell array with multiple arguments Cell more = next().cell_value(); if (more.nelem() == 0) { throw std::invalid_argument("Use a cell {'name',args,..} for loss functions with arguments"); } for (int i = 1 ; i < more.nelem() ; ++i) { more_out->push_back(more(i).double_value()); } return more(0).string_value(); } else { return next().string_value(); } }
virtual bool end() { return i >= args.length(); }