Skip to content

Instantly share code, notes, and snippets.

View alarrosa14's full-sized avatar

Alvaro Larrosa alarrosa14

View GitHub Profile
@alarrosa14
alarrosa14 / kmeans.c
Last active November 12, 2015 01:06
A sequential kmeans algorithm implementation.
#include <stdlib.h>
#include <math.h>
#include <limits.h>
#include <float.h>
#include <stdio.h>
#define N 300000
#define K 100
#define TOLERANCE 0.00001
#define SEED 11
@alarrosa14
alarrosa14 / mandelbrot_master.c
Last active November 12, 2015 01:07
PVM mandelbrot algorithm.
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <pvm3.h>
int main() {
const double yMin = -1.0;
const double yMax = +1.0;
const double xMin = -2.0;
const double xMax = +0.5;
@alarrosa14
alarrosa14 / mandelbrot.c
Last active November 12, 2015 01:07
C fork based multiprocess mandelbrot algorithm implementation.
#include <sys/stat.h>
#include <fcntl.h>
#include <limits.h>
#include <sys/mman.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>