8 #include "InitOneToOneWeightsWithDelays.hpp" 12 InitOneToOneWeightsWithDelays::InitOneToOneWeightsWithDelays(
char const *name, HyPerCol *hc) {
16 InitOneToOneWeightsWithDelays::InitOneToOneWeightsWithDelays() {}
18 InitOneToOneWeightsWithDelays::~InitOneToOneWeightsWithDelays() {}
20 int InitOneToOneWeightsWithDelays::initialize(
char const *name, HyPerCol *hc) {
21 int status = InitWeights::initialize(name, hc);
27 createOneToOneConnectionWithDelays(dataStart, patchIndex, mWeightInit, arborId);
30 void InitOneToOneWeightsWithDelays::createOneToOneConnectionWithDelays(
37 int unitCellIndex = dataIndexToUnitCellIndex(dataPatchIndex);
43 int const sxp = mWeights->
getGeometry()->getPatchStrideX();
44 int const syp = mWeights->
getGeometry()->getPatchStrideY();
45 int const sfp = mWeights->
getGeometry()->getPatchStrideF();
48 memset(dataStart, 0, nxp * nyp * nfp);
50 int x = (int)(nxp / 2);
51 int y = (int)(nyp / 2);
52 for (
int f = 0; f < nfp; f++) {
53 dataStart[x * sxp + y * syp + f * sfp] = f == nArbors * unitCellIndex + arborId ? iWeight : 0;
int getPatchSizeX() const
float * getDataFromDataIndex(int arbor, int dataIndex)
int getPatchSizeY() const
std::shared_ptr< PatchGeometry > getGeometry() const
virtual void calcWeights()
int getPatchSizeF() const