ARTS 2.5.0 (git: 9ee3ac6c)
matpack_complex.cc File Reference
#include "matpack_complex.h"
#include "blas.h"
#include "exceptions.h"
#include <cmath>
#include <cstring>

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &os, const ConstComplexVectorView &v)
 Output operator. More...
 
void copy (ConstComplexIterator1D origin, const ConstComplexIterator1D &end, ComplexIterator1D target)
 Copy data between begin and end to target. More...
 
void copy (Complex x, ComplexIterator1D target, const ComplexIterator1D &end)
 Copy a scalar to all elements. More...
 
void swap (ComplexVector &v1, ComplexVector &v2)
 Swaps two objects. More...
 
std::ostream & operator<< (std::ostream &os, const ConstComplexMatrixView &v)
 Output operator. More...
 
void copy (ConstComplexIterator2D origin, const ConstComplexIterator2D &end, ComplexIterator2D target)
 Copy data between begin and end to target. More...
 
void copy (Complex x, ComplexIterator2D target, const ComplexIterator2D &end)
 Copy a scalar to all elements. More...
 
void copy (Numeric x, ComplexIterator2D target, const ComplexIterator2D &end)
 Copy a scalar to all elements. More...
 
void swap (ComplexMatrix &m1, ComplexMatrix &m2)
 Swaps two objects. More...
 
ConstComplexMatrixView transpose (ConstComplexMatrixView m)
 Const version of transpose. More...
 
ComplexMatrixView transpose (ComplexMatrixView m)
 Returns the transpose. More...
 
ComplexMatrixView transpose (ComplexVector v)
 Returns the transpose. More...
 
Complex operator* (const ConstComplexVectorView &a, const ConstComplexVectorView &b)
 Scalar product. More...
 
void mult (ComplexVectorView y, const ConstComplexMatrixView &M, const ConstComplexVectorView &x)
 Matrix-Vector Multiplication. More...
 
void mult (ComplexMatrixView A, const ConstComplexMatrixView &B, const ConstComplexMatrixView &C)
 Matrix-Matrix Multiplication. More...
 
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)
 
ConstComplexMatrixViewMap MapToEigen (const ConstComplexMatrixView &A)
 
ConstComplexMatrixViewMap MapToEigen (const ConstComplexVectorView &A)
 
ConstComplexMatrixViewMap MapToEigenRow (const ConstComplexVectorView &A)
 
ConstComplexMatrixViewMap MapToEigenCol (const ConstComplexVectorView &A)
 
ComplexMatrixViewMap MapToEigen (ComplexMatrixView &A)
 
ComplexMatrixViewMap MapToEigen (ComplexVectorView &A)
 
ComplexMatrixViewMap MapToEigenRow (ComplexVectorView &A)
 
ComplexMatrixViewMap MapToEigenCol (ComplexVectorView &A)
 
Complex debug_matrixview_get_elem (ComplexMatrixView &mv, Index r, Index c)
 Helper function to access matrix elements. More...
 

Function Documentation

◆ copy() [1/5]

void copy ( Complex  x,
ComplexIterator1D  target,
const ComplexIterator1D end 
)

Copy a scalar to all elements.

Definition at line 483 of file matpack_complex.cc.

References Zeeman::end().

◆ copy() [2/5]

void copy ( Complex  x,
ComplexIterator2D  target,
const ComplexIterator2D end 
)

Copy a scalar to all elements.

Definition at line 1319 of file matpack_complex.cc.

References ComplexVectorView::begin(), and Zeeman::end().

◆ copy() [3/5]

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 471 of file matpack_complex.cc.

Referenced by ComplexMatrix::ComplexMatrix(), ComplexVector::ComplexVector(), ComplexMatrix::operator=(), Array< base >::operator=(), ArrayOfSpeciesTag::operator=(), ComplexMatrixView::operator=(), ComplexVectorView::operator=(), and InteractiveWorkspace::resize().

◆ copy() [4/5]

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 1307 of file matpack_complex.cc.

References ConstComplexVectorView::begin(), and Zeeman::end().

◆ copy() [5/5]

void copy ( Numeric  x,
ComplexIterator2D  target,
const ComplexIterator2D end 
)

Copy a scalar to all elements.

Definition at line 1328 of file matpack_complex.cc.

References ComplexVectorView::begin(), and Zeeman::end().

◆ debug_matrixview_get_elem()

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.

Parameters
mvMatrixView
rRow index
cColumn index
Author
Oliver Lemke
Date
2004-05-10

Definition at line 1721 of file matpack_complex.cc.

References c.

◆ MapToEigen() [1/4]

Definition at line 1675 of file matpack_complex.cc.

◆ MapToEigen() [2/4]

Definition at line 1684 of file matpack_complex.cc.

◆ MapToEigen() [3/4]

Definition at line 1645 of file matpack_complex.cc.

Referenced by MapToEigenRow(), and mult().

◆ MapToEigen() [4/4]

Definition at line 1654 of file matpack_complex.cc.

◆ MapToEigenCol() [1/2]

ComplexMatrixViewMap MapToEigenCol ( ComplexVectorView A)

Definition at line 1697 of file matpack_complex.cc.

◆ MapToEigenCol() [2/2]

ConstComplexMatrixViewMap MapToEigenCol ( const ConstComplexVectorView A)

Definition at line 1667 of file matpack_complex.cc.

◆ MapToEigenRow() [1/2]

ComplexMatrixViewMap MapToEigenRow ( ComplexVectorView A)

Definition at line 1692 of file matpack_complex.cc.

References MapToEigen().

◆ MapToEigenRow() [2/2]

ConstComplexMatrixViewMap MapToEigenRow ( const ConstComplexVectorView A)

Definition at line 1662 of file matpack_complex.cc.

References MapToEigen().

◆ mult() [1/5]

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

Parameters
[in,out]AThe matrix A, that will hold the result of the multiplication.
[in]BThe matrix B
[in]CThe matrix C

Definition at line 1594 of file matpack_complex.cc.

◆ mult() [2/5]

void mult ( ComplexMatrixView  A,
const ConstComplexMatrixView B,
const ConstMatrixView C 
)

Definition at line 1607 of file matpack_complex.cc.

◆ mult() [3/5]

void mult ( ComplexMatrixView  A,
const ConstMatrixView B,
const ConstComplexMatrixView C 
)

Definition at line 1620 of file matpack_complex.cc.

◆ mult() [4/5]

◆ mult() [5/5]

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.

Parameters
[out]yThe length-m ComplexVectorView where the result is stored.
[in]MReference to the m-times-n Const{Complex,}MatrixView holding the matrix M.
[in]xReference to the length-n Const{Complex,}VectorView holding the vector x.

Definition at line 1569 of file matpack_complex.cc.

◆ operator*()

Complex operator* ( const ConstComplexVectorView a,
const ConstComplexVectorView b 
)

Scalar product.

The two vectors may be identical.

Definition at line 1544 of file matpack_complex.cc.

◆ operator<<() [1/2]

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 861 of file matpack_complex.cc.

◆ operator<<() [2/2]

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 131 of file matpack_complex.cc.

References Zeeman::end(), and v.

◆ swap() [1/2]

void swap ( ComplexMatrix m1,
ComplexMatrix m2 
)

Swaps two objects.

Definition at line 1465 of file matpack_complex.cc.

◆ swap() [2/2]

◆ transpose() [1/3]

Returns the transpose.

This creates a special MatrixView for the transpose. The original is not changed!

Definition at line 1505 of file matpack_complex.cc.

References ConstComplexVectorView::begin(), and ConstComplexVectorView::end().

◆ transpose() [2/3]

ComplexMatrixView transpose ( ComplexVector  v)

Returns the transpose.

This creates a special MatrixView for the transpose. The original is not changed!

Definition at line 1511 of file matpack_complex.cc.

References transpose(), and v.

◆ transpose() [3/3]