Start of new and improved version 0.3 series. The build system has been simplified by removing less useful configuration options, including support for using the Windows SDK compiler instead of GCC (this options hasn't worked for some time anyway). Instead, there is an experimental option to compile with ATLAS instead of the reference BLAS library, which substantially improves LAPACK performance.
This is the version that should be used for compiling from source, as the older versions no longer compile due to some changes in the CLAPACK distribution. For precompiled binaries, see version 0.2.1.
ATLAS also provides a couple of optimized LAPACK routines, as well as a tuned version of ilaenv() which picks runtime parameters for all the other routines. This adds another speedup. For instance, I benchmarked .qml.minv (using optimized routine) at 12 times faster and .qml.mqr (relying on tuned parameters) at 9 times faster than in QML 0.2.1.
The core of ATLAS is written in C, but it provides a Fortran interface as well. Even with the --nof77 configure flag, this interface gets compiled, because gcc is happy to invoke the gfortran frontend for *.f files. We need this interface to override the routines in plain CLAPACK, even though that's compiled completely in C.
Now, it is possible to convert the Fortran parts to C with F2C and get the whole thing to build without a Fortran compiler, but I think we'll eventually switch to Fortran LAPACK instead of CLAPACK, so we might as well just rely on gfortran from now on.
Systems of linear equations and linear least-squares problems can be solved in various ways using the basic matrix functions in LAPACK, but it is more efficient to use the driver routines and avoid multiple conversions between q form and LAPACK form. For instance, the LUP method involves constructing two triangular matrixes, but the LAPACK driver can keep them in a single matrix (L has implied ones on the diagonal).
QML 0.3.5 adds an interface to driver routines for these two problems, with one faster and one more accurate method per problem.
I fixed a small bug that could occur when a user function supplied to one of the CONMAX routines returned a null value. There might be a few variations of this, but in the clause I found, an array index is chosen based on some floating-point comparisons using arithmetic (three-way) Fortran IFs. These transfer control depending on whether their argument is negative, zero, or positive, but what happens when it is neither of these (NaN) is not specified (or it falls through if read differently). The F2C-converted version in QML 0.2.1 happened to take a safe path in this case, but in the Fortran-compiled version used since QML 0.3.4 the index ends up uninitialized.
The fix simply replaces any null value returned by a user function with infinity (negative infinity for “≥” constraints so that the corresponding parameter is not considered feasible).
“‘|’ is an ordinary character and there
is no equivalent for its functionality.”
— re_format(7).
That applies to basic regexes in the BSD implementation of
sed, which is used on Darwin. GNU
sed allows ‘\|’ as the
alternation operator.
Also, according to POSIX, an empty subgroup or an empty alternative is either invalid or gives undefined results.
In search of a robust build on 64-bit Windows, updated from ATLAS 3.8.4 to the bleeding edge 3.9.46. There might be a performance benefit somewhere in there as well.
There's a new make check target to invoke the internal tests
of individual libraries, which currently includes just ATLAS. The venerable
test.q program (invoked, as usual, by
make test) is intended mainly to check the interface code in
QML itself, although it has decent converage and flagged one bug in
ATLAS 3.9.45 while I was working on that version.
The current status on 64-bit Windows is that ATLAS might or might not build.
I'm considering refocusing QML to make broader use of system libraries, in particular for BLAS and LAPACK. ATLAS and Netlib LAPACK take a long time to build, so it's better to use independently installed versions if available. Linking to other high-performance implementations like the free software EIGEN and the vendor libraries ACML and MKL may also be of interest.