<commit_before>/*
 * PointProbe.cpp
 *
 *  Created on: Mar 10, 2009
 *      Author: rasmussn
 */

#include "PointProbe.hpp"
#include <string.h>

namespace PV {

PointProbe::PointProbe(const char * filename, int xLoc, int yLoc, int fLoc, const char * msg)
   : PVLayerProbe(filename)
{
   this->xLoc = xLoc;
   this->yLoc = yLoc;
   this->fLoc = fLoc;
   this->msg = strdup(msg);
}

PointProbe::PointProbe(int xLoc, int yLoc, int fLoc, const char * msg)
   : PVLayerProbe()
{
   this->xLoc = xLoc;
   this->yLoc = yLoc;
   this->fLoc = fLoc;
   this->msg = strdup(msg);
}

PointProbe::~PointProbe()
{
   free(msg);
}

int PointProbe::outputState(float time, PVLayer * l)
{
   int nf = l->numFeatures;
   int sf = 1;
   int sx = nf;
   int sy = nf * l->loc.nx;
   int offset = yLoc * sy + xLoc * sx + fLoc * sf;

   fprintf(fd, "%s t=%4d", msg, (int)time);
   fprintf(fd, " G_E=%1.4f", l->G_E[offset]);
   fprintf(fd, " G_I=%1.4f", l->G_I[offset]);
   fprintf(fd, " V=%1.4f", l->V[offset]);
   fprintf(fd, " Vth=%1.4f", l->Vth[offset]);
   fprintf(fd, " a=%1.1f\n", l->activity->data[offset]);

   fflush(fd);

   return 0;
}

} // namespace PV<commit_msg>Renamed variable to make name more consistent with usage.<commit_after>/*
 * PointProbe.cpp
 *
 *  Created on: Mar 10, 2009
 *      Author: rasmussn
 */

#include "PointProbe.hpp"
#include <string.h>

namespace PV {

PointProbe::PointProbe(const char * filename, int xLoc, int yLoc, int fLoc, const char * msg)
   : PVLayerProbe(filename)
{
   this->xLoc = xLoc;
   this->yLoc = yLoc;
   this->fLoc = fLoc;
   this->msg = strdup(msg);
}

PointProbe::PointProbe(int xLoc, int yLoc, int fLoc, const char * msg)
   : PVLayerProbe()
{
   this->xLoc = xLoc;
   this->yLoc = yLoc;
   this->fLoc = fLoc;
   this->msg = strdup(msg);
}

PointProbe::~PointProbe()
{
   free(msg);
}

int PointProbe::outputState(float time, PVLayer * l)
{
   int nf = l->numFeatures;
   int sf = 1;
   int sx = nf;
   int sy = nf * l->loc.nx;
   int offset = yLoc * sy + xLoc * sx + fLoc * sf;

   fprintf(fp, "%s t=%4d", msg, (int)time);
   fprintf(fp, " G_E=%1.4f", l->G_E[offset]);
   fprintf(fp, " G_I=%1.4f", l->G_I[offset]);
   fprintf(fp, " V=%1.4f", l->V[offset]);
   fprintf(fp, " Vth=%1.4f", l->Vth[offset]);
   fprintf(fp, " a=%1.1f\n", l->activity->data[offset]);

   fflush(fp);

   return 0;
}

} // namespace PV
{'fraction_non_alphanumeric': 0.1875, 'fraction_numerical': 0.016156462585034014, 'mean_word_length': 3.2017857142857142, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4401642', 'n_tokens_mistral': 1015, 'n_tokens_neox': 997, 'n_words': 221}