BLAS1_C
Basic Linear Algebra Subprograms
Level 1
Single Precision Complex Arithmetic
BLAS1_C
is a MATLAB library which
implements the Level 1 BLAS, or Basic Linear Algebra Subprograms.
The BLAS are a small core library of linear algebra utilities,
which can be highly optimized for various architectures. Software
that relies on the BLAS is thus highly portable, and will typically
run very efficiently. The
LINPACK
and
LAPACK
linear algebra libraries make extensive use of the BLAS.
The Level 1 BLAS are primarily for use in vector operations.
In certain cases, they may also be used to operate on the rows
or columns of a two-dimensional array.
It is worth questioning whether one should try to implement the
Level 1 BLAS in MATLAB: for one thing, the MATLAB language makes
it very easy to carry out vector operations, even with nonunit
incrementing on the vector indices. Moreover, MATLAB actually
makes it more difficult to stick with the syntax of the BLAS, since
it is not so easy to make a two dimensional array "look like" a
vector.
In particular, if you want to work on a row of a matrix,
MATLAB essentially prefers you to make a temporary vector, as in
"A(3,1:N)"; in the standard BLAS, you would instead pass the location
of the first entry, A(3,1), and an increment, LDA, that will lead to
the next entry of the row. This is not easy or natural to do
in MATLAB. Still, for consistency, I have gone ahead and tried
to make a reasonable effort at implementing the Level 1 BLAS.
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
Languages:
BLAS1_C is available in
a C version and
a C++ version and
a FORTRAN77 version and
a FORTRAN90 version and
a MATLAB version.
Related Data and Programs:
BLAS1_D,
a MATLAB library which
contains basic linear algebra routines for vector-vector operations,
using double precision real arithmetic.
BLAS1_S,
a MATLAB library which
contains basic linear algebra routines for vector-vector operations,
using single precision real arithmetic.
BLAS1_Z,
a MATLAB library which
contains basic linear algebra routines for vector-vector operations,
using double precision complex arithmetic.
GSL,
a C++ library which
includes an implementation of the BLAS1 routines.
LAPACK_EXAMPLES,
a FORTRAN90 program which
demonstrates the use of the LAPACK linear algebra library.
LINPACK_C,
a MATLAB library which
solves linear systems using single precision complex arithmetic;
SUPER_BLAS,
a C library which
contains a version of some of the BLAS1
routines.
Reference:
-
Thomas Coleman, Charles vanLoan,
Handbook for Matrix Computations,
SIAM, 1988,
ISBN13: 978-0-898712-27-8,
LC: QA188.C65.
-
Jack Dongarra, Jim Bunch, Cleve Moler, Pete Stewart,
LINPACK User's Guide,
SIAM, 1979,
ISBN13: 978-0-898711-72-1,
LC: QA214.L56.
-
Charles Lawson, Richard Hanson, David Kincaid, Fred Krogh,
Algorithm 539:
Basic Linear Algebra Subprograms for Fortran Usage,
ACM Transactions on Mathematical Software,
Volume 5, Number 3, September 1979, pages 308-323.
Source Code:
-
cabs1.m,
returns the L1 magnitude of a complex number;
-
cabs2.m,
returns the L2 magnitude of a complex number;
-
caxpy.m,
adds a constant times one complex vector to another.
-
ccopy.m,
makes a copy of a complex vector;
-
cdotc.m,
computes the conjugated scalar product of two complex vectors;
-
cdotu.m,
computes the unconjugated scalar product of two complex vectors;
-
cmach.m,
computes machine parameters.
-
crotg.m,
constructs a complex Givens plane rotation.
-
cscal.m,
scales a complex vector by a constant.
-
csign1.m,
transfer of sign to the L1 magnitude of a complex number.
-
csign2.m,
transfer of sign to the L2 magnitude of a complex number.
-
csrot.m,
applies a plane rotation to complex vectors.
-
csscal.m,
scale a complex vector by a real constant.
-
cswap.m,
interchanges two complex vectors.
-
icamax.m,
returns the index of the complex vector entry of greatest magnitude;
-
scasum.m,
sums the absolute values of the entries of a complex vector;
-
scnrm2.m,
computes the Euclidean norm of a complex vector.
Examples and Tests:
-
blas1_c_test.m,
calls all the tests;
-
blas1_c_test_output.txt,
the output file.
-
blas1_c_test01.m,
tests CABS1;
-
blas1_c_test02.m,
tests CABS2;
-
blas1_c_test03.m,
tests CAXPY;
-
blas1_c_test04.m,
tests CCOPY;
-
blas1_c_test05.m,
tests CDOTC;
-
blas1_c_test06.m,
tests CDOTU;
-
blas1_c_test07.m,
tests CMACH.
-
blas1_c_test08.m,
tests CROTG.
-
blas1_c_test09.m,
tests CSCAL;
-
blas1_c_test10.m,
tests CSIGN1;
-
blas1_c_test11.m,
tests CSIGN2;
-
blas1_c_test12.m,
tests CSROT;
-
blas1_c_test13.m,
tests CSSCAL;
-
blas1_c_test14.m,
tests CSWAP;
-
blas1_c_test15.m,
tests ICAMAX;
-
blas1_c_test16.m,
tests SCASUM;
-
blas1_c_test17.m,
tests SCNRM2;
Utility Routines:
-
c4_uniform_01.m,
returns a random complex value.
-
lsame.m,
returns .TRUE. if CA is the same letter as CB regardless of case.
-
timestamp.m,
prints the YMDHMS date as a timestamp.
-
xerbla.m,
is an error handler for the LAPACK routines.
You can go up one level to
the MATLAB source codes.
Last revised on 23 June 2009.