MIDSX 0.1
A x-ray transport code system for dosimetry
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Interpolator::Linear Class Reference

Class which performs linear interpolation. More...

#include <interpolators.h>

Collaboration diagram for Interpolator::Linear:

Public Member Functions

 Linear (const Eigen::Matrix< double, Eigen::Dynamic, 2 > &data)
 Constructor for the Linear class.
 
double operator() (double x) const override
 Performs linear interpolation.
 

Private Member Functions

bool isXSmallerThanMin (double x) const
 
bool isXBiggerThanMax (double x) const
 
int findIndexOfNextLargestValue (double x) const
 
double calculateInterpolatedY (int idx, double x) const
 

Private Attributes

Eigen::VectorXd x_vec_
 
Eigen::VectorXd y_vec_
 

Detailed Description

Class which performs linear interpolation.

Definition at line 79 of file interpolators.h.

Constructor & Destructor Documentation

◆ Linear()

Interpolator::Linear::Linear ( const Eigen::Matrix< double, Eigen::Dynamic, 2 > & data)
explicit

Constructor for the Linear class.

Parameters
dataA 2 column matrix containing the x and y values to be interpolated.

Member Function Documentation

◆ operator()()

double Interpolator::Linear::operator() ( double x) const
overridevirtual

Performs linear interpolation.

Parameters
xThe x value to be interpolated.
Returns
The interpolated y value.

Implements Interpolator::Interpolator.

Reimplemented in Interpolator::LogLogLinear.

Member Data Documentation

◆ x_vec_

Eigen::VectorXd Interpolator::Linear::x_vec_
private

Definition at line 97 of file interpolators.h.

◆ y_vec_

Eigen::VectorXd Interpolator::Linear::y_vec_
private

Definition at line 98 of file interpolators.h.


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