Skip to content

ohno/ill-conditioned

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Ill-conditioned

Examples of ill-conditioned eigenvalue problems.

Usage

Run following commands on WSL/Ubuntu. Each eigenvalue problems of Frank matrix and of Hilbert matrix will be solved using SSYEV and DSYEV. Results depend on the number of threads.

git clone https://github.com/ohno/ill-conditioned.git
cd ill-conditioned
export OMP_NUM_THREADS=1
bash run.sh

GCC, BLAS and LAPACK must be installed before use. Run following commands on WSL/Ubuntu to install GCC, BLAS and LAPACK.

sudo apt update
sudo apt install build-essential
sudo apt install gfortran
gcc -v
g++ -v
gfortran -v
sudo apt install libblas-dev
sudo apt install liblapack-dev

If you need other BLAS distributions, run following commands on WSL/Ubuntu to install and to choice.

sudo apt update
sudo apt install libblas-dev
sudo apt install libatlas-base-dev
sudo apt install libblis-dev
sudo apt install intel-mkl
sudo apt install libopenblas-base
sudo apt install libopenblas-dev
sudo update-alternatives --config libblas.so-x86_64-linux-gnu

Formulation

Eigenvalue problems of $n\times n$ matrix $A$

$$ Ax = \lambda x $$

are solved. For example, $5\times5$ Frank matrix is

$$ A = \left[ \begin{array}{ccccc} 5 & 4 & 3 & 2 & 1 \\ 4 & 4 & 3 & 2 & 1 \\ 3 & 3 & 3 & 2 & 1 \\ 2 & 2 & 2 & 2 & 1 \\ 1 & 1 & 1 & 1 & 1 \\ \end{array} \right], $$

$5\times5$ Hilbert matrix is

$$ A = \left[ \begin{array}{ccccc} 1 & \frac{1}{2} & \frac{1}{3} & \frac{1}{4} & \frac{1}{5} \\ \frac{1}{2} & \frac{1}{3} & \frac{1}{4} & \frac{1}{5} & \frac{1}{6} \\ \frac{1}{3} & \frac{1}{4} & \frac{1}{5} & \frac{1}{6} & \frac{1}{7} \\ \frac{1}{4} & \frac{1}{5} & \frac{1}{6} & \frac{1}{7} & \frac{1}{8} \\ \frac{1}{5} & \frac{1}{6} & \frac{1}{7} & \frac{1}{8} & \frac{1}{9} \\ \end{array} \right]. $$

Results

Minimum eigenvalues are following.

Frank matrix
n = 10
 SSYEV  0.255679399
 DSYEV  0.25567956279643672
n = 100
 SSYEV  0.250060558
 DSYEV  0.25006108272069305
n = 1000
 SSYEV  0.247511998
 DSYEV  0.25000061623489633
Hilbert matrix
n = 1
 SSYEV   1.00000000
 DSYEV   1.0000000000000000
n = 2
 SSYEV   6.57414496E-02
 DSYEV   6.5741454089335100E-002
n = 3
 SSYEV   2.68730382E-03
 DSYEV   2.6873403557734501E-003
n = 4
 SSYEV   9.66915541E-05
 DSYEV   9.6702304022688464E-005
n = 5
 SSYEV   3.30206194E-06
 DSYEV   3.2879287721638091E-006
n = 6
 SSYEV   7.15312751E-08
 DSYEV   1.0827994840427084E-007

Reference

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published