From 3758f23f44bb733a212afc365ba1a9f589ab115a Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Mon, 21 May 2012 20:16:29 +0200 Subject: [PATCH] not-that-dumb matrix*vector multiplication --- lib/matrix.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/matrix.cpp b/lib/matrix.cpp index 7ec3157..204ee67 100644 --- a/lib/matrix.cpp +++ b/lib/matrix.cpp @@ -200,11 +200,7 @@ bool matrix::mult_vec_right (const bvector&a, bvector&r) uint w = width(), h = height(); if (a.size() != w) return false; r.resize (h, 0); - for (uint i = 0; i < h; ++i) { - bool t = 0; - for (uint j = 0; j < w; ++j) - t ^= item (j) [i] & a[j]; - r[i] = t; - } + for (uint i = 0; i < w; ++i) + if (a[i]) r.add (item (i) ); return true; }