8 #include "TransposePatchSize.hpp" 9 #include "columns/HyPerCol.hpp" 13 TransposePatchSize::TransposePatchSize(
char const *name, HyPerCol *hc) { initialize(name, hc); }
15 TransposePatchSize::TransposePatchSize() {}
17 TransposePatchSize::~TransposePatchSize() {}
19 int TransposePatchSize::initialize(
char const *name, HyPerCol *hc) {
20 return PatchSize::initialize(name, hc);
23 void TransposePatchSize::setObjectType() { mObjectType =
"TransposePatchSize"; }
25 void TransposePatchSize::setPatchSize(PatchSize *originalPatchSize) {
26 auto *originalConnectionData = originalPatchSize->getConnectionData();
27 pvAssert(originalConnectionData);
28 int const nxpOrig = originalPatchSize->getPatchSizeX();
29 int const nypOrig = originalPatchSize->getPatchSizeY();
30 PVLayerLoc const *originalPreLoc = originalConnectionData->getPre()->getLayerLoc();
31 PVLayerLoc const *originalPostLoc = originalConnectionData->getPost()->getLayerLoc();
32 mPatchSizeX =
calcPostPatchSize(nxpOrig, originalPreLoc->nx, originalPostLoc->nx);
33 mPatchSizeY =
calcPostPatchSize(nypOrig, originalPreLoc->ny, originalPostLoc->ny);
static int calcPostPatchSize(int prePatchSize, int numNeuronsPre, int numNeuronsPost)