annotate libinterp/octave-value/ov-range.h @ 17822:ebb3ef964372

maint: Use common #define syntax "octave_filename_h" in h_files. * libgui/src/dialog.h, libgui/src/find-files-dialog.h, libgui/src/find-files-model.h, libgui/src/m-editor/file-editor-tab.h, libgui/src/m-editor/octave-qscintilla.h, libgui/src/main-window.h, libgui/src/octave-dock-widget.h, libgui/src/workspace-model.h, libgui/src/workspace-view.h, libinterp/corefcn/Cell.h, libinterp/corefcn/gl-render.h, libinterp/corefcn/gl2ps-renderer.h, libinterp/corefcn/graphics.in.h, libinterp/corefcn/oct-errno.h, libinterp/corefcn/oct-fstrm.h, libinterp/corefcn/oct-handle.h, libinterp/corefcn/oct-hdf5.h, libinterp/corefcn/oct-hist.h, libinterp/corefcn/oct-iostrm.h, libinterp/corefcn/oct-lvalue.h, libinterp/corefcn/oct-prcstrm.h, libinterp/corefcn/oct-procbuf.h, libinterp/corefcn/oct-stdstrm.h, libinterp/corefcn/oct-stream.h, libinterp/corefcn/oct-strstrm.h, libinterp/corefcn/octave-link.h, libinterp/corefcn/pt-jit.h, libinterp/octave-value/ov-base-diag.h, libinterp/octave-value/ov-base-int.h, libinterp/octave-value/ov-base-mat.h, libinterp/octave-value/ov-base-scalar.h, libinterp/octave-value/ov-base-sparse.h, libinterp/octave-value/ov-base.h, libinterp/octave-value/ov-bool-mat.h, libinterp/octave-value/ov-bool-sparse.h, libinterp/octave-value/ov-bool.h, libinterp/octave-value/ov-builtin.h, libinterp/octave-value/ov-cell.h, libinterp/octave-value/ov-ch-mat.h, libinterp/octave-value/ov-class.h, libinterp/octave-value/ov-colon.h, libinterp/octave-value/ov-complex.h, libinterp/octave-value/ov-cs-list.h, libinterp/octave-value/ov-cx-diag.h, libinterp/octave-value/ov-cx-mat.h, libinterp/octave-value/ov-cx-sparse.h, libinterp/octave-value/ov-dld-fcn.h, libinterp/octave-value/ov-fcn-handle.h, libinterp/octave-value/ov-fcn-inline.h, libinterp/octave-value/ov-fcn.h, libinterp/octave-value/ov-float.h, libinterp/octave-value/ov-flt-complex.h, libinterp/octave-value/ov-flt-cx-diag.h, libinterp/octave-value/ov-flt-cx-mat.h, libinterp/octave-value/ov-flt-re-diag.h, libinterp/octave-value/ov-flt-re-mat.h, libinterp/octave-value/ov-int-traits.h, libinterp/octave-value/ov-int16.h, libinterp/octave-value/ov-int32.h, libinterp/octave-value/ov-int64.h, libinterp/octave-value/ov-int8.h, libinterp/octave-value/ov-java.h, libinterp/octave-value/ov-lazy-idx.h, libinterp/octave-value/ov-mex-fcn.h, libinterp/octave-value/ov-null-mat.h, libinterp/octave-value/ov-perm.h, libinterp/octave-value/ov-range.h, libinterp/octave-value/ov-re-diag.h, libinterp/octave-value/ov-re-mat.h, libinterp/octave-value/ov-re-sparse.h, libinterp/octave-value/ov-scalar.h, libinterp/octave-value/ov-str-mat.h, libinterp/octave-value/ov-struct.h, libinterp/octave-value/ov-typeinfo.h, libinterp/octave-value/ov-uint16.h, libinterp/octave-value/ov-uint32.h, libinterp/octave-value/ov-uint64.h, libinterp/octave-value/ov-uint8.h, libinterp/octave-value/ov-usr-fcn.h, libinterp/octave-value/ov.h, libinterp/parse-tree/pt-all.h, libinterp/parse-tree/pt-arg-list.h, libinterp/parse-tree/pt-array-list.h, libinterp/parse-tree/pt-assign.h, libinterp/parse-tree/pt-binop.h, libinterp/parse-tree/pt-bp.h, libinterp/parse-tree/pt-cbinop.h, libinterp/parse-tree/pt-cell.h, libinterp/parse-tree/pt-check.h, libinterp/parse-tree/pt-cmd.h, libinterp/parse-tree/pt-colon.h, libinterp/parse-tree/pt-const.h, libinterp/parse-tree/pt-decl.h, libinterp/parse-tree/pt-eval.h, libinterp/parse-tree/pt-except.h, libinterp/parse-tree/pt-exp.h, libinterp/parse-tree/pt-fcn-handle.h, libinterp/parse-tree/pt-id.h, libinterp/parse-tree/pt-idx.h, libinterp/parse-tree/pt-jump.h, libinterp/parse-tree/pt-loop.h, libinterp/parse-tree/pt-mat.h, libinterp/parse-tree/pt-misc.h, libinterp/parse-tree/pt-pr-code.h, libinterp/parse-tree/pt-select.h, libinterp/parse-tree/pt-stmt.h, libinterp/parse-tree/pt-unop.h, libinterp/parse-tree/pt-walk.h, libinterp/parse-tree/pt.h, liboctave/array/CColVector.h, liboctave/array/CDiagMatrix.h, liboctave/array/CMatrix.h, liboctave/array/CNDArray.h, liboctave/array/CRowVector.h, liboctave/array/boolMatrix.h, liboctave/array/chMatrix.h, liboctave/array/chNDArray.h, liboctave/array/dColVector.h, liboctave/array/dDiagMatrix.h, liboctave/array/dMatrix.h, liboctave/array/dNDArray.h, liboctave/array/dRowVector.h, liboctave/array/fCColVector.h, liboctave/array/fCDiagMatrix.h, liboctave/array/fCMatrix.h, liboctave/array/fCNDArray.h, liboctave/array/fCRowVector.h, liboctave/array/fColVector.h, liboctave/array/fDiagMatrix.h, liboctave/array/fMatrix.h, liboctave/array/fNDArray.h, liboctave/array/fRowVector.h, liboctave/cruft/misc/lo-error.h, liboctave/numeric/CmplxAEPBAL.h, liboctave/numeric/CmplxCHOL.h, liboctave/numeric/CmplxGEPBAL.h, liboctave/numeric/CmplxHESS.h, liboctave/numeric/CmplxLU.h, liboctave/numeric/CmplxQR.h, liboctave/numeric/CmplxQRP.h, liboctave/numeric/CmplxSCHUR.h, liboctave/numeric/CmplxSVD.h, liboctave/numeric/Quad.h, liboctave/numeric/SparseCmplxCHOL.h, liboctave/numeric/SparseCmplxLU.h, liboctave/numeric/SparseCmplxQR.h, liboctave/numeric/SparseQR.h, liboctave/numeric/SparsedbleCHOL.h, liboctave/numeric/SparsedbleLU.h, liboctave/numeric/bsxfun.h, liboctave/numeric/dbleAEPBAL.h, liboctave/numeric/dbleCHOL.h, liboctave/numeric/dbleGEPBAL.h, liboctave/numeric/dbleHESS.h, liboctave/numeric/dbleLU.h, liboctave/numeric/dbleQR.h, liboctave/numeric/dbleQRP.h, liboctave/numeric/dbleSCHUR.h, liboctave/numeric/dbleSVD.h, liboctave/numeric/fCmplxAEPBAL.h, liboctave/numeric/fCmplxCHOL.h, liboctave/numeric/fCmplxGEPBAL.h, liboctave/numeric/fCmplxHESS.h, liboctave/numeric/fCmplxLU.h, liboctave/numeric/fCmplxQR.h, liboctave/numeric/fCmplxQRP.h, liboctave/numeric/fCmplxSCHUR.h, liboctave/numeric/fCmplxSVD.h, liboctave/numeric/fEIG.h, liboctave/numeric/floatAEPBAL.h, liboctave/numeric/floatCHOL.h, liboctave/numeric/floatGEPBAL.h, liboctave/numeric/floatHESS.h, liboctave/numeric/floatLU.h, liboctave/numeric/floatQR.h, liboctave/numeric/floatQRP.h, liboctave/numeric/floatSCHUR.h, liboctave/numeric/floatSVD.h, liboctave/numeric/lo-mappers.h, liboctave/numeric/lo-specfun.h, liboctave/numeric/oct-convn.h, liboctave/numeric/oct-norm.h, liboctave/numeric/oct-rand.h, liboctave/operators/Sparse-diag-op-defs.h, liboctave/operators/Sparse-op-defs.h, liboctave/operators/Sparse-perm-op-defs.h, liboctave/system/lo-sysdep.h, liboctave/system/oct-env.h, liboctave/system/oct-group.h, liboctave/system/oct-openmp.h, liboctave/system/oct-passwd.h, liboctave/system/oct-syscalls.h, liboctave/system/oct-time.h, liboctave/system/oct-uname.h, liboctave/util/lo-array-gripes.h, liboctave/util/lo-cutils.h, liboctave/util/lo-ieee.h, liboctave/util/lo-macros.h, liboctave/util/lo-math.h, liboctave/util/lo-regexp.h, liboctave/util/lo-traits.h, liboctave/util/lo-utils.h, liboctave/util/oct-base64.h, liboctave/util/oct-binmap.h, liboctave/util/oct-glob.h, liboctave/util/oct-inttypes.h, liboctave/util/oct-locbuf.h, liboctave/util/oct-mem.h, liboctave/util/oct-mutex.h, liboctave/util/oct-refcount.h, liboctave/util/oct-rl-edit.h, liboctave/util/oct-rl-hist.h, liboctave/util/oct-shlib.h, liboctave/util/oct-sort.h, liboctave/util/oct-sparse.h: Use common #define syntax "octave_filename_h" in h_files.
author Rik <rik@octave.org>
date Thu, 31 Oct 2013 22:19:07 -0700
parents 175b392e91fe
children 1d2e709bbbda
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
1 /*
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
2
17744
d63878346099 maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents: 16468
diff changeset
3 Copyright (C) 1996-2013 John W. Eaton
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
4
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
6
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6999
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6999
diff changeset
10 option) any later version.
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
11
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
15 for more details.
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
16
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6999
diff changeset
18 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6999
diff changeset
19 <http://www.gnu.org/licenses/>.
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
20
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
21 */
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
22
17822
ebb3ef964372 maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents: 17787
diff changeset
23 #if !defined (octave_ov_range_h)
ebb3ef964372 maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents: 17787
diff changeset
24 #define octave_ov_range_h 1
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
25
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
26 #include <cstdlib>
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
27
8950
d865363208d6 include <iosfwd> instead of <iostream> in header files
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
28 #include <iosfwd>
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
29 #include <string>
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
30
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
31 #include "Range.h"
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
32
2889
8aa189b811d0 [project @ 1997-04-28 01:35:18 by jwe]
jwe
parents: 2847
diff changeset
33 #include "lo-mappers.h"
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
34 #include "lo-utils.h"
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
35 #include "mx-base.h"
2477
3d905d3820a4 [project @ 1996-11-07 16:46:11 by jwe]
jwe
parents: 2466
diff changeset
36 #include "oct-alloc.h"
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
37 #include "str-vec.h"
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
38
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
39 #include "error.h"
5051
cab27aa905c4 [project @ 2004-10-19 15:29:15 by jwe]
jwe
parents: 5042
diff changeset
40 #include "oct-stream.h"
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
41 #include "ov-base.h"
6127
5ea7e62233f2 [project @ 2006-11-01 05:34:45 by jwe]
jwe
parents: 5958
diff changeset
42 #include "ov-re-mat.h"
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
43 #include "ov-typeinfo.h"
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
44
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
45 class octave_value_list;
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
46
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
47 class tree_walker;
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
48
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
49 // Range values.
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
50
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
51 class
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
52 octave_range : public octave_base_value
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
53 {
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
54 public:
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
55
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
56 octave_range (void)
11584
cda4aa780d58 Another round of initialising members in the constructor initialisation list
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents: 11570
diff changeset
57 : octave_base_value (), range (), idx_cache () { }
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
58
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
59 octave_range (double base, double limit, double inc)
9350
16a5f9e1fdb3 cache idx_vector result in matrices once used for indexing
Jaroslav Hajek <highegg@gmail.com>
parents: 9146
diff changeset
60 : octave_base_value (), range (base, limit, inc), idx_cache ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
61 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
62 if (range.nelem () < 0)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
63 ::error ("invalid range");
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
64 }
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
65
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
66 octave_range (const Range& r)
9350
16a5f9e1fdb3 cache idx_vector result in matrices once used for indexing
Jaroslav Hajek <highegg@gmail.com>
parents: 9146
diff changeset
67 : octave_base_value (), range (r), idx_cache ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
68 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
69 if (range.nelem () < 0 && range.nelem () != -2)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
70 ::error ("invalid range");
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
71 }
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
72
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
73 octave_range (const octave_range& r)
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11584
diff changeset
74 : octave_base_value (), range (r.range),
9350
16a5f9e1fdb3 cache idx_vector result in matrices once used for indexing
Jaroslav Hajek <highegg@gmail.com>
parents: 9146
diff changeset
75 idx_cache (r.idx_cache ? new idx_vector (*r.idx_cache) : 0)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
76 { }
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
77
9479
d9716e3ee0dd supply optimized compiled sub2ind & ind2sub
Jaroslav Hajek <highegg@gmail.com>
parents: 9350
diff changeset
78 octave_range (const Range& r, const idx_vector& cache)
d9716e3ee0dd supply optimized compiled sub2ind & ind2sub
Jaroslav Hajek <highegg@gmail.com>
parents: 9350
diff changeset
79 : octave_base_value (), range (r), idx_cache ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
80 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
81 set_idx_cache (cache);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
82 }
9479
d9716e3ee0dd supply optimized compiled sub2ind & ind2sub
Jaroslav Hajek <highegg@gmail.com>
parents: 9350
diff changeset
83
9350
16a5f9e1fdb3 cache idx_vector result in matrices once used for indexing
Jaroslav Hajek <highegg@gmail.com>
parents: 9146
diff changeset
84 ~octave_range (void) { clear_cached_info (); }
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
85
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5731
diff changeset
86 octave_base_value *clone (void) const { return new octave_range (*this); }
6127
5ea7e62233f2 [project @ 2006-11-01 05:34:45 by jwe]
jwe
parents: 5958
diff changeset
87
5ea7e62233f2 [project @ 2006-11-01 05:34:45 by jwe]
jwe
parents: 5958
diff changeset
88 // A range is really just a special kind of real matrix object. In
5ea7e62233f2 [project @ 2006-11-01 05:34:45 by jwe]
jwe
parents: 5958
diff changeset
89 // the places where we need to call empty_clone, it makes more sense
5ea7e62233f2 [project @ 2006-11-01 05:34:45 by jwe]
jwe
parents: 5958
diff changeset
90 // to create an empty matrix (0x0) instead of an empty range (1x0).
5ea7e62233f2 [project @ 2006-11-01 05:34:45 by jwe]
jwe
parents: 5958
diff changeset
91 octave_base_value *empty_clone (void) const { return new octave_matrix (); }
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
92
8345
c777f3ce02d8 smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents: 7922
diff changeset
93 type_conv_info numeric_conversion_function (void) const;
2410
367485171742 [project @ 1996-10-15 16:50:27 by jwe]
jwe
parents: 2376
diff changeset
94
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5731
diff changeset
95 octave_base_value *try_narrowing_conversion (void);
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
96
4247
fc9a075d10fb [project @ 2002-12-30 23:05:27 by jwe]
jwe
parents: 4219
diff changeset
97 octave_value subsref (const std::string& type,
10313
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
98 const std::list<octave_value_list>& idx);
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3678
diff changeset
99
7651
443a8f5a50fd require both subsref variants to be defined in octave_value subclasses
John W. Eaton <jwe@octave.org>
parents: 7638
diff changeset
100 octave_value_list subsref (const std::string& type,
10313
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
101 const std::list<octave_value_list>& idx, int)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
102 { return subsref (type, idx); }
4271
be631c1720ea [project @ 2003-01-03 19:36:04 by jwe]
jwe
parents: 4247
diff changeset
103
5885
bd3041e30d97 [project @ 2006-07-14 20:29:35 by jwe]
jwe
parents: 5775
diff changeset
104 octave_value do_index_op (const octave_value_list& idx,
10313
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
105 bool resize_ok = false);
2436
a628e881be66 [project @ 1996-10-29 22:08:28 by jwe]
jwe
parents: 2410
diff changeset
106
10605
1834132fb50b allow non-integer ranges as indices conditionally
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
107 idx_vector index_vector (void) const;
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
108
4563
742993a501b9 [project @ 2003-10-29 06:25:12 by jwe]
jwe
parents: 4457
diff changeset
109 dim_vector dims (void) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
110 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
111 octave_idx_type n = range.nelem ();
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
112 return dim_vector (n > 0, n);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
113 }
3195
7a5a5da64756 [project @ 1998-10-28 22:54:04 by jwe]
jwe
parents: 3145
diff changeset
114
5731
c7d5a534afa5 [project @ 2006-04-03 19:33:26 by jwe]
jwe
parents: 5434
diff changeset
115 octave_value resize (const dim_vector& dv, bool fill = false) const;
c7d5a534afa5 [project @ 2006-04-03 19:33:26 by jwe]
jwe
parents: 5434
diff changeset
116
4915
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
117
4792
d2038299c683 [project @ 2004-02-20 18:44:43 by jwe]
jwe
parents: 4791
diff changeset
118 size_t byte_size (void) const { return 3 * sizeof (double); }
4791
62f2fb593455 [project @ 2004-02-20 18:02:59 by jwe]
jwe
parents: 4687
diff changeset
119
4627
212fc2115e09 [project @ 2003-11-17 03:48:03 by jwe]
jwe
parents: 4612
diff changeset
120 octave_value reshape (const dim_vector& new_dims) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
121 { return NDArray (array_value ().reshape (new_dims)); }
4627
212fc2115e09 [project @ 2003-11-17 03:48:03 by jwe]
jwe
parents: 4612
diff changeset
122
5434
c2428a4b7d56 [project @ 2005-08-30 19:29:49 by jwe]
jwe
parents: 5307
diff changeset
123 octave_value permute (const Array<int>& vec, bool inv = false) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
124 { return NDArray (array_value ().permute (vec, inv)); }
5434
c2428a4b7d56 [project @ 2005-08-30 19:29:49 by jwe]
jwe
parents: 5307
diff changeset
125
6999
9325d3f604a3 [project @ 2007-10-10 17:03:34 by jwe]
jwe
parents: 6974
diff changeset
126 octave_value squeeze (void) const { return range; }
9325d3f604a3 [project @ 2007-10-10 17:03:34 by jwe]
jwe
parents: 6974
diff changeset
127
8458
d254a21e0120 reimplement full as method of octave_base_value
Jaroslav Hajek <highegg@gmail.com>
parents: 8437
diff changeset
128 octave_value full_value (void) const { return range.matrix_value (); }
d254a21e0120 reimplement full as method of octave_base_value
Jaroslav Hajek <highegg@gmail.com>
parents: 8437
diff changeset
129
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
130 bool is_defined (void) const { return true; }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
131
2974
ebbc34ff7f66 [project @ 1997-05-15 19:36:16 by jwe]
jwe
parents: 2962
diff changeset
132 bool is_constant (void) const { return true; }
ebbc34ff7f66 [project @ 1997-05-15 19:36:16 by jwe]
jwe
parents: 2962
diff changeset
133
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
134 bool is_range (void) const { return true; }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
135
4017
0eb247b9cc9b [project @ 2002-08-03 04:07:14 by jwe]
jwe
parents: 3933
diff changeset
136 octave_value all (int dim = 0) const;
0eb247b9cc9b [project @ 2002-08-03 04:07:14 by jwe]
jwe
parents: 3933
diff changeset
137
0eb247b9cc9b [project @ 2002-08-03 04:07:14 by jwe]
jwe
parents: 3933
diff changeset
138 octave_value any (int dim = 0) const;
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
139
8366
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents: 8345
diff changeset
140 octave_value diag (octave_idx_type k = 0) const;
7620
36594d5bbe13 Move diag function into the octave_value class
David Bateman <dbateman@free.fr>
parents: 7576
diff changeset
141
14557
e8e86ae3abbc make diag (x, m, n) return a proper diagonal matrix object (bug #36099)
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
142 octave_value diag (octave_idx_type m, octave_idx_type n) const;
e8e86ae3abbc make diag (x, m, n) return a proper diagonal matrix object (bug #36099)
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
143
7463
2467639bd8c0 eliminate UNDEFINED sort mode
John W. Eaton <jwe@octave.org>
parents: 7458
diff changeset
144 octave_value sort (octave_idx_type dim = 0, sortmode mode = ASCENDING) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
145 { return range.sort (dim, mode); }
7458
1032e24f199f make sort work for ranges
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
146
1032e24f199f make sort work for ranges
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
147 octave_value sort (Array<octave_idx_type>& sidx, octave_idx_type dim = 0,
10313
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
148 sortmode mode = ASCENDING) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
149 { return range.sort (sidx, dim, mode); }
7458
1032e24f199f make sort work for ranges
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
150
8734
767ed8cc6634 rename internal issorted and issorted_rows functions to is_sorted and is_sorted_rows
John W. Eaton <jwe@octave.org>
parents: 8733
diff changeset
151 sortmode is_sorted (sortmode mode = UNSORTED) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
152 { return range.is_sorted (mode); }
8721
e9cb742df9eb imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents: 8458
diff changeset
153
8733
3ef774603887 rename all uses of sortrows_idx to sort_rows_idx
John W. Eaton <jwe@octave.org>
parents: 8721
diff changeset
154 Array<octave_idx_type> sort_rows_idx (sortmode) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
155 { return Array<octave_idx_type> (dim_vector (1, 0)); }
8721
e9cb742df9eb imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents: 8458
diff changeset
156
8734
767ed8cc6634 rename internal issorted and issorted_rows functions to is_sorted and is_sorted_rows
John W. Eaton <jwe@octave.org>
parents: 8733
diff changeset
157 sortmode is_sorted_rows (sortmode mode = UNSORTED) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
158 { return mode ? mode : ASCENDING; }
8721
e9cb742df9eb imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents: 8458
diff changeset
159
9685
e793865ede63 implement builtin_type
Jaroslav Hajek <highegg@gmail.com>
parents: 9479
diff changeset
160 builtin_type_t builtin_type (void) const { return btyp_double; }
e793865ede63 implement builtin_type
Jaroslav Hajek <highegg@gmail.com>
parents: 9479
diff changeset
161
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
162 bool is_real_type (void) const { return true; }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
163
5895
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
164 bool is_double_type (void) const { return true; }
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
165
7576
7ebdc99a0bab new isfloat function
John W. Eaton <jwe@octave.org>
parents: 7503
diff changeset
166 bool is_float_type (void) const { return true; }
7ebdc99a0bab new isfloat function
John W. Eaton <jwe@octave.org>
parents: 7503
diff changeset
167
3678
b6cc5bcfba8f [project @ 2000-06-08 15:35:24 by jwe]
jwe
parents: 3587
diff changeset
168 bool is_numeric_type (void) const { return true; }
b6cc5bcfba8f [project @ 2000-06-08 15:35:24 by jwe]
jwe
parents: 3587
diff changeset
169
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
170 bool is_true (void) const;
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
171
3145
0d640dc625c7 [project @ 1998-02-05 08:44:59 by jwe]
jwe
parents: 2974
diff changeset
172 double double_value (bool = false) const;
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
173
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
174 float float_value (bool = false) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
175
3145
0d640dc625c7 [project @ 1998-02-05 08:44:59 by jwe]
jwe
parents: 2974
diff changeset
176 double scalar_value (bool frc_str_conv = false) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
177 { return double_value (frc_str_conv); }
2916
4e7bea116f24 [project @ 1997-04-30 20:56:31 by jwe]
jwe
parents: 2901
diff changeset
178
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
179 float float_scalar_value (bool frc_str_conv = false) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
180 { return float_value (frc_str_conv); }
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
181
3145
0d640dc625c7 [project @ 1998-02-05 08:44:59 by jwe]
jwe
parents: 2974
diff changeset
182 Matrix matrix_value (bool = false) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
183 { return range.matrix_value (); }
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
184
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
185 FloatMatrix float_matrix_value (bool = false) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
186 { return range.matrix_value (); }
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
187
4668
7849788ca4bd [project @ 2003-11-26 04:28:39 by jwe]
jwe
parents: 4661
diff changeset
188 NDArray array_value (bool = false) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
189 { return range.matrix_value (); }
4668
7849788ca4bd [project @ 2003-11-26 04:28:39 by jwe]
jwe
parents: 4661
diff changeset
190
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
191 FloatNDArray float_array_value (bool = false) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
192 { return FloatMatrix (range.matrix_value ()); }
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
193
9146
a48c500e48e1 support range->string conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8971
diff changeset
194 charNDArray char_array_value (bool = false) const;
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11584
diff changeset
195
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
196 // FIXME: it would be better to have Range::intXNDArray_value
6934
37676450044a [project @ 2007-09-28 15:41:01 by jwe]
jwe
parents: 6932
diff changeset
197 // functions to avoid the intermediate conversion to a matrix
37676450044a [project @ 2007-09-28 15:41:01 by jwe]
jwe
parents: 6932
diff changeset
198 // object.
37676450044a [project @ 2007-09-28 15:41:01 by jwe]
jwe
parents: 6932
diff changeset
199
6932
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
200 int8NDArray
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
201 int8_array_value (void) const { return int8NDArray (array_value ()); }
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
202
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
203 int16NDArray
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
204 int16_array_value (void) const { return int16NDArray (array_value ()); }
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
205
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
206 int32NDArray
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
207 int32_array_value (void) const { return int32NDArray (array_value ()); }
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
208
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
209 int64NDArray
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
210 int64_array_value (void) const { return int64NDArray (array_value ()); }
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
211
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
212 uint8NDArray
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
213 uint8_array_value (void) const { return uint8NDArray (array_value ()); }
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
214
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
215 uint16NDArray
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
216 uint16_array_value (void) const { return uint16NDArray (array_value ()); }
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
217
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
218 uint32NDArray
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
219 uint32_array_value (void) const { return uint32NDArray (array_value ()); }
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
220
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
221 uint64NDArray
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
222 uint64_array_value (void) const { return uint64NDArray (array_value ()); }
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
223
6928
20dac48f4d8d [project @ 2007-09-26 21:55:05 by dbateman]
dbateman
parents: 6127
diff changeset
224 SparseMatrix sparse_matrix_value (bool = false) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
225 { return SparseMatrix (range.matrix_value ()); }
6928
20dac48f4d8d [project @ 2007-09-26 21:55:05 by dbateman]
dbateman
parents: 6127
diff changeset
226
20dac48f4d8d [project @ 2007-09-26 21:55:05 by dbateman]
dbateman
parents: 6127
diff changeset
227 SparseComplexMatrix sparse_complex_matrix_value (bool = false) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
228 { return SparseComplexMatrix (sparse_matrix_value ()); }
6928
20dac48f4d8d [project @ 2007-09-26 21:55:05 by dbateman]
dbateman
parents: 6127
diff changeset
229
3145
0d640dc625c7 [project @ 1998-02-05 08:44:59 by jwe]
jwe
parents: 2974
diff changeset
230 Complex complex_value (bool = false) const;
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
231
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
232 FloatComplex float_complex_value (bool = false) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
233
10613
e103fb2182ce use internal variable instead of warning state to control whether to allow non-integer ranges as indices
John W. Eaton <jwe@octave.org>
parents: 10605
diff changeset
234 boolNDArray bool_array_value (bool warn = false) const;
5898
da843f35775c [project @ 2006-07-19 18:18:08 by jwe]
jwe
parents: 5895
diff changeset
235
3145
0d640dc625c7 [project @ 1998-02-05 08:44:59 by jwe]
jwe
parents: 2974
diff changeset
236 ComplexMatrix complex_matrix_value (bool = false) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
237 { return ComplexMatrix (range.matrix_value ()); }
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
238
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
239 FloatComplexMatrix float_complex_matrix_value (bool = false) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
240 { return FloatComplexMatrix (range.matrix_value ()); }
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
241
4668
7849788ca4bd [project @ 2003-11-26 04:28:39 by jwe]
jwe
parents: 4661
diff changeset
242 ComplexNDArray complex_array_value (bool = false) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
243 { return ComplexMatrix (range.matrix_value ()); }
4668
7849788ca4bd [project @ 2003-11-26 04:28:39 by jwe]
jwe
parents: 4661
diff changeset
244
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
245 FloatComplexNDArray float_complex_array_value (bool = false) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
246 { return FloatComplexMatrix (range.matrix_value ()); }
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
247
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
248 Range range_value (void) const { return range; }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
249
5279
bd32f770c09a [project @ 2005-04-12 21:55:31 by jwe]
jwe
parents: 5275
diff changeset
250 octave_value convert_to_str_internal (bool pad, bool force, char type) const;
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2436
diff changeset
251
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
252 void print (std::ostream& os, bool pr_as_read_syntax = false) const;
2901
e6d25bc478dd [project @ 1997-04-30 03:41:26 by jwe]
jwe
parents: 2889
diff changeset
253
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
254 void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const;
2901
e6d25bc478dd [project @ 1997-04-30 03:41:26 by jwe]
jwe
parents: 2889
diff changeset
255
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
256 bool print_name_tag (std::ostream& os, const std::string& name) const;
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
257
16468
0f143f68078d use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
258 std::string short_disp (void) const;
0f143f68078d use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
259
6974
9e32bb109980 [project @ 2007-10-08 11:06:47 by jwe]
jwe
parents: 6934
diff changeset
260 bool save_ascii (std::ostream& os);
4687
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4668
diff changeset
261
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4668
diff changeset
262 bool load_ascii (std::istream& is);
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4668
diff changeset
263
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4668
diff changeset
264 bool save_binary (std::ostream& os, bool& save_as_floats);
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4668
diff changeset
265
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11584
diff changeset
266 bool load_binary (std::istream& is, bool swap,
10313
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
267 oct_mach_info::float_format fmt);
4687
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4668
diff changeset
268
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4668
diff changeset
269 #if defined (HAVE_HDF5)
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4668
diff changeset
270 bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats);
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4668
diff changeset
271
9881
b3089dba88bf Remove HDF5 cruft for older versions of HDF5
Kacper Kowalik
parents: 9812
diff changeset
272 bool load_hdf5 (hid_t loc_id, const char *name);
4687
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4668
diff changeset
273 #endif
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4668
diff changeset
274
5051
cab27aa905c4 [project @ 2004-10-19 15:29:15 by jwe]
jwe
parents: 5042
diff changeset
275 int write (octave_stream& os, int block_size,
10313
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
276 oct_data_conv::data_type output_type, int skip,
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
277 oct_mach_info::float_format flt_fmt) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
278 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
279 // FIXME: could be more memory efficient by having a
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
280 // special case of the octave_stream::write method for ranges.
5051
cab27aa905c4 [project @ 2004-10-19 15:29:15 by jwe]
jwe
parents: 5042
diff changeset
281
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
282 return os.write (matrix_value (), block_size, output_type, skip, flt_fmt);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
283 }
5051
cab27aa905c4 [project @ 2004-10-19 15:29:15 by jwe]
jwe
parents: 5042
diff changeset
284
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5898
diff changeset
285 mxArray *as_mxArray (void) const;
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5898
diff changeset
286
9812
f80c566bc751 improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents: 9685
diff changeset
287 octave_value map (unary_mapper_t umap) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
288 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
289 octave_matrix m (matrix_value ());
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
290 return m.map (umap);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
291 }
7503
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
292
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
293 private:
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
294
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
295 Range range;
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
296
9350
16a5f9e1fdb3 cache idx_vector result in matrices once used for indexing
Jaroslav Hajek <highegg@gmail.com>
parents: 9146
diff changeset
297 idx_vector set_idx_cache (const idx_vector& idx) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
298 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
299 delete idx_cache;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
300 idx_cache = idx ? new idx_vector (idx) : 0;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
301 return idx;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
302 }
9350
16a5f9e1fdb3 cache idx_vector result in matrices once used for indexing
Jaroslav Hajek <highegg@gmail.com>
parents: 9146
diff changeset
303
16a5f9e1fdb3 cache idx_vector result in matrices once used for indexing
Jaroslav Hajek <highegg@gmail.com>
parents: 9146
diff changeset
304 void clear_cached_info (void) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
305 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
306 delete idx_cache; idx_cache = 0;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
307 }
9350
16a5f9e1fdb3 cache idx_vector result in matrices once used for indexing
Jaroslav Hajek <highegg@gmail.com>
parents: 9146
diff changeset
308
16a5f9e1fdb3 cache idx_vector result in matrices once used for indexing
Jaroslav Hajek <highegg@gmail.com>
parents: 9146
diff changeset
309 mutable idx_vector *idx_cache;
16a5f9e1fdb3 cache idx_vector result in matrices once used for indexing
Jaroslav Hajek <highegg@gmail.com>
parents: 9146
diff changeset
310
12153
e0e50f48df37 Explicitly disallow copying in some classes
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents: 11586
diff changeset
311 // No assignment.
e0e50f48df37 Explicitly disallow copying in some classes
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents: 11586
diff changeset
312
e0e50f48df37 Explicitly disallow copying in some classes
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents: 11586
diff changeset
313 octave_range& operator = (const octave_range&);
e0e50f48df37 Explicitly disallow copying in some classes
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents: 11586
diff changeset
314
4612
d44675070f1a [project @ 2003-11-14 19:49:56 by jwe]
jwe
parents: 4563
diff changeset
315 DECLARE_OCTAVE_ALLOCATOR
2477
3d905d3820a4 [project @ 1996-11-07 16:46:11 by jwe]
jwe
parents: 2466
diff changeset
316
4612
d44675070f1a [project @ 2003-11-14 19:49:56 by jwe]
jwe
parents: 4563
diff changeset
317 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
318 };
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
319
10613
e103fb2182ce use internal variable instead of warning state to control whether to allow non-integer ranges as indices
John W. Eaton <jwe@octave.org>
parents: 10605
diff changeset
320 // If TRUE, allow ranges with non-integer elements as array indices.
e103fb2182ce use internal variable instead of warning state to control whether to allow non-integer ranges as indices
John W. Eaton <jwe@octave.org>
parents: 10605
diff changeset
321 extern bool Vallow_noninteger_range_as_index;
e103fb2182ce use internal variable instead of warning state to control whether to allow non-integer ranges as indices
John W. Eaton <jwe@octave.org>
parents: 10605
diff changeset
322
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
323 #endif