52 size_t lrwork = 2 * minMN;
53 size_t lzwork = M * N;
57 W = malloc( lzwork *
sizeof(
double) + lrwork *
sizeof(
double) );
58 s = (
double*)(W + M*N);
61 ret = LAPACKE_dlacpy_work( LAPACK_COL_MAJOR,
'A', M, N, A, lda, W, M );
63 ret = LAPACKE_dgesvd(LAPACK_COL_MAJOR,
'N',
'N', M, N, W, M, s, NULL, 1, NULL, 1, superb );
66 for(i=0; i<minMN; i++) {
67 fprintf( stderr,
"%e ", s[i] );
69 fprintf(stderr,
"\n");
112 double eps = LAPACKE_dlamch_work(
'e');
118 Id = malloc( minMN * minMN *
sizeof(
double) );
119 ret = LAPACKE_dlaset_work( LAPACK_COL_MAJOR,
'A', minMN, minMN,
125 cblas_dsyrk(CblasColMajor, CblasUpper, CblasTrans, N, M, alpha, A, lda, beta, Id, minMN);
129 cblas_dsyrk(CblasColMajor, CblasUpper, CblasNoTrans, M, N, alpha, A, lda, beta, Id, minMN);
132 normQ = LAPACKE_dlansy_work( LAPACK_COL_MAJOR,
'M',
'U', minMN, Id, minMN, NULL );
133 res = normQ / (maxMN * eps);
135 if ( isnan(res) || isinf(res) || (res > 60.0) ) {
136 fprintf(stderr,
"Check Orthogonality: || I - Q*Q' || = %e, ||Id-Q'*Q||_oo / (N*eps) = %e : \n",
197 double eps = LAPACKE_dlamch_work(
'e');
202 Zero = malloc( NA * NB *
sizeof(
double) );
203 ret = LAPACKE_dlaset_work( LAPACK_COL_MAJOR,
'A', NA, NB,
207 cblas_dgemm(CblasColMajor, CblasTrans, CblasNoTrans,
213 norm = LAPACKE_dlange_work( LAPACK_COL_MAJOR,
'M', NA, NB, Zero, NA, NULL );
214 res = norm / (M * eps);
216 if ( isnan(res) || isinf(res) || (res > 60.0) ) {
217 fprintf(stderr,
"Check Orthogonality: || A' B || = %e, || A' B ||_oo / (M*eps) = %e : \n",
Manage nancheck for lowrank kernels. This header describes all the LAPACKE functions used for low-ran...
BEGIN_C_DECLS typedef int pastix_int_t
void core_dlrdbg_printsvd(pastix_int_t M, pastix_int_t N, const double *A, pastix_int_t lda)
Print the svd values of the given matrix.
int core_dlrdbg_check_orthogonality_AB(pastix_int_t M, pastix_int_t NA, pastix_int_t NB, const double *A, pastix_int_t lda, const double *B, pastix_int_t ldb)
Check the orthogonality of the matrix A relatively to the matrix B.
int core_dlrdbg_check_orthogonality(pastix_int_t M, pastix_int_t N, const double *A, pastix_int_t lda)
Check the orthogonality of the matrix A.