⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 utility.cpp

📁 Ball Vector Machine (BVM)支撑向量机C++程序项目代码
💻 CPP
字号:
#include <stdlib.h>#include <stdio.h>#include <stdarg.h>#ifndef _MSC_VER#include <sys/times.h>#include <unistd.h>#else#include <time.h>#endif//----------------------------------------------------------------------------------// Global helper functionsint delta(int x, int y){	return ( (x==y)? (1) : (0) );}double dotProduct( const double* x1, const double* x2, int length ){	double sum = 0;	for (int i=0; i<length; i++)		sum += ( x1[i] * x2[i] );	return sum;}


double getRunTime(){#ifdef _MSC_VER  clock_t current = clock();  return (double)(current) / CLOCKS_PER_SEC;#else  struct tms current;  times(&current);    double norm = (double)sysconf(_SC_CLK_TCK);  return(((double)current.tms_utime)/norm);#endif}

⌨️ 快捷键说明

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