Home
last modified time | relevance | path

Searched refs:ls (Results 1 – 25 of 60) sorted by relevance

123

/petsc/src/tao/linesearch/interface/
H A Dtaolinesearch.c63 PetscErrorCode TaoLineSearchView(TaoLineSearch ls, PetscViewer viewer) in TaoLineSearchView() argument
69 PetscValidHeaderSpecific(ls, TAOLINESEARCH_CLASSID, 1); in TaoLineSearchView()
70 if (!viewer) PetscCall(PetscViewerASCIIGetStdout(((PetscObject)ls)->comm, &viewer)); in TaoLineSearchView()
72 PetscCheckSameComm(ls, 1, viewer, 2); in TaoLineSearchView()
77 PetscCall(PetscObjectPrintClassNamePrefixType((PetscObject)ls, viewer)); in TaoLineSearchView()
79 PetscTryTypeMethod(ls, view, viewer); in TaoLineSearchView()
82 …PetscCall(PetscViewerASCIIPrintf(viewer, "maximum function evaluations=%" PetscInt_FMT "\n", ls->m… in TaoLineSearchView()
83 …ewer, "tolerances: ftol=%g, rtol=%g, gtol=%g\n", (double)ls->ftol, (double)ls->rtol, (double)ls->g… in TaoLineSearchView()
84 …ViewerASCIIPrintf(viewer, "total number of function evaluations=%" PetscInt_FMT "\n", ls->nfeval)); in TaoLineSearchView()
85 …ViewerASCIIPrintf(viewer, "total number of gradient evaluations=%" PetscInt_FMT "\n", ls->ngeval)); in TaoLineSearchView()
[all …]
/petsc/src/tao/linesearch/impls/gpcglinesearch/
H A Dgpcglinesearch.c4 static PetscErrorCode TaoLineSearchDestroy_GPCG(TaoLineSearch ls) in TaoLineSearchDestroy_GPCG() argument
6 TaoLineSearch_GPCG *ctx = (TaoLineSearch_GPCG *)ls->data; in TaoLineSearchDestroy_GPCG()
13 PetscCall(PetscFree(ls->data)); in TaoLineSearchDestroy_GPCG()
17 static PetscErrorCode TaoLineSearchView_GPCG(TaoLineSearch ls, PetscViewer viewer) in TaoLineSearchView_GPCG() argument
27 static PetscErrorCode TaoLineSearchApply_GPCG(TaoLineSearch ls, Vec x, PetscReal *f, Vec g, Vec s) in TaoLineSearchApply_GPCG() argument
29 TaoLineSearch_GPCG *neP = (TaoLineSearch_GPCG *)ls->data; in TaoLineSearchApply_GPCG()
44 PetscCall(TaoLineSearchMonitor(ls, 0, *f, 0.0)); in TaoLineSearchApply_GPCG()
46 ls->reason = TAOLINESEARCH_CONTINUE_ITERATING; in TaoLineSearchApply_GPCG()
47 ls->step = ls->initstep; in TaoLineSearchApply_GPCG()
69 …PetscCall(PetscInfo(ls, "Line search error: search direction is not descent direction. dot(g,s) = … in TaoLineSearchApply_GPCG()
[all …]
/petsc/src/tao/linesearch/impls/morethuente/
H A Dmorethuente.c10 static PetscErrorCode Tao_mcstep(TaoLineSearch ls, PetscReal *stx, PetscReal *fx, PetscReal *dx, Pe…
12 static PetscErrorCode TaoLineSearchDestroy_MT(TaoLineSearch ls) in TaoLineSearchDestroy_MT() argument
14 TaoLineSearch_MT *mt = (TaoLineSearch_MT *)ls->data; in TaoLineSearchDestroy_MT()
19 PetscCall(PetscFree(ls->data)); in TaoLineSearchDestroy_MT()
23 static PetscErrorCode TaoLineSearchMonitor_MT(TaoLineSearch ls) in TaoLineSearchMonitor_MT() argument
25 TaoLineSearch_MT *mt = (TaoLineSearch_MT *)ls->data; in TaoLineSearchMonitor_MT()
28 …PetscCall(PetscViewerASCIIPrintf(ls->viewer, "stx: %g, fx: %g, dgx: %g\n", (double)mt->stx, (doubl… in TaoLineSearchMonitor_MT()
29 …PetscCall(PetscViewerASCIIPrintf(ls->viewer, "sty: %g, fy: %g, dgy: %g\n", (double)mt->sty, (doubl… in TaoLineSearchMonitor_MT()
33 static PetscErrorCode TaoLineSearchApply_MT(TaoLineSearch ls, Vec x, PetscReal *f, Vec g, Vec s) in TaoLineSearchApply_MT() argument
35 TaoLineSearch_MT *mt = (TaoLineSearch_MT *)ls->data; in TaoLineSearchApply_MT()
[all …]
/petsc/src/tao/linesearch/impls/armijo/
H A Darmijo.c11 static PetscErrorCode TaoLineSearchDestroy_Armijo(TaoLineSearch ls) in TaoLineSearchDestroy_Armijo() argument
13 TaoLineSearch_ARMIJO *armP = (TaoLineSearch_ARMIJO *)ls->data; in TaoLineSearchDestroy_Armijo()
19 PetscCall(PetscFree(ls->data)); in TaoLineSearchDestroy_Armijo()
23 static PetscErrorCode TaoLineSearchReset_Armijo(TaoLineSearch ls) in TaoLineSearchReset_Armijo() argument
25 TaoLineSearch_ARMIJO *armP = (TaoLineSearch_ARMIJO *)ls->data; in TaoLineSearchReset_Armijo()
33 static PetscErrorCode TaoLineSearchSetFromOptions_Armijo(TaoLineSearch ls, PetscOptionItems PetscOp… in TaoLineSearchSetFromOptions_Armijo() argument
35 TaoLineSearch_ARMIJO *armP = (TaoLineSearch_ARMIJO *)ls->data; in TaoLineSearchSetFromOptions_Armijo()
51 static PetscErrorCode TaoLineSearchView_Armijo(TaoLineSearch ls, PetscViewer pv) in TaoLineSearchView_Armijo() argument
53 TaoLineSearch_ARMIJO *armP = (TaoLineSearch_ARMIJO *)ls->data; in TaoLineSearchView_Armijo()
61 if (ls->bounded) PetscCall(PetscViewerASCIIPrintf(pv, " (projected)")); in TaoLineSearchView_Armijo()
[all …]
/petsc/src/tao/linesearch/impls/owarmijo/
H A Dowarmijo.c37 static PetscErrorCode TaoLineSearchDestroy_OWArmijo(TaoLineSearch ls) in TaoLineSearchDestroy_OWArmijo() argument
39 TaoLineSearch_OWARMIJO *armP = (TaoLineSearch_OWARMIJO *)ls->data; in TaoLineSearchDestroy_OWArmijo()
45 PetscCall(PetscFree(ls->data)); in TaoLineSearchDestroy_OWArmijo()
49 static PetscErrorCode TaoLineSearchSetFromOptions_OWArmijo(TaoLineSearch ls, PetscOptionItems Petsc… in TaoLineSearchSetFromOptions_OWArmijo() argument
51 TaoLineSearch_OWARMIJO *armP = (TaoLineSearch_OWARMIJO *)ls->data; in TaoLineSearchSetFromOptions_OWArmijo()
67 static PetscErrorCode TaoLineSearchView_OWArmijo(TaoLineSearch ls, PetscViewer pv) in TaoLineSearchView_OWArmijo() argument
69 TaoLineSearch_OWARMIJO *armP = (TaoLineSearch_OWARMIJO *)ls->data; in TaoLineSearchView_OWArmijo()
112 static PetscErrorCode TaoLineSearchApply_OWArmijo(TaoLineSearch ls, Vec x, PetscReal *f, Vec g, Vec… in TaoLineSearchApply_OWArmijo() argument
114 TaoLineSearch_OWARMIJO *armP = (TaoLineSearch_OWARMIJO *)ls->data; in TaoLineSearchApply_OWArmijo()
125 PetscCall(PetscObjectGetComm((PetscObject)ls, &comm)); in TaoLineSearchApply_OWArmijo()
[all …]
/petsc/src/tao/linesearch/interface/ftn-custom/
H A Dztaolinesearchf.c22 static PetscErrorCode ourtaolinesearchobjectiveroutine(TaoLineSearch ls, Vec x, PetscReal *f, Petsc… in ourtaolinesearchobjectiveroutine() argument
24 … *, PetscReal *, void *, PetscErrorCode *))(((PetscObject)ls)->fortran_func_pointers[OBJ]))(&ls, &… in ourtaolinesearchobjectiveroutine()
28 static PetscErrorCode ourtaolinesearchgradientroutine(TaoLineSearch ls, Vec x, Vec g, PetscCtx ctx) in ourtaolinesearchgradientroutine() argument
30 …, Vec *, Vec *, void *, PetscErrorCode *))(((PetscObject)ls)->fortran_func_pointers[GRAD]))(&ls, &… in ourtaolinesearchgradientroutine()
34 static PetscErrorCode ourtaolinesearchobjectiveandgradientroutine(TaoLineSearch ls, Vec x, PetscRea… in ourtaolinesearchobjectiveandgradientroutine() argument
36 …Real *, Vec *, void *, PetscErrorCode *))(((PetscObject)ls)->fortran_func_pointers[OBJGRAD]))(&ls,… in ourtaolinesearchobjectiveandgradientroutine()
40 static PetscErrorCode ourtaolinesearchobjectiveandgtsroutine(TaoLineSearch ls, Vec x, Vec s, PetscR… in ourtaolinesearchobjectiveandgtsroutine() argument
42 …, PetscReal *, void *, PetscErrorCode *))(((PetscObject)ls)->fortran_func_pointers[OBJGTS]))(&ls, … in ourtaolinesearchobjectiveandgtsroutine()
46 PETSC_EXTERN void taolinesearchsetobjectiveroutine_(TaoLineSearch *ls, void (*func)(TaoLineSearch *… in taolinesearchsetobjectiveroutine_() argument
48 PetscObjectAllocateFortranPointers(*ls, NFUNCS); in taolinesearchsetobjectiveroutine_()
[all …]
/petsc/src/tao/linesearch/impls/unit/
H A Dunit.c3 static PetscErrorCode TaoLineSearchView_Unit(TaoLineSearch ls, PetscViewer viewer) in TaoLineSearchView_Unit() argument
9 … PetscCall(PetscViewerASCIIPrintf(viewer, " Line Search: Unit Step %g.\n", (double)ls->initstep)); in TaoLineSearchView_Unit()
14 static PetscErrorCode TaoLineSearchApply_Unit(TaoLineSearch ls, Vec x, PetscReal *f, Vec g, Vec ste… in TaoLineSearchApply_Unit() argument
17 PetscCall(TaoLineSearchMonitor(ls, 0, *f, 0.0)); in TaoLineSearchApply_Unit()
18 ls->step = ls->initstep; in TaoLineSearchApply_Unit()
19 PetscCall(VecAXPY(x, ls->step, step_direction)); in TaoLineSearchApply_Unit()
20 PetscCall(TaoLineSearchComputeObjectiveAndGradient(ls, x, f, g)); in TaoLineSearchApply_Unit()
21 PetscCall(TaoLineSearchMonitor(ls, 1, *f, ls->step)); in TaoLineSearchApply_Unit()
22 ls->reason = TAOLINESEARCH_SUCCESS; in TaoLineSearchApply_Unit()
36 PETSC_EXTERN PetscErrorCode TaoLineSearchCreate_Unit(TaoLineSearch ls) in TaoLineSearchCreate_Unit() argument
[all …]
/petsc/include/petsc/private/
H A Dlinesearchimpl.h111 #define SNESLineSearchCheckFunctionDomainError(snes, ls, fnorm) \ argument
114 …PetscCheck(!snes->errorifnotconverged, PetscObjectComm((PetscObject)ls), PETSC_ERR_NOT_CONVERGED, …
117 …iondomainerror, &functiondomainerror, 1, MPI_C_BOOL, MPI_LOR, PetscObjectComm((PetscObject)ls))); \
119 ls->reason = SNES_LINESEARCH_FAILED_FUNCTION_DOMAIN; \
121 } else ls->reason = SNES_LINESEARCH_FAILED_NANORINF; \
193 #define SNESLineSearchCheckJacobianDomainError(snes, ls) \ argument
197 …iandomainerror, &jacobiandomainerror, 1, MPI_C_BOOL, MPI_LOR, PetscObjectComm((PetscObject)ls))); \
199 ls->reason = SNES_LINESEARCH_FAILED_JACOBIAN_DOMAIN; \
201 …PetscCheck(!snes->errorifnotconverged, PetscObjectComm((PetscObject)ls), PETSC_ERR_NOT_CONVERGED, …
/petsc/src/mat/graphops/order/
H A Dfndsep.c34 …const PetscInt *adjncy, PetscInt *mask, PetscInt *nsep, PetscInt *sep, PetscInt *xls, PetscInt *ls) in SPARSEPACKfndsep() argument
47 --ls; in SPARSEPACKfndsep()
54 PetscCall(SPARSEPACKfnroot(root, &xadj[1], &adjncy[1], &mask[1], &nlvl, &xls[1], &ls[1])); in SPARSEPACKfndsep()
61 node = ls[i]; in SPARSEPACKfndsep()
79 node = ls[i]; in SPARSEPACKfndsep()
85 node = ls[i]; in SPARSEPACKfndsep()
104 node = ls[i]; in SPARSEPACKfndsep()
H A Drootls.c24 …etscInt *xadj, const PetscInt *adjncy, PetscInt *mask, PetscInt *nlvl, PetscInt *xls, PetscInt *ls) in SPARSEPACKrootls() argument
36 --ls; in SPARSEPACKrootls()
43 ls[1] = *root; in SPARSEPACKrootls()
58 node = ls[i]; in SPARSEPACKrootls()
67 ls[ccsize] = nbr; in SPARSEPACKrootls()
81 node = ls[i]; in SPARSEPACKrootls()
H A Ddegree.c26 …Int *inxadj, const PetscInt *adjncy, PetscInt *mask, PetscInt *deg, PetscInt *ccsize, PetscInt *ls) in SPARSEPACKdegree() argument
40 --ls; in SPARSEPACKdegree()
46 ls[1] = *root; in SPARSEPACKdegree()
59 node = ls[i]; in SPARSEPACKdegree()
73 ls[*ccsize] = nbr; in SPARSEPACKdegree()
86 node = ls[i]; in SPARSEPACKdegree()
H A Dfnroot.c32 …etscInt *xadj, const PetscInt *adjncy, PetscInt *mask, PetscInt *nlvl, PetscInt *xls, PetscInt *ls) in SPARSEPACKfnroot() argument
43 --ls; in SPARSEPACKfnroot()
49 PetscCall(SPARSEPACKrootls(root, &xadj[1], &adjncy[1], &mask[1], nlvl, &xls[1], &ls[1])); in SPARSEPACKfnroot()
57 *root = ls[jstrt]; in SPARSEPACKfnroot()
61 node = ls[j]; in SPARSEPACKfnroot()
77 PetscCall(SPARSEPACKrootls(root, &xadj[1], &adjncy[1], &mask[1], &nunlvl, &xls[1], &ls[1])); in SPARSEPACKfnroot()
H A Dfn1wd.c30 …adjncy, PetscInt *mask, PetscInt *nsep, PetscInt *sep, PetscInt *nlvl, PetscInt *xls, PetscInt *ls) in SPARSEPACKfn1wd() argument
46 --ls; in SPARSEPACKfn1wd()
53 PetscCall(SPARSEPACKfnroot(root, &xadj[1], &adjncy[1], &mask[1], nlvl, &xls[1], &ls[1])); in SPARSEPACKfn1wd()
64 node = ls[i]; in SPARSEPACKfn1wd()
83 node = ls[j]; in SPARSEPACKfn1wd()
91 node = ls[j]; in SPARSEPACKfn1wd()
109 node = ls[j]; in SPARSEPACKfn1wd()
H A Dsp1wd.c9 PetscInt i, *mask, *xls, nblks, *xblk, *ls, nrow, *perm; in MatGetOrdering_1WD() local
17 PetscCall(PetscMalloc5(nrow, &mask, nrow + 1, &xls, nrow, &ls, nrow + 1, &xblk, nrow, &perm)); in MatGetOrdering_1WD()
18 PetscCall(SPARSEPACKgen1wd(&nrow, ia, ja, mask, &nblks, xblk, perm, xls, ls)); in MatGetOrdering_1WD()
25 PetscCall(PetscFree5(mask, xls, ls, xblk, perm)); in MatGetOrdering_1WD()
H A Dspnd.c9 PetscInt i, *mask, *xls, *ls, nrow, *perm; in MatGetOrdering_ND() local
21 PetscCall(PetscMalloc4(nrow, &mask, nrow, &perm, nrow + 1, &xls, nrow, &ls)); in MatGetOrdering_ND()
22 PetscCall(SPARSEPACKgennd(&nrow, ia, ja, mask, perm, xls, ls)); in MatGetOrdering_ND()
35 PetscCall(PetscFree4(mask, perm, xls, ls)); in MatGetOrdering_ND()
H A Dgen1wd.c30 …jncy, PetscInt *mask, PetscInt *nblks, PetscInt *xblk, PetscInt *perm, PetscInt *xls, PetscInt *ls) in SPARSEPACKgen1wd() argument
42 --ls; in SPARSEPACKgen1wd()
59 …SEPACKfn1wd(&root, &xadj[1], &adjncy[1], &mask[1], &nsep, &perm[num + 1], &nlvl, &xls[1], &ls[1])); in SPARSEPACKgen1wd()
69 node = ls[j]; in SPARSEPACKgen1wd()
H A Dgennd.c54 …etscInt *xadj, const PetscInt *adjncy, PetscInt *mask, PetscInt *perm, PetscInt *xls, PetscInt *ls) in SPARSEPACKgennd() argument
65 --ls; in SPARSEPACKgennd()
82 …l(SPARSEPACKfndsep(&root, &xadj[1], &adjncy[1], &mask[1], &nsep, &perm[num + 1], &xls[1], &ls[1])); in SPARSEPACKgennd()
/petsc/src/snes/linesearch/interface/
H A Dlinesearch.c32 PetscErrorCode SNESLineSearchMonitorCancel(SNESLineSearch ls) in SNESLineSearchMonitorCancel() argument
37 PetscValidHeaderSpecific(ls, SNESLINESEARCH_CLASSID, 1); in SNESLineSearchMonitorCancel()
38 for (i = 0; i < ls->numbermonitors; i++) { in SNESLineSearchMonitorCancel()
39 if (ls->monitordestroy[i]) PetscCall((*ls->monitordestroy[i])(&ls->monitorcontext[i])); in SNESLineSearchMonitorCancel()
41 ls->numbermonitors = 0; in SNESLineSearchMonitorCancel()
61 PetscErrorCode SNESLineSearchMonitor(SNESLineSearch ls) in SNESLineSearchMonitor() argument
63 PetscInt i, n = ls->numbermonitors; in SNESLineSearchMonitor()
66 for (i = 0; i < n; i++) PetscCall((*ls->monitorftns[i])(ls, ls->monitorcontext[i])); in SNESLineSearchMonitor()
99 PetscErrorCode SNESLineSearchMonitorSet(SNESLineSearch ls, PetscErrorCode (*f)(SNESLineSearch ls, P… in SNESLineSearchMonitorSet() argument
102 PetscValidHeaderSpecific(ls, SNESLINESEARCH_CLASSID, 1); in SNESLineSearchMonitorSet()
[all …]
/petsc/src/binding/petsc4py/test/
H A Dtest_snes.py455 ls = PETSc.SNESLineSearch()
456 ls.create()
457 ls.destroy()
460 ls = PETSc.SNESLineSearch().create()
461 ls.setType(PETSc.SNESLineSearch.Type.BASIC)
462 typ = ls.getType()
464 ls.destroy()
467 ls = PETSc.SNESLineSearch().create()
468 ls.setTolerances(rtol=0.125, atol=3, minstep=4, ltol=5, maxstep=6, max_its=7)
469 minstep, maxstep, rtol, atol, ltol, max_its = ls.getTolerances()
[all …]
/petsc/src/mat/impls/baij/seq/
H A Dbaijsolvtrann.c12 PetscScalar *x, *t, *ls; in MatSolveTranspose_SeqBAIJ_N_inplace() local
32 ls = a->solve_work + A->cmap->n; in MatSolveTranspose_SeqBAIJ_N_inplace()
34 PetscCall(PetscArraycpy(ls, t + i * bs, bs)); in MatSolveTranspose_SeqBAIJ_N_inplace()
35 PetscKernel_w_gets_transA_times_v(bs, ls, aa + bs2 * a->diag[i], t + i * bs); in MatSolveTranspose_SeqBAIJ_N_inplace()
78 PetscScalar *x, *t, *ls; in MatSolveTranspose_SeqBAIJ_N() local
98 ls = a->solve_work + A->cmap->n; in MatSolveTranspose_SeqBAIJ_N()
100 PetscCall(PetscArraycpy(ls, t + i * bs, bs)); in MatSolveTranspose_SeqBAIJ_N()
101 PetscKernel_w_gets_transA_times_v(bs, ls, aa + bs2 * diag[i], t + i * bs); in MatSolveTranspose_SeqBAIJ_N()
/petsc/src/dm/dt/fv/interface/
H A Dfv.c1970 PetscFV_LeastSquares *ls = (PetscFV_LeastSquares *)fvm->data; in PetscFVDestroy_LeastSquares() local
1974 PetscCall(PetscFree4(ls->B, ls->Binv, ls->tau, ls->work)); in PetscFVDestroy_LeastSquares()
1975 PetscCall(PetscFree(ls)); in PetscFVDestroy_LeastSquares()
2153 PetscFV_LeastSquares *ls = (PetscFV_LeastSquares *)fvm->data; in PetscFVComputeGradient_LeastSquares() local
2155 const PetscInt maxFaces = ls->maxFaces; in PetscFVComputeGradient_LeastSquares()
2165 for (d = 0; d < dim; ++d) ls->B[d * maxFaces + f] = dx[f * dim + d]; in PetscFVComputeGradient_LeastSquares()
2170 …quaresPseudoInverseSVD_Static(numFaces, maxFaces, dim, ls->B, ls->Binv, ls->tau, ls->workSize, ls-… in PetscFVComputeGradient_LeastSquares()
2173 for (d = 0; d < dim; ++d) grad[f * dim + d] = ls->Binv[d + maxmn * f]; in PetscFVComputeGradient_LeastSquares()
2176 …stSquaresPseudoInverse_Static(numFaces, maxFaces, dim, ls->B, ls->Binv, ls->tau, ls->workSize, ls-… in PetscFVComputeGradient_LeastSquares()
2179 for (d = 0; d < dim; ++d) grad[f * dim + d] = ls->Binv[d * maxFaces + f]; in PetscFVComputeGradient_LeastSquares()
[all …]
/petsc/src/mat/tests/
H A Dex40.c12 PetscInt i, ls, *sizes; in ISAllGatherDisjoint() local
19 PetscCall(ISGetLocalSize(iis, &ls)); in ISAllGatherDisjoint()
21 …PetscCallMPI(MPI_Allgather(&ls, 1, MPIU_INT, sizes, 1, MPIU_INT, PetscObjectComm((PetscObject)iis)… in ISAllGatherDisjoint()
24 for (i = 0, ls = 0; i < size; i++) { in ISAllGatherDisjoint()
25 PetscCall(ISCreateGeneral(PETSC_COMM_SELF, sizes[i], idxs + ls, PETSC_COPY_VALUES, &is2[i])); in ISAllGatherDisjoint()
26 ls += sizes[i]; in ISAllGatherDisjoint()
/petsc/config/BuildSystem/config/packages/
H A DMatlab.py74 ls = os.listdir(os.path.join(matlab,'extern','lib'))
75 if ls:
78 if not self.matlab_arch in ls:
79 …-with-matlab-arch='+self.matlab_arch+' but that arch does not exist;\n possibilities are '+str(ls))
82 self.matlab_arch = ls[0]
/petsc/src/tao/complementarity/impls/ssls/
H A Dssls.c23 PetscErrorCode Tao_SSLS_Function(TaoLineSearch ls, Vec X, PetscReal *fcn, void *ptr) in Tao_SSLS_Function() argument
36 PetscErrorCode Tao_SSLS_FunctionGradient(TaoLineSearch ls, Vec X, PetscReal *fcn, Vec G, void *ptr) in Tao_SSLS_FunctionGradient() argument
/petsc/src/ts/tutorials/power_grid/stability_9bus/
H A Dpetscoptions7 #-snes_type ls

123