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_FloatComplexDiagMatrix_h)
00025 #define octave_FloatComplexDiagMatrix_h 1
00026
00027 #include "MDiagArray2.h"
00028
00029 #include "fRowVector.h"
00030 #include "fCRowVector.h"
00031 #include "fColVector.h"
00032 #include "fCColVector.h"
00033 #include "DET.h"
00034
00035 #include "mx-defs.h"
00036
00037 class
00038 OCTAVE_API
00039 FloatComplexDiagMatrix : public MDiagArray2<FloatComplex>
00040 {
00041 public:
00042
00043 FloatComplexDiagMatrix (void) : MDiagArray2<FloatComplex> () { }
00044
00045 FloatComplexDiagMatrix (octave_idx_type r, octave_idx_type c) : MDiagArray2<FloatComplex> (r, c) { }
00046
00047 FloatComplexDiagMatrix (octave_idx_type r, octave_idx_type c, const FloatComplex& val)
00048 : MDiagArray2<FloatComplex> (r, c, val) { }
00049
00050 explicit FloatComplexDiagMatrix (const FloatRowVector& a)
00051 : MDiagArray2<FloatComplex> (FloatComplexRowVector (a)) { }
00052
00053 explicit FloatComplexDiagMatrix (const FloatComplexRowVector& a)
00054 : MDiagArray2<FloatComplex> (a) { }
00055
00056 explicit FloatComplexDiagMatrix (const FloatColumnVector& a)
00057 : MDiagArray2<FloatComplex> (FloatComplexColumnVector (a)) { }
00058
00059 explicit FloatComplexDiagMatrix (const FloatComplexColumnVector& a)
00060 : MDiagArray2<FloatComplex> (a) { }
00061
00062 explicit FloatComplexDiagMatrix (const FloatDiagMatrix& a);
00063
00064 FloatComplexDiagMatrix (const MDiagArray2<FloatComplex>& a)
00065 : MDiagArray2<FloatComplex> (a) { }
00066
00067 FloatComplexDiagMatrix (const FloatComplexDiagMatrix& a)
00068 : MDiagArray2<FloatComplex> (a) { }
00069
00070 template <class U>
00071 FloatComplexDiagMatrix (const DiagArray2<U>& a)
00072 : MDiagArray2<FloatComplex> (a) { }
00073
00074 FloatComplexDiagMatrix& operator = (const FloatComplexDiagMatrix& a)
00075 {
00076 MDiagArray2<FloatComplex>::operator = (a);
00077 return *this;
00078 }
00079
00080 bool operator == (const FloatComplexDiagMatrix& a) const;
00081 bool operator != (const FloatComplexDiagMatrix& a) const;
00082
00083 FloatComplexDiagMatrix& fill (float val);
00084 FloatComplexDiagMatrix& fill (const FloatComplex& val);
00085 FloatComplexDiagMatrix& fill (float val, octave_idx_type beg, octave_idx_type end);
00086 FloatComplexDiagMatrix& fill (const FloatComplex& val, octave_idx_type beg, octave_idx_type end);
00087 FloatComplexDiagMatrix& fill (const FloatColumnVector& a);
00088 FloatComplexDiagMatrix& fill (const FloatComplexColumnVector& a);
00089 FloatComplexDiagMatrix& fill (const FloatRowVector& a);
00090 FloatComplexDiagMatrix& fill (const FloatComplexRowVector& a);
00091 FloatComplexDiagMatrix& fill (const FloatColumnVector& a, octave_idx_type beg);
00092 FloatComplexDiagMatrix& fill (const FloatComplexColumnVector& a, octave_idx_type beg);
00093 FloatComplexDiagMatrix& fill (const FloatRowVector& a, octave_idx_type beg);
00094 FloatComplexDiagMatrix& fill (const FloatComplexRowVector& a, octave_idx_type beg);
00095
00096 FloatComplexDiagMatrix hermitian (void) const { return MDiagArray2<FloatComplex>::hermitian (std::conj); }
00097 FloatComplexDiagMatrix transpose (void) const { return MDiagArray2<FloatComplex>::transpose(); }
00098 FloatDiagMatrix abs (void) const;
00099
00100 friend OCTAVE_API FloatComplexDiagMatrix conj (const FloatComplexDiagMatrix& a);
00101
00102
00103
00104 FloatComplexMatrix extract (octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2) const;
00105
00106
00107
00108 FloatComplexRowVector row (octave_idx_type i) const;
00109 FloatComplexRowVector row (char *s) const;
00110
00111 FloatComplexColumnVector column (octave_idx_type i) const;
00112 FloatComplexColumnVector column (char *s) const;
00113
00114 FloatComplexDiagMatrix inverse (octave_idx_type& info) const;
00115 FloatComplexDiagMatrix inverse (void) const;
00116 FloatComplexDiagMatrix pseudo_inverse (void) const;
00117
00118 bool all_elements_are_real (void) const;
00119
00120
00121
00122 FloatComplexDiagMatrix& operator += (const FloatDiagMatrix& a);
00123 FloatComplexDiagMatrix& operator -= (const FloatDiagMatrix& a);
00124
00125
00126
00127 FloatComplexColumnVector diag (octave_idx_type k = 0) const
00128 { return MDiagArray2<FloatComplex>::diag (k); }
00129
00130 FloatComplexDET determinant (void) const;
00131 float rcond (void) const;
00132
00133
00134
00135 friend std::ostream& operator << (std::ostream& os, const FloatComplexDiagMatrix& a);
00136
00137 private:
00138
00139 FloatComplexDiagMatrix (FloatComplex *d, octave_idx_type nr, octave_idx_type nc)
00140 : MDiagArray2<FloatComplex> (d, nr, nc) { }
00141 };
00142
00143 OCTAVE_API FloatComplexDiagMatrix conj (const FloatComplexDiagMatrix& a);
00144
00145
00146
00147 OCTAVE_API FloatComplexDiagMatrix
00148 operator * (const FloatComplexDiagMatrix& a, const FloatComplexDiagMatrix& b);
00149
00150 OCTAVE_API FloatComplexDiagMatrix
00151 operator * (const FloatComplexDiagMatrix& a, const FloatDiagMatrix& b);
00152
00153 OCTAVE_API FloatComplexDiagMatrix
00154 operator * (const FloatDiagMatrix& a, const FloatComplexDiagMatrix& b);
00155
00156 MDIAGARRAY2_FORWARD_DEFS (MDiagArray2, FloatComplexDiagMatrix, FloatComplex)
00157
00158 #endif
00159
00160
00161
00162
00163
00164