\chapter{Kernel Function Interface}
\label{KernelFunctionInterface}
\index{Kernel Function}
\thispagestyle{empty}

\section{Overview}

The simulator kernel offers a variety of functions for the creation
and manipulation of networks. These can roughly be grouped into the
following categories:

\begin{itemize}
\item functions to manipulate the network
\item functions to determine the structure of the network
\item functions to define and manipulate cell prototypes
\item functions to propagate the network
\item learning functions
\item functions to manipulate patterns
\item functions to load and save the network and pattern files
\item functions for error treatment, search functions for names,
functions to change default values etc.
\end{itemize}

The following paragraphs explains the interface functions in detail.
All functions of this interface between the kernel and the user
interface carry the prefix {\tt krui\_}\ldots
(\underline{k}e\underline{r}nel \underline{u}ser \underline{i}nterface
functions).

Additionally there are some interface functions which are useful to
build applications for ART networks. These functions carry the prefix
{\tt artui\_}\dots (\underline{ART} \underline{u}ser
\underline{i}nterface functions).

\section{Unit Functions}
\index{Kernel Function!Unit \~~}

The following functions are available for manipulation of the cells and
their components:
\begin{verbatim}
krui_getNoOfUnits()
krui_getNoOfSpecialUnits()
krui_getFirstUnit()
krui_getNextUnit()
krui_setCurrentUnit( int  UnitNo )
krui_getCurrentUnit()
krui_getUnitName( int  UnitNo )
krui_setUnitName( int  UnitNo, char *unit_name )
krui_searchUnitName( char  *unit_name )
krui_searchNextUnitName( void )
krui_getNoOfTTypeUnits()
krui_getUnitOutFuncName( int  UnitNo )
krui_setUnitOutFunc( int  UnitNo, char *unitOutFuncName )
krui_getUnitActFuncName( int  UnitNo )
krui_setUnitActFunc( int  UnitNo, char *unitActFuncName )
krui_getUnitFTypeName( int UnitNo )
krui_getUnitActivation( int  UnitNo )
krui_setUnitActivation( int  UnitNo, FlintType  unit_activation )
krui_getUnitInitialActivation( int  UnitNo )
krui_setUnitInitialActivation( int  UnitNo, FlintType unit_i_activation)
krui_getUnitOutput( int  UnitNo )
krui_setUnitOutput( int  UnitNo, FlintType  unit_output )
krui_getUnitBias( int  UnitNo )
krui_setUnitBias( int  UnitNo, FlintType  unit_bias )
krui_getUnitSubnetNo( int UnitNo )
krui_setUnitSubnetNo( int UnitNo, int  subnet_no)
krui_getUnitLayerNo( int UnitNo )
krui_setUnitLayerNo( int UnitNo, unsigned short layer_bitField )
krui_getUnitPosition( int  UnitNo, struct PosType  *position )
krui_setUnitPosition( int  UnitNo, struct PosType  *position )
krui_getUnitNoAtPosition( struct PosType  *position, int subnet_no )
krui_getUnitNoNearPosition( struct PosType  *position, int subnet_no,
                            int range, int gridWidth )
krui_getXYTransTable( struct TransTable  * *xy_trans_tbl_ptr )
krui_getUnitCenters( int unit_no, int center_no,
                     struct PositionVector  * *unit_center )
krui_setUnitCenters( int unit_no, int center_no,
                     struct PositionVector  *unit_center )
krui_getUnitTType( int  UnitNo )
krui_setUnitTType( int  UnitNo, int  UnitTType )
krui_freezeUnit( int  UnitNo )
krui_unfreezeUnit( int  UnitNo )
krui_isUnitFrozen( int  UnitNo )
krui_getUnitInputType( UnitNo )
krui_getUnitValueA(int UnitNo)
krui_setUnitValueA(int UnitNo, FlintTypeParam unit_valueA)
krui_createDefaultUnit()
krui_createUnit( char  *unit_name, char  *out_func_name,
                 char  *act_func_name, FlintType  act,
                 FlintType  i_act, FlintType  out,
                 FlintType  bias)
krui_createFTypeUnit( char  *FType_name)
krui_setUnitFType( int  UnitNo, char *FTypeName )
krui_copyUnit( int  UnitNo, int copy_mode )
krui_deleteUnitList( int no_of_units, int unit_list[] )
\end{verbatim}
\vspace{1ex}

\subsection{Unit Enquiry and Manipulation Functions}
\index{Kernel Function!Unit Enquiry and Manipulation \~~}
\verb#int  krui_getNoOfUnits()#\\
determines the number of units in the neural net.
\vspace{1ex}

\verb#int  krui_getNoOfSpecialUnits()#\\
determines the number of special units in the neural net.
\vspace{1ex}

\verb#int  krui_getFirstUnit()#\\
Many interface functions refer to a current unit or site. 
\verb#krui_getFirstUnit()# selects the (chronological) first unit of
the network and makes it current. If this unit has sites, the
chronological first site becomes current. The function returns 0 if no
units are defined.
\vspace{1ex}

\verb#int  krui_getNextUnit()#\\
selects the next unit in the net, as well as its first site (if
present); returns 0 if no more units exist.
\vspace{1ex}

\verb#krui_err  krui_setCurrentUnit( int  UnitNo )#\\
makes the unit with number {\em UnitNo}\/ current unit; returns an
error code if no unit with the specified number exists.
\vspace{1ex}

\verb#int  krui_getCurrentUnit()#\\
determines the number of the current unit (0 if not defined)
\vspace{1ex}

\verb#char     *krui_getUnitName( int  UnitNo )#\\
\verb#krui_err  krui_setUnitName( int  UnitNo, char *unit_name )#\\
determines/sets the name of the unit. {\tt krui\_setUnitName} returns
NULL if no unit with the specified number exists.
\vspace{1ex}

\verb#int  krui_searchUnitName( char  *unit_name )#\\
searches for a unit with the given name.  Returns the first unit
number if a unit with the given name was found, 0 otherwise.
\vspace{1ex}

\verb#int  krui_searchNextUnitName( void )#\\
searches for the next unit with the given name.
Returns the next unit number if a unit with the given name was found,
0 otherwise. \verb#krui_searchUnitName( unit_name )# has to be called
before at least once, to confirm the unit name.
Returns error code if no units are defined.
\vspace{1ex}

\verb#char  *krui_getUnitOutFuncName( int  UnitNo )#\\
\verb#char  *krui_getUnitActFuncName( int  UnitNo )#\\
determines the output function resp.\ activation function of the unit.

\verb#krui_err  krui_setUnitOutFunc( int  UnitNo, char *unitOutFuncName )#\\
\verb#krui_err  krui_setUnitActFunc( int  UnitNo, char *unitActFuncName )#\\
sets the output function resp.\ activation function of the unit.
Returns an error code if the function name is unknown, i.e.\ if the
name does not appear in the function table as output or activation
function. The f-type of the unit is deleted.
\vspace{1ex}

\verb#char  *krui_getUnitFTypeName( int UnitNo )#\\
yields the f-type of the unit; returns NULL if the unit
has no prototype.


