American-transaction costs 1.0.0.0
American option pricer under proportional transaction costs
Line Class Reference

Straight line in two dimensions. More...

#include <line.h>

List of all members.

Public Member Functions

void check ()
coefficient intercept () const
 Line (const coefficient slope, const coefficient intercept)
void negate ()
coefficient operator() (const coefficient x) const
Lineoperator*= (const coefficient value)
void shift (const coefficient x, const coefficient y)
coefficient slope () const
void swivel (const coefficient slope, const coefficient x)

Detailed Description

Straight line in two dimensions.

The line follows the equation y = slope()x + intercept().

Author:
Alet Roux <alet.roux@york.ac.uk>

Constructor & Destructor Documentation

Line::Line ( const coefficient  slope,
const coefficient  intercept 
) [inline]

Constructor.


Member Function Documentation

void Line::check ( ) [inline]

Checks whether slope or intercept is zero.

coefficient Line::intercept ( ) const [inline]

Intercept with vertical axis.

void Line::negate ( ) [inline]

Negates both slope() and intersection().

coefficient Line::operator() ( const coefficient  x) const [inline]

Value of line for given horizontal value x.

Line & Line::operator*= ( const coefficient  value) [inline]

Multiplies both slope() and intercept() by value.

void Line::shift ( const coefficient  x,
const coefficient  y 
) [inline]

Shifts line.

Parameters:
xNumber of units to shift to the right (to the left if negative)
yNumber of units to shift upwards (downwards if negative)
coefficient Line::slope ( ) const [inline]

Slope of line.

void Line::swivel ( const coefficient  slope,
const coefficient  x 
) [inline]

Adjust line to have slope slope, while leaving its value in x unchanged.

Parameters:
slopeNew slope
xPoint at which value of function should be left unchanged.

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Defines