GNU Octave  4.2.1
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-2017 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 "octave-config.h"
27 
28 #include "MDiagArray2.h"
29 
30 #include "fRowVector.h"
31 #include "fCRowVector.h"
32 #include "fColVector.h"
33 #include "fCColVector.h"
34 #include "DET.h"
35 
36 #include "mx-defs.h"
37 
38 class
39 OCTAVE_API
41 {
42 public:
43 
45 
48  : MDiagArray2<FloatComplex> (r, c) { }
49 
51  const FloatComplex& val)
52  : MDiagArray2<FloatComplex> (r, c, val) { }
53 
55  : MDiagArray2<FloatComplex> (a) { }
56 
59  : MDiagArray2<FloatComplex> (a, r, c) { }
60 
63 
64  explicit FloatComplexDiagMatrix (const FloatDiagMatrix& a);
65 
67  : MDiagArray2<FloatComplex> (a) { }
68 
70  : MDiagArray2<FloatComplex> (a) { }
71 
72  template <typename U>
74  : MDiagArray2<FloatComplex> (a) { }
75 
77  {
79  return *this;
80  }
81 
82  bool operator == (const FloatComplexDiagMatrix& a) const;
83  bool operator != (const FloatComplexDiagMatrix& a) const;
84 
96  octave_idx_type beg);
98  octave_idx_type beg);
101  octave_idx_type beg);
102 
107  FloatDiagMatrix abs (void) const;
108 
109  friend OCTAVE_API FloatComplexDiagMatrix
110  conj (const FloatComplexDiagMatrix& a);
111 
112  // resize is the destructive analog for this one
113 
115  octave_idx_type r2, octave_idx_type c2) const;
116 
117  // extract row or column i
118 
120  FloatComplexRowVector row (char *s) const;
121 
123  FloatComplexColumnVector column (char *s) const;
124 
125  FloatComplexDiagMatrix inverse (octave_idx_type& info) const;
126  FloatComplexDiagMatrix inverse (void) const;
127  FloatComplexDiagMatrix pseudo_inverse (float tol = 0.0f) const;
128 
129  bool all_elements_are_real (void) const;
130 
131  // diagonal matrix by diagonal matrix -> diagonal matrix operations
132 
135 
136  // other operations
137 
140 
141  FloatComplexDET determinant (void) const;
142  float rcond (void) const;
143 
144  // i/o
145 
146  friend std::ostream& operator << (std::ostream& os,
147  const FloatComplexDiagMatrix& a);
148 
149 };
150 
152 
153 // diagonal matrix by diagonal matrix -> diagonal matrix operations
154 
155 OCTAVE_API FloatComplexDiagMatrix
157 
158 OCTAVE_API FloatComplexDiagMatrix
160 
161 OCTAVE_API FloatComplexDiagMatrix
163 
165 
166 #endif
FloatComplexDiagMatrix hermitian(void) const
Definition: fCDiagMatrix.h:103
MDiagArray2< T > hermitian(T(*fcn)(const T &)=0) const
Definition: MDiagArray2.h:110
OCTAVE_EXPORT octave_value_list column
Definition: sparse.cc:123
FloatComplexRowVector & fill(float val)
Definition: fCRowVector.cc:97
bool operator!=(const dim_vector &a, const dim_vector &b)
Definition: dim-vector.h:567
FloatComplexRowVector & operator=(const FloatComplexRowVector &a)
Definition: fCRowVector.h:65
identity matrix If supplied two scalar respectively For allows like xample val
Definition: data.cc:5068
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE const F77_DBLE * f
MDiagArray2< T > & operator=(const MDiagArray2< T > &a)
Definition: MDiagArray2.h:78
for large enough k
Definition: lu.cc:606
Array< T > extract_diag(octave_idx_type k=0) const
Definition: DiagArray2.cc:58
#define MDIAGARRAY2_FORWARD_DEFS(B, R, T)
Definition: MDiagArray2.h:132
s
Definition: file-io.cc:2682
OCTAVE_API FloatComplexDiagMatrix operator*(const FloatComplexDiagMatrix &a, const FloatComplexDiagMatrix &b)
FloatComplexDiagMatrix(const Array< float > &a)
Definition: fCDiagMatrix.h:61
FloatComplexDiagMatrix(const MDiagArray2< FloatComplex > &a)
Definition: fCDiagMatrix.h:66
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
Definition: cellfun.cc:398
FloatComplexDiagMatrix(octave_idx_type r, octave_idx_type c)
Definition: fCDiagMatrix.h:46
FloatComplexRowVector extract(octave_idx_type c1, octave_idx_type c2) const
Definition: fCRowVector.cc:214
Definition: DET.h:33
ComplexColumnVector operator-=(ComplexColumnVector &x, const Complex &y)
Definition: CColVector.h:151
the sparsity preserving column transformation such that that defines the pivoting threshold can be given in which case it defines the c
Definition: lu.cc:138
FloatComplexColumnVector extract_diag(octave_idx_type k=0) const
Definition: fCDiagMatrix.h:138
FloatComplexDiagMatrix(const FloatComplexDiagMatrix &a)
Definition: fCDiagMatrix.h:69
OCTAVE_API FloatComplexDiagMatrix conj(const FloatComplexDiagMatrix &a)
bool operator==(const dim_vector &a, const dim_vector &b)
Definition: dim-vector.h:538
ComplexColumnVector operator+=(ComplexColumnVector &x, const Complex &y)
Definition: CColVector.h:151
FloatComplexDiagMatrix(const DiagArray2< U > &a)
Definition: fCDiagMatrix.h:73
=val(i)}if ode{val(i)}occurs in table i
Definition: lookup.cc:239
OCTAVE_EXPORT octave_value_list return the value of the option it must match the dimension of the state and the relative tolerance must also be a vector of the same length tem it must match the dimension of the state and the absolute tolerance must also be a vector of the same length The local error test applied at each integration step is xample roup abs(local error in x(i))<
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:50
b
Definition: cellfun.cc:398
FloatComplexDiagMatrix(const Array< FloatComplex > &a)
Definition: fCDiagMatrix.h:54
std::complex< float > FloatComplex
Definition: oct-cmplx.h:32
FloatComplexDiagMatrix transpose(void) const
Definition: fCDiagMatrix.h:105
MDiagArray2< T > transpose(void) const
Definition: MDiagArray2.h:109
where the brackets indicate optional arguments and and character or cell array For character arrays the conversion is repeated for every row
Definition: str2double.cc:342
FloatComplexDiagMatrix(const Array< FloatComplex > &a, octave_idx_type r, octave_idx_type c)
Definition: fCDiagMatrix.h:57