CPolynomial:Empty
The Empty method deletes all coefficients from the set.
CPolynomial:Empty() |
This resets to zero array elements without deleting the CPolynomial object itself. If you delete the CPolynomial, the object is set to nil and cannot be used again without creating a new instance with new. By calling Empty, the existing CPolynomial can be used to Set new orders, and so forth.
The following script fragment empties the coefficients from CPolynomial P:
|
-- create a CPolynomial |
|
-- set coef[0] |
|
-- set coef[1] |
|
-- set coef[4] |
|
-- result: Ncoefs = 3 |
|
-- empty the CPolynomial object |
|
-- result: Ncoefs = 0 |
|
-- if finished with P, clean up memory |