GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
fCDiagMatrix.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 1994-2025 The Octave Project Developers
4//
5// See the file COPYRIGHT.md in the top-level directory of this
6// distribution or <https://octave.org/copyright/>.
7//
8// This file is part of Octave.
9//
10// Octave is free software: you can redistribute it and/or modify it
11// under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// Octave is distributed in the hope that it will be useful, but
16// WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU General Public License for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with Octave; see the file COPYING. If not, see
22// <https://www.gnu.org/licenses/>.
23//
24////////////////////////////////////////////////////////////////////////
25
26#if ! defined (octave_fCDiagMatrix_h)
27#define octave_fCDiagMatrix_h 1
28
29#include "octave-config.h"
30
31#include "DET.h"
32#include "MDiagArray2.h"
33#include "fCColVector.h"
34#include "fCRowVector.h"
35#include "fColVector.h"
36#include "fRowVector.h"
37#include "mx-defs.h"
38
39class OCTAVE_API FloatComplexDiagMatrix : public MDiagArray2<FloatComplex>
40{
41public:
42
44
45 typedef float real_elt_type;
48
50
52
54
56
60
64
67
71
74
76
79
80 template <typename U>
83
86
87 OCTAVE_API FloatComplexDiagMatrix& fill (float val);
90 fill (float val, octave_idx_type beg, octave_idx_type end);
92 fill (const FloatComplex& val, octave_idx_type beg, octave_idx_type end);
98 fill (const FloatColumnVector& a, octave_idx_type beg);
100 fill (const FloatComplexColumnVector& a, octave_idx_type beg);
102 fill (const FloatRowVector& a, octave_idx_type beg);
104 fill (const FloatComplexRowVector& a, octave_idx_type beg);
105
111
113 conj (const FloatComplexDiagMatrix& a);
114
115 // resize is the destructive analog for this one
116
118 extract (octave_idx_type r1, octave_idx_type c1,
119 octave_idx_type r2, octave_idx_type c2) const;
120
121 // extract row or column i
122
124 OCTAVE_API FloatComplexRowVector row (char *s) const;
125
127 OCTAVE_API FloatComplexColumnVector column (char *s) const;
128
130 OCTAVE_API FloatComplexDiagMatrix inverse () const;
131 OCTAVE_API FloatComplexDiagMatrix pseudo_inverse (float tol = 0.0f) const;
132
133 OCTAVE_API bool all_elements_are_real () const;
134
135 // diagonal matrix by diagonal matrix -> diagonal matrix operations
136
139
140 // other operations
141
144
145 OCTAVE_API FloatComplexDET determinant () const;
146 OCTAVE_API float rcond () const;
147
148 // i/o
149
150 friend OCTAVE_API std::ostream&
151 operator << (std::ostream& os, const FloatComplexDiagMatrix& a);
152
153};
154
156
157// diagonal matrix by diagonal matrix -> diagonal matrix operations
158
161
164
167
169
170#endif
template std::ostream & operator<<(std::ostream &, const Array< bool > &)
ComplexColumnVector conj(const ComplexColumnVector &a)
ComplexColumnVector operator+=(ComplexColumnVector &x, const Complex &y)
Definition CColVector.h:156
ComplexColumnVector operator-=(ComplexColumnVector &x, const Complex &y)
Definition CColVector.h:156
#define MDIAGARRAY2_FORWARD_DEFS(B, R, T)
N Dimensional Array with copy-on-write semantics.
Definition Array.h:130
Array< T > extract_diag(octave_idx_type k=0) const
Definition DiagArray2.cc:48
FloatComplexDiagMatrix transpose() const
~FloatComplexDiagMatrix()=default
FloatComplex element_type
FloatComplexDiagMatrix(const Array< float > &a)
FloatComplexColumnVector extract_diag(octave_idx_type k=0) const
FloatComplexDiagMatrix(octave_idx_type r, octave_idx_type c)
FloatComplexDiagMatrix(const FloatComplexDiagMatrix &a)=default
FloatComplexDiagMatrix(const Array< FloatComplex > &a, octave_idx_type r, octave_idx_type c)
FloatComplexDiagMatrix hermitian() const
FloatComplex complex_elt_type
FloatComplexDiagMatrix(const MDiagArray2< FloatComplex > &a)
FloatComplexDiagMatrix(const DiagArray2< U > &a)
FloatComplexMatrix full_matrix_type
FloatComplexDiagMatrix(const Array< FloatComplex > &a)
FloatComplexDiagMatrix(octave_idx_type r, octave_idx_type c, const FloatComplex &val)
FloatComplexDiagMatrix()=default
Template for two dimensional diagonal array with math operators.
Definition MDiagArray2.h:54
MDiagArray2< T > & operator=(const MDiagArray2< T > &a)
Definition MDiagArray2.h:78
MDiagArray2< T > hermitian(T(*fcn)(const T &)=nullptr) const
MDiagArray2< T > transpose() const
Definition DET.h:38
bool operator!=(const dim_vector &a, const dim_vector &b)
Definition dim-vector.h:532
bool operator==(const dim_vector &a, const dim_vector &b)
Definition dim-vector.h:516
FloatComplexDiagMatrix conj(const FloatComplexDiagMatrix &a)
FloatComplexDiagMatrix operator*(const FloatComplexDiagMatrix &a, const FloatComplexDiagMatrix &b)
#define OCTAVE_API
Definition main.in.cc:55
std::complex< float > FloatComplex
Definition oct-cmplx.h:34
template int8_t abs(int8_t)