C/C++ source
0001 #include <math.h> 0002 #include "Fokker_Planck_DKE_loop.h" 0003 #include <stdio.h> 0004 #include <stdlib.h> 0005 0006 void Scalar_Tensor_product(DOUBLE s,struct Tensor A,struct Tensor* B) 0007 { 0008 int i; 0009 /* fprintf(stdout,"starting S_T_P\n");*/ 0010 /*(*B).ndims=A.ndims; 0011 fprintf(stdout,"allocating Bsizedim S_T_P\n"); 0012 (*B).sizedim=A.sizedim; 0013 (*B).size=A.size; 0014 fprintf(stdout,"allocating Bvals S_T_P\n"); 0015 (*B).vals=malloc(A.size*sizeof(DOUBLE));*/ 0016 Tensor_Create(A.ndims,A.sizedim,B); 0017 for(i=0;i<(*B).size;i++){ 0018 (*B).vals[i]=A.vals[i]*s; 0019 } 0020 }