Changeset 2146


Ignore:
Timestamp:
02/20/07 18:36:14 (17 years ago)
Author:
mattausch
Message:

improved hash pvs timings

Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/HashPvs.h

    r2123 r2146  
    1919   enum 
    2020   { 
    21       bucket_size = 4, 
    22       min_buckets = 8 
     21      bucket_size = 1, 
     22      min_buckets = 16 
    2323   }; 
    2424 
     
    236236float HashPvs<T, S>::AddSample(T sample, const float pdf) 
    237237{ 
    238         HASH_SET::iterator it; 
     238        static HASH_SET::iterator it; 
    239239 
    240240        if (Find(sample, it)) 
     
    243243        mEntries.insert(sample); 
    244244        return 1.0f; 
     245 
     246        /*pair<HASH_SET::iterator, bool> p = mEntries.insert(sample); 
     247 
     248        if (p.second) 
     249                return 0.0f; 
     250        else 
     251                return 1.0f;*/ 
    245252} 
    246253         
     
    249256void HashPvs<T, S>::AddSampleDirty(T sample, const float pdf) 
    250257{ 
    251         HASH_SET::iterator it; 
     258        static HASH_SET::iterator it; 
    252259 
    253260        // not yet in map 
     
    256263                mEntries.insert(sample);         
    257264        } 
     265 
     266        //pair<HASH_SET::iterator, bool> p = mEntries.insert(sample); 
    258267} 
    259268 
     
    263272                                                                                const float pdf) 
    264273{ 
    265         HASH_SET::iterator it; 
     274        /*pair<HASH_SET::iterator, bool> p = mEntries.insert(sample); 
     275 
     276        // already in map 
     277        return p.second; 
     278*/ 
     279        static HASH_SET::iterator it; 
    266280 
    267281        // already in map 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj

    r2130 r2146  
    222222                                OptimizeForWindowsApplication="TRUE" 
    223223                                AdditionalIncludeDirectories="..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;..\MultiLevelRayTracing;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtOpenGl&quot;;&quot;$(CG_INC_PATH)&quot;;Timer" 
    224                                 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GTP_INTERNAL;USE_QT;USE_BIT_PVS" 
     224                                PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GTP_INTERNAL;USE_QT;USE_HASH_PVS" 
    225225                                ExceptionHandling="TRUE" 
    226226                                RuntimeLibrary="2" 
  • GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj

    r2130 r2146  
    199199                                OptimizeForWindowsApplication="TRUE" 
    200200                                AdditionalIncludeDirectories="..\include;..\..\..\..\..\..\NonGTP\Boost;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;&quot;$(QTDIR)\include\QtOpenGl&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include&quot;;QtInterface" 
    201                                 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL;USE_QT;USE_CG;USE_BIT_PVS" 
     201                                PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL;USE_QT;USE_CG;USE_HASH_PVS" 
    202202                                ExceptionHandling="TRUE" 
    203203                                RuntimeLibrary="2" 
Note: See TracChangeset for help on using the changeset viewer.