MFEM v2.0
Functions
sparsemat.cpp File Reference
#include <iostream>
#include <iomanip>
#include <math.h>
#include "linalg.hpp"
#include "../general/table.hpp"
Include dependency graph for sparsemat.cpp:

Go to the source code of this file.

Functions

void SparseMatrixFunction (SparseMatrix &S, double(*f)(double))
 Applies f() to each element of the matrix (after it is finalized).
SparseMatrixTranspose (SparseMatrix &A)
 Transpose of a sparse matrix. A must be finalized.
SparseMatrixMult (SparseMatrix &A, SparseMatrix &B, SparseMatrix *OAB)
SparseMatrixRAP (SparseMatrix &A, SparseMatrix &R, SparseMatrix *ORAP)
SparseMatrixMult_AtDA (SparseMatrix &A, Vector &D, SparseMatrix *OAtDA)

Function Documentation

SparseMatrix* Mult ( SparseMatrix A,
SparseMatrix B,
SparseMatrix OAB = NULL 
)

Matrix product A.B. If OAB is not NULL, we assume it has the structure of A.B and store the result in OAB. If OAB is NULL, we create a new SparseMatrix to store the result and return a pointer to it. All matrices must be finalized.

Definition at line 1430 of file sparsemat.cpp.

References SparseMatrix::GetData(), SparseMatrix::GetI(), SparseMatrix::GetJ(), mfem_error(), Operator::Size(), and SparseMatrix::Width().

SparseMatrix* Mult_AtDA ( SparseMatrix A,
Vector D,
SparseMatrix OAtDA = NULL 
)

Matrix multiplication A^t D A. All matrices must be finalized.

Definition at line 1550 of file sparsemat.cpp.

References Mult(), and Transpose().

SparseMatrix* RAP ( SparseMatrix A,
SparseMatrix R,
SparseMatrix ORAP = NULL 
)

RAP matrix product. ORAP is like OAB above. All matrices must be finalized.

Definition at line 1539 of file sparsemat.cpp.

References Mult(), and Transpose().

void SparseMatrixFunction ( SparseMatrix S,
double(*)(double)  f 
)

Applies f() to each element of the matrix (after it is finalized).

Definition at line 1379 of file sparsemat.cpp.

References SparseMatrix::GetData(), and SparseMatrix::NumNonZeroElems().

SparseMatrix* Transpose ( SparseMatrix A)

Transpose of a sparse matrix. A must be finalized.

Definition at line 1388 of file sparsemat.cpp.

References SparseMatrix::GetData(), SparseMatrix::GetI(), SparseMatrix::GetJ(), SparseMatrix::NumNonZeroElems(), Operator::Size(), and SparseMatrix::Width().

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines