I had in mind something like this: std::priority_queue<int> order;uint max_size = start + max_count; for (uint gnum=0; gnum < base->numGames; gnum++) { if (base->treeFilter->Get(gnum) == 0) { continue; } IndexEntry * ie = base->idx->FetchEntry (gnum); for (uint gnum=0; gnum < base->numGames; gnum++) { if (filter->Get(gnum) == 0) { continue; } IndexEntry * ie = FetchEntry (gnum); int value_sortedby = ie->GetWhiteElo(); order.push(value_sortedby); if (order.size() > max_size) order.pop();} std::vector<int> res(max_count);for (int i = max_count -1; i >= 0; i--) res[i] = order.pop(); This is a sample shorter version of the algorithm in sc_tree_best.Writing dedicated code without std containers should be faster.However i hadn't made any speed test. For the 'interest' value i need some chess help.The actual formula is:interest = avg_elo + bonus_comment - penalty_old - penalty_earlydraw - penalty_rapid - penalty_blind andbonus_comment = 400penalty_old = 20*each_year_old (max 400)penalty_earlydraw = -250 if < 30 moves; -100 if < 40 movespenalty_rapid = -250penalty_blind = 400
It is a huge improvement versus the old simple avg_elo, but i'm not really satisfied.Let me now if you have any suggestion.Bye,Fulvio ----Messaggio originale---- Da: gerd.lorsch...@onlinehome.de Data: 25/02/2011 19.19 A: "Fulvio"<f...@libero.it> Cc: "Scid Users List"<scid-users@lists.sourceforge.net> Ogg: Re: Re: AW: [Scid-users] Sorting by variations patch html { margin:0px; padding:0px; } body { font-size: 100.01%; font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; width:100%; height:100%; background-color:transparent; overflow:show; background-image:none; margin:0px; padding:5px; }p { margin:0px; padding:0px; } body { font-size: 12px; font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; } p { margin: 0; padding: 0; } blockquote { padding-left: 5px; margin-left: 5px; margin-bottom: 0px; margin-top: 0px; } blockquote.quote { border-left: 1px solid #CCC; padding-left: 5px; margin-left: 5px; } .misspelled { background: transparent url(//webmailerng.1und1.de/static_resource/mailclient/widgets/basic/parts/maileditor/spellchecking_underline.gif) repeat-x scroll center bottom; } .correct {} .unknown {} .ignored {}html { margin:0px; padding:0px; } body { font-size: 100.01%; font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; width:100%; height:100%; background-color:transparent; overflow:show; background-image:none; margin:0px; padding:5px; }p { margin:0px; padding:0px; } body { font-size: 12px; font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; } p { margin: 0; padding: 0; } blockquote { padding-left: 5px; margin-left: 5px; margin-bottom: 0px; margin-top: 0px; } blockquote.quote { border-left: 1px solid #CCC; padding-left: 5px; margin-left: 5px; } .misspelled { background: transparent url(//webmailerng.1und1.de/static_resource/mailclient/widgets/basic/parts/maileditor/spellchecking_underline.gif) repeat-x scroll center bottom; } .correct {} .unknown {} .ignored {}--> Hello Fulvio, it is not that easy if I assume right that you want to have it starting from the game 20 of the sorted database. Then you need to sort the whole base first. This takes around 5 to 30 seconds for a large base. Is the user prepared to wait for this? So we need to discuss the usecases.
------------------------------------------------------------------------------ Free Software Download: Index, Search & Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk-dev2dev
_______________________________________________ Scid-users mailing list Scid-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/scid-users