|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.hedgehog.HObject
com.hedgehog.math.functions.Function
com.hedgehog.math.functions.XYVectorPolynomialFunction
com.hedgehog.math.functions.LagrangianPolynomialFunction
public class LagrangianPolynomialFunction
Title: LagrangianPolynomialFunction - represents the Lagrangian polynomial function.
Description: Lagrangian polynomial function.
Copyright: Copyright (c) Hedgehog Software 2007-2009.
Company: Hedgehog Software
| Field Summary |
|---|
| Fields inherited from class com.hedgehog.math.functions.XYVectorPolynomialFunction |
|---|
mxi, myi |
| Fields inherited from class com.hedgehog.math.functions.Function |
|---|
method |
| Fields inherited from class com.hedgehog.HObject |
|---|
mID, mName |
| Constructor Summary | |
|---|---|
LagrangianPolynomialFunction(FloatingPointVector xi,
FloatingPointVector yi)
Constructor. |
|
LagrangianPolynomialFunction(LagrangianPolynomialFunction object)
Copy constructor. |
|
| Method Summary | |
|---|---|
double |
firstDerivative(double x)
Evaluates the first derivative. |
double |
getValue(double x)
Evaluates L(x). |
OneVariablePolynomial |
lagrangianPolynomial()
Returns the interpolating Lagrangian polynomial L(x). |
OneVariablePolynomial |
lagrangianPolynomial(int i)
Returns the Lagrangian polynomial for Li(x). |
double |
Lix(double x,
int i)
Evaluates Li(x). |
double |
Lixd(double x,
int i)
Evaluates Li'(x). |
| Methods inherited from class com.hedgehog.math.functions.XYVectorPolynomialFunction |
|---|
findXInterval, getXI, getYI, interpolateY, isValid, setXI, setYI, taylorsSeriesFirstDerivative, taylorsSeriesSecondDerivative, toString |
| Methods inherited from class com.hedgehog.math.functions.Function |
|---|
getMethod, setMethod |
| Methods inherited from class com.hedgehog.HObject |
|---|
clone, compare, compareTo, copy, equals, getID, getName, hashCode, hasID, hasName, setID, setName |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public LagrangianPolynomialFunction(FloatingPointVector xi,
FloatingPointVector yi)
throws java.lang.IllegalArgumentException
hedgehog.math.vectors.FloatingPointVector xi = new hedgehog.math.vectors.FloatingPointVector(5);
hedgehog.math.vectors.FloatingPointVector yi = new hedgehog.math.vectors.FloatingPointVector(5);
xi.setValueOpt(0.0,0); xi.setValueOpt(Math.PI/4.0,1); xi.setValueOpt(Math.PI/2.0,2); xi.setValueOpt(3.0*Math.PI/4.0,3); xi.setValueOpt(Math.PI,4);
yi.setValueOpt(0.0,0); yi.setValueOpt(0.707,1); yi.setValueOpt(1.0,2); yi.setValueOpt(0.707,3); yi.setValueOpt(0.0,4);
LagrangianPolynomialFunction lpf = new LagrangianPolynomialFunction(xi,yi);
System.out.println("lpf: " + lpf);
System.out.println("lpf.getValue(0.2pi): " + lpf.getValue(0.2*Math.PI));
System.out.println("lpf.getValue(0.6pi): " + lpf.getValue(0.6*Math.PI));
with output:
lpf.getValue(0.2pi): 0.5871616 // exact: 0.587785 lpf.getValue(0.6pi): 0.9511936 // exact: 0.951057
xi - x values.yi - y values.
java.lang.IllegalArgumentException - Thrown if xi and yi are not of the size.public LagrangianPolynomialFunction(LagrangianPolynomialFunction object)
object - Object to copy.| Method Detail |
|---|
public double Lix(double x,
int i)
throws java.lang.IllegalArgumentException
x - Value of x.i - Index of x values.
java.lang.IllegalArgumentException - Thrown if i<0 or i>=mxi.size().
public double Lixd(double x,
int i)
throws java.lang.IllegalArgumentException
x - Value of x.i - Index of x values.
java.lang.IllegalArgumentException - Thrown if i<0 or i>=mxi.size().public double firstDerivative(double x)
x - Value at which derivative is required.
public OneVariablePolynomial lagrangianPolynomial(int i)
throws java.lang.IllegalArgumentException
i - Index of x values.
java.lang.IllegalArgumentException - Thrown if i is out of range.public OneVariablePolynomial lagrangianPolynomial()
public double getValue(double x)
x - x value at which to find y.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||