ZOSAPI.Common.IMatrixData Interface Reference
Last update: 17.07.2025Methods and properties for retrieving and/or setting a 2D array of double precision data. More...
Public Member Functions | |
| void | ReadData (int Size, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)][In, Out]double[] Data) |
| Retrieve the entire data set. This method is functionally identical to using Data, however it may be easier to use from some languages. | |
| void | WriteData (int Size, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)][In]double[] Data) |
| Update the entire data set. This method is functionally identical to using Data, however it may be easier to use from some languages. Note that calling this method will have no effect if IsReadOnly is true. | |
| double | GetValueAt (int Row, int Col) |
| Retrieves a single value from the 2D array. Note that accessing the data one element at a time may be much slower than retrieving the entire array at once. | |
| void | SetValueAt (int Row, int Col, double Value) |
| Set a single value from the 2D array. Note that accessing the data one element at a time may be much slower than updating the entire array at once. | |
Properties | |
| bool | IsReadOnly [get] |
| Gets a value indicating whether the data in this matrix can be modified. | |
| int | Rows [get] |
| Gets the number of rows in the 2D array. | |
| int | Cols [get] |
| Gets the number of cols in the 2D array. | |
| int | TotalLength [get] |
| Gets the total size of the 2D array (Rows * Cols). | |
| double[,] | Data [get, set] |
Gets or sets (if IsReadOnly is false) the data. Note that making changes to the returned array does not change the underlying data source. Use this property to replace the entire data, or use WriteData to update the data source. | |
Detailed Description
Methods and properties for retrieving and/or setting a 2D array of double precision data.
Usage (see Example 23 for a full sample)
C#
C++
Matlab
Python
Member Function Documentation
◆ GetValueAt()
| double ZOSAPI.Common.IMatrixData.GetValueAt | ( | int | Row, |
| int | Col | ||
| ) |
Retrieves a single value from the 2D array. Note that accessing the data one element at a time may be much slower than retrieving the entire array at once.
- Parameters
-
Row The row. Col The col.
- Returns
◆ ReadData()
| void ZOSAPI.Common.IMatrixData.ReadData | ( | int | Size, |
| [In, Out] double[] | Data | ||
| ) |
Retrieve the entire data set. This method is functionally identical to using Data, however it may be easier to use from some languages.
- Parameters
-
Size The size of the input array – this must be the same as TotalLength. Data The array to fill. Note that this must be allocated prior to calling ReadData.
◆ SetValueAt()
| void ZOSAPI.Common.IMatrixData.SetValueAt | ( | int | Row, |
| int | Col, | ||
| double | Value | ||
| ) |
Set a single value from the 2D array. Note that accessing the data one element at a time may be much slower than updating the entire array at once.
- Parameters
-
Row The row. Col The col. Value The value.
◆ WriteData()
| void ZOSAPI.Common.IMatrixData.WriteData | ( | int | Size, |
| [In] double[] | Data | ||
| ) |
Update the entire data set. This method is functionally identical to using Data, however it may be easier to use from some languages.
Note that calling this method will have no effect if IsReadOnly is true.
- Parameters
-
Size The size of the input array. Data The new array data.
Property Documentation
◆ Cols
|
get |
Gets the number of cols in the 2D array.
The number of cols.
◆ Data
|
getset |
Gets or sets (if IsReadOnly is false) the data. Note that making changes to the returned array does not change the underlying data source.
Use this property to replace the entire data, or use WriteData to update the data source.
The raw array of data.
◆ IsReadOnly
|
get |
Gets a value indicating whether the data in this matrix can be modified.
true if this instance is read only; otherwise, false.
◆ Rows
|
get |
Gets the number of rows in the 2D array.
The number of rows.
◆ TotalLength
|
get |
Gets the total size of the 2D array (Rows * Cols).
The total length.