Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97631789
o_swi_big.c
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Jan 5, 21:38
Size
1 KB
Mime Type
text/x-c
Expires
Tue, Jan 7, 21:38 (2 d)
Engine
blob
Format
Raw Data
Handle
23371832
Attached To
R1448 Lenstool-HPC
o_swi_big.c
View Options
#include<stdio.h>
#include<math.h>
#include<float.h>
#include<fonction.h>
#include<constant.h>
#include<dimension.h>
#include<structure.h>
/****************************************************************/
/* nom: o_swi_big */
/* auteur: Jean-Paul Kneib */
/* date: 10/02/92 */
/* place: Toulouse *
***************************************************************
* Return 1 if the new parameter range is larger than the error bar
* otherwise return 0.
*
* Parameters :
* - i : index of the potential to optimize
* - ipx : index of the parameter to optimize
*/
int o_swi_big(int i, int ipx)
{
extern double excu[][NPAMAX];
extern double excd[][NPAMAX];
extern int block[][NPAMAX];
double x0, x1, x2, y1, y2, lmin, lmax;
x0 = x1 = x2 = y1 = y2 = DBL_MAX;
lmin = o_get_lmin(i, ipx);
lmax = o_get_lmax(i, ipx);
x0 = o_get_lens(i, ipx);
x1 = x0 + excu[i][ipx] * ( lmax - x0 );
o_set_lens(i, ipx, x1);
y1 = o_chi();
x2 = x0 - excd[i][ipx] * ( x0 - lmin );
o_set_lens(i, ipx, x2);
y2 = o_chi();
o_set_lens(i, ipx, x0);
//TODO check if x0,x1,x2,y1,y2 have been modified
/* if excd=excu (default value in o_set_ext() : 0.3) then
* x2-x1<err is equiv to 0.3(pmax-pmin)<err */
if ( fabs(x2 - x1) <= o_get_err(i, ipx) )
{
block[i][ipx] = 0;
return(0);
}
else
{
o_keep_min(x1, x2, y1, y2, i, ipx);
return(1);
}
}
Event Timeline
Log In to Comment