6.7.11 MapToVector

6.7.11.1 Outline of the node

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

6.7.11.2 Necessary file

No files are required.

6.7.11.3 Usage

When to use

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

6.7.11.4 Input-output and property of the node

Input

INPUT

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

Output

OUTPUT

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

Parameter

Table 6.95: Parameter list of MapToVector 

Parameter name

Type

Default value

Unit

Description

METHOD

string 

min_key

 

The method to convert the Map<int, ObjectRef> type to the Vector<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 Vector<ObjectRef> type. Select min_key, max_key, average, or summation. Selecting min_key or max_key outputs a Vector<float> or a Vector<complex<float> > whose key is the minimum or the maximum among the input Map<int, ObjectRef> . Selecting average or summation outputs a Vector<float> or a Vector<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.11.5 Details of the node

Table 6.96: Conversion table of MapToVector 

INPUT

OUTPUT

METHOD

 
   

min_key

(1)

Map$<$ int , Vector<float> $>$

Vector<float> 

max_key

(2)

   

average

(3)

   

summation

(4)

   

min_key

 

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

Vector<complex<float> > 

max_key

 
   

average

 
   

summation

 

<例>

INPUT: Three input values, each value consists of a key and a 3 element vector. { 0, $<$ 1 2 3 $>$ }, { 1, $<$ 4 5 6 $>$ }, { 2, $<$ 7 8 9 $>$ }


OUTPUT(1): a 3 element vector for key 0 $<$ 1 2 3 $>$

OUTPUT(2): a 3 element vector for key 2 $<$ 7 8 9 $>$

OUTPUT(4): a 3 element vector, the average of vectors whose key is from 0 to 2 $<$ 4 5 6 $>$

OUTPUT(3): a 3 element vector, the summation of vectors whose key is from 0 to 2 $<$ 12 15 18 $>$