matpackII.h File Reference

Header file for sparse matrices. More...

#include "matpackI.h"

Include dependency graph for matpackII.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Sparse
 The Sparse class. More...

Functions

void abs (Sparse &A, const Sparse &B)
 Absolute value of sparse matrix elements.
void mult (VectorView y, const Sparse &M, ConstVectorView x)
 Sparse matrix - Vector multiplication.
void mult (MatrixView A, const Sparse &B, ConstMatrixView C)
 SparseMatrix - Matrix multiplication.
void mult (Sparse &A, const Sparse &B, const Sparse &C)
 Sparse - Sparse multiplication.
void transpose (Sparse &A, const Sparse &B)
 Transpose of sparse matrix.


Detailed Description

Header file for sparse matrices.

Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Tue Jul 15 15:05:40 2003
Notes:

There are two different ways to index: S.rw(3,4) = 1; // Read and write cout << S.ro(3,4); // Read only

This distinction is necessary, because rw() creates elements if they don't already exist.

The normal index operator "()" correspondes to ro, so "S(3,4)" is the same as S.ro(3,4).

Definition in file matpackII.h.


Function Documentation

void abs ( Sparse A,
const Sparse B 
)

Absolute value of sparse matrix elements.

Computes the absolute values of the elements in sparse matrix B.

The output matrix A must have been initialized with the correct size.

Parameters:
A Output: Absolute value matrix.
B Original matrix.
Author:
Mattias Ekstrom
Date:
2005-03-21

Definition at line 634 of file matpackII.cc.

References copy(), Sparse::mcolptr, Sparse::mdata, Sparse::mrowind, Sparse::ncols(), and Sparse::nrows().

void mult ( Sparse A,
const Sparse B,
const Sparse C 
)

Sparse - Sparse multiplication.

Calculates A = B*C, where result A is sparse, and B and C are also sparse.

Output comes first!

Dimensions of A, B, and C must match. No memory reallocation takes place, only the data is copied.

Parameters:
A Output: Result matrix.
B First product matrix.
C Second product matrix.
Author:
Mattias Ekstroem
Date:
2003-08-06

Definition at line 875 of file matpackII.cc.

References Sparse::mcolptr, Sparse::mcr, Sparse::mdata, Sparse::mrowind, Sparse::ncols(), Sparse::nrows(), Sparse::rw(), and Sparse::transpose.

void mult ( MatrixView  A,
const Sparse B,
ConstMatrixView  C 
)

SparseMatrix - Matrix multiplication.

Calculates the matrix product:

A = B*C, where B is sparse.

Output comes first!

Dimensions of A, B, and C must match. No memory reallocation takes place, only the data is copied.

Parameters:
A Output: Result matrix (full).
B First matrix to multiply (sparse).
C Second matrix to multiply (full).
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Tue Jul 15 15:05:40 2003

Definition at line 729 of file matpackII.cc.

References Sparse::mcolptr, Sparse::mdata, Sparse::mrowind, Sparse::ncols(), ConstMatrixView::ncols(), Sparse::nrows(), and ConstMatrixView::nrows().

void mult ( VectorView  y,
const Sparse M,
ConstVectorView  x 
)

Sparse matrix - Vector multiplication.

This calculates the product

y = M*x, where M is sparse.

Output comes first!

Dimensions of y, M, and x must match. No memory reallocation takes place, only the data is copied.

Parameters:
y Output: The multiplication result.
M Matrix for multiplication (sparse).
x Vector for multiplication.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Tue Jul 15 15:05:40 2003

Definition at line 676 of file matpackII.cc.

References Sparse::mcolptr, Sparse::mdata, Sparse::mrowind, Sparse::ncols(), ConstVectorView::nelem(), and Sparse::nrows().

void transpose ( Sparse A,
const Sparse B 
)

Transpose of sparse matrix.

Computes the transpose of the sparse matrix B.

The output matrix A must have been initialized with the correct size.

Parameters:
A Output: Transposed matrix.
B Original matrix.
Author:
Mattias Ekstroem
Date:
2003-08-05

Definition at line 785 of file matpackII.cc.

References Sparse::mcolptr, Sparse::mcr, Sparse::mdata, Sparse::mrowind, Sparse::ncols(), and Sparse::nrows().


Generated on Mon Mar 23 14:06:44 2009 for ARTS by  doxygen 1.5.6