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
dDiagMatrix.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_dDiagMatrix_h)
24
#define octave_dDiagMatrix_h 1
25
26
#include "
MDiagArray2.h
"
27
28
#include "
dRowVector.h
"
29
#include "
dColVector.h
"
30
#include "
DET.h
"
31
32
#include "
mx-defs.h
"
33
34
class
35
OCTAVE_API
36
DiagMatrix
:
public
MDiagArray2<double>
37
{
38
friend
class
SVD
;
39
friend
class
ComplexSVD
;
40
41
public
:
42
43
DiagMatrix
(
void
) :
MDiagArray2
<
double
> () { }
44
45
DiagMatrix
(
octave_idx_type
r,
octave_idx_type
c)
46
:
MDiagArray2
<
double
> (r, c) { }
47
48
DiagMatrix
(
octave_idx_type
r,
octave_idx_type
c,
double
val)
49
:
MDiagArray2
<
double
> (r, c, val) { }
50
51
DiagMatrix
(
const
DiagMatrix
& a) :
MDiagArray2
<
double
> (a) { }
52
53
DiagMatrix
(
const
MDiagArray2<double>
& a) :
MDiagArray2
<
double
> (a) { }
54
55
template
<
class
U>
56
DiagMatrix
(
const
DiagArray2<U>
& a) :
MDiagArray2
<
double
> (a) { }
57
58
explicit
DiagMatrix
(
const
Array<double>
& a) :
MDiagArray2
<
double
> (a) { }
59
60
DiagMatrix
(
const
Array<double>
& a,
octave_idx_type
r,
octave_idx_type
c)
61
:
MDiagArray2
<
double
> (a, r, c) { }
62
63
DiagMatrix
&
operator =
(
const
DiagMatrix
& a)
64
{
65
MDiagArray2<double>::operator =
(a);
66
return
*
this
;
67
}
68
69
bool
operator ==
(
const
DiagMatrix
& a)
const
;
70
bool
operator !=
(
const
DiagMatrix
& a)
const
;
71
72
DiagMatrix
& fill (
double
val);
73
DiagMatrix
& fill (
double
val,
octave_idx_type
beg,
octave_idx_type
end);
74
DiagMatrix
& fill (
const
ColumnVector
& a);
75
DiagMatrix
& fill (
const
RowVector
& a);
76
DiagMatrix
& fill (
const
ColumnVector
& a,
octave_idx_type
beg);
77
DiagMatrix
& fill (
const
RowVector
& a,
octave_idx_type
beg);
78
79
DiagMatrix
transpose
(
void
)
const
80
{
return
MDiagArray2<double>::transpose
(); }
81
DiagMatrix
abs
(
void
)
const
;
82
83
friend
OCTAVE_API
DiagMatrix
real
(
const
ComplexDiagMatrix
& a);
84
friend
OCTAVE_API
DiagMatrix
imag
(
const
ComplexDiagMatrix
& a);
85
86
// resize is the destructive analog for this one
87
88
Matrix
extract (
octave_idx_type
r1
,
octave_idx_type
c1
,
89
octave_idx_type
r2
,
octave_idx_type
c2)
const
;
90
91
// extract row or column i.
92
93
RowVector
row (
octave_idx_type
i)
const
;
94
RowVector
row (
char
*s)
const
;
95
96
ColumnVector
column (
octave_idx_type
i)
const
;
97
ColumnVector
column (
char
*s)
const
;
98
99
DiagMatrix
inverse (
void
)
const
;
100
DiagMatrix
inverse (
octave_idx_type
& info)
const
;
101
DiagMatrix
pseudo_inverse (
void
)
const
;
102
103
// other operations
104
105
ColumnVector
extract_diag (
octave_idx_type
k = 0)
const
106
{
return
MDiagArray2<double>::extract_diag
(k); }
107
108
DET
determinant (
void
)
const
;
109
double
rcond (
void
)
const
;
110
111
// i/o
112
113
friend
OCTAVE_API std::ostream&
operator <<
(std::ostream& os,
114
const
DiagMatrix
& a);
115
116
};
117
118
OCTAVE_API
DiagMatrix
real
(
const
ComplexDiagMatrix
& a);
119
OCTAVE_API
DiagMatrix
imag
(
const
ComplexDiagMatrix
& a);
120
121
// diagonal matrix by diagonal matrix -> diagonal matrix operations
122
123
OCTAVE_API
DiagMatrix
124
operator *
(
const
DiagMatrix
& a,
const
DiagMatrix
& b);
125
126
MDIAGARRAY2_FORWARD_DEFS
(
MDiagArray2
,
DiagMatrix
,
double
)
127
128
#endif
Generated on Mon Dec 30 2013 03:04:41 for GNU Octave by
1.8.1.2