GNU Octave
3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
liboctave
array
CDiagMatrix.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_CDiagMatrix_h)
24
#define octave_CDiagMatrix_h 1
25
26
#include "
MDiagArray2.h
"
27
28
#include "
dRowVector.h
"
29
#include "
CRowVector.h
"
30
#include "
dColVector.h
"
31
#include "
CColVector.h
"
32
#include "
DET.h
"
33
34
#include "
mx-defs.h
"
35
36
class
37
OCTAVE_API
38
ComplexDiagMatrix
:
public
MDiagArray2<Complex>
39
{
40
public
:
41
42
ComplexDiagMatrix
(
void
) :
MDiagArray2
<
Complex
> () { }
43
44
ComplexDiagMatrix
(
octave_idx_type
r,
octave_idx_type
c)
45
:
MDiagArray2
<
Complex
> (r, c) { }
46
47
ComplexDiagMatrix
(
octave_idx_type
r,
octave_idx_type
c,
const
Complex
& val)
48
:
MDiagArray2
<
Complex
> (r, c, val) { }
49
50
explicit
ComplexDiagMatrix
(
const
Array<Complex>
& a)
51
:
MDiagArray2
<
Complex
> (a) { }
52
53
explicit
ComplexDiagMatrix
(
const
Array<double>
& a)
54
:
MDiagArray2
<
Complex
> (
Array
<
Complex
> (a)) { }
55
56
ComplexDiagMatrix
(
const
Array<Complex>
& a,
octave_idx_type
r,
57
octave_idx_type
c)
58
:
MDiagArray2
<
Complex
> (a, r, c) { }
59
60
explicit
ComplexDiagMatrix
(
const
DiagMatrix
& a);
61
62
ComplexDiagMatrix
(
const
MDiagArray2<Complex>
& a)
63
:
MDiagArray2
<
Complex
> (a) { }
64
65
ComplexDiagMatrix
(
const
ComplexDiagMatrix
& a)
66
:
MDiagArray2
<
Complex
> (a) { }
67
68
template
<
class
U>
69
ComplexDiagMatrix
(
const
DiagArray2<U>
& a)
70
:
MDiagArray2
<
Complex
> (a) { }
71
72
ComplexDiagMatrix
&
operator =
(
const
ComplexDiagMatrix
& a)
73
{
74
MDiagArray2<Complex>::operator =
(a);
75
return
*
this
;
76
}
77
78
bool
operator ==
(
const
ComplexDiagMatrix
& a)
const
;
79
bool
operator !=
(
const
ComplexDiagMatrix
& a)
const
;
80
81
ComplexDiagMatrix
&
fill
(
double
val);
82
ComplexDiagMatrix
&
fill
(
const
Complex
& val);
83
ComplexDiagMatrix
&
fill
(
double
val,
84
octave_idx_type
beg,
octave_idx_type
end);
85
ComplexDiagMatrix
&
fill
(
const
Complex
& val,
86
octave_idx_type
beg,
octave_idx_type
end);
87
ComplexDiagMatrix
&
fill
(
const
ColumnVector
& a);
88
ComplexDiagMatrix
&
fill
(
const
ComplexColumnVector
& a);
89
ComplexDiagMatrix
&
fill
(
const
RowVector
& a);
90
ComplexDiagMatrix
&
fill
(
const
ComplexRowVector
& a);
91
ComplexDiagMatrix
&
fill
(
const
ColumnVector
& a,
octave_idx_type
beg);
92
ComplexDiagMatrix
&
fill
(
const
ComplexColumnVector
& a,
octave_idx_type
beg);
93
ComplexDiagMatrix
&
fill
(
const
RowVector
& a,
octave_idx_type
beg);
94
ComplexDiagMatrix
&
fill
(
const
ComplexRowVector
& a,
octave_idx_type
beg);
95
96
ComplexDiagMatrix
hermitian
(
void
)
const
97
{
return
MDiagArray2<Complex>::hermitian
(
std::conj
); }
98
ComplexDiagMatrix
transpose
(
void
)
const
99
{
return
MDiagArray2<Complex>::transpose
(); }
100
DiagMatrix
abs
(
void
)
const
;
101
102
friend
OCTAVE_API
ComplexDiagMatrix
conj
(
const
ComplexDiagMatrix
& a);
103
104
// resize is the destructive analog for this one
105
106
ComplexMatrix
extract
(
octave_idx_type
r1
,
octave_idx_type
c1
,
107
octave_idx_type
r2
,
octave_idx_type
c2)
const
;
108
109
// extract row or column i
110
111
ComplexRowVector
row (
octave_idx_type
i)
const
;
112
ComplexRowVector
row (
char
*s)
const
;
113
114
ComplexColumnVector
column
(
octave_idx_type
i)
const
;
115
ComplexColumnVector
column
(
char
*s)
const
;
116
117
ComplexDiagMatrix
inverse (
octave_idx_type
& info)
const
;
118
ComplexDiagMatrix
inverse (
void
)
const
;
119
ComplexDiagMatrix
pseudo_inverse (
void
)
const
;
120
121
bool
all_elements_are_real (
void
)
const
;
122
123
// diagonal matrix by diagonal matrix -> diagonal matrix operations
124
125
ComplexDiagMatrix
&
operator +=
(
const
DiagMatrix
& a);
126
ComplexDiagMatrix
&
operator -=
(
const
DiagMatrix
& a);
127
128
// other operations
129
130
ComplexColumnVector
extract_diag (
octave_idx_type
k = 0)
const
131
{
return
MDiagArray2<Complex>::extract_diag
(k); }
132
133
ComplexDET
determinant (
void
)
const
;
134
double
rcond (
void
)
const
;
135
136
// i/o
137
138
friend
std::ostream&
operator <<
(std::ostream& os,
139
const
ComplexDiagMatrix
& a);
140
141
};
142
143
OCTAVE_API
ComplexDiagMatrix
conj
(
const
ComplexDiagMatrix
& a);
144
145
// diagonal matrix by diagonal matrix -> diagonal matrix operations
146
147
OCTAVE_API
ComplexDiagMatrix
148
operator *
(
const
ComplexDiagMatrix
& a,
const
ComplexDiagMatrix
& b);
149
150
OCTAVE_API
ComplexDiagMatrix
151
operator *
(
const
ComplexDiagMatrix
& a,
const
DiagMatrix
& b);
152
153
OCTAVE_API
ComplexDiagMatrix
154
operator *
(
const
DiagMatrix
& a,
const
ComplexDiagMatrix
& b);
155
156
MDIAGARRAY2_FORWARD_DEFS
(
MDiagArray2
,
ComplexDiagMatrix
,
Complex
)
157
158
#endif
Generated on Mon Dec 30 2013 03:04:39 for GNU Octave by
1.8.1.2