diff --git a/compile.sh b/compile.sh index 0d9653e..860901c 100644 --- a/compile.sh +++ b/compile.sh @@ -2,8 +2,6 @@ set -xe -clang -g -ansi -Weverything -Ofast -o main main.c - -valgrind ./main +gcc -g -ansi -Wall -Wextra -Wpedantic -Werror -Ofast -c -o xeuron.o xeuron.c exit diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..28b77af --- /dev/null +++ b/install.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -xe + +mkdir -p /usr/include/xolatile + +cp xeuron.h /usr/include/xolatile/xeuron.h +cp xeuron.c /usr/include/xolatile/xeuron.c +cp xeuron.o /usr/include/xolatile/xeuron.o + +exit diff --git a/main.c b/main.c index 0eecc94..771a390 100644 --- a/main.c +++ b/main.c @@ -1,4 +1,4 @@ -#include "xeuron.c" +#include int main (void) { //~int input [] = { 0, 0, 1, 1, 0, 1, 0, 1 }, output [] = { 0, 0, 0, 1 }; /* AND */ diff --git a/xeuron.c b/xeuron.c index 15eaeb0..1327125 100644 --- a/xeuron.c +++ b/xeuron.c @@ -9,22 +9,14 @@ It is distributed in the hope that it will be useful or harmful, it really depen #ifndef XEURON_SOURCE #define XEURON_SOURCE -/*#include */ -#include "xeuron.h" -#include +#include int neuron_array = 0; int neuron_count = 0; int * neuron_input = NULL; int * neuron_output = NULL; int * neuron_system = NULL; -/* -square : right up - bd abd bcd abcd - d ad cd acd - b ab bc abc - 1 a c ac -*/ + static int neuron_system_expect (int element) { int i, j; @@ -68,50 +60,26 @@ void neuron_initialize (int array, int count, int * input_data, int * output_dat neuron_system = allocate ((1 << neuron_array) * (int) sizeof (* neuron_system)); } -void neuron_configure (void) { +void neuron_configure (void) { /* Unimplemented. */ int i, j; - //~int i; for (j = 0; j != 3; ++j) { - int offset; - for (i = 0; i != 1 << neuron_array; ++i) { neuron_system [i] += j; } - offset = neuron_system_factor (i); + neuron_print (); for (i = 0; i != 1 << neuron_array; ++i) { neuron_system [i] -= 2 * j; } - offset = neuron_system_factor (i); + neuron_print (); for (i = 0; i != 1 << neuron_array; ++i) { neuron_system [i] += j; } - - echo ("-------------------------------------------------------------------\n"); } - - //~for (i = 0; i != 1 << neuron_array; ++i) { - //~int offset, offset_upper, offset_lower; - - //~offset = neuron_system_factor (i); - //~neuron_print (); - - //~neuron_system [i] += 1; - //~offset_upper = neuron_system_factor (i); - //~neuron_print (); - - //~neuron_system [i] -= 2; - //~offset_lower = neuron_system_factor (i); - //~neuron_print (); - - //~neuron_system [i] += 1; - - //~echo ("-------------------------------------------------------------------\n"); - //~} } void neuron_deinitialize (void) {