-
Notifications
You must be signed in to change notification settings - Fork 0
/
ncutW.h
29 lines (24 loc) · 869 Bytes
/
ncutW.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
* ncutW: normalized cuts on a general graph
*
* translated from Shi et al's matlab implementation
*
* Evan Herbst
* 10 / 13 / 11
*/
#ifndef EX_NCUT_W_H
#define EX_NCUT_W_H
#include <vector>
#include "Eigen/Core"
#include "Eigen/Sparse"
/*
* run normalized cuts on a similarity matrix W
*/
//std::vector<unsigned int> ncutW(const Eigen::MatrixXd& W, const unsigned int nbcluster);
int* ncutW(const Eigen::SparseMatrix<double>& W, const unsigned int nbcluster);
/*
* compute the value of the normalized cuts objective for the given clustering (asgns[i] in [0, numClusters))
*/
//double ncutObjective(const Eigen::MatrixXd& W, const unsigned int numClusters, const std::vector<unsigned int>& asgns);
double ncutObjective(const Eigen::SparseMatrix<double>& W, const unsigned int numClusters, const std::vector<unsigned int>& asgns);
#endif //EX_NCUT_W_H