GNU Octave  4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
op-float-conv.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2004-2015 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
81 {
82  INSTALL_CONVOP (octave_int8_matrix, octave_float_matrix,
83  int8_matrix_to_float_matrix);
84  INSTALL_CONVOP (octave_int16_matrix, octave_float_matrix,
85  int16_matrix_to_float_matrix);
86  INSTALL_CONVOP (octave_int32_matrix, octave_float_matrix,
87  int32_matrix_to_float_matrix);
88  INSTALL_CONVOP (octave_int64_matrix, octave_float_matrix,
89  int64_matrix_to_float_matrix);
90 
91  INSTALL_CONVOP (octave_uint8_matrix, octave_float_matrix,
92  uint8_matrix_to_float_matrix);
93  INSTALL_CONVOP (octave_uint16_matrix, octave_float_matrix,
94  uint16_matrix_to_float_matrix);
95  INSTALL_CONVOP (octave_uint32_matrix, octave_float_matrix,
96  uint32_matrix_to_float_matrix);
97  INSTALL_CONVOP (octave_uint64_matrix, octave_float_matrix,
98  uint64_matrix_to_float_matrix);
99 
100  INSTALL_CONVOP (octave_int8_scalar, octave_float_matrix,
101  int8_scalar_to_float_matrix);
102  INSTALL_CONVOP (octave_int16_scalar, octave_float_matrix,
103  int16_scalar_to_float_matrix);
104  INSTALL_CONVOP (octave_int32_scalar, octave_float_matrix,
105  int32_scalar_to_float_matrix);
106  INSTALL_CONVOP (octave_int64_scalar, octave_float_matrix,
107  int64_scalar_to_float_matrix);
108 
109  INSTALL_CONVOP (octave_uint8_scalar, octave_float_matrix,
110  uint8_scalar_to_float_matrix);
111  INSTALL_CONVOP (octave_uint16_scalar, octave_float_matrix,
112  uint16_scalar_to_float_matrix);
113  INSTALL_CONVOP (octave_uint32_scalar, octave_float_matrix,
114  uint32_scalar_to_float_matrix);
115  INSTALL_CONVOP (octave_uint64_scalar, octave_float_matrix,
116  uint64_scalar_to_float_matrix);
117 
119  bool_matrix_to_float_matrix);
121  bool_scalar_to_float_matrix);
122 
123  INSTALL_CONVOP (octave_range, octave_float_matrix, range_to_float_matrix);
124 
126  char_matrix_str_to_float_matrix);
128  char_matrix_sq_str_to_float_matrix);
129 
131  float_scalar_to_float_matrix);
132 }
#define DEFSTRFLTCONVFN(name, tfrom)
Definition: ops.h:215
#define INSTALL_CONVOP(t1, t2, f)
Definition: ops.h:68
#define DEFFLTCONVFN(name, ovtfrom, e)
Definition: ops.h:201
void install_float_conv_ops(void)
static bool scalar(const dim_vector &dims)
Definition: ov-struct.cc:736