ov-uint32.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 <climits>
00028 
00029 #include <iostream>
00030 
00031 #include "lo-ieee.h"
00032 #include "lo-utils.h"
00033 #include "mx-base.h"
00034 #include "quit.h"
00035 
00036 #include "defun.h"
00037 #include "gripes.h"
00038 #include "oct-obj.h"
00039 #include "oct-lvalue.h"
00040 #include "ops.h"
00041 #include "ov-base.h"
00042 
00043 #ifdef HAVE_HDF5
00044 #define HDF5_SAVE_TYPE H5T_NATIVE_UINT32
00045 #endif
00046 
00047 #include "ov-base-int.h"
00048 #include "ov-base-int.cc"
00049 #include "ov-uint32.h"
00050 #include "ov-type-conv.h"
00051 #include "pr-output.h"
00052 #include "variables.h"
00053 
00054 #include "byte-swap.h"
00055 #include "ls-oct-ascii.h"
00056 #include "ls-utils.h"
00057 #include "ls-hdf5.h"
00058 
00059 template class octave_base_matrix<uint32NDArray>;
00060 
00061 template class octave_base_int_matrix<uint32NDArray>;
00062 
00063 DEFINE_OCTAVE_ALLOCATOR (octave_uint32_matrix);
00064 
00065 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_uint32_matrix,
00066                                      "uint32 matrix", "uint32");
00067 
00068 template class octave_base_scalar<octave_uint32>;
00069 
00070 template class octave_base_int_scalar<octave_uint32>;
00071 
00072 DEFINE_OCTAVE_ALLOCATOR (octave_uint32_scalar);
00073 
00074 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_uint32_scalar,
00075                                      "uint32 scalar", "uint32");
00076 
00077 DEFUN (uint32, args, ,
00078   "-*- texinfo -*-\n\
00079 @deftypefn {Built-in Function} {} uint32 (@var{x})\n\
00080 Convert @var{x} to unsigned 32-bit integer type.\n\
00081 @end deftypefn")
00082 {
00083   OCTAVE_TYPE_CONV_BODY (uint32);
00084 }
00085 
00086 /*
00087 
00088 %!assert (class (uint32 (1)), "uint32")
00089 %!assert (uint32 (1.25), uint32 (1))
00090 %!assert (uint32 (1.5), uint32 (2))
00091 %!assert (uint32 (-1.5), uint32 (0))
00092 %!assert (uint32 (2^33), uint32 (2^32-1))
00093 %!assert (uint32 (-2^33), uint32 (0))
00094 
00095 */
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines