Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » stable sort bug.. or looks like it
stable sort bug.. or looks like it [message #48123] Sun, 21 May 2017 22:30 Go to previous message
aftershock is currently offline  aftershock
Messages: 143
Registered: May 2008
Experienced Member
Have a look
VectorMap<String, int> involved_nodes;

DUMPM ( involved_nodes );
StableSort ( involved_nodes.Begin(), involved_nodes.End(), lip );

DUMPM ( involved_nodes );

Stable sort does not seem copy key value pairs correctly for maps.


before
involved_nodes:
[0] = (tester_withdraw_when) 0
[1] = (tester_withdraw_amount) 2
[2] = (tester_balance) 3
[3] = (trading_buy_open_start_hour) 12
[4] = (trading_buy_open_end_hour) 13
[5] = (trading_sell_open_start_hour) 18
[6] = (trading_sell_open_end_hour) 19
[7] = (buy_closewhenprofit) 38
[8] = (buy_stepsize) 43
[9] = (buy_stopdistance) 47
[10] = (sell_stepsize) 51
[11] = (sell_closewhenprofit) 52
[12] = (buy_close_after_minutes) 180
[13] = (sell_close_after_minutes) 181
[14] = (sell_stopdistance) 216
[15] = (buy_stop_fallback) 221
[16] = (sell_stop_fallback) 225
[17] = (buy_rsi_timeframe) 229
[18] = (sell_rsi_timeframe) 230
[19] = (buy_rsi_upper_limit) 367
[20] = (sell_rsi_lower_limit) 368
after incorrect result
involved_nodes:
[0] = (tester_withdraw_when) 3
[1] = (tester_withdraw_amount) 0
[2] = (tester_balance) 2
[3] = (trading_buy_open_start_hour) 19
[4] = (trading_buy_open_end_hour) 13
[5] = (trading_sell_open_start_hour) 18
[6] = (trading_sell_open_end_hour) 12
[7] = (buy_closewhenprofit) 38
[8] = (buy_stepsize) 47
[9] = (buy_stopdistance) 51
[10] = (sell_stepsize) 216
[11] = (sell_closewhenprofit) 221
[12] = (buy_close_after_minutes) 229
[13] = (sell_close_after_minutes) 43
[14] = (sell_stopdistance) 52
[15] = (buy_stop_fallback) 180
[16] = (sell_stop_fallback) 181
[17] = (buy_rsi_timeframe) 225
[18] = (sell_rsi_timeframe) 230
[19] = (buy_rsi_upper_limit) 367
[20] = (sell_rsi_lower_limit) 368

This is what it should be.....
involved_nodes:
[0] = (tester_withdraw_when) 0
[1] = (tester_withdraw_amount) 2
[2] = (tester_balance) 3
[3] = (trading_buy_open_start_hour) 12
[4] = (trading_buy_open_end_hour) 13
[5] = (trading_sell_open_start_hour) 18
[6] = (trading_sell_open_end_hour) 19
[7] = (buy_closewhenprofit) 38
[8] = (buy_stepsize) 43
[9] = (buy_stopdistance) 47
[10] = (sell_stepsize) 51
[11] = (sell_closewhenprofit) 52
[12] = (buy_close_after_minutes) 180
[13] = (sell_close_after_minutes) 181
[14] = (sell_stopdistance) 216
[15] = (buy_stop_fallback) 221
[16] = (sell_stop_fallback) 225
[17] = (buy_rsi_timeframe) 229
[18] = (sell_rsi_timeframe) 230
[19] = (buy_rsi_upper_limit) 367
[20] = (sell_rsi_lower_limit) 368

Thanks.. Can you fix this?

A.

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Writing Bits object to disk
Next Topic: How to distribute some parts of Core in another library?
Goto Forum:
  


Current Time: Sat Apr 20 12:30:36 CEST 2024

Total time taken to generate the page: 0.01741 seconds