00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #if !defined (octave_sparse_complex_matrix_h)
00025 #define octave_sparse_complex_matrix_h 1
00026
00027 #include <cstdlib>
00028
00029 #include <iosfwd>
00030 #include <string>
00031
00032 #include "mx-base.h"
00033 #include "oct-alloc.h"
00034 #include "str-vec.h"
00035
00036 #include "error.h"
00037 #include "oct-stream.h"
00038 #include "ov-base.h"
00039 #include "ov-typeinfo.h"
00040
00041 #include "CSparse.h"
00042 #include "ov-base-sparse.h"
00043 #include "ov-re-sparse.h"
00044
00045 class Octave_map;
00046 class octave_value_list;
00047
00048 class tree_walker;
00049
00050 class
00051 OCTINTERP_API
00052 octave_sparse_complex_matrix : public octave_base_sparse<SparseComplexMatrix>
00053 {
00054 public:
00055
00056 octave_sparse_complex_matrix (void)
00057 : octave_base_sparse<SparseComplexMatrix> () { }
00058
00059 octave_sparse_complex_matrix (const ComplexNDArray& m)
00060 : octave_base_sparse<SparseComplexMatrix> (SparseComplexMatrix (m)) { }
00061
00062 octave_sparse_complex_matrix (const ComplexMatrix& m)
00063 : octave_base_sparse<SparseComplexMatrix> (SparseComplexMatrix (m)) { }
00064
00065 octave_sparse_complex_matrix (const SparseComplexMatrix& m)
00066 : octave_base_sparse<SparseComplexMatrix> (m) { }
00067
00068 octave_sparse_complex_matrix (const SparseComplexMatrix& m,
00069 const MatrixType &t)
00070 : octave_base_sparse<SparseComplexMatrix> (m, t) { }
00071
00072 octave_sparse_complex_matrix (const MSparse<Complex>& m)
00073 : octave_base_sparse<SparseComplexMatrix> (m) { }
00074
00075 octave_sparse_complex_matrix (const MSparse<Complex>& m,
00076 const MatrixType &t)
00077 : octave_base_sparse<SparseComplexMatrix> (m, t) { }
00078
00079 octave_sparse_complex_matrix (const Sparse<Complex>& m,
00080 const MatrixType &t)
00081 : octave_base_sparse<SparseComplexMatrix> (SparseComplexMatrix (m), t) { }
00082
00083 octave_sparse_complex_matrix (const Sparse<Complex>& m)
00084 : octave_base_sparse<SparseComplexMatrix> (SparseComplexMatrix (m)) { }
00085
00086 octave_sparse_complex_matrix (const octave_sparse_complex_matrix& cm)
00087 : octave_base_sparse<SparseComplexMatrix> (cm) { }
00088
00089 ~octave_sparse_complex_matrix (void) { }
00090
00091 octave_base_value *clone (void) const { return new octave_sparse_complex_matrix (*this); }
00092 octave_base_value *empty_clone (void) const { return new octave_sparse_complex_matrix (); }
00093
00094 octave_base_value *try_narrowing_conversion (void);
00095
00096 void assign (const octave_value_list& idx, const SparseComplexMatrix& rhs);
00097
00098 void assign (const octave_value_list& idx, const SparseMatrix& rhs);
00099
00100 builtin_type_t builtin_type (void) const { return btyp_complex; }
00101
00102 bool is_complex_matrix (void) const { return true; }
00103
00104 bool is_complex_type (void) const { return true; }
00105
00106 bool is_double_type (void) const { return true; }
00107
00108 bool is_float_type (void) const { return true; }
00109
00110 double double_value (bool = false) const;
00111
00112 double scalar_value (bool frc_str_conv = false) const
00113 { return double_value (frc_str_conv); }
00114
00115 Matrix matrix_value (bool = false) const;
00116
00117 Complex complex_value (bool = false) const;
00118
00119 ComplexMatrix complex_matrix_value (bool = false) const;
00120
00121 ComplexNDArray complex_array_value (bool = false) const;
00122
00123 charNDArray char_array_value (bool frc_str_conv = false) const;
00124
00125 SparseMatrix sparse_matrix_value (bool = false) const;
00126
00127 SparseComplexMatrix sparse_complex_matrix_value (bool = false) const
00128 { return matrix; }
00129
00130 #if 0
00131 int write (octave_stream& os, int block_size,
00132 oct_data_conv::data_type output_type, int skip,
00133 oct_mach_info::float_format flt_fmt) const
00134 {
00135
00136 return os.write (matrix_value (true), block_size, output_type,
00137 skip, flt_fmt);
00138 }
00139 #endif
00140
00141 bool save_binary (std::ostream& os, bool& save_as_floats);
00142
00143 bool load_binary (std::istream& is, bool swap,
00144 oct_mach_info::float_format fmt);
00145
00146 #if defined (HAVE_HDF5)
00147 bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats);
00148
00149 bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug);
00150 #endif
00151
00152 mxArray *as_mxArray (void) const;
00153
00154 octave_value erf (void) const;
00155 octave_value erfc (void) const;
00156 octave_value gamma (void) const;
00157 octave_value lgamma (void) const;
00158 octave_value abs (void) const;
00159 octave_value acos (void) const;
00160 octave_value acosh (void) const;
00161 octave_value angle (void) const;
00162 octave_value arg (void) const;
00163 octave_value asin (void) const;
00164 octave_value asinh (void) const;
00165 octave_value atan (void) const;
00166 octave_value atanh (void) const;
00167 octave_value ceil (void) const;
00168 octave_value conj (void) const;
00169 octave_value cos (void) const;
00170 octave_value cosh (void) const;
00171 octave_value exp (void) const;
00172 octave_value expm1 (void) const;
00173 octave_value fix (void) const;
00174 octave_value floor (void) const;
00175 octave_value imag (void) const;
00176 octave_value log (void) const;
00177 octave_value log2 (void) const;
00178 octave_value log10 (void) const;
00179 octave_value log1p (void) const;
00180 octave_value real (void) const;
00181 octave_value round (void) const;
00182 octave_value roundb (void) const;
00183 octave_value signum (void) const;
00184 octave_value sin (void) const;
00185 octave_value sinh (void) const;
00186 octave_value sqrt (void) const;
00187 octave_value tan (void) const;
00188 octave_value tanh (void) const;
00189 octave_value finite (void) const;
00190 octave_value isinf (void) const;
00191 octave_value isna (void) const;
00192 octave_value isnan (void) const;
00193
00194 private:
00195
00196 DECLARE_OCTAVE_ALLOCATOR
00197
00198 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
00199 };
00200
00201 #endif
00202
00203
00204
00205
00206
00207