annotate libinterp/operators/op-double-conv.cc @ 20595:c1a6c31ac29a

eliminate more simple uses of error_state * ov-classdef.cc: Eliminate simple uses of error_state.
author John W. Eaton <jwe@octave.org>
date Tue, 06 Oct 2015 00:20:02 -0400
parents 4197fc428c7d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
1 /*
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
2
19731
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 17787
diff changeset
3 Copyright (C) 2004-2015 John W. Eaton
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
4
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
6
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
35bfb4e0b96b [project @ 2004-06-14 18:33:02 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: 5992
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: 5992
diff changeset
10 option) any later version.
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
11
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
15 for more details.
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
16
35bfb4e0b96b [project @ 2004-06-14 18:33:02 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: 5992
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: 5992
diff changeset
19 <http://www.gnu.org/licenses/>.
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
20
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
21 */
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
22
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
23 #ifdef HAVE_CONFIG_H
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
24 #include <config.h>
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
25 #endif
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
26
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
27 #include "gripes.h"
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
28 #include "oct-obj.h"
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
29 #include "ov.h"
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
30 #include "ov-int8.h"
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
31 #include "ov-int16.h"
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
32 #include "ov-int32.h"
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
33 #include "ov-int64.h"
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
34 #include "ov-uint8.h"
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
35 #include "ov-uint16.h"
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
36 #include "ov-uint32.h"
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
37 #include "ov-uint64.h"
5002
d894b803ccb5 [project @ 2004-09-16 01:11:39 by jwe]
jwe
parents: 4901
diff changeset
38 #include "ov-bool.h"
d894b803ccb5 [project @ 2004-09-16 01:11:39 by jwe]
jwe
parents: 4901
diff changeset
39 #include "ov-bool-mat.h"
5164
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents: 5032
diff changeset
40 #include "ov-re-sparse.h"
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents: 5032
diff changeset
41 #include "ov-bool-sparse.h"
5032
3361e0846469 [project @ 2004-09-24 03:56:41 by jwe]
jwe
parents: 5002
diff changeset
42 #include "ov-range.h"
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
43 #include "ov-scalar.h"
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
44 #include "ov-re-mat.h"
5032
3361e0846469 [project @ 2004-09-24 03:56:41 by jwe]
jwe
parents: 5002
diff changeset
45 #include "ov-str-mat.h"
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
46 #include "ov-typeinfo.h"
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
47 #include "ops.h"
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
48
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
49 // conversion ops
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
50
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
51 DEFDBLCONVFN (int8_matrix_to_double_matrix, int8_matrix, int8_array)
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
52 DEFDBLCONVFN (int16_matrix_to_double_matrix, int16_matrix, int16_array)
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
53 DEFDBLCONVFN (int32_matrix_to_double_matrix, int32_matrix, int32_array)
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
54 DEFDBLCONVFN (int64_matrix_to_double_matrix, int64_matrix, int64_array)
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
55
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
56 DEFDBLCONVFN (uint8_matrix_to_double_matrix, uint8_matrix, uint8_array)
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
57 DEFDBLCONVFN (uint16_matrix_to_double_matrix, uint16_matrix, uint16_array)
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
58 DEFDBLCONVFN (uint32_matrix_to_double_matrix, uint32_matrix, uint32_array)
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
59 DEFDBLCONVFN (uint64_matrix_to_double_matrix, uint64_matrix, uint64_array)
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
60
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
61 DEFDBLCONVFN (int8_scalar_to_double_matrix, int8_scalar, int8_array)
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
62 DEFDBLCONVFN (int16_scalar_to_double_matrix, int16_scalar, int16_array)
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
63 DEFDBLCONVFN (int32_scalar_to_double_matrix, int32_scalar, int32_array)
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
64 DEFDBLCONVFN (int64_scalar_to_double_matrix, int64_scalar, int64_array)
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
65
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
66 DEFDBLCONVFN (uint8_scalar_to_double_matrix, uint8_scalar, uint8_array)
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
67 DEFDBLCONVFN (uint16_scalar_to_double_matrix, uint16_scalar, uint16_array)
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
68 DEFDBLCONVFN (uint32_scalar_to_double_matrix, uint32_scalar, uint32_array)
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
69 DEFDBLCONVFN (uint64_scalar_to_double_matrix, uint64_scalar, uint64_array)
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
70
5002
d894b803ccb5 [project @ 2004-09-16 01:11:39 by jwe]
jwe
parents: 4901
diff changeset
71 DEFDBLCONVFN (bool_matrix_to_double_matrix, bool_matrix, bool_array)
d894b803ccb5 [project @ 2004-09-16 01:11:39 by jwe]
jwe
parents: 4901
diff changeset
72 DEFDBLCONVFN (bool_scalar_to_double_matrix, bool, bool_array)
d894b803ccb5 [project @ 2004-09-16 01:11:39 by jwe]
jwe
parents: 4901
diff changeset
73
5164
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents: 5032
diff changeset
74 DEFDBLCONVFN (sparse_matrix_to_double_matrix, sparse_matrix, array)
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents: 5032
diff changeset
75 DEFDBLCONVFN (sparse_bool_matrix_to_double_matrix, sparse_bool_matrix, array)
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents: 5032
diff changeset
76
5032
3361e0846469 [project @ 2004-09-24 03:56:41 by jwe]
jwe
parents: 5002
diff changeset
77 DEFDBLCONVFN (range_to_double_matrix, range, array)
3361e0846469 [project @ 2004-09-24 03:56:41 by jwe]
jwe
parents: 5002
diff changeset
78
5992
4289ed95dde8 [project @ 2006-09-15 20:29:18 by jwe]
jwe
parents: 5307
diff changeset
79 DEFSTRDBLCONVFN(char_matrix_str_to_double_matrix, char_matrix_str)
4289ed95dde8 [project @ 2006-09-15 20:29:18 by jwe]
jwe
parents: 5307
diff changeset
80 DEFSTRDBLCONVFN(char_matrix_sq_str_to_double_matrix, char_matrix_sq_str)
5032
3361e0846469 [project @ 2004-09-24 03:56:41 by jwe]
jwe
parents: 5002
diff changeset
81
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
82 DEFDBLCONVFN (double_scalar_to_double_matrix, scalar, array)
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
83
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
84 void
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
85 install_double_conv_ops (void)
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
86 {
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
87 INSTALL_CONVOP (octave_int8_matrix, octave_matrix,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
88 int8_matrix_to_double_matrix);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
89 INSTALL_CONVOP (octave_int16_matrix, octave_matrix,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
90 int16_matrix_to_double_matrix);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
91 INSTALL_CONVOP (octave_int32_matrix, octave_matrix,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
92 int32_matrix_to_double_matrix);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
93 INSTALL_CONVOP (octave_int64_matrix, octave_matrix,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
94 int64_matrix_to_double_matrix);
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
95
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
96 INSTALL_CONVOP (octave_uint8_matrix, octave_matrix,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
97 uint8_matrix_to_double_matrix);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
98 INSTALL_CONVOP (octave_uint16_matrix, octave_matrix,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
99 uint16_matrix_to_double_matrix);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
100 INSTALL_CONVOP (octave_uint32_matrix, octave_matrix,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
101 uint32_matrix_to_double_matrix);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
102 INSTALL_CONVOP (octave_uint64_matrix, octave_matrix,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
103 uint64_matrix_to_double_matrix);
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
104
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
105 INSTALL_CONVOP (octave_int8_scalar, octave_matrix,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
106 int8_scalar_to_double_matrix);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
107 INSTALL_CONVOP (octave_int16_scalar, octave_matrix,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
108 int16_scalar_to_double_matrix);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
109 INSTALL_CONVOP (octave_int32_scalar, octave_matrix,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
110 int32_scalar_to_double_matrix);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
111 INSTALL_CONVOP (octave_int64_scalar, octave_matrix,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
112 int64_scalar_to_double_matrix);
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
113
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
114 INSTALL_CONVOP (octave_uint8_scalar, octave_matrix,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
115 uint8_scalar_to_double_matrix);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
116 INSTALL_CONVOP (octave_uint16_scalar, octave_matrix,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
117 uint16_scalar_to_double_matrix);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
118 INSTALL_CONVOP (octave_uint32_scalar, octave_matrix,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
119 uint32_scalar_to_double_matrix);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
120 INSTALL_CONVOP (octave_uint64_scalar, octave_matrix,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
121 uint64_scalar_to_double_matrix);
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
122
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
123 INSTALL_CONVOP (octave_bool_matrix, octave_matrix,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
124 bool_matrix_to_double_matrix);
5002
d894b803ccb5 [project @ 2004-09-16 01:11:39 by jwe]
jwe
parents: 4901
diff changeset
125 INSTALL_CONVOP (octave_bool, octave_matrix, bool_scalar_to_double_matrix);
d894b803ccb5 [project @ 2004-09-16 01:11:39 by jwe]
jwe
parents: 4901
diff changeset
126
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
127 INSTALL_CONVOP (octave_sparse_matrix, octave_matrix,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
128 sparse_matrix_to_double_matrix);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
129 INSTALL_CONVOP (octave_sparse_bool_matrix, octave_matrix,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
130 sparse_bool_matrix_to_double_matrix);
5164
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents: 5032
diff changeset
131
5032
3361e0846469 [project @ 2004-09-24 03:56:41 by jwe]
jwe
parents: 5002
diff changeset
132 INSTALL_CONVOP (octave_range, octave_matrix, range_to_double_matrix);
3361e0846469 [project @ 2004-09-24 03:56:41 by jwe]
jwe
parents: 5002
diff changeset
133
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
134 INSTALL_CONVOP (octave_char_matrix_str, octave_matrix,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
135 char_matrix_str_to_double_matrix);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
136 INSTALL_CONVOP (octave_char_matrix_sq_str, octave_matrix,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
137 char_matrix_sq_str_to_double_matrix);
5032
3361e0846469 [project @ 2004-09-24 03:56:41 by jwe]
jwe
parents: 5002
diff changeset
138
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
139 INSTALL_CONVOP (octave_scalar, octave_matrix, double_scalar_to_double_matrix);
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents:
diff changeset
140 }