On 8 апреля 2013 22:53:13 Michal D. wrote:
> I haven't been able to sort through the mt code to decipher how to call the
> routines with a single input matrix. It looks like quite a substantial
> amount of important work.
load'math/mt'
NB. generate random symmetric 4x4-matrix to play with (see rand.ijs)
] A=. _1 1 0 3 _6 4&gemat_mt_ hemat_mt_ 4 4
_0.0157367 0.000464677 _0.0096888 _7.10246
0.000464677 _1.38946 _11.0957 1.71751
_0.0096888 _11.0957 0.0149438 _1.78811
_7.10246 1.71751 _1.78811 0.0686757
NB. case 1: use mt-only staff
NB. - since there is no equivalent xGEEV('N','N',...), let's use
NB. equivalent of xGGEV('N','N',...), either ggevunn or ggevlnn
NB. - ggevunn is column-wise algo implementing xGGEV('N','N',...) of LAPACK
NB. version 3.2.2, ggevlnn is row-wise algo modeling the same
NB. xGGEV('N','N',...)
NB. 1) create 4x4 identity matrix
I=. idmat_mt_ 4
NB. 2) compose generalized eigenvalue problem and feed it to ggevlnn
ggevlnn_mt_ A ,: I
11.3293 6.40637 _7.25198 _11.8053
1 1 1 1
NB. - result is 2x4-matrix of generalized eigenvalues, where 1st row
NB. is A's eigenvalues
NB. case 2: create new definition to get necessary functionality,
NB. see application section for ggevlxx in ev.ijs
NB. 1) simulate LAPACK's xGEEV('N','N',...):
NB. e=. geevlnn A
geevlnn=: {.@ggevlnn_mt_@(,:(idmat_mt_@c_mt_))
NB. 2) feed A to it
geevlnn A
11.3293 6.40637 _7.25198 _11.8053
--
WBR
Igor
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm