op-float-conv.cc

Go to the documentation of this file.
00001 /*
00002 
00003 Copyright (C) 2004-2012 John W. Eaton
00004 
00005 This file is part of Octave.
00006 
00007 Octave is free software; you can redistribute it and/or modify it
00008 under the terms of the GNU General Public License as published by the
00009 Free Software Foundation; either version 3 of the License, or (at your
00010 option) any later version.
00011 
00012 Octave is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00015 for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Octave; see the file COPYING.  If not, see
00019 <http://www.gnu.org/licenses/>.
00020 
00021 */
00022 
00023 #ifdef HAVE_CONFIG_H
00024 #include <config.h>
00025 #endif
00026 
00027 #include "gripes.h"
00028 #include "oct-obj.h"
00029 #include "ov.h"
00030 #include "ov-int8.h"
00031 #include "ov-int16.h"
00032 #include "ov-int32.h"
00033 #include "ov-int64.h"
00034 #include "ov-uint8.h"
00035 #include "ov-uint16.h"
00036 #include "ov-uint32.h"
00037 #include "ov-uint64.h"
00038 #include "ov-bool.h"
00039 #include "ov-bool-mat.h"
00040 #include "ov-range.h"
00041 #include "ov-float.h"
00042 #include "ov-flt-re-mat.h"
00043 #include "ov-str-mat.h"
00044 #include "ov-typeinfo.h"
00045 #include "ops.h"
00046 
00047 // conversion ops
00048 
00049 DEFFLTCONVFN (int8_matrix_to_float_matrix, int8_matrix, int8_array)
00050 DEFFLTCONVFN (int16_matrix_to_float_matrix, int16_matrix, int16_array)
00051 DEFFLTCONVFN (int32_matrix_to_float_matrix, int32_matrix, int32_array)
00052 DEFFLTCONVFN (int64_matrix_to_float_matrix, int64_matrix, int64_array)
00053 
00054 DEFFLTCONVFN (uint8_matrix_to_float_matrix, uint8_matrix, uint8_array)
00055 DEFFLTCONVFN (uint16_matrix_to_float_matrix, uint16_matrix, uint16_array)
00056 DEFFLTCONVFN (uint32_matrix_to_float_matrix, uint32_matrix, uint32_array)
00057 DEFFLTCONVFN (uint64_matrix_to_float_matrix, uint64_matrix, uint64_array)
00058 
00059 DEFFLTCONVFN (int8_scalar_to_float_matrix, int8_scalar, int8_array)
00060 DEFFLTCONVFN (int16_scalar_to_float_matrix, int16_scalar, int16_array)
00061 DEFFLTCONVFN (int32_scalar_to_float_matrix, int32_scalar, int32_array)
00062 DEFFLTCONVFN (int64_scalar_to_float_matrix, int64_scalar, int64_array)
00063 
00064 DEFFLTCONVFN (uint8_scalar_to_float_matrix, uint8_scalar, uint8_array)
00065 DEFFLTCONVFN (uint16_scalar_to_float_matrix, uint16_scalar, uint16_array)
00066 DEFFLTCONVFN (uint32_scalar_to_float_matrix, uint32_scalar, uint32_array)
00067 DEFFLTCONVFN (uint64_scalar_to_float_matrix, uint64_scalar, uint64_array)
00068 
00069 DEFFLTCONVFN (bool_matrix_to_float_matrix, bool_matrix, bool_array)
00070 DEFFLTCONVFN (bool_scalar_to_float_matrix, bool, bool_array)
00071 
00072 DEFFLTCONVFN (range_to_float_matrix, range, array)
00073 
00074 DEFSTRFLTCONVFN(char_matrix_str_to_float_matrix, char_matrix_str)
00075 DEFSTRFLTCONVFN(char_matrix_sq_str_to_float_matrix, char_matrix_sq_str)
00076 
00077 DEFFLTCONVFN (float_scalar_to_float_matrix, scalar, array)
00078 
00079 void
00080 install_float_conv_ops (void)
00081 {
00082   INSTALL_CONVOP (octave_int8_matrix, octave_float_matrix, int8_matrix_to_float_matrix);
00083   INSTALL_CONVOP (octave_int16_matrix, octave_float_matrix, int16_matrix_to_float_matrix);
00084   INSTALL_CONVOP (octave_int32_matrix, octave_float_matrix, int32_matrix_to_float_matrix);
00085   INSTALL_CONVOP (octave_int64_matrix, octave_float_matrix, int64_matrix_to_float_matrix);
00086 
00087   INSTALL_CONVOP (octave_uint8_matrix, octave_float_matrix, uint8_matrix_to_float_matrix);
00088   INSTALL_CONVOP (octave_uint16_matrix, octave_float_matrix, uint16_matrix_to_float_matrix);
00089   INSTALL_CONVOP (octave_uint32_matrix, octave_float_matrix, uint32_matrix_to_float_matrix);
00090   INSTALL_CONVOP (octave_uint64_matrix, octave_float_matrix, uint64_matrix_to_float_matrix);
00091 
00092   INSTALL_CONVOP (octave_int8_scalar, octave_float_matrix, int8_scalar_to_float_matrix);
00093   INSTALL_CONVOP (octave_int16_scalar, octave_float_matrix, int16_scalar_to_float_matrix);
00094   INSTALL_CONVOP (octave_int32_scalar, octave_float_matrix, int32_scalar_to_float_matrix);
00095   INSTALL_CONVOP (octave_int64_scalar, octave_float_matrix, int64_scalar_to_float_matrix);
00096 
00097   INSTALL_CONVOP (octave_uint8_scalar, octave_float_matrix, uint8_scalar_to_float_matrix);
00098   INSTALL_CONVOP (octave_uint16_scalar, octave_float_matrix, uint16_scalar_to_float_matrix);
00099   INSTALL_CONVOP (octave_uint32_scalar, octave_float_matrix, uint32_scalar_to_float_matrix);
00100   INSTALL_CONVOP (octave_uint64_scalar, octave_float_matrix, uint64_scalar_to_float_matrix);
00101 
00102   INSTALL_CONVOP (octave_bool_matrix, octave_float_matrix, bool_matrix_to_float_matrix);
00103   INSTALL_CONVOP (octave_bool, octave_float_matrix, bool_scalar_to_float_matrix);
00104 
00105   INSTALL_CONVOP (octave_range, octave_float_matrix, range_to_float_matrix);
00106 
00107   INSTALL_CONVOP (octave_char_matrix_str, octave_float_matrix, char_matrix_str_to_float_matrix);
00108   INSTALL_CONVOP (octave_char_matrix_sq_str, octave_float_matrix, char_matrix_sq_str_to_float_matrix);
00109 
00110   INSTALL_CONVOP (octave_scalar, octave_float_matrix, float_scalar_to_float_matrix);
00111 }
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines