Lines Matching refs:A

1 static PetscErrorCode MatCopyHashToXAIJ_Seq_Hash(Mat A, Mat B)  in MatCopyHashToXAIJ_Seq_Hash()  argument
3 PetscConcat(Mat_Seq, TYPE) *a = (PetscConcat(Mat_Seq, TYPE) *)A->data; in MatCopyHashToXAIJ_Seq_Hash()
14 PetscCall(MatGetBlockSize(A, &bs)); in MatCopyHashToXAIJ_Seq_Hash()
15 if (bs > 1 && A == B) PetscCall(PetscHSetIJDestroy(&a->bht)); in MatCopyHashToXAIJ_Seq_Hash()
17 if (A == B) { in MatCopyHashToXAIJ_Seq_Hash()
18 A->preallocated = PETSC_FALSE; /* this was set to true for the MatSetValues_Hash() to work */ in MatCopyHashToXAIJ_Seq_Hash()
20 A->ops[0] = a->cops; in MatCopyHashToXAIJ_Seq_Hash()
21 A->hash_active = PETSC_FALSE; in MatCopyHashToXAIJ_Seq_Hash()
25 PetscCall(MatGetSize(A, &m, NULL)); in MatCopyHashToXAIJ_Seq_Hash()
47 if (A == B) PetscCall(PetscHMapIJVDestroy(&a->ht)); in MatCopyHashToXAIJ_Seq_Hash()
54 if (A == B) PetscCall(PetscFree(a->dnz)); in MatCopyHashToXAIJ_Seq_Hash()
56 if (bs > 1 && A == B) PetscCall(PetscFree(a->bdnz)); in MatCopyHashToXAIJ_Seq_Hash()
70 static PetscErrorCode MatAssemblyEnd_Seq_Hash(Mat A, MatAssemblyType type) in MatAssemblyEnd_Seq_Hash() argument
73 PetscCall(MatCopyHashToXAIJ(A, A)); in MatAssemblyEnd_Seq_Hash()
77 static PetscErrorCode MatDestroy_Seq_Hash(Mat A) in MatDestroy_Seq_Hash() argument
79 PetscConcat(Mat_Seq, TYPE) *a = (PetscConcat(Mat_Seq, TYPE) *)A->data; in MatDestroy_Seq_Hash()
88 PetscCall(MatGetBlockSize(A, &bs)); in MatDestroy_Seq_Hash()
94 PetscCall((*a->cops.destroy)(A)); in MatDestroy_Seq_Hash()
98 static PetscErrorCode MatZeroEntries_Seq_Hash(Mat A) in MatZeroEntries_Seq_Hash() argument
104 static PetscErrorCode MatSetRandom_Seq_Hash(Mat A, PetscRandom r) in MatSetRandom_Seq_Hash() argument
107 …SETERRQ(PetscObjectComm((PetscObject)A), PETSC_ERR_ARG_WRONGSTATE, "Must set preallocation first"); in MatSetRandom_Seq_Hash()
111 static PetscErrorCode MatSetUp_Seq_Hash(Mat A) in MatSetUp_Seq_Hash() argument
113 PetscConcat(Mat_Seq, TYPE) *a = (PetscConcat(Mat_Seq, TYPE) *)A->data; in MatSetUp_Seq_Hash()
120 …PetscCall(PetscInfo(A, "Using hash-based MatSetValues() for MATSEQ" PetscStringize(TYPE) " because… in MatSetUp_Seq_Hash()
121 PetscCall(PetscLayoutSetUp(A->rmap)); in MatSetUp_Seq_Hash()
122 PetscCall(PetscLayoutSetUp(A->cmap)); in MatSetUp_Seq_Hash()
123 if (A->rmap->bs < 1) A->rmap->bs = 1; in MatSetUp_Seq_Hash()
124 if (A->cmap->bs < 1) A->cmap->bs = 1; in MatSetUp_Seq_Hash()
126 PetscCall(MatGetLocalSize(A, &m, NULL)); in MatSetUp_Seq_Hash()
130 PetscCall(MatGetBlockSize(A, &bs)); in MatSetUp_Seq_Hash()
138 a->cops = A->ops[0]; in MatSetUp_Seq_Hash()
139 A->ops->assemblybegin = NULL; in MatSetUp_Seq_Hash()
140 A->ops->assemblyend = MatAssemblyEnd_Seq_Hash; in MatSetUp_Seq_Hash()
141 A->ops->destroy = MatDestroy_Seq_Hash; in MatSetUp_Seq_Hash()
142 A->ops->zeroentries = MatZeroEntries_Seq_Hash; in MatSetUp_Seq_Hash()
143 A->ops->setrandom = MatSetRandom_Seq_Hash; in MatSetUp_Seq_Hash()
144 A->ops->copyhashtoxaij = MatCopyHashToXAIJ_Seq_Hash; in MatSetUp_Seq_Hash()
146 if (bs > 1) A->ops->setvalues = MatSetValues_Seq_Hash_BS; in MatSetUp_Seq_Hash()
149 A->ops->setvalues = MatSetValues_Seq_Hash; in MatSetUp_Seq_Hash()
150 A->ops->setvaluesblocked = NULL; in MatSetUp_Seq_Hash()
152 A->preallocated = PETSC_TRUE; in MatSetUp_Seq_Hash()
153 A->hash_active = PETSC_TRUE; in MatSetUp_Seq_Hash()