Opened 14 years ago

Last modified 13 years ago

#1370 closed defect (fixed)

EigenValues problem

Reported by: sjoelund.se Owned by: sjoelund.se
Priority: high Milestone:
Component: Instantiation Version:
Keywords: Cc: sjoelund.se, adrpo, perost

Description

{{{[a.mo:10:3-10:75:writable] Error: Wrong type or wrong number of arguments to zeros(size(A, 1), size(A, 1))'.
}}}

The problem is that the function uses a binding with (at the time) unknown dimensions (because the function has yet to be called).

{{{function dgeev_eigenValues

input Real A[:, size(A, 1)];
output Real EigenReal[size(A, 1)];
output Real EigenImag[size(A, 1)];
output Integer info;

protected

Integer lwork=8*size(A, 1);
Real Awork[size(A, 1), size(A, 1)]=A;
Real work[lwork];
Real EigenvectorsL[size(A, 1), size(A, 1)]=zeros(size(A, 1), size(A, 1));

external "Fortran 77" dgeev("N", "N", size(A, 1), Awork, size(A, 1),

EigenReal, EigenImag, EigenvectorsL, size(EigenvectorsL, 1),
EigenvectorsL, size(EigenvectorsL, 1), work, size(work, 1), info)
annotation (Library="Lapack");

end dgeev_eigenValues;

class testeig

import Modelica.Math.Matrices;
Real A[3,3] = [1,2,3;3,4,5;2,1,4];
Real [3] eval;
Real [2] vals;

algorithm

(vals,eval):=dgeev_eigenValues(A);

end testeig;}}}

Change History (3)

comment:1 Changed 14 years ago by sjoelund.se

Note: This only fails if the function is external.

comment:2 Changed 13 years ago by adrpo

Hehe, now it compiles and runs and dies with:

base_array.c: array dimension size for dimension 842 is -1 < 0!
Assertion failed: base_array_ok(&a), file base_array.c, line 320

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Got a more meaningful error out of it, I don't think there is any 842
dimension in any of the arrays. So something is fishy now with the
array management.

comment:3 Changed 13 years ago by adrpo

See SCM Commits tab.

Note: See TracTickets for help on using tickets.