|
SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
|
Scale an equation by a constant coefficient. More...
#include <arithmetic.hpp>
Public Types | |
| using | Test = typename EquationT::Test |
| The test type of the scaled equation is the same as the test type of the original equation. | |
Public Member Functions | |
| EquationScale (EquationT equation, const double coefficient) | |
| Construct a scaled equation. | |
| auto | contributions () const noexcept |
| Return the contributions of the scaled equation. | |
| double | coefficient () const noexcept |
| Return the coefficient of the scaled equation. | |
Static Public Attributes | |
| static constexpr std::string_view | name = "scaled equation" |
| Compile time name for the scaled equation, used for debugging and logging. | |
Private Attributes | |
| EquationT | m_equation |
| The equation being scaled. | |
| double | m_coefficient |
| The coefficient to scale the equation by. Must be finite. | |
Scale an equation by a constant coefficient.
This class is a compile-time tag that indicates that the weak contributions from a given equation should be scaled by the given coefficient. The actual scaling is performed by the backend. A simple example would be if the scale is set to 1 then the weak contributions would be integrated unchanged; whereas if the scale were set to -1 then the weak contributions would be integrated and then negated.
| EquationT | The equation type to scale. |
| using serif::equations::EquationScale< EquationT >::Test = typename EquationT::Test |
The test type of the scaled equation is the same as the test type of the original equation.
|
inlineexplicit |
Construct a scaled equation.
| equation | The equation to scale. |
| coefficient | The coefficient to scale the equation by. Must be finite. |
| Equation Contributions |
|---|
|
| std::invalid_argument | If the coefficient is not finite. |
|
inlinenodiscardnoexcept |
Return the coefficient of the scaled equation.
|
inlinenodiscardnoexcept |
Return the contributions of the scaled equation.
|
private |
The coefficient to scale the equation by. Must be finite.
|
private |
The equation being scaled.
|
staticconstexpr |
Compile time name for the scaled equation, used for debugging and logging.