void CubePBC::UpdateCoord() { if(_psp){ for(int i=1; i<=_psp->GetNP(); ++i) for(int j=0; j<DIM; ++j) (*_psp)[i].x[j] = RestrictX((*_psp)[i].x[j]); } }
/* * Calculate the x-value at the center of the specified column. If the * column number is too large, xmax is returned. If the column number is * too small, xmin is returned. This method uses the is_log_x flag to * determine whether to use a "log" tranformation to map the column to x. * * @param col The column number to map to an x-value. * * @return A corresponding x value between xmin and xmax. */ double DataArray::XOfColumn( size_t col ) const { double xval; if ( is_log_x ) { xval = xmin * exp( ((double)col+0.5)/(double)n_cols * log(xmax/xmin)); } else { xval = ((double)col+0.5)/(double)n_cols * (xmax-xmin) + xmin; } RestrictX( xval ); return xval; }