V3FIT
|
Module is part of the LIBSTELL. This module contains code to create a profile constructed of line sigments. These line segments are assumed to be specified such that xx(i) < xx(i + 1) More...
Functions/Subroutines | |
subroutine, public | line_seg (x, y, xx, yy, n) |
Interpolate a point on a line. More... | |
subroutine, public | line_seg_int (x, y, xx, yy, n) |
Integrate to a point on a line. More... | |
pure recursive subroutine, private | get_indices (x, xx, lBound, uBound, ilow, ihigh) |
Find the bounding indicies of the array. More... | |
pure real(rprec) function, private | slope (yy, xx, ilow, ihigh) |
Find the slope of the line. More... | |
pure real(rprec) function, private | offset (yy, xx, ilow, ihigh) |
Find the y intercept of the line. More... | |
pure real(rprec) function, private | y_value (x, yy, xx, ilow, ihigh) |
Evaluate the line. More... | |
pure real(rprec) function, private | y_value_int (x0, x1, yy, xx, ilow, ihigh) |
Integrate the line. More... | |
logical function, public | line_seg_test () |
Line segment unit test function. More... | |
logical function, private | check (expected, received, testNum, name) |
Check a real value. More... | |
Module is part of the LIBSTELL. This module contains code to create a profile constructed of line sigments. These line segments are assumed to be specified such that xx(i) < xx(i + 1)
|
private |
Check a real value.
Checks that the expected value matches the recieved. Otherwise report an error.
[in] | expected | The known value. |
[in] | received | The known test value. |
[in] | testNum | The number of the test. |
[in] | name | The name of the test. |
Definition at line 589 of file line_segment.f.
|
private |
Find the bounding indicies of the array.
This performs a recursive search to find the upper and lower indices of the that bound a point x. This is performed by splitting the array in half and recursively calling the subroutine on the half that still bounda the point. Once the array is down to two elements, the bounding indicies have been found.
[in] | x | X point to find the bounds at. |
[in] | xx | X positions defining the line segments. |
[in] | lBound | Lower bound value of the array. |
[in] | uBound | Upper bound value of the array. |
[out] | ilow | Index of the lower bound. |
[out] | ihigh | Index of the upper bound. |
Definition at line 165 of file line_segment.f.
subroutine, public line_segment::line_seg | ( | real (rprec), intent(in) | x, |
real (rprec), intent(out) | y, | ||
real (rprec), dimension(:), intent(in) | xx, | ||
real (rprec), dimension(:), intent(in) | yy, | ||
integer, intent(in) | n | ||
) |
Interpolate a point on a line.
Find the linearly interpolated value of y at position x from line sigments specified by yy(xx).
[in] | x | X point to interpolate the line at. |
[out] | y | The value of the interpolated point. |
[in] | xx | X positions defining the line segments. |
[in] | yy | Y positions defining the line segments. |
[in] | n | Number of points defining the line. |
Definition at line 41 of file line_segment.f.
subroutine, public line_segment::line_seg_int | ( | real (rprec), intent(in) | x, |
real (rprec), intent(out) | y, | ||
real (rprec), dimension(:), intent(in) | xx, | ||
real (rprec), dimension(:), intent(in) | yy, | ||
integer, intent(in) | n | ||
) |
Integrate to a point on a line.
Find the linearly integrated value of y at position x from line sigments specified by yy(xx).
[in] | x | X point to interpolate the line at. |
[out] | y | The value of the interpolated point. |
[in] | xx | X positions defining the line segments. |
[in] | yy | Y positions defining the line segments. |
[in] | n | Number of points defining the line. |
Definition at line 88 of file line_segment.f.
logical function, public line_segment::line_seg_test |
Line segment unit test function.
This runs the associated unit tests and returns the result.
Definition at line 344 of file line_segment.f.
|
private |
Find the y intercept of the line.
This finds the b of y = m*x + b where x is defined as xx and y is defined as yy. b is defined as (x2y1 - x1y2)/(x2 - x1).
[in] | xx | X positions defining the line segments. |
[in] | yy | Y positions defining the line segments. |
[in] | ilow | Index of the lower bound. |
[in] | ihigh | Index of the upper bound. |
Definition at line 239 of file line_segment.f.
|
private |
Find the slope of the line.
This find the m of y = m*x + b where x is defined as xx and y is defined as yy. m is defined as dy/dx.
[in] | xx | X positions defining the line segments. |
[in] | yy | Y positions defining the line segments. |
[in] | ilow | Index of the lower bound. |
[in] | ihigh | Index of the upper bound. |
Definition at line 211 of file line_segment.f.
|
private |
Evaluate the line.
Evaluates the line defined by the x and y at the indicies. Avoid a possible divide by zero when two xx indices have the same value. Handel this by taking the high index of yy.
[in] | x | X point to evaluate the line at. |
[in] | xx | X positions defining the line segments. |
[in] | yy | Y positions defining the line segments. |
[in] | ilow | Index of the lower bound. |
[in] | ihigh | Index of the upper bound. |
Definition at line 270 of file line_segment.f.
|
private |
Integrate the line.
Evaluates the integral of line defined by the x and y at the indicies. Avoid a potential divide by zero error when two xx indices have the same value. In this case, the integral is zero.
[in] | x0 | Starting point of the integration. |
[in] | x1 | Ending point of the integration. |
[in] | xx | X positions defining the line segments. |
[in] | yy | Y positions defining the line segments. |
[in] | ilow | Index of the lower bound. |
[in] | ihigh | Index of the upper bound. |
Definition at line 307 of file line_segment.f.