I am attempting to use this routine but am getting an exception:
Exception thrown at 0x01FA5428 (mkl_core.dll) in Console1.exe: 0xC0000005: Access violation reading location 0x00000000.
I wonder if anyone knows how I might fix this.
The application sets up an underdetermined and rank deficient set of equations and I wish to obtain a least squares solution to the problem. The routine runs fine until I call dgelss when I get the error shown in the image uploaded previously. Any assistance, and you can take a look at the complete application uploaded previously, would be gratefully received. Thanks, Angus.
The routine DGELSS has a Fortran-77 interface, with 13 arguments. You have called it with just 4 arguments, and such a call is bound to fail badly. If you want to call the Lapack95 version, instead, the routine name is GELSS, and that routine takes 2 required arguments + 4 optional arguments.
The routine GELSS is a driver routine; with a single call to it, you can obtain the least-norm solution to a rank-deficient undetermined set of equations. Therefore, I do not understand why you have calls to GETRF and GETRI and further matrix operations.
The MKL distribution includes the source code for an example that calls GELSS.
Okay to using gelss rather than dgelss. However, according to the INTEL MKL documentation the call has four non-optional arguments:
Nontheless, if I call it with just the first two essential arguments it seems to work - need to check out the results in more detail.
The calls to getrf and getri were an earlier attempt to solve the problem before I realised that could be rank-deficient.
Thanks for your assistance with this.
... according to the INTEL MKL documentation the call has four non-optional arguments ... Nonetheless, if I call it with just the first two essential arguments it seems to work
The convention used in the documentation is that arguments shown within square brackets are optional keyword arguments. The comma preceding an optional argument is also shown inside the square brackets, and that should remove any ambiguity as to what is meant.
Ah - it is a long while since I'd done any coding and when I look again I do indeed see the call syntax towards the top of the page and the LAPACK95 Interface notes at the bottom of the page where only some of the arguments are listed/defined and where the optional nature of some of these is not clear. Might be better, for optimum clarity, to move the appropriate call syntax to be adjacent to the notes?
Thanks for your patience and help.