comparison Discovery/Src/buehlmann.c @ 256:d10f53e39374 bm-3

Buehlmann: trivial performance improvement (NDL) When searching backward for a valid NDL in steps of 10 minutes, we only need to search 10 minutes forward (in steps of 1 minute) to find the NDL in 1 minute resolution. So, do not search 20 min. forward. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
author Jan Mulder <jlmulder@xs4all.nl>
date Fri, 12 Apr 2019 19:05:49 +0200
parents dcf7a3435fe1
children 21387d7e786f
comparison
equal deleted inserted replaced
255:dcf7a3435fe1 256:d10f53e39374
570 // refine 570 // refine
571 memcpy(gTissue_nitrogen_bar, local_tissue_nitrogen_bar, (4*16)); 571 memcpy(gTissue_nitrogen_bar, local_tissue_nitrogen_bar, (4*16));
572 memcpy(gTissue_helium_bar, local_tissue_helium_bar, (4*16)); 572 memcpy(gTissue_helium_bar, local_tissue_helium_bar, (4*16));
573 573
574 //One minutes step 574 //One minutes step
575 for(i = 0; i < 20; i++) 575 for(i = 0; i < 10; i++)
576 { 576 {
577 gNDL += 60; 577 gNDL += 60;
578 //tissues_exposure_at_gPressure_seconds(60); 578 //tissues_exposure_at_gPressure_seconds(60);
579 decom_tissues_exposure2(60, &pDiveSettings->decogaslist[gGas_id], gPressure,gTissue_nitrogen_bar,gTissue_helium_bar); 579 decom_tissues_exposure2(60, &pDiveSettings->decogaslist[gGas_id], gPressure,gTissue_nitrogen_bar,gTissue_helium_bar);
580 decom_oxygen_calculate_cns_exposure(60,&pDiveSettings->decogaslist[gGas_id],gPressure,&gCNS); 580 decom_oxygen_calculate_cns_exposure(60,&pDiveSettings->decogaslist[gGas_id],gPressure,&gCNS);
581 buehlmann_backup_and_restore(true); 581 buehlmann_backup_and_restore(true);
582 if(dive1_check_deco(pDiveSettings)) 582 if(dive1_check_deco(pDiveSettings))
583 break; 583 break;
584 buehlmann_backup_and_restore(false); 584 buehlmann_backup_and_restore(false);
585 } 585 }
586 //gNDL -= 60;
587 return;
588 } 586 }
589 587
590 588
591 // =============================================================================== 589 // ===============================================================================
592 // dive1_check_deco 590 // dive1_check_deco