\verb#FlintType  krui_getUnitActivation( int UnitNo )#\\
\verb#krui_err   krui_setUnitActivation( int UnitNo,#\\
\verb#                                   FlintTypeParam unit_activation )#\\
returns/sets the activation of the unit.

\verb#FlintType krui_getUnitInitialActivation( int  UnitNo )#\\
\verb#void      krui_setUnitInitialActivation( int  UnitNo,#\\
\verb#                                         FlintType unit_i_activation )#\\
returns/sets the initial activation of the unit, i.e.\ the activation
after loading the net. See also \verb#krui_resetNet()#.
\vspace{1ex}

\verb#FlintType  krui_getUnitOutput( int  UnitNo )#\\
\verb#krui_err   krui_setUnitOutput( int  unit_no, FlintTypeParam  unit_output )#\\
returns/sets the output value of the unit.
\vspace{1ex}

\verb#FlintType  krui_getUnitBias( int  UnitNo )#\\
\verb#void  krui_setUnitBias( int  UnitNo, FlintType  unit_bias )#\\
returns/sets the bias (threshold) of the unit.
\vspace{1ex}

\verb#int   krui_getUnitSubnetNo( int UnitNo )#\\
\verb#void  krui_setUnitSubnetNo( int UnitNo, int  subnet_no)#\\
returns/sets the subnet number of the unit (the range of subnet
numbers is -32736 to +32735).

\verb#unsigned short  krui_getUnitLayerNo( int UnitNo )#\\
\verb#void            krui_setUnitLayerNo( int UnitNo,int layer_no)#\\
returns/sets the layer number (16 Bit integer).

\verb#void  krui_getUnitPosition( int  UnitNo, struct PosType  *position )#\\
\verb#void  krui_setUnitPosition( int  UnitNo, struct PosType  *position )#\\
determines/sets the (graphical) position of the unit. See also
include file \verb#glob_typ.h# for the definition of PosType.

\verb#int  krui_getUnitNoAtPosition( struct PosType  *position, int subnet_no )#\\
yields the unit number of a unit with the given position and subnet
number; returns 0 if no such unit exists.

\verb#int  krui_getUnitNoNearPosition( struct PosType  *position,#\\
\verb#                                 int subnet_no, int range,#\\
\verb#                                 int gridWidth )#\\
yields a unit in the surrounding (defined by {\em range}\/) of the
given position with the given graphic resolution {\em gridWidth};
otherwise like \verb#krui_getUnitNoAtPosition(...)#.

\verb#krui_err krui_getUnitCenters( int unit_no, int center_no,#\\
\verb#                              struct PositionVector  * *unit_center )#\\
returns the 3D-transformation center of the specified unit and center number.
Function has no effect on the current unit.
Returns error number if unit or center number is invalid or if the SNNS-kernel
isn't a 3D-kernel.


\verb#krui_err krui_setUnitCenters( int unit_no, int center_no,#\\
\verb#                              struct PositionVector  *unit_center )#\\
sets the 3D-transformation center and center number of the specified unit.
Function has no effect on the current unit.
Returns error number if unit or center number is invalid or if the SNNS-kernel
isn't a 3D-kernel.

\verb#krui_err krui_getXYTransTable( dummy )#\\
returns the base address of the XY-translation table.
Returns error code if the SNNS-kernel isn't a 3D-kernel.
\vspace{1ex}

\verb#int       krui_getUnitTType( int  UnitNo )#\\
\verb#krui_err  krui_setUnitTType( int  UnitNo, int  UnitTType )#\\
gets/sets the IO-type\footnote{ The term T-type was changed to
IO-type after completion of the kernel} (i.e.\ input, output,
hidden) of the unit. See include file \verb#glob_typ.h# for IO-type
constants. {\tt Set} yields an error code if the IO-type is invalid.
\vspace{1ex}

\verb#krui_err  krui_freezeUnit( int  unit_no )#\\
freezes the output and the activation value of the unit, i.e.\ these
values are not updated anymore.
\vspace{1ex}

\verb#krui_err  krui_unfreezeUnit( int  unit_no )#\\
switches the computation of output and activation values on again.
\vspace{1ex}

\verb#bool  krui_isUnitFrozen( int  unit_no )#\\
yields TRUE if the unit is frozen, else FALSE.
\vspace{1ex}

\verb#int  krui_getUnitInputType( UnitNo )#\\
yields the input type. There are three kinds of input types:\\
\verb#      NO_INPUTS#: the unit doesn't have inputs (yet).\\
\verb#      SITES#: the unit has one or more sites (and therefore no
direct inputs).\\
\verb#      DIRECT_LINKS#: the unit has direct inputs (and no sites).\\
See also file \verb#glob_typ.h#.
\vspace{1ex}


\verb#FlintType krui_getUnitValueA(int UnitNo)#\\
\verb#void      krui_setUnitValueA(int UnitNo, FlintTypeParam unit_valueA)#\\
returns and sets the Value A field of the unit structure.
\vspace{1ex}


\subsection{Unit Definition Functions}
\index{Kernel Function!Unit Definition \~~}

\verb#int  krui_createDefaultUnit()#\\
creates a unit with the properties of the (definable) default values of the
kernel. The default unit has the following properties:

\hspace*{0.5cm}$\bullet$ standard activation and output function\\
\hspace*{0.5cm}$\bullet$ standard activation and bias\\
\hspace*{0.5cm}$\bullet$ standard position-, subnet-, and layer number\\
\hspace*{0.5cm}$\bullet$ default IO type\\
\hspace*{0.5cm}$\bullet$ no unit prototype\\
\hspace*{0.5cm}$\bullet$ no sites\\
\hspace*{0.5cm}$\bullet$ no inputs or outputs\\
\hspace*{0.5cm}$\bullet$ no unit name

Returns the number of the new unit or a (negative) error code. See also
include file  \verb#kr_def.h#.

\verb#int  krui_createUnit( char  *unit_name, char  *out_func_name,#\\
\verb#                      char  *act_func_name, FlintTypeParam i_act,#\\
\verb#                      FlintTypeParam  bias)#\\
creates a unit with selectable properties; otherwise like 
\verb#krui_createDefaultUnit()#. There are the following defaults:

\hspace*{0.5cm}$\bullet$ standard position-, subnet-, and layer number\\
\hspace*{0.5cm}$\bullet$ default IO type\\
\hspace*{0.5cm}$\bullet$ no unit prototype\\
\hspace*{0.5cm}$\bullet$ no sites\\
\hspace*{0.5cm}$\bullet$ no inputs or outputs

Returns the number of the new unit or a (negative) error code. See also
include file  \verb#kr_def.h#.
\vspace{1ex}

\verb#int  krui_createFTypeUnit( char  *FType_name)#\\
creates a unit with the properties of the (previously defined)
prototype. It has the following default properties:

\hspace*{0.5cm}$\bullet$ standard position number, subnet number and
layer number\\
\hspace*{0.5cm}$\bullet$ no inputs or outputs

The function returns the number of the new unit or a (negative) error
code.
\vspace{1ex}

