GNU Octave  3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
fCDiagMatrix.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1994-2013 John W. Eaton
4 
5 This file is part of Octave.
6 
7 Octave is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if !defined (octave_fCDiagMatrix_h)
24 #define octave_fCDiagMatrix_h 1
25 
26 #include "MDiagArray2.h"
27 
28 #include "fRowVector.h"
29 #include "fCRowVector.h"
30 #include "fColVector.h"
31 #include "fCColVector.h"
32 #include "DET.h"
33 
34 #include "mx-defs.h"
35 
36 class
37 OCTAVE_API
39 {
40 public:
41 
43 
46  : MDiagArray2<FloatComplex> (r, c) { }
47 
49  const FloatComplex& val)
50  : MDiagArray2<FloatComplex> (r, c, val) { }
51 
53  : MDiagArray2<FloatComplex> (a) { }
54 
57  : MDiagArray2<FloatComplex> (a, r, c) { }
58 
61 
62  explicit FloatComplexDiagMatrix (const FloatDiagMatrix& a);
63 
65  : MDiagArray2<FloatComplex> (a) { }
66 
68  : MDiagArray2<FloatComplex> (a) { }
69 
70  template <class U>
72  : MDiagArray2<FloatComplex> (a) { }
73 
75  {
77  return *this;
78  }
79 
80  bool operator == (const FloatComplexDiagMatrix& a) const;
81  bool operator != (const FloatComplexDiagMatrix& a) const;
82 
83  FloatComplexDiagMatrix& fill (float val);
85  FloatComplexDiagMatrix& fill (float val,
94  octave_idx_type beg);
96  octave_idx_type beg);
99  octave_idx_type beg);
100 
105  FloatDiagMatrix abs (void) const;
106 
107  friend OCTAVE_API FloatComplexDiagMatrix
108  conj (const FloatComplexDiagMatrix& a);
109 
110  // resize is the destructive analog for this one
111 
114 
115  // extract row or column i
116 
118  FloatComplexRowVector row (char *s) const;
119 
121  FloatComplexColumnVector column (char *s) const;
122 
123  FloatComplexDiagMatrix inverse (octave_idx_type& info) const;
124  FloatComplexDiagMatrix inverse (void) const;
125  FloatComplexDiagMatrix pseudo_inverse (void) const;
126 
127  bool all_elements_are_real (void) const;
128 
129  // diagonal matrix by diagonal matrix -> diagonal matrix operations
130 
133 
134  // other operations
135 
136  FloatComplexColumnVector extract_diag (octave_idx_type k = 0) const
138 
139  FloatComplexDET determinant (void) const;
140  float rcond (void) const;
141 
142  // i/o
143 
144  friend std::ostream& operator << (std::ostream& os,
145  const FloatComplexDiagMatrix& a);
146 
147 };
148 
150 
151 // diagonal matrix by diagonal matrix -> diagonal matrix operations
152 
153 OCTAVE_API FloatComplexDiagMatrix
155 
156 OCTAVE_API FloatComplexDiagMatrix
158 
159 OCTAVE_API FloatComplexDiagMatrix
161 
163 
164 #endif