fixes
This commit is contained in:
		
							
								
								
									
										5
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								Makefile
									
									
									
									
									
								
							| @@ -6,7 +6,6 @@ CFLAGS   := -Wall -fopenmp -O3 | |||||||
| LDFLAGS  := -lm | LDFLAGS  := -lm | ||||||
| SRCDIR   := src | SRCDIR   := src | ||||||
| OBJDIR   := out | OBJDIR   := out | ||||||
| DATAPATH := data/web-Google/web-Google.mtx |  | ||||||
|  |  | ||||||
| # | # | ||||||
| SRCS     := $(wildcard $(SRCDIR)/*.c) | SRCS     := $(wildcard $(SRCDIR)/*.c) | ||||||
| @@ -25,9 +24,7 @@ pagerank: $(OBJDIR)/pagerank | $(OBJDIR) | |||||||
| # -------------------------------------------------- | # -------------------------------------------------- | ||||||
| # Link | # Link | ||||||
| # -------------------------------------------------- | # -------------------------------------------------- | ||||||
| $(OBJDIR)/pagerank: $(OBJS) $(DATAPATH) | $(OBJDIR) | $(OBJDIR)/pagerank: $(OBJS) | $(OBJDIR) | ||||||
| 	@echo "→ Copying input data" |  | ||||||
| 	cp $(DATAPATH) $(OBJDIR)/input.mtx |  | ||||||
| 	@echo "→ Linking $@" | 	@echo "→ Linking $@" | ||||||
| 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) | 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -33,7 +33,7 @@ double* gauss_seidel_pagerank(const SparseMatrix *matrix, double epsilon, double | |||||||
|         memcpy(x_old, x, vec_size); |         memcpy(x_old, x, vec_size); | ||||||
|  |  | ||||||
|         // 2. alpha/N * (x * f) |         // 2. alpha/N * (x * f) | ||||||
|         double x_f = vec_product(x_old, f, N); |         double x_f = vec_product(x, f, N); | ||||||
|         double right_var = (alpha / (double)N) * x_f; |         double right_var = (alpha / (double)N) * x_f; | ||||||
|  |  | ||||||
|         // 3. alpha*(pi*M) + (right_const+alpha/N * (pi * f))*e |         // 3. alpha*(pi*M) + (right_const+alpha/N * (pi * f))*e | ||||||
|   | |||||||
| @@ -22,7 +22,7 @@ void generate_f(const SparseMatrix *matrix, double *res) { | |||||||
|     init_vector(res, N, 1); |     init_vector(res, N, 1); | ||||||
|     int num_arcs = matrix->num_arcs; |     int num_arcs = matrix->num_arcs; | ||||||
|     for (int i = 0; i < num_arcs; ++i) { |     for (int i = 0; i < num_arcs; ++i) { | ||||||
|         res[matrix->arcs[i].dest] = 0; |         res[matrix->arcs[i].origin] = 0; | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user