⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 smo.h

📁 cvm的c语言版
💻 H
字号:
#include "globals.h"#include <fstream.h>/* * * solve  c' * x + 1/2 x' * H * x -> min * w.r.t. A * x = b *        l <= x <= u * */ class smo_c { private:  quadratic_program* qp;  SVMFLOAT* x;  SVMFLOAT* sum;  SVMINT n;  SVMFLOAT lambda_eq;  SVMFLOAT lambda_nu;  SVMFLOAT is_zero;  SVMFLOAT max_allowed_error;  SVMINT max_iteration;  SVMFLOAT x2tox1(const SVMFLOAT x2, const int id, 		  const SVMFLOAT A1, const SVMFLOAT b);  SVMFLOAT x1tox2(const SVMFLOAT x1, const int id, 		  const SVMFLOAT A2, const SVMFLOAT b);  void simple_solve(SVMFLOAT* x1, SVMFLOAT* x2,		    const SVMFLOAT H1, const SVMFLOAT H2,		    const SVMFLOAT c0, 		    const SVMFLOAT c1, const SVMFLOAT c2,		    const SVMFLOAT A1, const SVMFLOAT A2,		    const SVMFLOAT l1, const SVMFLOAT l2,		    const SVMFLOAT u1, const SVMFLOAT u2);  int minimize_ij(const SVMINT i, const SVMINT j);  int minimize_i(const SVMINT i);  void calc_lambda_eq();  void calc_lambda_nu();  void set_qp(quadratic_program* the_qp); public:  smo_c();  smo_c(const SVMFLOAT new_is_zero, 	const SVMFLOAT new_max_allowed_error, 	const SVMINT new_max_iteration);  void set_max_allowed_error(SVMFLOAT new_max_allowed_error);  void init(const SVMFLOAT new_is_zero,        const SVMFLOAT new_max_allowed_error,        const SVMINT new_max_iteration);  int smo_solve(quadratic_program* the_qp,SVMFLOAT* the_x);  int smo_solve_single(quadratic_program* the_qp,SVMFLOAT* the_x);  int smo_solve_const_sum(quadratic_program* the_qp,SVMFLOAT* the_x);  SVMFLOAT get_lambda_eq();  SVMFLOAT get_lambda_nu();};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -