ARTS 2.5.4 (git: 31ce4f0e)
matpack_complex.cc File Reference
#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. 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)
 
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 468 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 1287 of file matpack_complex.cc.

References ComplexVectorView::begin(), Constant::e, ComplexVectorView::end(), 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 456 of file matpack_complex.cc.

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

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

References ComplexVectorView::begin(), ConstComplexVectorView::begin(), Constant::e, ConstComplexVectorView::end(), and Zeeman::end().

◆ copy() [5/5]

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

Copy a scalar to all elements.

Definition at line 1296 of file matpack_complex.cc.

References ComplexVectorView::begin(), Constant::e, ComplexVectorView::end(), 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 1631 of file matpack_complex.cc.

References c.

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

◆ mult() [2/5]

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

Definition at line 1576 of file matpack_complex.cc.

◆ mult() [3/5]

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

Definition at line 1590 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 1537 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 1512 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 855 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 133 of file matpack_complex.cc.

◆ swap() [1/2]

void swap ( ComplexMatrix m1,
ComplexMatrix m2 
)

Swaps two objects.

Definition at line 1433 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 1473 of file matpack_complex.cc.

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

References transpose(), and v.

◆ transpose() [3/3]