Ignore:
Timestamp:
Jun 8, 2016, 8:29:24 PM (9 years ago)
Author:
Frederik Heber <heber@…>
Children:
f84241
Parents:
0c9476
git-author:
Frederik Heber <heber@…> (05/27/16 18:34:23)
git-committer:
Frederik Heber <heber@…> (06/08/16 20:29:24)
Message:

Added getDiscreteWindowIndices() and getDiscreteWindowLengthPerAxis() to SamplingGrid.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Fragmentation/Summation/SetValues/SamplingGrid_inline.hpp

    r0c9476 ra5d4c3  
    3838inline
    3939#endif
     40const size_t SamplingGrid::getDiscreteWindowLengthPerAxis(const size_t axis) const
     41{
     42  const double round_offset =
     43      (std::numeric_limits<size_t>::round_style == std::round_toward_zero) ?
     44          0.5 : 0.; // need offset to get to round_toward_nearest behavior
     45  const double length =
     46    (double)getGridPointsPerAxis()*getWindowLengthPerAxis(axis)/getTotalLengthPerAxis(axis)+round_offset;
     47  return length;
     48}
     49
     50#ifdef HAVE_INLINE
     51inline
     52#endif
    4053const size_t SamplingGrid::getWindowGridPoints() const
    4154{
Note: See TracChangeset for help on using the changeset viewer.