Skip to content

Incorrect initialization of LDWORK in sb03md #165

@artpelling

Description

@artpelling

According to the SLICOT documentation for LDWORK of SB03MD:

 LDWORK  INTEGER
          The length of the array DWORK.  LDWORK >= 1, and
          If JOB = 'X' then
             If FACT = 'F', LDWORK >= N*N,           for DICO = 'C';
                            LDWORK >= MAX(N*N, 2*N), for DICO = 'D';
             If FACT = 'N', LDWORK >= MAX(N*N, 3*N).
          If JOB = 'S' or JOB = 'B' then
             If FACT = 'F', LDWORK >= 2*N*N,       for DICO = 'C';
                            LDWORK >= 2*N*N + 2*N, for DICO = 'D'.
             If FACT = 'N', LDWORK >= MAX(2*N*N, 3*N), DICO = 'C';
                            LDWORK >= 2*N*N + 2*N, for DICO = 'D'.
          For optimum performance LDWORK should be larger.
[...]

However, LDWORK is set to

Slycot/slycot/synthesis.py

Lines 790 to 791 in 063fed3

if ldwork is None:
ldwork = max(2*n*n, 3*n)

disregarding the values of JOB, FACT and DICO.

Which gives me

slycot.exceptions.SlycotParameterError: The following argument had an illegal value: ldwork

for JOB='B', FACT='N' and DICO='D'

I know that I can set ldwork manually, but IMHO that sort of thing is precisely what the wrapper should do for me :^)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions