CPolynomial:Copy
The Copy method duplicates the polynomial coefficients and returns the new copy.
P = CPolynomial:Copy() |
P is a new CPolynomial containing the same coefficients as the current one.
The following script fragment duplicates the coefficient set P into a new set P2:
P = CPolynomial:new() |
-- create a CPolynomial |
P:Set( 0, 5.5 ) |
-- set coef[0] |
P:Set( 1, 0.144 ) |
-- set coef[1] |
P:Set( 4, -1.045e-6) |
-- set coef[4] |
P2 = P:Copy() |
-- creates a duplicate coefficient set named P2 |
Printf("N = %d", P2:Count()) |
-- result: N = 3 |
P:delete() |
-- if finished with P, clean up memory |