We copy the heading from the .h file that describes what the class does. Each member function implementation has a similar blocked comment describing the details of the member function (more of an overview) /**************************************************************** * Grid1.C.m4 * * * * Class Grid1 implements an 1-dimensional lparx grid. * * The elements * * of the grid are given by ``type''. * * * Author: Scott Kohn (skohn-at-cs.ucsd.edu) * * Revisions: Stephen Fink * * rewrote for KeLP * *****************************************************************/ #include "Assert.h" #include "Grid1.h" #include "KelpStats.h" /**************************************************************** * Grid1::Grid1(const Region1& region, * * const int processor) * * * * Constructor Grid1() creates a Grid1 object which is * * distributed across all processors. If this is the processor * * which owns the object, then we allocate the data. If not, do * * not allocate the data. * *****************************************************************/ template Grid1::Grid1(const Region1& region, const int processor) : _xobject(processor,region) { if ( (region.size()) && local_object()) _data.resize(region); } /**************************************************************** * Grid1::Grid1(const int i, const int processor) * * * * Constructor Grid1() creates a Grid1 object which is * * distributed across all processors. If this is the processor * * which owns the object, then we allocate the data. If not, * * do not allocate the data. * *************************************************************** */ template Grid1::Grid1(const int i, const int processor) : _xobject(processor,Region1(0, i-1)) { if ( (size()) && local_object()) _data.resize(i); } /* ************************************************************************* * void Grid1::PackRegion(tTYPE *buffer, const Region1& from) * * * * Efficiently pack data from region ``from'' in grid to the buffer. * ************************************************************************* */ template void Grid1::PackRegion(tTYPE *buffer, const Region1& from) const { KELP_STATS_START(KELP_STATS_PACK_REGION); const Grid1& src = *this; int p = 0; BeginFastIndex1(src, const tTYPE); for_1(i, from) buffer[p++] = FastIndex1(src,i); end_for EndFastIndex1(src); KELP_STATS_STOP(KELP_STATS_PACK_REGION); }