14#include <dune/common/referencehelper.hh>
61 return RawScalarType{Dune::resolveRef(val) + Dune::resolveRef(v.val)};
69 return RawScalarType{Dune::resolveRef(val) - Dune::resolveRef(v.val)};
91 Dune::resolveRef(val) += Dune::resolveRef(v.val);
101 Dune::resolveRef(val) -= Dune::resolveRef(v.val);
111 Dune::resolveRef(val) *= v;
121 Dune::resolveRef(val) /= v;
A wrapper class for scalar types to facilitate reference passing in Python bindings.
Definition: scalarwrapper.hh:27
RawScalarType operator*(RawScalarType value) const
Multiplies the wrapped scalar value by another value.
Definition: scalarwrapper.hh:83
const RawScalarType & value() const
Gets the wrapped scalar value as a constant reference.
Definition: scalarwrapper.hh:47
RawScalarType operator-(const ScalarWrapper &v) const
Subtracts the value of another ScalarWrapper from this instance.
Definition: scalarwrapper.hh:68
ScalarWrapper & operator-=(const ScalarWrapper &v)
Subtracts another ScalarWrapper's value from this instance.
Definition: scalarwrapper.hh:100
RawScalarType & value()
Gets the wrapped scalar value as a reference.
Definition: scalarwrapper.hh:53
RawScalarType operator+(const ScalarWrapper &v) const
Adds the values of two ScalarWrapper instances. This returns the raw type since this makes makes no s...
Definition: scalarwrapper.hh:60
ScalarWrapper(T val)
Constructs a ScalarWrapper with the given value.
Definition: scalarwrapper.hh:32
friend RawScalarType operator*(RawScalarType f, const ScalarWrapper &v)
Multiplies a scalar value by a ScalarWrapper's value.
Definition: scalarwrapper.hh:134
ScalarWrapper & operator/=(RawScalarType v)
Divides the wrapped scalar value by another value and assigns the result.
Definition: scalarwrapper.hh:120
ScalarWrapper & operator*=(RawScalarType v)
Multiplies the wrapped scalar value by another value and assigns the result.
Definition: scalarwrapper.hh:110
ScalarWrapper & operator+=(const ScalarWrapper &v)
Adds another ScalarWrapper's value to this instance.
Definition: scalarwrapper.hh:90
Dune::ResolveRef_t< T > RawScalarType
Definition: scalarwrapper.hh:35
RawScalarType operator-() const
Negates the wrapped scalar value.
Definition: scalarwrapper.hh:76