-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Henrik Johansson
committed
Jan 15, 2009
1 parent
21aecce
commit 9a2f942
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import numpy as npy | ||
import slicot | ||
|
||
from nose.tools import * | ||
from numpy.testing import assert_array_almost_equal | ||
|
||
def test_sb03md(): | ||
A = npy.array([[1., 2.], [3., 4.]]) | ||
C = -npy.array([[5., 6.], [6., 8.]]) | ||
|
||
a,u,c,scale,sep,ferr,wr,wi,info = slicot.sb03md(dico='C', job='X', fact='N', trana='N', a=A, c=C) | ||
|
||
assert_equal(info, 0) | ||
|
||
## Test if eigenvalues of A are correct | ||
Alambda,Aeigvec = npy.linalg.eig(A) | ||
assert_array_almost_equal(wr, Alambda) | ||
|
||
## Test result | ||
assert_array_almost_equal(c, npy.array([[-0.1, -0.8],[-0.8, -0.6]])) | ||
|
||
|
||
|