Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96627573
dist_min.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, Dec 29, 05:00
Size
1 KB
Mime Type
text/x-c
Expires
Tue, Dec 31, 05:00 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23218865
Attached To
R1448 Lenstool-HPC
dist_min.c
View Options
#include<stdio.h>
#include<math.h>
#include<fonction.h>
#include<constant.h>
#include<dimension.h>
#include<structure.h>
/****************************************************************/
/* nom: dist_min */
/* auteur: Ghislain Golse */
/* date: 10/99 */
/* place: Toulouse */
/****************************************************************/
/* Calcule la distance la plus courte entre 2 images d'une meme famille
*
* Pour chaque famille de n images, calcule les n-1 distances euclidiennes
* entre 2 images et sauvegarde la distance la plus courte dans la liste
* globale distmin[NFMAX].
*
* Call by o_global() if I.n_mult>0.
* */
void
dist_min
()
{
extern
double
distmin
[
NFMAX
];
const
extern
struct
g_image
I
;
const
extern
struct
g_mode
M
;
const
extern
struct
galaxie
multi
[
NFMAX
][
NIMAX
];
int
i
,
j
,
k
;
double
d
,
d_min
;
NPRINTF
(
stderr
,
"INFO: Minimal distance between arcs for each familly
\n
"
);
for
(
i
=
0
;
i
<
I
.
n_mult
;
i
++
)
{
d_min
=
1000.
;
for
(
j
=
0
;
j
<
I
.
mult
[
i
];
j
++
)
{
for
(
k
=
j
+
1
;
k
<
I
.
mult
[
i
];
k
++
)
{
d
=
dist
(
multi
[
i
][
j
].
C
,
multi
[
i
][
k
].
C
);
NPRINTF
(
stderr
,
"
\t
dist(%d:%d,%d):%.3lf
\n
"
,
i
,
j
,
k
,
d
);
if
(
d
<
d_min
)
d_min
=
d
;
};
};
if
(
d_min
>
15.
)
d_min
=
15.
;
distmin
[
i
]
=
d_min
;
NPRINTF
(
stderr
,
"
\t
distmin[%d]=%.3lf
\n
"
,
i
,
distmin
[
i
]);
};
}
Event Timeline
Log In to Comment