ARTS  2.4.0(git:4fb77825)
TransmissionMatrix Class Reference

Class to keep track of Transmission Matrices for Stokes Dim 1-4. More...

#include <transmissionmatrix.h>

Classes

struct  Weights
 Struct of far and close weights. More...
 

Public Member Functions

 TransmissionMatrix (Index nf=0, Index stokes=1)
 Construct a new Transmission Matrix object. More...
 
 TransmissionMatrix (TransmissionMatrix &&tm) noexcept
 Construct a new Transmission Matrix object. More...
 
 TransmissionMatrix (const TransmissionMatrix &tm)=default
 Construct a new Transmission Matrix object. More...
 
TransmissionMatrixoperator= (const TransmissionMatrix &tm)=default
 Assignment operator. More...
 
TransmissionMatrixoperator= (TransmissionMatrix &&tm) noexcept
 Move operator. More...
 
 TransmissionMatrix (const PropagationMatrix &pm, const Numeric &r=1.0)
 Construct a new Transmission Matrix from a Propagation Matrix. More...
 
 operator Tensor3 () const
 
const Eigen::Matrix4d & Mat4 (size_t i) const
 Get Matrix at position. More...
 
const Eigen::Matrix3d & Mat3 (size_t i) const
 Get Matrix at position. More...
 
const Eigen::Matrix2d & Mat2 (size_t i) const
 Get Matrix at position. More...
 
const Eigen::Matrix< double, 1, 1 > & Mat1 (size_t i) const
 Get Matrix at position. More...
 
Eigen::MatrixXd Mat (size_t i) const
 Get Matrix at position by copy. More...
 
Eigen::Matrix4d & Mat4 (size_t i)
 Get Matrix at position. More...
 
Eigen::Matrix3d & Mat3 (size_t i)
 Get Matrix at position. More...
 
Eigen::Matrix2d & Mat2 (size_t i)
 Get Matrix at position. More...
 
Eigen::Matrix< double, 1, 1 > & Mat1 (size_t i)
 Get Matrix at position. More...
 
void setIdentity ()
 Set to identity matrix. More...
 
void setZero ()
 Set to zero matrix. More...
 
void mul (const TransmissionMatrix &A, const TransmissionMatrix &B)
 Set this to a multiple of A by B. More...
 
void mul_aliased (const TransmissionMatrix &A, const TransmissionMatrix &B)
 Set this to a multiple of A by B. More...
 
Numeric operator() (const Index i, const Index j, const Index k) const
 Access value in matrix. More...
 
Index StokesDim () const
 Stokes dimensionaility. More...
 
Index Frequencies () const
 Number of frequencies. More...
 
TransmissionMatrixoperator+= (const LazyScale< TransmissionMatrix > &lstm)
 Assign to *this lazily. More...
 
TransmissionMatrixoperator*= (const Numeric &scale)
 Scale self. More...
 
TransmissionMatrixoperator= (const LazyScale< TransmissionMatrix > &lstm)
 Assign lazily. More...
 
template<size_t N>
Weights< Nlinear_in_tau_weights (size_t) const noexcept
 
template<>
TransmissionMatrix::Weights< 1 > linear_in_tau_weights (size_t i) const noexcept
 

Private Attributes

Index stokes_dim
 
std::vector< Eigen::Matrix4d, Eigen::aligned_allocator< Eigen::Matrix4d > > T4
 
std::vector< Eigen::Matrix3d, Eigen::aligned_allocator< Eigen::Matrix3d > > T3
 
std::vector< Eigen::Matrix2d, Eigen::aligned_allocator< Eigen::Matrix2d > > T2
 
std::vector< Eigen::Matrix< double, 1, 1 >, Eigen::aligned_allocator< Eigen::Matrix< double, 1, 1 > > > T1
 

Friends

std::ostream & operator<< (std::ostream &os, const TransmissionMatrix &tm)
 Output operator. More...
 
std::istream & operator>> (std::istream &data, TransmissionMatrix &tm)
 Input operator. More...
 

Detailed Description

Class to keep track of Transmission Matrices for Stokes Dim 1-4.

Definition at line 38 of file transmissionmatrix.h.

Constructor & Destructor Documentation

◆ TransmissionMatrix() [1/4]

TransmissionMatrix::TransmissionMatrix ( Index  nf = 0,
Index  stokes = 1 
)
inline

Construct a new Transmission Matrix object.

Parameters
[in]nfNumber of frequencies
[in]stokesStokes dimension

Definition at line 55 of file transmissionmatrix.h.

Referenced by TransmissionMatrix().

◆ TransmissionMatrix() [2/4]

