Lines Matching refs:m
99 static int CeedHouseholderReflect(CeedScalar *A, const CeedScalar *v, CeedScalar b, CeedInt m, Ceed… in CeedHouseholderReflect() argument
103 for (CeedInt i = 1; i < m; i++) w += v[i] * A[i * row + j * col]; in CeedHouseholderReflect()
105 for (CeedInt i = 1; i < m; i++) A[i * row + j * col] -= b * w * v[i]; in CeedHouseholderReflect()
129 …CeedScalar c, CeedScalar s, CeedTransposeMode t_mode, CeedInt i, CeedInt k, CeedInt m, CeedInt n) { in CeedGivensRotation() argument
130 CeedInt stride_j = 1, stride_ik = m, num_its = n; in CeedGivensRotation()
135 num_its = m; in CeedGivensRotation()
163 static int CeedScalarView(const char *name, const char *fp_fmt, CeedInt m, CeedInt n, const CeedSca… in CeedScalarView() argument
164 if (m > 1) { in CeedScalarView()
172 for (CeedInt i = 0; i < m; i++) { in CeedScalarView()
173 if (m > 1) fprintf(stream, "%s [%" CeedInt_FMT "]", tabs, i); in CeedScalarView()
304 for (CeedInt m = 1; m < num_matrices; m++) { in CeedBasisCreateProjectionMatrices() local
305 input_from[m] = (CeedScalar *)&grad_from_source[(m - 1) * Q * P_from]; in CeedBasisCreateProjectionMatrices()
306 output_project[m] = &((*grad_project)[(m - 1) * P_to * P_from]); in CeedBasisCreateProjectionMatrices()
308 for (CeedInt m = 0; m < num_matrices; m++) { in CeedBasisCreateProjectionMatrices() local
310 memcpy(interp_from, input_from[m], Q * P_from * q_comp * sizeof(input_from[m][0])); in CeedBasisCreateProjectionMatrices()
311 …Multiply(CeedBasisReturnCeed(basis_to), interp_to_inv, input_from[m], output_project[m], P_to, P_f… in CeedBasisCreateProjectionMatrices()
314 if (fabs(output_project[m][i]) < 10 * CEED_EPSILON) output_project[m][i] = 0.0; in CeedBasisCreateProjectionMatrices()
1146 …onst CeedScalar *mat_A, const CeedScalar *mat_B, CeedScalar *mat_C, CeedInt m, CeedInt n, CeedInt … in CeedMatrixMatrixMultiply() argument
1147 for (CeedInt i = 0; i < m; i++) { in CeedMatrixMatrixMultiply()
1171 int CeedQRFactorization(Ceed ceed, CeedScalar *mat, CeedScalar *tau, CeedInt m, CeedInt n) { in CeedQRFactorization() argument
1172 CeedScalar v[m]; in CeedQRFactorization()
1175 CeedCheck(n <= m, ceed, CEED_ERROR_UNSUPPORTED, "Cannot compute QR factorization with n > m"); in CeedQRFactorization()
1180 if (i >= m - 1) { // last row of matrix, no reflection needed in CeedQRFactorization()
1186 for (CeedInt j = i + 1; j < m; j++) { in CeedQRFactorization()
1198 for (CeedInt j = i + 1; j < m; j++) v[j] /= v[i]; in CeedQRFactorization()
1201 CeedHouseholderReflect(&mat[i * n + i + 1], &v[i], tau[i], m - i, n - i - 1, n, 1); in CeedQRFactorization()
1204 for (CeedInt j = i + 1; j < m; j++) mat[i + n * j] = v[j]; in CeedQRFactorization()
1228 …_A, const CeedScalar *mat_Q, const CeedScalar *tau, CeedTransposeMode t_mode, CeedInt m, CeedInt n, in CeedHouseholderApplyQ() argument
1232 CeedCall(CeedMalloc(m, &v)); in CeedHouseholderApplyQ()
1235 for (CeedInt j = i + 1; j < m; j++) v[j] = mat_Q[j * k + i]; in CeedHouseholderApplyQ()
1237 CeedCall(CeedHouseholderReflect(&mat_A[i * row], &v[i], tau[i], m - i, n, row, col)); in CeedHouseholderApplyQ()
1256 int CeedMatrixPseudoinverse(Ceed ceed, const CeedScalar *mat, CeedInt m, CeedInt n, CeedScalar *mat… in CeedMatrixPseudoinverse() argument
1259 CeedCall(CeedCalloc(m, &tau)); in CeedMatrixPseudoinverse()
1260 CeedCall(CeedCalloc(m * m, &I)); in CeedMatrixPseudoinverse()
1261 CeedCall(CeedCalloc(m * n, &mat_copy)); in CeedMatrixPseudoinverse()
1262 memcpy(mat_copy, mat, m * n * sizeof mat[0]); in CeedMatrixPseudoinverse()
1265 CeedCall(CeedQRFactorization(ceed, mat_copy, tau, m, n)); in CeedMatrixPseudoinverse()
1268 for (CeedInt i = 0; i < m; i++) I[i * m + i] = 1.0; in CeedMatrixPseudoinverse()
1269 CeedCall(CeedHouseholderApplyQ(I, mat_copy, tau, CEED_TRANSPOSE, m, m, n, m, 1)); in CeedMatrixPseudoinverse()
1271 for (CeedInt j = 0; j < m; j++) { // Column j in CeedMatrixPseudoinverse()
1272 mat_pinv[j + m * (n - 1)] = I[j + m * (n - 1)] / mat_copy[n * n - 1]; in CeedMatrixPseudoinverse()
1274 mat_pinv[j + m * i] = I[j + m * i]; in CeedMatrixPseudoinverse()
1275 …for (CeedInt k = i + 1; k < n; k++) mat_pinv[j + m * i] -= mat_copy[k + n * i] * mat_pinv[j + m * … in CeedMatrixPseudoinverse()
1276 mat_pinv[j + m * i] /= mat_copy[i + n * i]; in CeedMatrixPseudoinverse()