Archive for the ‘Dense Matrices’ Category

The right-hand-side is usually dense or at least it was the case in my applications. In this case I have used the class Matrix that was already employed previously in sections devoted to dense matrices. I will describe this class in more detail here. The class is declared in matrices.h and actually most functions are defined […]

I like C++ and after I have switched from Fortran to C++ at the beginning of the nineties, I wanted to do everything in C++ including linear algebra. My first linear algebra in C++ was GNUSSL by Robert D. Pierce. It was a nice template library that helped me a lot to understand how one […]

The goal of this section is basically to repeat the rules from the section Using Fortran Subroutines from C++ with the example of the Fortran subroutines decomp and solve from the book Computer Methods for Mathematical Computations. I will use a simple matrix class described in matrix.h (see also Class Matrix). The class is based on vector<double> and it […]

The LAPACK library for linear algebra is integrated in many interactive environments (for example, Mathematica or Matlab) and this is the simplest way to access it. In this chapter, I will demonstrate the use of some LAPACK routines from SciPy in Python. Below it is assumed that NumPy and SciPy are installed in your Python […]

decomp is a simple implementation in Fortran of the LU-decomposition from the book Computer Methods for Mathematical Computations. It is just 169 lines and theoretically one can use the code to learn the algorithm. It also allows you to get the flavor of Fortran, the code, I guess, is written in Fortran IV. Fortran is a […]

Solution of a system of linear equations is the task encountered most often in linear algebra. A good starting point from the theoretical side is the page in Wikipedia Numerical methods to solve a linear system are divided in two groups: direct and iterative methods. For dense matrices, people use mostly direct methods and […]

At IMTEK, I have been working with Mathematica and I should say that it is a pretty good tool for fast prototyping. The only disadvantage is that it is a commercial tool and it is necessary to purchase a license. As a result, when I finished my work at IMTEK, I have decided to look what […]

LAPACK is the best linear algebra library and it is free. Hence it would be just stupid not to use it. LAPACK Users’ Guide gives a good introduction in the library, so it is good to have it. The guide with the difference to the code does cost some money but this will be a […]

Linear algebra algorithms can be written in terms of standard matrix-vector operations. This operations could be optimized for a particular hardware and thus one can increase performance by using the optimized BLAS libraries. In practice this means that it is must to use an optimized BLAS in your work. A nice introduction to BLAS is in […]

David Kahaner, Cleve Moler, Stephen Nash, 1988 This book is similar to the Forsythe book, in a way this is an update. I have browsed the book in 1989, while being at NIST and then used the code from the book for some time. The code is available now at the pages of Stephen Nash […]