\verb#krui_err  krui_setUnitFType( int  UnitNo, char *FTypeName )#\\
changes the structure of the unit to the intersection of the current
type of the unit with the prototype; returns an error code if this
operation has been failed.
\vspace{1ex}

\verb#int  krui_copyUnit( int  UnitNo, int  copy_mode)#\\
copies a unit according to the copy mode. Four different copy modes
are available:

\hspace*{0.5cm}$\bullet$ copy unit with all input and output connections\\
\hspace*{0.5cm}$\bullet$ copy only input connections\\
\hspace*{0.5cm}$\bullet$ copy only output connections\\
\hspace*{0.5cm}$\bullet$ copy only the unit, no connections

Returns the number of the new unit or a (negative) error code. See 
\verb#glob_typ.h# for reference of the definition of constants for
the copy modes.
\vspace{1ex}

\verb#krui_err krui_deleteUnitList( int no_of_units, int unit_list[] )#\\ 
deletes 'no\_of\_units' from the network. The numbers of the units that
have to be deleted are listed up in an array of integers beginning
with index 0.  This array is passed to parameter 'unit\_list'.  Removes
all links to and from these units.

%\clearpage

\section{Site Functions}

Before input functions (sites) can be set for units, they first have
to be defined. To define it, each site is assigned a name by the user.
Sites can be selected by using this name. For the definition of sites,
the following functions are available:

\begin{verbatim}
krui_createSiteTableEntry( char  *site_name, char  *site_func )
krui_changeSiteTableEntry( char  *old_site_name, char  *new_site_name,
                           char  *new_site_func )
krui_deleteSiteTableEntry( char *site_name )
krui_getFirstSiteTableEntry( char * *site_name, char * *site_func )
krui_getNextSiteTableEntry( char * *site_name, char * *site_func )
krui_getSiteTableFuncName( char  *site_name )
krui_setFirstSite( void )
krui_setNextSite( void )
krui_setSite( char  *site_name )
krui_getSiteValue()
krui_getSiteName()
krui_setSiteName( char  *site_name )
krui_getSiteFuncName()
krui_addSite( char *site_name )
krui_deleteSite()
\end{verbatim}


\subsection{Functions for the Definition of Sites}
\index{Kernel Function!Site Function!Site Definition \~~}

\verb#krui_err  krui_createSiteTableEntry( char  *site_name, char  *site_func )#\\
defines the correspondence between site function and name of the site.
Error codes are generated for site names already used, invalid site
functions, or problems with the memory allocation.


\verb#krui_err  krui_changeSiteTableEntry( char  *old_site_name,#\\
\verb#                                     char  *new_site_name,#\\
\verb#                                     char  *new_site_func )#\\
changes the correspondence between site function and name of the site.
All sites in the network with the name \verb#old_site_name#
change their name and function. Error
codes are generated for already defined site names, invalid new site
function, or problems with the memory allocation.
\vspace{1ex}

\verb#krui_err  krui_deleteSiteTableEntry( char *site_name )#\\
deletes a site in the site table. This is possible only if there
exist no sites in the network with that name.
Returns an error code if there  are still sites with this name in the net.

\verb#bool  krui_getFirstSiteTableEntry( char * *site_name, char * *site_func )#\\
\verb#bool  krui_getNextSiteTableEntry ( char * *site_name, char * *site_func )#\\
returns the first/next pair of site name and site function. The
return code is TRUE if there is (still) an entry in the site table,
else FALSE.
\vspace{1ex}

\verb#char  *krui_getSiteTableFuncName( char  *site_name )#\\
returns the name of the site function assigned to the site. If no
site with this name exists, a pointer to NULL is returned.



\subsection{Functions for the Manipulation of Sites}
\index{Kernel Function!Site Function!Site Manipulation \~~}

\verb#bool  krui_setFirstSite( void )#\\
initializes the first site of the current unit, i.e.\ the first site of
the current unit becomes current site. If the current unit doesn't
have sites, FALSE is returned, else TRUE.
\vspace{1ex}


\verb#bool  krui_setNextSite( void )#\\
initializes the next site of the current unit. If the  unit doesn't
have more sites, FALSE is returned.
\vspace{1ex}


\verb#krui_err  krui_setSite( char  *site_name )#\\
initializes the given site of the current unit. An error code is
generated if the unit doesn't have sites, the site name is invalid, or
the unit doesn't have a site with that name.
\vspace{1ex}


\verb#FlintType  krui_getSiteValue()#\\
\verb#char      *krui_getSiteFuncName()#\\
returns the name/value of the site function of the current site.
\vspace{1ex}


\verb#char  *krui_getSiteName()#\\
returns the name of the current site.
\vspace{1ex}


\verb#krui_err  krui_setSiteName( char  *site_name )#\\
changes the name (and thereby also the site function) of the current
site. An error code is returned if the site name is unknown.
The f-type of the unit is erased.
\vspace{1ex}


\verb#krui_err krui_addSite( char *site_name )#\\ 
adds a new site to the current unit. The new site is inserted in
front, i.e.\ it becomes the first site of the unit. Therefore it is
possible to make the new site current by a call to
\verb#krui_setFirstSite()#.  \verb#krui_addSite(...)# has no effect on
the current site! Error codes are generated if the unit has direct
input connections, the site name is invalid, or problems with the
memory allocation occurred. The functionality type of the unit will
be cleared.
\vspace{1ex}


\verb#bool  krui_deleteSite()#\\
deletes the current site of the current unit and all input connections
to that site. The functionality type of the unit is also erased.
 \verb#krui_setFirstSite()# or \verb#krui_setNextSite()# has to be
called before at least once, to confirm the current site/unit.
After the deletion the next available site becomes current. The return
code is TRUE if further sites exist, else FALSE\@. The following
program is sufficient to delete all sites of a unit:
\begin{verbatim}
if ( krui_setFirstSite() )
  while ( krui_deleteSite() ) { }
\end{verbatim}



\section{Link Functions}
\index{Kernel Function!Link \~~}

The following functions are available to define or determine the
topology of the network:

\begin{verbatim}
krui_getFirstPredUnit( FlintType  *strength )
krui_getNextPredUnit( FlintType   *strength )
krui_getCurrentPredUnit( FlintType  *strength )
krui_getFirstSuccUnit( int  UnitNo, FlintType  *strength )
krui_getNextSuccUnit( FlintType  *strength )
krui_isConnected( int  source_unit_no )
krui_areConnected( int source_unit_no, int target_unit_no,
                   FlintType  *weight )
krui_getLinkWeight()
krui_setLinkWeight( FlintTypeParam  weight )
krui_createLink( int source_unit_no, FlintTypeParam  weight )
krui_deleteLink()
krui_deleteAllInputLinks()
krui_deleteAllOutputLinks()
krui_jogWeights( FlintTypeParam  minus, FlintTypeParam  plus)
\end{verbatim}


\verb#int  krui_getFirstPredUnit( FlintType  *strength )#\\
determines the unit number of the predecessor unit of the current unit
and site; returns 0 if no such unit exists, i.e.\ if the current
unit has no inputs. If a predecessor unit exists, the connection
between the two units becomes current and its strength is returned.
\vspace{1ex}


\verb#int  krui_getNextPredUnit( FlintType   *strength )#\\
gets another predecessor unit of the current unit/site (returns 0 if
no more exist). Otherwise like \verb#krui_getFirstPredUnit(...)#.
\vspace{1ex}


\verb#int  krui_getCurrentPredUnit( FlintType  *strength )#\\
yields the current predecessor unit.
\vspace{1ex}


\verb#int krui_getFirstSuccUnit( int UnitNo, FlintType *strength )#\\
yields unit number and connection strength of the first successor unit
to the current unit. The return code is 0 if no such unit exists,
i.e.\ the current unit has no outputs. If a successor unit exists,
the connection between the two units becomes current. If the
successor unit has sites, the site connected with this link becomes
current site. The function is slow, because the units are connected
only backwards (lookup time is proportional to the number of
connections in the net).  \vspace{1ex}

\verb#int  krui_getNextSuccUnit( FlintType  *strength )#\\
gets another successor unit of the current unit (returns 0 if no other
successors exist). Otherwise like \verb#krui_getFirstSuccUnit(...)#. The
function is slow, because the units are only connected backwards.
\vspace{1ex}

\verb#bool  krui_isConnected( int  source_unit_no )#\\
checks, whether there is a connection between the current unit and
the source unit. If this is true, this link becomes current and TRUE is
returned.

\verb#bool  krui_areConnected( int source_unit_no, int target_unit_no,#\\
\verb#                         FlintType  *weight )#\\
checks, whether there is a connection between the source unit and
the target unit. In contrast to \verb#krui_isConnected(...)# this
function traverses sites during the search. If there is such a
connection, this link becomes current and TRUE is returned.
\vspace{1ex}

\verb#FlintType  krui_getLinkWeight()#\\
\verb#void       krui_setLinkWeight( FlintTypeParam  weight )#\\
determines/sets the connection weight of the current link.

\verb#krui_err  krui_createLink( int source_unit_no, FlintTypeParam weight )#\\
creates a new link between the current unit/site and the source unit.
An error code is generated if a link between these two units already
exists, or if the source unit does not exist.
\vspace{1ex}

\verb#krui_err  krui_deleteLink()#\\
deletes the current link. To delete a connection between the current
unit/site and the source unit a sequence of {\tt krui\_\-is\-Connec\-ted(
source\_\-unit\_\-no )} and {\tt krui\_\-delete\-Link()} is ideal.  
\vspace{1ex}

\verb#krui_err  krui_deleteAllInputLinks()#\\
\verb#krui_err  krui_deleteAllOutputLinks()#\\
deletes all inputs/outputs at the current unit/site.
\vspace{1ex}

\verb#void krui_jogWeights( FlintTypeParam minus, FlintTypeParam plus)#\\ 
adds uniform distributed random values to the connection weights of the network. 
Minus must be less then plus. 
See also \verb#krui_setSeedNo(...)#.


\section{Functions for the Manipulation of Prototypes}
\index{Kernel Function!Prototype Manipulation \~~}

By describing the characteristic properties of units, like
activation/output function and sites, the user can define unit
prototypes (called f-types in SNNS). Thereby the user can create a
library of units. It is a big advantage that each change to the
prototypes in the library affects all units of this f-type in the
whole network. This means, that all units of a certain type are
updated with a change in the library. With the following functions
prototypes can be defined and manipulated:

\begin{verbatim}
krui_setFirstFTypeEntry()
krui_setNextFTypeEntry()
krui_setFTypeEntry( char  *Ftype_symbol )
krui_getFTypeName()
krui_setFTypeName( char  *unitFType_name )
krui_getFTypeActFuncName()
krui_setFTypeActFunc( char  *act_func_name )
krui_getFTypeOutFuncName()
krui_setFTypeOutFunc( char  *out_func_name )
krui_setFirstFTypeSite()
krui_setNextFTypeSite()
krui_getFTypeSiteName()
krui_setFTypeSiteName( char  *FType_site_name )
krui_createFTypeEntry( char *FType_symbol,char *act_func,
                       char *out_func, int no_of_sites,
                       char * *array_of_site_names )
krui_deleteFTypeEntry( char *  FType_symbol )
\end{verbatim}


\verb#bool  krui_setFirstFTypeEntry()#\\
\verb#bool  krui_setNextFTypeEntry()#\\
initializes the first/next prototype and makes it current. The return
code is FALSE if no unit types are defined, otherwise TRUE.
\vspace{1ex}

\verb#bool  krui_setFTypeEntry( char *Ftype_symbol )#\\
selects a prototype by a name and returns TRUE if the name exists.
\vspace{1ex}

\verb#char  *krui_getFTypeName()#\\
determines the name of the current prototype.
\vspace{1ex}

\verb#krui_err  krui_setFTypeName( char  *unitFType_name )#\\
changes the name of the current prototype. The name has to be
unambiguous, i.e.\ all names have to be different. If the name is
ambiguous, or if memory allocation failed, an error code is returned.
\vspace{1ex}

\verb#char  *krui_getFTypeActFuncName()#\\
determines the name of the activation function of the current prototype.
\vspace{1ex}

\verb#krui_err  krui_setFTypeActFunc( char * act_func_name )#\\
changes the activation function of the current prototype; returns an
error code if the given function is not a valid activation function.
All units of the net that are derived from this prototype change their
activation function.
\vspace{1ex}

\verb#char  *krui_getFTypeOutFuncName()#\\
determines the name of the output function of the current prototype.
\vspace{1ex}

\verb#krui_err  krui_setFTypeOutFunc( char  *out_func_name )#\\
changes the output function of the current prototype; returns an error
code if the given function is not a valid output function. All units of
the net that are derived from this prototype change their output
function.  
\vspace{1ex}

\verb#bool  krui_setFirstFTypeSite()#\\
selects the first site of the prototype (this site becomes current
prototype site); returns TRUE if the prototype has sites.
\vspace{1ex}

\verb#bool  krui_setNextFTypeSite()#\\
selects the next site of the prototype (this site becomes current
prototype site); returns TRUE if the prototype has more sites.
\vspace{1ex}

\verb#char  *krui_getFTypeSiteName()#\\
determines the name of the current prototype site.
\vspace{1ex}

\verb#krui_err  krui_setFTypeSiteName( char *FType_site_name )#\\
changes the name (and also the site function) of the current prototype
site. All units of the net that are derived from this prototype change
their site names or site functions.  An error code is generated if the
new site name is not yet defined.

\verb#krui_err krui_createFTypeEntry( char *FType_symbol,char *act_func,#\\
\verb#                                char *out_func, int no_of_sites,#\\
\verb#                                char * *array_of_site_names )#\\
defines the prototype of a unit. If the prototype is supposed to have
sites, i.e.\  {\tt no\_of\_\-sites > 0}, an array of pointers to strings is
needed to define the sites. These pointers must point to strings
containing the names of the sites. The number of pointers in the
arrays must match \verb#no_of_sites#. An error code is generated if
the site names are ambiguous, one or several site names are unknown,
the prototype name is ambiguous, or a memory allocation error occurred.

\verb#void  krui_deleteFTypeEntry( char  *FType_symbol )#\\
deletes the specified prototype. If there are still units in the net which
are derived from this prototype, they loose their unit type.



\section{Functions to Read the Function Table}
\index{Kernel Function!Function Table Read \~~}

\verb#int  krui_getNoOfFunctions()#\\
determines the number of available functions (unit, site, and learning
functions). 

\verb#void  krui_getFuncInfo( int  func_no,#\\
\verb#                        char * *func_name,#\\
\verb#                        int  *func_type )#\\
determines the name and type (activation, output, site, or learning
function) from the function table. See include file  \verb#glob_typ.h#
for the definition of the function types.
\vspace{1ex}

\verb#bool  krui_isFunction( char  *func_name, int  func_type )#\\
returns TRUE if the specified function is a valid function.

\verb#bool krui_getFuncParamInfo( char *func_name, int  func_type,#\\
\verb#                            int *no_of_input_params,#\\
\verb#                            int *no_of_output_params )#\\
returns the number of input and output parameters of the given
learning, update or initialization function.
Returns TRUE if the given function exists, FALSE otherwise.


\section{Network Initialization Functions}
\index{Kernel Function!Network Initialization \~~}

\verb#krui_err  krui_setInitialisationFunc( char  *init_func )#\\
changes the initialization function; returns an error code if the 
initialization function is unknown.
\vspace{1ex}

