Commits

Anonymous committed da50750

fix warnings issues by ICC & remove unused watch.c/.h

Comments (0)

Files changed (6)

 
 lib_LTLIBRARIES = libm4ri.la
 
-libm4ri_la_SOURCES = src/brilliantrussian.c src/misc.c src/packedmatrix.c src/grayflex.c src/strassen.c src/watch.c src/permutation.c src/trsm.c src/lqup.c
+libm4ri_la_SOURCES = src/brilliantrussian.c src/misc.c src/packedmatrix.c src/grayflex.c src/strassen.c src/permutation.c src/trsm.c src/lqup.c
 
-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
+include_HEADERS = src/m4ri.h src/brilliantrussian.h src/misc.h src/packedmatrix.h src/grayflex.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.20080826
  * \warning Not thread safe!
  */
 
-void m4ri_build_all_codes();
+void m4ri_build_all_codes(void);
 
 /**
  * Frees memory from the global code book.
  * \warning Not thread safe!
  */
 
-void m4ri_destroy_all_codes();
+void m4ri_destroy_all_codes(void);
 
 /**
  * \brief Return the optimal var k for the given parameters. 
   abort();
 }
 
-void m4ri_print_bit_string(int number, int length){
-  int i;
-  for(i=length-1 ; i>=0; i--) {
-    ((1<<i) & number) ? printf("1") : printf("0");
-  }
-  printf("\n");
-}
-
 /* Warning: I assume *destination has RADIX+1 bytes available */
 void m4ri_word_to_str( char *destination, word data, int colon) {
   int i;
  * \todo Allow user to provide her own random() function.
  */
 
-BIT m4ri_coin_flip();
+BIT m4ri_coin_flip(void);
 
 /***** Initialization *****/
 
  */
 
 #if defined(__GNUC__)
-void __attribute__ ((constructor)) m4ri_init();
+void __attribute__ ((constructor)) m4ri_init(void);
 #else
-void m4ri_init();
+void m4ri_init(void);
 #endif
 
 #ifdef __SUNPRO_C
  */
 
 #if defined(__GNUC__)
-void __attribute__ ((destructor)) m4ri_fini();
+void __attribute__ ((destructor)) m4ri_fini(void);
 #else
-void m4ri_fini();
+void m4ri_fini(void);
 #endif
 
 #ifdef __SUNPRO_C
  * \todo Make thread safe.
  */
 
-static inline mm_block *m4ri_mmc_handle() {
+static inline mm_block *m4ri_mmc_handle(void) {
   return m4ri_mmc_cache;
 }
 
  * \warning Not thread safe.
  */
 
-static inline void m4ri_mmc_cleanup() {
+static inline void m4ri_mmc_cleanup(void) {
   mm_block *mm = m4ri_mmc_handle();
   size_t i;
   for(i=0; i < M4RI_MMC_NBLOCKS; i++) {

src/watch.c

-/******************************************************************************
-*
-*            M4RI: Method of the Four Russians Inversion
-*
-*       Copyright (C) 2007 Gregory Bard <gregory.bard@ieee.org> 
-*
-*  Distributed under the terms of the GNU General Public License (GPL)
-*
-*    This code is distributed in the hope that it will be useful,
-*    but WITHOUT ANY WARRANTY; without even the implied warranty of
-*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-*    General Public License for more details.
-*
-*  The full text of the GPL is available at:
-*
-*                  http://www.gnu.org/licenses/
-******************************************************************************/
-
-#include "watch.h"
-#include "misc.h"
-#include <stdio.h>
-#include <stdlib.h>
-
-clock_t watchstart;
-clock_t watchstop;
-long watchrunning;
-
-double logtotal, logtotalsquare, logcount;
-
-void m4ri_watch_seed() {
-  srand(clock()/10000);
-}
-
-double m4ri_sqrt(double n) {
-  double guess=n/2;
-  double miss, der;
-  int i;
-
-  if (n<0) {
-    printf("\a Tried to take square root of %f.\n",n);
-    exit(1);
-  }
-
-  for (i=0; i<40 ;i++) {
-    miss=n-guess*guess;
-    der=2.0*guess;
-    guess+=miss/der;
-  }
-
-  return guess;
-}
-
-void m4ri_watch_start() {
-  watchstart=clock();
-  watchrunning=TRUE;
-}
-
-void m4ri_watch_stop() {
-  watchstop=clock();
-  watchrunning=FALSE;
-}
-
-clock_t m4ri_watch_get() {
-  if (watchrunning==TRUE) 
-    return clock()-watchstart;
-  else 
-    return watchstop-watchstart;
-}
-
-void m4ri_watch_clear_logs() {
-  logtotal=0;
-  logtotalsquare=0;
-  logcount=0;
-}
-
-void m4ri_watch_store(clock_t watch) {
-  double value=(double)watch;
-
-  logtotal+=value;
-  logtotalsquare+=value*value;
-  logcount++;
-}
-
-double m4ri_watch_get_average() {
-  return logtotal/(logcount*1.0);
-}
-
-double m4ri_watch_get_sigma() {
-  double mean = m4ri_watch_get_average();
-  double ex_sq = logtotalsquare/(logcount*1.0);
-  double var = ex_sq-mean*mean;
-  double sigma = m4ri_sqrt(var);
-  return sigma;
-}
-
-long m4ri_watch_get_count() {
-  return (long)logcount;
-}
-
-
-
-

src/watch.h

-#ifndef WATCH_H
-#define WATCH_H
-
-/******************************************************************************
-*
-*            M4RI: Method of the Four Russians Inversion
-*
-*       Copyright (C) 2007 Gregory Bard <gregory.bard@ieee.org> 
-*
-*  Distributed under the terms of the GNU General Public License (GPL)
-*
-*    This code is distributed in the hope that it will be useful,
-*    but WITHOUT ANY WARRANTY; without even the implied warranty of
-*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-*    General Public License for more details.
-*
-*  The full text of the GPL is available at:
-*
-*                  http://www.gnu.org/licenses/
-******************************************************************************/
-
-#include <time.h>
-#include <math.h>
-
-extern clock_t watchstart;
-extern clock_t watchstop;
-extern long watchrunning;
-
-extern double logtotal, logtotalsquare, logcount;
-
-void m4ri_watch_seed();
-
-double m4ri_sqrt(double n);
-
-void m4ri_watch_start();
-
-void m4ri_watch_stop();
-
-clock_t m4ri_watch_get();
-
-void m4ri_watch_clear_logs();
-
-void m4ri_watch_store(clock_t watch);
-
-double m4ri_watch_get_average_time();
-
-double m4ri_watch_get_sigma();
-
-long m4ri_watch_get_count();
-
-#endif //WATCH_H
-
-
-