LinAlg: Basic Linear Algebra and Optimization classlib
LinAlg: Basic Linear Algebra and Optimization classlibThis C++ class library introduces
Matrix,
Vector,
subMatrices, and
LAStreams over
the real domain. The library contains efficient and fool-proof
implementations of level 1 and 2 BLAS (element-wise operations and
various multiplications), transposition, determinant evaluation and
matrix inverse. There are operations on a single row/col/diagonal of a
matrix. Distinct features of the package are Matrix
views,
Matrix
streams, and
LazyMatrices. Lazy
construction allows us to write matrix expressions in a natural way
without introducing any hidden temporaries, deep copying, and any
reference counting.
LinAlg stresses Matrix streams, which provide a sequential
access to a matrix or
its parts.
LABlockStreams may span over an arbitrary rectangular block of a matrix, including
the whole matrix, a single matrix element, and all other block sizes
in between. Matrix streams are
seek-able and
subrange-able. A stream or a substream are always created
in-line. They are
safe and allocate no heap storage.
LinAlg demonstrates that many of Linear Algebra algorithms indeed require only a sequential access to a matrix or its sub-blocks. The sequential access is simpler and faster than a random one. Notable examples of such ``serial algorithms'' are matrix inverse and Householder bidiagonalizations. Every feature of the package is extensively tested by included validation code.
Other features:
Ax=b, where the matrix
A does not have to be square, and
b does not
have to be a vector.Matrix A = inverse(D); C = A*B;
assert(
of_every(ConstMatrixRow(m,i)).max_abs(of_every(vect))
== 2.0 );The README file [plain text file]
LinAlg.tar.gz [115K]
Complete source code, validation code, sample code, and test
run outputs
LinAlg.h [58K]
LinAlg interface definition
LAStreams.h [28K]
LAStreams interface definition
linalg-4.4_vc7.zip [377K]
VC 7 Project filewhich was very kindly contributed by Markus Bader
Functional Style in C++: Closures, Late Binding, and
Lambda Abstractions
borrows many code snippets from LinAlg
(lazy) SVD promising a matrix in extended LinAlg.shar [plain text file]
An old but still relevant article posted on
comp.c++.moderated, comp.sys.mac.programmer.tools,
comp.sys.mac.scitech, sci.math.num-analysis newsgroups on Tue Feb 27
11:31:08 CST 1996
LinAlg is also available from
netlib
<
http://netlib.bell-labs.com/netlib/c++/linalg.tgz>
Mathtools.net, the technical computing portal for all scientific and
engineering needs
FreeBSD port and a package
This C++ class library performs radix-2 Discerete Fourier
transform of a real or complex sequence, and
sin,
cos, and complex Fourier integrals of an evenly tabulated
function.
The input can be either
real or
complex with/without zero padding; you can request either the full complex
transform, or only
real,
im, or
abs part of it.
fft.tar.gz [36K]
Commented C++ source code, verification code and test run outputs.
The verification code demonstrates many possible usage scenarious
LinAlg: Basic Linear Algebra and Optimization classlib is required as a dependency
[The Abstract of the paper]
Recent work showed that staging and abstract interpretation can be used to derive correct families of combinatorial circuits, and illustrated this technique with an in-depth analysis of the Fast Fourier Transform (FFT) for sizes 2^n. While the quality of the generated code was promising, it used more floating-point operations than the well-known FFTW codelets and split-radix algorithm.
This paper shows that staging and abstract interpretation can in fact be used to produce circuits with the same number of floating-point operations as each of split-radix and FFTW. In addition, choosing between two standard implementations of complex multiplication produces results that match each of the two algorithms. Thus, we provide a constructive method for deriving the two distinct algorithms.
Relating FFTW and Split-Radix.
Joint work with Walid Taha.
Proc. of ICESS'04, the First International Conference on
Embedded Software and System, December 9-10 2004,
Hangzhou (Zhejiang), China.
<
http://www.cs.rice.edu/~taha/publications/conference/icess04.pdf>
FFTW: Fastest Fourier Transform in the West
<
http://www.fftw.org>
This site's top page is http://pobox.com/~oleg/ftp/
Converted from SXML by SXML->HTML