yMor
yMor

Reputation: 5

Accelerated framework in Xcode to get a QR factorization of A but zgeqrf cannot been found

I have successfully used sgetrf to obtain a LU factorization of A using accelerated framework in Xcode, when I tried to get a QR factorization of A using the same framework I get the error " Semantic Issue Group No matching function for call to 'zgeqrf_' 1. Candidate function not viable: no known conversion from 'float *' to '__CLPK_doublecomplex *' for 3rd argumen" here is my code:

include

include

int main(int argc, const char * argv[]) {

float A[4][3] = {{0,-2,1}, {1,3,1}, {0,0,1}, {1,1,5}};

__CLPK_integer m = 4;
__CLPK_integer n = 3;
__CLPK_integer ipiv[3];
__CLPK_doublecomplex tau[n];
__CLPK_doublecomplex work[n];
__CLPK_integer lwork = n;
__CLPK_integer info = 0;

sgetrf_(&m, &n, &A[0][0], &m, ipiv, &info);
zgeqrf_(&m, &n, &A[0][0], &m, tau, work, &lwork, &info);


int row, columns;

for (row=0; row<4; row++)
{
    for(columns=0; columns<3; columns++)
    {
        printf("%f", A[row][columns]);
    }
    printf("\n");
}

}

Thanks for your time in advance;

Upvotes: 0

Views: 84

Answers (1)

jtbandes
jtbandes

Reputation: 118681

From your error message it sounds like zgeqrf_ requires the argument to be of type __CLPK_doublecomplex* instead of float*, but your A is declared as an array of floats. Check the documentation for zgeqrf_ to help understand why.

Upvotes: 0

Related Questions