Home
last modified time | relevance | path

Searched refs:ncols (Results 1 – 25 of 107) sorted by relevance

12345

/petsc/src/dm/tests/ !
H A Dnoflux_check.c11 PetscInt ncols; in globalKMat_3d() local
17 ncols = 0; in globalKMat_3d()
25 vals[ncols++] = -6.; //ncols=1 in globalKMat_3d()
27 col[ncols].i = i - 1; in globalKMat_3d()
28 col[ncols].j = j; in globalKMat_3d()
29 col[ncols].k = k; in globalKMat_3d()
30 vals[ncols++] = 1.; //ncols=2 in globalKMat_3d()
32 col[ncols].i = i + 1; in globalKMat_3d()
33 col[ncols].j = j; in globalKMat_3d()
34 col[ncols].k = k; in globalKMat_3d()
[all …]
/petsc/src/mat/ftn-kernels/ !
H A Dsgemv.F9010 PetscInt, intent(in) :: bs, ncols
11 MatScalar, intent(in) :: A(bs, ncols)
12 PetscScalar, intent(in) :: x(ncols)
18 do i = 1, ncols
26 PetscInt, intent(in) :: bs, ncols
27 MatScalar, intent(in) :: A(bs, ncols)
28 PetscScalar, intent(in) :: x(ncols)
33 do i = 1, ncols
41 PetscInt, intent(in) :: bs, ncols
42 MatScalar, intent(in) :: A(bs, ncols)
[all …]
/petsc/src/ksp/ksp/tutorials/ !
H A Dex46.c67 PetscInt ncols = 0; in main() local
70 col[ncols].j = j; in main()
71 col[ncols].i = i; in main()
72 v[ncols++] = 2 * (hx / hy + hy / hx); in main()
75 col[ncols].j = j; in main()
76 col[ncols].i = i - 1; in main()
77 v[ncols++] = -hy / hx; in main()
80 col[ncols].j = j; in main()
81 col[ncols].i = i + 1; in main()
82 v[ncols++] = -hy / hx; in main()
[all …]
/petsc/src/ksp/pc/impls/gamg/ !
H A Dclassical.c85 PetscInt r, c, ncols; in PCGAMGCreateGraph_Classical() local
111 PetscCall(MatGetRow(A, r, &ncols, &rcol, &rval)); in PCGAMGCreateGraph_Classical()
112 for (c = 0; c < ncols; c++) { in PCGAMGCreateGraph_Classical()
116 if (ncols > cmax) cmax = ncols; in PCGAMGCreateGraph_Classical()
120 for (c = 0; c < ncols; c++) { in PCGAMGCreateGraph_Classical()
129 PetscCall(MatRestoreRow(A, r, &ncols, &rcol, &rval)); in PCGAMGCreateGraph_Classical()
142 PetscCall(MatGetRow(A, r, &ncols, &rcol, &rval)); in PCGAMGCreateGraph_Classical()
144 for (c = 0; c < ncols; c++) { in PCGAMGCreateGraph_Classical()
153 PetscCall(MatRestoreRow(A, r, &ncols, &rcol, &rval)); in PCGAMGCreateGraph_Classical()
190 PetscInt fn, cn, fs, fe, cs, ce, i, j, ncols, col, row_f, row_c, cmax = 0, idx, noff; in PCGAMGProlongator_Classical_Direct() local
[all …]
/petsc/src/mat/utils/ !
H A Daxpy.c165 PetscInt ncols; in MatAXPY_Basic_Preallocate() local
169 PetscCall(MatGetRow(Y, r, &ncols, &row, &vals)); in MatAXPY_Basic_Preallocate()
170 PetscCall(MatSetValues(preallocator, 1, &r, ncols, row, vals, INSERT_VALUES)); in MatAXPY_Basic_Preallocate()
171 PetscCall(MatRestoreRow(Y, r, &ncols, &row, &vals)); in MatAXPY_Basic_Preallocate()
172 PetscCall(MatGetRow(X, r, &ncols, &row, &vals)); in MatAXPY_Basic_Preallocate()
173 PetscCall(MatSetValues(preallocator, 1, &r, ncols, row, vals, INSERT_VALUES)); in MatAXPY_Basic_Preallocate()
174 PetscCall(MatRestoreRow(X, r, &ncols, &row, &vals)); in MatAXPY_Basic_Preallocate()
202 PetscInt i, start, end, j, ncols, m, n; in MatAXPY_Basic() local
213 PetscCall(MatGetRow(X, i, &ncols, &row, &vals)); in MatAXPY_Basic()
214 PetscCall(MatSetValues(Y, 1, &i, ncols, row, vals, ADD_VALUES)); in MatAXPY_Basic()
[all …]
H A Dbandwidth.c32 PetscInt ncols; in MatComputeBandwidth() local
34 PetscCall(MatGetRow(A, r, &ncols, &cols, NULL)); in MatComputeBandwidth()
35 if (ncols) { in MatComputeBandwidth()
37 lbw[1] = PetscMax(lbw[1], cols[ncols - 1] - r); in MatComputeBandwidth()
39 PetscCall(MatRestoreRow(A, r, &ncols, &cols, NULL)); in MatComputeBandwidth()
/petsc/src/mat/tests/ !
H A Dex39.c9 PetscInt i, j, m = 5, n, nrows, ncols; in main() local
34 PetscCall(ISGetLocalSize(iscols, &ncols)); in main()
36 PetscCall(PetscMalloc1(nrows * ncols, &v)); in main()
43 for (j = 0; j < ncols; j++) { in main()
45 v[i * ncols + j] = rval; in main()
51 …for (j = 0; j < ncols; j++) v[i * ncols + j] = (PetscReal)(10000 * rank + 100 * rows[i] + cols[j]); in main()
54 PetscCall(MatSetValues(C, nrows, rows, ncols, cols, v, INSERT_VALUES)); in main()
111 PetscCall(ISGetLocalSize(iscols, &ncols)); in main()
114 for (j = 0; j < ncols; j++) v[i * ncols + j] = (PetscReal)(1000 * rows[i] + cols[j]); in main()
116 PetscCall(MatSetValues(B, nrows, rows, ncols, cols, v, INSERT_VALUES)); in main()
H A Dex103.c15 PetscInt i, j, M = 10, N = 5, nrows, ncols; in main() local
41 PetscCall(ISGetLocalSize(iscols, &ncols)); in main()
43 PetscCall(PetscMalloc1(nrows * ncols, &v)); in main()
46 for (j = 0; j < ncols; j++) { in main()
48 v[i * ncols + j] = (PetscScalar)(i + j); in main()
50 v[i * ncols + j] = (PetscScalar)rank + j * 0.1; in main()
54 PetscCall(MatSetValues(A, nrows, rows, ncols, cols, v, INSERT_VALUES)); in main()
H A Dex243.c8 PetscInt i, j, M = 10, N = 5, nloc, mloc, nrows, ncols; in main() local
38 PetscCall(ISGetLocalSize(iscols, &ncols)); in main()
40 PetscCall(PetscMalloc1(nrows * ncols, &v)); in main()
43 for (j = 0; j < ncols; j++) { in main()
45 v[i * ncols + j] = (PetscScalar)(i + j); in main()
47 v[i * ncols + j] = (PetscScalar)rank + j * 0.1; in main()
51 PetscCall(MatSetValues(A, nrows, rows, ncols, cols, v, INSERT_VALUES)); in main()
H A Dex245.c9 PetscInt m = 5, n, p, i, j, nrows, ncols; in main() local
45 PetscCall(ISGetLocalSize(iscols, &ncols)); in main()
47 PetscCall(PetscMalloc1(nrows * ncols, &v)); in main()
49 for (j = 0; j < ncols; j++) { in main()
51 v[i * ncols + j] = rval; in main()
54 PetscCall(MatSetValues(A, nrows, rows, ncols, cols, v, INSERT_VALUES)); in main()
63 …_FMT ", m %" PetscInt_FMT "; ncols %" PetscInt_FMT ", n %" PetscInt_FMT "\n", nrows, m, ncols, n)); in main()
77 PetscCall(ISGetLocalSize(iscols, &ncols)); in main()
79 PetscCall(PetscMalloc1(nrows * ncols, &v)); in main()
81 for (j = 0; j < ncols; j++) { in main()
[all …]
H A Dex145.c9 PetscInt m = 5, n, p, i, j, nrows, ncols; in main() local
46 PetscCall(ISGetLocalSize(iscols, &ncols)); in main()
48 PetscCall(PetscMalloc1(nrows * ncols, &v)); in main()
50 for (j = 0; j < ncols; j++) { in main()
52 v[i * ncols + j] = rval; in main()
55 PetscCall(MatSetValues(A, nrows, rows, ncols, cols, v, INSERT_VALUES)); in main()
64 …_FMT ", m %" PetscInt_FMT "; ncols %" PetscInt_FMT ", n %" PetscInt_FMT "\n", nrows, m, ncols, n)); in main()
78 PetscCall(ISGetLocalSize(iscols, &ncols)); in main()
80 PetscCall(PetscMalloc1(nrows * ncols, &v)); in main()
82 for (j = 0; j < ncols; j++) { in main()
[all …]
H A Dex242.c9 PetscInt i, j, M = 5, N, mb = 2, nb, nrows, ncols, mloc, nloc; in main() local
44 PetscCall(ISGetLocalSize(iscols, &ncols)); in main()
46 PetscCall(PetscMalloc1(nrows * ncols, &v)); in main()
48 for (j = 0; j < ncols; j++) v[i * ncols + j] = (PetscReal)(rows[i] + 1 + (cols[j] + 1) * 0.01); in main()
50 PetscCall(MatSetValues(C, nrows, rows, ncols, cols, v, INSERT_VALUES)); in main()
109 PetscCall(ISGetLocalSize(iscols, &ncols)); in main()
111 PetscCall(PetscMalloc1(nrows * ncols, &v)); in main()
113 for (j = 0; j < ncols; j++) v[i * ncols + j] = (PetscReal)(1000 * rows[i] + cols[j]); in main()
115 PetscCall(MatSetValues(B, nrows, rows, ncols, cols, v, INSERT_VALUES)); in main()
H A Dex38.c8 PetscInt i, j, m = 5, n, nrows, ncols; in main() local
52 PetscCall(ISGetLocalSize(iscols, &ncols)); in main()
54 PetscCall(PetscMalloc1(nrows * ncols, &v)); in main()
56 for (j = 0; j < ncols; j++) { in main()
58 v[i * ncols + j] = (PetscReal)(rank * 10000 + 100 * rows[i] + cols[j]); in main()
61 PetscCall(MatSetValues(C, nrows, rows, ncols, cols, v, INSERT_VALUES)); in main()
H A Dex73.c135 PetscInt rstart, i, *nzd, *nzo, nzl, nzmax = 0, *ncols, nrow, j; in main() local
160 PetscCall(PetscMalloc2(nzmax, &ncols, nzmax, &nvals)); in main()
165 ncols[2 * j] = 2 * cols[j]; in main()
166 ncols[2 * j + 1] = 2 * cols[j] + 1; in main()
169 PetscCall(MatSetValues(J, 1, &nrow, 2 * nzl, ncols, nvals, INSERT_VALUES)); in main()
171 PetscCall(MatSetValues(J, 1, &nrow, 2 * nzl, ncols, nvals, INSERT_VALUES)); in main()
181 PetscCall(PetscFree2(ncols, nvals)); in main()
H A Dex211.c11 PetscInt ncols, isstart, *idx, m, rstart, count; in ISGetSeqIS_SameColDist_Private() local
23 PetscCall(ISGetLocalSize(iscol, &ncols)); in ISGetSeqIS_SameColDist_Private()
34 PetscCallMPI(MPI_Scan(&ncols, &isstart, 1, MPIU_INT, MPI_SUM, comm)); in ISGetSeqIS_SameColDist_Private()
35 isstart -= ncols; in ISGetSeqIS_SameColDist_Private()
41 PetscCall(PetscMalloc1(ncols, &idx)); in ISGetSeqIS_SameColDist_Private()
42 for (i = 0; i < ncols; i++) { in ISGetSeqIS_SameColDist_Private()
52 PetscCall(ISCreateGeneral(PETSC_COMM_SELF, ncols, idx, PETSC_OWN_POINTER, iscol_d)); in ISGetSeqIS_SameColDist_Private()
/petsc/src/ksp/pc/impls/kaczmarz/ !
H A Dkaczmarz.c18 PetscInt xs, xe, ys, ye, ncols, i, j; in PCApply_Kaczmarz() local
34 PetscCall(MatGetRow(pc->pmat, i, &ncols, &cols, &vals)); in PCApply_Kaczmarz()
37 for (j = 0; j < ncols; j++) { in PCApply_Kaczmarz()
42 for (j = 0; j < ncols; j++) { in PCApply_Kaczmarz()
46 PetscCall(MatRestoreRow(pc->pmat, i, &ncols, &cols, &vals)); in PCApply_Kaczmarz()
50 PetscCall(MatGetRow(pc->pmat, i, &ncols, &cols, &vals)); in PCApply_Kaczmarz()
53 for (j = 0; j < ncols; j++) { in PCApply_Kaczmarz()
58 for (j = 0; j < ncols; j++) { in PCApply_Kaczmarz()
62 PetscCall(MatRestoreRow(pc->pmat, i, &ncols, &cols, &vals)); in PCApply_Kaczmarz()
/petsc/src/mat/graphops/color/impls/greedy/ !
H A Dgreedy.c19 …PetscInt i, j, k, s, e, n, no, nd, nd_global, n_global, idx, ncols, maxcolors, masksize, cc… in GreedyColoringLocalDistanceOne_Private() local
94 ncols = md_i[idx + 1] - md_i[idx]; in GreedyColoringLocalDistanceOne_Private()
96 for (j = 0; j < ncols; j++) { in GreedyColoringLocalDistanceOne_Private()
112 ncols = mo_i[idx + 1] - mo_i[idx]; in GreedyColoringLocalDistanceOne_Private()
114 for (j = 0; j < ncols; j++) { in GreedyColoringLocalDistanceOne_Private()
146 ncols = mo_i[i + 1] - mo_i[i]; in GreedyColoringLocalDistanceOne_Private()
148 for (j = 0; j < ncols; j++) { in GreedyColoringLocalDistanceOne_Private()
173 …PetscInt i, j, k, l, s, e, n, nd, nd_global, n_global, idx, ncols, maxcolors, mcol, mcol_g… in GreedyColoringLocalDistanceTwo_Private() local
295 ncols = rmd_i[idx + 1] - rmd_i[idx]; in GreedyColoringLocalDistanceTwo_Private()
297 for (j = 0; j < ncols; j++) { in GreedyColoringLocalDistanceTwo_Private()
[all …]
/petsc/src/mat/graphops/color/utils/ !
H A Dweights.c44 PetscInt ncols; in MatColoringGetDegrees() local
70 ncols = Gi[i + 1] - Gi[i]; in MatColoringGetDegrees()
74 for (j = 0; j < ncols; j++) { in MatColoringGetDegrees()
87 ncols = Gi[idx + 1] - Gi[idx]; in MatColoringGetDegrees()
89 for (j = 0; j < ncols; j++) { in MatColoringGetDegrees()
110 PetscInt i, s, e, n, ncols; in MatColoringCreateLargestFirstWeights() local
125 PetscCall(MatGetRow(G, i, &ncols, NULL, NULL)); in MatColoringCreateLargestFirstWeights()
127 weights[i - s] = ncols + PetscAbsReal(r); in MatColoringCreateLargestFirstWeights()
128 PetscCall(MatRestoreRow(G, i, &ncols, NULL, NULL)); in MatColoringCreateLargestFirstWeights()
145 PetscInt ncols, nxt, prv, cur; in MatColoringCreateSmallestLastWeights() local
[all …]
H A Dvalid.c11 PetscInt ncolors, nrows, ncols; in MatColoringTest() local
28 PetscCall(PetscSFGetGraph(etoc, &ncols, &nleafcols, NULL, NULL)); in MatColoringTest()
30 PetscCall(PetscMalloc1(ncols, &statecol)); in MatColoringTest()
37 for (k = 0; k < ncols; k++) statecol[k] = -1; in MatColoringTest()
67 for (i = 0; i < ncols; i++) nentries += degrees[i]; in MatColoringTest()
69 for (i = 0; i < ncols; i++) { in MatColoringTest()
/petsc/src/dm/impls/stag/tests/ !
H A Dex40.c623 PetscInt ncols = 0; in FormFunction2D() local
626 col[ncols].c = c; in FormFunction2D()
627 col[ncols].loc = DMSTAG_DOWN_LEFT; in FormFunction2D()
628 ++ncols; in FormFunction2D()
631 col[ncols].c = c; in FormFunction2D()
632 col[ncols].loc = DMSTAG_LEFT; in FormFunction2D()
633 ++ncols; in FormFunction2D()
636 col[ncols].c = c; in FormFunction2D()
637 col[ncols].loc = DMSTAG_DOWN; in FormFunction2D()
638 ++ncols; in FormFunction2D()
[all …]
/petsc/src/mat/graphops/color/impls/jp/ !
H A Djp.c42 PetscInt ncols; in MCJPGreatestWeight_Private() local
102 ncols = di[i + 1] - di[i]; in MCJPGreatestWeight_Private()
104 for (j = 0; j < ncols; j++) { in MCJPGreatestWeight_Private()
109 ncols = oi[i + 1] - oi[i]; in MCJPGreatestWeight_Private()
111 for (j = 0; j < ncols; j++) { in MCJPGreatestWeight_Private()
138 PetscInt ncols; in MCJPInitialLocalColor_Private() local
189 ncols = di[i + 1] - di[i]; in MCJPInitialLocalColor_Private()
191 for (j = 0; j < ncols; j++) { in MCJPInitialLocalColor_Private()
206 ncols = di[idx + 1] - di[idx]; in MCJPInitialLocalColor_Private()
208 for (j = 0; j < ncols; j++) { in MCJPInitialLocalColor_Private()
[all …]
/petsc/src/mat/graphops/order/ !
H A Dspectral.c38 PetscInt ncols, newcols, c; in MatCreateLaplacian() local
42 PetscCall(MatGetRow(A, r, &ncols, &cols, &vals)); in MatCreateLaplacian()
43 for (c = 0, newcols = 0; c < ncols; ++c) { in MatCreateLaplacian()
59 PetscCall(MatRestoreRow(A, r, &ncols, &cols, &vals)); in MatCreateLaplacian()
68 PetscInt ncols, newcols, c; in MatCreateLaplacian() local
71 PetscCall(MatGetRow(A, r, &ncols, &cols, &vals)); in MatCreateLaplacian()
72 for (c = 0, newcols = 0; c < ncols; ++c) { in MatCreateLaplacian()
90 PetscCall(MatRestoreRow(A, r, &ncols, &cols, &vals)); in MatCreateLaplacian()
/petsc/include/petsc/private/kernels/ !
H A Dblockinvert.h184 #define PetscKernel_w_gets_w_plus_Ar_times_v(bs, ncols, v, A, w) \ argument
189 PetscCall(PetscBLASIntCast(ncols, &_bncols)); \
203 #define PetscKernel_w_gets_w_minus_Ar_times_v(bs, ncols, w, A, v) \ argument
208 PetscCall(PetscBLASIntCast(ncols, &_bncols)); \
254 #define PetscKernel_w_gets_Ar_times_v(bs, ncols, x, A, z) \ argument
259 PetscCall(PetscBLASIntCast(ncols, &_bncols)); \
269 #define PetscKernel_w_gets_w_plus_trans_Ar_times_v(bs, ncols, x, A, z) \ argument
274 PetscCall(PetscBLASIntCast(ncols, &_bncols)); \
378 …#define PetscKernel_w_gets_Ar_times_v(bs, ncols, x, A, z) msgemv_(&(bs), &(ncols), (A… argument
383 …#define PetscKernel_w_gets_w_plus_trans_Ar_times_v(bs, ncols, x, A, z) msgemvt_(&(bs), &(ncols), (… argument
/petsc/src/mat/tutorials/ !
H A Dex16.c16 PetscInt row, ncols, j, nrows, nnzA = 0, nnzAsp = 0; in main() local
64 PetscCall(MatGetRow(A, row, &ncols, &cols, &vals)); in main()
65 nnzA += ncols; in main()
67 for (j = 0; j < ncols; j++) { in main()
76 PetscCall(MatRestoreRow(A, row, &ncols, &cols, &vals)); in main()
/petsc/src/mat/impls/aij/seq/bas/ !
H A Dspbas.c250 …ss_pattern(PetscInt *irow_in, PetscInt *icol_in, PetscInt nrows, PetscInt ncols, PetscInt col_idx_… in spbas_compress_pattern() argument
267 B->ncols = ncols; in spbas_compress_pattern()
437 PetscInt ncols = in_matrix.nrows; in spbas_transpose() local
438 PetscInt nrows = in_matrix.ncols; in spbas_transpose()
448 result->ncols = ncols; in spbas_transpose()
459 for (i = 0; i < ncols; i++) { in spbas_transpose()
480 for (i = 0; i < ncols; i++) { in spbas_transpose()
496 for (i = 0; i < ncols; i++) { in spbas_transpose()
703 PetscErrorCode spbas_pattern_only(PetscInt nrows, PetscInt ncols, PetscInt *ai, PetscInt *aj, spbas… in spbas_pattern_only() argument
711 retval.ncols = ncols; in spbas_pattern_only()
[all …]

12345