README
1KKTDirect 0.5
2Robert Bridson (rbridson@cs.ubc.ca)
3
4This project is released into the public domain.
5
6This is an alpha release of KKTDirect, a direct solver package for
7sparse symmetric indefinite matrices of so-called KKT structure. I
8make no guarantees of correctness or the ability to fail gracefully.
9The interface is not well documented; see kktsolve.cpp, fulltest.cpp or
10kktsolve_mex.cpp (which does implement a simple MATLAB interface to
11the solver) for an outline of how one might call it. In particular,
12kktsolve.cpp provides a single function for factoring and solving a linear
13system which hides the complexity of the intermediate calls to the
14supernodal version of the solver. Use at your own risk.
15
16The code should be able to solve problems with matrices of the form:
17 [ A B ]
18 [ B^T -C ]
19where A is symmetric positive definite, B has full column rank, and C
20is symmetric positive semi-definite (typically C=0). If the LDL^T
21factorization of the unpermuted system works (apart from memory problems
22from fill-in) then this code should work; it has succeeded on more
23challenging problems but I haven't derived guarantees. (Note that
24in particular the factorization may be unstable if A is much smaller
25than B, even though the matrix as a whole may be well-conditioned.)
26
27A report describing how the algorithms work is included as a
28PDF preprint (kktdirect.pdf) for a document-in-progress
29describing the underlying ideas and some numerical experiments.
30Note that the numerical experiments in the document were run with
31version 0.3 of the code.
32
33To make the software, edit the Makefile for your platform
34(determining where BLAS/LAPACK libraries are etc. or setting USE_NAIVE_* if
35unavailable) then run make.
36The following should be produced:
37 libkktdirect.a: a library containing the KKTDirect functions
38 fulltest: a commandline executable which takes an ASCII description of a
39 matrix from standard input and runs several of the KKTDirect
40 routines to test the library is working.
41 stokes: a commandline executable which takes a grid size as argument and
42 outputs an ASCII description of the matrix arising from a standard
43 staggered grid discretization of the 2D Stokes problem (suitable
44 for testing with fulltest).
45 stokes3d: the same thing, but for the 3D problem. Note that unlike
46 stokes, this produces a singular matrix (with null-space
47 corresponding to constant pressures) and thus factorization
48 may be reported to fail. However, only the very last pivot
49 will be zero, so a sensible solution will be returned with
50 the residual close to optimal.
51 kktsolve_mex: a MATLAB MEX file for solving saddlepoint problems (see
52 kktsolve.m for more details)
53
54-----------------------------------------------------------------------------
55New since version 0.4:
56- The BLAS calls are cleaned up a bit.
57- There is now an option to make the library without an external BLAS and
58 LAPACK (#define USE_NAIVE_BLAS and #define USE_NAIVE_LAPACK). It is
59 suggested to use this only as a last resort if you cannot get a working
60 BLAS and LAPACK linked: the performance and in some cases reliability
61 are not going to be as good.
62- fixed an uninitialized memory bug in symbolic factorization
63
64-----------------------------------------------------------------------------
65New since version 0.3:
66- The symbolic factorization for left-looking supernodal runs uses modern
67 algorithms to run much faster.
68- A bug was found and corrected in the supernodal signed Cholesky code,
69 where occasionally a supernode that begins with a constrained node is
70 erroneously reordered to have a different (unconstrained) first node.
71 This can occasionally reduce fill-in, but as a side effect invalidates
72 the elimination tree and postordering, which can cause bugs later on
73 in factorization. This occurs rarely enough it seems unlikely to be
74 worth pursuing as a strategy to reduce fill, and thus version 0.4 instead
75 makes sure never to change the first node in a supernode when modifying
76 orderings based on constraints.
77- A few small API changes to make the order of function parameters a little
78 more consistent; expect to see further changes in the future to make the
79 library easier to use.
80
81Edit the Makefile as needed for your platform.
82Three things are created by "make all":
83- fulltest, which reads the structure of a compressed-sparse-column matrix
84 from stdin and writes a KKT-minimum-degree ordering back to
85 stdout.
86- stokes, which given a grid size as a command-line argument (default 30
87 if omitted), write to stdout an example compressed-sparse-column
88 matrix to stdout. (In particular, a 2D Stokes problem with
89 solid wall boundary conditions around a square domain -- note
90 that it has a null-space consisting of pressure values all one.)
91- kktmd_mex, which is a MEX extension to MATLAB (see kktmd.m)
92
93New in version 0.5 is the ability to use "naive" versions of the BLAS and
94LAPACK routines for the case where you cannot link to working external
95libraries. The file dense.h in this case has plain C++ versions of the
96required routines (dgemm, dpotrf, dpotrs, dsytrf, dsytrs) specialized as
97desired; these are not expected to be nearly as good as proper BLAS and
98LAPACK, but may help if you have nothing else.
99
100Also new in version 0.5 is "kktsolve.cpp", an example of how to call KKTDirect
101from C++. This provides a simple single function call which factors and solves
102a linear system, hiding all the complexity of the intermediate steps.
103