Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/Math/Function/Interpolator.pm
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ has points => (
required => 1,
);

=head1 SUBROUTINES/METHODS

=head2 buildargs
BUILDARGS

=cut

sub BUILDARGS { ## no critic (Subroutines::RequireArgUnpacking)
my $self = shift;
my %args = ref( $_[0] ) ? %{ $_[0] } : @_;
Expand Down
7 changes: 7 additions & 0 deletions lib/Math/Function/Interpolator/Cubic.pm
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ sub _extrapolate_spline {
return $first->{y} - ( $first->{x} - $x ) * $derivative1;
}

=head1 SUBROUTINES/METHODS

=head2 cubic
do_calculation

=cut

# Returns the interpolated_y given point_x and a minimum of 5 data points
sub do_calculation {
my ( $self, $x ) = @_;
Expand Down
11 changes: 11 additions & 0 deletions lib/Math/Function/Interpolator/Linear.pm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ use Carp qw(confess);
use Number::Closest::XS qw(find_closest_numbers_around);
use Scalar::Util qw(looks_like_number);

=head1 NAME
Math::Function::Interpolator::Linear - Interpolation made easy
=cut

has 'interpolate' => (
is => 'ro',
isa => sub {
Expand All @@ -20,6 +24,13 @@ has 'interpolate' => (
required => 1
);

=head1 SUBROUTINES/METHODS

=head2 linear
do_calculation

=cut

# Solves for point_y linearly given point_x and an array of points.
sub do_calculation {
my ( $self, $x ) = @_;
Expand Down
7 changes: 7 additions & 0 deletions lib/Math/Function/Interpolator/Quadratic.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ has 'interpolate' => (
required => 1
);

=head1 SUBROUTINES/METHODS

=head2 quadratic
do_calculation

=cut

# Returns the interpolated_y value given point_x with 3 data points
sub do_calculation {
my ( $self, $x ) = @_;
Expand Down