csocp_ldl.h 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /**
  2. * @file csocp_ldl.h
  3. * @brief 实现稀疏Cholesky分解模块
  4. * This file implements Sparse cholesky factorization module
  5. * @version 0.1
  6. * @date 2021-09-17
  7. *
  8. * @copyright Copyright (c) 2021
  9. *
  10. */
  11. #include "csocp_config.h"
  12. /** 符号分解 Symbolic factorization */
  13. void c_ldl_symbolic(c_int ndim, /**< KKT矩阵的维度 Dimension of KKT matrix */
  14. c_int *Ajc, /**< 输入:KKT矩阵的begin指针 Input begin pointer of KKT matrix */
  15. c_int *Air, /**< 输入:KKT矩阵的index指针 Input index pointer of KKT matrix */
  16. c_int *Ljc, /**< 输出:KKT矩阵的begin指针 Output begin pointer of matrix */
  17. c_int *etree, /**< 临时消去树 Temporary elimination tree */
  18. c_int *lnz, /**< 临时非零元计数 Temporary non-zeros count */
  19. c_int *flag /**< Temporary visit flag */
  20. );
  21. /** 数值分解 Numerical factorization */
  22. void c_ldl_numeric(c_int ndim, /**< KKT矩阵的维度 Dimension of KKT matrix */
  23. c_int *Ajc, /**< 输入:KKT矩阵的begin指针 Input begin pointer of KKT matrix */
  24. c_int *Air, /**< 输入:KKT矩阵的index指针 Input index pointer of KKT matrix */
  25. c_real *Apr, /**< 输入:KKT矩阵的element指针 Input element pointer of KKT matrix */
  26. c_int *Ljc, /**< 输入:L矩阵的begin指针 Input begin pointer of L matrix */
  27. c_int *etree, /**< 输入:消去树 Input elimination tree */
  28. c_int *sign, /**< 输入:符号向量 Input sign vector */
  29. c_real eps, /**< 输入:正则化阈值 Input regularization threshold */
  30. c_real delta, /**< 输入:正则化参数 Input regularization parameter */
  31. c_int *lnz, /**< 输出:L矩阵非零元素数量 Output non-zeros count of L matrix */
  32. c_int *Lir, /**< 输出:L矩阵的index指针 Output index pointer of L matrix */
  33. c_real *Lpr, /**< 输出:L矩阵的element指针 Output element pointer of L matrix */
  34. c_real *D, /**< 输出:对角矩阵D Output diagonal D matrix */
  35. c_real *col, /**< 临时列向量 Temporary column vector */
  36. c_int *pattern, /**< Temporary non-zeros pattern */
  37. c_int *flag /**< Temporary flag for visit status */
  38. );
  39. /** 求解下三角线性方程组L*x=b Solve L*x = b */
  40. void c_ldl_lsolve(c_int ndim, /**< L矩阵维度 Dimension of L matrix */
  41. c_real *b, /**< 输入:右端项 Input RHS value */
  42. c_int *Ljc, /**< 输入:L矩阵的begin指针 Input begin pointer of L matrix */
  43. c_int *Lir, /**< 输入:L矩阵的index指针 Input index pointer of L matrix */
  44. c_real *Lpr, /**< 输入:L矩阵的element指针 Input element pointer of L matrix */
  45. c_real *x /**< 输出:求解结果x Output solution value */
  46. );
  47. /** 求解对角线性方程组D*x=b Solve D*x = b */
  48. void c_ldl_dsolve(c_int ndim, /**< 对角矩阵维度 Dimension of diagonal matrix */
  49. c_real *x, /**< 输入输出:求解结果x Input + Output value */
  50. c_real *D /**< 输入:对角矩阵D Input diagonal matrix */
  51. );
  52. /** 求解上三角线性方程组L'*x=b Solve L'*x = b */
  53. void c_ldl_ltsolve(c_int ndim, /**< L矩阵维度Dimension of L matrix */
  54. c_real *x, /**< 输入输出:求解结果x Input + Output value */
  55. c_int *Ljc, /**< 输入:L矩阵的begin指针 Input begin pointer of L matrix */
  56. c_int *Lir, /**< 输入:L矩阵的index指针 Input index pointer of L matrix */
  57. c_real *Lpr /**< 输入:L矩阵的element指针 Input element pointer of L matrix */
  58. );