plll  1.0
plll::arithmetic::expressions Namespace Reference

Expression templates. More...

Classes

class  AbsOp
 Returns the absolute value of the operand. More...
 
class  AbsOp_Context
 Returns the absolute value of the operand. Uses the context stored in the operator. More...
 
class  ACosOp
 Returns the arcus cosine of the operand. More...
 
class  ACosOp_Context
 Returns the arcus cosine of the operand. Uses the context stored in the operator. More...
 
class  AddOp
 Returns the sum of the operands. More...
 
class  AndOp
 Returns the bitwise AND of the operands. More...
 
class  ASinOp
 Returns the arcus sine of the operand. More...
 
class  ASinOp_Context
 Returns the arcus sine of the operand. Uses the context stored in the operator. More...
 
class  ATan2Op
 Returns the arcus tangent of the quotient of the operands. More...
 
class  ATan2Op_Context
 Returns the arcus tangent of the quotient of the operands. Uses the context stored in the operator. More...
 
class  ATanOp
 Returns the arcus tangent of the operand. More...
 
class  ATanOp_Context
 Returns the arcus tangent of the operand. Uses the context stored in the operator. More...
 
class  BitInvOp
 Returns the bitwise inversion of the operands. More...
 
class  CeilDivOp
 Returns the ceil of the quotient of the two operands. More...
 
class  ConversionWrapper
 Wraps a native type for a conversion. More...
 
class  ConvertCeilOp_Context
 Converts the argument to the destination type by rounding up (ceil). Uses the context stored in the operator. More...
 
class  ConvertFloorOp_Context
 Converts the argument to the destination type by rounding down (floor). Uses the context stored in the operator. More...
 
class  ConvertOp_Context
 Converts the argument to the destination type. Uses the context stored in the operator. More...
 
class  ConvertRound2Op_Context
 Converts the argument to the destination type by rounding. Uses the context stored in the operator and stores the rounding direction in the provided bool reference. More...
 
class  ConvertRoundOp_Context
 Converts the argument to the destination type by rounding. Uses the context stored in the operator. More...
 
class  CosOp
 Returns the cosine of the operand. More...
 
class  CosOp_Context
 Returns the cosine of the operand. Uses the context stored in the operator. More...
 
class  DivOp
 Returns the quotient of the operands. More...
 
class  ExpOp
 Returns the exponential of the operand. More...
 
class  ExpOp_Context
 Returns the exponential of the operand. Uses the context stored in the operator. More...
 
class  Expression
 Represents an expression. More...
 
class  FloorDivOp
 Returns the floor of the quotient of the two operands. More...
 
class  GammaOp
 Returns the Gamma function evaluated of the operand. More...
 
class  GammaOp_Context
 Returns the Gamma function evaluated of the operand. Uses the context stored in the operator. More...
 
class  GCDOp
 Returns the GCD of the two operands. More...
 
class  LCMOp
 Returns the LCM of the two operands. More...
 
class  LGamma2Op
 Returns the logarithm of the absolute value of the Gamma function evaluated of the operand together with the sign of the Gamma function. More...
 
class  LGamma2Op_Context
 Returns the logarithm of the absolute value of the Gamma function evaluated of the operand together with the sign of the Gamma function. Uses the context stored in the operator. More...
 
class  LGammaOp
 Returns the logarithm of the absolute value of the Gamma function evaluated of the operand. More...
 
class  LGammaOp_Context
 Returns the logarithm of the absolute value of the Gamma function evaluated of the operand. Uses the context stored in the operator. More...
 
class  Log10Op
 Returns the logarithm to base 10 of the operand. More...
 
class  Log10Op_Context
 Returns the logarithm to base 10 of the operand. Uses the context stored in the operator. More...
 
class  Log2Op
 Returns the logarithm to base 2 of the operand. More...
 
class  Log2Op_Context
 Returns the logarithm to base 2 of the operand. Uses the context stored in the operator. More...
 
class  LogOp
 Returns the natural logarithm of the operand. More...
 
