Reducer

Synopsis

This module reduces the linear input array of float values using a factor specified by the user. Output is the reduced array of float values.

Inputs

Name Type Description

in float[] linear array of float values

Parameters

Name Type Description UI Control

factor int factor to reduce the in-array Field

Output Ports

Name Type Description

out float[] reduced array

Description

The size of the output array is defined by the size of the input array divided by the value of the reduce factor. If the division leaves a remainder this will be dropped. The out size is only the integer part of the division.

The values of the output array are calculated in a loop. Each value is the average of a group of float values. The size of each group is given by the reduce factor. The groups are taken from the input array.

Example:

		in_arr[5] = {1,3,5,7,9}
		factor = 2
		=> out_size = in_size/factor = 5/2 = 2
		   out_arr[0] = (1+3)/2 = 2
		   out_arr[1] = (5+7)/2 = 6.5
		=> out_arr[2] = {2,6.5}
		         
If there are any values of the input array left they will be ignored.

The user_macro provides a simple user interface to type in the reduce factor.

Parameters

Inputs

in_arr

input array

factor

reduce factor

Outputs

nout

number of values in output array

out

output array

Example

Using the Read_Field you can browse a field which is transformed by extract_data_array to a linear array. Notice that the size of the output array is smaller than the size of the input array.

Files

iac_proj/reducer/reducer.v Creates the IAC_PROJ.Reducer library.

iac_proj/reducer/red_mods.v Creates the ReducerMods library containing the low-level module ReducerCore and the parameter block ReducerParams.

iac_proj/reducer/red_macs.v Creates the ReducerMacs library containing the high-level functional macro ReducerFunc, user interface macro ReducerUI and the user macro Reducermacro definition

iac_proj/reducer/red_apps.v Creates the ReducerApps library containing the example application ReducerEg.

Author

Ian Curington,
Advanced Visual Systems, Inc.

Modifications

Simone Herrmann,
Manchester Visualization Centre

Contact

International AVS Centre
Manchester Visualization Centre
Kilburn Building
University of Manchester
Oxford Road
Manchester
United Kingdom
M13 9PL