📄 example.cc
字号:
// file: $isip/doc/examples/class/stat/stat_example_00/example.cc// version: $Id: example.cc,v 1.1 2001/01/09 23:50:42 peng Exp $//// isip include files//#include <GaussianModel.h>// main program starts here:// this example demonstrates the several simple steps to compute the// Mahalanobis distance for a input vector from a GaussianModel//int main() { // declare the GaussianModel object // GaussianModel gauss; // declare mean and covariance matrix to define gaussian // VectorFloat mean(L"1.0, 1.0, 1.0"); MatrixFloat cov(3, 3, L"0.1, 0.1, 0.1", Integral::DIAGONAL); // set gaussian // gauss.setMean(mean); gauss.setCovariance(cov); // declare the input vector // VectorFloat input; input.assign(L"-1, -1, -1"); // get the distance // Float distance = gauss.getLogLikelihood(input); // output the result to the console output // distance.debug(L"Mahalanobis Distance:"); // exit gracefully // Integral::exit();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -