Convert the Matrix<ObjectRef> type to the Vector<ObjectRef> type when the ObjectRef of the Matrix<ObjectRef> given as the input is either the float type or the complex<float> type.
No files are required.
When to use
This node is used to convert the Matrix<ObjectRef> type to the Vector<ObjectRef> type when the ObjectRef of the Matrix<ObjectRef> given as the input is either the float type or the complex<float> type. Taking a Matrix<float> as the input will output a Vector<float> . Taking a Matrix<complex<float> > as the input will output a Vector<complex<float> > .
Input
: any type. Note that the supported data types are the Matrix<float> type and the Matrix<complex<float> > type.
Output
: any type. Note that the supported data types are the Vector<float> type and the Vector<complex<float> > type.
Parameter
Parameter name |
Type |
Default value |
Unit |
Description |
METHOD |
reshape |
The method to convert Matrix to Vector . Select reshape or accumulate. Convert by reshaping the matrix with the original elements unchanged or by replacing the original elements of the matrix with the accumulated value. |
||
RESHAPE_ORDER |
row |
The order for storing multidimensional arrays in linear storage. Select row or column. Reshape the matrix given into a vector by row-major order or by column-major order. |
||
ACCUMULATE_METHOD |
row_sum |
The method to accumulate the elements of the matrix. Select one from row_sum, col_sum, row_avg, or col_avg. Calculate the sum of the elements in each row, the sum of the elements in each column, the average the elements in each row, and the average of the elements in each column, respectively |
||
DEBUG |
false |
Enable or disable to output the conversion status to standard output. |
: string type. The method to convert the Matrix<ObjectRef> type to the Vector<ObjectRef> type; Matrix<float> to Vector<float> , or Matrix<complex<float> > to Vector<complex<float> > . Select reshape or accumulate. Selecting reshape reshapes the Matrix<ObjectRef> given as the input into a Vector by row-major order or by column-major order. Selecting accumulate calculates the elements of the Matrix<ObjectRef> by rows or by columns and then replaces the elements with the accumulated value. The default value is reshape.
: string type. The order to reshape the input Matrix . When the parameter value of METHOD is set to reshape, specify the desired value. Select row, or column. Selecting row reshapes the matrix by row-major order. Selecting column reshapes the matrix by column-major order. The default value is row.
: string type. The method to accumulate the elements of the Matrix when the parameter value of METHOD is set to accumulate. Select row_sum, col_sum, row_avg, or col_avg. Calculate the sum of elements in each row, the sum of elements in each column, the average of the elements in each row, and the average of the elements in each column, respectively. The default value is row_sum.
: bool type. The default value is false. Setting the value to trueoutputs the conversion status to the standard output.
INPUT |
OUTPUT |
METHOD |
RESHAPE _ORDER |
ACCUMULATE _METHOD |
|||
type |
size |
type |
size |
||||
(NxM) |
reshape |
row |
- |
(1) |
|||
column |
(2) |
||||||
N |
row_sum |
(3) |
|||||
accumulate |
- |
row_avg |
(4) |
||||
M |
col_sum |
(5) |
|||||
NxM |
col_avg |
(6) |
|||||
(NxM) |
reshape |
row |
- |
||||
column |
|||||||
N |
row_sum |
||||||
accumulate |
- |
row_avg |
|||||
M |
col_sum |
||||||
col_avg |
$<$example$>$
INPUT:
\[ \left[ \begin{array}{cc} 1 & 2\\ 3 & 4\\ 5 & 6\\ \end{array} \right] \] |
↓
OUTPUT(1): $<$ 1 2 3 4 5 6 $>$
OUTPUT(2): $<$ 1 3 5 2 4 6 $>$
OUTPUT(3): $<$ 3 7 11 $>$ ← $<$ 1+2 3+4 5+6 $>$
OUTPUT(4): $<$ 1.5 3.5 5.5 $>$ ← $<$ (1+2)/2 (3+4)/2 (5+6)/2 $>$
OUTPUT(5): $<$ 9 12 $>$ ← $<$ 1+3+5 2+4+6 $>$
OUTPUT(6): $<$ 3 4 $>$ ← $<$ (1+3+5)/3 (2+4+6)/3 $>$