\verb#char  *krui_getInitialisationFunc( void )#\\
returns the current initialization function. The default initialization
function is {\em `Randomize\_Weights'}\/ (see also \verb#kr_def.h#).

\verb#krui_err  krui_initializeNet( float *parameterArray, int  NoOfParams )#\\
initializes the network with the current initialization function.



\section{Functions for Activation Propagation in the Network}
\index{Kernel Function!Activation Propagation \~~}

\verb#krui_err  krui_updateSingleUnit( int  UnitNo )#\\
evaluates the net input, the activation and the output value of the
specified unit; returns an error code if the unit doesn't exist. 
\/ \verb#krui_updateSingleUnit(...)# also evaluates 'frozen' units.
\vspace{1ex}


\verb#char  *krui_getUpdateFunc( void )#\\
returns the current update function. The default update function is
{\em`Serial\_Order'}\/ (see also \verb#kr_def.h#).
\vspace{1ex}

\verb#krui_err  krui_setUpdateFunc( char  *update_func )#\\
Changes the current update function; returns an error code if the update
function is invalid.
\vspace{1ex}

\verb#krui_err  krui_updateNet( float *parameterArray, int  NoOfParams )#\\
updates the network according to the update function.  The network
should be a feed-forward type if one wants to update the network with
the topological update function, otherwise the function returns a
warning message.  To propagate a pattern through the network the use of
the following function calls is recommended:
\begin{verbatim}
   krui_setPatternNo( pat_no );
   krui_showPattern( OUTPUT_NOTHING );
   krui_updateNet( parameterArray, NoOfParams );
\end{verbatim}
See also \verb#krui_setSeedNo# for initializing the pseudo random
number generator. The function returns an error code if an error
occurred. The following update functions are available:
\index{Kernel Function!Update \~~}

\begin{itemize}
\item synchronous firing: the units of the network all change their
activation at the same time.

\item chronological order: the user defines the order in which the
units change their activations.

\item random order: the activations are computed in random order. It
may happen that some units are updated several times while others are
not updated at all.

\item random permutation: the activations of all units are computed
exactly once, but in a random order.

\item topological order: the units change their activations according
to their topological order. This mode should be selected only with
nets that are free of cycles (feed-forward nets).
\end{itemize}

The topological order propagation method computes the stable activation
pattern of the net in just one cycle. It is therefore the method of
choice in cycle free nets. In other modes, depending upon the number
of layers in the network, several cycles are required to reach a stable
activation pattern (if this is possible at all).



\section{Learning and Pruning Functions}
\index{Kernel Function!Learning \~~}
\index{Kernel Function!Pruning \~~}

\verb#krui_err  krui_setLearnFunc( char *learning_function)#\\
\verb#krui_err  krui_setFFLearnFunc( char *FF_learning_function)#\\
\verb#krui_err  krui_setPrunnFunc( char *pruning_function)#\\
selects the learning~/ subordinate learning~/ pruning function;
returns an error code if the given function is unknown.
\vspace{1ex}

\verb#char  *krui_getLearnFunc( void )#\\
\verb#char  *krui_getFFLearnFunc( void )#\\
\verb#char  *krui_getPrunFunc( void )#\\
returns the name of the current learning~/ subordinate learning~/
pruning function.  The default learning~/ subordinate learning
function is {\em `Std\_Backpropagation'}\/, the default pruning
function is {\em `MagPruning'}\/ (see also \verb#kr_def.h#).


\verb#krui_err  krui_learnAllPatterns( float *parameterInArray,#\\
\verb#                                 int  NoOfInParams,#\\
\verb#                                 float  * *parameterOutArray,#\\
\verb#                                 int *NoOfOutParams )#\\
\verb#krui_err  krui_learnAllPatternsFF( float *parameterInArray,#\\
\verb#                                   int  NoOfInParams,#\\
\verb#                                   float  * *parameterOutArray,#\\
\verb#                                   int *NoOfOutParams )#\\
learns all patterns (each consisting of an input/output pair) using
the current learning~/ subordinate learning function.
\verb#parameterInArray# contains the learning parameter(s).
\verb#NoOfInParams# stores the number of learning parameters.
\verb#parameterOutArray# returns the results of the learning function.
This array is a static array defined in the learning function.
\verb#*NoOfOutParams# points to an integer value that contains the
number of output parameters from the current learning function.  The
function returns an error code if memory allocation has failed or if
the learning has failed. Patterns must be loaded before calling this
function.

\verb#krui_err  krui_learnSinglePattern( int  pattern_no,#\\
\verb#                                   float   *parameterInArray,#\\ 
\verb#                                   int NoOfInParams,#\\
\verb#                                   float  * *parameterOutArray,#\\ 
\verb#                                   int *NoOfOutParams )#\\
\verb#krui_err  krui_learnSinglePatternFF( int  pattern_no,#\\
\verb#                                     float   *parameterInArray,#\\ 
\verb#                                     int NoOfInParams,#\\
\verb#                                     float  * *parameterOutArray,#\\ 
\verb#                                     int *NoOfOutParams )#\\
same as \verb#krui_learnAllPatterns( ... )# or
\verb#krui_learnAllPatternsFF( ... )# respectively, but teaches only
the current pattern.



\section{Functions for the Manipulation of Patterns}
\index{Kernel Function!Pattern Manipulation \~~}

\verb#krui_err  krui_setPatternNo( int  patter_no )#\\
sets the current pattern; returns an error code if the pattern number
is invalid.  
\vspace{1ex}

\verb#krui_err  krui_deletePattern( void )#\\
deletes the current pattern.
\vspace{1ex}

\verb#krui_err  krui_modifyPattern( void )#\\
modifies the current pattern. Sets the pattern to the current
activation of the units.
\vspace{1ex}

\verb#krui_err  krui_showPattern( int  mode )#\\
outputs a pattern on the activation or output values of the
input/output units. The following modes are possible:
\begin{itemize}
\item \verb#OUTPUT_NOTHING#: stores the input pattern in the
activation of the input units.
\item \verb#OUTPUT_ACT#: like  \verb#OUTPUT_NOTHING#, but stores
also the output pattern in the activation of the output units.
\item \verb#OUTPUT_OUT#: like \verb#OUTPUT_ACT#, additionally a new
output value of the output units is computed.
\end{itemize}

\verb#krui_showPattern(...)#\\ draws pattern on the
display. Generates an error code if the number of input and output
units does not correspond with the previously loaded pattern. The
constants of the various modes are defined in \verb#glob_typ.h#.
\vspace{1ex}

\verb#krui_err  krui_newPattern( void )#\\
creates a new pattern (an input/output pair).
A pattern can be created by modifying the activation
value of the input/output units.
The function returns an error code if there is insufficient memory or
the number of input/output units is incompatible with the pattern.

Note: \verb#krui_newPattern()# switches pattern shuffling off.
For shuffling the new patterns call:
\begin{verbatim}
  krui_newPattern(...)
  krui_shufflePatterns( TRUE )
\end{verbatim}
\vspace{1ex}

\verb#void  krui_deleteAllPatterns()#\\
deletes all previously defined patterns in main memory.
\vspace{1ex}

\verb#krui_err krui_shufflePatterns( bool on_or_off )#\\
\mbox{shuffles the order of the patterns if} {\tt on\_or\_off} is
true. If {\tt on\_or\_off} is false the original order can be
restored. See also \verb#krui_setSeedNo(...)#.  
\vspace{1ex}

\verb#krui_err  krui_shuffleSubPatterns(bool on_or_off)#\\
shuffles sub pattern pairs by using pseudo random generator.\\
\verb#krui_shuffleSubPatterns(TRUE)# switches shuffeling of sub patterns on,\\
\verb#krui_shuffleSubPatterns(FALSE)# switches shuffeling of sub patterns off.\\
The default presetting is \verb#krui_shuffleSubPatterns (FALSE)#.
\vspace{1ex}




\verb#int  krui_getNoOfPatterns( void )#\\
returns the actual number of patterns (0 if no patterns have
been loaded).
\vspace{1ex}


\verb#krui_err  krui_allocNewPatternSet(int *set_no)#\\
returns the number of the allocated pattern set.
In case of an error the error code will be returned.
\vspace{1ex}


\verb#krui_err krui_setCurrPatSet(int number)#\\
chooses the number of the current pattern set.
The number ranges from 0 to n-1.
\vspace {1ex}


\verb#krui_err  krui_deletePatSet(int number)#\\
deletes all patterns of the pattern set with the given number. 
\vspace {1ex}


\verb#krui_err  krui_GetPatInfo(pattern_set_info *set_info,#\\
\verb#                          pattern_descriptor *pat_info)#\\
gets all available information concerning the current pattern  set and the current
pattern.
\vspace {1ex}

\verb#krui_err  kruiDefShowSubPat(int *insize,int *outsize,int,#\\
\verb#                            int *inpos,int *outpos)#\\
defines the sub pattern that will be shown with the next call of \verb#krui_showPattern#.
\vspace {1ex}


\verb#krui_err  krui_DefTrainSubPat(int *insize,int *outsize,int *instep,#\\
\verb#                              int *outstep, int *max_n_pos)#\\
defines how sub pattern should be generated during training.
\verb#krui_DefTrainSubPat()# has to be called before any training can take place.
\vspace {1ex}


\verb#krui_err   krui_AlignSubPat(int *inpos,int *outpos,int *no)#\\
aligns the given sub pattern position to a valid position which fits the 
defined sub pattern training scheme \verb#(krui_DefTrainSubPat)#.
\vspace {1ex}


\verb#krui_err  krui_GetShapeOfSubPattern(int *insize,int *outsize,int *inpos,#\\
\verb#                                    int *outpos,int *n_pos)#\\
gets the shape of the sub pattern by using the current set,current pattern and the current 
train scheme (defined with \verb#krui_DefTrainSubPat)#.
\vspace {1ex}





\section{File I/O Functions}
\index{Kernel Function!File I/O \~~}

\verb#krui_err  krui_loadNet( char  *filename, char  * *netname )#\\
\verb#krui_err  krui_saveNet( char  *filename, char  *netname)#\\
loads/saves a network from/to disk and generates an internal network
structure.
\vspace{1ex}

\verb#krui_err krui_loadNewPatterns(char *filename,int *set_no)#\\
\verb#krui_err  krui_saveNewPatterns(char *filename,int set_no)#\\
saves and loads a pattern file with new style conventions.\\
The pattern set with the given number will be saved and loaded.
\vspace{1ex}


\verb#krui_err krui_saveResultParam(char *filename,bool create,int startpattern,#\\
\verb#                      int endpattern,bool includeinput,bool includeoutput,#\\
\verb#                      float *Update_param_array, int NoOfUpdateParam)#\\
Saves the network result which depends on the loaded patterns.
If create is false,the new file will be appended to an existing file.
Startpattern and endpattern determines the range of patterns to use.
The input patterns and the teaching output patterns can be included.

An error code is returned if an error occurred during the execution of
the I/O functions.



\section{Functions to Search the Symbol Table}
\index{Kernel Function!Symbol Table Search \~~}
 
\verb#bool  krui_getFirstSymbolTableEntry( char * *symbol_name,#\\ 
\verb#                                    int *symbol_type )#\\
\verb#bool  krui_getNextSymbolTableEntry( char * *symbol_name,#\\
\verb#                                    int *symbol_type )#\\
determines the name and type of the first/next entry in the symbol
table and returns TRUE if another entry exists.
\vspace{1ex}

\verb#bool  krui_symbolSearch( char *symbol, int  symbol_type)#\\
returns TRUE if the given symbol exists in the symbol table.

\clearpage

\section{Miscelaneous other Interface Functions}
\index{Kernel Function!Interface \~~}

\verb#char  *krui_getVersion()#\\
determines the version number of the SNNS kernel.

\verb#void  krui_getNetInfo( int  *no_of_sites, int  *no_of_links,#\\
\verb#                       int  *no_of_STable_entries,#\\
\verb#                       int  *no_of_FTable_entries )#\\
gathers various information about the network.

\verb#void  krui_getUnitDefaults( FlintType  *act, FlintType  *bias,#\\
\verb#                           int *io_type, int *subnet_no, int *layer_no,#\\
\verb#                           char * *act_func, char * *out_func)#\\
determines the default values for generating units. See also
\verb#krui_createDefaultUnit()# and \verb#krui_createFTypeUnit(...)#.

\verb#krui_err  krui_setUnitDefaults( FlintTypeParam act, FlintTypeParam bias,#\\
\verb#                               int io_type, int subnet_no, int layer_no,#\\
\verb#                               char *act_func, char *out_func)#\\
changes the default values; returns an error code if the IO-type or
the activation/output function is unknown.
\vspace{1ex}


\verb#void  krui_setSeedNo( long seed )#\\
initializes the random number generator. If  \verb#seed = 0#, the
random number generator is re-initialized (this time really at
random!).
\vspace{1ex}

\verb#int  krui_getNoOfInputUnits()#\\
\verb#int  krui_getNoOfOutputUnits()#\\
return the number of input/output units
\vspace{1ex}

\verb#int  krui_getNoOfSpecialInputUnits()#\\
\verb#int  krui_getNoOfSpecialOutputUnits()#\\
return the number of special input/output units
\vspace{1ex}

\verb#void  krui_resetNet()#\\
sets the activation values of all units to their respective defaults.



\section{Memory Management Functions}
\index{Kernel Function!Memory Management \~~}

\verb#krui_err  krui_allocateUnits( int  number )#\\
reserves \verb#<number># units in memory. Additional units can be
requested by multiple calls to that function. This function doesn't
have to be called, since the SNNS kernel always reserves enough memory
for units, sites and links. If a large amount of units is needed,
however, a call to \verb#krui_allocateUnits(...)# eases the
administration of system resources. If \verb#krui_allocateUnits(...)#
is never called, units are always requested in blocks of size
\verb#<UNIT_BLOCK>#. See also \verb#kr_def.h#.


\verb#void krui_getMemoryManagerInfo(int *unit_bytes, int *site_bytes,#\\
\verb#                               int *link_bytes, int *NTable_bytes,#\\
\verb#                               int *STable_bytes, int *FTable_bytes)#\\
determines the number of allocated (not the number of used) bytes for
the various components.
\vspace{1ex}

\verb#void  krui_deleteNet()#\\
deletes the network and frees the whole memory used for the
representation of the data structures.

\section{ART Interface Functions}
\index{Kernel Function!ART Interface \~~}

The functions described in this paragraph are only useful if you use
one of the ART models ART1, ART2 or ARTMAP. They are additional
functions, not replacing any of the kernel interface functions
described above. To use them, you have to include the files
{\tt art\_ui.h} and {\tt art\_typ.h} in your application.


\verb#krui_err artui_getClassifiedStatus( art_cl_status *status )#\\
returns the actual classification state of an ART network in parameter
{\tt status}. Type {\tt art\_cl\_status} is described above. An
SNNS error code is returned as function value. 
The function can be used for ART1, ART2 and ARTMAP models.

\verb#krui_err artui_getClassNo( int *class_no )#\\
returns a number between 1 and $M$ in parameter {\tt class\_no}, which
is either the index of the actual winner unit in the F$_2$ layer of an 
ART1 or ART2 network or the one of the activated MAP unit in an ARTMAP
network. It will return -1 as {\tt class\_no} if no actual class is
active. An SNNS error code is returned as function value.

\verb#krui_err  artui_getN (int *N )#\\
determines the number of F1-units in an ART1 or ART2 network.

\verb#krui_err  artui_getM (int *M )#\\
determines the number of F2-units in an ART1 or ART2 network.

\verb#krui_err  artui_getNa (int *Na )#\\
determines the number of F1a-units in an ARTMAP network.

\verb#krui_err  artui_getMa (int *Ma )#\\
determines the number of F2a-units in an ARTMAP network

\verb#krui_err  artui_getNb (int *Nb)#\\
determines the number of F1b-units in an ARTMAP network.

\verb#krui_err  artui_getMb (int *Mb)#\\
determines the number of F2b-units in an ARTMAP network.

\clearpage

\section{Error Messages of the Simulator Kernel}
\index{Error Message}
\index{Kernel Function!Error Code Translation}

Most interface functions return an error code if the parameters
contradict each other, or if an error occurred during execution. If no
error occurred during execution of a kernel interface function, the
function returns the code: \verb#KRERR_NO_ERROR#.
\verb#KRERR_NO_ERROR# is equal to 0.  The simulator kernel can generate
54 different error messages.  The error code constants are defined in
\verb#glob_typ.h#.  There is also a function to translate an error
code into text:

\verb#char  *krui_error( int  error_code )#\\
converts an error code to a string. The following error messages are
used:

\begin{verbatim}
KRERR_NO_ERROR:                  No Error
KRERR_INSUFFICIENT_MEM:          Insufficient memory
KRERR_UNIT_NO:                   Invalid unit number
KRERR_OUTFUNC:                   Invalid unit output function
KRERR_ACTFUNC:                   Invalid unit activation function
KRERR_SITEFUNC:                  Invalid site function
KRERR_CREATE_SITE:               Creation of sites is not permitted 
                                 because unit has direct input links
KRERR_ALREADY_CONNECTED:         Creation of a link is not permitted 
                                 because there exists already a link 
                                 between these units
KRERR_CRITICAL_MALLOC:           allocation failed in critical operation.
KRERR_FTYPE_NAME:                Ftype name is not definite
KRERR_FTYPE_ENTRY:               Current Ftype entry is not defined
KRERR_COPYMODE:                  Invalid copy mode
KRERR_NO_SITES:                  Current unit does not have sites
KRERR_FROZEN:                    Can't update unit because unit is frozen
KRERR_REDEF_SITE_NAME:           Redefinition of site name not permitted
                                 (site name already exists)
KRERR_UNDEF_SITE_NAME:           Site name is not defined
KRERR_NOT_3D:                    Invalid Function: Not a 3D-Kernel
KRERR_DUPLICATED_SITE:           Unit has already a site with this name  
KRERR_INUSE_SITE:                Can not delete site table entry because 
                                 site is in use
KRERR_FTYPE_SITE:                Current Ftype site is not defined
KRERR_FTYPE_SYMBOL:              Given symbol is not defined in the symbol 
                                 table
KRERR_IO:                        Physical I/O error
KRERR_SAVE_LINE_LEN:             Creation of output file failed 
                                 (line length, limit exceeded)
KRERR_NET_DEPTH:                 The depth of the network does not fit the 
                                 learning function
KRERR_NO_UNITS:                  No Units defined
KRERR_EOF:                       Unexpected EOF
KRERR_LINE_LENGTH:               Line length exceeded
KRERR_FILE_FORMAT:               Incompatible file format
KRERR_FILE_OPEN:                 Can not open file
KRERR_FILE_SYNTAX:               Syntax error at line
KRERR_MALLOC1:                   Memory allocation error 1
KRERR_TTYPE:                     Topologic type invalid
KRERR_SYMBOL:                    Symbol pattern invalid 
                                 (must match [A-Za-z]^[|, ]*)
KRERR_NO_SUCH_SITE:              Current unit does not have a site with 
                                 this name
KRERR_NO_HIDDEN_UNITS:           No hidden units defined
KRERR_CYCLES:                    cycle(s):
KRERR_DEAD_UNITS:                dead unit(s):
KRERR_INPUT_PATTERNS:            Pattern file contains not the same number
                                 of input units as the network                                
KRERR_OUTPUT_PATTERNS:           Pattern file contains not the same number 
                                 of output units as the network
KRERR_CHANGED_I_UNITS:           Number of input units has changed
KRERR_CHANGED_O_UNITS:           Number of output units has changed
KRERR_NO_INPUT_UNITS:            No input units defined
KRERR_NO_OUTPUT_UNITS:           No output units defined
KRERR_NO_PATTERNS:               No patterns defined
KRERR_INCORE_PATTERNS:           Incore patterns incompatible with current 
                                 network (remove loaded patterns before 
                                 loading network)
KRERR_PATTERN_NO:                Invalid pattern number
KRERR_LEARNING_FUNC:             Invalid learning function
KRERR_PARAMETERS:                Invalid parameters
KRERR_UPDATE_FUNC:               Invalid update function
KRERR_INIT_FUNC:                 Invalid initialization function
KRERR_DERIV_FUNC:                Derivation function of the activation 
                                 function does not exist
KRERR_I_UNITS_CONNECT:           input unit(s) with input connections to 
                                 other units
KRERR_O_UNITS_CONNECT:           output unit(s) with output connections to 
                                 other units
KRERR_TOPOMODE:                  Invalid topological sorting mode
KRERR_LEARNING_SITES:            Learning function doesn't support sites   
KRERR_SITES_NO_SUPPORT:          Sites are not supported
KRERR_NO_MASPAR_KERNEL:          This isn't a MasPar Kernel
KRERR_NOT_NEIGHBOUR_LAYER:       Connection(s) between unit(s) in 
                                 non-neighbour layers are not supported
KRERR_MUCH_LAYERS:               The number of layers is too high
KRERR_NOT_FULLY_CONNECTED:       The network layers aren't fully connected
KRERR_MODE_FF1_INVALID_OP:       This operation is not allowed in parallel 
                                 kernel mode
KRERR_NET_TRANSFORM:             Change of network type isn't possible in 
                                 parallel kernel mode
KRERR_NO_CURRENT_LINK:           No current link defined
KRERR_NO_CURRENT_UNIT:           No current unit defined
KRERR_UNIT_NO_INPUT:             Current unit does't have any inputs
KRERR_TOPO_DEFINITION:           Invalid parameter in topologic definition 
                                 section
KRERR_BAD_CONNECTION:            Creation of link between these units is 
                                 not permitted
KRERR_MASPAR_NO_RESPOND:         MasPar doesn't respond 
KRERR_NOT_IMPLEMENTED_YET:       This function isn't implemented yet
KRERR_NOT_PARRALLEL_MODE:        Kernel isn't in parallel mode
KRERR_MASPAR_OUT_OF_PE_MEM:      MasPar ran out of memory
KRERR_MASPAR_COMMUNICATE:        MasPar communication error
KRERR_MASPAR_OUT_OF_PE:          MasPar ran out of processors
KRERR_MISSING_DEFAULT_FUNC:      Missing default function 
                                 (check function table)
KRERR_MASPAR_MULTI_OUT_FUNC:     MasPar kernel does not support multiple 
                                 unit output functions
KRERR_MASPAR_MULTI_ACT_FUNC:     MasPar kernel doesn't support multiple 
                                 unit activation functions
KRERR_NET_DEPTH:                 The depth of the network does not fit to 
                                 the learning function
KRERR_NO_OF_UNITS_IN_LAYER:      Wrong no. of units in layer
KRERR_UNIT_MISSING:              Unit missing or not correctly connected
KRERR_UNDETERMINED_UNIT:         Unit does not belong to a defined layer 
                                 in the network
KRERR_ACT_FUNC:                  Unit has wrong activation function
KRERR_OUT_FUNC:                  Unit has wrong output function
KRERR_SITE_FUNC:                 Unexpected site function at unit 
KRERR_UNEXPECTED_SITES:          Unit is not expected to have sites 
KRERR_UNEXPECTED_DIRECT_INPUTS:  Unit is expected to have sites 
KRERR_SITE_MISSING:              Site missing at unit 
KRERR_UNEXPECTED_LINK:           Unexpected link 
KRERR_LINK_MISSING:              Missing link(s) to unit 
KRERR_LINK_TO_WRONG_SITE:        Link ends at wrong site of target unit 
KRERR_TOPOLOGY:                  The network is not fitting the required 
                                 topology
KRERR_PARAM_BETA:                Wrong beta parameter in unit bias value
KRERR_CC_ERROR1:                 Topo_ptr_array is sorted in the wrong way
KRERR_CC_ERROR2:                 There is no memory allocated
KRERR_CC_ERROR3:                 Not enough memory to run Casscade
KRERR_CC_ERROR4:                 Hidden unit with more than one recurent 
                                 link detected
KRERR_CC_ERROR5:                 Hidden unit without recurrent link found
KRERR_CC_ERROR6:                 Hidden layer does not fit the required 
                                 topology
KRERR_CC_ERROR7:                 The first link of a hidden unit is not a 
                                 recurent link
KRERR_CC_ERROR8:                 Special unit with more than one recurent 
                                 link detected
KRERR_CC_ERROR9:                 First link of a special unit is not a 
                                 recurent link
KRERR_CC_ERROR10:                Wrong update function
KRERR_CC_ERROR11:                Wrong init function
DLVQ_ERROR1:                     There are empty classes
DLVQ_ERROR2:                     There is a class lower than zero
DLVQ_ERROR3:                     Wrong number of output units.
DLVQ_ERROR4:                     This network is not fitting the required 
                                 topology
DLVQ_ERROR5:                     There isn't a unit for every class
KRERR_NP_NO_MORE_ENTRIES:        No more free pattern sets available
KRERR_NP_NO_SUCH_PATTERN_SET:    No such Pattern set defined
KRERR_NP_CURRENT_PATTERN:        No current pattern defined
KRERR_NP_DIMENSION:              Specified sub pattern does not fit into 
                                 pattern
KRERR_NP_NO_SUCH_PATTERN:        No such pattern available
KRERR_NP_NO_CURRENT_PATTERN_SET: No current pattern set defined
KRERR_NP_DOES_NOT_FIT:           Pattern (sub pattern) does not fit the 
                                 network
KRERR_NP_NO_TRAIN_SCHEME:        No sub pattern shifting scheme defined
KRERR_NP_NO_OUTPUT_PATTERN:      Pattern contains no output information
KRERR_NP_INCOMPATIBLE_NEW:       New Pattern does not fit to existing set   
KRERR_NP_PARAM_ZERO:             Illegal parameter value <= 0 specified
KRERR_IP_ISNOTINITED:            Paragon kernel is not initialized
KRERR_IP_ISINITED:               Paragon kernel is already initialized
KRERR_IP_SENDMSGFAILED:          Sending a message fails
KRERR_IP_MSGSYNTAX:              Syntax error in received message 
KRERR_IP_UNKNOWENCMD:            Receive unknown command
KRERR_IP_LESSPAT:                There are less patterns than allocated 
                                 nodes
KRERR_IP_WEIGHTUPDATE:           Weight update with global sum fails
KRERR_IP_LEARNFNOTPAR:           Learning function is not parallelized       

\end{verbatim}