TransmissionMatrix::TransmissionMatrix ( TransmissionMatrix &&  tm)
inlinenoexcept

Construct a new Transmission Matrix object.

Parameters
[in]tmMatrix to move from

Definition at line 68 of file transmissionmatrix.h.

◆ TransmissionMatrix() [3/4]

TransmissionMatrix::TransmissionMatrix ( const TransmissionMatrix tm)
default

Construct a new Transmission Matrix object.

Parameters
[in]tmmatrix to copy

◆ TransmissionMatrix() [4/4]

TransmissionMatrix::TransmissionMatrix ( const PropagationMatrix pm,
const Numeric r = 1.0 
)
explicit

Construct a new Transmission Matrix from a Propagation Matrix.

Parameters
[in]pmPropagation Matrix
[in]rDistance

Definition at line 1868 of file transmissionmatrix.cc.

References PropagationMatrix::NumberOfFrequencies(), PropagationMatrix::StokesDimensions(), transmat(), and TransmissionMatrix().

Member Function Documentation

◆ Frequencies()

Index TransmissionMatrix::Frequencies ( ) const
inline

Number of frequencies.

Definition at line 268 of file transmissionmatrix.h.

References stokes_dim, T1, T2, T3, and T4.

Referenced by operator Tensor3(), and xml_write_to_stream().

◆ linear_in_tau_weights() [1/2]

template<>
TransmissionMatrix::Weights< 4 > TransmissionMatrix::linear_in_tau_weights ( size_t  i) const
inlinenoexcept

Definition at line 348 of file transmissionmatrix.h.

◆ linear_in_tau_weights() [2/2]

template<size_t N>
Weights<N> TransmissionMatrix::linear_in_tau_weights ( size_t  ) const
inlinenoexcept

Return the weights of far and close for a given frequency for linear in tau expression:

\[ far = \frac{1-\left(1+\log{T_{00}}\right) T}{\log{T_{00}}} \]

\[ close = \frac{\log{T_{00}} - 1 + T}{\log{T_{00}}} \]

Parameters
[in]iIndex of frequency
Returns
Linear Weights

Definition at line 342 of file transmissionmatrix.h.

References N.

Referenced by RadiationVector::add_weighted().

◆ Mat()

Eigen::MatrixXd TransmissionMatrix::Mat ( size_t  i) const
inline

Get Matrix at position by copy.

Parameters
[in]iPosition
Returns
Right size

Definition at line 157 of file transmissionmatrix.h.

References Mat1(), Mat2(), Mat3(), Mat4(), and stokes_dim.

◆ Mat1() [1/2]

Eigen::Matrix<double, 1, 1>& TransmissionMatrix::Mat1 ( size_t  i)
inline

Get Matrix at position.

Parameters
[in]iPosition
Returns
Eigen::Matrix<double, 1, 1>& Matrix

Definition at line 197 of file transmissionmatrix.h.

References T1.

◆ Mat1() [2/2]

const Eigen::Matrix<double, 1, 1>& TransmissionMatrix::Mat1 ( size_t  i) const
inline

◆ Mat2() [1/2]

Eigen::Matrix2d& TransmissionMatrix::Mat2 ( size_t  i)
inline

Get Matrix at position.

Parameters
[in]iPosition
Returns
Eigen::Matrix42& Matrix

Definition at line 190 of file transmissionmatrix.h.

References T2.

◆ Mat2() [2/2]

const Eigen::Matrix2d& TransmissionMatrix::Mat2 ( size_t  i) const
inline

◆ Mat3() [1/2]

Eigen::Matrix3d& TransmissionMatrix::Mat3 ( size_t  i)
inline

Get Matrix at position.

Parameters
[in]iPosition
Returns
Eigen::Matrix3d& Matrix

Definition at line 183 of file transmissionmatrix.h.

References T3.

◆ Mat3() [2/2]

const Eigen::Matrix3d& TransmissionMatrix::Mat3 ( size_t  i) const
inline

◆ Mat4() [1/2]

Eigen::Matrix4d& TransmissionMatrix::Mat4 ( size_t  i)
inline

Get Matrix at position.

Parameters
[in]

Definition at line 176 of file transmissionmatrix.h.

References T4.

◆ Mat4() [2/2]

◆ mul()

void TransmissionMatrix::mul ( const TransmissionMatrix A,
const TransmissionMatrix B 
)
inline

Set this to a multiple of A by B.

*this is not aliased with A or B

Parameters
[in]AMatrix 1
[in]BMatrix 2

Definition at line 222 of file transmissionmatrix.h.

References T1, T2, T3, and T4.

◆ mul_aliased()

