util.c

来自「Birch算法的c代码,做数据聚类」· C语言 代码 · 共 57 行

C
57
字号
/****************************************************************File Name:   util.CAuthor: Tian Zhang, CS Dept., Univ. of Wisconsin-Madison, 1995               Copyright(c) 1995 by Tian Zhang                   All Rights ReservedPermission to use, copy and modify this software must be grantedby the author and provided that the above copyright notice appear in all relevant copies and that both that copyright notice and this permission notice appear in all relevant supporting documentations. Comments and additions may be sent the author at zhang@cs.wisc.edu.******************************************************************/#include "global.h"#include "util.h"int MinOne(int x, int y){ if (x<y) return x;  else return y;}int MaxOne(int x, int y){ if (x>y) return x;  else return y;}double MinOne(double x, double y){ if (x<y) return x;  else return y;}double MaxOne(double x, double y){ if (x>y) return x;  else return y;}void indent(short ind, ostream &fo){ for (short i=0; i<ind; i++) 	fo << ' '; }void indent(short ind, ofstream &fo){ for (short i=0; i<ind; i++) 	fo << ' '; }void print_error(char *fnc, char *msg) {        printf("Fatal Error: in function %s: %s\n",fnc,msg);        exit(1);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?