ARTS 2.5.10 (git: 2f1c442c)
|
#include "blas.h"
#include "exceptions.h"
#include "matpack_complex.h"
#include "matpack_eigen.h"
#include <algorithm>
#include <cmath>
#include <cstring>
Go to the source code of this file.
Functions | |
std::ostream & | operator<< (std::ostream &os, const ConstComplexVectorView &v) |
Output operator. | |
void | copy (ConstComplexIterator1D origin, const ConstComplexIterator1D &end, ComplexIterator1D target) |
Copy data between begin and end to target. | |
void | copy (Complex x, ComplexIterator1D target, const ComplexIterator1D &end) |
Copy a scalar to all elements. | |
void | swap (ComplexVector &v1, ComplexVector &v2) noexcept |
Swaps two objects. | |
std::ostream & | operator<< (std::ostream &os, const ConstComplexMatrixView &v) |
Output operator. | |
void | copy (ConstComplexIterator2D origin, const ConstComplexIterator2D &end, ComplexIterator2D target) |
Copy data between begin and end to target. | |
void | copy (Complex x, ComplexIterator2D target, const ComplexIterator2D &end) |
Copy a scalar to all elements. | |
void | copy (Numeric x, ComplexIterator2D target, const ComplexIterator2D &end) |
Copy a scalar to all elements. | |
void | swap (ComplexMatrix &m1, ComplexMatrix &m2) noexcept |
Swaps two objects. | |
ConstComplexMatrixView | transpose (ConstComplexMatrixView m) |
Const version of transpose. | |
ComplexMatrixView | transpose (ComplexMatrixView m) |
Returns the transpose. | |
ComplexMatrixView | transpose (ComplexVector v) |
Returns the transpose. | |
Complex | operator* (const ConstComplexVectorView &a, const ConstComplexVectorView &b) |
Scalar product. | |
void | mult (ComplexVectorView y, const ConstComplexMatrixView &M, const ConstComplexVectorView &x) |
Matrix-Vector Multiplication. | |
void | mult (ComplexMatrixView A, const ConstComplexMatrixView &B, const ConstComplexMatrixView &C) |
Matrix-Matrix Multiplication. | |
void | mult (ComplexMatrixView A, const ConstComplexMatrixView &B, const ConstMatrixView &C) |
void | mult (ComplexMatrixView A, const ConstMatrixView &B, const ConstComplexMatrixView &C) |
void | mult (ComplexMatrixView A, const ConstMatrixView &B, const ConstMatrixView &C) |
Complex | debug_matrixview_get_elem (ComplexMatrixView &mv, Index r, Index c) |
Helper function to access matrix elements. | |
void copy | ( | Complex | x, |
ComplexIterator1D | target, | ||
const ComplexIterator1D & | end | ||
) |
Copy a scalar to all elements.
Definition at line 468 of file matpack_complex.cc.
void copy | ( | Complex | x, |
ComplexIterator2D | target, | ||
const ComplexIterator2D & | end | ||
) |
Copy a scalar to all elements.
Definition at line 1329 of file matpack_complex.cc.
References ComplexVectorView::begin(), and ComplexVectorView::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 456 of file matpack_complex.cc.
Referenced by ComplexMatrix::ComplexMatrix(), ComplexVector::ComplexVector(), ComplexMatrix::operator=(), ComplexMatrixView::operator=(), and ComplexVectorView::operator=().
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 1317 of file matpack_complex.cc.
References ComplexVectorView::begin(), ConstComplexVectorView::begin(), and ConstComplexVectorView::end().
void copy | ( | Numeric | x, |
ComplexIterator2D | target, | ||
const ComplexIterator2D & | end | ||
) |
Copy a scalar to all elements.
Definition at line 1338 of file matpack_complex.cc.
References ComplexVectorView::begin(), and ComplexVectorView::end().
Complex debug_matrixview_get_elem | ( | ComplexMatrixView & | mv, |
Index | r, | ||
Index | c | ||
) |
Helper function to access matrix elements.
Because of function inlining the operator() is not accessible from the debuggger. This function helps to access Matrix elements from within the debugger.
mv | MatrixView |
r | Row index |
c | Column index |
Definition at line 1674 of file matpack_complex.cc.
References c.
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 1605 of file matpack_complex.cc.
References ConstComplexVectorView::mdata.
void mult | ( | ComplexMatrixView | A, |
const ConstComplexMatrixView & | B, | ||
const ConstMatrixView & | C | ||
) |
Definition at line 1619 of file matpack_complex.cc.
void mult | ( | ComplexMatrixView | A, |
const ConstMatrixView & | B, | ||
const ConstComplexMatrixView & | C | ||
) |
Definition at line 1633 of file matpack_complex.cc.
void mult | ( | ComplexMatrixView | A, |
const ConstMatrixView & | B, | ||
const ConstMatrixView & | C | ||
) |
Definition at line 1647 of file matpack_complex.cc.
References ARTS_ASSERT, matpack::eigen::mat(), 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 1580 of file matpack_complex.cc.
Complex operator* | ( | const ConstComplexVectorView & | a, |
const ConstComplexVectorView & | b | ||
) |
Scalar product.
The two vectors may be identical.
Definition at line 1555 of file matpack_complex.cc.
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 897 of file matpack_complex.cc.
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 133 of file matpack_complex.cc.
|
noexcept |
Swaps two objects.
Definition at line 1475 of file matpack_complex.cc.
|
noexcept |
Swaps two objects.
Definition at line 761 of file matpack_complex.cc.
Referenced by cloud_RT_no_background(), emission_from_propmat_field(), iyEmissionHybrid(), iyRadarSingleScat(), iyTransmissionStandard(), TokVal::operator=(), binistream::readDoubleArray(), binistream::readFloat(), Absorption::LineMixing::LinearRovibErrorCorrectedSudden::relaxation_matrix_offdiagonal(), TokVal::TokVal(), transform_jacobian(), transform_x(), transform_x_back(), wigner3j_limits(), and binostream::writeFloat().
ComplexMatrixView transpose | ( | ComplexMatrixView | m | ) |
Returns the transpose.
This creates a special MatrixView for the transpose. The original is not changed!
Definition at line 1516 of file matpack_complex.cc.
ComplexMatrixView transpose | ( | ComplexVector | v | ) |
Returns the transpose.
This creates a special MatrixView for the transpose. The original is not changed!
Definition at line 1522 of file matpack_complex.cc.
References transpose(), and v.
ConstComplexMatrixView transpose | ( | ConstComplexMatrixView | m | ) |
Const version of transpose.
Definition at line 1510 of file matpack_complex.cc.
Referenced by Append(), lm_hitran_2017::calcw(), generate_test_data(), HydrotableCalc(), jacobianSetAffineTransformation(), lsf(), matrix_mult(), matrix_vector_mult(), MCRadar(), CovarianceMatrix::operator Matrix(), operator+=(), random_fill_matrix_pos_def(), random_fill_matrix_pos_semi_def(), random_fill_matrix_symmetric(), rtmethods_jacobian_finalisation(), test03(), test1(), test33(), test41(), test42(), test46(), test5(), test_col_and_row_vec(), test_dense_sparse_multiplication(), test_diagonal(), test_multiplication_and_setting(), test_sparse_dense_multiplication(), test_sparse_multiplication(), test_sparse_unary_operations(), transform_x(), transpose(), WMRFSelectChannels(), and yApplyUnit().