CARLsim  3.1.3
CARLsim: a GPU-accelerated SNN simulator
Grid3D Struct Reference

A struct to arrange neurons on a 3D grid (a primitive cubic Bravais lattice with cubic side length 1) More...

#include <carlsim_datastructures.h>

Public Member Functions

 Grid3D (int w)
 
 Grid3D (int w, int h)
 
 Grid3D (int w, int h, int d)
 

Public Attributes

int channels
 
int columns
 
int depth
 
int height
 
int N
 
int width
 
int x
 
int y
 
int z
 

Friends

std::ostream & operator<< (std::ostream &strm, const Grid3D &g)
 

Detailed Description

Neurons of a group can be arranged topographically, so that they virtually lie on a 3D grid. Connections can then be specified depending on the relative placement of neurons via CARLsim::connect. This allows for the creation of networks with complex spatial structure.

Each neuron in the group gets assigned a (x,y,z) location on a 3D grid centered around the origin, so that calling Grid3D(Nx,Ny,Nz) creates coordinates that fall in the range [-(Nx-1)/2, (Nx-1)/2], [-(Ny-1)/2, (Ny-1)/2], and [-(Nz-1)/2, (Nz-1)/2]. The resulting grid is a primitive cubic Bravais lattice with cubic side length 1 (arbitrary units). The primitive (or simple) cubic crystal system consists of one lattice point (neuron) on each corner of the cube. Each neuron at a lattice point is then shared equally between eight adjacent cubes.

Parameters
[in]wthe width of the 3D grid (1st dim)
[in]hthe height of the 3D grid (2nd dim)
[in]zthe depth of the 3D grid (3rd dim; also called column or channel) Examples:
  • Grid3D(1,1,1) will create a single neuron with location (0,0,0).
  • Grid3D(2,1,1) will create two neurons, where the first neuron (ID 0) has location (-0.5,0,0), and the second neuron (ID 1) has location (0.5,0,0).
  • Grid3D(1,1,2) will create two neurons, where the first neuron (ID 0) has location (0,0,-0.5), and the second neuron (ID 1) has location (0,0,0.5).
  • Grid3D(2,2,2) will create eight neurons, where the first neuron (ID 0) has location (-0.5,-0.5,-0.5), the second neuron has location (0.5,-0.5,-0.5), the third has (-0.5,0.5,-0.5), and so forth (see figure below).
  • Grid3D(3,3,3) will create 3x3x3=27 neurons, where the first neuron (ID 0) has location (-1,-1,-1), the second neuron has location (0,-1,-1), the third has (1,-1,-1), the fourth has (-1,0,-1), ..., and the last one has (1,1,1).
  • etc.

Members: x, width the width of the 3D grid (1st dim) y, height the height of the 3D grid (2nd dim) z, depth, columns, channels the depth of the 3D grid (3rd dim) N the total number of neurons on the grid, N=x*y*z

Definition at line 444 of file carlsim_datastructures.h.

Constructor & Destructor Documentation

Grid3D ( int  w)
inline

Definition at line 445 of file carlsim_datastructures.h.

Grid3D ( int  w,
int  h 
)
inline

Definition at line 448 of file carlsim_datastructures.h.

Grid3D ( int  w,
int  h,
int  d 
)
inline

Definition at line 452 of file carlsim_datastructures.h.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  strm,
const Grid3D g 
)
friend

Definition at line 458 of file carlsim_datastructures.h.

Member Data Documentation

int channels

Definition at line 464 of file carlsim_datastructures.h.

int columns

Definition at line 464 of file carlsim_datastructures.h.

int depth

Definition at line 463 of file carlsim_datastructures.h.

int height

Definition at line 463 of file carlsim_datastructures.h.

int N

Definition at line 465 of file carlsim_datastructures.h.

int width

Definition at line 463 of file carlsim_datastructures.h.

int x

Definition at line 462 of file carlsim_datastructures.h.

int y

Definition at line 462 of file carlsim_datastructures.h.

int z

Definition at line 462 of file carlsim_datastructures.h.


The documentation for this struct was generated from the following file: