Mundy: Multibody Nonlocal Dynamics Version of the Day
Loading...
Searching...
No Matches
mundy::LinearSystem< Backend, LinearOp, RhsVector, Workspace > Class Template Reference

The linear system A x = b for a square operator A. More...

#include <linear_system.hpp>

Public Types

using backend_t = Backend
using linear_op_storage_t = ::mundy::storage<LinearOp>
using rhs_vector_storage_t = ::mundy::storage<RhsVector>
using linear_op_t = typename linear_op_storage_t::value_type
using rhs_vector_t = typename rhs_vector_storage_t::value_type
using workspace_t = Workspace
using value_type = impl::vector_value_type<rhs_vector_t>

Public Member Functions

 LinearSystem (Backend, LinearOp &&A, RhsVector &&b)
 LinearSystem (Backend, LinearOp &&A, RhsVector &&b, workspace_t workspace)
Backend backend () const
const auto & A () const
const auto & b () const
workspace_tworkspace () const
 Cached scratch state for evaluating A (mutated during a solve).

Detailed Description

template<typename Backend, typename LinearOp, typename RhsVector, typename Workspace = impl::workspace_for_t<std::remove_cvref_t<LinearOp>>>
class mundy::LinearSystem< Backend, LinearOp, RhsVector, Workspace >

Pairs the operator with its right-hand side and a mutable workspace; unconstrained (no convex space). A must be square; CG (this header) additionally requires it to be SPD.

Member Typedef Documentation

◆ backend_t

template<typename Backend, typename LinearOp, typename RhsVector, typename Workspace = impl::workspace_for_t<std::remove_cvref_t<LinearOp>>>
using mundy::LinearSystem< Backend, LinearOp, RhsVector, Workspace >::backend_t = Backend

◆ linear_op_storage_t

template<typename Backend, typename LinearOp, typename RhsVector, typename Workspace = impl::workspace_for_t<std::remove_cvref_t<LinearOp>>>
using mundy::LinearSystem< Backend, LinearOp, RhsVector, Workspace >::linear_op_storage_t = ::mundy::storage<LinearOp>

◆ rhs_vector_storage_t

template<typename Backend, typename LinearOp, typename RhsVector, typename Workspace = impl::workspace_for_t<std::remove_cvref_t<LinearOp>>>
using mundy::LinearSystem< Backend, LinearOp, RhsVector, Workspace >::rhs_vector_storage_t = ::mundy::storage<RhsVector>

◆ linear_op_t

template<typename Backend, typename LinearOp, typename RhsVector, typename Workspace = impl::workspace_for_t<std::remove_cvref_t<LinearOp>>>
using mundy::LinearSystem< Backend, LinearOp, RhsVector, Workspace >::linear_op_t = typename linear_op_storage_t::value_type

◆ rhs_vector_t

template<typename Backend, typename LinearOp, typename RhsVector, typename Workspace = impl::workspace_for_t<std::remove_cvref_t<LinearOp>>>
using mundy::LinearSystem< Backend, LinearOp, RhsVector, Workspace >::rhs_vector_t = typename rhs_vector_storage_t::value_type

◆ workspace_t

template<typename Backend, typename LinearOp, typename RhsVector, typename Workspace = impl::workspace_for_t<std::remove_cvref_t<LinearOp>>>
using mundy::LinearSystem< Backend, LinearOp, RhsVector, Workspace >::workspace_t = Workspace

◆ value_type

template<typename Backend, typename LinearOp, typename RhsVector, typename Workspace = impl::workspace_for_t<std::remove_cvref_t<LinearOp>>>
using mundy::LinearSystem< Backend, LinearOp, RhsVector, Workspace >::value_type = impl::vector_value_type<rhs_vector_t>

Constructor & Destructor Documentation

◆ LinearSystem() [1/2]

template<typename Backend, typename LinearOp, typename RhsVector, typename Workspace = impl::workspace_for_t<std::remove_cvref_t<LinearOp>>>
mundy::LinearSystem< Backend, LinearOp, RhsVector, Workspace >::LinearSystem ( Backend ,
LinearOp && A,
RhsVector && b )
inline

◆ LinearSystem() [2/2]

template<typename Backend, typename LinearOp, typename RhsVector, typename Workspace = impl::workspace_for_t<std::remove_cvref_t<LinearOp>>>
mundy::LinearSystem< Backend, LinearOp, RhsVector, Workspace >::LinearSystem ( Backend ,
LinearOp && A,
RhsVector && b,
workspace_t workspace )
inline

Member Function Documentation

◆ backend()

template<typename Backend, typename LinearOp, typename RhsVector, typename Workspace = impl::workspace_for_t<std::remove_cvref_t<LinearOp>>>
Backend mundy::LinearSystem< Backend, LinearOp, RhsVector, Workspace >::backend ( ) const
inline

◆ A()

template<typename Backend, typename LinearOp, typename RhsVector, typename Workspace = impl::workspace_for_t<std::remove_cvref_t<LinearOp>>>
const auto & mundy::LinearSystem< Backend, LinearOp, RhsVector, Workspace >::A ( ) const
inline

◆ b()

template<typename Backend, typename LinearOp, typename RhsVector, typename Workspace = impl::workspace_for_t<std::remove_cvref_t<LinearOp>>>
const auto & mundy::LinearSystem< Backend, LinearOp, RhsVector, Workspace >::b ( ) const
inline

◆ workspace()

template<typename Backend, typename LinearOp, typename RhsVector, typename Workspace = impl::workspace_for_t<std::remove_cvref_t<LinearOp>>>
workspace_t & mundy::LinearSystem< Backend, LinearOp, RhsVector, Workspace >::workspace ( ) const
inline

One Problem must not back two concurrent solves; construct a fresh Problem per concurrent solve.