ov-flt-re-diag.h

Go to the documentation of this file.
00001 /*
00002 
00003 Copyright (C) 2008-2012 Jaroslav Hajek
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 #if !defined (octave_float_diag_matrix_h)
00024 #define octave_float_diag_matrix_h 1
00025 
00026 #include "ov-base.h"
00027 #include "ov-base-diag.h"
00028 #include "ov-flt-re-mat.h"
00029 #include "ov-typeinfo.h"
00030 
00031 // Real diagonal matrix values.
00032 
00033 class
00034 OCTINTERP_API
00035 octave_float_diag_matrix
00036   : public octave_base_diag<FloatDiagMatrix, FloatMatrix>
00037 {
00038 public:
00039 
00040   octave_float_diag_matrix (void)
00041     : octave_base_diag<FloatDiagMatrix, FloatMatrix> () { }
00042 
00043   octave_float_diag_matrix (const FloatDiagMatrix& m)
00044     : octave_base_diag<FloatDiagMatrix, FloatMatrix> (m) { }
00045 
00046   octave_float_diag_matrix (const octave_float_diag_matrix& m)
00047     : octave_base_diag<FloatDiagMatrix, FloatMatrix> (m) { }
00048 
00049   ~octave_float_diag_matrix (void) { }
00050 
00051   octave_base_value *clone (void) const { return new octave_float_diag_matrix (*this); }
00052   octave_base_value *empty_clone (void) const { return new octave_float_diag_matrix (); }
00053 
00054   type_conv_info numeric_conversion_function (void) const;
00055 
00056   octave_base_value *try_narrowing_conversion (void);
00057 
00058   builtin_type_t builtin_type (void) const { return btyp_float; }
00059 
00060   bool is_real_matrix (void) const { return true; }
00061 
00062   bool is_real_type (void) const { return true; }
00063 
00064   bool is_single_type (void) const { return true; }
00065 
00066   bool is_float_type (void) const { return true; }
00067 
00068   DiagMatrix diag_matrix_value (bool = false) const;
00069 
00070   FloatDiagMatrix float_diag_matrix_value (bool = false) const;
00071 
00072   ComplexDiagMatrix complex_diag_matrix_value (bool = false) const;
00073 
00074   FloatComplexDiagMatrix float_complex_diag_matrix_value (bool = false) const;
00075 
00076   bool save_binary (std::ostream& os, bool& save_as_floats);
00077 
00078   bool load_binary (std::istream& is, bool swap,
00079                     oct_mach_info::float_format fmt);
00080 
00081   octave_value map (unary_mapper_t umap) const;
00082 
00083 private:
00084 
00085   bool chk_valid_scalar (const octave_value&,
00086                          float&) const;
00087 
00088   DECLARE_OCTAVE_ALLOCATOR
00089 
00090   DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
00091 };
00092 
00093 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines