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

file_io.c File Reference

General file-saving routines. More...

#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <math.h>
#include "ipc.h"
#include "cmdparam.h"
#include "tilt.h"
#include "ppm_draw.h"
#include "binarysave.h"
#include "inputs.h"
#include "analyze.h"
#include "file_io.h"
#include "globals.h"
#include "kernel.h"
#include "lissom.h"

Include dependency graph for file_io.c:

Include dependency graph

Go to the source code of this file.

Compounds

struct  cmdobj_activity_distribution
struct  cmdobj_dump_lat_wts
struct  cmdobj_dump_lat_wts_sq
struct  cmdobj_load_snapshot
struct  cmdobj_or_pref_distribution
struct  cmdobj_plot_activity
struct  cmdobj_plot_afferent_weight_map
struct  cmdobj_plot_or_key
struct  cmdobj_plot_weights
struct  cmdobj_read_or_pref
struct  cmdobj_save_snapshot

Defines

#define MAX_FILENAME_LENGTH   128

Functions

cmdstat cmd_activity_distribution ( int argc, const char *argv[] )
cmdstat cmd_dump_lat_wts ( int argc, const char *argv[] )
cmdstat cmd_dump_lat_wts_sq ( int argc, const char *argv[] )
 Dumps lateral weights in a square region of the net, starting with (neuron,neuron) and ending with (neuron+side, neuron+side), in steps. More...

cmdstat cmd_load_snapshot ( int argc, const char *argv[] )
cmdstat cmd_or_pref_distribution ( int argc, const char *argv[] )
cmdstat cmd_plot_afferent_weight_map ( int argc, const char *argv[] )
cmdstat cmd_plot_or_key ( int argc, const char *argv[] )
cmdstat cmd_plot_weights ( int argc, const char *argv[] )
cmdstat cmd_plot_activity ( int argc, const char *argv[] )
cmdstat cmd_read_or_pref ( int argc, const char *argv[] )
cmdstat cmd_save_snapshot ( int argc, const char *argv[] )
int save_orientation_distribution (OrientationHistogram *histo, const char *histotype, int eye)
void read_afferent_wts (Neuron nmap[NMAX][NMAX], FILE *fp, int ui,int uj, int action)
void read_one_eye_wts (FILE *fp, a_weight affwts[WTMAX][WTMAX], int lowk, int highk, int lowl, int highl, int action)
int read_maple (FILE *fp,l_weight *weights,int radius,int ui,int uj,double multiplier, int action)
void weights_IO (int action, FILE *fp)
 This procedure does reading and writing of weights to an ASCII file. More...

void file_io_init_hook ( void )
void save_presentation_image (const char* filename, double fname_angle, double input_v[RNMAX*RNMAX*MAX_NUM_EYES], double initial_activity[NMAX][NMAX], double settled_activity[NMAX][NMAX], int pres)
 Create and save a picture of the input and activations. More...

int save_image_data (void)
 Saves data for visualizing the network's evolution. More...

void read_or (FILE * or_fp, int or_min, int or_max, int or_preferences[EYE_ARRAY_SIZE][NMAX][NMAX], double or_selectivities[EYE_ARRAY_SIZE][NMAX][NMAX] )
void read_wts (Neuron nmap[NMAX][NMAX], const char *basefilename,int ui,int uj, int output_routine, int iter, int action, int *centerx, int *centery)
 Reads Maple plot files of weight values for one neuron. More...

int compute_orientation_distribution (int lowi, int highi, int lowj, int highj, OrientationHistogram *histo, double activity[NMAX][NMAX],int eye)
 Make an orientation histogram out of the current orientation map and (optionally) a map of activities. More...

int compute_weight_distribution (OrientationHistogram *histo, int ui, int uj, l_weight *weights, int radius, int ar_width, int eye)
 Make an orientation histogram out of the current orientation map and a set of lateral weights. More...

int plot_weights_to_file (int ui, int uj, char *filebasename,int iter)
void swallow_line (FILE *stream)
 Swallows the rest of the current line on the given stream. More...


Variables

int plot_pe = PARENTPE
int save_histo_files = False
OrientationHistogram map_angles
OrientationHistogram prev_map_angles
OrientationHistogram weight_angles
OrientationHistogram ormap_angles


Detailed Description

General file-saving routines.

Header:
/u/nn/cvsroot/lissom/src/file_io.c,v 1.74 2000/04/21 20:47:22 jbednar Exp

Definition in file file_io.c.


Define Documentation

#define MAX_FILENAME_LENGTH   128
 

Definition at line 34 of file file_io.c.

#define SAVE_ACTIVITIES
 

Definition at line 43 of file file_io.c.

#define SAVE_INPUTS
 

Definition at line 46 of file file_io.c.

#define SAVE_MAP_DATA
 

Definition at line 44 of file file_io.c.

#define SAVE_OD_PREFS
 

Definition at line 45 of file file_io.c.


Function Documentation

cmdstat cmd_activity_distribution ( int argc,
const char * argv[] )
 

Definition at line 1311 of file file_io.c.

cmdstat cmd_dump_lat_wts ( int argc,
const char * argv[] )
 

Definition at line 842 of file file_io.c.

cmdstat cmd_dump_lat_wts_sq ( int argc,
const char * argv[] )
 

Dumps lateral weights in a square region of the net, starting with (neuron,neuron) and ending with (neuron+side, neuron+side), in steps.

The ipc_get function overwrites local weights of PE 0, so this can be called only at the end of the simulation. It cannot be used in conjunction with weights_IO if the N-1th PE is involved, because that overwrites the (N-1)th PE's weights.

Definition at line 915 of file file_io.c.

cmdstat cmd_load_snapshot ( int argc,
const char * argv[] )
 

Definition at line 286 of file file_io.c.

cmdstat cmd_or_pref_distribution ( int argc,
const char * argv[] )
 

Definition at line 1288 of file file_io.c.

cmdstat cmd_plot_activity ( int argc,
const char * argv[] )
 

Definition at line 305 of file file_io.c.

cmdstat cmd_plot_afferent_weight_map ( int argc,
const char * argv[] )
 

Definition at line 365 of file file_io.c.

cmdstat cmd_plot_or_key ( int argc,
const char * argv[] )
 

Definition at line 328 of file file_io.c.

cmdstat cmd_plot_weights ( int argc,
const char * argv[] )
 

Definition at line 1461 of file file_io.c.

cmdstat cmd_read_or_pref ( int argc,
const char * argv[] )
 

Definition at line 988 of file file_io.c.

cmdstat cmd_save_snapshot ( int argc,
const char * argv[] )
 

Definition at line 268 of file file_io.c.

int compute_orientation_distribution ( int lowi,
int highi,
int lowj,
int highj,
OrientationHistogram * histo,
double activity[NMAX][NMAX],
int eye )
 

Make an orientation histogram out of the current orientation map and (optionally) a map of activities.

Definition at line 1348 of file file_io.c.

int compute_weight_distribution ( OrientationHistogram * histo,
int ui,
int uj,
l_weight * weights,
int radius,
int ar_width,
int eye )
 

Make an orientation histogram out of the current orientation map and a set of lateral weights.

Definition at line 1382 of file file_io.c.

void file_io_init_hook ( void )
 

Definition at line 107 of file file_io.c.

int plot_weights_to_file ( int ui,
int uj,
char * filebasename,
int iter )
 

Definition at line 1497 of file file_io.c.

void read_afferent_wts ( Neuron nmap[NMAX][NMAX],
FILE * fp,
int ui,
int uj,
int action )
 

Definition at line 1269 of file file_io.c.

int read_maple ( FILE * fp,
l_weight * weights,
int radius,
int ui,
int uj,
double multiplier,
int action )
 

Definition at line 1141 of file file_io.c.

void read_one_eye_wts ( FILE * fp,
a_weight affwts[WTMAX][WTMAX],
int lowk,
int highk,
int lowl,
int highl,
int action )
 

Definition at line 1190 of file file_io.c.

void read_or ( FILE * or_fp,
int or_min,
int or_max,
int or_preferences[EYE_ARRAY_SIZE][NMAX][NMAX],
double or_selectivities[EYE_ARRAY_SIZE][NMAX][NMAX] )
 

Definition at line 1018 of file file_io.c.

void read_wts ( Neuron nmap[NMAX][NMAX],
const char * basefilename,
int ui,
int uj,
int output_routine,
int iter,
int action,
int * centerx,
int * centery )
 

Reads Maple plot files of weight values for one neuron.

Note that the inhibitory and excitatory lateral weight values have been scaled by gammainh and gammaexc, respectively.

Definition at line 1087 of file file_io.c.

int save_image_data ( void )
 

Saves data for visualizing the network's evolution.

At each snapshot, the afferent map, od patterns and intitial and final activity patterns are stored.

The cx and cy arrays must be static local to use shmem communication.

(28 Feb 96 J.A.B.) Reorganized and added ifdefs to allow saving only some files if the rest are not needed. Note that disabling any of them may interfere with the operation of the display_od program, so turning them off should only be done if using another display method.

Definition at line 510 of file file_io.c.

Referenced by save_presentation_image().

int save_orientation_distribution ( OrientationHistogram * histo,
const char * histotype,
int eye )
 

Definition at line 1418 of file file_io.c.

void save_presentation_image ( const char * filename,
double fname_angle,
double input_v[RNMAX *RNMAX *MAX_NUM_EYES],
double initial_activity[NMAX][NMAX],
double settled_activity[NMAX][NMAX],
int pres )
 

Create and save a picture of the input and activations.

Definition at line 428 of file file_io.c.

void swallow_line ( FILE * stream )
 

Swallows the rest of the current line on the given stream.

Definition at line 1538 of file file_io.c.

void weights_IO ( int action,
FILE * fp )
 

This procedure does reading and writing of weights to an ASCII file.

fp is the file pointer. Data are saved and read from the N-th PE to the zeroth so that the same locally allocated structures can be used to hold the data. The ipc_get procedure overwrites local weights, so this function can be called only at the end of the simulation.

Definition at line 737 of file file_io.c.


Variable Documentation

OrientationHistogram map_angles
 

Definition at line 64 of file file_io.c.

OrientationHistogram ormap_angles
 

Definition at line 67 of file file_io.c.

int plot_pe = PARENTPE
 

Definition at line 54 of file file_io.c.

OrientationHistogram prev_map_angles
 

Definition at line 65 of file file_io.c.

int save_histo_files = False
 

Definition at line 62 of file file_io.c.

OrientationHistogram weight_angles
 

Definition at line 66 of file file_io.c.


Generated at Mon Aug 21 00:30:58 2000 for RF-LISSOM by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000