void dump_grid_range_highlight(const Grid & grid, ssize_t ix0, ssize_t iy0, ssize_t ix1, ssize_t iy1, ssize_t ixhigh, ssize_t iyhigh, FILE * stream) { PVDEBUG("%zu %zu %zu %zu %zu %zu\n", ix0, iy0, ix1, iy1, ixhigh, iyhigh); fprintf(stream, " "); for(ssize_t ix(ix0); ix <= ix1; ++ix) if(ix == ixhigh) fprintf(stream, " ***********"); else fprintf(stream, " "); fprintf(stream, " \n"); ssize_t iy(iy1); for(/**/; iy != iy0; --iy){ const char * high(iy == iyhigh ? "*" : " "); linesep(grid, stream, ix0, ix1, 0, " "); line1(grid, stream, iy, ix0, ix1, 0, high); line2(grid, stream, iy, ix0, ix1, 0, high); line3(grid, stream, iy, ix0, ix1, 0, high); line4(grid, stream, iy, ix0, ix1, 0, high); } const char * high(iy == iyhigh ? "*" : " "); linesep(grid, stream, ix0, ix1, 0, " "); line1(grid, stream, iy, ix0, ix1, 0, high); line2(grid, stream, iy, ix0, ix1, 0, high); line3(grid, stream, iy, ix0, ix1, 0, high); line4(grid, stream, iy, ix0, ix1, 0, high); linesep(grid, stream, ix0, ix1, 0, " "); fprintf(stream, " "); for(ssize_t ix(ix0); ix <= ix1; ++ix) if(ix == ixhigh) fprintf(stream, " ***********"); else fprintf(stream, " "); fprintf(stream, " \n"); }
void Recorder< EventType >::eventIn( const EventType& n ) { // inserts a string "\n" before each measurement to make the resulting file more readable std::string linesep( "\n" ); (*m_pArchive) << linesep; (*m_pArchive) << n; }
void dump_grid_range(const Grid & grid, ssize_t ix0, ssize_t iy0, ssize_t ix1, ssize_t iy1, FILE * stream) { PVDEBUG("%zu %zu %zu %zu\n", ix0, iy0, ix1, iy1); const char * even(""); const char * oddsep; const char * oddpre; if (grid.GetNeighborhood() == Grid::SIX) { oddsep = "+-----"; oddpre = " "; } else { oddsep = even; oddpre = even; } ssize_t iy(iy1); const char * prefix; for(/**/; iy != iy0; --iy){ if(iy % 2){ linesep(grid, stream, ix0, ix1, oddsep, 0); prefix = oddpre; } else{ linesep(grid, stream, ix0, ix1, even, 0); prefix = even; } line1(grid, stream, iy, ix0, ix1, prefix, 0); line2(grid, stream, iy, ix0, ix1, prefix, 0); line3(grid, stream, iy, ix0, ix1, prefix, 0); line4(grid, stream, iy, ix0, ix1, prefix, 0); } if(iy % 2){ linesep(grid, stream, ix0, ix1, oddsep, 0); prefix = oddpre; } else{ linesep(grid, stream, ix0, ix1, even, 0); prefix = even; } line1(grid, stream, iy, ix0, ix1, prefix, 0); line2(grid, stream, iy, ix0, ix1, prefix, 0); line3(grid, stream, iy, ix0, ix1, prefix, 0); line4(grid, stream, iy, ix0, ix1, prefix, 0); if(iy % 2) linesep(grid, stream, ix0, ix1, even, 0); else linesep(grid, stream, ix0, ix1, oddsep, 0); }