// file: $isip/doc/examples/class/stat/stat_example_00/example.cc // version: $Id: example.cc 6146 2001-01-09 23:50:42Z peng $ // // isip include files // #include // 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(); }