struct_prob.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /**
  2. * @file struct_prob.h
  3. * @brief 定义优化问题(problem)结构体。本模块用来提高工程代码质量。
  4. * This is the definition of problem structure. For better code engineering.
  5. * @version 0.1
  6. * @date 2021-09-17
  7. *
  8. * @copyright Copyright (c) 2021
  9. *
  10. */
  11. #ifndef __STRUCT_PROB_H__
  12. #define __STRUCT_PROB_H__
  13. #include "csocp_config.h"
  14. /** CSOCP优化问题结构体 Structrue of CSOCP problem */
  15. struct c_prob_s {
  16. c_int n; /**< 变量数量 Number of variables */
  17. c_int m; /**< 不等式约束数量 Number of inequalities */
  18. c_int p; /**< 等式约束数量 Number of equalities */
  19. c_int degree; /**< 线性锥与二阶锥的数量和 Degree of the cone */
  20. c_spmat *A; /**< 等式约束矩阵A Equality matrix */
  21. c_spmat *G; /**< 不等式约束矩阵G Inequality matrix */
  22. c_real *c; /**< 目标函数向量c Objective costs */
  23. c_real *b; /**< 等式约束右端项b RHS of equalities */
  24. c_real *h; /**< 不等式约束右端项h RHS of cones */
  25. c_cone *cone; /**< 锥 Cone */
  26. c_kkt *kkt; /**< KKT系统 KKT System */
  27. c_param *param; /**< 参数 Parameters */
  28. c_real *facX; /**< 变量缩放系数 Scaling factors of variables */
  29. c_real *facA; /**< 等式约束矩阵A缩放系数 Scaling factors of equality matrix */
  30. c_real *facG; /**< 不等式约束矩阵G缩放系数 Scaling factors of inequality matrix */
  31. c_real *rx;
  32. c_real *ry;
  33. c_real *rz;
  34. c_real *dx1;
  35. c_real *dy1;
  36. c_real *dz1;
  37. c_real *dx2;
  38. c_real *dy2;
  39. c_real *dz2;
  40. c_real *dsaff;
  41. c_real *dzaff;
  42. c_real *dsaff_w;
  43. c_real *dzaff_w;
  44. c_real *lambda;
  45. c_real *x;
  46. c_real *y;
  47. c_real *z;
  48. c_real *s;
  49. c_attr *attr;
  50. c_real *best_x;
  51. c_real *best_y;
  52. c_real *best_z;
  53. c_real *best_s;
  54. c_attr *best_attr;
  55. };
  56. #endif