Into

Modules

Documentation

classPii::UnaryCompose

#include <PiiFunctional.h>

A unary function adaptor that makes the result of one unary function the argument of another.

Inherits Pii::UnaryFunction< AdaptableUnaryFunction2::argument_type, AdaptableUnaryFunction1::result_type >

Description

If function 1 is f(x) and function 2 is g(x), the composition returns f(g(x)).

 PiiMatrix<double> mat(1,5, 1.0, 2.0, 3.0, 4.0, 5.0);
 // Calculate -sin(x)
 mat.map(Pii::unaryCompose(std::negate(), std::ptr_fun(sin)));
See also

Constructors and destructor

(
  • const AdaptableUnaryFunction1 & op1
  • const AdaptableUnaryFunction2 & op2
)

Construct a UnaryCompose object.

Public member functions

AdaptableUnaryFunction1::result_type
(
  • const typename AdaptableUnaryFunction2::argument_type & value
)
template<class AdaptableUnaryFunction1, class AdaptableUnaryFunction2>
UnaryCompose< AdaptableUnaryFunction1, AdaptableUnaryFunction2 >
(
  • const AdaptableUnaryFunction1 & op1
  • const AdaptableUnaryFunction2 & op2
)

Construct a composed unary function (UnaryCompose) out of two adaptable unary functions.

Function details

  • UnaryCompose

    (
    • const AdaptableUnaryFunction1 & op1
    • const AdaptableUnaryFunction2 & op2
    )
    [inline]

    Construct a UnaryCompose object.

    It is seldom necessary to use the constructor directly. Use the unaryCompose() function instead.

  • AdaptableUnaryFunction1::result_type operator()

    (
    • const typename AdaptableUnaryFunction2::argument_type & value
    )
    [inline]
  • template<class AdaptableUnaryFunction1, class AdaptableUnaryFunction2>

    UnaryCompose< AdaptableUnaryFunction1, AdaptableUnaryFunction2 > unaryCompose

    (
    • const AdaptableUnaryFunction1 & op1
    • const AdaptableUnaryFunction2 & op2
    )
    [inline]

    Construct a composed unary function (UnaryCompose) out of two adaptable unary functions.

Notes (0)

Add a note

Not a single note added yet. Be the first, add yours.