Commits

Anonymous committed f9845bc

int/long -> size_t cleanup courtesy of MSVC

Comments (0)

Files changed (7)

 include_HEADERS = src/m4ri.h src/brilliantrussian.h src/misc.h src/packedmatrix.h src/grayflex.h src/watch.h src/strassen.h src/parity.h src/permutation.h src/config.h src/trsm.h src/lqup.h
 
 #libm4ri_la_LDFLAGS = -version-info 0:0:0
-libm4ri_la_LDFLAGS = -release 0.0.1
+libm4ri_la_LDFLAGS = -release 0.0.20080624
 				>
 			</File>
 			<File
+				RelativePath=".\src\lqup.h"
+				>
+			</File>
+			<File
 				RelativePath=".\src\m4ri.h"
 				>
 			</File>
 				>
 			</File>
 			<File
+				RelativePath=".\src\permutation.h"
+				>
+			</File>
+			<File
 				RelativePath=".\src\strassen.h"
 				>
 			</File>
 			<File
+				RelativePath=".\src\trsm.h"
+				>
+			</File>
+			<File
 				RelativePath=".\src\watch.h"
 				>
 			</File>
 				>
 			</File>
 			<File
+				RelativePath=".\src\lqup.c"
+				>
+			</File>
+			<File
 				RelativePath=".\src\misc.c"
 				>
 			</File>
 				>
 			</File>
 			<File
+				RelativePath=".\src\permutation.c"
+				>
+			</File>
+			<File
 				RelativePath=".\src\strassen.c"
 				>
 			</File>
 			<File
+				RelativePath=".\src\trsm.c"
+				>
+			</File>
+			<File
 				RelativePath=".\src\watch.c"
 				>
 			</File>

