/* prints pairwise squared distances */
void printvdist2(MATRIX *pmat){
    int i, j, n;

    n = pmat->count;
    for(i=0; i<n; i++){
	for(j=0; j<n; j++){
	    printf("%g\t", vecdist2( matrixget(pmat, i),
				     matrixget(pmat, j) ) );
	}
	printf("\n");
    }
}
예제 #2
0
파일: kdtree.c 프로젝트: SunnyQ/15826
/* like vecdist2, but returns HUGE if one of the vectors is NULL */
NUMBER myvecdist2( VECTOR *vp1, VECTOR *vp2){
    if( (vp1 == NULL) || (vp2 == NULL) ) { return (HUGE) ;}
    else{ return( sqrt(vecdist2(vp1, vp2)) ) ; }
}