Преглед изворни кода

Added even more files...

master
Ognjen Milan Robovic пре 6 месеци
родитељ
комит
7dd641d63e
4 измењених фајлова са 18 додато и 41 уклоњено
  1. +1
    -3
      compile.sh
  2. +11
    -0
      install.sh
  3. +1
    -1
      main.c
  4. +5
    -37
      xeuron.c

+ 1
- 3
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

+ 11
- 0
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

+ 1
- 1
main.c Прегледај датотеку

@@ -1,4 +1,4 @@
#include "xeuron.c"
#include <xolatile/xeuron.c>

int main (void) {
//~int input [] = { 0, 0, 1, 1, 0, 1, 0, 1 }, output [] = { 0, 0, 0, 1 }; /* AND */


+ 5
- 37
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 <xolatile/xeuron.h>*/
#include "xeuron.h"
#include <stdio.h>
#include <xolatile/xeuron.h>

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) {


Loading…
Откажи
Сачувај