From 86251e7699bb979a656849def15ba1e1e55c4e57 Mon Sep 17 00:00:00 2001 From: "yu.dongliang" Date: Fri, 20 Nov 2020 13:56:15 +0800 Subject: [PATCH] fix --- mat.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/mat.c b/mat.c index 39784b1..0368098 100644 --- a/mat.c +++ b/mat.c @@ -143,29 +143,29 @@ void mat_mul_strassen(mat_t* m, mat_t* m0, mat_t* m1, int n_min) { assert(m0->n == m1->n); assert(m->n == m0->n); - +#if 1 if (m->n <= n_min) return mat_mul(m, m0, m1); - +#endif if (n_min < 16) - printf("%s(), n_min: %d\n", __func__, n_min); + printf("%s(), m->n: %d, n_min: %d\n", __func__, m->n, n_min); int n = m->n / 2; - mat_t* a = mat_alloc(0, 0, n, m0->b); - mat_t* b = mat_alloc(0, n, n, m0->b); - mat_t* c = mat_alloc(n, 0, n, m0->b); - mat_t* d = mat_alloc(n, n, n, m0->b); + mat_t* a = mat_alloc(m0->i, m0->j, n, m0->b); + mat_t* b = mat_alloc(m0->i, m0->j + n, n, m0->b); + mat_t* c = mat_alloc(m0->i + n, m0->j, n, m0->b); + mat_t* d = mat_alloc(m0->i + n, m0->j + n, n, m0->b); - mat_t* e = mat_alloc(0, 0, n, m1->b); - mat_t* f = mat_alloc(0, n, n, m1->b); - mat_t* g = mat_alloc(n, 0, n, m1->b); - mat_t* h = mat_alloc(n, n, n, m1->b); + mat_t* e = mat_alloc(m1->i, m1->j, n, m1->b); + mat_t* f = mat_alloc(m1->i, m1->j + n, n, m1->b); + mat_t* g = mat_alloc(m1->i + n, m1->j, n, m1->b); + mat_t* h = mat_alloc(m1->i + n, m1->j + n, n, m1->b); - mat_t* r = mat_alloc(0, 0, n, m->b); - mat_t* s = mat_alloc(0, n, n, m->b); - mat_t* t = mat_alloc(n, 0, n, m->b); - mat_t* u = mat_alloc(n, n, n, m->b); + mat_t* r = mat_alloc(m->i, m->j, n, m->b); + mat_t* s = mat_alloc(m->i, m->j + n, n, m->b); + mat_t* t = mat_alloc(m->i + n, m->j, n, m->b); + mat_t* u = mat_alloc(m->i + n, m->j + n, n, m->b); mat_t* p1 = mat_alloc(0, 0, n, NULL); mat_t* p2 = mat_alloc(0, 0, n, NULL); -- 2.25.1