Class template Dune::XT::Functions::CombinedFunction¶
Inherits from Dune::XT::Functions::FunctionInterface.
-
template<class LeftType, class RightType, class comb>
class Dune::XT::Functions::CombinedFunction<LeftType, RightType, comb> : public FunctionInterface<LeftType::d, internal::CombinedHelper<LeftType, RightType, comb>::r, internal::CombinedHelper<LeftType, RightType, comb>::rC, typename internal::CombinedHelper<LeftType, RightType, comb>::R>¶ Combined function.
using ConstantType = Functions::ConstantFunction< …, double>; ConstantType one( … ); ConstantType two( … ); // the following code auto difference = one - two; // is equivalent to Difference< ConstantType, ConstantType > difference(one, two); // and internal::Combined< ConstantType, ConstantType, CombinationType::difference > difference(one, tow);
using ConstantType = Functions::ConstantFunction< …, double >; Difference< ConstantType, ConstantType > stupid_difference() { ConstantType one( … ); ConstantType two( … ); return one - two; }
using ConstantType = Functions::ConstantFunction< …, double >; Difference< ConstantType, ConstantType > stupid_difference() { auto one = std::make_shared< ConstantType >(1); auto two = std::make_shared< ConstantType >(2); return Difference< ConstantType, ConstantType >(one, two) }
This class combines two given functions of type LeftType and RightType using the given combination Combination. This class (and any derived class, like Difference, Sum or Product) can be used in two ways: - You can pass references of the left and right operand to this class. This is done for instance when calling operator+, operator- or operator* on any function deriving from FunctionInterface:
In this situation you are responsible to ensure that the arguments given are valid throughout the lifetime of this class. The following will lead to a segfault:
You can pass shared_ptr of the left and right operands to this class. In this case the following is valid:
Note
Most likely you do not want to use this class diretly, but one of Difference, Sum or Product.
Method Dune::XT::Functions::CombinedFunction::copy_as_function_impl¶
-
template<class LeftType, class RightType, class comb>
ThisType *Dune::XT::Functions::CombinedFunction<LeftType, RightType, comb>::copy_as_function_impl() const override¶ No documentation provided.
Method Dune::XT::Functions::CombinedFunction::copy_as_function¶
-
template<class LeftType, class RightType, class comb>
int Dune::XT::Functions::CombinedFunction<LeftType, RightType, comb>::copy_as_function() const¶ No documentation provided.
Method Dune::XT::Functions::CombinedFunction::name¶
-
template<class LeftType, class RightType, class comb>
std::string Dune::XT::Functions::CombinedFunction<LeftType, RightType, comb>::name() const final¶ No documentation provided.
Method Dune::XT::Functions::CombinedFunction::order¶
Method Dune::XT::Functions::CombinedFunction::evaluate¶
Method Dune::XT::Functions::CombinedFunction::jacobian¶
Constructor Dune::XT::Functions::CombinedFunction::CombinedFunction<LeftType, RightType, comb>¶
Constructor Dune::XT::Functions::CombinedFunction::CombinedFunction<LeftType, RightType, comb>¶
Constructor Dune::XT::Functions::CombinedFunction::CombinedFunction<LeftType, RightType, comb>¶
Field Dune::XT::Functions::CombinedFunction::left_¶
-
int Dune::XT::Functions::CombinedFunction::left_¶
No documentation provided.
Field Dune::XT::Functions::CombinedFunction::right_¶
-
int Dune::XT::Functions::CombinedFunction::right_¶
No documentation provided.
Field Dune::XT::Functions::CombinedFunction::name_¶
-
const std::string Dune::XT::Functions::CombinedFunction::name_¶
No documentation provided.
Type alias Dune::XT::Functions::CombinedFunction::BaseType¶
-
type Dune::XT::Functions::CombinedFunction::BaseType¶
No documentation provided.
Type alias Dune::XT::Functions::CombinedFunction::ThisType¶
-
type Dune::XT::Functions::CombinedFunction::ThisType¶
No documentation provided.
Type alias Dune::XT::Functions::CombinedFunction::Helper¶
-
type Dune::XT::Functions::CombinedFunction::Helper¶
No documentation provided.