1 /* Scicos
2 *
3 * Copyright (C) INRIA - METALAU Project <scicos@inria.fr>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 *
19 * See the file ./license.txt
20 */
21 /*--------------------------------------------------------------------------*/
22 #include "dynlib_scicos_blocks.h"
23
prod(int * flag,int * nevprt,double * t,double xd[],double x[],int * nx,double z[],int * nz,double tvec[],int * ntvec,double rpar[],int * nrpar,int ipar[],int * nipar,double * inptr[],int insz[],int * nin,double * outptr[],int outsz[],int * nout)24 SCICOS_BLOCKS_IMPEXP void prod(int *flag, int *nevprt,
25 double *t, double xd[],
26 double x[], int *nx,
27 double z[], int *nz,
28 double tvec[], int *ntvec,
29 double rpar[], int *nrpar,
30 int ipar[], int *nipar,
31 double *inptr[], int insz[], int *nin,
32 double *outptr[], int outsz[], int *nout)
33 {
34 int n = outsz[0]; /* insz[0]==insz[1] .. ==insz[*nin]== outsz[0] */
35 double *y = (double *)outptr[0];
36 int i = 0;
37
38 for (i = 0; i < n; i++)
39 {
40 int k = 0;
41
42 y[i] = 1.0;
43
44 for (k = 0; k < *nin; k++)
45 {
46 double *u = (double *)inptr[k];
47 y[i] = y[i] * u[i];
48 }
49 }
50 }
51 /*--------------------------------------------------------------------------*/
52