| 1802 | } |
| 1803 | |
| 1804 | void initialize() |
| 1805 | { |
| 1806 | // Taken from Jonathan Shewchuk's exactinit. |
| 1807 | double half; |
| 1808 | double check, lastcheck; |
| 1809 | int every_other; |
| 1810 | |
| 1811 | every_other = 1; |
| 1812 | half = 0.5; |
| 1813 | expansion_epsilon_ = 1.0; |
| 1814 | expansion_splitter_ = 1.0; |
| 1815 | check = 1.0; |
| 1816 | // Repeatedly divide `epsilon' by two until it is too small to add |
| 1817 | // to one without causing roundoff. (Also check if the sum is equal |
| 1818 | // to the previous sum, for machines that round up instead of using |
| 1819 | // exact rounding. Not that this library will work on such machines |
| 1820 | // anyway. |
| 1821 | do |
| 1822 | { |
| 1823 | lastcheck = check; |
| 1824 | expansion_epsilon_ *= half; |
| 1825 | if( every_other ) |
| 1826 | { |
| 1827 | expansion_splitter_ *= 2.0; |
| 1828 | } |
| 1829 | every_other = !every_other; |
| 1830 | check = 1.0 + expansion_epsilon_; |
| 1831 | } while( ( check != 1.0 ) && ( check != lastcheck ) ); |
| 1832 | expansion_splitter_ += 1.0; |
| 1833 | } |
| 1834 | } // namespace PCK |
| 1835 | } // namespace GEO |
no outgoing calls