Multiplication
Keywords: main

Subsections

- Library
- Description
- Default properties
- Interfacing function
- Computational function (type 2)

##
Multiplication

### Library

Non_linear

### Description

The output is the element wize product of the inputs.

### Default properties

- always active: no
- direct-feedthrough: yes
- zero-crossing: no
- mode: no
- number/sizes of inputs: 2 / -1 -1
- number/sizes of outputs: 1 / -1
- number/sizes of activation inputs: 0 /
- number/sizes of activation outputs: 0 /
- continuous-time state: no
- discrete-time state: no
- name of computational function: prod

### Interfacing function

`scilab/macros/scicos_blocks/nonlinear/PROD_f.sci`

### Computational function (type 2)

    /* Copyright INRIA */
    #include "../machine.h"

    /* Element wise product */

    void
    prod(flag,nevprt,t,xd,x,nx,z,nz,tvec,ntvec,rpar,nrpar,
    	       ipar,nipar,inptr,insz,nin,outptr,outsz,nout)
         integer *flag,*nevprt,*nx,*nz,*ntvec,*nrpar,ipar[],*nipar,insz[];
         integer *nin,outsz[],*nout;
         double x[],xd[],z[],tvec[],rpar[];
         double *inptr[],*outptr[],*t;

    {
        int k,i,n;
        double *y;
        double *u;

        n=outsz[0]; /* insz[0]==insz[1] .. ==insz[*nin]== outsz[0] */

        y=(double *)outptr[0];

        for (i=0;i<n;i++) {
          y[i]=1.0;
          for (k=0;k<*nin;k++) {
    	u=(double *)inptr[k];
    	y[i]=y[i]*u[i];
          }
        }
    }