DGETRI returns all zeros as inverse with large numbers

Open discussion regarding features, bugs, issues, vendors, etc.

DGETRI returns all zeros as inverse with large numbers

Postby mphanclich » Tue Jun 07, 2016 7:38 am

I am using clapack/cblas through ATLAS and coding in C. I don't get any error messages, but after using both dgetrf and dgetri (pretty sure correctly) I get the inverse being a zero matrix. I am operating here in the integer ring 11862379. The code works with smaller numbers, but I need to be in this field for the program to be worth anything. Here is my code:

#include <stdio.h>
#include <stlib.h>
#include <math.h>
#include <cblas.h>
#include <clapack.h>

const int n = 3;

int main() {
double b[n*n]; double binv[n*n]; int ipiv[n*n];
RandomCirculant(b); //this works, and I dont feel like writing it all out again here
cblas_dcopy(n*n, b, 1, binv, 1);
int info = clapack_dgetrf(CblasRowMajor, n, n, binv, n, ipiv);
if (info == 0)
clapack_dgetri(CblasRowMajor, n, binv, n, ipiv);

return 0;
}
mphanclich
 
Posts: 1
Joined: Tue Jun 07, 2016 7:24 am

Return to User Discussion

Who is online

Users browsing this forum: Google [Bot] and 4 guests