/* 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"); } }
/* 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)) ) ; } }