product

PURPOSE ^

C/C++ source

SYNOPSIS ^

C/C++ source

DESCRIPTION ^

C/C++ source

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 #include <stdio.h>
0002 #include <stdlib.h>
0003 #include <math.h>
0004 #include "Fokker_Planck_DKE_loop.h"
0005 
0006 int product(struct Tensor A,struct Tensor B,struct Tensor* C){
0007 int i;
0008 
0009 if (A.ndims ==2 && A.sizedim[0]==1 && A.sizedim[1]==1)/*A is a scalar*/
0010 {/*fprintf(stdout,"Case 2\n");*/
0011 Tensor_Create(B.ndims,B.sizedim,C);
0012    for(i=0;ireturn 0;}
0016 else if (B.ndims ==2 && B.sizedim[0]==1 && B.sizedim[1]==1)/*B is a scalar*/{
0017    /*fprintf(stdout,"Case3\n");*/
0018    Tensor_Create(A.ndims,A.sizedim,C);
0019    for(i=0;ireturn 0;
0023 }
0024 /*Other cases:Checking dimensions consistency*/
0025 else if(A.ndims !=B.ndims){return -1;fprintf(stdout,"Case1\n");}
0026 else {/*fprintf(stdout,"Case4\n");*/
0027     for(i=0;iif(A.sizedim[i] != B.sizedim[i] && ((A.ndims !=2 && A.sizedim[0]!=1 && A.sizedim[1]!=1) ||
0029 (B.ndims !=2 && B.sizedim[0]!=1 &&
0030 B.sizedim[1]!=1))){/*printf("product:dimension mismatch\n");*/
0031 return -1;}
0032        }
0033      Tensor_Create(A.ndims,A.sizedim,C); 
0034     /* fprintf(stdout,"computing C.vals\n");*/
0035     for(i=0;i/* fprintf(stdout,"endprod\n");*/
0040 return 0;}

Community support and wiki are available on Redmine. Last update: 18-Apr-2019.