free(work);returnRnorm;}/*------------------------------------------------------------------------ * * Check the accuracy of the computed inverse * */intzcheck_inverse(intN,MORSE_Complex64_t*A1,MORSE_Complex64_t*A2,intLDA,MORSE_enumuplo,double*rnorm,double*anorm,double*ainvnorm){intinfo_inverse;inti,j;doubleresult;MORSE_Complex64_talpha,beta,zone;MORSE_Complex64_t*workz=(MORSE_Complex64_t*)malloc(N*N*sizeof(MORSE_Complex64_t));double*workd=(double*)malloc(N*sizeof(double));doubleeps;eps=LAPACKE_dlamch_work('e');alpha=-1.0;beta=0.0;zone=1.0;/* Rebuild the other part of the inverse matrix */if(uplo==MorseUpper){for(j=0;j<N;j++)for(i=0;i<j;i++)*(A2+j+i*LDA)=*(A2+i+j*LDA);cblas_zhemm(CblasColMajor,CblasLeft,CblasUpper,N,N,CBLAS_SADDR(alpha),A2,LDA,A1,LDA,CBLAS_SADDR(beta),workz,N);}else{for(j=0;j<N;j++)for(i=j;i<N;i++)*(A2+j+i*LDA)=*(A2+i+j*LDA);cblas_zhemm(CblasColMajor,CblasLeft,CblasLower,N,N,CBLAS_SADDR(alpha),A2,LDA,A1,LDA,CBLAS_SADDR(beta),workz,N);}/* Add the identity matrix to workz */for(i=0;i<N;i++)*(workz+i+i*N)=*(workz+i+i*N)+zone;