On 4-May-2006, David Bateman wrote:
| David Bateman wrote:
|
| >There was a discussion a month or so ago about the interface changes in
| >CXSparse v2.0 and how to treat these. In the end its not a major issue
| >to allow both versions prior to and after v2.0.0 to be used, and the
| >attached patch to the CVS allows this
| >
| >Regards
| >David
| >
| >2006-05-04 David Bateman <address@hidden>
| >
| > * SparseQR.cc, SparseQR.h, SparseCmplxQR.cc, SparseCmplxQR.h,
| > sparse-dmsolve.cc : Allow compilation with versions v2.0.0 of
| > CXSparse or later
| >
| >2006-05-04 David Bateman <address@hidden>
| >
| > * DLD-FUNCTIONS/spqr.cc (Fdmperm): Allow compilation with versions
| > v2.0.0 of CXSparse or later.
|
| Sorry, here is the same patch without the extraneous muck...
Is there any reason we shouldn't just require version 2 or later?
What about using some macros to avoid repeating the #ifdefs
everywhere? Something like
#if defined(CS_VER) && (CS_VER >= 2)
#define CXSPARSE_SQR(ORDER, A, QR) \
CXSPARSE_ZNAME (_sqr) (ORDER, A, QR)
#else
#define CXSPARSE_SQR(ORDER, A, QR) \
CXSPARSE_ZNAME (_sqr) (A, ORDER-1, QR)
#endif
and then
S = CXSPARSE_SQR (order, &A, 1);
instead of
#if defined(CS_VER) && (CS_VER >= 2)
S = CXSPARSE_ZNAME (_sqr) (order, &A, 1);
#else
S = CXSPARSE_ZNAME (_sqr) (&A, order - 1, 1);
#endif