Mercurial > octave-nkf
comparison libinterp/octave-value/ov.h @ 17787:175b392e91fe
Use GNU style coding conventions for code in libinterp/
* libinterp/corefcn/Cell.h, libinterp/corefcn/__contourc__.cc,
libinterp/corefcn/__dispatch__.cc, libinterp/corefcn/__lin_interpn__.cc,
libinterp/corefcn/__pchip_deriv__.cc, libinterp/corefcn/__qp__.cc,
libinterp/corefcn/balance.cc, libinterp/corefcn/besselj.cc,
libinterp/corefcn/betainc.cc, libinterp/corefcn/bitfcns.cc,
libinterp/corefcn/bsxfun.cc, libinterp/corefcn/c-file-ptr-stream.cc,
libinterp/corefcn/c-file-ptr-stream.h, libinterp/corefcn/cellfun.cc,
libinterp/corefcn/colloc.cc, libinterp/corefcn/comment-list.h,
libinterp/corefcn/conv2.cc, libinterp/corefcn/daspk.cc,
libinterp/corefcn/dasrt.cc, libinterp/corefcn/dassl.cc,
libinterp/corefcn/data.cc, libinterp/corefcn/debug.cc,
libinterp/corefcn/defaults.cc, libinterp/corefcn/defaults.in.h,
libinterp/corefcn/defun-int.h, libinterp/corefcn/defun.cc,
libinterp/corefcn/det.cc, libinterp/corefcn/dirfns.cc,
libinterp/corefcn/display.cc, libinterp/corefcn/dlmread.cc,
libinterp/corefcn/dot.cc, libinterp/corefcn/dynamic-ld.cc,
libinterp/corefcn/dynamic-ld.h, libinterp/corefcn/eig.cc,
libinterp/corefcn/ellipj.cc, libinterp/corefcn/error.cc,
libinterp/corefcn/error.h, libinterp/corefcn/event-queue.h,
libinterp/corefcn/fft.cc, libinterp/corefcn/fft2.cc, libinterp/corefcn/fftn.cc,
libinterp/corefcn/file-io.cc, libinterp/corefcn/filter.cc,
libinterp/corefcn/find.cc, libinterp/corefcn/gammainc.cc,
libinterp/corefcn/gcd.cc, libinterp/corefcn/getgrent.cc,
libinterp/corefcn/getpwent.cc, libinterp/corefcn/getrusage.cc,
libinterp/corefcn/givens.cc, libinterp/corefcn/gl-render.cc,
libinterp/corefcn/gl2ps-renderer.cc, libinterp/corefcn/gl2ps-renderer.h,
libinterp/corefcn/graphics.cc, libinterp/corefcn/graphics.in.h,
libinterp/corefcn/gripes.cc, libinterp/corefcn/gripes.h,
libinterp/corefcn/help.cc, libinterp/corefcn/hess.cc,
libinterp/corefcn/hex2num.cc, libinterp/corefcn/input.cc,
libinterp/corefcn/input.h, libinterp/corefcn/inv.cc,
libinterp/corefcn/jit-ir.h, libinterp/corefcn/jit-typeinfo.cc,
libinterp/corefcn/jit-typeinfo.h, libinterp/corefcn/jit-util.h,
libinterp/corefcn/kron.cc, libinterp/corefcn/load-path.cc,
libinterp/corefcn/load-path.h, libinterp/corefcn/load-save.cc,
libinterp/corefcn/load-save.h, libinterp/corefcn/lookup.cc,
libinterp/corefcn/ls-ascii-helper.cc, libinterp/corefcn/ls-hdf5.cc,
libinterp/corefcn/ls-hdf5.h, libinterp/corefcn/ls-mat-ascii.cc,
libinterp/corefcn/ls-mat-ascii.h, libinterp/corefcn/ls-mat4.cc,
libinterp/corefcn/ls-mat5.cc, libinterp/corefcn/ls-mat5.h,
libinterp/corefcn/ls-oct-ascii.cc, libinterp/corefcn/lsode.cc,
libinterp/corefcn/lu.cc, libinterp/corefcn/luinc.cc,
libinterp/corefcn/mappers.cc, libinterp/corefcn/matrix_type.cc,
libinterp/corefcn/max.cc, libinterp/corefcn/md5sum.cc,
libinterp/corefcn/mex.cc, libinterp/corefcn/mexproto.h,
libinterp/corefcn/mgorth.cc, libinterp/corefcn/mxarray.in.h,
libinterp/corefcn/nproc.cc, libinterp/corefcn/oct-hist.cc,
libinterp/corefcn/oct-lvalue.h, libinterp/corefcn/oct-map.cc,
libinterp/corefcn/oct-map.h, libinterp/corefcn/oct-obj.h,
libinterp/corefcn/oct-prcstrm.h, libinterp/corefcn/oct-stdstrm.h,
libinterp/corefcn/oct-stream.cc, libinterp/corefcn/oct-stream.h,
libinterp/corefcn/octave-link.cc, libinterp/corefcn/octave-link.h,
libinterp/corefcn/pager.cc, libinterp/corefcn/pinv.cc,
libinterp/corefcn/pr-output.cc, libinterp/corefcn/procstream.h,
libinterp/corefcn/profiler.cc, libinterp/corefcn/pt-jit.cc,
libinterp/corefcn/pt-jit.h, libinterp/corefcn/quad.cc,
libinterp/corefcn/quadcc.cc, libinterp/corefcn/qz.cc,
libinterp/corefcn/rand.cc, libinterp/corefcn/rcond.cc,
libinterp/corefcn/regexp.cc, libinterp/corefcn/schur.cc,
libinterp/corefcn/sighandlers.cc, libinterp/corefcn/sighandlers.h,
libinterp/corefcn/sparse-xdiv.cc, libinterp/corefcn/sparse-xdiv.h,
libinterp/corefcn/sparse-xpow.cc, libinterp/corefcn/sparse.cc,
libinterp/corefcn/spparms.cc, libinterp/corefcn/sqrtm.cc,
libinterp/corefcn/str2double.cc, libinterp/corefcn/strfind.cc,
libinterp/corefcn/strfns.cc, libinterp/corefcn/sub2ind.cc,
libinterp/corefcn/svd.cc, libinterp/corefcn/syl.cc,
libinterp/corefcn/symtab.cc, libinterp/corefcn/symtab.h,
libinterp/corefcn/syscalls.cc, libinterp/corefcn/sysdep.cc,
libinterp/corefcn/sysdep.h, libinterp/corefcn/time.cc,
libinterp/corefcn/toplev.cc, libinterp/corefcn/toplev.h,
libinterp/corefcn/tril.cc, libinterp/corefcn/txt-eng-ft.cc,
libinterp/corefcn/txt-eng-ft.h, libinterp/corefcn/txt-eng.h,
libinterp/corefcn/typecast.cc, libinterp/corefcn/urlwrite.cc,
libinterp/corefcn/utils.cc, libinterp/corefcn/variables.cc,
libinterp/corefcn/variables.h, libinterp/corefcn/xdiv.cc,
libinterp/corefcn/xdiv.h, libinterp/corefcn/xnorm.h, libinterp/corefcn/xpow.cc,
libinterp/corefcn/xpow.h, libinterp/corefcn/zfstream.cc,
libinterp/corefcn/zfstream.h, libinterp/dldfcn/__delaunayn__.cc,
libinterp/dldfcn/__dsearchn__.cc, libinterp/dldfcn/__eigs__.cc,
libinterp/dldfcn/__fltk_uigetfile__.cc, libinterp/dldfcn/__glpk__.cc,
libinterp/dldfcn/__init_fltk__.cc, libinterp/dldfcn/__init_gnuplot__.cc,
libinterp/dldfcn/__magick_read__.cc, libinterp/dldfcn/__voronoi__.cc,
libinterp/dldfcn/amd.cc, libinterp/dldfcn/ccolamd.cc, libinterp/dldfcn/chol.cc,
libinterp/dldfcn/colamd.cc, libinterp/dldfcn/convhulln.cc,
libinterp/dldfcn/dmperm.cc, libinterp/dldfcn/fftw.cc, libinterp/dldfcn/qr.cc,
libinterp/dldfcn/symbfact.cc, libinterp/dldfcn/symrcm.cc,
libinterp/dldfcn/tsearch.cc, libinterp/octave-value/ov-base-diag.cc,
libinterp/octave-value/ov-base-diag.h, libinterp/octave-value/ov-base-int.cc,
libinterp/octave-value/ov-base-int.h, libinterp/octave-value/ov-base-mat.h,
libinterp/octave-value/ov-base-scalar.cc,
libinterp/octave-value/ov-base-scalar.h,
libinterp/octave-value/ov-base-sparse.cc,
libinterp/octave-value/ov-base-sparse.h, libinterp/octave-value/ov-base.cc,
libinterp/octave-value/ov-base.h, libinterp/octave-value/ov-bool-mat.cc,
libinterp/octave-value/ov-bool-mat.h, libinterp/octave-value/ov-bool-sparse.cc,
libinterp/octave-value/ov-bool-sparse.h, libinterp/octave-value/ov-bool.cc,
libinterp/octave-value/ov-bool.h, libinterp/octave-value/ov-builtin.cc,
libinterp/octave-value/ov-builtin.h, libinterp/octave-value/ov-cell.cc,
libinterp/octave-value/ov-cell.h, libinterp/octave-value/ov-ch-mat.cc,
libinterp/octave-value/ov-ch-mat.h, libinterp/octave-value/ov-class.cc,
libinterp/octave-value/ov-class.h, libinterp/octave-value/ov-colon.h,
libinterp/octave-value/ov-complex.cc, libinterp/octave-value/ov-complex.h,
libinterp/octave-value/ov-cx-diag.cc, libinterp/octave-value/ov-cx-diag.h,
libinterp/octave-value/ov-cx-mat.cc, libinterp/octave-value/ov-cx-mat.h,
libinterp/octave-value/ov-cx-sparse.cc, libinterp/octave-value/ov-cx-sparse.h,
libinterp/octave-value/ov-dld-fcn.h, libinterp/octave-value/ov-fcn-handle.cc,
libinterp/octave-value/ov-fcn-handle.h,
libinterp/octave-value/ov-fcn-inline.cc,
libinterp/octave-value/ov-fcn-inline.h, libinterp/octave-value/ov-fcn.h,
libinterp/octave-value/ov-float.cc, libinterp/octave-value/ov-float.h,
libinterp/octave-value/ov-flt-complex.cc,
libinterp/octave-value/ov-flt-complex.h,
libinterp/octave-value/ov-flt-cx-diag.cc,
libinterp/octave-value/ov-flt-cx-diag.h,
libinterp/octave-value/ov-flt-cx-mat.cc,
libinterp/octave-value/ov-flt-cx-mat.h,
libinterp/octave-value/ov-flt-re-diag.cc,
libinterp/octave-value/ov-flt-re-diag.h,
libinterp/octave-value/ov-flt-re-mat.cc,
libinterp/octave-value/ov-flt-re-mat.h, libinterp/octave-value/ov-int16.cc,
libinterp/octave-value/ov-int32.cc, libinterp/octave-value/ov-int64.cc,
libinterp/octave-value/ov-int8.cc, libinterp/octave-value/ov-intx.h,
libinterp/octave-value/ov-java.cc, libinterp/octave-value/ov-lazy-idx.h,
libinterp/octave-value/ov-mex-fcn.cc, libinterp/octave-value/ov-mex-fcn.h,
libinterp/octave-value/ov-null-mat.cc, libinterp/octave-value/ov-null-mat.h,
libinterp/octave-value/ov-oncleanup.cc, libinterp/octave-value/ov-perm.cc,
libinterp/octave-value/ov-perm.h, libinterp/octave-value/ov-range.cc,
libinterp/octave-value/ov-range.h, libinterp/octave-value/ov-re-diag.cc,
libinterp/octave-value/ov-re-diag.h, libinterp/octave-value/ov-re-mat.cc,
libinterp/octave-value/ov-re-mat.h, libinterp/octave-value/ov-re-sparse.cc,
libinterp/octave-value/ov-re-sparse.h, libinterp/octave-value/ov-scalar.cc,
libinterp/octave-value/ov-scalar.h, libinterp/octave-value/ov-str-mat.cc,
libinterp/octave-value/ov-str-mat.h, libinterp/octave-value/ov-struct.cc,
libinterp/octave-value/ov-struct.h, libinterp/octave-value/ov-type-conv.h,
libinterp/octave-value/ov-typeinfo.cc, libinterp/octave-value/ov-typeinfo.h,
libinterp/octave-value/ov-uint16.cc, libinterp/octave-value/ov-uint32.cc,
libinterp/octave-value/ov-uint64.cc, libinterp/octave-value/ov-uint8.cc,
libinterp/octave-value/ov-usr-fcn.cc, libinterp/octave-value/ov-usr-fcn.h,
libinterp/octave-value/ov.cc, libinterp/octave-value/ov.h, libinterp/octave.cc,
libinterp/operators/op-b-bm.cc, libinterp/operators/op-b-sbm.cc,
libinterp/operators/op-bm-b.cc, libinterp/operators/op-bm-bm.cc,
libinterp/operators/op-cdm-cdm.cc, libinterp/operators/op-chm.cc,
libinterp/operators/op-class.cc, libinterp/operators/op-cm-cm.cc,
libinterp/operators/op-cm-cs.cc, libinterp/operators/op-cm-s.cc,
libinterp/operators/op-cm-scm.cc, libinterp/operators/op-cm-sm.cc,
libinterp/operators/op-cs-cm.cc, libinterp/operators/op-cs-cs.cc,
libinterp/operators/op-cs-scm.cc, libinterp/operators/op-cs-sm.cc,
libinterp/operators/op-dm-dm.cc, libinterp/operators/op-dm-scm.cc,
libinterp/operators/op-double-conv.cc, libinterp/operators/op-fcdm-fcdm.cc,
libinterp/operators/op-fcm-fcm.cc, libinterp/operators/op-fcm-fcs.cc,
libinterp/operators/op-fcm-fm.cc, libinterp/operators/op-fcm-fs.cc,
libinterp/operators/op-fcs-fcm.cc, libinterp/operators/op-fcs-fcs.cc,
libinterp/operators/op-fcs-fm.cc, libinterp/operators/op-fcs-fs.cc,
libinterp/operators/op-fdm-fdm.cc, libinterp/operators/op-float-conv.cc,
libinterp/operators/op-fm-fcm.cc, libinterp/operators/op-fm-fcs.cc,
libinterp/operators/op-fm-fm.cc, libinterp/operators/op-fm-fs.cc,
libinterp/operators/op-fs-fcm.cc, libinterp/operators/op-fs-fcs.cc,
libinterp/operators/op-fs-fm.cc, libinterp/operators/op-fs-fs.cc,
libinterp/operators/op-m-cm.cc, libinterp/operators/op-m-cs.cc,
libinterp/operators/op-m-m.cc, libinterp/operators/op-m-s.cc,
libinterp/operators/op-m-scm.cc, libinterp/operators/op-m-sm.cc,
libinterp/operators/op-pm-scm.cc, libinterp/operators/op-range.cc,
libinterp/operators/op-s-cm.cc, libinterp/operators/op-s-cs.cc,
libinterp/operators/op-s-scm.cc, libinterp/operators/op-sbm-b.cc,
libinterp/operators/op-sbm-bm.cc, libinterp/operators/op-sbm-sbm.cc,
libinterp/operators/op-scm-cm.cc, libinterp/operators/op-scm-cs.cc,
libinterp/operators/op-scm-m.cc, libinterp/operators/op-scm-s.cc,
libinterp/operators/op-scm-scm.cc, libinterp/operators/op-scm-sm.cc,
libinterp/operators/op-sm-cm.cc, libinterp/operators/op-sm-m.cc,
libinterp/operators/op-sm-s.cc, libinterp/operators/op-sm-scm.cc,
libinterp/operators/op-sm-sm.cc, libinterp/operators/op-str-m.cc,
libinterp/operators/op-str-s.cc, libinterp/operators/op-str-str.cc,
libinterp/operators/ops.h, libinterp/parse-tree/lex.h,
libinterp/parse-tree/parse.h, libinterp/parse-tree/pt-arg-list.cc,
libinterp/parse-tree/pt-arg-list.h, libinterp/parse-tree/pt-assign.cc,
libinterp/parse-tree/pt-assign.h, libinterp/parse-tree/pt-binop.cc,
libinterp/parse-tree/pt-binop.h, libinterp/parse-tree/pt-bp.h,
libinterp/parse-tree/pt-cbinop.cc, libinterp/parse-tree/pt-check.cc,
libinterp/parse-tree/pt-colon.cc, libinterp/parse-tree/pt-colon.h,
libinterp/parse-tree/pt-const.cc, libinterp/parse-tree/pt-decl.cc,
libinterp/parse-tree/pt-decl.h, libinterp/parse-tree/pt-eval.cc,
libinterp/parse-tree/pt-except.h, libinterp/parse-tree/pt-exp.h,
libinterp/parse-tree/pt-fcn-handle.cc, libinterp/parse-tree/pt-id.cc,
libinterp/parse-tree/pt-id.h, libinterp/parse-tree/pt-idx.cc,
libinterp/parse-tree/pt-idx.h, libinterp/parse-tree/pt-loop.h,
libinterp/parse-tree/pt-mat.cc, libinterp/parse-tree/pt-misc.cc,
libinterp/parse-tree/pt-misc.h, libinterp/parse-tree/pt-pr-code.cc,
libinterp/parse-tree/pt-select.h, libinterp/parse-tree/pt-stmt.h,
libinterp/parse-tree/token.h, libinterp/version.cc:
Use GNU style coding conventions for code in libinterp/
author | Rik <rik@octave.org> |
---|---|
date | Mon, 28 Oct 2013 19:51:46 -0700 |
parents | d63878346099 |
children | ebb3ef964372 |
comparison
equal
deleted
inserted
replaced
17786:34d9812a943b | 17787:175b392e91fe |
---|---|
163 const octave_value& rhs = octave_value ()); | 163 const octave_value& rhs = octave_value ()); |
164 | 164 |
165 enum magic_colon { magic_colon_t }; | 165 enum magic_colon { magic_colon_t }; |
166 | 166 |
167 octave_value (void) | 167 octave_value (void) |
168 { | 168 { |
169 static octave_base_value nil_rep; | 169 static octave_base_value nil_rep; |
170 rep = &nil_rep; | 170 rep = &nil_rep; |
171 rep->count++; | 171 rep->count++; |
172 } | 172 } |
173 | 173 |
174 octave_value (short int i); | 174 octave_value (short int i); |
175 octave_value (unsigned short int i); | 175 octave_value (unsigned short int i); |
176 octave_value (int i); | 176 octave_value (int i); |
177 octave_value (unsigned int i); | 177 octave_value (unsigned int i); |
178 octave_value (long int i); | 178 octave_value (long int i); |
179 octave_value (unsigned long int i); | 179 octave_value (unsigned long int i); |
180 | 180 |
181 // FIXME -- these are kluges. They turn into doubles | 181 // FIXME: these are kluges. They turn into doubles |
182 // internally, which will break for very large values. We just use | 182 // internally, which will break for very large values. We just use |
183 // them to store things like 64-bit ino_t, etc, and hope that those | 183 // them to store things like 64-bit ino_t, etc, and hope that those |
184 // values are never actually larger than can be represented exactly | 184 // values are never actually larger than can be represented exactly |
185 // in a double. | 185 // in a double. |
186 | 186 |
213 octave_value (const ColumnVector& v); | 213 octave_value (const ColumnVector& v); |
214 octave_value (const FloatColumnVector& v); | 214 octave_value (const FloatColumnVector& v); |
215 octave_value (const Complex& C); | 215 octave_value (const Complex& C); |
216 octave_value (const FloatComplex& C); | 216 octave_value (const FloatComplex& C); |
217 octave_value (const ComplexMatrix& m, const MatrixType& t = MatrixType ()); | 217 octave_value (const ComplexMatrix& m, const MatrixType& t = MatrixType ()); |
218 octave_value (const FloatComplexMatrix& m, const MatrixType& t = MatrixType ()); | 218 octave_value (const FloatComplexMatrix& m, |
219 const MatrixType& t = MatrixType ()); | |
219 octave_value (const ComplexNDArray& cnda); | 220 octave_value (const ComplexNDArray& cnda); |
220 octave_value (const FloatComplexNDArray& cnda); | 221 octave_value (const FloatComplexNDArray& cnda); |
221 octave_value (const Array<Complex>& m); | 222 octave_value (const Array<Complex>& m); |
222 octave_value (const Array<FloatComplex>& m); | 223 octave_value (const Array<FloatComplex>& m); |
223 octave_value (const ComplexDiagMatrix& d); | 224 octave_value (const ComplexDiagMatrix& d); |
294 octave_value (octave_base_value *new_rep, int xcount) GCC_ATTR_DEPRECATED; | 295 octave_value (octave_base_value *new_rep, int xcount) GCC_ATTR_DEPRECATED; |
295 | 296 |
296 // Copy constructor. | 297 // Copy constructor. |
297 | 298 |
298 octave_value (const octave_value& a) | 299 octave_value (const octave_value& a) |
299 { | 300 { |
300 rep = a.rep; | 301 rep = a.rep; |
301 rep->count++; | 302 rep->count++; |
302 } | 303 } |
303 | 304 |
304 // This should only be called for derived types. | 305 // This should only be called for derived types. |
305 | 306 |
306 octave_base_value *clone (void) const; | 307 octave_base_value *clone (void) const; |
307 | 308 |
308 octave_base_value *empty_clone (void) const | 309 octave_base_value *empty_clone (void) const |
309 { return rep->empty_clone (); } | 310 { return rep->empty_clone (); } |
310 | 311 |
311 // Delete the representation of this constant if the count drops to | 312 // Delete the representation of this constant if the count drops to |
312 // zero. | 313 // zero. |
313 | 314 |
314 ~octave_value (void) | 315 ~octave_value (void) |
316 if (--rep->count == 0) | 317 if (--rep->count == 0) |
317 delete rep; | 318 delete rep; |
318 } | 319 } |
319 | 320 |
320 void make_unique (void) | 321 void make_unique (void) |
321 { | 322 { |
322 if (rep->count > 1) | 323 if (rep->count > 1) |
323 { | 324 { |
324 octave_base_value *r = rep->unique_clone (); | 325 octave_base_value *r = rep->unique_clone (); |
325 | 326 |
326 if (--rep->count == 0) | 327 if (--rep->count == 0) |
327 delete rep; | 328 delete rep; |
328 | 329 |
329 rep = r; | 330 rep = r; |
330 } | 331 } |
331 } | 332 } |
332 | 333 |
333 // This uniquifies the value if it is referenced by more than a certain | 334 // This uniquifies the value if it is referenced by more than a certain |
334 // number of shallow copies. This is useful for optimizations where we | 335 // number of shallow copies. This is useful for optimizations where we |
335 // know a certain copy, typically within a cell array, to be obsolete. | 336 // know a certain copy, typically within a cell array, to be obsolete. |
336 void make_unique (int obsolete_copies) | 337 void make_unique (int obsolete_copies) |
337 { | 338 { |
338 if (rep->count > obsolete_copies + 1) | 339 if (rep->count > obsolete_copies + 1) |
339 { | 340 { |
340 octave_base_value *r = rep->unique_clone (); | 341 octave_base_value *r = rep->unique_clone (); |
341 | 342 |
342 if (--rep->count == 0) | 343 if (--rep->count == 0) |
343 delete rep; | 344 delete rep; |
344 | 345 |
345 rep = r; | 346 rep = r; |
346 } | 347 } |
347 } | 348 } |
348 | 349 |
349 // Simple assignment. | 350 // Simple assignment. |
350 | 351 |
351 octave_value& operator = (const octave_value& a) | 352 octave_value& operator = (const octave_value& a) |
352 { | 353 { |
353 if (rep != a.rep) | 354 if (rep != a.rep) |
354 { | 355 { |
355 if (--rep->count == 0) | 356 if (--rep->count == 0) |
356 delete rep; | 357 delete rep; |
357 | 358 |
358 rep = a.rep; | 359 rep = a.rep; |
359 rep->count++; | 360 rep->count++; |
360 } | 361 } |
361 | 362 |
362 return *this; | 363 return *this; |
363 } | 364 } |
364 | 365 |
365 octave_idx_type get_count (void) const { return rep->count; } | 366 octave_idx_type get_count (void) const { return rep->count; } |
366 | 367 |
367 octave_base_value::type_conv_info numeric_conversion_function (void) const | 368 octave_base_value::type_conv_info numeric_conversion_function (void) const |
368 { return rep->numeric_conversion_function (); } | 369 { return rep->numeric_conversion_function (); } |
369 | 370 |
370 octave_base_value::type_conv_info numeric_demotion_function (void) const | 371 octave_base_value::type_conv_info numeric_demotion_function (void) const |
371 { return rep->numeric_demotion_function (); } | 372 { return rep->numeric_demotion_function (); } |
372 | 373 |
373 void maybe_mutate (void); | 374 void maybe_mutate (void); |
374 | 375 |
375 octave_value squeeze (void) const | 376 octave_value squeeze (void) const |
376 { return rep->squeeze (); } | 377 { return rep->squeeze (); } |
377 | 378 |
378 // The result of full(). | 379 // The result of full(). |
379 octave_value full_value (void) const | 380 octave_value full_value (void) const |
380 { return rep->full_value (); } | 381 { return rep->full_value (); } |
381 | 382 |
382 octave_base_value *try_narrowing_conversion (void) | 383 octave_base_value *try_narrowing_conversion (void) |
383 { return rep->try_narrowing_conversion (); } | 384 { return rep->try_narrowing_conversion (); } |
384 | 385 |
385 // Close to dims (), but can be overloaded for classes. | 386 // Close to dims (), but can be overloaded for classes. |
386 Matrix size (void) | 387 Matrix size (void) |
387 { return rep->size (); } | 388 { return rep->size (); } |
388 | 389 |
389 octave_idx_type numel (const octave_value_list& idx) | 390 octave_idx_type numel (const octave_value_list& idx) |
390 { return rep->numel (idx); } | 391 { return rep->numel (idx); } |
391 | 392 |
392 octave_value single_subsref (const std::string& type, | 393 octave_value single_subsref (const std::string& type, |
393 const octave_value_list& idx); | 394 const octave_value_list& idx); |
394 | 395 |
395 octave_value subsref (const std::string& type, | 396 octave_value subsref (const std::string& type, |
396 const std::list<octave_value_list>& idx) | 397 const std::list<octave_value_list>& idx) |
397 { return rep->subsref (type, idx); } | 398 { return rep->subsref (type, idx); } |
398 | 399 |
399 octave_value subsref (const std::string& type, | 400 octave_value subsref (const std::string& type, |
400 const std::list<octave_value_list>& idx, | 401 const std::list<octave_value_list>& idx, |
401 bool auto_add) | 402 bool auto_add) |
402 { return rep->subsref (type, idx, auto_add); } | 403 { return rep->subsref (type, idx, auto_add); } |
403 | 404 |
404 octave_value_list subsref (const std::string& type, | 405 octave_value_list subsref (const std::string& type, |
405 const std::list<octave_value_list>& idx, | 406 const std::list<octave_value_list>& idx, |
406 int nargout); | 407 int nargout); |
407 | 408 |
429 std::list<octave_value_list>& idx, | 430 std::list<octave_value_list>& idx, |
430 size_t skip = 1); | 431 size_t skip = 1); |
431 | 432 |
432 octave_value do_index_op (const octave_value_list& idx, | 433 octave_value do_index_op (const octave_value_list& idx, |
433 bool resize_ok = false) | 434 bool resize_ok = false) |
434 { return rep->do_index_op (idx, resize_ok); } | 435 { return rep->do_index_op (idx, resize_ok); } |
435 | 436 |
436 octave_value_list | 437 octave_value_list |
437 do_multi_index_op (int nargout, const octave_value_list& idx); | 438 do_multi_index_op (int nargout, const octave_value_list& idx); |
438 | 439 |
439 octave_value_list | 440 octave_value_list |
440 do_multi_index_op (int nargout, const octave_value_list& idx, | 441 do_multi_index_op (int nargout, const octave_value_list& idx, |
441 const std::list<octave_lvalue> *lvalue_list); | 442 const std::list<octave_lvalue> *lvalue_list); |
442 | 443 |
443 octave_value subsasgn (const std::string& type, | 444 octave_value subsasgn (const std::string& type, |
444 const std::list<octave_value_list>& idx, | 445 const std::list<octave_value_list>& idx, |
445 const octave_value& rhs); | 446 const octave_value& rhs); |
446 | 447 |
447 octave_value undef_subsasgn (const std::string& type, | 448 octave_value undef_subsasgn (const std::string& type, |
448 const std::list<octave_value_list>& idx, | 449 const std::list<octave_value_list>& idx, |
449 const octave_value& rhs); | 450 const octave_value& rhs); |
450 | 451 |
451 octave_value& assign (assign_op op, const std::string& type, | 452 octave_value& assign (assign_op op, const std::string& type, |
452 const std::list<octave_value_list>& idx, | 453 const std::list<octave_value_list>& idx, |
453 const octave_value& rhs); | 454 const octave_value& rhs); |
454 | 455 |
455 octave_value& assign (assign_op, const octave_value& rhs); | 456 octave_value& assign (assign_op, const octave_value& rhs); |
456 | 457 |
457 idx_vector index_vector (void) const | 458 idx_vector index_vector (void) const |
458 { return rep->index_vector (); } | 459 { return rep->index_vector (); } |
459 | 460 |
460 // Size. | 461 // Size. |
461 | 462 |
462 dim_vector dims (void) const | 463 dim_vector dims (void) const |
463 { return rep->dims (); } | 464 { return rep->dims (); } |
464 | 465 |
465 octave_idx_type rows (void) const { return rep->rows (); } | 466 octave_idx_type rows (void) const { return rep->rows (); } |
466 | 467 |
467 octave_idx_type columns (void) const { return rep->columns (); } | 468 octave_idx_type columns (void) const { return rep->columns (); } |
468 | 469 |
471 int ndims (void) const { return rep->ndims (); } | 472 int ndims (void) const { return rep->ndims (); } |
472 | 473 |
473 bool all_zero_dims (void) const { return dims ().all_zero (); } | 474 bool all_zero_dims (void) const { return dims ().all_zero (); } |
474 | 475 |
475 octave_idx_type numel (void) const | 476 octave_idx_type numel (void) const |
476 { return rep->numel (); } | 477 { return rep->numel (); } |
477 | 478 |
478 octave_idx_type capacity (void) const | 479 octave_idx_type capacity (void) const |
479 { return rep->capacity (); } | 480 { return rep->capacity (); } |
480 | 481 |
481 size_t byte_size (void) const | 482 size_t byte_size (void) const |
482 { return rep->byte_size (); } | 483 { return rep->byte_size (); } |
483 | 484 |
484 octave_idx_type nnz (void) const { return rep->nnz (); } | 485 octave_idx_type nnz (void) const { return rep->nnz (); } |
485 | 486 |
486 octave_idx_type nzmax (void) const { return rep->nzmax (); } | 487 octave_idx_type nzmax (void) const { return rep->nzmax (); } |
487 | 488 |
488 octave_idx_type nfields (void) const { return rep->nfields (); } | 489 octave_idx_type nfields (void) const { return rep->nfields (); } |
489 | 490 |
490 octave_value reshape (const dim_vector& dv) const | 491 octave_value reshape (const dim_vector& dv) const |
491 { return rep->reshape (dv); } | 492 { return rep->reshape (dv); } |
492 | 493 |
493 octave_value permute (const Array<int>& vec, bool inv = false) const | 494 octave_value permute (const Array<int>& vec, bool inv = false) const |
494 { return rep->permute (vec, inv); } | 495 { return rep->permute (vec, inv); } |
495 | 496 |
496 octave_value ipermute (const Array<int>& vec) const | 497 octave_value ipermute (const Array<int>& vec) const |
497 { return rep->permute (vec, true); } | 498 { return rep->permute (vec, true); } |
498 | 499 |
499 octave_value resize (const dim_vector& dv, bool fill = false) const | 500 octave_value resize (const dim_vector& dv, bool fill = false) const |
500 { return rep->resize (dv, fill);} | 501 { return rep->resize (dv, fill);} |
501 | 502 |
502 MatrixType matrix_type (void) const | 503 MatrixType matrix_type (void) const |
503 { return rep->matrix_type (); } | 504 { return rep->matrix_type (); } |
504 | 505 |
505 MatrixType matrix_type (const MatrixType& typ) const | 506 MatrixType matrix_type (const MatrixType& typ) const |
508 // Does this constant have a type? Both of these are provided since | 509 // Does this constant have a type? Both of these are provided since |
509 // it is sometimes more natural to write is_undefined() instead of | 510 // it is sometimes more natural to write is_undefined() instead of |
510 // ! is_defined(). | 511 // ! is_defined(). |
511 | 512 |
512 bool is_defined (void) const | 513 bool is_defined (void) const |
513 { return rep->is_defined (); } | 514 { return rep->is_defined (); } |
514 | 515 |
515 bool is_undefined (void) const | 516 bool is_undefined (void) const |
516 { return ! is_defined (); } | 517 { return ! is_defined (); } |
517 | 518 |
518 bool is_empty (void) const | 519 bool is_empty (void) const |
519 { return rep->is_empty (); } | 520 { return rep->is_empty (); } |
520 | 521 |
521 bool is_cell (void) const | 522 bool is_cell (void) const |
522 { return rep->is_cell (); } | 523 { return rep->is_cell (); } |
523 | 524 |
524 bool is_cellstr (void) const | 525 bool is_cellstr (void) const |
525 { return rep->is_cellstr (); } | 526 { return rep->is_cellstr (); } |
526 | 527 |
527 bool is_real_scalar (void) const | 528 bool is_real_scalar (void) const |
528 { return rep->is_real_scalar (); } | 529 { return rep->is_real_scalar (); } |
529 | 530 |
530 bool is_real_matrix (void) const | 531 bool is_real_matrix (void) const |
531 { return rep->is_real_matrix (); } | 532 { return rep->is_real_matrix (); } |
532 | 533 |
533 bool is_complex_scalar (void) const | 534 bool is_complex_scalar (void) const |
534 { return rep->is_complex_scalar (); } | 535 { return rep->is_complex_scalar (); } |
535 | 536 |
536 bool is_complex_matrix (void) const | 537 bool is_complex_matrix (void) const |
537 { return rep->is_complex_matrix (); } | 538 { return rep->is_complex_matrix (); } |
538 | 539 |
539 bool is_bool_scalar (void) const | 540 bool is_bool_scalar (void) const |
540 { return rep->is_bool_scalar (); } | 541 { return rep->is_bool_scalar (); } |
541 | 542 |
542 bool is_bool_matrix (void) const | 543 bool is_bool_matrix (void) const |
543 { return rep->is_bool_matrix (); } | 544 { return rep->is_bool_matrix (); } |
544 | 545 |
545 bool is_char_matrix (void) const | 546 bool is_char_matrix (void) const |
546 { return rep->is_char_matrix (); } | 547 { return rep->is_char_matrix (); } |
547 | 548 |
548 bool is_diag_matrix (void) const | 549 bool is_diag_matrix (void) const |
549 { return rep->is_diag_matrix (); } | 550 { return rep->is_diag_matrix (); } |
550 | 551 |
551 bool is_perm_matrix (void) const | 552 bool is_perm_matrix (void) const |
552 { return rep->is_perm_matrix (); } | 553 { return rep->is_perm_matrix (); } |
553 | 554 |
554 bool is_string (void) const | 555 bool is_string (void) const |
555 { return rep->is_string (); } | 556 { return rep->is_string (); } |
556 | 557 |
557 bool is_sq_string (void) const | 558 bool is_sq_string (void) const |
558 { return rep->is_sq_string (); } | 559 { return rep->is_sq_string (); } |
559 | 560 |
560 bool is_dq_string (void) const | 561 bool is_dq_string (void) const |
561 { return rep->is_string () && ! rep->is_sq_string (); } | 562 { return rep->is_string () && ! rep->is_sq_string (); } |
562 | 563 |
563 bool is_range (void) const | 564 bool is_range (void) const |
564 { return rep->is_range (); } | 565 { return rep->is_range (); } |
565 | 566 |
566 bool is_map (void) const | 567 bool is_map (void) const |
567 { return rep->is_map (); } | 568 { return rep->is_map (); } |
568 | 569 |
569 bool is_object (void) const | 570 bool is_object (void) const |
570 { return rep->is_object (); } | 571 { return rep->is_object (); } |
571 | 572 |
572 bool is_java (void) const | 573 bool is_java (void) const |
573 { return rep->is_java (); } | 574 { return rep->is_java (); } |
574 | 575 |
575 bool is_cs_list (void) const | 576 bool is_cs_list (void) const |
576 { return rep->is_cs_list (); } | 577 { return rep->is_cs_list (); } |
577 | 578 |
578 bool is_magic_colon (void) const | 579 bool is_magic_colon (void) const |
579 { return rep->is_magic_colon (); } | 580 { return rep->is_magic_colon (); } |
580 | 581 |
581 bool is_null_value (void) const | 582 bool is_null_value (void) const |
582 { return rep->is_null_value (); } | 583 { return rep->is_null_value (); } |
583 | 584 |
584 // Are any or all of the elements in this constant nonzero? | 585 // Are any or all of the elements in this constant nonzero? |
585 | 586 |
586 octave_value all (int dim = 0) const | 587 octave_value all (int dim = 0) const |
587 { return rep->all (dim); } | 588 { return rep->all (dim); } |
588 | 589 |
589 octave_value any (int dim = 0) const | 590 octave_value any (int dim = 0) const |
590 { return rep->any (dim); } | 591 { return rep->any (dim); } |
591 | 592 |
592 builtin_type_t builtin_type (void) const | 593 builtin_type_t builtin_type (void) const |
593 { return rep->builtin_type (); } | 594 { return rep->builtin_type (); } |
594 | 595 |
595 // Floating point types. | 596 // Floating point types. |
596 | 597 |
597 bool is_double_type (void) const | 598 bool is_double_type (void) const |
598 { return rep->is_double_type (); } | 599 { return rep->is_double_type (); } |
599 | 600 |
600 bool is_single_type (void) const | 601 bool is_single_type (void) const |
601 { return rep->is_single_type (); } | 602 { return rep->is_single_type (); } |
602 | 603 |
603 bool is_float_type (void) const | 604 bool is_float_type (void) const |
604 { return rep->is_float_type (); } | 605 { return rep->is_float_type (); } |
605 | 606 |
606 // Integer types. | 607 // Integer types. |
607 | 608 |
608 bool is_int8_type (void) const | 609 bool is_int8_type (void) const |
609 { return rep->is_int8_type (); } | 610 { return rep->is_int8_type (); } |
610 | 611 |
611 bool is_int16_type (void) const | 612 bool is_int16_type (void) const |
612 { return rep->is_int16_type (); } | 613 { return rep->is_int16_type (); } |
613 | 614 |
614 bool is_int32_type (void) const | 615 bool is_int32_type (void) const |
615 { return rep->is_int32_type (); } | 616 { return rep->is_int32_type (); } |
616 | 617 |
617 bool is_int64_type (void) const | 618 bool is_int64_type (void) const |
618 { return rep->is_int64_type (); } | 619 { return rep->is_int64_type (); } |
619 | 620 |
620 bool is_uint8_type (void) const | 621 bool is_uint8_type (void) const |
621 { return rep->is_uint8_type (); } | 622 { return rep->is_uint8_type (); } |
622 | 623 |
623 bool is_uint16_type (void) const | 624 bool is_uint16_type (void) const |
624 { return rep->is_uint16_type (); } | 625 { return rep->is_uint16_type (); } |
625 | 626 |
626 bool is_uint32_type (void) const | 627 bool is_uint32_type (void) const |
627 { return rep->is_uint32_type (); } | 628 { return rep->is_uint32_type (); } |
628 | 629 |
629 bool is_uint64_type (void) const | 630 bool is_uint64_type (void) const |
630 { return rep->is_uint64_type (); } | 631 { return rep->is_uint64_type (); } |
631 | 632 |
632 // Other type stuff. | 633 // Other type stuff. |
633 | 634 |
634 bool is_bool_type (void) const | 635 bool is_bool_type (void) const |
635 { return rep->is_bool_type (); } | 636 { return rep->is_bool_type (); } |
636 | 637 |
637 bool is_integer_type (void) const | 638 bool is_integer_type (void) const |
638 { return rep->is_integer_type (); } | 639 { return rep->is_integer_type (); } |
639 | 640 |
640 bool is_real_type (void) const | 641 bool is_real_type (void) const |
641 { return rep->is_real_type (); } | 642 { return rep->is_real_type (); } |
642 | 643 |
643 bool is_complex_type (void) const | 644 bool is_complex_type (void) const |
644 { return rep->is_complex_type (); } | 645 { return rep->is_complex_type (); } |
645 | 646 |
646 bool is_scalar_type (void) const | 647 bool is_scalar_type (void) const |
647 { return rep->is_scalar_type (); } | 648 { return rep->is_scalar_type (); } |
648 | 649 |
649 bool is_matrix_type (void) const | 650 bool is_matrix_type (void) const |
650 { return rep->is_matrix_type (); } | 651 { return rep->is_matrix_type (); } |
651 | 652 |
652 bool is_numeric_type (void) const | 653 bool is_numeric_type (void) const |
653 { return rep->is_numeric_type (); } | 654 { return rep->is_numeric_type (); } |
654 | 655 |
655 bool is_sparse_type (void) const | 656 bool is_sparse_type (void) const |
656 { return rep->is_sparse_type (); } | 657 { return rep->is_sparse_type (); } |
657 | 658 |
658 // Does this constant correspond to a truth value? | 659 // Does this constant correspond to a truth value? |
659 | 660 |
660 bool is_true (void) const | 661 bool is_true (void) const |
661 { return rep->is_true (); } | 662 { return rep->is_true (); } |
662 | 663 |
663 // Do two constants match (in a switch statement)? | 664 // Do two constants match (in a switch statement)? |
664 | 665 |
665 bool is_equal (const octave_value&) const; | 666 bool is_equal (const octave_value&) const; |
666 | 667 |
667 // Are the dimensions of this constant zero by zero? | 668 // Are the dimensions of this constant zero by zero? |
668 | 669 |
669 bool is_zero_by_zero (void) const | 670 bool is_zero_by_zero (void) const |
670 { return (rows () == 0 && columns () == 0); } | 671 { return (rows () == 0 && columns () == 0); } |
671 | 672 |
672 bool is_constant (void) const | 673 bool is_constant (void) const |
673 { return rep->is_constant (); } | 674 { return rep->is_constant (); } |
674 | 675 |
675 bool is_function_handle (void) const | 676 bool is_function_handle (void) const |
676 { return rep->is_function_handle (); } | 677 { return rep->is_function_handle (); } |
677 | 678 |
678 bool is_anonymous_function (void) const | 679 bool is_anonymous_function (void) const |
679 { return rep->is_anonymous_function (); } | 680 { return rep->is_anonymous_function (); } |
680 | 681 |
681 bool is_inline_function (void) const | 682 bool is_inline_function (void) const |
682 { return rep->is_inline_function (); } | 683 { return rep->is_inline_function (); } |
683 | 684 |
684 bool is_function (void) const | 685 bool is_function (void) const |
685 { return rep->is_function (); } | 686 { return rep->is_function (); } |
686 | 687 |
687 bool is_user_script (void) const | 688 bool is_user_script (void) const |
688 { return rep->is_user_script (); } | 689 { return rep->is_user_script (); } |
689 | 690 |
690 bool is_user_function (void) const | 691 bool is_user_function (void) const |
691 { return rep->is_user_function (); } | 692 { return rep->is_user_function (); } |
692 | 693 |
693 bool is_user_code (void) const | 694 bool is_user_code (void) const |
694 { return rep->is_user_code (); } | 695 { return rep->is_user_code (); } |
695 | 696 |
696 bool is_builtin_function (void) const | 697 bool is_builtin_function (void) const |
697 { return rep->is_builtin_function (); } | 698 { return rep->is_builtin_function (); } |
698 | 699 |
699 bool is_dld_function (void) const | 700 bool is_dld_function (void) const |
700 { return rep->is_dld_function (); } | 701 { return rep->is_dld_function (); } |
701 | 702 |
702 bool is_mex_function (void) const | 703 bool is_mex_function (void) const |
703 { return rep->is_mex_function (); } | 704 { return rep->is_mex_function (); } |
704 | 705 |
705 void erase_subfunctions (void) { rep->erase_subfunctions (); } | 706 void erase_subfunctions (void) { rep->erase_subfunctions (); } |
706 | 707 |
707 // Values. | 708 // Values. |
708 | 709 |
709 octave_value eval (void) { return *this; } | 710 octave_value eval (void) { return *this; } |
710 | 711 |
711 short int | 712 short int |
712 short_value (bool req_int = false, bool frc_str_conv = false) const | 713 short_value (bool req_int = false, bool frc_str_conv = false) const |
713 { return rep->short_value (req_int, frc_str_conv); } | 714 { return rep->short_value (req_int, frc_str_conv); } |
714 | 715 |
715 unsigned short int | 716 unsigned short int |
716 ushort_value (bool req_int = false, bool frc_str_conv = false) const | 717 ushort_value (bool req_int = false, bool frc_str_conv = false) const |
717 { return rep->ushort_value (req_int, frc_str_conv); } | 718 { return rep->ushort_value (req_int, frc_str_conv); } |
718 | 719 |
719 int int_value (bool req_int = false, bool frc_str_conv = false) const | 720 int int_value (bool req_int = false, bool frc_str_conv = false) const |
720 { return rep->int_value (req_int, frc_str_conv); } | 721 { return rep->int_value (req_int, frc_str_conv); } |
721 | 722 |
722 unsigned int | 723 unsigned int |
723 uint_value (bool req_int = false, bool frc_str_conv = false) const | 724 uint_value (bool req_int = false, bool frc_str_conv = false) const |
724 { return rep->uint_value (req_int, frc_str_conv); } | 725 { return rep->uint_value (req_int, frc_str_conv); } |
725 | 726 |
726 int nint_value (bool frc_str_conv = false) const | 727 int nint_value (bool frc_str_conv = false) const |
727 { return rep->nint_value (frc_str_conv); } | 728 { return rep->nint_value (frc_str_conv); } |
728 | 729 |
729 long int | 730 long int |
730 long_value (bool req_int = false, bool frc_str_conv = false) const | 731 long_value (bool req_int = false, bool frc_str_conv = false) const |
731 { return rep->long_value (req_int, frc_str_conv); } | 732 { return rep->long_value (req_int, frc_str_conv); } |
732 | 733 |
733 unsigned long int | 734 unsigned long int |
734 ulong_value (bool req_int = false, bool frc_str_conv = false) const | 735 ulong_value (bool req_int = false, bool frc_str_conv = false) const |
735 { return rep->ulong_value (req_int, frc_str_conv); } | 736 { return rep->ulong_value (req_int, frc_str_conv); } |
736 | 737 |
737 int64_t | 738 int64_t |
738 int64_value (bool req_int = false, bool frc_str_conv = false) const | 739 int64_value (bool req_int = false, bool frc_str_conv = false) const |
739 { return rep->int64_value (req_int, frc_str_conv); } | 740 { return rep->int64_value (req_int, frc_str_conv); } |
740 | 741 |
741 uint64_t | 742 uint64_t |
742 uint64_value (bool req_int = false, bool frc_str_conv = false) const | 743 uint64_value (bool req_int = false, bool frc_str_conv = false) const |
743 { return rep->uint64_value (req_int, frc_str_conv); } | 744 { return rep->uint64_value (req_int, frc_str_conv); } |
744 | 745 |
745 octave_idx_type | 746 octave_idx_type |
746 idx_type_value (bool req_int = false, bool frc_str_conv = false) const; | 747 idx_type_value (bool req_int = false, bool frc_str_conv = false) const; |
747 | 748 |
748 double double_value (bool frc_str_conv = false) const | 749 double double_value (bool frc_str_conv = false) const |
749 { return rep->double_value (frc_str_conv); } | 750 { return rep->double_value (frc_str_conv); } |
750 | 751 |
751 float float_value (bool frc_str_conv = false) const | 752 float float_value (bool frc_str_conv = false) const |
752 { return rep->float_value (frc_str_conv); } | 753 { return rep->float_value (frc_str_conv); } |
753 | 754 |
754 double scalar_value (bool frc_str_conv = false) const | 755 double scalar_value (bool frc_str_conv = false) const |
755 { return rep->scalar_value (frc_str_conv); } | 756 { return rep->scalar_value (frc_str_conv); } |
756 | 757 |
757 float float_scalar_value (bool frc_str_conv = false) const | 758 float float_scalar_value (bool frc_str_conv = false) const |
758 { return rep->float_scalar_value (frc_str_conv); } | 759 { return rep->float_scalar_value (frc_str_conv); } |
759 | 760 |
760 Cell cell_value (void) const; | 761 Cell cell_value (void) const; |
761 | 762 |
762 Matrix matrix_value (bool frc_str_conv = false) const | 763 Matrix matrix_value (bool frc_str_conv = false) const |
763 { return rep->matrix_value (frc_str_conv); } | 764 { return rep->matrix_value (frc_str_conv); } |
764 | 765 |
765 FloatMatrix float_matrix_value (bool frc_str_conv = false) const | 766 FloatMatrix float_matrix_value (bool frc_str_conv = false) const |
766 { return rep->float_matrix_value (frc_str_conv); } | 767 { return rep->float_matrix_value (frc_str_conv); } |
767 | 768 |
768 NDArray array_value (bool frc_str_conv = false) const | 769 NDArray array_value (bool frc_str_conv = false) const |
769 { return rep->array_value (frc_str_conv); } | 770 { return rep->array_value (frc_str_conv); } |
770 | 771 |
771 FloatNDArray float_array_value (bool frc_str_conv = false) const | 772 FloatNDArray float_array_value (bool frc_str_conv = false) const |
772 { return rep->float_array_value (frc_str_conv); } | 773 { return rep->float_array_value (frc_str_conv); } |
773 | 774 |
774 Complex complex_value (bool frc_str_conv = false) const | 775 Complex complex_value (bool frc_str_conv = false) const |
775 { return rep->complex_value (frc_str_conv); } | 776 { return rep->complex_value (frc_str_conv); } |
776 | 777 |
777 FloatComplex float_complex_value (bool frc_str_conv = false) const | 778 FloatComplex float_complex_value (bool frc_str_conv = false) const |
778 { return rep->float_complex_value (frc_str_conv); } | 779 { return rep->float_complex_value (frc_str_conv); } |
779 | 780 |
780 ComplexMatrix complex_matrix_value (bool frc_str_conv = false) const | 781 ComplexMatrix complex_matrix_value (bool frc_str_conv = false) const |
781 { return rep->complex_matrix_value (frc_str_conv); } | 782 { return rep->complex_matrix_value (frc_str_conv); } |
782 | 783 |
783 FloatComplexMatrix float_complex_matrix_value (bool frc_str_conv = false) const | 784 FloatComplexMatrix |
784 { return rep->float_complex_matrix_value (frc_str_conv); } | 785 float_complex_matrix_value (bool frc_str_conv = false) const |
786 { return rep->float_complex_matrix_value (frc_str_conv); } | |
785 | 787 |
786 ComplexNDArray complex_array_value (bool frc_str_conv = false) const | 788 ComplexNDArray complex_array_value (bool frc_str_conv = false) const |
787 { return rep->complex_array_value (frc_str_conv); } | 789 { return rep->complex_array_value (frc_str_conv); } |
788 | 790 |
789 FloatComplexNDArray float_complex_array_value (bool frc_str_conv = false) const | 791 FloatComplexNDArray |
790 { return rep->float_complex_array_value (frc_str_conv); } | 792 float_complex_array_value (bool frc_str_conv = false) const |
793 { return rep->float_complex_array_value (frc_str_conv); } | |
791 | 794 |
792 bool bool_value (bool warn = false) const | 795 bool bool_value (bool warn = false) const |
793 { return rep->bool_value (warn); } | 796 { return rep->bool_value (warn); } |
794 | 797 |
795 boolMatrix bool_matrix_value (bool warn = false) const | 798 boolMatrix bool_matrix_value (bool warn = false) const |
796 { return rep->bool_matrix_value (warn); } | 799 { return rep->bool_matrix_value (warn); } |
797 | 800 |
798 boolNDArray bool_array_value (bool warn = false) const | 801 boolNDArray bool_array_value (bool warn = false) const |
799 { return rep->bool_array_value (warn); } | 802 { return rep->bool_array_value (warn); } |
800 | 803 |
801 charMatrix char_matrix_value (bool frc_str_conv = false) const | 804 charMatrix char_matrix_value (bool frc_str_conv = false) const |
802 { return rep->char_matrix_value (frc_str_conv); } | 805 { return rep->char_matrix_value (frc_str_conv); } |
803 | 806 |
804 charNDArray char_array_value (bool frc_str_conv = false) const | 807 charNDArray char_array_value (bool frc_str_conv = false) const |
805 { return rep->char_array_value (frc_str_conv); } | 808 { return rep->char_array_value (frc_str_conv); } |
806 | 809 |
807 SparseMatrix sparse_matrix_value (bool frc_str_conv = false) const | 810 SparseMatrix sparse_matrix_value (bool frc_str_conv = false) const |
808 { return rep->sparse_matrix_value (frc_str_conv); } | 811 { return rep->sparse_matrix_value (frc_str_conv); } |
809 | 812 |
810 SparseComplexMatrix sparse_complex_matrix_value (bool frc_str_conv = false) const | 813 SparseComplexMatrix |
811 { return rep->sparse_complex_matrix_value (frc_str_conv); } | 814 sparse_complex_matrix_value (bool frc_str_conv = false) const |
815 { return rep->sparse_complex_matrix_value (frc_str_conv); } | |
812 | 816 |
813 SparseBoolMatrix sparse_bool_matrix_value (bool warn = false) const | 817 SparseBoolMatrix sparse_bool_matrix_value (bool warn = false) const |
814 { return rep->sparse_bool_matrix_value (warn); } | 818 { return rep->sparse_bool_matrix_value (warn); } |
815 | 819 |
816 DiagMatrix diag_matrix_value (bool force = false) const | 820 DiagMatrix diag_matrix_value (bool force = false) const |
817 { return rep->diag_matrix_value (force); } | 821 { return rep->diag_matrix_value (force); } |
818 | 822 |
819 FloatDiagMatrix float_diag_matrix_value (bool force = false) const | 823 FloatDiagMatrix float_diag_matrix_value (bool force = false) const |
820 { return rep->float_diag_matrix_value (force); } | 824 { return rep->float_diag_matrix_value (force); } |
821 | 825 |
822 ComplexDiagMatrix complex_diag_matrix_value (bool force = false) const | 826 ComplexDiagMatrix complex_diag_matrix_value (bool force = false) const |
823 { return rep->complex_diag_matrix_value (force); } | 827 { return rep->complex_diag_matrix_value (force); } |
824 | 828 |
825 FloatComplexDiagMatrix float_complex_diag_matrix_value (bool force = false) const | 829 FloatComplexDiagMatrix |
826 { return rep->float_complex_diag_matrix_value (force); } | 830 float_complex_diag_matrix_value (bool force = false) const |
831 { return rep->float_complex_diag_matrix_value (force); } | |
827 | 832 |
828 PermMatrix perm_matrix_value (void) const | 833 PermMatrix perm_matrix_value (void) const |
829 { return rep->perm_matrix_value (); } | 834 { return rep->perm_matrix_value (); } |
830 | 835 |
831 octave_int8 int8_scalar_value (void) const | 836 octave_int8 int8_scalar_value (void) const |
832 { return rep->int8_scalar_value (); } | 837 { return rep->int8_scalar_value (); } |
833 | 838 |
834 octave_int16 int16_scalar_value (void) const | 839 octave_int16 int16_scalar_value (void) const |
835 { return rep->int16_scalar_value (); } | 840 { return rep->int16_scalar_value (); } |
836 | 841 |
837 octave_int32 int32_scalar_value (void) const | 842 octave_int32 int32_scalar_value (void) const |
838 { return rep->int32_scalar_value (); } | 843 { return rep->int32_scalar_value (); } |
839 | 844 |
840 octave_int64 int64_scalar_value (void) const | 845 octave_int64 int64_scalar_value (void) const |
841 { return rep->int64_scalar_value (); } | 846 { return rep->int64_scalar_value (); } |
842 | 847 |
843 octave_uint8 uint8_scalar_value (void) const | 848 octave_uint8 uint8_scalar_value (void) const |
844 { return rep->uint8_scalar_value (); } | 849 { return rep->uint8_scalar_value (); } |
845 | 850 |
846 octave_uint16 uint16_scalar_value (void) const | 851 octave_uint16 uint16_scalar_value (void) const |
847 { return rep->uint16_scalar_value (); } | 852 { return rep->uint16_scalar_value (); } |
848 | 853 |
849 octave_uint32 uint32_scalar_value (void) const | 854 octave_uint32 uint32_scalar_value (void) const |
850 { return rep->uint32_scalar_value (); } | 855 { return rep->uint32_scalar_value (); } |
851 | 856 |
852 octave_uint64 uint64_scalar_value (void) const | 857 octave_uint64 uint64_scalar_value (void) const |
853 { return rep->uint64_scalar_value (); } | 858 { return rep->uint64_scalar_value (); } |
854 | 859 |
855 int8NDArray int8_array_value (void) const | 860 int8NDArray int8_array_value (void) const |
856 { return rep->int8_array_value (); } | 861 { return rep->int8_array_value (); } |
857 | 862 |
858 int16NDArray int16_array_value (void) const | 863 int16NDArray int16_array_value (void) const |
859 { return rep->int16_array_value (); } | 864 { return rep->int16_array_value (); } |
860 | 865 |
861 int32NDArray int32_array_value (void) const | 866 int32NDArray int32_array_value (void) const |
862 { return rep->int32_array_value (); } | 867 { return rep->int32_array_value (); } |
863 | 868 |
864 int64NDArray int64_array_value (void) const | 869 int64NDArray int64_array_value (void) const |
865 { return rep->int64_array_value (); } | 870 { return rep->int64_array_value (); } |
866 | 871 |
867 uint8NDArray uint8_array_value (void) const | 872 uint8NDArray uint8_array_value (void) const |
868 { return rep->uint8_array_value (); } | 873 { return rep->uint8_array_value (); } |
869 | 874 |
870 uint16NDArray uint16_array_value (void) const | 875 uint16NDArray uint16_array_value (void) const |
871 { return rep->uint16_array_value (); } | 876 { return rep->uint16_array_value (); } |
872 | 877 |
873 uint32NDArray uint32_array_value (void) const | 878 uint32NDArray uint32_array_value (void) const |
874 { return rep->uint32_array_value (); } | 879 { return rep->uint32_array_value (); } |
875 | 880 |
876 uint64NDArray uint64_array_value (void) const | 881 uint64NDArray uint64_array_value (void) const |
877 { return rep->uint64_array_value (); } | 882 { return rep->uint64_array_value (); } |
878 | 883 |
879 string_vector all_strings (bool pad = false) const | 884 string_vector all_strings (bool pad = false) const |
880 { return rep->all_strings (pad); } | 885 { return rep->all_strings (pad); } |
881 | 886 |
882 std::string string_value (bool force = false) const | 887 std::string string_value (bool force = false) const |
883 { return rep->string_value (force); } | 888 { return rep->string_value (force); } |
884 | 889 |
885 Array<std::string> cellstr_value (void) const | 890 Array<std::string> cellstr_value (void) const |
886 { return rep->cellstr_value (); } | 891 { return rep->cellstr_value (); } |
887 | 892 |
888 Range range_value (void) const | 893 Range range_value (void) const |
889 { return rep->range_value (); } | 894 { return rep->range_value (); } |
890 | 895 |
891 octave_map map_value (void) const; | 896 octave_map map_value (void) const; |
892 | 897 |
893 octave_scalar_map scalar_map_value (void) const; | 898 octave_scalar_map scalar_map_value (void) const; |
894 | 899 |
895 string_vector map_keys (void) const | 900 string_vector map_keys (void) const |
896 { return rep->map_keys (); } | 901 { return rep->map_keys (); } |
897 | 902 |
898 size_t nparents (void) const | 903 size_t nparents (void) const |
899 { return rep->nparents (); } | 904 { return rep->nparents (); } |
900 | 905 |
901 std::list<std::string> parent_class_name_list (void) const | 906 std::list<std::string> parent_class_name_list (void) const |
902 { return rep->parent_class_name_list (); } | 907 { return rep->parent_class_name_list (); } |
903 | 908 |
904 string_vector parent_class_names (void) const | 909 string_vector parent_class_names (void) const |
905 { return rep->parent_class_names (); } | 910 { return rep->parent_class_names (); } |
906 | 911 |
907 octave_base_value * | 912 octave_base_value * |
908 find_parent_class (const std::string& parent_class_name) | 913 find_parent_class (const std::string& parent_class_name) |
909 { return rep->find_parent_class (parent_class_name); } | 914 { return rep->find_parent_class (parent_class_name); } |
910 | 915 |
911 octave_function *function_value (bool silent = false) const; | 916 octave_function *function_value (bool silent = false) const; |
912 | 917 |
913 octave_user_function *user_function_value (bool silent = false) const; | 918 octave_user_function *user_function_value (bool silent = false) const; |
914 | 919 |
921 octave_fcn_inline *fcn_inline_value (bool silent = false) const; | 926 octave_fcn_inline *fcn_inline_value (bool silent = false) const; |
922 | 927 |
923 octave_value_list list_value (void) const; | 928 octave_value_list list_value (void) const; |
924 | 929 |
925 ColumnVector column_vector_value (bool frc_str_conv = false, | 930 ColumnVector column_vector_value (bool frc_str_conv = false, |
926 bool frc_vec_conv = false) const; | 931 bool frc_vec_conv = false) const; |
927 | 932 |
928 ComplexColumnVector | 933 ComplexColumnVector |
929 complex_column_vector_value (bool frc_str_conv = false, | 934 complex_column_vector_value (bool frc_str_conv = false, |
930 bool frc_vec_conv = false) const; | 935 bool frc_vec_conv = false) const; |
931 | 936 |
932 RowVector row_vector_value (bool frc_str_conv = false, | 937 RowVector row_vector_value (bool frc_str_conv = false, |
933 bool frc_vec_conv = false) const; | 938 bool frc_vec_conv = false) const; |
934 | 939 |
935 ComplexRowVector | 940 ComplexRowVector |
936 complex_row_vector_value (bool frc_str_conv = false, | 941 complex_row_vector_value (bool frc_str_conv = false, |
937 bool frc_vec_conv = false) const; | 942 bool frc_vec_conv = false) const; |
938 | 943 |
939 | 944 |
940 FloatColumnVector float_column_vector_value (bool frc_str_conv = false, | 945 FloatColumnVector float_column_vector_value (bool frc_str_conv = false, |
941 bool frc_vec_conv = false) const; | 946 bool frc_vec_conv = false) const; |
942 | 947 |
943 FloatComplexColumnVector | 948 FloatComplexColumnVector |
944 float_complex_column_vector_value (bool frc_str_conv = false, | 949 float_complex_column_vector_value (bool frc_str_conv = false, |
945 bool frc_vec_conv = false) const; | 950 bool frc_vec_conv = false) const; |
946 | 951 |
947 FloatRowVector float_row_vector_value (bool frc_str_conv = false, | 952 FloatRowVector float_row_vector_value (bool frc_str_conv = false, |
948 bool frc_vec_conv = false) const; | 953 bool frc_vec_conv = false) const; |
949 | 954 |
950 FloatComplexRowVector | 955 FloatComplexRowVector |
951 float_complex_row_vector_value (bool frc_str_conv = false, | 956 float_complex_row_vector_value (bool frc_str_conv = false, |
952 bool frc_vec_conv = false) const; | 957 bool frc_vec_conv = false) const; |
953 | 958 |
954 | 959 |
955 | 960 |
956 | 961 |
957 Array<int> int_vector_value (bool req_int = false, | 962 Array<int> int_vector_value (bool req_int = false, |
968 | 973 |
969 Array<Complex> complex_vector_value (bool frc_str_conv = false, | 974 Array<Complex> complex_vector_value (bool frc_str_conv = false, |
970 bool frc_vec_conv = false) const; | 975 bool frc_vec_conv = false) const; |
971 | 976 |
972 Array<float> float_vector_value (bool frc_str_conv = false, | 977 Array<float> float_vector_value (bool frc_str_conv = false, |
978 bool frc_vec_conv = false) const; | |
979 | |
980 Array<FloatComplex> | |
981 float_complex_vector_value (bool frc_str_conv = false, | |
973 bool frc_vec_conv = false) const; | 982 bool frc_vec_conv = false) const; |
974 | 983 |
975 Array<FloatComplex> float_complex_vector_value (bool frc_str_conv = false, | |
976 bool frc_vec_conv = false) const; | |
977 | |
978 // Possibly economize a lazy-indexed value. | 984 // Possibly economize a lazy-indexed value. |
979 | 985 |
980 void maybe_economize (void) | 986 void maybe_economize (void) |
981 { rep->maybe_economize (); } | 987 { rep->maybe_economize (); } |
982 | 988 |
983 // The following two hook conversions are called on any octave_value prior to | 989 // The following two hook conversions are called on any octave_value prior to |
984 // storing it to a "permanent" location, like a named variable, a cell or a | 990 // storing it to a "permanent" location, like a named variable, a cell or a |
985 // struct component, or a return value of a function. | 991 // struct component, or a return value of a function. |
986 | 992 |
995 // class wants a certain kind of constant, he should simply ask for | 1001 // class wants a certain kind of constant, he should simply ask for |
996 // it, and we should convert it if possible. | 1002 // it, and we should convert it if possible. |
997 | 1003 |
998 octave_value convert_to_str (bool pad = false, bool force = false, | 1004 octave_value convert_to_str (bool pad = false, bool force = false, |
999 char type = '\'') const | 1005 char type = '\'') const |
1000 { return rep->convert_to_str (pad, force, type); } | 1006 { return rep->convert_to_str (pad, force, type); } |
1001 | 1007 |
1002 octave_value | 1008 octave_value |
1003 convert_to_str_internal (bool pad, bool force, char type) const | 1009 convert_to_str_internal (bool pad, bool force, char type) const |
1004 { return rep->convert_to_str_internal (pad, force, type); } | 1010 { return rep->convert_to_str_internal (pad, force, type); } |
1005 | 1011 |
1006 void convert_to_row_or_column_vector (void) | 1012 void convert_to_row_or_column_vector (void) |
1007 { rep->convert_to_row_or_column_vector (); } | 1013 { rep->convert_to_row_or_column_vector (); } |
1008 | 1014 |
1009 bool print_as_scalar (void) const | 1015 bool print_as_scalar (void) const |
1010 { return rep->print_as_scalar (); } | 1016 { return rep->print_as_scalar (); } |
1011 | 1017 |
1012 void print (std::ostream& os, bool pr_as_read_syntax = false) const | 1018 void print (std::ostream& os, bool pr_as_read_syntax = false) const |
1013 { rep->print (os, pr_as_read_syntax); } | 1019 { rep->print (os, pr_as_read_syntax); } |
1014 | 1020 |
1015 void print_raw (std::ostream& os, | 1021 void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const |
1016 bool pr_as_read_syntax = false) const | 1022 { rep->print_raw (os, pr_as_read_syntax); } |
1017 { rep->print_raw (os, pr_as_read_syntax); } | |
1018 | 1023 |
1019 bool print_name_tag (std::ostream& os, const std::string& name) const | 1024 bool print_name_tag (std::ostream& os, const std::string& name) const |
1020 { return rep->print_name_tag (os, name); } | 1025 { return rep->print_name_tag (os, name); } |
1021 | 1026 |
1022 void print_with_name (std::ostream& os, const std::string& name) const | 1027 void print_with_name (std::ostream& os, const std::string& name) const |
1023 { rep->print_with_name (os, name, true); } | 1028 { rep->print_with_name (os, name, true); } |
1024 | 1029 |
1025 std::string short_disp (void) const { return rep->short_disp (); } | 1030 std::string short_disp (void) const { return rep->short_disp (); } |
1031 std::string class_name (void) const { return rep->class_name (); } | 1036 std::string class_name (void) const { return rep->class_name (); } |
1032 | 1037 |
1033 // Unary and binary operations. | 1038 // Unary and binary operations. |
1034 | 1039 |
1035 friend OCTINTERP_API octave_value do_unary_op (unary_op op, | 1040 friend OCTINTERP_API octave_value do_unary_op (unary_op op, |
1036 const octave_value& a); | 1041 const octave_value& a); |
1037 | 1042 |
1038 octave_value& do_non_const_unary_op (unary_op op); | 1043 octave_value& do_non_const_unary_op (unary_op op); |
1039 | 1044 |
1040 octave_value& do_non_const_unary_op (unary_op op, const std::string& type, | 1045 octave_value& do_non_const_unary_op (unary_op op, const std::string& type, |
1041 const std::list<octave_value_list>& idx); | 1046 const std::list<octave_value_list>& idx); |
1042 | 1047 |
1043 friend OCTINTERP_API octave_value do_binary_op (binary_op op, | 1048 friend OCTINTERP_API octave_value do_binary_op (binary_op op, |
1044 const octave_value& a, | 1049 const octave_value& a, |
1045 const octave_value& b); | 1050 const octave_value& b); |
1046 | 1051 |
1047 friend OCTINTERP_API octave_value do_binary_op (compound_binary_op op, | 1052 friend OCTINTERP_API octave_value do_binary_op (compound_binary_op op, |
1048 const octave_value& a, | 1053 const octave_value& a, |
1049 const octave_value& b); | 1054 const octave_value& b); |
1050 | 1055 |
1051 friend OCTINTERP_API octave_value do_cat_op (const octave_value& a, | 1056 friend OCTINTERP_API octave_value do_cat_op (const octave_value& a, |
1052 const octave_value& b, | 1057 const octave_value& b, |
1053 const Array<octave_idx_type>& ra_idx); | 1058 const Array<octave_idx_type>& ra_idx); |
1054 | 1059 |
1055 const octave_base_value& get_rep (void) const { return *rep; } | 1060 const octave_base_value& get_rep (void) const { return *rep; } |
1056 | 1061 |
1057 bool is_copy_of (const octave_value &val) const { return rep == val.rep; } | 1062 bool is_copy_of (const octave_value &val) const { return rep == val.rep; } |
1058 | 1063 |
1059 void print_info (std::ostream& os, | 1064 void print_info (std::ostream& os, |
1060 const std::string& prefix = std::string ()) const; | 1065 const std::string& prefix = std::string ()) const; |
1061 | 1066 |
1062 bool save_ascii (std::ostream& os) { return rep->save_ascii (os); } | 1067 bool save_ascii (std::ostream& os) { return rep->save_ascii (os); } |
1063 | 1068 |
1064 bool load_ascii (std::istream& is) { return rep->load_ascii (is); } | 1069 bool load_ascii (std::istream& is) { return rep->load_ascii (is); } |
1065 | 1070 |
1066 bool save_binary (std::ostream& os, bool& save_as_floats) | 1071 bool save_binary (std::ostream& os, bool& save_as_floats) |
1067 { return rep->save_binary (os, save_as_floats); } | 1072 { return rep->save_binary (os, save_as_floats); } |
1068 | 1073 |
1069 bool load_binary (std::istream& is, bool swap, | 1074 bool load_binary (std::istream& is, bool swap, |
1070 oct_mach_info::float_format fmt) | 1075 oct_mach_info::float_format fmt) |
1071 { return rep->load_binary (is, swap, fmt); } | 1076 { return rep->load_binary (is, swap, fmt); } |
1072 | 1077 |
1073 #if defined (HAVE_HDF5) | 1078 #if defined (HAVE_HDF5) |
1074 bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats) | 1079 bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats) |
1075 { return rep->save_hdf5 (loc_id, name, save_as_floats); } | 1080 { return rep->save_hdf5 (loc_id, name, save_as_floats); } |
1076 | 1081 |
1077 bool load_hdf5 (hid_t loc_id, const char *name) | 1082 bool load_hdf5 (hid_t loc_id, const char *name) |
1078 { return rep->load_hdf5 (loc_id, name); } | 1083 { return rep->load_hdf5 (loc_id, name); } |
1079 #endif | 1084 #endif |
1080 | 1085 |
1081 int write (octave_stream& os, int block_size, | 1086 int write (octave_stream& os, int block_size, |
1082 oct_data_conv::data_type output_type, int skip, | 1087 oct_data_conv::data_type output_type, int skip, |
1083 oct_mach_info::float_format flt_fmt) const; | 1088 oct_mach_info::float_format flt_fmt) const; |
1084 | 1089 |
1085 octave_base_value *internal_rep (void) const { return rep; } | 1090 octave_base_value *internal_rep (void) const { return rep; } |
1086 | 1091 |
1087 // Unsafe. These functions exist to support the MEX interface. | 1092 // Unsafe. These functions exist to support the MEX interface. |
1088 // You should not use them anywhere else. | 1093 // You should not use them anywhere else. |
1093 octave_idx_type *mex_get_jc (void) const { return rep->mex_get_jc (); } | 1098 octave_idx_type *mex_get_jc (void) const { return rep->mex_get_jc (); } |
1094 | 1099 |
1095 mxArray *as_mxArray (void) const { return rep->as_mxArray (); } | 1100 mxArray *as_mxArray (void) const { return rep->as_mxArray (); } |
1096 | 1101 |
1097 octave_value diag (octave_idx_type k = 0) const | 1102 octave_value diag (octave_idx_type k = 0) const |
1098 { return rep->diag (k); } | 1103 { return rep->diag (k); } |
1099 | 1104 |
1100 octave_value diag (octave_idx_type m, octave_idx_type n) const | 1105 octave_value diag (octave_idx_type m, octave_idx_type n) const |
1101 { return rep->diag (m, n); } | 1106 { return rep->diag (m, n); } |
1102 | 1107 |
1103 octave_value sort (octave_idx_type dim = 0, sortmode mode = ASCENDING) const | 1108 octave_value sort (octave_idx_type dim = 0, sortmode mode = ASCENDING) const |
1104 { return rep->sort (dim, mode); } | 1109 { return rep->sort (dim, mode); } |
1105 octave_value sort (Array<octave_idx_type> &sidx, octave_idx_type dim = 0, | 1110 octave_value sort (Array<octave_idx_type> &sidx, octave_idx_type dim = 0, |
1106 sortmode mode = ASCENDING) const | 1111 sortmode mode = ASCENDING) const |
1107 { return rep->sort (sidx, dim, mode); } | 1112 { return rep->sort (sidx, dim, mode); } |
1108 | 1113 |
1109 sortmode is_sorted (sortmode mode = UNSORTED) const | 1114 sortmode is_sorted (sortmode mode = UNSORTED) const |
1110 { return rep->is_sorted (mode); } | 1115 { return rep->is_sorted (mode); } |
1111 | 1116 |
1112 Array<octave_idx_type> sort_rows_idx (sortmode mode = ASCENDING) const | 1117 Array<octave_idx_type> sort_rows_idx (sortmode mode = ASCENDING) const |
1113 { return rep->sort_rows_idx (mode); } | 1118 { return rep->sort_rows_idx (mode); } |
1114 | 1119 |
1115 sortmode is_sorted_rows (sortmode mode = UNSORTED) const | 1120 sortmode is_sorted_rows (sortmode mode = UNSORTED) const |
1116 { return rep->is_sorted_rows (mode); } | 1121 { return rep->is_sorted_rows (mode); } |
1117 | 1122 |
1118 void lock (void) { rep->lock (); } | 1123 void lock (void) { rep->lock (); } |
1119 | 1124 |
1120 void unlock (void) { rep->unlock (); } | 1125 void unlock (void) { rep->unlock (); } |
1121 | 1126 |
1193 MAPPER_FORWARD (xtoupper) | 1198 MAPPER_FORWARD (xtoupper) |
1194 | 1199 |
1195 #undef MAPPER_FORWARD | 1200 #undef MAPPER_FORWARD |
1196 | 1201 |
1197 octave_value map (octave_base_value::unary_mapper_t umap) const | 1202 octave_value map (octave_base_value::unary_mapper_t umap) const |
1198 { return rep->map (umap); } | 1203 { return rep->map (umap); } |
1199 | 1204 |
1200 // Extract the n-th element, aka val(n). Result is undefined if val is not an | 1205 // Extract the n-th element, aka val(n). Result is undefined if val is not an |
1201 // array type or n is out of range. Never error. | 1206 // array type or n is out of range. Never error. |
1202 octave_value | 1207 octave_value |
1203 fast_elem_extract (octave_idx_type n) const | 1208 fast_elem_extract (octave_idx_type n) const |
1204 { return rep->fast_elem_extract (n); } | 1209 { return rep->fast_elem_extract (n); } |
1205 | 1210 |
1206 // Assign the n-th element, aka val(n) = x. Returns false if val is not an | 1211 // Assign the n-th element, aka val(n) = x. Returns false if val is not an |
1207 // array type, x is not a matching scalar type, or n is out of range. | 1212 // array type, x is not a matching scalar type, or n is out of range. |
1208 // Never error. | 1213 // Never error. |
1209 virtual bool | 1214 virtual bool |
1210 fast_elem_insert (octave_idx_type n, const octave_value& x) | 1215 fast_elem_insert (octave_idx_type n, const octave_value& x) |
1211 { | 1216 { |
1212 make_unique (); | 1217 make_unique (); |
1213 return rep->fast_elem_insert (n, x); | 1218 return rep->fast_elem_insert (n, x); |
1214 } | 1219 } |
1215 | 1220 |
1216 protected: | 1221 protected: |
1217 | 1222 |
1218 // The real representation. | 1223 // The real representation. |
1219 octave_base_value *rep; | 1224 octave_base_value *rep; |
1339 #define OV_REP_TYPE octave_base_value | 1344 #define OV_REP_TYPE octave_base_value |
1340 | 1345 |
1341 // Templated value extractors. | 1346 // Templated value extractors. |
1342 template<class Value> | 1347 template<class Value> |
1343 inline Value octave_value_extract (const octave_value&) | 1348 inline Value octave_value_extract (const octave_value&) |
1344 { assert (false); } | 1349 { assert (false); } |
1345 | 1350 |
1346 #define DEF_VALUE_EXTRACTOR(VALUE,MPREFIX) \ | 1351 #define DEF_VALUE_EXTRACTOR(VALUE,MPREFIX) \ |
1347 template<> \ | 1352 template<> \ |
1348 inline VALUE octave_value_extract<VALUE> (const octave_value& v) \ | 1353 inline VALUE octave_value_extract<VALUE> (const octave_value& v) \ |
1349 { return v.MPREFIX ## _value (); } | 1354 { return v.MPREFIX ## _value (); } |