摘要:
The K-means algorithm is based on the use of squared Euclidean distance as the measure of dissimilarity between a data point and a prototype vector. O 阅读全文
摘要:
To summarize, principal component analysis involves evaluating the mean x and the covariance matrix S of the data set and then finding the M eigenvect 阅读全文
摘要:
#include <iostream>#include <vector>#include <string> class Assoc { struct Pair { std::string name; double val; Pair(std::string n="", double v=0) :na 阅读全文
摘要:
# awk.awk { if(data[$0]++ == 0) lines[++count] = $0} END { for (i=1;i<=count;i++) print lines[i]} 脚本用法如下: awk -f awk.awk text_to_process cat text_to_p 阅读全文
摘要:
#include <iostream> class Singleton { static Singleton s; int i; Singleton(int x):i(x) {} Singleton& operator=(Singleton&); Singleton(const Singleton& 阅读全文
摘要:
复制构造函数与复制赋值的区别如下: class Name { const char* s; //... }; class Table { Name* p; size_t sz; public: //... Table(const Table&); //复制构造函数 Table& operator=( 阅读全文
摘要:
关联数组是用户定义类型中最常见的也是最有用的一类。关联数组也常被成为映射(map),有时被 成为字典(dictionary),其中保存的是值的对偶。给定了一个称为关键码的值,我们就能访问另一个 称为映射值的值。可以将关联数组想象为一个下标不必是整数的数组: template<class K, cla 阅读全文
摘要:
#include <sys/stat.h> int stat(const char *restrict pathname, struct stat *restrict buf); struct stat { mode_t st_mode; /*file type & mode(permissions 阅读全文
摘要:
Thus we see that there are very close similarities between this Bayesian viewpoint and the conventional one based on error function minimization and r 阅读全文
摘要:
template <class T1, class T2> struct std::pair { typedef T1 first_type; typedef T2 second_type; T1 first; T2 second; pair() :first(T1()), second(T2()) 阅读全文