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
fDiagMatrix.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_fDiagMatrix_h)
24 #define octave_fDiagMatrix_h 1
25 
26 #include "octave-config.h"
27 
28 #include "MDiagArray2.h"
29 
30 #include "fRowVector.h"
31 #include "fColVector.h"
32 #include "DET.h"
33 
34 #include "mx-defs.h"
35 
36 class
37 OCTAVE_API
39 {
40 public:
41 
42  FloatDiagMatrix (void) : MDiagArray2<float> () { }
43 
45  : MDiagArray2<float> (r, c) { }
46 
48  : MDiagArray2<float> (r, c, val) { }
49 
50  FloatDiagMatrix (const FloatDiagMatrix& a) : MDiagArray2<float> (a) { }
51 
52  FloatDiagMatrix (const MDiagArray2<float>& a) : MDiagArray2<float> (a) { }
53 
54  template <typename U>
55  FloatDiagMatrix (const DiagArray2<U>& a) : MDiagArray2<float> (a) { }
56 
57  explicit FloatDiagMatrix (const Array<double>& a) : MDiagArray2<float> (a) { }
58 
60  : MDiagArray2<float> (a, r, c) { }
61 
63  {
65  return *this;
66  }
67 
68  bool operator == (const FloatDiagMatrix& a) const;
69  bool operator != (const FloatDiagMatrix& a) const;
70 
71  FloatDiagMatrix& fill (float val);
77 
79  { return MDiagArray2<float>::transpose (); }
80 
81  FloatDiagMatrix abs (void) const;
82 
83  friend OCTAVE_API FloatDiagMatrix real (const FloatComplexDiagMatrix& a);
84  friend OCTAVE_API FloatDiagMatrix imag (const FloatComplexDiagMatrix& a);
85 
86  // resize is the destructive analog for this one
87 
89  octave_idx_type r2, octave_idx_type c2) const;
90 
91  // extract row or column i.
92 
94  FloatRowVector row (char *s) const;
95 
97  FloatColumnVector column (char *s) const;
98 
99  FloatDiagMatrix inverse (void) const;
100  FloatDiagMatrix inverse (octave_idx_type& info) const;
101  FloatDiagMatrix pseudo_inverse (float tol = 0.0f) const;
102 
103  // other operations
104 
106  { return MDiagArray2<float>::extract_diag (k); }
107 
108  FloatDET determinant (void) const;
109  float rcond (void) const;
110 
111  // i/o
112 
113  friend OCTAVE_API std::ostream& operator << (std::ostream& os,
114  const FloatDiagMatrix& a);
115 
116 };
117 
118 OCTAVE_API FloatDiagMatrix real (const FloatComplexDiagMatrix& a);
119 OCTAVE_API FloatDiagMatrix imag (const FloatComplexDiagMatrix& a);
120 
121 // diagonal matrix by diagonal matrix -> diagonal matrix operations
122 
123 OCTAVE_API FloatDiagMatrix operator * (const FloatDiagMatrix& a,
124  const FloatDiagMatrix& b);
125 
127 
128 #endif
OCTAVE_EXPORT octave_value_list column
Definition: sparse.cc:123
bool operator!=(const dim_vector &a, const dim_vector &b)
Definition: dim-vector.h:567
OCTAVE_API FloatDiagMatrix imag(const FloatComplexDiagMatrix &a)
Definition: fDiagMatrix.cc:139
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
FloatComplexColumnVector & operator=(const FloatComplexColumnVector &a)
Definition: fCColVector.h:65
for large enough k
Definition: lu.cc:606
FloatDiagMatrix(const MDiagArray2< float > &a)
Definition: fDiagMatrix.h:52
OCTAVE_API FloatDiagMatrix real(const FloatComplexDiagMatrix &a)
Definition: fDiagMatrix.cc:133
Array< T > extract_diag(octave_idx_type k=0) const
Definition: DiagArray2.cc:58
FloatDiagMatrix(octave_idx_type r, octave_idx_type c, float val)
Definition: fDiagMatrix.h:47
#define MDIAGARRAY2_FORWARD_DEFS(B, R, T)
Definition: MDiagArray2.h:132
s
Definition: file-io.cc:2682
FloatDiagMatrix(octave_idx_type r, octave_idx_type c)
Definition: fDiagMatrix.h:44
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
FloatDiagMatrix transpose(void) const
Definition: fDiagMatrix.h:78
Definition: DET.h:33
Template for two dimensional diagonal array with math operators.
Definition: MDiagArray2.h:33
FloatDiagMatrix(const Array< float > &a, octave_idx_type r, octave_idx_type c)
Definition: fDiagMatrix.h:59
FloatColumnVector extract_diag(octave_idx_type k=0) const
Definition: fDiagMatrix.h:105
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
bool operator==(const dim_vector &a, const dim_vector &b)
Definition: dim-vector.h:538
FloatDiagMatrix(const DiagArray2< U > &a)
Definition: fDiagMatrix.h:55
FloatDiagMatrix(const FloatDiagMatrix &a)
Definition: fDiagMatrix.h:50
FloatDiagMatrix(const Array< double > &a)
Definition: fDiagMatrix.h:57
=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 > &)
b
Definition: cellfun.cc:398
OCTAVE_API FloatDiagMatrix operator*(const FloatDiagMatrix &a, const FloatDiagMatrix &b)
Definition: fDiagMatrix.cc:281
FloatComplexColumnVector & fill(float val)
Definition: fCColVector.cc:102
FloatDiagMatrix(void)
Definition: fDiagMatrix.h:42
FloatComplexColumnVector extract(octave_idx_type r1, octave_idx_type r2) const
Definition: fCColVector.cc:226
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