Lines Matching refs:next
9 Mat_CompositeLink next, prev; member
34 Mat_CompositeLink next, oldnext; in MatDestroy_Composite() local
39 next = shell->head; in MatDestroy_Composite()
40 while (next) { in MatDestroy_Composite()
41 PetscCall(MatDestroy(&next->mat)); in MatDestroy_Composite()
42 …if (next->work && (!next->next || next->work != next->next->work)) PetscCall(VecDestroy(&next->wor… in MatDestroy_Composite()
43 oldnext = next; in MatDestroy_Composite()
44 next = next->next; in MatDestroy_Composite()
76 Mat_CompositeLink next; in MatMult_Composite_Multiplicative() local
81 next = shell->head; in MatMult_Composite_Multiplicative()
82 …PetscCheck(next, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONGSTATE, "Must provide at least one matrix with… in MatMult_Composite_Multiplicative()
83 while (next->next) { in MatMult_Composite_Multiplicative()
84 if (!next->work) { /* should reuse previous work if the same size */ in MatMult_Composite_Multiplicative()
85 PetscCall(MatCreateVecs(next->mat, NULL, &next->work)); in MatMult_Composite_Multiplicative()
87 out = next->work; in MatMult_Composite_Multiplicative()
88 PetscCall(MatMult(next->mat, x, out)); in MatMult_Composite_Multiplicative()
90 next = next->next; in MatMult_Composite_Multiplicative()
92 PetscCall(MatMult(next->mat, x, y)); in MatMult_Composite_Multiplicative()
152 for (cur = shell->head; cur; cur = cur->next) { in MatMult_Composite()
162 for (cur = shell->head; cur; cur = cur->next) { in MatMult_Composite()
174 for (cur = shell->head; cur; cur = cur->next) { in MatMult_Composite()
204 for (cur = shell->head, j = 0; cur; cur = cur->next, j++) { /* j-th matrix */ in MatMult_Composite()
251 for (cur = shell->head, tot = i = 0; cur; cur = cur->next, i++) { /* i-th matrix */ in MatMult_Composite()
263 for (cur = shell->head, i = 0; cur; cur = cur->next, i++) { in MatMult_Composite()
268 for (cur = shell->head; cur; cur = cur->next) PetscCall(MatMultAdd(cur->mat, x, y, y)); in MatMult_Composite()
277 Mat_CompositeLink next; in MatMultTranspose_Composite() local
283 next = shell->head; in MatMultTranspose_Composite()
284 …PetscCheck(next, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONGSTATE, "Must provide at least one matrix with… in MatMultTranspose_Composite()
286 PetscCall(MatMultTranspose(next->mat, x, y)); in MatMultTranspose_Composite()
293 while ((next = next->next)) { in MatMultTranspose_Composite()
294 if (!shell->scalings) PetscCall(MatMultTransposeAdd(next->mat, x, y, y)); in MatMultTranspose_Composite()
296 PetscCall(MatMultTranspose(next->mat, x, y2)); in MatMultTranspose_Composite()
306 Mat_CompositeLink next; in MatGetDiagonal_Composite() local
311 next = shell->head; in MatGetDiagonal_Composite()
312 …PetscCheck(next, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONGSTATE, "Must provide at least one matrix with… in MatGetDiagonal_Composite()
313 PetscCall(MatGetDiagonal(next->mat, v)); in MatGetDiagonal_Composite()
316 if (next->next && !shell->work) PetscCall(VecDuplicate(v, &shell->work)); in MatGetDiagonal_Composite()
318 while ((next = next->next)) { in MatGetDiagonal_Composite()
319 PetscCall(MatGetDiagonal(next->mat, shell->work)); in MatGetDiagonal_Composite()
404 Mat_CompositeLink ilink, next; in MatCompositeAddMat_Composite() local
410 next = shell->head; in MatCompositeAddMat_Composite()
412 ilink->next = NULL; in MatCompositeAddMat_Composite()
416 if (!next) shell->head = ilink; in MatCompositeAddMat_Composite()
418 while (next->next) next = next->next; in MatCompositeAddMat_Composite()
419 next->next = ilink; in MatCompositeAddMat_Composite()
420 ilink->prev = next; in MatCompositeAddMat_Composite()
655 Mat_CompositeLink next, prev; in MatCompositeMerge_Composite() local
663 next = shell->head; in MatCompositeMerge_Composite()
665 …PetscCheck(next, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONGSTATE, "Must provide at least one matrix with… in MatCompositeMerge_Composite()
670 PetscCall(MatDuplicate(next->mat, MAT_COPY_VALUES, &tmat)); in MatCompositeMerge_Composite()
672 …while ((next = next->next)) PetscCall(MatAXPY(tmat, shell->scalings ? shell->scalings[i++] : 1.0, … in MatCompositeMerge_Composite()
681 PetscCall(MatDuplicate(next->mat, MAT_COPY_VALUES, &tmat)); in MatCompositeMerge_Composite()
682 while ((next = next->next)) { in MatCompositeMerge_Composite()
683 PetscCall(MatMatMult(next->mat, tmat, MAT_INITIAL_MATRIX, PETSC_DETERMINE, &newmat)); in MatCompositeMerge_Composite()
790 for (k = 0; k < i; k++) ilink = ilink->next; in MatCompositeGetMat_Composite()