BSplinebasis
Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations | Functions | Variables
bspline::operators Namespace Reference

Operator definitions. More...

Classes

class  Derivative
 Derivative operator. More...
 
class  IdentityOperator
 Multiplicative identity operator. More...
 
class  Operator
 Marker interface for operators. More...
 
class  OperatorProduct
 Represents the product of two operators. More...
 
class  OperatorSum
 Operator sum. Represents the sum or difference of two operators. More...
 
class  Position
 Position operator. More...
 
class  ScalarMultiplication
 Multiplication operator for Operator and scalar. More...
 
class  SplineOperator
 Operator representation of a Spline. More...
 

Typedefs

template<size_t n>
using Dx = Derivative< n >
 Convenient alias for derivative operator.
 
template<size_t n>
using X = Position< n >
 Alias for Position operator.
 

Enumerations

enum class  AdditionOperation { ADDITION , SUBTRACTION }
 

Functions

template<typename O1 , typename O2 , std::enable_if_t< are_operators_v< O1, O2 >, bool > = true>
OperatorProduct< O1, O2operator* (O1 &&o1, O2 &&o2)
 Operator multiplication operator.
 
template<typename O1 , typename O2 , std::enable_if_t< are_operators_v< O1, O2 >, bool > = true>
auto operator+ (O1 &&o1, O2 &&o2)
 Operator sum.
 
template<typename O1 , typename O2 , std::enable_if_t< are_operators_v< O1, O2 >, bool > = true>
auto operator- (O1 &&o1, O2 &&o2)
 Operator difference.
 
template<typename T , size_t order, typename O , std::enable_if_t< is_operator_v< O >, bool > = true>
auto transformSpline (const O &op, const Spline< T, order > &spline)
 Applies operator to spline.
 
template<typename O , typename S , std::enable_if_t< is_operator_v< O > &&is_spline_v< S >, bool > = true>
auto operator* (const O &o, const S &s)
 Applies an operator to a spline.
 
template<typename S >
 ScalarMultiplication (S s) -> ScalarMultiplication< S, IdentityOperator >
 ScalarMultiplication with default constructed operator.
 
template<typename S , typename O , std::enable_if_t< are_scalar_multiplication_types_v< S, O >, bool > = true>
ScalarMultiplication< S, Ooperator* (const S &s, O &&o)
 Scalar-Opertator multiplication.
 
template<typename S , typename O , std::enable_if_t< are_scalar_multiplication_types_v< S, O >, bool > = true>
ScalarMultiplication< S, Ooperator* (O &&o, const S &s)
 The scalar multiplication operator for an operator.
 
template<typename S , typename O , std::enable_if_t< are_scalar_multiplication_types_v< S, O >, bool > = true>
ScalarMultiplication< S, Ooperator/ (O &&o, const S &s)
 The scalar division operator for an operator.
 
template<typename S , typename O , std::enable_if_t< are_scalar_multiplication_types_v< S, O >, bool > = true>
auto operator+ (O &&o, const S &s)
 
template<typename S , typename O , std::enable_if_t< are_scalar_multiplication_types_v< S, O >, bool > = true>
auto operator+ (const S &s, O &&o)
 The scalar addition operator for an operator.
 
template<typename S , typename O , std::enable_if_t< are_scalar_multiplication_types_v< S, O >, bool > = true>
auto operator- (O &&o, const S &s)
 The scalar subtraction operator for an operator.
 
template<typename S , typename O , std::enable_if_t< are_scalar_multiplication_types_v< S, O >, bool > = true>
auto operator- (const S &s, O &&o)
 
template<typename O , std::enable_if_t< is_operator_v< O >, bool > = true>
ScalarMultiplication< int, Ooperator- (O &&o)
 Unitary minus operator.
 

Variables

template<AdditionOperation operation>
constexpr bool is_valid_operation_v
 Validates operation.
 
template<typename O >
constexpr bool is_operator_v
 Checks whether O is an operator.
 
template<typename O1 , typename O2 >
constexpr bool are_operators_v = is_operator_v<O1> &&is_operator_v<O2>
 Checks whether O1 and O2 are operators.
 
template<typename T , typename O >
constexpr bool are_scalar_multiplication_types_v
 Validates ScalarOperator template parameters.
 

Detailed Description

Operator definitions.

Operator definitions.

Typedef Documentation

◆ Dx

Convenient alias for derivative operator.

Alias for the derivative operator $\mathrm{d}^n/\mathrm{d}x^n$.

Template Parameters
nOrder of the derivative.

◆ X

Alias for Position operator.

Alias for the power $x^n$ of the position operator.

Template Parameters
nOrder of the power of the position operator.

Enumeration Type Documentation

◆ AdditionOperation

Indicates which operation the OperatorSum is supposed to perform.

Enumerator
ADDITION 

Perform addition.

SUBTRACTION 

Perform subtraction.

Function Documentation

◆ operator*() [1/4]

template<typename O , typename S , std::enable_if_t< is_operator_v< O > &&is_spline_v< S >, bool > = true>
auto bspline::operators::operator* ( const O o,
const S s 
)

Applies an operator to a spline.

Parameters
oThe operator.
sThe spline.
Template Parameters
OThe type of the operator.
SThe type of the spline.
Returns
The spline resulting from the application of the operator to the spline.

◆ operator*() [2/4]

template<typename S , typename O , std::enable_if_t< are_scalar_multiplication_types_v< S, O >, bool > = true>
ScalarMultiplication< S, O > bspline::operators::operator* ( const S s,
O &&  o 
)

Scalar-Opertator multiplication.

Deduction guide for a ScalarMultiplication of a scalar and an Operator.

Parameters
sThe scalar to be multiplied.
oThe operator to be multiplied.
Template Parameters
SThe type of the scalar.
OThe type of the operator to be multiplied.
Returns
The scaled operator.

◆ operator*() [3/4]

template<typename S , typename O , std::enable_if_t< are_scalar_multiplication_types_v< S, O >, bool > = true>
ScalarMultiplication< S, O > bspline::operators::operator* ( O &&  o,
const S s 
)

The scalar multiplication operator for an operator.

Parameters
oThe operator to be multiplied.
sThe scalar to be multiplied.
Template Parameters
SThe type of the scalar.
OThe type of the operator to be multiplied.
Returns
The scaled operator.

◆ operator*() [4/4]

template<typename O1 , typename O2 , std::enable_if_t< are_operators_v< O1, O2 >, bool > = true>
OperatorProduct< O1, O2 > bspline::operators::operator* ( O1 &&  o1,
O2 &&  o2 
)

Operator multiplication operator.

The multiplication operator for two operators, returning an OperatorProduct.

Parameters
o1The first (left) operator.
o2The second (right) operator.
Template Parameters
O1The type of the first (left) operator.
O2The type of the second (right) operator.

◆ operator+() [1/3]

template<typename S , typename O , std::enable_if_t< are_scalar_multiplication_types_v< S, O >, bool > = true>
auto bspline::operators::operator+ ( const S s,
O &&  o 
)

The scalar addition operator for an operator.

Parameters
sThe scalar to be added.
oThe operator to be added.
Template Parameters
SThe type of the scalar.
OThe type of the operator.
Returns
The shifted operator.

◆ operator+() [2/3]

template<typename S , typename O , std::enable_if_t< are_scalar_multiplication_types_v< S, O >, bool > = true>
auto bspline::operators::operator+ ( O &&  o,
const S s 
)

The scalar addition operator for an operator.

Parameters
oThe operator to be added.
sThe scalar to be added.
Template Parameters
SThe type of the scalar.
OThe type of the operator.
Returns
The shifted operator.

◆ operator+() [3/3]

template<typename O1 , typename O2 , std::enable_if_t< are_operators_v< O1, O2 >, bool > = true>
auto bspline::operators::operator+ ( O1 &&  o1,
O2 &&  o2 
)

Operator sum.

The addition operator for two operators, returning an OperatorSum.

Parameters
o1The first operator.
o2The second operator.
Template Parameters
O1The type of the first operator.
O2The type of the second operator.
Returns
The sum of the two input operators.

◆ operator-() [1/4]

template<typename S , typename O , std::enable_if_t< are_scalar_multiplication_types_v< S, O >, bool > = true>
auto bspline::operators::operator- ( const S s,
O &&  o 
)

The scalar subtraction operator for an operator.

Parameters
sThe scalar.
oThe operator to be subtracted.
Template Parameters
SThe type of the scalar.
OThe type of the operator.
Returns
The shifted and inverted operator.

◆ operator-() [2/4]

template<typename O , std::enable_if_t< is_operator_v< O >, bool > = true>
ScalarMultiplication< int, O > bspline::operators::operator- ( O &&  o)

Unitary minus operator.

The unitary minus operator for an operator. Returns an ScalarMultiplication<int, O>.

Parameters
oThe operator to be negated.
Template Parameters
OThe type of the operator to be negated.
Returns
The inverted operator.

◆ operator-() [3/4]

template<typename S , typename O , std::enable_if_t< are_scalar_multiplication_types_v< S, O >, bool > = true>
auto bspline::operators::operator- ( O &&  o,
const S s 
)

The scalar subtraction operator for an operator.

Parameters
oThe operator.
sThe scalar to be subtracted.
Template Parameters
SThe type of the scalar.
OThe type of the operator.
Returns
The shifted operator.

◆ operator-() [4/4]

template<typename O1 , typename O2 , std::enable_if_t< are_operators_v< O1, O2 >, bool > = true>
auto bspline::operators::operator- ( O1 &&  o1,
O2 &&  o2 
)

Operator difference.

The subtraction operator for two operators, returning an OperatorSum.

Parameters
o1The first operator.
o2The second operator.
Template Parameters
O1The type of the first operator.
O2The type of the second operator.
Returns
the difference of the two input operators.

◆ operator/()

template<typename S , typename O , std::enable_if_t< are_scalar_multiplication_types_v< S, O >, bool > = true>
ScalarMultiplication< S, O > bspline::operators::operator/ ( O &&  o,
const S s 
)

The scalar division operator for an operator.

Parameters
oThe operator to be divided.
sThe divisor.
Template Parameters
SThe type of the scalar.
OThe type of the operator to be divided.
Returns
The scaled operator.

◆ ScalarMultiplication()

ScalarMultiplication with default constructed operator.

Deduction guide for a ScalarMultiplication constructed from a scalar alone.

Template Parameters
SThe type of the scalar.

◆ transformSpline()

template<typename T , size_t order, typename O , std::enable_if_t< is_operator_v< O >, bool > = true>
auto bspline::operators::transformSpline ( const O op,
const Spline< T, order > &  spline 
)

Applies operator to spline.

Helper method that applies an operator to a spline based on the transformation of the coefficients on a single interval.

Parameters
opThe operator to apply to the spline.
splineThe spline to apply the operator to.
Template Parameters
TThe datatype of the input and output splines.
orderThe order of the input spline.
OThe type of the operator.
Returns
The spline resulting from the application of this operator to the spline.

Variable Documentation

◆ are_operators_v

template<typename O1 , typename O2 >
constexpr bool bspline::operators::are_operators_v = is_operator_v<O1> &&is_operator_v<O2>
inlineconstexpr

Checks whether O1 and O2 are operators.

Indicates whether both template parameters are operator types.

Template Parameters
O1First template parameter.
O2Second template parameter.

◆ are_scalar_multiplication_types_v

template<typename T , typename O >
constexpr bool bspline::operators::are_scalar_multiplication_types_v
inlineconstexpr
Initial value:
=
!is_spline_v<T> && !is_operator_v<T> && is_operator_v<O>

Validates ScalarOperator template parameters.

Indicates whether the argument types may be arguments of a scalar multiplication (i.e. a scalar multiplied with an operator).

Template Parameters
TScalar type.
OOperator type.

◆ is_operator_v

template<typename O >
constexpr bool bspline::operators::is_operator_v
inlineconstexpr
Initial value:
=
std::is_base_of_v<Operator, std::remove_cv_t<std::remove_reference_t<O>>>

Checks whether O is an operator.

Indicates whether the template parameter is an operator type.

Template Parameters
OTemplate parameter.

◆ is_valid_operation_v

template<AdditionOperation operation>
constexpr bool bspline::operators::is_valid_operation_v
inlineconstexpr
Initial value:
= (operation ==
AdditionOperation::ADDITION) ||
(operation ==
AdditionOperation::SUBTRACTION)

Validates operation.

Checks whether the operation is a valid oeration for OperatorSum.

Template Parameters
operationThe operation type to be checked.