CoDiPack  2.2.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
codi::LinearSystemSolverHandler< T_LinearSystem, typename > Struct Template Reference

#include <linearSystemHandler.hpp>

Public Types

using LinearSystem = T_LinearSystem
 See LinearSystemSolverHandler.
 
using Matrix = typename LinearSystem::Matrix
 See LinearSystemInterfaceTypes.
 
using MatrixIdentifier = typename LinearSystem::MatrixIdentifier
 See LinearSystemInterfaceTypes.
 
using MatrixReal = typename LinearSystem::MatrixReal
 See LinearSystemInterfaceTypes.
 
using Type = typename LinearSystem::Type
 See LinearSystemInterfaceTypes.
 
using Vector = typename LinearSystem::Vector
 See LinearSystemInterfaceTypes.
 
using VectorIdentifier = typename LinearSystem::VectorIdentifier
 See LinearSystemInterfaceTypes.
 
using VectorReal = typename LinearSystem::VectorReal
 See LinearSystemInterfaceTypes.
 

Public Member Functions

void solve (LinearSystem lsi, Matrix *A, Vector *b, Vector *x, LinearSystemSolverHints hints)
 

Detailed Description

template<typename T_LinearSystem, typename = void>
struct codi::LinearSystemSolverHandler< T_LinearSystem, typename >

Solves Ax=b and registers an external function on the tape which solves the specific AD mode equations.

Forward mode: x_d = A_v^-1 * (b_d - A_d * x_v)
Reverse mode:
  s = A_v^T^-1 * x_b
  A_b += -x_v * s^T
  b_b += s
  x_b = 0

The hints steer the algorithm, see LinearSystemInterface for details.

See Example 21 - Special handling of linear system solvers for an example use of this class.

Template Parameters
T_LinearSystemImplementation of LinearSystemInterface.

Member Function Documentation

◆ solve()

template<typename T_LinearSystem , typename = void>
void codi::LinearSystemSolverHandler< T_LinearSystem, typename >::solve ( LinearSystem lsi,
Matrix * A,
Vector * b,
Vector * x,
LinearSystemSolverHints hints )
inline

Solves the linear system Ax=b and adds an external function to the tape.

The hints steer the memory management and computations of the algorithm.


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