class  LogOp_Context
 Returns the natural logarithm of the operand. Uses the context stored in the operator. More...
 
class  ModOp
 Returns the remainder of the operands. More...
 
class  MulOp
 Returns the product of the operands. More...
 
class  NegOp
 Returns the negative of the operand. More...
 
struct  NoData
 A simple "no data" indicator. More...
 
class  NoneOp
 Simply provides the data without any modifications. More...
 
class  OrOp
 Returns the bitwise OR of the operands. More...
 
struct  PowerCOp
 Returns the power of the operand to a constant stored in the operator object. More...
 
struct  PowerCOp_Context
 Returns the power of the operand to a constant stored in the operator object. Uses the context stored in the operator. More...
 
class  PowerOp
 Returns the power of the first operand to the second operand. More...
 
class  PowerOp_Context
 Returns the power of the first operand to the second operand. Uses the context stored in the operator. More...
 
class  RoundDivOp
 Returns the rounded quotient of the two operands. More...
 
class  ShiftCOp
 Returns the operand multiplied by 2 to the power of a constant. More...
 
class  ShLOp
 Returns the first operand multiplied by 2 to the power of the second operand. More...
 
class  ShROp
 Returns the first operand divided by 2 to the power of the second operand. More...
 
class  SinOp
 Returns the sine of the operand. More...
 
class  SinOp_Context
 Returns the sine of the operand. Uses the context stored in the operator. More...
 
class  SqrtCeilOp
 Returns the ceil of the square root of the operand. More...
 
class  SqrtFloorOp
 Returns the floor of the square root of the operand. More...
 
class  SqrtOp
 Returns the square root of the operand. More...
 
class  SqrtOp_Context
 Returns the square root of the operand. Uses the context stored in the operator. More...
 
class  SquareOp
 Returns the square of the operand. More...
 
class  SquareOp_Context
 Returns the square of the operand. Uses the context stored in the operator. More...
 
class  SubOp
 Returns the difference of the operands. More...
 
class  TanOp
 Returns the tangent of the operand. More...
 
class  TanOp_Context
 Returns the tangent of the operand. Uses the context stored in the operator. More...
 
class  Wrapper
 Wraps a variable to behave similarly to an Expression<> object. More...
 
class  XOROp
 Returns the bitwise XOR (exclusive or) of the operands. More...
 

Functions

template<typename Context , class Data , class Op >
void do_assign (typename Context::Type &x, const Op &op, const Data &data)
 Performs the assignment of the expression to x. More...
 
template<typename Context >
Expression< Context, Wrapper
< Context >, NoneOp
make_expression (const typename Context::Type &a)
 Creates an expression from a type.
 

Detailed Description

Expression templates.

This namespace contains all facilities required to implement expression templates for arithmetic. It is used to provide arithmetic for the arithmetic::Integer, arithmetic::Real and arithmetic::Rational types.

An expression arithmetic::expressions::Expression<Context, Data, Op> consists of three parts:

  • an arithmetic context Context describing the result;
  • arbitrary data of type Data, which describes the operands of the operation and can be other expressions, wrappers (see the expressions::Wrapper<> template)
  • a operation, modelled by a template template parameter Op, which is instanciated with the context and the data type.

Types using expression templates should provide constructors and assignment operators which call the evaluateTo() method of the expression; otherwise, it will be evaluated by calling the cast operator which returns an object of type Context::Type.

Function Documentation

template<typename Context , class Data , class Op >
void plll::arithmetic::expressions::do_assign ( typename Context::Type &  x,
const Op &  op,
const Data &  data 
)

Performs the assignment of the expression to x.

This function is provided to allow overloading for specialized situations. For example, if the underlying type provides an addmul() function, overloading this function for certain expression constructs allows to use this function.

By default, the operator object's assignTo() function is called to do this assignment.

Parameters
xWhere to store the result in.
opThe operator object.
dataThe provided data.

Definition at line 1905 of file arithmetic-expressions.hpp.