CPolynomial:Init
The Init method sets the first n coefficients to the same target value.
CPolynomial:Init( n, value ) |
n is the number of coefficients to set.
value is the target value to assign to the first n coefficients.
The following script fragment initializes through 4-th order (the first 5 indices) to 1.0:
P = CPolynomial:new() |
-- create a CPolynomial |
P:Init( 5, 1.75) |
-- set first 5 values to 1.75 |
Printf("coef[3]= %lg", P:Get(3)) |
-- result: coef[3] = 1.75 |