GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
fCDiagMatrix.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1994-2018 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
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License 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 <https://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 "DET.h"
29 #include "MDiagArray2.h"
30 #include "fCColVector.h"
31 #include "fCRowVector.h"
32 #include "fColVector.h"
33 #include "fRowVector.h"
34 #include "mx-defs.h"
35 
36 class
37 OCTAVE_API
39 {
40 public:
41 
43 
44  typedef float real_elt_type;
47 
49 
52  : MDiagArray2<FloatComplex> (r, c) { }
53 
55  const FloatComplex& val)
56  : MDiagArray2<FloatComplex> (r, c, val) { }
57 
59  : MDiagArray2<FloatComplex> (a) { }
60 
63  : MDiagArray2<FloatComplex> (a, r, c) { }
64 
67 
68  explicit FloatComplexDiagMatrix (const FloatDiagMatrix& a);
69 
71  : MDiagArray2<FloatComplex> (a) { }
72 
74  : MDiagArray2<FloatComplex> (a) { }
75 
76  template <typename U>
78  : MDiagArray2<FloatComplex> (a) { }
79 
81  {
83  return *this;
84  }
85 
86  bool operator == (const FloatComplexDiagMatrix& a) const;
87  bool operator != (const FloatComplexDiagMatrix& a) const;
88 
100  octave_idx_type beg);
102  octave_idx_type beg);
105  octave_idx_type beg);
106 
111  FloatDiagMatrix abs (void) const;
112 
113  friend OCTAVE_API FloatComplexDiagMatrix
114  conj (const FloatComplexDiagMatrix& a);
115 
116  // resize is the destructive analog for this one
117 
119  octave_idx_type r2, octave_idx_type c2) const;
120 
121  // extract row or column i
122 
124  FloatComplexRowVector row (char *s) const;
125 
127  FloatComplexColumnVector column (char *s) const;
128 
129  FloatComplexDiagMatrix inverse (octave_idx_type& info) const;
130  FloatComplexDiagMatrix inverse (void) const;
131  FloatComplexDiagMatrix pseudo_inverse (float tol = 0.0f) const;
132 
133  bool all_elements_are_real (void) const;
134 
135  // diagonal matrix by diagonal matrix -> diagonal matrix operations
136 
139 
140  // other operations
141 
144 
145  FloatComplexDET determinant (void) const;
146  float rcond (void) const;
147 
148  // i/o
149 
150  friend std::ostream& operator << (std::ostream& os,
151  const FloatComplexDiagMatrix& a);
152 
153 };
154 
156 
157 // diagonal matrix by diagonal matrix -> diagonal matrix operations
158 
159 OCTAVE_API FloatComplexDiagMatrix
161 
162 OCTAVE_API FloatComplexDiagMatrix
164 
165 OCTAVE_API FloatComplexDiagMatrix
167 
169 
170 #endif
FloatComplexDiagMatrix transpose(void) const
Definition: fCDiagMatrix.h:109
OCTAVE_EXPORT octave_value_list column
Definition: sparse.cc:123
FloatComplexRowVector & fill(float val)
Definition: fCRowVector.cc:96
bool operator!=(const dim_vector &a, const dim_vector &b)
Definition: dim-vector.h:566
FloatComplexRowVector & operator=(const FloatComplexRowVector &a)
Definition: fCRowVector.h:64
identity matrix If supplied two scalar respectively For allows like xample val
Definition: data.cc:4986
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 const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE * f
for large enough k
Definition: lu.cc:617
static T abs(T x)
Definition: pr-output.cc:1696
#define MDIAGARRAY2_FORWARD_DEFS(B, R, T)
Definition: MDiagArray2.h:126
nd example oindent opens the file binary numeric values will be read assuming they are stored in IEEE format with the least significant bit and then converted to the native representation Opening a file that is already open simply opens it again and returns a separate file id It is not an error to open a file several though writing to the same file through several different file ids may produce unexpected results The possible values of text mode reading and writing automatically converts linefeeds to the appropriate line end character for the you may append a you must also open the file in binary mode The parameter conversions are currently only supported for and permissions will be set to and then everything is written in a single operation This is very efficient and improves performance c
Definition: file-io.cc:587
s
Definition: file-io.cc:2729
OCTAVE_API FloatComplexDiagMatrix operator*(const FloatComplexDiagMatrix &a, const FloatComplexDiagMatrix &b)
FloatComplexDiagMatrix(const Array< float > &a)
Definition: fCDiagMatrix.h:65
Template for two dimensional diagonal array with math operators.
Definition: MDiagArray2.h:32
FloatComplexDiagMatrix(const MDiagArray2< FloatComplex > &a)
Definition: fCDiagMatrix.h:70
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:400
FloatComplexDiagMatrix(octave_idx_type r, octave_idx_type c)
Definition: fCDiagMatrix.h:50
FloatComplexColumnVector extract_diag(octave_idx_type k=0) const
Definition: fCDiagMatrix.h:142
FloatComplex element_type
Definition: fCDiagMatrix.h:46
Definition: DET.h:34
ComplexColumnVector operator-=(ComplexColumnVector &x, const Complex &y)
Definition: CColVector.h:150
FloatComplexMatrix full_matrix_type
Definition: fCDiagMatrix.h:42
FloatComplexDiagMatrix(const FloatComplexDiagMatrix &a)
Definition: fCDiagMatrix.h:73
MDiagArray2< T > & operator=(const MDiagArray2< T > &a)
Definition: MDiagArray2.h:77
OCTAVE_API FloatComplexDiagMatrix conj(const FloatComplexDiagMatrix &a)
bool operator==(const dim_vector &a, const dim_vector &b)
Definition: dim-vector.h:550
MDiagArray2< T > transpose(void) const
Definition: MDiagArray2.h:103
ComplexColumnVector operator+=(ComplexColumnVector &x, const Complex &y)
Definition: CColVector.h:150
FloatComplexDiagMatrix(const DiagArray2< U > &a)
Definition: fCDiagMatrix.h:77
Array< T > extract_diag(octave_idx_type k=0) const
Definition: DiagArray2.cc:50
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:54
FloatComplex complex_elt_type
Definition: fCDiagMatrix.h:45
b
Definition: cellfun.cc:400
FloatComplexDiagMatrix(const Array< FloatComplex > &a)
Definition: fCDiagMatrix.h:58
for i
Definition: data.cc:5264
MDiagArray2< T > hermitian(T(*fcn)(const T &)=nullptr) const
Definition: MDiagArray2.h:104
std::complex< float > FloatComplex
Definition: oct-cmplx.h:32
FloatComplexDiagMatrix hermitian(void) const
Definition: fCDiagMatrix.h:107
FloatComplexRowVector extract(octave_idx_type c1, octave_idx_type c2) const
Definition: fCRowVector.cc:213
octave::stream os
Definition: file-io.cc:627
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:61