The Complete SPRLIB & ANNLIB

add_unit_ff

- add a new unit to a layer

SYNOPSIS

UNIT *add_unit_ff (net, layer_id)

ARGUMENTS

NET *net A pointer to a correctly filled NET structure.
long layer_id The layer ID of the layer to which the unit should be added.

RETURNS

A pointer to a newly allocated UNIT, or NULL in case of an error.

FUNCTION

This function allocates a new UNIT using malloc_unit. It resets most values (Activation, Output, CurError) to 0.0 and the history to NULL. Furthermore, it constructs LINK structures with corresponding WEIGHT structures between the new UNIT and all UNITs in the previous and next layers, using the malloc_link and malloc_weight functions.

NOTE

The function changes the UnitId field of some of the units in the network to be able to 'insert' the new unit. It also sets the ModificationData field using the time_stamp function. If the unit is an input or output unit, the function returns NULL. This function is currently not used within the library.

This document was generated using api2html on Thu Mar 5 09:00:00 MET DST 1998