@@ -155,7 +155,7 @@ size_t mshow_stats(const b128mat_t *a, const char *mname,FILE *file) {
155155// check if two b128 compressed matrices :a and :b are equal
156156// if a==b return -1
157157// if a!=b return the row index>=0 containing the first difference
158- int mequals_plain (size_t size , const b128mat_t * a , const b128mat_t * b )
158+ static int mequals_aux (size_t size , const b128mat_t * a , const b128mat_t * b )
159159{
160160 (void ) size ;
161161 assert (a != NULL && b != NULL );
@@ -169,7 +169,7 @@ int mequals_plain(size_t size, const b128mat_t *a, const b128mat_t *b)
169169bool mequals (const b128mat_t * a , const b128mat_t * b ) {
170170 assert (a != NULL && b != NULL );
171171 if (a -> size != b -> size ) return false; // cannot say
172- return mequals_plain (0 , a , b ) < 0 ;
172+ return mequals_aux (0 , a , b ) < 0 ;
173173}
174174
175175// add indentity matrix to a
@@ -220,6 +220,21 @@ void msum(const b128mat_t *a, const b128mat_t *b, b128mat_t *c)
220220 return ;
221221}
222222
223+ // logically add matrix b to a
224+ void madd (b128mat_t * a , const b128mat_t * b )
225+ {
226+ assert (a != NULL && b != NULL );
227+ if (a -> size != b -> size )
228+ quit ("madd: matrix size mismatch" ,__LINE__ ,__FILE__ );
229+
230+ for (size_t i = 0 ; i < a -> size * a -> colb ; i ++ )
231+ a -> b [i ] = a -> b [i ] | b -> b [i ];
232+ return ;
233+ }
234+
235+
236+
237+
223238// main entry point for matrix multiplication.
224239// multiply size x size b128 compressed matrices :a and :b storing
225240// the result in c, old content of c is discarded
0 commit comments