Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Solve Underdetermined Linear equations using UTL_NLA.LAPACK_GELS

974722Jun 15 2016 — edited Jun 15 2016

SET SERVEROUTPUT ON

DECLARE

   A      utl_nla_array_dbl;

   B      utl_nla_array_dbl;

   info   INTEGER;

BEGIN

   A :=      utl_nla_array_dbl (0,

                         0,

                         384,

                         0,

                         0,

                         0,

                         368,

                         352,

                         0,

                         0,

                         0,

                         0);

   B := utl_nla_array_dbl (1, 2);

   UTL_NLA.LAPACK_GELS (trans   => 'N',         -- transpose or normal problem

                        m       => 2,                      -- A number of rows

                        n       => 6,                   -- A number of columns

                        nrhs    => 1,                   -- B number of columns

                        a       => A,                              -- A matrix

                        lda     => 2,                              -- max(1,m)

                        b       => B,                              -- B matrix

                        ldb     => 6,                            -- max(1,n,m)

                        info    => info,        -- operation status (0=sucess)

                        pack    => 'R'          -- how the matrices are stored

                                      );                     --(C=column-wise)

   DBMS_OUTPUT.put_line (info);

   FOR i IN b.FIRST .. b.LAST

   LOOP

      DBMS_OUTPUT.put_line ('c' || I || '=    ' || b (i));

   END LOOP;

EXCEPTION

   WHEN OTHERS

   THEN

     dbms_output.put_line(sqlcode||'   '||sqlerrm);

END;

-------------------------------------------------------------------------------------------------------------------

Error Thrown:

-20005   ORA-20005: Illegal argument for matrix: The value of trans is 'N', but the leading dimension does not equal m or the number of matrix elements does not equal the leading dimension multiplied by the number of columns. The number of matrix elements is 2. The value of m is 6. The number of columns is 1. The leading dimension is 6. lapack_gels. The matrix is 'b'. The leading dimension is n. The number of columns is nrhs. m is less than or equal to n.

PL/SQL procedure successfully completed.

Please help solving the issue. Thanks.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 14 2016
Added on Jun 15 2016
6 comments
529 views