CPolynomial:Empty
The Empty method deletes all coefficients from the coefficient array.
CPolynomial:Empty() |
This resets to zero all 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 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 |
Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.