ARTS
2.4.0(git:4fb77825)
|
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 | ) |
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 | ( | Complex | x, |
ComplexIterator1D | target, | ||
const ComplexIterator1D & | end | ||
) |
Copy a scalar to all elements.
Definition at line 490 of file complex.cc.
References Zeeman::end(), and ARTS::Var::x().
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 Zeeman::end().
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 205 of file complex.cc.
References Zeeman::end(), ComplexIterator1D::mstride, ConstComplexIterator1D::mstride, ComplexIterator1D::mx, and ConstComplexIterator1D::mx.
Referenced by ComplexMatrix::ComplexMatrix(), ComplexVector::ComplexVector(), ComplexMatrix::operator=(), Array< base >::operator=(), ComplexMatrixView::operator=(), ComplexVectorView::operator=(), and InteractiveWorkspace::resize().
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 Zeeman::end().
ComplexMatrixViewMap MapToEigen | ( | ComplexMatrixView & | A | ) |
Definition at line 700 of file complex.cc.
References Range::get_start(), Range::get_stride(), ConstComplexMatrixView::mcr, ConstComplexMatrixView::mdata, ConstComplexMatrixView::mrr, ConstComplexMatrixView::ncols(), ConstComplexMatrixView::nrows(), ComplexVectorView::operator=(), and ARTS::Var::x().
ComplexMatrixViewMap MapToEigen | ( | ComplexVectorView & | A | ) |
Definition at line 336 of file complex.cc.
References Range::get_start(), Range::get_stride(), ConstComplexVectorView::mdata, ConstComplexVectorView::mrange, and ConstComplexVectorView::nelem().
ComplexConstMatrixViewMap MapToEigen | ( | const ConstComplexMatrixView & | A | ) |
Definition at line 699 of file complex.cc.
References Range::get_start(), Range::get_stride(), ConstComplexMatrixView::mcr, ConstComplexMatrixView::mdata, ConstComplexMatrixView::mrr, ConstComplexMatrixView::ncols(), and ConstComplexMatrixView::nrows().
Referenced by MapToEigenRow(), mult(), Linefunctions::set_cross_section_of_band(), test03(), xsec_species(), and zeeman_on_the_fly().
ComplexConstMatrixViewMap MapToEigen | ( | const ConstComplexVectorView & | A | ) |
Definition at line 334 of file complex.cc.
References Range::get_start(), Range::get_stride(), ConstComplexVectorView::mdata, ConstComplexVectorView::mrange, and ConstComplexVectorView::nelem().
ComplexMatrixViewMap MapToEigenCol | ( | ComplexVectorView & | A | ) |
Definition at line 337 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 335 of file complex.cc.
References Range::get_start(), Range::get_stride(), ConstComplexVectorView::mdata, ConstComplexVectorView::mrange, and ConstComplexVectorView::nelem().
ComplexMatrixViewMap MapToEigenRow | ( | ComplexVectorView & | A | ) |
Definition at line 1702 of file complex.cc.
References MapToEigen().
ComplexConstMatrixViewMap MapToEigenRow | ( | const ConstComplexVectorView & | A | ) |
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 688 of file complex.cc.
References MapToEigen(), ConstComplexMatrixView::mdata, ConstComplexMatrixView::ncols(), and ConstComplexMatrixView::nrows().
void mult | ( | ComplexMatrixView | A, |
const ConstComplexMatrixView & | B, | ||
const ConstMatrixView & | C | ||
) |
Definition at line 694 of file complex.cc.
References MapToEigen(), ConstComplexMatrixView::mdata, ConstComplexMatrixView::ncols(), ConstMatrixView::ncols(), ConstComplexMatrixView::nrows(), and ConstMatrixView::nrows().
void mult | ( | ComplexMatrixView | A, |
const ConstMatrixView & | B, | ||
const ConstComplexMatrixView & | C | ||
) |
Definition at line 691 of file complex.cc.
References 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 MapToEigen(), ConstComplexMatrixView::ncols(), ConstMatrixView::ncols(), ConstComplexMatrixView::nrows(), and ConstMatrixView::nrows().
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 330 of file complex.cc.
References M, MapToEigen(), MapToEigenRow(), ARTS::Var::x(), and ARTS::Var::y().
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(), get_stepwise_effective_source(), get_stepwise_transmission_matrix(), iy_transmission_mult(), iyHybrid(), iySurfaceFastem(), QuadraticModel::Jacobian(), jacobianCalcFreqShift(), jacobianCalcFreqStretch(), jacobianCalcPointingZaInterp(), jacobianCalcPointingZaRecalc(), lsf(), main(), matrix_vector_mult(), MatrixMatrixMultiply(), MatrixVectorMultiply(), MCGeneral(), mcPathTraceRadar(), MCRadar(), met_mm_polarisation_hmatrix(), random_fill_matrix_pos_def(), random_fill_matrix_pos_semi_def(), MCAntenna::return_los(), rte_step_doit_replacement(), rtmethods_jacobian_finalisation(), 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(), yActive(), yCalc(), yCalc_mblock_loop_body(), and ySimpleSpectrometer().
Complex operator* | ( | const ConstComplexVectorView & | a, |
const ConstComplexVectorView & | b | ||
) |
Scalar product.
The two vectors may be identical.
Definition at line 313 of file complex.cc.
References ConstComplexVectorView::begin(), ConstComplexVectorView::end(), and ConstComplexVectorView::nelem().
|
inline |
|
inline |
|
inline |
|
inline |
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().
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 Zeeman::end().
ComplexMatrixView transpose | ( | ComplexMatrixView | m | ) |
Returns the transpose.
This creates a special MatrixView for the transpose. The original is not changed!
Definition at line 837 of file complex.cc.
References ConstComplexMatrixView::mcr, ConstComplexMatrixView::mdata, and ConstComplexMatrixView::mrr.
ConstComplexMatrixView transpose | ( | ConstComplexMatrixView | m | ) |
Const version of transpose.
Definition at line 684 of file complex.cc.
References ConstComplexMatrixView::mcr, ConstComplexMatrixView::mdata, and ConstComplexMatrixView::mrr.
Referenced by Append(), generate_test_data(), jacobianSetAffineTransformation(), lsf(), ludcmp(), matrix_vector_mult(), MCRadar(), mult(), operator+=(), random_fill_matrix_pos_def(), random_fill_matrix_pos_semi_def(), random_fill_matrix_symmetric(), rtmethods_jacobian_finalisation(), test03(), test1(), test33(), test5(), test_dense_sparse_multiplication(), test_diagonal(), test_sparse_dense_multiplication(), transform_x(), transpose(), and WMRFSelectChannels().