Adding new superclass for C ops

This adds a new class (gof.COp) for new C ops to inherit from. It allows to have the C implementation in a different file than the Python implementation and it also takes care of a few C-related methods of the Op class automatically. This pull request also updates the Extending Theano with a C Op tutorial to include an example using this new class.
I commented on that too and he will change that.

On Wed, Oct 15, 2014 at 3:03 PM, Pascal Lamblin <notifications@github.com>
wrote:

> In doc/tutorial/extending_theano_c.txt:
>
> > +    void vector_elemwise_mult_<<<<NODE_NAME_PLACEHOLDER>>>>(
> > +        npy_%(dtype_x)s* x_ptr, int x_str,
> > +        npy_%(dtype_y)s* y_ptr, int y_str,
> > +        npy_%(dtype_z)s* z_ptr, int z_str, int nbElements)
> > +    {
> > +        for (int i=0; i < nbElements; i++){
> > +            z_ptr[i * z_str] = x_ptr[i * x_str] * y_ptr[i * y_str];
> > +        }
> > +    }
> > +
> > +    int myFunc_<<<<NODE_NAME_PLACEHOLDER>>>>(void* in0, void* in1,
> > +                                             void** out0)
> > +    {
> > +        PyArrayObject* input0 = (PyArrayObject*)in0;
> > +        PyArrayObject* input1 = (PyArrayObject*)in1;
> > +        PyArrayObject** output0 = (PyArrayObject**)out0;
>
> That may segfault if the data passed is not of the right type, I think.
> Or has it already been checked?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/Theano/Theano/pull/2179/files#r18914850>.
>