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