summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--model/ranksvm.cpp12
-rw-r--r--model/ranksvm.h10
-rw-r--r--model/ranksvmtn.cpp11
3 files changed, 22 insertions, 11 deletions
diff --git a/model/ranksvm.cpp b/model/ranksvm.cpp
index bb50126..068bf47 100644
--- a/model/ranksvm.cpp
+++ b/model/ranksvm.cpp
@@ -10,6 +10,18 @@ using namespace std;
double C=1e-4;// Compensating & scaling
+// Main terminating criteria
+int maxiter = 50; // max iteration count
+double prec=1e-10; // precision
+// conjugate gradient
+double cg_prec=1e-10; // precision
+int cg_maxiter = 5; // not worth having a large number
+int ls_maxiter = 10;
+// line search
+double line_prec=1e-10; // precision
+double line_turb=1e-15; // purturbation
+
+
int RSVM::saveModel(const string fname){
std::ofstream fout(fname.c_str());
diff --git a/model/ranksvm.h b/model/ranksvm.h
index 20bb35a..41de0f4 100644
--- a/model/ranksvm.h
+++ b/model/ranksvm.h
@@ -38,5 +38,15 @@ public:
};
extern double C;// Compensating & scaling
+// Main terminating criteria
+extern int maxiter; // max iteration count
+extern double prec; // precision
+// conjugate gradient
+extern double cg_prec; // precision
+extern int cg_maxiter; // not worth having a large number
+extern int ls_maxiter;
+// line search
+extern double line_prec; // precision
+extern double line_turb; // purturbation
#endif \ No newline at end of file
diff --git a/model/ranksvmtn.cpp b/model/ranksvmtn.cpp
index d8e4c5c..7f292f5 100644
--- a/model/ranksvmtn.cpp
+++ b/model/ranksvmtn.cpp
@@ -6,17 +6,6 @@
using namespace std;
using namespace Eigen;
-// Main terminating criteria
-const int maxiter = 50; // max iteration count
-const double prec=1e-10; // precision
-// conjugate gradient
-const double cg_prec=1e-10; // precision
-const int cg_maxiter = 5; // not worth having a large number
-const int ls_maxiter = 10;
-// line search
-const double line_prec=1e-10; // precision
-const double line_turb=1e-15; // purturbation
-
void cal_Dw(RidList &D,const VectorXd &w, VectorXd &Dw)
{
int n = D.getSize();