AI-LibNeural

 view release on metacpan or  search on metacpan

LibNeural.xs  view on Meta::CPAN

#include "perl.h"
#include "XSUB.h"
#ifdef __cplusplus
}
#endif
	
#include <nnwork.h>
#include <neuron.h>

static int
not_here(char *s)
{
    croak("%s not implemented on this architecture", s);
    return -1;
}

static double
constant(char *name, int len, int arg)
{
    errno = 0;
    switch (name[0 + 0]) {
    case 'A':
	if (strEQ(name + 0, "ALL")) {	/*  removed */
#ifdef ALL
	    return ALL;
#else
	    goto not_there;
#endif
	}
    case 'H':
	if (strEQ(name + 0, "HIDDEN")) {	/*  removed */
#ifdef HIDDEN
	    return HIDDEN;
#else
	    goto not_there;
#endif
	}
    case 'I':
	if (strEQ(name + 0, "INPUT")) {	/*  removed */
#ifdef INPUT
	    return INPUT;
#else
	    goto not_there;
#endif
	}
    case 'O':
	if (strEQ(name + 0, "OUTPUT")) {	/*  removed */
#ifdef OUTPUT
	    return OUTPUT;
#else
	    goto not_there;
#endif
	}
    }
    errno = EINVAL;
    return 0;

not_there:
    errno = ENOENT;
    return 0;
}

/* function that takes an array reference and convert it into an equivelent
 * float array. dlen is the number of elements that we want to make sure are in
 * the array */
static float *
svpvav_to_float_array (SV * svpvav, int dlen)
{



( run in 0.492 second using v1.01-cache-2.11-cpan-b61123c0432 )