src/brilliantrussian.c

 }
 
 void mzd_process_rows(packedmatrix *M, size_t startrow, size_t stoprow, size_t startcol, int k, packedmatrix *T, size_t *L) {
-  int r;
+  size_t r;
   const size_t blocknum=startcol/RADIX;
   size_t wide = M->width - blocknum;
 
 }
 
 void mzd_process_rows2(packedmatrix *M, size_t startrow, size_t stoprow, size_t startcol, int k, packedmatrix *T0, size_t *L0, packedmatrix *T1, size_t *L1) {
-  int r;
+  size_t r;
   const size_t blocknum=startcol/RADIX;
   const size_t wide = M->width - blocknum;
 
 }
 
 void mzd_process_rows3(packedmatrix *M, size_t startrow, size_t stoprow, size_t startcol, int k, packedmatrix *T0, size_t *L0, packedmatrix *T1, size_t *L1, packedmatrix *T2, size_t *L2) {
-  int r;
+  size_t r;
   const size_t blocknum=startcol/RADIX;
   const size_t wide = M->width - blocknum;
 
 
 void mzd_process_rows4(packedmatrix *M, size_t startrow, size_t stoprow, size_t startcol, int k, 
                        packedmatrix *T0, size_t *L0, packedmatrix *T1, size_t *L1, packedmatrix *T2, size_t *L2, packedmatrix *T3, size_t *L3) {
-  int r;
+  size_t r;
   const size_t blocknum=startcol/RADIX;
   const size_t wide = M->width - blocknum;
 
 void mzd_process_rows5(packedmatrix *M, size_t startrow, size_t stoprow, size_t startcol, int k, 
                        packedmatrix *T0, size_t *L0, packedmatrix *T1, size_t *L1, packedmatrix *T2, size_t *L2, packedmatrix *T3, size_t *L3,
                        packedmatrix *T4, size_t *L4) {
-  int r;
+  size_t r;
   const size_t blocknum=startcol/RADIX;
   const size_t wide = M->width - blocknum;
 
 void mzd_process_rows6(packedmatrix *M, size_t startrow, size_t stoprow, size_t startcol, int k, 
                        packedmatrix *T0, size_t *L0, packedmatrix *T1, size_t *L1, packedmatrix *T2, size_t *L2, packedmatrix *T3, size_t *L3,
                        packedmatrix *T4, size_t *L4, packedmatrix *T5, size_t *L5) {
-  int r;
+  size_t r;
   const size_t blocknum=startcol/RADIX;
   const size_t wide = M->width - blocknum;
 
     const int x3 = L3[ (int)mzd_read_bits(M, r, startcol+ka+kb+kc, kd)];
     const int x4 = L4[ (int)mzd_read_bits(M, r, startcol+ka+kb+kc+kd, ke)];
     const int x5 = L5[ (int)mzd_read_bits(M, r, startcol+ka+kb+kc+kd+ke, kf)];
-
+    
     if(x0 == 0 && x1 == 0 && x2 == 0 && x3 == 0 && x4 == 0 && x5 == 0) 
       continue;
-
+    
     word * m0 = M->values + M->rowswap[r] + blocknum;
     const word *t0 = T0->values + T0->rowswap[x0] + blocknum;
     const word *t1 = T1->values + T1->rowswap[x1] + blocknum;
       k -= 4;
     }
   }
+  /*printf("k: %d\n",k);*/
   int kk = 6*k;
 
   packedmatrix *U  = mzd_init(kk, A->ncols);
   packedmatrix *T = mzd_init(TWOPOW(k), b_nc);
   size_t *L = (size_t *)m4ri_mm_malloc(TWOPOW(k) * sizeof(size_t));
 
-  long s, start;
-  const long end = a_nc/k;
+  size_t s, start;
+  const size_t end = a_nc/k;
 
     for (start=0; start + blocksize <= a_nr; start += blocksize) {
       for(i=0; i < end; i++) {
   }
 
 #ifndef M4RM_GRAY8
-  size_t *buffer = m4ri_mm_malloc(4 * TWOPOW(k) * sizeof(size_t));
+  size_t *buffer = (size_t*)m4ri_mm_malloc(4 * TWOPOW(k) * sizeof(size_t));
 #else
-  size_t *buffer = m4ri_mm_malloc(8 * TWOPOW(k) * sizeof(size_t));
+  size_t *buffer = (size_t*)m4ri_mm_malloc(8 * TWOPOW(k) * sizeof(size_t));
 #endif
 
   packedmatrix *T1 = mzd_init(TWOPOW(k), b_nc);
 #endif
 
   /* process stuff that fits into multiple of k first, but blockwise (babystep-giantstep)*/
-  long babystep, giantstep;
+  size_t babystep, giantstep;
 #ifdef M4RM_GRAY8
   const int kk = 8*k;
 #else
   const int kk = 4*k;
 #endif
-  const long end = a_nc/kk;
+  const size_t end = a_nc/kk;
 
   for (giantstep=0; giantstep + blocksize <= a_nr; giantstep += blocksize) {
     for(i=0; i < end; i++) {
 
 void _mzd_lqup_submatrix_finish(packedmatrix *A, size_t r, size_t c, int kbar) {
   size_t i, j;
-  for(i=0 ; i < kbar; i++) {
+  for(i=0 ; i < (size_t)kbar; i++) {
     // clear L first
     for (j=0; j<i; i++) {
       mzd_write_bit(A, r+i, c+j, 0);
  ********************************************************************/
 
 #include <stdlib.h>
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
 
 /*
  * These define entirely the word width used in the library.

src/permutation.c

 
 permutation *mzp_init(size_t length) {
   size_t i;
-  permutation *P = m4ri_mm_malloc(sizeof(permutation));
+  permutation *P = (permutation*)m4ri_mm_malloc(sizeof(permutation));
   P->values = (size_t*)m4ri_mm_malloc(sizeof(size_t)*length);
   P->length = length;
   for (i=0; i<length; i++) {
 
   /* adjust cutting numbers to work on words */
   unsigned long mult = 1;
-  size_t width = a;
+  long width = a;
   while (width > 2*cutoff) {
     width/=2;
     mult*=2;
 
   /* adjust cutting numbers to work on words */
   unsigned long mult = 1;
-  size_t width = a;
+  long width = a;
   while (width > 2*cutoff) {
     width/=2;
     mult*=2;

testsuite/Makefile

-CFLAGS=-I../src
+CFLAGS=-I../src -fopenmp
 LDFLAGS=-L../.libs/ -lm4ri
 DEBUG=-ggdb