Helios++
Helios software for LiDAR simulations
fluxionum::SimpleLinearFunction< A, B > Class Template Reference

Simple linear function. More...

#include <SimpleLinearFunction.h>

Inheritance diagram for fluxionum::SimpleLinearFunction< A, B >:
Collaboration diagram for fluxionum::SimpleLinearFunction< A, B >:

Public Member Functions

 SimpleLinearFunction (B const slope, B const intercept)
 SimpleLinearFunction default constructor. More...
 
eval (A const &x) override
 Calculate the image of \(x\) by \(f\) assuming a linear behavior where \(a\) is the slope and \(b\) is the intercept. More...
 
getSlope () const
 Obtain the slope \(a\) of the linear function. More...
 
getIntercept () const
 Obtain the intercept \(b\) of the linear function. More...
 
- Public Member Functions inherited from fluxionum::Function< A, B >
 Function ()=default
 
operator() (A const &x)
 Evaluate the function \(f(x)=y\). More...
 

Protected Attributes

slope
 The slope \(a\) of the linear function.
 
intercept
 The intercept \(b\) of the linear function.
 

Detailed Description

template<typename A, typename B>
class fluxionum::SimpleLinearFunction< A, B >

Simple linear function.

Author
Alberto M. Esmoris Pena
Version
1.0

\[ f(x) = ax + b \]

See also
fluxionum::Function

Constructor & Destructor Documentation

◆ SimpleLinearFunction()

template<typename A , typename B >
fluxionum::SimpleLinearFunction< A, B >::SimpleLinearFunction ( B const  slope,
B const  intercept 
)
inline

Member Function Documentation

◆ eval()

template<typename A , typename B >
B fluxionum::SimpleLinearFunction< A, B >::eval ( A const &  x)
inlineoverridevirtual

Calculate the image of \(x\) by \(f\) assuming a linear behavior where \(a\) is the slope and \(b\) is the intercept.

\[ f(x) = ax + b \]

Parameters
xThe input value belonging to the domain of the function
Returns
The image of \(x\) by \(f\)

Implements fluxionum::Function< A, B >.

◆ getIntercept()

template<typename A , typename B >
B fluxionum::SimpleLinearFunction< A, B >::getIntercept ( ) const
inline

Obtain the intercept \(b\) of the linear function.

Returns
The intercept \(b\) of the linear function

◆ getSlope()

template<typename A , typename B >
B fluxionum::SimpleLinearFunction< A, B >::getSlope ( ) const
inline

Obtain the slope \(a\) of the linear function.

Returns
The slope \(a\) of the linear function

The documentation for this class was generated from the following file: