Lines Matching refs:sctx

231   FactorShiftCtx   sctx;  in MatLUFactorNumeric_SeqAIJ()  local
240 PetscCall(PetscMemzero(&sctx, sizeof(FactorShiftCtx))); in MatLUFactorNumeric_SeqAIJ()
244 sctx.shift_top = info->zeropivot; in MatLUFactorNumeric_SeqAIJ()
252 if (rs > sctx.shift_top) sctx.shift_top = rs; in MatLUFactorNumeric_SeqAIJ()
254 sctx.shift_top *= 1.1; in MatLUFactorNumeric_SeqAIJ()
255 sctx.nshift_max = 5; in MatLUFactorNumeric_SeqAIJ()
256 sctx.shift_lo = 0.; in MatLUFactorNumeric_SeqAIJ()
257 sctx.shift_hi = 1.; in MatLUFactorNumeric_SeqAIJ()
266 sctx.newshift = PETSC_FALSE; in MatLUFactorNumeric_SeqAIJ()
285 rtmp[i] += sctx.shift_amount; /* shift the diagonal of the matrix */ in MatLUFactorNumeric_SeqAIJ()
328 sctx.rs = rs; in MatLUFactorNumeric_SeqAIJ()
329 sctx.pv = rtmp[i]; in MatLUFactorNumeric_SeqAIJ()
330 PetscCall(MatPivotCheck(B, A, info, &sctx, i)); in MatLUFactorNumeric_SeqAIJ()
331 if (sctx.newshift) break; /* break for-loop */ in MatLUFactorNumeric_SeqAIJ()
332 rtmp[i] = sctx.pv; /* sctx.pv might be updated in the case of MAT_SHIFT_INBLOCKS */ in MatLUFactorNumeric_SeqAIJ()
341 …= (PetscReal)MAT_SHIFT_POSITIVE_DEFINITE && !sctx.newshift && sctx.shift_fraction > 0 && sctx.nshi… in MatLUFactorNumeric_SeqAIJ()
346 sctx.shift_hi = sctx.shift_fraction; in MatLUFactorNumeric_SeqAIJ()
347 sctx.shift_fraction = (sctx.shift_hi + sctx.shift_lo) / 2.; in MatLUFactorNumeric_SeqAIJ()
348 sctx.shift_amount = sctx.shift_fraction * sctx.shift_top; in MatLUFactorNumeric_SeqAIJ()
349 sctx.newshift = PETSC_TRUE; in MatLUFactorNumeric_SeqAIJ()
350 sctx.nshift++; in MatLUFactorNumeric_SeqAIJ()
352 } while (sctx.newshift); in MatLUFactorNumeric_SeqAIJ()
381 if (sctx.nshift) { in MatLUFactorNumeric_SeqAIJ()
383 … up by %e fraction top_value %e\n", sctx.nshift, (double)sctx.shift_amount, (double)sctx.shift_fra… in MatLUFactorNumeric_SeqAIJ()
385 …number of shift_nz tries %" PetscInt_FMT ", shift_amount %g\n", sctx.nshift, (double)sctx.shift_am… in MatLUFactorNumeric_SeqAIJ()
387 …ber of shift_inblocks applied %" PetscInt_FMT ", each shift_amount %g\n", sctx.nshift, (double)inf… in MatLUFactorNumeric_SeqAIJ()
410 FactorShiftCtx sctx; in MatLUFactorNumeric_SeqAIJ_inplace() local
419 PetscCall(PetscMemzero(&sctx, sizeof(FactorShiftCtx))); in MatLUFactorNumeric_SeqAIJ_inplace()
423 sctx.shift_top = info->zeropivot; in MatLUFactorNumeric_SeqAIJ_inplace()
431 if (rs > sctx.shift_top) sctx.shift_top = rs; in MatLUFactorNumeric_SeqAIJ_inplace()
433 sctx.shift_top *= 1.1; in MatLUFactorNumeric_SeqAIJ_inplace()
434 sctx.nshift_max = 5; in MatLUFactorNumeric_SeqAIJ_inplace()
435 sctx.shift_lo = 0.; in MatLUFactorNumeric_SeqAIJ_inplace()
436 sctx.shift_hi = 1.; in MatLUFactorNumeric_SeqAIJ_inplace()
445 sctx.newshift = PETSC_FALSE; in MatLUFactorNumeric_SeqAIJ_inplace()
456 rtmp[ics[r[i]]] += sctx.shift_amount; /* shift the diagonal of the matrix */ in MatLUFactorNumeric_SeqAIJ_inplace()
484 sctx.rs = rs; in MatLUFactorNumeric_SeqAIJ_inplace()
485 sctx.pv = pv[diag]; in MatLUFactorNumeric_SeqAIJ_inplace()
486 PetscCall(MatPivotCheck(B, A, info, &sctx, i)); in MatLUFactorNumeric_SeqAIJ_inplace()
487 if (sctx.newshift) break; in MatLUFactorNumeric_SeqAIJ_inplace()
488 pv[diag] = sctx.pv; in MatLUFactorNumeric_SeqAIJ_inplace()
491 …= (PetscReal)MAT_SHIFT_POSITIVE_DEFINITE && !sctx.newshift && sctx.shift_fraction > 0 && sctx.nshi… in MatLUFactorNumeric_SeqAIJ_inplace()
496 sctx.shift_hi = sctx.shift_fraction; in MatLUFactorNumeric_SeqAIJ_inplace()
497 sctx.shift_fraction = (sctx.shift_hi + sctx.shift_lo) / 2.; in MatLUFactorNumeric_SeqAIJ_inplace()
498 sctx.shift_amount = sctx.shift_fraction * sctx.shift_top; in MatLUFactorNumeric_SeqAIJ_inplace()
499 sctx.newshift = PETSC_TRUE; in MatLUFactorNumeric_SeqAIJ_inplace()
500 sctx.nshift++; in MatLUFactorNumeric_SeqAIJ_inplace()
502 } while (sctx.newshift); in MatLUFactorNumeric_SeqAIJ_inplace()
529 if (sctx.nshift) { in MatLUFactorNumeric_SeqAIJ_inplace()
531 … up by %e fraction top_value %e\n", sctx.nshift, (double)sctx.shift_amount, (double)sctx.shift_fra… in MatLUFactorNumeric_SeqAIJ_inplace()
533 …number of shift_nz tries %" PetscInt_FMT ", shift_amount %g\n", sctx.nshift, (double)sctx.shift_am… in MatLUFactorNumeric_SeqAIJ_inplace()
566 FactorShiftCtx sctx; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm() local
576 PetscCall(PetscMemzero(&sctx, sizeof(FactorShiftCtx))); in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
582 sctx.shift_top = info->zeropivot; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
590 if (rs > sctx.shift_top) sctx.shift_top = rs; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
592 sctx.shift_top *= 1.1; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
593 sctx.nshift_max = 5; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
594 sctx.shift_lo = 0.; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
595 sctx.shift_hi = 1.; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
605 sctx.shift_top = 0.; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
606 sctx.nshift_max = 0; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
607 sctx.shift_lo = 0.; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
608 sctx.shift_hi = 0.; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
609 sctx.shift_fraction = 0.; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
612 sctx.shift_top = 0.; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
620 if (rs > sctx.shift_top) sctx.shift_top = rs; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
622 if (sctx.shift_top < info->zeropivot) sctx.shift_top = info->zeropivot; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
623 sctx.shift_top *= 1.1; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
624 sctx.nshift_max = 5; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
625 sctx.shift_lo = 0.; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
626 sctx.shift_hi = 1.; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
629 sctx.shift_amount = 0.; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
630 sctx.nshift = 0; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
634 sctx.newshift = PETSC_FALSE; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
649 rtmp[r[i]] += sctx.shift_amount; /* shift the diagonal of the matrix */ in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
678 sctx.rs = rs; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
679 sctx.pv = pv[nbdiag]; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
680 PetscCall(MatPivotCheck(B, A, info, &sctx, i)); in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
681 if (sctx.newshift) break; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
682 pv[nbdiag] = sctx.pv; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
685 …= (PetscReal)MAT_SHIFT_POSITIVE_DEFINITE && !sctx.newshift && sctx.shift_fraction > 0 && sctx.nshi… in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
690 sctx.shift_hi = sctx.shift_fraction; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
691 sctx.shift_fraction = (sctx.shift_hi + sctx.shift_lo) / 2.; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
692 sctx.shift_amount = sctx.shift_fraction * sctx.shift_top; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
693 sctx.newshift = PETSC_TRUE; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
694 sctx.nshift++; in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
696 } while (sctx.newshift); in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
715 if (sctx.nshift) { in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
717 … up by %e fraction top_value %e\n", sctx.nshift, (double)sctx.shift_amount, (double)sctx.shift_fra… in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
719 …number of shift_nz tries %" PetscInt_FMT ", shift_amount %g\n", sctx.nshift, (double)sctx.shift_am… in MatLUFactorNumeric_SeqAIJ_InplaceWithPerm()
1715 FactorShiftCtx sctx; in MatCholeskyFactorNumeric_SeqAIJ() local
1725 PetscCall(PetscMemzero(&sctx, sizeof(FactorShiftCtx))); in MatCholeskyFactorNumeric_SeqAIJ()
1728 sctx.shift_top = info->zeropivot; in MatCholeskyFactorNumeric_SeqAIJ()
1736 if (rs > sctx.shift_top) sctx.shift_top = rs; in MatCholeskyFactorNumeric_SeqAIJ()
1738 sctx.shift_top *= 1.1; in MatCholeskyFactorNumeric_SeqAIJ()
1739 sctx.nshift_max = 5; in MatCholeskyFactorNumeric_SeqAIJ()
1740 sctx.shift_lo = 0.; in MatCholeskyFactorNumeric_SeqAIJ()
1741 sctx.shift_hi = 1.; in MatCholeskyFactorNumeric_SeqAIJ()
1754 sctx.newshift = PETSC_FALSE; in MatCholeskyFactorNumeric_SeqAIJ()
1777 rtmp[k] += sctx.shift_amount; /* shift the diagonal of the matrix */ in MatCholeskyFactorNumeric_SeqAIJ()
1824 sctx.rs = rs; in MatCholeskyFactorNumeric_SeqAIJ()
1825 sctx.pv = dk; in MatCholeskyFactorNumeric_SeqAIJ()
1826 PetscCall(MatPivotCheck(B, A, info, &sctx, i)); in MatCholeskyFactorNumeric_SeqAIJ()
1827 if (sctx.newshift) break; in MatCholeskyFactorNumeric_SeqAIJ()
1828 dk = sctx.pv; in MatCholeskyFactorNumeric_SeqAIJ()
1832 } while (sctx.newshift); in MatCholeskyFactorNumeric_SeqAIJ()
1858 if (sctx.nshift) { in MatCholeskyFactorNumeric_SeqAIJ()
1860 … up by %e fraction top_value %e\n", sctx.nshift, (double)sctx.shift_amount, (double)sctx.shift_fra… in MatCholeskyFactorNumeric_SeqAIJ()
1862 …number of shift_nz tries %" PetscInt_FMT ", shift_amount %g\n", sctx.nshift, (double)sctx.shift_am… in MatCholeskyFactorNumeric_SeqAIJ()
1864 …ber of shift_inblocks applied %" PetscInt_FMT ", each shift_amount %g\n", sctx.nshift, (double)inf… in MatCholeskyFactorNumeric_SeqAIJ()
1883 FactorShiftCtx sctx; in MatCholeskyFactorNumeric_SeqAIJ_inplace() local
1892 PetscCall(PetscMemzero(&sctx, sizeof(FactorShiftCtx))); in MatCholeskyFactorNumeric_SeqAIJ_inplace()
1895 sctx.shift_top = info->zeropivot; in MatCholeskyFactorNumeric_SeqAIJ_inplace()
1903 if (rs > sctx.shift_top) sctx.shift_top = rs; in MatCholeskyFactorNumeric_SeqAIJ_inplace()
1905 sctx.shift_top *= 1.1; in MatCholeskyFactorNumeric_SeqAIJ_inplace()
1906 sctx.nshift_max = 5; in MatCholeskyFactorNumeric_SeqAIJ_inplace()
1907 sctx.shift_lo = 0.; in MatCholeskyFactorNumeric_SeqAIJ_inplace()
1908 sctx.shift_hi = 1.; in MatCholeskyFactorNumeric_SeqAIJ_inplace()
1918 sctx.newshift = PETSC_FALSE; in MatCholeskyFactorNumeric_SeqAIJ_inplace()
1941 if (sctx.nshift) rtmp[k] += sctx.shift_amount; in MatCholeskyFactorNumeric_SeqAIJ_inplace()
1978 sctx.rs = rs; in MatCholeskyFactorNumeric_SeqAIJ_inplace()
1979 sctx.pv = dk; in MatCholeskyFactorNumeric_SeqAIJ_inplace()
1980 PetscCall(MatPivotCheck(B, A, info, &sctx, k)); in MatCholeskyFactorNumeric_SeqAIJ_inplace()
1981 if (sctx.newshift) break; in MatCholeskyFactorNumeric_SeqAIJ_inplace()
1982 dk = sctx.pv; in MatCholeskyFactorNumeric_SeqAIJ_inplace()
2000 } while (sctx.newshift); in MatCholeskyFactorNumeric_SeqAIJ_inplace()
2024 if (sctx.nshift) { in MatCholeskyFactorNumeric_SeqAIJ_inplace()
2026 …"number of shiftnz tries %" PetscInt_FMT ", shift_amount %g\n", sctx.nshift, (double)sctx.shift_am… in MatCholeskyFactorNumeric_SeqAIJ_inplace()
2028 …"number of shiftpd tries %" PetscInt_FMT ", shift_amount %g\n", sctx.nshift, (double)sctx.shift_am… in MatCholeskyFactorNumeric_SeqAIJ_inplace()