ARTS
2.3.1285(git:92a29ea9-dirty)
|
A class implementing complex numbers for ARTS. More...
Go to the source code of this file.
Classes | |
class | ComplexIterator1D |
The iterator class for sub vectors. More... | |
class | ConstComplexIterator1D |
The constant iterator class for sub vectors. More... | |
class | ConstComplexVectorView |
A constant view of a ComplexVector. More... | |
class | ComplexVectorView |
The ComplexVectorView class. More... | |
class | ComplexIterator2D |
The row iterator class for sub matrices. More... | |
class | ConstComplexIterator2D |
The const row iterator class for sub matrices. More... | |
class | ComplexVector |
The ComplexVector class. More... | |
class | ConstComplexMatrixView |
A constant view of a ComplexMatrix. More... | |
class | ComplexMatrixView |
The ComplexMatrixView class. More... | |
class | ComplexMatrix |
The ComplexMatrix class. More... | |
Macros | |
#define | a1 c.real() |
#define | b1 c.imag() |
#define | a2 z.real() |
#define | b2 z.imag() |
#define | _complex_operations_(T) |
Typedefs | |
typedef std::complex< Numeric > | Complex |
typedef Eigen::Matrix< Complex, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > | ComplexMatrixType |
typedef Eigen::Stride< Eigen::Dynamic, Eigen::Dynamic > | ComplexStrideType |
typedef Eigen::Map< ComplexMatrixType, 0, ComplexStrideType > | ComplexMatrixViewMap |
typedef Eigen::Map< const ComplexMatrixType, 0, ComplexStrideType > | ComplexConstMatrixViewMap |
typedef Array< ComplexVector > | ArrayOfComplexVector |
typedef Array< ComplexMatrix > | ArrayOfComplexMatrix |
#define _complex_operations_ | ( | T | ) |
#define a1 c.real() |
Definition at line 56 of file complex.h.
Referenced by CKD_mt_CIAfun_n2(), defocusing_sat2sat(), ELL07WaterDropletAbs(), TelsemAtlas::emis_interp(), CovarianceMatrix::invert_correlation_block(), lineshape_voigt_kuntz6(), MakeArray< base >::MakeArray(), MakeVector::MakeVector(), and psd_cloudice_MH97().
#define a2 z.real() |
Definition at line 58 of file complex.h.
Referenced by CKD_mt_CIAfun_n2(), defocusing_sat2sat(), ELL07WaterDropletAbs(), TelsemAtlas::emis_interp(), CovarianceMatrix::invert_correlation_block(), lineshape_voigt_kuntz6(), Absorption::PredefinedModel::makarov2020_o2_lines_mpm(), MakeArray< base >::MakeArray(), MakeVector::MakeVector(), and PropagationMatrix::MatrixInverseAtPosition().
#define b1 c.imag() |
Definition at line 57 of file complex.h.
Referenced by ELL07WaterDropletAbs(), TelsemAtlas::emis_interp(), CovarianceMatrix::invert_correlation_block(), lineshape_voigt_kuntz6(), MPM93_H2O_continuum(), and psd_cloudice_MH97().
#define b2 z.imag() |
Definition at line 59 of file complex.h.
Referenced by ELL07WaterDropletAbs(), TelsemAtlas::emis_interp(), CovarianceMatrix::invert_correlation_block(), lineshape_voigt_kuntz6(), PropagationMatrix::MatrixInverseAtPosition(), MPM93_H2O_continuum(), and psd_cloudice_MH97().
typedef Array<ComplexMatrix> ArrayOfComplexMatrix |
typedef Array<ComplexVector> ArrayOfComplexVector |
typedef Eigen::Map<const ComplexMatrixType, 0, ComplexStrideType> ComplexConstMatrixViewMap |
typedef Eigen::Matrix<Complex, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> ComplexMatrixType |
typedef Eigen::Map<ComplexMatrixType, 0, ComplexStrideType> ComplexMatrixViewMap |
typedef Eigen::Stride<Eigen::Dynamic, Eigen::Dynamic> ComplexStrideType |
_complex_operations_ | ( | int | ) | const |
the conjugate of c
Definition at line 65 of file complex.h.
Referenced by ampmat_to_phamat(), Linefunctions::apply_linemixing_scaling_and_mirroring(), pCqSDHC_to_arts(), and surface_specular_R_and_b().
void copy | ( | ConstComplexIterator1D | origin, |
const ConstComplexIterator1D & | end, | ||
ComplexIterator1D | target | ||
) |
Copy data between begin and end to target.
Target must be a valid area of memory. Note that the strides in the iterators can be different, so that we can for example copy data between different kinds of subvectors.
Definition at line 478 of file complex.cc.
References ComplexVectorView::end(), ComplexIterator1D::mstride, ConstComplexIterator1D::mstride, ComplexIterator1D::mx, and ConstComplexIterator1D::mx.
Referenced by ComplexMatrix::ComplexMatrix(), ComplexVector::ComplexVector(), Array< QuantumFieldDescription >::operator=(), ComplexVectorView::operator=(), ComplexMatrixView::operator=(), ComplexMatrix::operator=(), InteractiveWorkspace::resize(), and LineShape::LegacyLineMixingData::vector2modellm().
void copy | ( | Complex | x, |
ComplexIterator1D | target, | ||
const ComplexIterator1D & | end | ||
) |
Copy a scalar to all elements.
Definition at line 490 of file complex.cc.
References ComplexVectorView::end().
void copy | ( | ConstComplexIterator2D | origin, |
const ConstComplexIterator2D & | end, | ||
ComplexIterator2D | target | ||
) |
Copy data between begin and end to target.
Target must be a valid area of memory. Note that the strides in the iterators can be different, so that we can for example copy data between different kinds of subvectors.
Origin, end, and target are 2D iterators, marking rows in a matrix. For each row the 1D iterator is obtained and used to copy the elements.
Definition at line 1316 of file complex.cc.
References ConstComplexVectorView::begin(), and ComplexMatrixView::end().
void copy | ( | Complex | x, |
ComplexIterator2D | target, | ||
const ComplexIterator2D & | end | ||
) |
Copy a scalar to all elements.
Definition at line 1328 of file complex.cc.
References ComplexVectorView::begin(), and ComplexMatrixView::end().
ComplexConstMatrixViewMap MapToEigen | ( | const ConstComplexMatrixView & | A | ) |
Definition at line 1655 of file complex.cc.
References Range::get_start(), Range::get_stride(), ConstComplexMatrixView::mcr, ConstComplexMatrixView::mdata, ConstComplexMatrixView::mrr, ConstComplexMatrixView::ncols(), and ConstComplexMatrixView::nrows().
Referenced by LineFunctions::apply_dipole(), LineFunctions::apply_linestrength(), LineFunctions::apply_linestrength_from_full_linemixing(), ComplexMatrix::get_raw_data(), Linefunctions::set_cross_section_of_band(), test03(), xsec_species(), and zeeman_on_the_fly().
ComplexConstMatrixViewMap MapToEigen | ( | const ConstComplexVectorView & | A | ) |
Definition at line 1664 of file complex.cc.
References Range::get_start(), Range::get_stride(), ConstComplexVectorView::mdata, ConstComplexVectorView::mrange, and ConstComplexVectorView::nelem().
ComplexMatrixViewMap MapToEigen | ( | ComplexMatrixView & | A | ) |
Definition at line 1685 of file complex.cc.
References Range::get_start(), Range::get_stride(), ConstComplexMatrixView::mcr, ConstComplexMatrixView::mdata, ConstComplexMatrixView::mrr, ConstComplexMatrixView::ncols(), and ConstComplexMatrixView::nrows().
ComplexMatrixViewMap MapToEigen | ( | ComplexVectorView & | A | ) |
Definition at line 1694 of file complex.cc.
References Range::get_start(), Range::get_stride(), ConstComplexVectorView::mdata, ConstComplexVectorView::mrange, and ConstComplexVectorView::nelem().
ComplexConstMatrixViewMap MapToEigenCol | ( | const ConstComplexVectorView & | A | ) |
Definition at line 1677 of file complex.cc.
References Range::get_start(), Range::get_stride(), ConstComplexVectorView::mdata, ConstComplexVectorView::mrange, and ConstComplexVectorView::nelem().
Referenced by ComplexMatrix::get_raw_data().
ComplexMatrixViewMap MapToEigenCol | ( | ComplexVectorView & | A | ) |
Definition at line 1707 of file complex.cc.
References Range::get_start(), Range::get_stride(), ConstComplexVectorView::mdata, ConstComplexVectorView::mrange, and ConstComplexVectorView::nelem().
ComplexConstMatrixViewMap MapToEigenRow | ( | const ConstComplexVectorView & | A | ) |
Definition at line 1672 of file complex.cc.
References ConstComplexMatrixView::MapToEigen.
Referenced by ComplexMatrix::get_raw_data(), and mult().
ComplexMatrixViewMap MapToEigenRow | ( | ComplexVectorView & | A | ) |
Definition at line 1702 of file complex.cc.
References ConstComplexMatrixView::MapToEigen.
void mult | ( | ComplexVectorView | y, |
const ConstComplexMatrixView & | M, | ||
const ConstComplexVectorView & | x | ||
) |
Matrix-Vector Multiplication.
Uses the Eigen library. Be carful to test the size of your input beforehand.
For left-hand multiplication, please use pure matrix-mult.
[out] | y | The length-m ComplexVectorView where the result is stored. |
[in] | M | Reference to the m-times-n Const{Complex,}MatrixView holding the matrix M. |
[in] | x | Reference to the length-n Const{Complex,}VectorView holding the vector x. |
Definition at line 1579 of file complex.cc.
References ConstComplexMatrixView::MapToEigen, MapToEigenRow(), ConstComplexVectorView::mdata, ConstComplexMatrixView::ncols(), ConstComplexVectorView::nelem(), and ConstComplexMatrixView::nrows().
Referenced by benchmark_mult(), benchmark_oem_linear(), cloud_RT_surface(), MCAntenna::draw_los(), LinearModel::evaluate(), QuadraticModel::evaluate(), generate_test_data(), get_diydx(), get_ppath_transmat(), ComplexMatrix::get_raw_data(), get_stepwise_effective_source(), get_stepwise_transmission_matrix(), interpTArray(), iy_transmission_mult(), iyHybrid(), iySurfaceFastem(), QuadraticModel::Jacobian(), jacobianCalcFreqShift(), jacobianCalcFreqStretch(), jacobianCalcPointingZaInterp(), jacobianCalcPointingZaRecalc(), lsf(), main(), matrix_vector_mult(), MatrixMatrixMultiply(), MatrixVectorMultiply(), MCGeneral(), MCIPA(), mcPathTraceRadar(), MCRadar(), met_mm_polarisation_hmatrix(), oem_cost_x(), oem_cost_y(), oem_gauss_newton_m_form(), oem_gauss_newton_n_form(), oem_linear_mform(), random_fill_matrix_pos_def(), random_fill_matrix_pos_semi_def(), MCAntenna::return_los(), rte_step_doit_replacement(), rtmethods_jacobian_finalisation(), scale_rows(), sensor_responseAntenna(), sensor_responseBackend(), sensor_responseFrequencySwitching(), sensor_responseMetMM(), sensor_responseMixer(), sensor_responseMixerBackendPrecalcWeights(), sensor_responsePolarisation(), sensor_responseStokesRotation(), sensor_responseWMRF(), SparseSparseMultiply(), surface_calc(), test4(), test5(), test_complex_diagonalize(), test_dense_sparse_multiplication(), test_inv(), test_lusolve4D(), test_real_diagonalize(), test_solve_linear_system(), test_sparse_arithmetic(), test_sparse_dense_multiplication(), transform_x(), transform_x_back(), VectorMatrixMultiply(), x2artsSpectroscopy(), yActive(), yCalc(), yCalc_mblock_loop_body(), and ySimpleSpectrometer().
void mult | ( | ComplexMatrixView | A, |
const ConstComplexMatrixView & | B, | ||
const ConstComplexMatrixView & | C | ||
) |
Matrix-Matrix Multiplication.
Uses the Eigen library. Be carful to test the size of your input beforehand. Note that to keep speed, the inputs should be different variables. There is memory duplication if this is not the case. Note that it is mdata that is checked, so even if the matrices are at different parts of a tensor, there is still a slowdown
[in,out] | A | The matrix A, that will hold the result of the multiplication. |
[in] | B | The matrix B |
[in] | C | The matrix C |
Definition at line 1604 of file complex.cc.
References ConstComplexMatrixView::MapToEigen, ConstComplexMatrixView::mdata, ConstComplexMatrixView::ncols(), and ConstComplexMatrixView::nrows().
void mult | ( | ComplexMatrixView | A, |
const ConstMatrixView & | B, | ||
const ConstComplexMatrixView & | C | ||
) |
Definition at line 1630 of file complex.cc.
References ConstComplexMatrixView::MapToEigen, ConstComplexMatrixView::mdata, ConstComplexMatrixView::ncols(), ConstMatrixView::ncols(), ConstComplexMatrixView::nrows(), and ConstMatrixView::nrows().
void mult | ( | ComplexMatrixView | A, |
const ConstComplexMatrixView & | B, | ||
const ConstMatrixView & | C | ||
) |
Definition at line 1617 of file complex.cc.
References ConstComplexMatrixView::MapToEigen, ConstComplexMatrixView::mdata, ConstComplexMatrixView::ncols(), ConstMatrixView::ncols(), ConstComplexMatrixView::nrows(), and ConstMatrixView::nrows().
void mult | ( | ComplexMatrixView | A, |
const ConstMatrixView & | B, | ||
const ConstMatrixView & | C | ||
) |
Definition at line 1643 of file complex.cc.
References ConstComplexMatrixView::MapToEigen, ConstComplexMatrixView::ncols(), ConstMatrixView::ncols(), ConstComplexMatrixView::nrows(), and ConstMatrixView::nrows().
|
inline |
|
inline |
Complex operator* | ( | const ConstComplexVectorView & | a, |
const ConstComplexVectorView & | b | ||
) |
Scalar product.
The two vectors may be identical.
Definition at line 1554 of file complex.cc.
References ConstComplexVectorView::begin(), ConstComplexVectorView::end(), and ConstComplexVectorView::nelem().
|
inline |
|
inline |
Definition at line 73 of file complex.h.
Referenced by Iterator1D::operator!=().
std::ostream& operator<< | ( | std::ostream & | os, |
const ConstComplexVectorView & | v | ||
) |
Output operator.
This demonstrates how iterators can be used to traverse the vector. The iterators know which part of the vector is `active', and also the stride.
Definition at line 134 of file complex.cc.
References ConstComplexVectorView::begin(), ConstComplexVectorView::end(), and i.
Referenced by ComplexMatrix::get_raw_data().
std::ostream& operator<< | ( | std::ostream & | os, |
const ConstComplexMatrixView & | v | ||
) |
Output operator.
This demonstrates how iterators can be used to traverse the matrix. The iterators know which part of the matrix is `active', and also the strides in both directions. This function is a bit more complicated than necessary to illustrate the concept, because the formating should look nice. This means that the first row, and the first element in each row, have to be treated individually.
Definition at line 866 of file complex.cc.
References ConstComplexVectorView::begin(), ConstComplexMatrixView::begin(), ConstComplexVectorView::end(), and ConstComplexMatrixView::end().
ConstComplexMatrixView transpose | ( | ConstComplexMatrixView | m | ) |
Const version of transpose.
Definition at line 1509 of file complex.cc.
References ConstComplexMatrixView::ConstComplexMatrixView(), ConstComplexMatrixView::mcr, ConstComplexMatrixView::mdata, and ConstComplexMatrixView::mrr.
Referenced by Append(), generate_test_data(), ComplexMatrix::get_raw_data(), jacobianSetAffineTransformation(), lsf(), ludcmp(), matrix_vector_mult(), MCRadar(), mult(), oem_gauss_newton_m_form(), oem_gauss_newton_n_form(), oem_linear_mform(), operator+=(), random_fill_matrix_pos_def(), random_fill_matrix_pos_semi_def(), random_fill_matrix_symmetric(), rtmethods_jacobian_finalisation(), scale_rows(), test03(), test1(), test33(), test5(), test_dense_sparse_multiplication(), test_diagonal(), test_sparse_dense_multiplication(), transform_x(), and WMRFSelectChannels().
ComplexMatrixView transpose | ( | ComplexMatrixView | m | ) |
Returns the transpose.
This creates a special MatrixView for the transpose. The original is not changed!
Definition at line 1515 of file complex.cc.
References ComplexMatrixView::ComplexMatrixView(), ConstComplexMatrixView::mcr, ConstComplexMatrixView::mdata, and ConstComplexMatrixView::mrr.