ldl.h 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /* ========================================================================== */
  2. /* === ldl.h: include file for the LDL package ============================= */
  3. /* ========================================================================== */
  4. /* Copyright (c) Timothy A Davis, http://www.suitesparse.com.
  5. * All Rights Reserved. See README for the License.
  6. *
  7. * Stripped down by Alexander Domahidi, 2012.
  8. */
  9. //#include "../../include/glblopts.h"
  10. //#include "../../include/ecos.h"
  11. #include "SuiteSparse_config.h"
  12. #ifdef LDL_LONG
  13. #define LDL_int SuiteSparse_long
  14. #define LDL_ID SuiteSparse_long_id
  15. #define LDL_symbolic2 ldl_l_symbolic2
  16. #define LDL_numeric2 ldl_l_numeric2
  17. #define LDL_lsolve ldl_l_lsolve
  18. #define LDL_lsolve2 ldl_l_lsolve2
  19. #define LDL_dsolve ldl_l_dsolve
  20. #define LDL_ltsolve ldl_l_ltsolve
  21. #else
  22. #define LDL_int int
  23. #define LDL_ID "%d"
  24. #define LDL_symbolic2 ldl_symbolic2
  25. #define LDL_numeric2 ldl_numeric2
  26. #define LDL_lsolve ldl_lsolve
  27. #define LDL_lsolve2 ldl_lsolve2
  28. #define LDL_dsolve ldl_dsolve
  29. #define LDL_ltsolve ldl_ltsolve
  30. #endif
  31. /* ========================================================================== */
  32. /* === int version ========================================================== */
  33. /* ========================================================================== */
  34. void ldl_symbolic2 (int n, int Ap [ ], int Ai [ ], int Lp [ ], int Parent [ ], int Lnz [ ], int Flag [ ]) ;
  35. int ldl_numeric2 (int n, int Ap [ ], int Ai [ ], double Ax [ ],
  36. int Lp [ ], int Parent [ ], int Sign[], double eps, double delta, int Lnz [ ], int Li [ ], double Lx [ ],
  37. double D [ ], double Y [ ], int Pattern [ ], int Flag [ ]
  38. #if PROFILING > 1
  39. ,double *t1, double *t2
  40. #endif
  41. ) ;
  42. void ldl_lsolve (int n, double B [], int Lp [ ], int Li [ ], double Lx [ ]) ;
  43. void ldl_lsolve2 (int n, double B [], int Lp [ ], int Li [ ], double Lx [ ], double X [ ]) ;
  44. void ldl_dsolve (int n, double X [ ], double D [ ]) ;
  45. void ldl_ltsolve (int n, double X [ ], int Lp [ ], int Li [ ],
  46. double Lx [ ]) ;
  47. /* ========================================================================== */
  48. /* === long version ========================================================= */
  49. /* ========================================================================== */
  50. void ldl_l_symbolic2 (SuiteSparse_long n, SuiteSparse_long Ap [ ],
  51. SuiteSparse_long Ai [ ], SuiteSparse_long Lp [ ],
  52. SuiteSparse_long Parent [ ], SuiteSparse_long Lnz [ ],
  53. SuiteSparse_long Flag [ ]);
  54. SuiteSparse_long ldl_l_numeric2 (SuiteSparse_long n, SuiteSparse_long Ap [ ],
  55. SuiteSparse_long Ai [ ], double Ax [ ], SuiteSparse_long Lp [ ],
  56. SuiteSparse_long Parent [ ], SuiteSparse_long Sign [ ], double eps, double delta, SuiteSparse_long Lnz [ ],
  57. SuiteSparse_long Li [ ], double Lx [ ], double D [ ], double Y [ ],
  58. SuiteSparse_long Pattern [ ], SuiteSparse_long Flag [ ]
  59. #if PROFILING > 1
  60. ,double *t1, double *t2
  61. #endif
  62. ) ;
  63. void ldl_l_lsolve (SuiteSparse_long n, double B [ ], SuiteSparse_long Lp [ ], SuiteSparse_long Li [ ], double Lx [ ]) ;
  64. void ldl_l_lsolve2 (SuiteSparse_long n, double B [ ], SuiteSparse_long Lp [ ], SuiteSparse_long Li [ ], double Lx [ ], double X [ ]) ;
  65. void ldl_l_dsolve (SuiteSparse_long n, double X [ ], double D [ ]) ;
  66. void ldl_l_ltsolve (SuiteSparse_long n, double X [ ], SuiteSparse_long Lp [ ],
  67. SuiteSparse_long Li [ ], double Lx [ ]) ;
  68. /* ========================================================================== */
  69. /* === LDL version ========================================================== */
  70. /* ========================================================================== */
  71. #define LDL_DATE "April 6, 2013, with dynamic regularization by A. Domahidi"
  72. #define LDL_VERSION_CODE(main,sub) ((main) * 1000 + (sub))
  73. #define LDL_MAIN_VERSION 2
  74. #define LDL_SUB_VERSION 1
  75. #define LDL_SUBSUB_VERSION 0
  76. #define LDL_VERSION LDL_VERSION_CODE(LDL_MAIN_VERSION,LDL_SUB_VERSION)