Added even more files...

This commit is contained in:
Ognjen Milan Robovic 2023-10-28 13:48:02 -04:00
parent d8ccd42fd8
commit 7dd641d63e
4 changed files with 18 additions and 41 deletions

View File

@ -2,8 +2,6 @@
set -xe set -xe
clang -g -ansi -Weverything -Ofast -o main main.c gcc -g -ansi -Wall -Wextra -Wpedantic -Werror -Ofast -c -o xeuron.o xeuron.c
valgrind ./main
exit exit

11
install.sh Normal file
View File

@ -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

2
main.c
View File

@ -1,4 +1,4 @@
#include "xeuron.c" #include <xolatile/xeuron.c>
int main (void) { int main (void) {
//~int input [] = { 0, 0, 1, 1, 0, 1, 0, 1 }, output [] = { 0, 0, 0, 1 }; /* AND */ //~int input [] = { 0, 0, 1, 1, 0, 1, 0, 1 }, output [] = { 0, 0, 0, 1 }; /* AND */

View File

@ -9,22 +9,14 @@ It is distributed in the hope that it will be useful or harmful, it really depen
#ifndef XEURON_SOURCE #ifndef XEURON_SOURCE
#define XEURON_SOURCE #define XEURON_SOURCE
/*#include <xolatile/xeuron.h>*/ #include <xolatile/xeuron.h>
#include "xeuron.h"
#include <stdio.h>
int neuron_array = 0; int neuron_array = 0;
int neuron_count = 0; int neuron_count = 0;
int * neuron_input = NULL; int * neuron_input = NULL;
int * neuron_output = NULL; int * neuron_output = NULL;
int * neuron_system = 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) { static int neuron_system_expect (int element) {
int i, j; 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)); neuron_system = allocate ((1 << neuron_array) * (int) sizeof (* neuron_system));
} }
void neuron_configure (void) { void neuron_configure (void) { /* Unimplemented. */
int i, j; int i, j;
//~int i;
for (j = 0; j != 3; ++j) { for (j = 0; j != 3; ++j) {
int offset;
for (i = 0; i != 1 << neuron_array; ++i) { for (i = 0; i != 1 << neuron_array; ++i) {
neuron_system [i] += j; neuron_system [i] += j;
} }
offset = neuron_system_factor (i);
neuron_print (); neuron_print ();
for (i = 0; i != 1 << neuron_array; ++i) { for (i = 0; i != 1 << neuron_array; ++i) {
neuron_system [i] -= 2 * j; neuron_system [i] -= 2 * j;
} }
offset = neuron_system_factor (i);
neuron_print (); neuron_print ();
for (i = 0; i != 1 << neuron_array; ++i) { for (i = 0; i != 1 << neuron_array; ++i) {
neuron_system [i] += j; 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) { void neuron_deinitialize (void) {