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.