annotate src/ov-range.h @ 7961:a5d1e27ee1f4 ss-3-1-51

3.1.51 snapshot
author John W. Eaton <jwe@octave.org>
date Tue, 22 Jul 2008 11:40:48 -0400
parents 935be827eaf8
children c777f3ce02d8
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
7017
a1dbe9d80eee [project @ 2007-10-12 21:27:11 by jwe]
jwe
parents: 7016
diff changeset
3 Copyright (C) 1996, 1997, 1998, 2000, 2002, 2003, 2004, 2005, 2006,
a1dbe9d80eee [project @ 2007-10-12 21:27:11 by jwe]
jwe
parents: 7016
diff changeset
4 2007 John W. Eaton
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
5
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
6 This file is part of Octave.
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
7
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
8 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
9 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
10 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
11 option) any later version.
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
12
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
13 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
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
15 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
16 for more details.
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
17
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
18 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
19 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
20 <http://www.gnu.org/licenses/>.
2376
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 */
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
23
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
24 #if !defined (octave_range_h)
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
25 #define octave_range_h 1
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
26
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
27 #include <cstdlib>
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
28
3503
d14c483b3c12 [project @ 2000-02-01 04:06:07 by jwe]
jwe
parents: 3219
diff changeset
29 #include <iostream>
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
30 #include <string>
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
31
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
32 #include "Range.h"
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
33
2889
8aa189b811d0 [project @ 1997-04-28 01:35:18 by jwe]
jwe
parents: 2847
diff changeset
34 #include "lo-mappers.h"
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
35 #include "lo-utils.h"
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
36 #include "mx-base.h"
2477
3d905d3820a4 [project @ 1996-11-07 16:46:11 by jwe]
jwe
parents: 2466
diff changeset
37 #include "oct-alloc.h"
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
38 #include "str-vec.h"
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
39
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
40 #include "error.h"
5051
cab27aa905c4 [project @ 2004-10-19 15:29:15 by jwe]
jwe
parents: 5042
diff changeset
41 #include "oct-stream.h"
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
42 #include "ov-base.h"
6127
5ea7e62233f2 [project @ 2006-11-01 05:34:45 by jwe]
jwe
parents: 5958
diff changeset
43 #include "ov-re-mat.h"
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
44 #include "ov-typeinfo.h"
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
45
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
46 class Octave_map;
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
47 class octave_value_list;
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 class tree_walker;
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 // Range values.
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
52
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
53 class
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
54 octave_range : public octave_base_value
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 public:
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
57
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
58 octave_range (void)
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
59 : octave_base_value () { }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
60
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
61 octave_range (double base, double limit, double inc)
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
62 : octave_base_value (), range (base, limit, inc)
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
63 {
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
64 if (range.nelem () < 0)
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
65 ::error ("invalid range");
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
66 }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
67
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
68 octave_range (const Range& r)
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
69 : octave_base_value (), range (r)
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
70 {
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
71 if (range.nelem () < 0)
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
72 ::error ("invalid range");
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
73 }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
74
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
75 octave_range (const octave_range& r)
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
76 : octave_base_value (), range (r.range) { }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
77
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
78 ~octave_range (void) { }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
79
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5731
diff changeset
80 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
81
5ea7e62233f2 [project @ 2006-11-01 05:34:45 by jwe]
jwe
parents: 5958
diff changeset
82 // 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
83 // 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
84 // 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
85 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
86
2410
367485171742 [project @ 1996-10-15 16:50:27 by jwe]
jwe
parents: 2376
diff changeset
87 type_conv_fcn numeric_conversion_function (void) const;
367485171742 [project @ 1996-10-15 16:50:27 by jwe]
jwe
parents: 2376
diff changeset
88
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5731
diff changeset
89 octave_base_value *try_narrowing_conversion (void);
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
90
4247
fc9a075d10fb [project @ 2002-12-30 23:05:27 by jwe]
jwe
parents: 4219
diff changeset
91 octave_value subsref (const std::string& type,
4219
23d06c9e1edd [project @ 2002-12-06 21:29:17 by jwe]
jwe
parents: 4192
diff changeset
92 const std::list<octave_value_list>& idx);
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3678
diff changeset
93
7651
443a8f5a50fd require both subsref variants to be defined in octave_value subclasses
John W. Eaton <jwe@octave.org>
parents: 7638
diff changeset
94 octave_value_list subsref (const std::string& type,
443a8f5a50fd require both subsref variants to be defined in octave_value subclasses
John W. Eaton <jwe@octave.org>
parents: 7638
diff changeset
95 const std::list<octave_value_list>& idx, int)
443a8f5a50fd require both subsref variants to be defined in octave_value subclasses
John W. Eaton <jwe@octave.org>
parents: 7638
diff changeset
96 { return subsref (type, idx); }
4271
be631c1720ea [project @ 2003-01-03 19:36:04 by jwe]
jwe
parents: 4247
diff changeset
97
5885
bd3041e30d97 [project @ 2006-07-14 20:29:35 by jwe]
jwe
parents: 5775
diff changeset
98 octave_value do_index_op (const octave_value_list& idx,
bd3041e30d97 [project @ 2006-07-14 20:29:35 by jwe]
jwe
parents: 5775
diff changeset
99 bool resize_ok = false);
2436
a628e881be66 [project @ 1996-10-29 22:08:28 by jwe]
jwe
parents: 2410
diff changeset
100
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
101 idx_vector index_vector (void) const { return idx_vector (range); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
102
4563
742993a501b9 [project @ 2003-10-29 06:25:12 by jwe]
jwe
parents: 4457
diff changeset
103 dim_vector dims (void) const
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
104 {
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
105 octave_idx_type n = range.nelem ();
4563
742993a501b9 [project @ 2003-10-29 06:25:12 by jwe]
jwe
parents: 4457
diff changeset
106 return dim_vector (n > 0, n);
742993a501b9 [project @ 2003-10-29 06:25:12 by jwe]
jwe
parents: 4457
diff changeset
107 }
3195
7a5a5da64756 [project @ 1998-10-28 22:54:04 by jwe]
jwe
parents: 3145
diff changeset
108
5731
c7d5a534afa5 [project @ 2006-04-03 19:33:26 by jwe]
jwe
parents: 5434
diff changeset
109 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
110
4915
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
111
4792
d2038299c683 [project @ 2004-02-20 18:44:43 by jwe]
jwe
parents: 4791
diff changeset
112 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
113
4627
212fc2115e09 [project @ 2003-11-17 03:48:03 by jwe]
jwe
parents: 4612
diff changeset
114 octave_value reshape (const dim_vector& new_dims) const
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4792
diff changeset
115 { return NDArray (array_value().reshape (new_dims)); }
4627
212fc2115e09 [project @ 2003-11-17 03:48:03 by jwe]
jwe
parents: 4612
diff changeset
116
5434
c2428a4b7d56 [project @ 2005-08-30 19:29:49 by jwe]
jwe
parents: 5307
diff changeset
117 octave_value permute (const Array<int>& vec, bool inv = false) const
c2428a4b7d56 [project @ 2005-08-30 19:29:49 by jwe]
jwe
parents: 5307
diff changeset
118 { return NDArray (array_value().permute (vec, inv)); }
c2428a4b7d56 [project @ 2005-08-30 19:29:49 by jwe]
jwe
parents: 5307
diff changeset
119
6999
9325d3f604a3 [project @ 2007-10-10 17:03:34 by jwe]
jwe
parents: 6974
diff changeset
120 octave_value squeeze (void) const { return range; }
9325d3f604a3 [project @ 2007-10-10 17:03:34 by jwe]
jwe
parents: 6974
diff changeset
121
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
122 bool is_defined (void) const { return true; }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
123
2974
ebbc34ff7f66 [project @ 1997-05-15 19:36:16 by jwe]
jwe
parents: 2962
diff changeset
124 bool is_constant (void) const { return true; }
ebbc34ff7f66 [project @ 1997-05-15 19:36:16 by jwe]
jwe
parents: 2962
diff changeset
125
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
126 bool is_range (void) const { return true; }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
127
4017
0eb247b9cc9b [project @ 2002-08-03 04:07:14 by jwe]
jwe
parents: 3933
diff changeset
128 octave_value all (int dim = 0) const;
0eb247b9cc9b [project @ 2002-08-03 04:07:14 by jwe]
jwe
parents: 3933
diff changeset
129
0eb247b9cc9b [project @ 2002-08-03 04:07:14 by jwe]
jwe
parents: 3933
diff changeset
130 octave_value any (int dim = 0) const;
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
131
7620
36594d5bbe13 Move diag function into the octave_value class
David Bateman <dbateman@free.fr>
parents: 7576
diff changeset
132 octave_value diag (octave_idx_type k = 0) const
36594d5bbe13 Move diag function into the octave_value class
David Bateman <dbateman@free.fr>
parents: 7576
diff changeset
133 { return octave_value (range.diag (k)); }
36594d5bbe13 Move diag function into the octave_value class
David Bateman <dbateman@free.fr>
parents: 7576
diff changeset
134
7463
2467639bd8c0 eliminate UNDEFINED sort mode
John W. Eaton <jwe@octave.org>
parents: 7458
diff changeset
135 octave_value sort (octave_idx_type dim = 0, sortmode mode = ASCENDING) const
7458
1032e24f199f make sort work for ranges
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
136 { return range.sort (dim, mode); }
1032e24f199f make sort work for ranges
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
137
1032e24f199f make sort work for ranges
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
138 octave_value sort (Array<octave_idx_type>& sidx, octave_idx_type dim = 0,
7463
2467639bd8c0 eliminate UNDEFINED sort mode
John W. Eaton <jwe@octave.org>
parents: 7458
diff changeset
139 sortmode mode = ASCENDING) const
7458
1032e24f199f make sort work for ranges
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
140 { return range.sort (sidx, dim, mode); }
1032e24f199f make sort work for ranges
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
141
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
142 bool is_real_type (void) const { return true; }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
143
5895
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
144 bool is_double_type (void) const { return true; }
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
145
7576
7ebdc99a0bab new isfloat function
John W. Eaton <jwe@octave.org>
parents: 7503
diff changeset
146 bool is_float_type (void) const { return true; }
7ebdc99a0bab new isfloat function
John W. Eaton <jwe@octave.org>
parents: 7503
diff changeset
147
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
148 bool valid_as_scalar_index (void) const
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
149 {
5042
3914c4ad3ffa [project @ 2004-10-01 19:59:40 by jwe]
jwe
parents: 4915
diff changeset
150 double b = range.base ();
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
151 return (range.nelem () == 1
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
152 && ! xisnan (b) && D_NINT (b) == b && NINTbig (b) == 1);
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
153 }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
154
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
155 bool valid_as_zero_index (void) const
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
156 {
5042
3914c4ad3ffa [project @ 2004-10-01 19:59:40 by jwe]
jwe
parents: 4915
diff changeset
157 double b = range.base ();
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
158 return (range.nelem () == 1
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
159 && ! xisnan (b) && D_NINT (b) == b && NINTbig (b) == 0);
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
160 }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
161
3678
b6cc5bcfba8f [project @ 2000-06-08 15:35:24 by jwe]
jwe
parents: 3587
diff changeset
162 bool is_numeric_type (void) const { return true; }
b6cc5bcfba8f [project @ 2000-06-08 15:35:24 by jwe]
jwe
parents: 3587
diff changeset
163
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
164 bool is_true (void) const;
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
165
3145
0d640dc625c7 [project @ 1998-02-05 08:44:59 by jwe]
jwe
parents: 2974
diff changeset
166 double double_value (bool = false) const;
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
167
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
168 float float_value (bool = false) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
169
3145
0d640dc625c7 [project @ 1998-02-05 08:44:59 by jwe]
jwe
parents: 2974
diff changeset
170 double scalar_value (bool frc_str_conv = false) const
0d640dc625c7 [project @ 1998-02-05 08:44:59 by jwe]
jwe
parents: 2974
diff changeset
171 { return double_value (frc_str_conv); }
2916
4e7bea116f24 [project @ 1997-04-30 20:56:31 by jwe]
jwe
parents: 2901
diff changeset
172
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
173 float float_scalar_value (bool frc_str_conv = false) const
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
174 { return float_value (frc_str_conv); }
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 Matrix matrix_value (bool = false) const
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
177 { return range.matrix_value (); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
178
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
179 FloatMatrix float_matrix_value (bool = false) const
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
180 { return range.matrix_value (); }
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
181
4668
7849788ca4bd [project @ 2003-11-26 04:28:39 by jwe]
jwe
parents: 4661
diff changeset
182 NDArray array_value (bool = false) const
7849788ca4bd [project @ 2003-11-26 04:28:39 by jwe]
jwe
parents: 4661
diff changeset
183 { return range.matrix_value (); }
7849788ca4bd [project @ 2003-11-26 04:28:39 by jwe]
jwe
parents: 4661
diff changeset
184
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
185 FloatNDArray float_array_value (bool = false) const
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
186 { return FloatMatrix (range.matrix_value ()); }
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
187
6934
37676450044a [project @ 2007-09-28 15:41:01 by jwe]
jwe
parents: 6932
diff changeset
188 // FIXME -- it would be better to have Range::intXNDArray_value
37676450044a [project @ 2007-09-28 15:41:01 by jwe]
jwe
parents: 6932
diff changeset
189 // functions to avoid the intermediate conversion to a matrix
37676450044a [project @ 2007-09-28 15:41:01 by jwe]
jwe
parents: 6932
diff changeset
190 // object.
37676450044a [project @ 2007-09-28 15:41:01 by jwe]
jwe
parents: 6932
diff changeset
191
6932
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
192 int8NDArray
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
193 int8_array_value (void) const { return int8NDArray (array_value ()); }
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
194
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
195 int16NDArray
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
196 int16_array_value (void) const { return int16NDArray (array_value ()); }
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
197
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
198 int32NDArray
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
199 int32_array_value (void) const { return int32NDArray (array_value ()); }
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
200
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
201 int64NDArray
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
202 int64_array_value (void) const { return int64NDArray (array_value ()); }
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
203
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
204 uint8NDArray
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
205 uint8_array_value (void) const { return uint8NDArray (array_value ()); }
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
206
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
207 uint16NDArray
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
208 uint16_array_value (void) const { return uint16NDArray (array_value ()); }
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
209
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
210 uint32NDArray
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
211 uint32_array_value (void) const { return uint32NDArray (array_value ()); }
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
212
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
213 uint64NDArray
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
214 uint64_array_value (void) const { return uint64NDArray (array_value ()); }
8065a1bc0358 [project @ 2007-09-28 10:40:08 by dbateman]
dbateman
parents: 6928
diff changeset
215
6928
20dac48f4d8d [project @ 2007-09-26 21:55:05 by dbateman]
dbateman
parents: 6127
diff changeset
216 SparseMatrix sparse_matrix_value (bool = false) const
20dac48f4d8d [project @ 2007-09-26 21:55:05 by dbateman]
dbateman
parents: 6127
diff changeset
217 { return SparseMatrix (range.matrix_value ()); }
20dac48f4d8d [project @ 2007-09-26 21:55:05 by dbateman]
dbateman
parents: 6127
diff changeset
218
20dac48f4d8d [project @ 2007-09-26 21:55:05 by dbateman]
dbateman
parents: 6127
diff changeset
219 SparseComplexMatrix sparse_complex_matrix_value (bool = false) const
20dac48f4d8d [project @ 2007-09-26 21:55:05 by dbateman]
dbateman
parents: 6127
diff changeset
220 { return SparseComplexMatrix (sparse_matrix_value ()); }
20dac48f4d8d [project @ 2007-09-26 21:55:05 by dbateman]
dbateman
parents: 6127
diff changeset
221
3145
0d640dc625c7 [project @ 1998-02-05 08:44:59 by jwe]
jwe
parents: 2974
diff changeset
222 Complex complex_value (bool = false) const;
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
223
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
224 FloatComplex float_complex_value (bool = false) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
225
5943
c038c2947ee1 [project @ 2006-08-18 21:27:03 by jwe]
jwe
parents: 5900
diff changeset
226 boolNDArray bool_array_value (bool warn = false) const
c038c2947ee1 [project @ 2006-08-18 21:27:03 by jwe]
jwe
parents: 5900
diff changeset
227 {
c038c2947ee1 [project @ 2006-08-18 21:27:03 by jwe]
jwe
parents: 5900
diff changeset
228 Matrix m = range.matrix_value ();
c038c2947ee1 [project @ 2006-08-18 21:27:03 by jwe]
jwe
parents: 5900
diff changeset
229
7922
935be827eaf8 error for NaN values in & and | expressions
John W. Eaton <jwe@octave.org>
parents: 7789
diff changeset
230 if (m.any_element_is_nan ())
935be827eaf8 error for NaN values in & and | expressions
John W. Eaton <jwe@octave.org>
parents: 7789
diff changeset
231 error ("invalid conversion from NaN to logical");
935be827eaf8 error for NaN values in & and | expressions
John W. Eaton <jwe@octave.org>
parents: 7789
diff changeset
232 else if (warn && m.any_element_not_one_or_zero ())
5943
c038c2947ee1 [project @ 2006-08-18 21:27:03 by jwe]
jwe
parents: 5900
diff changeset
233 gripe_logical_conversion ();
c038c2947ee1 [project @ 2006-08-18 21:27:03 by jwe]
jwe
parents: 5900
diff changeset
234
c038c2947ee1 [project @ 2006-08-18 21:27:03 by jwe]
jwe
parents: 5900
diff changeset
235 return boolNDArray (m);
c038c2947ee1 [project @ 2006-08-18 21:27:03 by jwe]
jwe
parents: 5900
diff changeset
236 }
5898
da843f35775c [project @ 2006-07-19 18:18:08 by jwe]
jwe
parents: 5895
diff changeset
237
3145
0d640dc625c7 [project @ 1998-02-05 08:44:59 by jwe]
jwe
parents: 2974
diff changeset
238 ComplexMatrix complex_matrix_value (bool = false) const
3587
b11f9c33558f [project @ 2000-02-08 05:54:21 by jwe]
jwe
parents: 3523
diff changeset
239 { return ComplexMatrix (range.matrix_value ()); }
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
240
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
241 FloatComplexMatrix float_complex_matrix_value (bool = false) const
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
242 { return FloatComplexMatrix (range.matrix_value ()); }
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
243
4668
7849788ca4bd [project @ 2003-11-26 04:28:39 by jwe]
jwe
parents: 4661
diff changeset
244 ComplexNDArray complex_array_value (bool = false) const
7849788ca4bd [project @ 2003-11-26 04:28:39 by jwe]
jwe
parents: 4661
diff changeset
245 { return ComplexMatrix (range.matrix_value ()); }
7849788ca4bd [project @ 2003-11-26 04:28:39 by jwe]
jwe
parents: 4661
diff changeset
246
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
247 FloatComplexNDArray float_complex_array_value (bool = false) const
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
248 { return FloatComplexMatrix (range.matrix_value ()); }
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7740
diff changeset
249
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
250 Range range_value (void) const { return range; }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
251
5279
bd32f770c09a [project @ 2005-04-12 21:55:31 by jwe]
jwe
parents: 5275
diff changeset
252 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
253
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
254 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
255
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
256 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
257
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
258 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
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
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4668
diff changeset
266 bool load_binary (std::istream& is, bool swap,
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4668
diff changeset
267 oct_mach_info::float_format fmt);
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
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4668
diff changeset
272 bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug);
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,
cab27aa905c4 [project @ 2004-10-19 15:29:15 by jwe]
jwe
parents: 5042
diff changeset
276 oct_data_conv::data_type output_type, int skip,
cab27aa905c4 [project @ 2004-10-19 15:29:15 by jwe]
jwe
parents: 5042
diff changeset
277 oct_mach_info::float_format flt_fmt) const
cab27aa905c4 [project @ 2004-10-19 15:29:15 by jwe]
jwe
parents: 5042
diff changeset
278 {
5775
ace8d8d26933 [project @ 2006-04-24 19:13:06 by jwe]
jwe
parents: 5759
diff changeset
279 // FIXME -- could be more memory efficient by having a
5051
cab27aa905c4 [project @ 2004-10-19 15:29:15 by jwe]
jwe
parents: 5042
diff changeset
280 // special case of the octave_stream::write method for ranges.
cab27aa905c4 [project @ 2004-10-19 15:29:15 by jwe]
jwe
parents: 5042
diff changeset
281
cab27aa905c4 [project @ 2004-10-19 15:29:15 by jwe]
jwe
parents: 5042
diff changeset
282 return os.write (matrix_value (), block_size, output_type, skip,
cab27aa905c4 [project @ 2004-10-19 15:29:15 by jwe]
jwe
parents: 5042
diff changeset
283 flt_fmt);
cab27aa905c4 [project @ 2004-10-19 15:29:15 by jwe]
jwe
parents: 5042
diff changeset
284 }
cab27aa905c4 [project @ 2004-10-19 15:29:15 by jwe]
jwe
parents: 5042
diff changeset
285
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5898
diff changeset
286 mxArray *as_mxArray (void) const;
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5898
diff changeset
287
7503
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
288 // Mapper functions are converted to double for treatment
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
289 #define RANGE_MAPPER(MAP) \
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
290 octave_value MAP (void) const \
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
291 { \
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
292 octave_matrix m (array_value ()); \
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
293 return m.MAP (); \
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
294 }
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
295
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
296 RANGE_MAPPER (abs)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
297 RANGE_MAPPER (acos)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
298 RANGE_MAPPER (acosh)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
299 RANGE_MAPPER (angle)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
300 RANGE_MAPPER (arg)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
301 RANGE_MAPPER (asin)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
302 RANGE_MAPPER (asinh)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
303 RANGE_MAPPER (atan)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
304 RANGE_MAPPER (atanh)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
305 RANGE_MAPPER (ceil)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
306 RANGE_MAPPER (conj)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
307 RANGE_MAPPER (cos)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
308 RANGE_MAPPER (cosh)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
309 RANGE_MAPPER (erf)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
310 RANGE_MAPPER (erfc)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
311 RANGE_MAPPER (exp)
7638
2df457529cfa implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents: 7636
diff changeset
312 RANGE_MAPPER (expm1)
7503
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
313 RANGE_MAPPER (finite)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
314 RANGE_MAPPER (fix)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
315 RANGE_MAPPER (floor)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
316 RANGE_MAPPER (gamma)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
317 RANGE_MAPPER (imag)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
318 RANGE_MAPPER (isinf)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
319 RANGE_MAPPER (isna)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
320 RANGE_MAPPER (isnan)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
321 RANGE_MAPPER (lgamma)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
322 RANGE_MAPPER (log)
7740
39930366b709 implement builtin log2
Jaroslav Hajek <highegg@gmail.com>
parents: 7651
diff changeset
323 RANGE_MAPPER (log2)
7503
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
324 RANGE_MAPPER (log10)
7638
2df457529cfa implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents: 7636
diff changeset
325 RANGE_MAPPER (log1p)
7503
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
326 RANGE_MAPPER (real)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
327 RANGE_MAPPER (round)
7636
99c410f7f0b0 implement mapper function for banker's rounding
Jaroslav Hajek <highegg@gmail.com>
parents: 7620
diff changeset
328 RANGE_MAPPER (roundb)
7503
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
329 RANGE_MAPPER (signum)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
330 RANGE_MAPPER (sin)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
331 RANGE_MAPPER (sinh)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
332 RANGE_MAPPER (sqrt)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
333 RANGE_MAPPER (tan)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
334 RANGE_MAPPER (tanh)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7463
diff changeset
335
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
336 private:
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
337
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
338 Range range;
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
339
4612
d44675070f1a [project @ 2003-11-14 19:49:56 by jwe]
jwe
parents: 4563
diff changeset
340 DECLARE_OCTAVE_ALLOCATOR
2477
3d905d3820a4 [project @ 1996-11-07 16:46:11 by jwe]
jwe
parents: 2466
diff changeset
341
4612
d44675070f1a [project @ 2003-11-14 19:49:56 by jwe]
jwe
parents: 4563
diff changeset
342 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
343 };
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
344
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
345 #endif
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
346
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
347 /*
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
348 ;;; Local Variables: ***
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
349 ;;; mode: C++ ***
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
350 ;;; End: ***
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
351 */