void TransmissionMatrix::mul_aliased ( const TransmissionMatrix A,
const TransmissionMatrix B 
)
inline

Set this to a multiple of A by B.

*this is aliased with A or B

Parameters
[in]AMatrix 1
[in]BMatrix 2

Definition at line 237 of file transmissionmatrix.h.

References T1, T2, T3, and T4.

◆ operator Tensor3()

TransmissionMatrix::operator Tensor3 ( ) const
inline

Definition at line 109 of file transmissionmatrix.h.

References Frequencies(), stokes_dim, and T4.

◆ operator()()

Numeric TransmissionMatrix::operator() ( const Index  i,
const Index  j,
const Index  k 
) const
inline

Access value in matrix.

Parameters
[in]iPosition in vector
[in]jRow in matrix
[in]kCol in matrix
Returns
const Numeric& value

Definition at line 251 of file transmissionmatrix.h.

◆ operator*=()

TransmissionMatrix& TransmissionMatrix::operator*= ( const Numeric scale)
inline

Scale self.

Parameters
[in]scaleTo scale with
Returns
TransmissionMatrix& *this

Definition at line 303 of file transmissionmatrix.h.

References T1, T2, T3, T4, and transform().

Referenced by operator=().

◆ operator+=()

TransmissionMatrix& TransmissionMatrix::operator+= ( const LazyScale< TransmissionMatrix > &  lstm)
inline

Assign to *this lazily.

Parameters
[in]lstmLazy matrix
Returns
TransmissionMatrix& *this

Definition at line 286 of file transmissionmatrix.h.

References LazyScale< base >::bas, Mat1(), Mat2(), Mat3(), Mat4(), LazyScale< base >::scale, T1, T2, T3, and T4.

◆ operator=() [1/3]

TransmissionMatrix& TransmissionMatrix::operator= ( const LazyScale< TransmissionMatrix > &  lstm)
inline

Assign lazily.

Parameters
[in]lstmLazy value
Returns
TransmissionMatrix& *this

Definition at line 316 of file transmissionmatrix.h.

References LazyScale< base >::bas, operator*=(), operator=(), and LazyScale< base >::scale.

◆ operator=() [2/3]

TransmissionMatrix& TransmissionMatrix::operator= ( const TransmissionMatrix tm)
default

Assignment operator.

Parameters
[in]tmmatrix to copy
Returns
TransmissionMatrix& *this

Referenced by operator=().

◆ operator=() [3/3]

TransmissionMatrix& TransmissionMatrix::operator= ( TransmissionMatrix &&  tm)
inlinenoexcept

Move operator.

Parameters
[in]tmmatrix to move from
Returns
TransmissionMatrix& *this

Definition at line 93 of file transmissionmatrix.h.

References stokes_dim, T1, T2, T3, and T4.

◆ setIdentity()

void TransmissionMatrix::setIdentity ( )
inline

Set to identity matrix.

Definition at line 200 of file transmissionmatrix.h.

References T1, T2, T3, and T4.

◆ setZero()

void TransmissionMatrix::setZero ( )
inline

Set to zero matrix.

Definition at line 208 of file transmissionmatrix.h.

References T1, T2, T3, and T4.

◆ StokesDim()

Index TransmissionMatrix::StokesDim ( ) const
inline

Stokes dimensionaility.

Definition at line 265 of file transmissionmatrix.h.

References stokes_dim.

Referenced by xml_write_to_stream().

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const TransmissionMatrix tm 
)
friend

Output operator.

Definition at line 1804 of file transmissionmatrix.cc.

◆ operator>>

std::istream& operator>> ( std::istream &  data,
TransmissionMatrix tm 
)
friend

Input operator.

Definition at line 1844 of file transmissionmatrix.cc.

Member Data Documentation

◆ stokes_dim

Index TransmissionMatrix::stokes_dim
private

Definition at line 40 of file transmissionmatrix.h.

Referenced by Frequencies(), Mat(), operator Tensor3(), operator=(), and StokesDim().

◆ T1

std::vector<Eigen::Matrix<double, 1, 1>, Eigen::aligned_allocator<Eigen::Matrix<double, 1, 1> > > TransmissionMatrix::T1
private

◆ T2

std::vector<Eigen::Matrix2d, Eigen::aligned_allocator<Eigen::Matrix2d> > TransmissionMatrix::T2
private

◆ T3

std::vector<Eigen::Matrix3d, Eigen::aligned_allocator<Eigen::Matrix3d> > TransmissionMatrix::T3
private

◆ T4

std::vector<Eigen::Matrix4d, Eigen::aligned_allocator<Eigen::Matrix4d> > TransmissionMatrix::T4
private

The documentation for this class was generated from the following files: