Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

binarysave.c File Reference


Detailed Description

Routines for binary weight file writing/reading.

Header
/u/nn/cvsroot/lissom/src/binarysave.c,v 1.50 2002/07/29 17:26:48 yschoe Exp

Definition in file binarysave.c.

#include <stdio.h>
#include <time.h>
#include <sys/types.h>
#include "binarysave.h"
#include "ipc.h"
#include "cmdparam.h"
#include "globals.h"
#include "kernel.h"

Include dependency graph for binarysave.c:

Include dependency graph

Go to the source code of this file.

Defines

#define NO_ANALYZE
#define LF_BUFFER_VERIFY
 Define if each buffer should be interpreted to verify before writing it.

#define LF_FLOAT_SIZE   sizeof(LFFloatType)
#define SMALLEST_LFTOK   1
#define LFTOK_NO_TOKEN   0
#define LFTOK_SNAPSHOT_HEADER   1
#define LFTOK_ROW_HEADER   2
#define LFTOK_NEURON_HEADER_ORIG   3
#define LFTOK_AFF_WEIGHTS   4
#define LFTOK_LEXC_WEIGHTS_OLD   5
#define LFTOK_LINH_WEIGHT_CHUNK   6
#define LFTOK_NEURON_TRAILER   7
#define LFTOK_SNAPSHOT_TRAILER   8
#define LFTOK_LEXC_WEIGHTS   9
#define LFTOK_NEURON_HEADER_BUG   10
#define LARGEST_LFTOK   10
#define LF_UNUSED   0x00
 Use to fill in a token field that is unused.

#define LF_ALL_EYES   99
 Indicates that afferent weights are for all eyes.

#define LF_FLOAT_TOLERANCE   0.0000001
#define LF_NO_ERROR   0
#define LF_ERROR   -1
#define LF_MAXWARNINGS   5
#define MAKE_SURE_NEURON_HEADER_INFO_AVAILABLE
#define compareOrSet_proc(type)
 Family of routines to set a value of different float types.


Typedefs

typedef f32 LFFloatType
 Format for each floating point number stored in the weights file.


Define Documentation

#define compareOrSet_proc type   
 

Value:

LISSOMBinaryStateSaver::type LISSOMBinaryStateSaver::compareOrSet_ ## type (type *destination, type value, int verify, const char *description) \
{                                                                                               \
  if (!verify)                                                                                  \
    *destination = value;                                                                       \
  else                                                                                          \
                        \
    if ((*destination == 0 && ((*destination - value)                 > LF_FLOAT_TOLERANCE ))|| \
        (*destination != 0 && ((*destination - value)/(*destination)) > LF_FLOAT_TOLERANCE ) ) {\
      static int warnings=0;                                                                    \
      warnings++;                                                                               \
      if (warnings < LF_MAXWARNINGS)                                                            \
        ipc_notify(IPC_ALL,IPC_ERROR,"compareOrSet_" #type ": Value for %s stored in buffer (%e) differs from value in memory (%e)",    \
                  description, (double)value, (double)(*destination));                          \
      else if (warnings == LF_MAXWARNINGS)                                                      \
        ipc_notify(IPC_ALL,IPC_ERROR,"compareOrSet_" #type ": Maximum number of warnings reached (%d)",warnings);       \
    }                                                                                           \
                                                                                                \
  return *destination;                                                                          \
}
Family of routines to set a value of different float types.

Can verify instead if in verify mode.

Definition at line 1422 of file binarysave.c.

#define MAKE_SURE_NEURON_HEADER_INFO_AVAILABLE
 

Value:

if (current_map_row == Uninitialized || current_j == Uninitialized) {  \
    ipc_notify(IPC_ALL,IPC_ERROR,"Missing neuron header");                           \
    return LF_ERROR;                                                       \
  }

Definition at line 623 of file binarysave.c.


Generated on Mon Jan 20 02:35:48 2003 for RF-LISSOM by doxygen1.3-rc2