SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
Loading...
Searching...
No Matches
serif::equations::EquationDifference< LeftT, RightT > Class Template Referencefinal

Subtract one equation from another. More...

#include <arithmetic.hpp>

Collaboration diagram for serif::equations::EquationDifference< LeftT, RightT >:
[legend]

Public Types

using Test = typename LeftT::Test
 The test type of the difference equation is the same as the test type of the left equation.
 

Public Member Functions

 EquationDifference (LeftT left, RightT right)
 Construct a difference equation.
 
const auto & contributions () const noexcept
 Return the contributions of the difference equation.
 

Static Public Attributes

static constexpr std::string_view name = "equation difference"
 Compile time name for the difference equation, used for debugging and logging.
 

Private Attributes

EquationSum< LeftT, EquationScale< RightT > > m_equation
 The equation representing the difference, which is a sum of the left equation and the scaled right equation (scaled by -1).
 

Detailed Description

template<Equation LeftT, Equation RightT>
requires std::same_as<typename LeftT::Test, typename RightT::Test>
class serif::equations::EquationDifference< LeftT, RightT >

Subtract one equation from another.

This class is a compile-time tag that indicates that the weak contributions from the right equation should be subtracted from the weak contributions of the left equation. The actual subtraction is performed by the backend. A simple example would be if the left equation has a weak contribution of 1 and the right equation has a weak contribution of 2, then the final residual would be -1.

Requirements
  • The left and right equations must share the same test type, otherwise the subtraction is not well-defined.
Equation Contributions
  • Residuals to all rows which are shared by the summed equations
Note
Only equations sharing a residual row can or should be subtracted from one another.
Template Parameters
LeftTThe left equation type to subtract from.
RightTThe right equation type to subtract.

Member Typedef Documentation

◆ Test

template<Equation LeftT, Equation RightT>
using serif::equations::EquationDifference< LeftT, RightT >::Test = typename LeftT::Test

The test type of the difference equation is the same as the test type of the left equation.

Constructor & Destructor Documentation

◆ EquationDifference()

template<Equation LeftT, Equation RightT>
serif::equations::EquationDifference< LeftT, RightT >::EquationDifference ( LeftT left,
RightT right )
inlineexplicit

Construct a difference equation.

Parameters
leftThe left equation to subtract from.
rightThe right equation to subtract.

Member Function Documentation

◆ contributions()

template<Equation LeftT, Equation RightT>
const auto & serif::equations::EquationDifference< LeftT, RightT >::contributions ( ) const
inlinenodiscardnoexcept

Return the contributions of the difference equation.

Returns
A tuple containing the contributions of the difference equation.

Member Data Documentation

◆ m_equation

template<Equation LeftT, Equation RightT>
EquationSum<LeftT, EquationScale<RightT> > serif::equations::EquationDifference< LeftT, RightT >::m_equation
private

The equation representing the difference, which is a sum of the left equation and the scaled right equation (scaled by -1).

◆ name

template<Equation LeftT, Equation RightT>
std::string_view serif::equations::EquationDifference< LeftT, RightT >::name = "equation difference"
staticconstexpr

Compile time name for the difference equation, used for debugging and logging.


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