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