Mercurial > octave-libgccjit
comparison src/OPERATORS/op-float-conv.cc @ 8853:9df4c9c94862
add op-float-conv.cc for previous change
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 24 Feb 2009 04:34:24 -0500 |
parents | |
children | eb63fbe60fab |
comparison
equal
deleted
inserted
replaced
8852:86088b49a6d7 | 8853:9df4c9c94862 |
---|---|
1 /* | |
2 | |
3 Copyright (C) 2004, 2005, 2006, 2007 John W. Eaton | |
4 | |
5 This file is part of Octave. | |
6 | |
7 Octave is free software; you can redistribute it and/or modify it | |
8 under the terms of the GNU General Public License as published by the | |
9 Free Software Foundation; either version 3 of the License, or (at your | |
10 option) any later version. | |
11 | |
12 Octave is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
18 along with Octave; see the file COPYING. If not, see | |
19 <http://www.gnu.org/licenses/>. | |
20 | |
21 */ | |
22 | |
23 #ifdef HAVE_CONFIG_H | |
24 #include <config.h> | |
25 #endif | |
26 | |
27 #include "gripes.h" | |
28 #include "oct-obj.h" | |
29 #include "ov.h" | |
30 #include "ov-int8.h" | |
31 #include "ov-int16.h" | |
32 #include "ov-int32.h" | |
33 #include "ov-int64.h" | |
34 #include "ov-uint8.h" | |
35 #include "ov-uint16.h" | |
36 #include "ov-uint32.h" | |
37 #include "ov-uint64.h" | |
38 #include "ov-bool.h" | |
39 #include "ov-bool-mat.h" | |
40 #include "ov-range.h" | |
41 #include "ov-float.h" | |
42 #include "ov-flt-re-mat.h" | |
43 #include "ov-str-mat.h" | |
44 #include "ov-typeinfo.h" | |
45 #include "ops.h" | |
46 | |
47 // conversion ops | |
48 | |
49 DEFFLTCONVFN (int8_matrix_to_float_matrix, int8_matrix, int8_array) | |
50 DEFFLTCONVFN (int16_matrix_to_float_matrix, int16_matrix, int16_array) | |
51 DEFFLTCONVFN (int32_matrix_to_float_matrix, int32_matrix, int32_array) | |
52 DEFFLTCONVFN (int64_matrix_to_float_matrix, int64_matrix, int64_array) | |
53 | |
54 DEFFLTCONVFN (uint8_matrix_to_float_matrix, uint8_matrix, uint8_array) | |
55 DEFFLTCONVFN (uint16_matrix_to_float_matrix, uint16_matrix, uint16_array) | |
56 DEFFLTCONVFN (uint32_matrix_to_float_matrix, uint32_matrix, uint32_array) | |
57 DEFFLTCONVFN (uint64_matrix_to_float_matrix, uint64_matrix, uint64_array) | |
58 | |
59 DEFFLTCONVFN (int8_scalar_to_float_matrix, int8_scalar, int8_array) | |
60 DEFFLTCONVFN (int16_scalar_to_float_matrix, int16_scalar, int16_array) | |
61 DEFFLTCONVFN (int32_scalar_to_float_matrix, int32_scalar, int32_array) | |
62 DEFFLTCONVFN (int64_scalar_to_float_matrix, int64_scalar, int64_array) | |
63 | |
64 DEFFLTCONVFN (uint8_scalar_to_float_matrix, uint8_scalar, uint8_array) | |
65 DEFFLTCONVFN (uint16_scalar_to_float_matrix, uint16_scalar, uint16_array) | |
66 DEFFLTCONVFN (uint32_scalar_to_float_matrix, uint32_scalar, uint32_array) | |
67 DEFFLTCONVFN (uint64_scalar_to_float_matrix, uint64_scalar, uint64_array) | |
68 | |
69 DEFFLTCONVFN (bool_matrix_to_float_matrix, bool_matrix, bool_array) | |
70 DEFFLTCONVFN (bool_scalar_to_float_matrix, bool, bool_array) | |
71 | |
72 DEFFLTCONVFN (range_to_float_matrix, range, array) | |
73 | |
74 DEFSTRFLTCONVFN(char_matrix_str_to_float_matrix, char_matrix_str) | |
75 DEFSTRFLTCONVFN(char_matrix_sq_str_to_float_matrix, char_matrix_sq_str) | |
76 | |
77 DEFFLTCONVFN (float_scalar_to_float_matrix, scalar, array) | |
78 | |
79 void | |
80 install_float_conv_ops (void) | |
81 { | |
82 INSTALL_CONVOP (octave_int8_matrix, octave_float_matrix, int8_matrix_to_float_matrix); | |
83 INSTALL_CONVOP (octave_int16_matrix, octave_float_matrix, int16_matrix_to_float_matrix); | |
84 INSTALL_CONVOP (octave_int32_matrix, octave_float_matrix, int32_matrix_to_float_matrix); | |
85 INSTALL_CONVOP (octave_int64_matrix, octave_float_matrix, int64_matrix_to_float_matrix); | |
86 | |
87 INSTALL_CONVOP (octave_uint8_matrix, octave_float_matrix, uint8_matrix_to_float_matrix); | |
88 INSTALL_CONVOP (octave_uint16_matrix, octave_float_matrix, uint16_matrix_to_float_matrix); | |
89 INSTALL_CONVOP (octave_uint32_matrix, octave_float_matrix, uint32_matrix_to_float_matrix); | |
90 INSTALL_CONVOP (octave_uint64_matrix, octave_float_matrix, uint64_matrix_to_float_matrix); | |
91 | |
92 INSTALL_CONVOP (octave_int8_scalar, octave_float_matrix, int8_scalar_to_float_matrix); | |
93 INSTALL_CONVOP (octave_int16_scalar, octave_float_matrix, int16_scalar_to_float_matrix); | |
94 INSTALL_CONVOP (octave_int32_scalar, octave_float_matrix, int32_scalar_to_float_matrix); | |
95 INSTALL_CONVOP (octave_int64_scalar, octave_float_matrix, int64_scalar_to_float_matrix); | |
96 | |
97 INSTALL_CONVOP (octave_uint8_scalar, octave_float_matrix, uint8_scalar_to_float_matrix); | |
98 INSTALL_CONVOP (octave_uint16_scalar, octave_float_matrix, uint16_scalar_to_float_matrix); | |
99 INSTALL_CONVOP (octave_uint32_scalar, octave_float_matrix, uint32_scalar_to_float_matrix); | |
100 INSTALL_CONVOP (octave_uint64_scalar, octave_float_matrix, uint64_scalar_to_float_matrix); | |
101 | |
102 INSTALL_CONVOP (octave_bool_matrix, octave_float_matrix, bool_matrix_to_float_matrix); | |
103 INSTALL_CONVOP (octave_bool, octave_float_matrix, bool_scalar_to_float_matrix); | |
104 | |
105 INSTALL_CONVOP (octave_range, octave_float_matrix, range_to_float_matrix); | |
106 | |
107 INSTALL_CONVOP (octave_char_matrix_str, octave_float_matrix, char_matrix_str_to_float_matrix); | |
108 INSTALL_CONVOP (octave_char_matrix_sq_str, octave_float_matrix, char_matrix_sq_str_to_float_matrix); | |
109 | |
110 INSTALL_CONVOP (octave_scalar, octave_float_matrix, float_scalar_to_float_matrix); | |
111 } | |
112 | |
113 /* | |
114 ;;; Local Variables: *** | |
115 ;;; mode: C++ *** | |
116 ;;; End: *** | |
117 p*/ |