DVcomb_comp


Synopsis

combine Node_Data components from two fields into one new Node_Data


group DVcomb_comp {
Node_Data+Iparam &nd1 {
nnodes+req;
};
Node_Data+Iparam &nd2 {
nnodes+req;
};
int+Iparam comp1[];
int+Iparam comp2[];
Node_Data+Oparam out {
nnodes<weight=-1> => nd1.nnodes;
// we are only modifying the pointer value of node_data
// the `*' here prevents us from getting dependencies on
// the upstream guys.
*node_data[];
nnode_data => array_size(node_data);
};
method+notify_val upd_comb_comp = "comb_comp";
};

Description

DVcomb_comp combines any combination of components of two Node_Data objects into one new Node_Data object with n components. The user should ensure that the nnodes of the two input Node_Datas are equal.

Input

&nd1

Reference to a Node_Data object.

&nd2

Reference to a Node_Data object.

comp1[]

An integer array of variable length. Sets which components to take from &nd1. For example, if comp1 = {0, 3}, then the first and fourth components will be extracted.

comp2[]

An integer array of variable length. Sets which components to take from &nd2. For example, if comp2 = {1}, then the second component will be extracted.

Output

out

This is a new Node_Data with the same number of nodes as the first input field, and n components (nnode_data), where n is the sum of the dimensions of comp1 and comp2. Its own Node_Data is a reference (*node_data) to an n object array, where the array values are references to the components in nd1 and nd2.

Files

v/dv.v
modules/combcomp.c

Utility DVM macros

DVMcomb_comp_param

Example

Libraries.Main.Mappers.cut

See also