Using the C++ Math Library |
 |
SetData( )
Paired with GetData()
is SetData()
, which allows you to change the array data pointed to by an mwArray
object. Use SetData()
with care; it allows you to fool the mwArray
reference counting system, which will lead either to memory leaks or program crashes. For example, never set the data of one mwArray
to the data returned by GetData()
on another mwArray
:
mwArray A = rand(4), B = magic(10);
B.SetData(A.GetData()); // NEVER, NEVER do this.
Note
Unless you really know what you are doing, you should never call SetData() . Use the assignment operator or the mwArray constructors instead to set the data in an array. |
| GetData( ) | | ExtractScalar( ) and ExtractData( ) |  |