Mercurial > hg > octave-nkf
comparison liboctave/dDiagMatrix.h @ 1214:0bf4d2b7def4
[project @ 1995-04-06 02:33:59 by jwe]
author | jwe |
---|---|
date | Thu, 06 Apr 1995 02:35:53 +0000 |
parents | 8302fab9fe24 |
children | f93b7fa5e113 |
comparison
equal
deleted
inserted
replaced
1213:9689615b34f2 | 1214:0bf4d2b7def4 |
---|---|
22 */ | 22 */ |
23 | 23 |
24 #if !defined (octave_DiagMatrix_h) | 24 #if !defined (octave_DiagMatrix_h) |
25 #define octave_DiagMatrix_h 1 | 25 #define octave_DiagMatrix_h 1 |
26 | 26 |
27 #include "Array.h" | 27 #include "MArray.h" |
28 | 28 |
29 #include "dRowVector.h" | 29 #include "dRowVector.h" |
30 #include "dColVector.h" | 30 #include "dColVector.h" |
31 | 31 |
32 #include "mx-defs.h" | 32 #include "mx-defs.h" |
33 | 33 |
34 extern "C++" { | 34 extern "C++" { |
35 | 35 |
36 class DiagMatrix : public DiagArray<double> | 36 class DiagMatrix : public MDiagArray<double> |
37 { | 37 { |
38 friend class SVD; | 38 friend class SVD; |
39 friend class ComplexSVD; | 39 friend class ComplexSVD; |
40 | 40 |
41 public: | 41 public: |
42 | 42 |
43 DiagMatrix (void) : DiagArray<double> () { } | 43 DiagMatrix (void) : MDiagArray<double> () { } |
44 DiagMatrix (int n) : DiagArray<double> (n) { } | 44 DiagMatrix (int n) : MDiagArray<double> (n) { } |
45 DiagMatrix (int n, double val) : DiagArray<double> (n, val) { } | 45 DiagMatrix (int n, double val) : MDiagArray<double> (n, val) { } |
46 DiagMatrix (int r, int c) : DiagArray<double> (r, c) { } | 46 DiagMatrix (int r, int c) : MDiagArray<double> (r, c) { } |
47 DiagMatrix (int r, int c, double val) : DiagArray<double> (r, c, val) { } | 47 DiagMatrix (int r, int c, double val) : MDiagArray<double> (r, c, val) { } |
48 DiagMatrix (const RowVector& a) : DiagArray<double> (a) { } | 48 DiagMatrix (const RowVector& a) : MDiagArray<double> (a) { } |
49 DiagMatrix (const ColumnVector& a) : DiagArray<double> (a) { } | 49 DiagMatrix (const ColumnVector& a) : MDiagArray<double> (a) { } |
50 DiagMatrix (const DiagArray<double>& a) : DiagArray<double> (a) { } | 50 DiagMatrix (const MDiagArray<double>& a) : MDiagArray<double> (a) { } |
51 DiagMatrix (const DiagMatrix& a) : DiagArray<double> (a) { } | 51 DiagMatrix (const DiagMatrix& a) : MDiagArray<double> (a) { } |
52 // DiagMatrix (double a) : DiagArray<double> (1, a) { } | 52 // DiagMatrix (double a) : MDiagArray<double> (1, a) { } |
53 | 53 |
54 DiagMatrix& operator = (const DiagMatrix& a) | 54 DiagMatrix& operator = (const DiagMatrix& a) |
55 { | 55 { |
56 DiagArray<double>::operator = (a); | 56 MDiagArray<double>::operator = (a); |
57 return *this; | 57 return *this; |
58 } | 58 } |
59 | |
60 // operator DiagArray<double>& () const { return *this; } | |
61 | 59 |
62 int operator == (const DiagMatrix& a) const; | 60 int operator == (const DiagMatrix& a) const; |
63 int operator != (const DiagMatrix& a) const; | 61 int operator != (const DiagMatrix& a) const; |
64 | 62 |
65 DiagMatrix& fill (double val); | 63 DiagMatrix& fill (double val); |
106 | 104 |
107 // i/o | 105 // i/o |
108 | 106 |
109 friend ostream& operator << (ostream& os, const DiagMatrix& a); | 107 friend ostream& operator << (ostream& os, const DiagMatrix& a); |
110 | 108 |
111 #define KLUDGE_DIAG_MATRICES | |
112 #define TYPE double | |
113 #define KL_DMAT_TYPE DiagMatrix | |
114 #include "mx-kludge.h" | |
115 #undef KLUDGE_DIAG_MATRICES | |
116 #undef TYPE | |
117 #undef KL_DMAT_TYPE | |
118 | |
119 private: | 109 private: |
120 | 110 |
121 DiagMatrix (double *d, int nr, int nc) : DiagArray<double> (d, nr, nc) { } | 111 DiagMatrix (double *d, int nr, int nc) : MDiagArray<double> (d, nr, nc) { } |
122 }; | 112 }; |
123 | 113 |
124 } // extern "C++" | 114 } // extern "C++" |
125 | 115 |
126 #endif | 116 #endif |