Skip to content

Commit

Permalink
Merge pull request #2037 from fredrik-johansson/matmul
Browse files Browse the repository at this point in the history
Matrix multiplication for nfloat_complex
  • Loading branch information
fredrik-johansson authored Jul 19, 2024
2 parents 886c317 + 60d5397 commit 91f0ece
Show file tree
Hide file tree
Showing 7 changed files with 952 additions and 33 deletions.
6 changes: 5 additions & 1 deletion doc/source/nfloat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -412,4 +412,8 @@ real pairs.
int _nfloat_complex_vec_set(nfloat_complex_ptr res, nfloat_complex_srcptr x, slong len, gr_ctx_t ctx)
int _nfloat_complex_vec_add(nfloat_complex_ptr res, nfloat_complex_srcptr x, nfloat_complex_srcptr y, slong len, gr_ctx_t ctx)
int _nfloat_complex_vec_sub(nfloat_complex_ptr res, nfloat_complex_srcptr x, nfloat_complex_srcptr y, slong len, gr_ctx_t ctx)

int nfloat_complex_mat_mul_fixed_classical(gr_mat_t C, const gr_mat_t A, const gr_mat_t B, gr_ctx_t ctx)
int nfloat_complex_mat_mul_waksman(gr_mat_t C, const gr_mat_t A, const gr_mat_t B, gr_ctx_t ctx)
int nfloat_complex_mat_mul_block(gr_mat_t C, const gr_mat_t A, const gr_mat_t B, slong min_block_size, gr_ctx_t ctx)
int nfloat_complex_mat_mul_reorder(gr_mat_t C, const gr_mat_t A, const gr_mat_t B, gr_ctx_t ctx)
int nfloat_complex_mat_mul(gr_mat_t C, const gr_mat_t A, const gr_mat_t B, gr_ctx_t ctx)
3 changes: 0 additions & 3 deletions src/gr_mat/test_approx_mul.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ void gr_mat_test_approx_mul_max_norm(gr_method_mat_binary_op mul_impl, gr_srcptr

status |= gr_mat_randtest(A, state, ctx);
status |= gr_mat_randtest(B, state, ctx);
status |= gr_mat_entrywise_unary_op(A, (gr_method_unary_op) gr_abs, A, ctx);
status |= gr_mat_entrywise_unary_op(B, (gr_method_unary_op) gr_abs, B, ctx);

status |= gr_mat_randtest(C, state, ctx);
status |= gr_mat_randtest(D, state, ctx);

Expand Down
6 changes: 6 additions & 0 deletions src/nfloat.h
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,12 @@ int _nfloat_complex_vec_sub(nfloat_complex_ptr res, nfloat_complex_srcptr x, nfl
int _nfloat_complex_vec_dot(nfloat_complex_ptr res, nfloat_complex_srcptr initial, int subtract, nfloat_complex_srcptr x, nfloat_complex_srcptr y, slong len, gr_ctx_t ctx);
int _nfloat_complex_vec_dot_rev(nfloat_complex_ptr res, nfloat_complex_srcptr initial, int subtract, nfloat_complex_srcptr x, nfloat_complex_srcptr y, slong len, gr_ctx_t ctx);

int nfloat_complex_mat_mul_fixed_classical(gr_mat_t C, const gr_mat_t A, const gr_mat_t B, gr_ctx_t ctx);
int nfloat_complex_mat_mul_waksman(gr_mat_t C, const gr_mat_t A, const gr_mat_t B, gr_ctx_t ctx);
int nfloat_complex_mat_mul_block(gr_mat_t C, const gr_mat_t A, const gr_mat_t B, slong min_block_size, gr_ctx_t ctx);
int nfloat_complex_mat_mul_reorder(gr_mat_t C, const gr_mat_t A, const gr_mat_t B, gr_ctx_t ctx);
int nfloat_complex_mat_mul(gr_mat_t C, const gr_mat_t A, const gr_mat_t B, gr_ctx_t ctx);

#ifdef __cplusplus
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/nfloat/complex.c
Original file line number Diff line number Diff line change
Expand Up @@ -1792,8 +1792,8 @@ gr_method_tab_input _nfloat_complex_methods_input[] =
/*
{GR_METHOD_POLY_MULLOW, (gr_funcptr) nfloat_complex_poly_mullow},
{GR_METHOD_POLY_ROOTS_OTHER,(gr_funcptr) nfloat_complex_poly_roots_other},
{GR_METHOD_MAT_MUL, (gr_funcptr) nfloat_complex_mat_mul},
*/
{GR_METHOD_MAT_MUL, (gr_funcptr) nfloat_complex_mat_mul},
{GR_METHOD_MAT_DET, (gr_funcptr) gr_mat_det_generic_field},
{GR_METHOD_MAT_FIND_NONZERO_PIVOT, (gr_funcptr) gr_mat_find_nonzero_pivot_large_abs},

Expand Down
Loading

0 comments on commit 91f0ece

Please sign in to comment.