6.7.10 MapToMatrix

6.7.10.1 Outline of the node

Convert the Map<int, ObjectRef> type to the Matrix<ObjectRef> $>$ type when the ObjectRef of the given Map<int, ObjectRef> is either the Matrix<float> type or the Matrix<complex<float> > type.

6.7.10.2 Necessary file

No files are required.

6.7.10.3 Usage

When to use

This node is used to convert the Map<int, ObjectRef> type to Matrix<ObjectRef> $>$ type when the ObjectRef of the given Map<int, ObjectRef> is either the Matrix<float> type or the Matrix<complex<float> > type. Taking a Map$<$ int , Matrix<float> $>$ as the input will output a Matrix<float> . Taking a Map$<$ int , Matrix<complex<float> > $>$ as the input will output a Matrix<complex<float> > .

6.7.10.4 Input-output and property of the node

Input

INPUT

: Map$<$ int , Matrix<float> $>$ or Map$<$ int , Matrix<complex<float> > $>$ of the Map<int, ObjectRef> type.

Output

OUTPUT

: any type. Note that the supported data types are the Matrix<float> type and the Matrix<complex<float> > type.

Parameter

Table 6.93: Parameter list of MapToMatrix 

Parameter name

Type

Default value

Unit

Description

METHOD

string 

min_key

 

The method to convert the Map<int, ObjectRef> type to the Matrix<ObjectRef> $>$ type. Select min_key, max_key, average, or summation.

DEBUG

bool 

false

 

Enable or disable to output the conversion status to standard output.

METHOD

: string type. The method to convert the Map<int, ObjectRef> type to the Matrix<ObjectRef> $>$ type.Select min_key, max_key, average, or summation. Selecting min_key or max_key outputs a Matrix<float> or a Matrix<complex<float> > whose key is the minimum or the maximum among the input Map<int, ObjectRef> . Selecting average or summation outputs a Matrix<float> or a Matrix<complex<float> > whose values are the summation of or the average of the values of the input Map<int, ObjectRef> . The default value is min_key.

DEBUG

: bool type. The default value is false. Setting the value to trueoutputs the conversion status to the standard output.

6.7.10.5 Details of the node

Table 6.94: Conversion table of MapToMatrix 

INPUT

OUTPUT

METHOD

 
   

min_key

(1)

Map$<$ int , Matrix<float> $>$

Matrix<float> 

max_key

(2)

   

average

(3)

   

summation

(4)

   

min_key

 

Map$<$ int , Matrix<complex<float> > $>$

Matrix<complex<float> > 

max_key

 
   

average

 
   

summation

 

$<$example$>$

INPUT: Three input values, each value consists of a key and a 2x2 matrix.

  \[ \left\{ \begin{array}{cc} 0, & \left[ \begin{array}{cc} 1 & 2\\ 3 & 4\\ \end{array} \right] \end{array} \right\} \]    

,

  \[ \left\{ \begin{array}{cc} 1, & \left[ \begin{array}{cc} 5 & 6\\ 7 & 8\\ \end{array} \right] \end{array} \right\} \]    

,

  \[ \left\{ \begin{array}{cc} 2, & \left[ \begin{array}{cc} 9 & 10\\ 11 & 12\\ \end{array} \right] \end{array} \right\} \]    



OUTPUT(1): a 2x2 matrix for key 0.

  \[ \left[ \begin{array}{cc} 1 & 2\\ 3 & 4\\ \end{array} \right] \]    

OUTPUT(2): a 2x2 matrix for key 1.

  \[ \left[ \begin{array}{cc} 9 & 10\\ 11 & 12\\ \end{array} \right] \]    

OUTPUT(3): a 2x2 matrix, the average of matrices whose key is from 0 to 2.

  \[ \left[ \begin{array}{cc} 5 & 6\\ 7 & 8\\ \end{array} \right] \]    

OUTPUT(4): a 2x2 matrix, the summation of matrices whose key is from 0 to 2.

  \[ \left[ \begin{array}{cc} 15 & 18\\ 21 & 24\\ \end{array} \right] \]