GNU Octave  3.8.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-double-conv.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2004-2013 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-re-sparse.h"
41 #include "ov-bool-sparse.h"
42 #include "ov-range.h"
43 #include "ov-scalar.h"
44 #include "ov-re-mat.h"
45 #include "ov-str-mat.h"
46 #include "ov-typeinfo.h"
47 #include "ops.h"
48 
49 // conversion ops
50 
51 DEFDBLCONVFN (int8_matrix_to_double_matrix, int8_matrix, int8_array)
52 DEFDBLCONVFN (int16_matrix_to_double_matrix, int16_matrix, int16_array)
53 DEFDBLCONVFN (int32_matrix_to_double_matrix, int32_matrix, int32_array)
54 DEFDBLCONVFN (int64_matrix_to_double_matrix, int64_matrix, int64_array)
55 
56 DEFDBLCONVFN (uint8_matrix_to_double_matrix, uint8_matrix, uint8_array)
57 DEFDBLCONVFN (uint16_matrix_to_double_matrix, uint16_matrix, uint16_array)
58 DEFDBLCONVFN (uint32_matrix_to_double_matrix, uint32_matrix, uint32_array)
59 DEFDBLCONVFN (uint64_matrix_to_double_matrix, uint64_matrix, uint64_array)
60 
61 DEFDBLCONVFN (int8_scalar_to_double_matrix, int8_scalar, int8_array)
62 DEFDBLCONVFN (int16_scalar_to_double_matrix, int16_scalar, int16_array)
63 DEFDBLCONVFN (int32_scalar_to_double_matrix, int32_scalar, int32_array)
64 DEFDBLCONVFN (int64_scalar_to_double_matrix, int64_scalar, int64_array)
65 
66 DEFDBLCONVFN (uint8_scalar_to_double_matrix, uint8_scalar, uint8_array)
67 DEFDBLCONVFN (uint16_scalar_to_double_matrix, uint16_scalar, uint16_array)
68 DEFDBLCONVFN (uint32_scalar_to_double_matrix, uint32_scalar, uint32_array)
69 DEFDBLCONVFN (uint64_scalar_to_double_matrix, uint64_scalar, uint64_array)
70 
71 DEFDBLCONVFN (bool_matrix_to_double_matrix, bool_matrix, bool_array)
72 DEFDBLCONVFN (bool_scalar_to_double_matrix, bool, bool_array)
73 
74 DEFDBLCONVFN (sparse_matrix_to_double_matrix, sparse_matrix, array)
75 DEFDBLCONVFN (sparse_bool_matrix_to_double_matrix, sparse_bool_matrix, array)
76 
77 DEFDBLCONVFN (range_to_double_matrix, range, array)
78 
79 DEFSTRDBLCONVFN(char_matrix_str_to_double_matrix, char_matrix_str)
80 DEFSTRDBLCONVFN(char_matrix_sq_str_to_double_matrix, char_matrix_sq_str)
81 
82 DEFDBLCONVFN (double_scalar_to_double_matrix, scalar, array)
83 
84 void
86 {
87  INSTALL_CONVOP (octave_int8_matrix, octave_matrix,
88  int8_matrix_to_double_matrix);
89  INSTALL_CONVOP (octave_int16_matrix, octave_matrix,
90  int16_matrix_to_double_matrix);
91  INSTALL_CONVOP (octave_int32_matrix, octave_matrix,
92  int32_matrix_to_double_matrix);
93  INSTALL_CONVOP (octave_int64_matrix, octave_matrix,
94  int64_matrix_to_double_matrix);
95 
96  INSTALL_CONVOP (octave_uint8_matrix, octave_matrix,
97  uint8_matrix_to_double_matrix);
98  INSTALL_CONVOP (octave_uint16_matrix, octave_matrix,
99  uint16_matrix_to_double_matrix);
100  INSTALL_CONVOP (octave_uint32_matrix, octave_matrix,
101  uint32_matrix_to_double_matrix);
102  INSTALL_CONVOP (octave_uint64_matrix, octave_matrix,
103  uint64_matrix_to_double_matrix);
104 
105  INSTALL_CONVOP (octave_int8_scalar, octave_matrix,
106  int8_scalar_to_double_matrix);
107  INSTALL_CONVOP (octave_int16_scalar, octave_matrix,
108  int16_scalar_to_double_matrix);
109  INSTALL_CONVOP (octave_int32_scalar, octave_matrix,
110  int32_scalar_to_double_matrix);
111  INSTALL_CONVOP (octave_int64_scalar, octave_matrix,
112  int64_scalar_to_double_matrix);
113 
114  INSTALL_CONVOP (octave_uint8_scalar, octave_matrix,
115  uint8_scalar_to_double_matrix);
116  INSTALL_CONVOP (octave_uint16_scalar, octave_matrix,
117  uint16_scalar_to_double_matrix);
118  INSTALL_CONVOP (octave_uint32_scalar, octave_matrix,
119  uint32_scalar_to_double_matrix);
120  INSTALL_CONVOP (octave_uint64_scalar, octave_matrix,
121  uint64_scalar_to_double_matrix);
122 
124  bool_matrix_to_double_matrix);
125  INSTALL_CONVOP (octave_bool, octave_matrix, bool_scalar_to_double_matrix);
126 
128  sparse_matrix_to_double_matrix);
130  sparse_bool_matrix_to_double_matrix);
131 
132  INSTALL_CONVOP (octave_range, octave_matrix, range_to_double_matrix);
133 
135  char_matrix_str_to_double_matrix);
137  char_matrix_sq_str_to_double_matrix);
138 
139  INSTALL_CONVOP (octave_scalar, octave_matrix, double_scalar_to_double_matrix);
140 }