SpatialOps
SpatialOps::LinearSolve< FieldT > Class Template Reference

Find the solution to result = inv(mat) * rhsVec with LU decomposition. More...

#include <MatVecOps.h>

Public Types

typedef FieldVector< FieldT > RightT
 right operand is a vector
 
typedef FieldMatrix< FieldT > LeftT
 left operand is a matrix
 
typedef FieldVector< FieldT > ResultT
 result is a vector
 
typedef FieldT::value_type ValT
 underlying data type, double by default
 

Static Public Member Functions

static void cpu_launch (ResultT *const result, const LeftT &mat, const RightT &vec)
 this method is the interface to receive needed pointers More...
 
static void gpu_launch (ResultT *const result, const LeftT &mat, const RightT &vec)
 this method is the interface to receive needed pointers More...
 

Detailed Description

template<typename FieldT>
class SpatialOps::LinearSolve< FieldT >

Find the solution to result = inv(mat) * rhsVec with LU decomposition.

This operator finds the solution vector, x, in the linear equation A; stated differently, we find the solution of x = inv(A) *b with LU decomposition, we never actually compute inv(A) explicitly (except on GPU). This operation is performed using an external library, currently cublas, boost::ublas or Eigen, which is an option in the makefile. More info included at the operate method.

Definition at line 706 of file MatVecOps.h.

Member Function Documentation

◆ cpu_launch()

template<typename FieldT >
void SpatialOps::LinearSolve< FieldT >::cpu_launch ( ResultT *const  result,
const LeftT mat,
const RightT vec 
)
static

this method is the interface to receive needed pointers

Parameters
resultResultT* const the vector "x" in Ax=b
matconst LeftT& the "A" matrix in Ax=b
vecconst RightT& the vector "b" in Ax=b
Returns
void

This method provides the operator with the pointers to the elements in both the right and left hand side. Because we are using an external library, we schedule multicore execution using our thread pool directly. The operate method is called on each available thread and the actual calculation is performed there.

Definition at line 1358 of file MatVecOps.h.

References SpatialOps::ThreadPoolFIFO::self(), and SpatialOps::Semaphore::wait().

Here is the call graph for this function:

◆ gpu_launch()

template<typename FieldT >
void SpatialOps::LinearSolve< FieldT >::gpu_launch ( ResultT *const  result,
const LeftT mat,
const RightT vec 
)
static

this method is the interface to receive needed pointers

Parameters
resultResultT* const the vector "x" in Ax=b
matconst LeftT& the "A" matrix in Ax=b
vecconst RightT& the vector "b" in Ax=b
Returns
void

This method provides the operator with the pointers to the elements in both the right and left hand side.

Definition at line 1345 of file MatVecOps.h.


The documentation for this class was generated from the following file: