ARTS  2.4.0(git:4fb77825)
lin_alg.h
Go to the documentation of this file.
1 /* Copyright (C) 2002-2012 Claudia Emde <claudia.emde@dlr.de>
2 
3  This program is free software; you can redistribute it and/or modify it
4  under the terms of the GNU General Public License as published by the
5  Free Software Foundation; either version 2, or (at your option) any
6  later version.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16  USA.
17 */
18 
28 #ifndef linalg_h
29 #define linalg_h
30 
31 #include "complex.h"
32 #include "matpackIII.h"
33 
34 // LU decomposition
35 void ludcmp(Matrix& LU, ArrayOfIndex& indx, ConstMatrixView A);
36 
37 // LU backsubstitution
39  ConstMatrixView LU,
41  const ArrayOfIndex& indx);
42 
43 // Solve linear system
45 
46 // Matrix inverse
47 void inv(MatrixView Ainv, ConstMatrixView A);
48 
49 // Matrix inverse
50 void inv(ComplexMatrixView Ainv, const ConstComplexMatrixView A);
51 
52 // Matrix diagonalization with lapack
54 
55 // Matrix diagonalization with lapack
58  const ConstComplexMatrixView A);
59 
60 // Exponential of a Matrix
61 void matrix_exp(MatrixView F, ConstMatrixView A, const Index& q = 10);
63 void matrix_exp_4x4(MatrixView F, ConstMatrixView A, const Index& q = 10);
65 
66 // Exponential of a Matrix and its partial derivatives.
67 // Includes a specialized function for speedier calculations
69  Tensor3View dF_upp,
70  Tensor3View dF_low,
72  ConstTensor3View dA_upp,
73  ConstTensor3View dA_low,
74  const Index& q = 10);
75 
78 
80  MatrixView F,
81  Tensor3View dF_upp,
82  Tensor3View dF_low,
84  ConstTensor3View dA_upp,
85  ConstTensor3View dA_low);
86 
89 
91  MatrixView F,
92  Tensor3View dF_upp,
93  Tensor3View dF_low,
95  ConstTensor3View dA_upp,
96  ConstTensor3View dA_low);
97 
99  Tensor3View dF_upp,
100  Tensor3View dF_low,
101  ConstMatrixView A,
102  ConstTensor3View dA_upp,
103  ConstTensor3View dA_low,
104  const Index& q = 10);
105 
107  Tensor3View dF,
108  ConstMatrixView A,
109  ConstTensor3View dA,
110  const Index& q = 10);
112  MatrixView dF,
113  ConstMatrixView A,
114  ConstMatrixView dA,
115  const Index& q = 10);
116 
117 // Maximum absolute row sum norm
119 
120 // Identity Matrix
121 void id_mat(MatrixView I);
122 
124 
126 
127 
140 Numeric lsf(VectorView x, ConstMatrixView A, ConstVectorView y, bool residual=true) noexcept;
141 
142 
148 Eigen::ComplexEigenSolver<Eigen::MatrixXcd> eig(const Eigen::Ref<Eigen::MatrixXcd> A);
149 
150 #endif // linalg_h
Matrix
The Matrix class.
Definition: matpackI.h:1193
MatrixView
The MatrixView class.
Definition: matpackI.h:1093
id_mat
void id_mat(MatrixView I)
Identity Matrix.
Definition: lin_alg.cc:2240
solve
void solve(VectorView x, ConstMatrixView A, ConstVectorView b)
Solve a linear system.
Definition: lin_alg.cc:138
linreg
void linreg(Vector &p, ConstVectorView x, ConstVectorView y)
Definition: lin_alg.cc:2302
special_matrix_exp_and_dmatrix_exp_dx_for_rt
void special_matrix_exp_and_dmatrix_exp_dx_for_rt(MatrixView F, Tensor3View dF_upp, Tensor3View dF_low, ConstMatrixView A, ConstTensor3View dA_upp, ConstTensor3View dA_low, const Index &q=10)
Special exponential of a Matrix with their derivatives.
Definition: lin_alg.cc:559
ARTS::Var::y
Vector y(Workspace &ws) noexcept
Definition: autoarts.h:7401
matrix_exp_4x4
void matrix_exp_4x4(MatrixView F, ConstMatrixView A, const Index &q=10)
Definition: lin_alg.cc:481
cayley_hamilton_fitted_method_4x4_propmat_to_transmat__explicit
void cayley_hamilton_fitted_method_4x4_propmat_to_transmat__explicit(MatrixView F, ConstMatrixView A)
Definition: lin_alg.cc:789
lubacksub
void lubacksub(VectorView x, ConstMatrixView LU, ConstVectorView b, const ArrayOfIndex &indx)
LU backsubstitution.
Definition: lin_alg.cc:91
complex.h
A class implementing complex numbers for ARTS.
Tensor3View
The Tensor3View class.
Definition: matpackIII.h:239
Array
This can be used to make arrays out of anything.
Definition: array.h:108
cayley_hamilton_fitted_method_4x4_propmat_to_transmat__eigen
void cayley_hamilton_fitted_method_4x4_propmat_to_transmat__eigen(MatrixView F, ConstMatrixView A)
Definition: lin_alg.cc:963
matrix_exp_dmatrix_exp
void matrix_exp_dmatrix_exp(MatrixView F, Tensor3View dF, ConstMatrixView A, ConstTensor3View dA, const Index &q=10)
General exponential of a Matrix with their derivatives.
Definition: lin_alg.cc:1926
propmat4x4_to_transmat4x4
void propmat4x4_to_transmat4x4(MatrixView F, Tensor3View dF_upp, Tensor3View dF_low, ConstMatrixView A, ConstTensor3View dA_upp, ConstTensor3View dA_low, const Index &q=10)
Definition: lin_alg.cc:1783
det
Numeric det(ConstMatrixView A)
Definition: lin_alg.cc:2256
VectorView
The VectorView class.
Definition: matpackI.h:610
Numeric
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
matpackIII.h
lsf
Numeric lsf(VectorView x, ConstMatrixView A, ConstVectorView y, bool residual=true) noexcept
Least squares fitting by solving x for known A and y.
Definition: lin_alg.cc:2350
ludcmp
void ludcmp(Matrix &LU, ArrayOfIndex &indx, ConstMatrixView A)
LU decomposition.
Definition: lin_alg.cc:56
ConstMatrixView
A constant view of a Matrix.
Definition: matpackI.h:982
ComplexMatrixView
The ComplexMatrixView class.
Definition: complex.h:731
inv
void inv(MatrixView Ainv, ConstMatrixView A)
Matrix Inverse.
Definition: lin_alg.cc:167
q
#define q
Definition: legacy_continua.cc:21712
ConstTensor3View
A constant view of a Tensor3.
Definition: matpackIII.h:132
eig
Eigen::ComplexEigenSolver< Eigen::MatrixXcd > eig(const Eigen::Ref< Eigen::MatrixXcd > A)
Return the Eigen decomposition of the eigen matrix.
Definition: lin_alg.cc:2373
ConstComplexMatrixView
A constant view of a ComplexMatrix.
Definition: complex.h:618
matrix_exp
void matrix_exp(MatrixView F, ConstMatrixView A, const Index &q=10)
General exponential of a Matrix.
Definition: lin_alg.cc:391
ARTS::Var::x
Vector x(Workspace &ws) noexcept
Definition: autoarts.h:7346
matrix_exp2
void matrix_exp2(MatrixView F, ConstMatrixView A)
Definition: lin_alg.cc:458
norm_inf
Numeric norm_inf(ConstMatrixView A)
Maximum absolute row sum norm.
Definition: lin_alg.cc:2223
Index
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
Vector
The Vector class.
Definition: matpackI.h:860
ConstVectorView
A constant view of a Vector.
Definition: matpackI.h:476
ComplexVectorView
The ComplexVectorView class.
Definition: complex.h:367
diagonalize
void diagonalize(MatrixView P, VectorView WR, VectorView WI, ConstMatrixView A)
Matrix Diagonalization.
Definition: lin_alg.cc:245
matrix_exp2_4x4
void matrix_exp2_4x4(MatrixView F, ConstMatrixView A)
Definition: lin_alg.cc:521