GNU Octave  4.0.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-2015 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 (float tol = 0.0f) 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 
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
FloatComplexDiagMatrix hermitian(void) const
Definition: fCDiagMatrix.h:101
MDiagArray2< T > hermitian(T(*fcn)(const T &)=0) const
Definition: MDiagArray2.h:98
FloatComplexRowVector & fill(float val)
Definition: fCRowVector.cc:122
bool operator!=(const dim_vector &a, const dim_vector &b)
Definition: dim-vector.h:548
FloatComplexRowVector & operator=(const FloatComplexRowVector &a)
Definition: fCRowVector.h:63
MDiagArray2< T > & operator=(const MDiagArray2< T > &a)
Definition: MDiagArray2.h:66
Array< T > extract_diag(octave_idx_type k=0) const
Definition: DiagArray2.cc:58
OCTAVE_API FloatComplexDiagMatrix operator*(const FloatComplexDiagMatrix &a, const FloatComplexDiagMatrix &b)
FloatComplexDiagMatrix(const Array< float > &a)
Definition: fCDiagMatrix.h:59
FloatComplexDiagMatrix(const MDiagArray2< FloatComplex > &a)
Definition: fCDiagMatrix.h:64
static MArray< double > const octave_idx_type const octave_idx_type octave_idx_type octave_idx_type r2
FloatComplexDiagMatrix(octave_idx_type r, octave_idx_type c)
Definition: fCDiagMatrix.h:44
FloatComplexRowVector extract(octave_idx_type c1, octave_idx_type c2) const
Definition: fCRowVector.cc:245
F77_RET_T const double const double * f
#define MDIAGARRAY2_FORWARD_DEFS(B, R, T)
Definition: MArray-decl.h:256
Definition: DET.h:31
ComplexColumnVector operator-=(ComplexColumnVector &x, const Complex &y)
Definition: CColVector.h:149
Array< FloatComplex > column(octave_idx_type k) const
Extract column: A(:,k+1).
FloatComplexColumnVector extract_diag(octave_idx_type k=0) const
Definition: fCDiagMatrix.h:136
FloatComplexDiagMatrix(const FloatComplexDiagMatrix &a)
Definition: fCDiagMatrix.h:67
OCTAVE_API FloatComplexDiagMatrix conj(const FloatComplexDiagMatrix &a)
bool operator==(const dim_vector &a, const dim_vector &b)
Definition: dim-vector.h:519
ComplexColumnVector operator+=(ComplexColumnVector &x, const Complex &y)
Definition: CColVector.h:149
FloatComplexDiagMatrix(const DiagArray2< U > &a)
Definition: fCDiagMatrix.h:71
template OCTAVE_API std::ostream & operator<<(std::ostream &, const Array< bool > &)
FloatComplexDiagMatrix(octave_idx_type r, octave_idx_type c, const FloatComplex &val)
Definition: fCDiagMatrix.h:48
FloatComplexDiagMatrix(const Array< FloatComplex > &a)
Definition: fCDiagMatrix.h:52
std::complex< float > FloatComplex
Definition: oct-cmplx.h:30
static MArray< double > const octave_idx_type const octave_idx_type octave_idx_type octave_idx_type octave_idx_type c1
static MArray< double > const octave_idx_type const octave_idx_type octave_idx_type r1
FloatComplexDiagMatrix transpose(void) const
Definition: fCDiagMatrix.h:103
MDiagArray2< T > transpose(void) const
Definition: MDiagArray2.h:97
T abs(T x)
Definition: pr-output.cc:3062
FloatComplexDiagMatrix(const Array< FloatComplex > &a, octave_idx_type r, octave_idx_type c)
Definition: fCDiagMatrix.h:55