diff options
Diffstat (limited to 'src/c/operations/interfaces')
20 files changed, 2263 insertions, 0 deletions
diff --git a/src/c/operations/interfaces/int_OpBackSlash.h b/src/c/operations/interfaces/int_OpBackSlash.h new file mode 100644 index 00000000..8a733f28 --- /dev/null +++ b/src/c/operations/interfaces/int_OpBackSlash.h @@ -0,0 +1,109 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ + +#ifndef __INT_OPBACKSLASH_H__ +#define __INT_OPBACKSLASH_H__ + +/* Scalar \ Scalar */ + +#define s0s0OpBackSlashs0(in1,in2) sldivs(in1,in2) + +#define d0d0OpBackSlashd0(in1,in2) dldivs(in1,in2) + +#define c0c0OpBackSlashc0(in1,in2) cldivs(in1,in2) + +#define z0z0OpBackSlashz0(in1,in2) zldivs(in1,in2) + +#define s0c0OpBackSlashc0(in1,in2) cldivs(FloatComplex(in1,0),in2) + +#define c0s0OpBackSlashc0(in1,in2) cldivs(in1,FloatComplex(in2,0)) + +#define d0z0OpBackSlashz0(in1,in2) zldivs(DoubleComplex(in1,0),in2) + +#define z0d0OpBackSlashz0(in1,in2) zldivs(in1,DoubleComplex(in2,0)) + + +/* Scalar \ Matrix */ + +#define s0s2OpBackSlashs2(in1,in2,size,out) {int i;\ + for( i=0;i<size[0]*size[1];i++) out[i]= sldivs(in1,in2[i]);} + +#define d0d2OpBackSlashd2(in1,in2,size,out) {int i;\ + for( i=0;i<size[0]*size[1];i++) out[i]= dldivs(in1,in2[i]);} + +#define c0c2OpBackSlashc2(in1,in2,size,out) {int i;\ + for( i=0;i<size[0]*size[1];i++) out[i]= cldivs(in1,in2[i]);} + +#define z0z2OpBackSlashz2(in1,in2,size,out) {int i;\ + for( i=0;i<size[0]*size[1];i++) out[i]= zldivs(in1,in2[i]);} + +#define s0c2OpBackSlashc2(in1,in2,size,out) c0c2OpBackSlashc2(FloatComplex(in1,0),in2,size,out) + +#define d0z2OpBackSlashz2(in1,in2,size,out) z0z2OpBackSlashz2(DoubleComplex(in1,0),in2,size,out) + +#define c0s2OpBackSlashc2(in1,in2,size,out) {int i;\ + for ( i=0;i<size[0]*size[1];i++) out[i]= cldivs(in1,FloatComplex(in2[i],0));} + +#define z0d2OpBackSlashz2(in1,in2,size,out) {int i;\ + for ( i=0;i<size[0]*size[1];i++) out[i]= zldivs(in1,DoubleComplex(in2[i],0));} + + +/* Matrix \ Scalar */ + +#define s2s0OpBackSlashs2(in1,size,in2,out) {float temp[1] = {in2};\ + sldivma(in1,size[0],size[1],temp,1,1,out);} + +#define d2d0OpBackSlashd2(in1,size,in2,out) {double temp[1] = {in2};\ + dldivma(in1,size[0],size[1],temp,1,1,out);} + +#define c2c0OpBackSlashc2(in1,size,in2,out) {int i;\ + for ( i=0;i<size[0]*size[1];i++) out[i]= cldivs(in1[i],in2);} + +#define z2z0OpBackSlashz2(in1,size,in2,out) {int i;\ + for ( i=0;i<size[0]*size[1];i++) out[i]= zldivs(in1[i],in2);} + +#define s2c0OpBackSlashc2(in1,size,in2,out) {int i;\ + for ( i=0;i<size[0]*size[1];i++) out[i]= cldivs(FloatComplex(in1[i],0),in2);} + +#define d2z0OpBackSlashz2(in1,size,in2,out) {int i;\ + for ( i=0;i<size[0]*size[1];i++) out[i]= zldivs(DoubleComplex(in1[i],0),in2);} + +#define c2s0OpBackSlashc2(in1,size,in2,out) c2c0OpBackSlashc2(in1,size,FloatComplex(in2,0),out) + +#define z2d0OpBackSlashz2(in1,size,in2,out) z2z0OpBackSlashz2(in1,size,DoubleComplex(in2,0),out) + + + +/* Matrix \ Matrix */ + +#define s2s2OpBackSlashs2(in1,size1,in2,size2,out) sldivma(in1,size1[0],size1[1],in2,size2[0],size2[1],out) + +#define d2d2OpBackSlashd2(in1,size1,in2,size2,out) dldivma(in1,size1[0],size1[1],in2,size2[0],size2[1],out) + +#define c2c2OpBackSlashc2(in1,size1,in2,size2,out) cldivma(in1,size1[0],size1[1],in2,size2[0],size2[1],out) + +#define c2s2OpBackSlashc2(in1,size1,in2,size2,out) cldivma(in1,size1[0],size1[1],FloatComplexMatrix(in2,0,size2[0]*size2[1]),size2[0],size2[1],out) + +#define s2c2OpBackSlashc2(in1,size1,in2,size2,out) cldivma(FloatComplexMatrix(in1,0,size1[0]*size1[1]),size1[0],size1[1],in2,size2[0],size2[1],out) + +#define z2z2OpBackSlashz2(in1,size1,in2,size2,out) zldivma(in1,size1[0],size1[1],in2,size2[0],size2[1],out) + +#define z2d2OpBackSlashc2(in1,size1,in2,size2,out) cldivma(in1,size1[0],size1[1],DoubleComplexMatrix(in2,0,size2[0]*size2[1]),size2[0],size2[1],out) + +#define d2z2OpBackSlashc2(in1,size1,in2,size2,out) cldivma(DoubleComplexMatrix(in1,0,size1[0]*size1[1]),size1[0],size1[1],in2,size2[0],size2[1],out) + + + + +#endif /* !__INT_OPBACKSLASH_H__ */ diff --git a/src/c/operations/interfaces/int_OpDotBackSlash.h b/src/c/operations/interfaces/int_OpDotBackSlash.h new file mode 100644 index 00000000..5ba1af3d --- /dev/null +++ b/src/c/operations/interfaces/int_OpDotBackSlash.h @@ -0,0 +1,109 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ + +#ifndef __INT_OPDOTBACKSLASH_H__ +#define __INT_OPDOTBACKSLASH_H__ + +/* Scalar .\ Scalar */ + +#define s0s0OpDotBackSlashs0(in1,in2) sldivs(in1,in2) + +#define d0d0OpDotBackSlashd0(in1,in2) dldivs(in1,in2) + +#define c0c0OpDotBackSlashc0(in1,in2) cldivs(in1,in2) + +#define z0z0OpDotBackSlashz0(in1,in2) zldivs(in1,in2) + +#define s0c0OpDotBackSlashc0(in1,in2) cldivs(FloatComplex(in1,0),in2) + +#define c0s0OpDotBackSlashc0(in1,in2) cldivs(in1,FloatComplex(in2,0)) + +#define d0z0OpDotBackSlashz0(in1,in2) zldivs(DoubleComplex(in1,0),in2) + +#define z0d0OpDotBackSlashz0(in1,in2) zldivs(in1,DoubleComplex(in2,0)) + + +/* Scalar \ Matrix */ + +#define s0s2OpDotBackSlashs2(in1,in2,size,out) {int i;\ + for(i=0;i<size[0]*size[1];i++) out[i]= sldivs(in1,in2[i]);} + +#define d0d2OpDotBackSlashd2(in1,in2,size,out) {int i;\ + for(i=0;i<size[0]*size[1];i++) out[i]= dldivs(in1,in2[i]);} + +#define c0c2OpDotBackSlashc2(in1,in2,size,out) {int i;\ + for(i=0;i<size[0]*size[1];i++) out[i]= cldivs(in1,in2[i]);} + +#define z0z2OpDotBackSlashz2(in1,in2,size,out) {int i;\ + for(i=0;i<size[0]*size[1];i++) out[i]= zldivs(in1,in2[i]);} + +#define s0c2OpDotBackSlashc2(in1,in2,size,out) c0c2OpDotBackSlashc2(FloatComplex(in1,0),in2,size,out) + +#define d0z2OpDotBackSlashz2(in1,in2,size,out) z0z2OpDotBackSlashz2(DoubleComplex(in1,0),in2,size,out) + +#define c0s2OpDotBackSlashc2(in1,in2,size,out) {int i;\ + for(i=0;i<size[0]*size[1];i++) out[i]= cldivs(in1,FloatComplex(in2[i],0));} + +#define z0d2OpDotBackSlashz2(in1,in2,size,out) {int i;\ + for(i=0;i<size[0]*size[1];i++) out[i]= zldivs(in1,DoubleComplex(in2[i],0));} + + +/* Matrix \ Scalar */ + +#define s2s0OpDotBackSlashs2(in1,size,in2,out) {int i;\ + for(i=0;i<size[0]*size[1];i++) out[i]= sldivs(in1[i],in2);} + +#define d2d0OpDotBackSlashd2(in1,size,in2,out) {int i;\ + for(i=0;i<size[0]*size[1];i++) out[i]= dldivs(in1[i],in2);} + +#define c2c0OpDotBackSlashc2(in1,size,in2,out) {int i;\ + for(i=0;i<size[0]*size[1];i++) out[i]= cldivs(in1[i],in2);} + +#define z2z0OpDotBackSlashz2(in1,size,in2,out) {int i;\ + for(i=0;i<size[0]*size[1];i++) out[i]= zldivs(in1[i],in2);} + +#define s2c0OpDotBackSlashc2(in1,size,in2,out) {int i;\ + for(i=0;i<size[0]*size[1];i++) out[i]= cldivs(FloatComplex(in1[i],0),in2);} + +#define d2z0OpDotBackSlashz2(in1,size,in2,out) {int i;\ + for(i=0;i<size[0]*size[1];i++) out[i]= zldivs(DoubleComplex(in1[i],0),in2);} + +#define c2s0OpDotBackSlashc2(in1,size,in2,out) c2c0OpDotBackSlashc2(in1,size,FloatComplex(in2,0),out) + +#define z2d0OpDotBackSlashz2(in1,size,in2,out) z2z0OpDotBackSlashz2(in1,size,DoubleComplex(in2,0),out) + +/* Matrix .\ Matrix */ + +#define s2s2OpDotBackSlashs2(in1,size1,in2,size2,out) sldiva(in1,in2,size2[0]*size2[1],out) + +#define d2d2OpDotBackSlashd2(in1,size1,in2,size2,out) dldiva(in1,in2,size2[0]*size2[1],out) + +#define c2c2OpDotBackSlashc2(in1,size1,in2,size2,out) cldiva(in1,in2,size2[0]*size2[1],out) + +#define c2s2OpDotBackSlashc2(in1,size1,in2,size2,out) {int i;\ + for(i=0;i<size1[0]*size2[1];i++) out[i]= cldivs(in1[i],FloatComplex(in2[i], 0));} + +#define s2c2OpDotBackSlashc2(in1,size1,in2,size2,out) {int i; \ + for(i=0;i<size1[0]*size2[1];i++) out[i]= cldivs(FloatComplex(in1[i], 0),in2[i]);} + +#define z2z2OpDotBackSlashz2(in1,size1,in2,size2,out) zldiva(in1,in2,size2[0]*size2[1],out) + +#define z2d2OpDotBackSlashz2(in1,size1,in2,size2,out) {int i;\ + for(i=0;i<size1[0]*size2[1];i++) out[i]= zldivs(in1[i],DoubleComplex(in2[i], 0));} + +#define d2z2OpDotBackSlashz2(in1,size1,in2,size2,out) {int i;\ + for(i=0;i<size1[0]*size2[1];i++) out[i]= zldivs(DoubleComplex(in1[i], 0),in2[i]);} + + +#endif /* !__INT_OPDOTBACKSLASH_H__ */ diff --git a/src/c/operations/interfaces/int_OpDotSlash.h b/src/c/operations/interfaces/int_OpDotSlash.h new file mode 100644 index 00000000..a6c57051 --- /dev/null +++ b/src/c/operations/interfaces/int_OpDotSlash.h @@ -0,0 +1,131 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ + +#ifndef __INT_OPDOTSLASH_H__ +#define __INT_OPDOTSLASH_H__ + +/* Scalar ./ Scalar */ + +#define s0s0OpDotSlashs0(in1,in2) srdivs(in1,in2) + +#define d0d0OpDotSlashd0(in1,in2) drdivs(in1,in2) + +#define c0c0OpDotSlashc0(in1,in2) crdivs(in1,in2) + +#define z0z0OpDotSlashz0(in1,in2) zrdivs(in1,in2) + +#define s0c0OpDotSlashc0(in1,in2) crdivs(FloatComplex(in1,0),in2) + +#define c0s0OpDotSlashc0(in1,in2) crdivs(in1,FloatComplex(in2,0)) + +#define d0z0OpDotSlashz0(in1,in2) zrdivs(DoubleComplex(in1,0),in2) + +#define z0d0OpDotSlashz0(in1,in2) zrdivs(in1,DoubleComplex(in2,0)) + + +/* Scalar / Matrix */ + + +#define s0s2OpDotSlashs2(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1/in2[i];} + + +#define d0d2OpDotSlashd2(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1/in2[i];} + + +#define c0c2OpDotSlashc2(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=crdivs(in1,in2[i]);} + + +#define z0z2OpDotSlashz2(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=crdivs(in1,in2[i]);} + +#define s0c2OpDotSlashc2(in1,in2,size,out) c0c2OpDotSlashc2(FloatComplex(in1,0),in2,size,out) + + +#define d0z2OpDotSlashz2(in1,in2,size,out) z0z2OpDotSlashz2(DoubleComplex(in1,0),in2,size,out) + + +#define c0s2OpDotSlashc2(in1,in2,size,out) {int i=0;\ + float* temp = malloc((uint)(size[0]*size[1])*sizeof(float));\ + sinverma(in2,temp,size[0]);\ + for (i=0;i<size[0]*size[1];i++) out[i]=cmuls(in1,FloatComplex(temp[i],0));} + +#define z0d2OpDotSlashz2(in1,in2,size,out) {int i=0;\ + double* temp = malloc((uint)(size[0]*size[1])*sizeof(double));\ + dinverma(in2,temp,size[0]);\ + for (i=0;i<size[0]*size[1];i++) out[i]=zmuls(in1,DoubleComplex(temp[i],0));} + + +/* Matrix / Scalar */ + + +#define s2s0OpDotSlashs2(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]/in2;} + + +#define d2d0OpDotSlashd2(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]/in2;} + + +#define c2c0OpDotSlashc2(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=crdivs(in1[i],in2);} + + +#define z2z0OpDotSlashz2(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=zrdivs(in1[i],in2);} + + +#define s2c0OpDotSlashc2(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=crdivs(FloatComplex(in1[i],0),in2);} + + +#define d2z0OpDotSlashz2(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=zrdivs(DoubleComplex(in1[i],0),in2);} + + +#define c2s0OpDotSlashc2(in1,size,in2,out) c2c0OpDotSlashc2(in1,size,FloatComplex(in2,0),out) + + +#define z2d0OpDotSlashz2(in1,size,in2,out) z2z0OpDotSlashz2(in1,size,DoubleComplex(in2,0),out) + + + +/* Matrix ./ Matrix */ + +#define s2s2OpDotSlashs2(in1,size1,in2,size2,out) srdiva(in1,in2,size2[0]*size2[1],out) + +#define d2d2OpDotSlashd2(in1,size1,in2,size2,out) drdiva(in1,in2,size2[0]*size2[1],out) + +#define c2c2OpDotSlashc2(in1,size1,in2,size2,out) crdiva(in1,in2,size2[0]*size2[1],out) + +#define z2z2OpDotSlashz2(in1,size1,in2,size2,out) zrdiva(in1,in2,size2[0]*size2[1],out) + + +#define c2s2OpDotSlashc2(in1,size1,in2,size2,out) {int i=0;\ + for (i=0;i<size1[0]*size2[1];i++) out[i]=crdivs(in1[i],FloatComplex(in2[i],0));} + +#define s2c2OpDotSlashc2(in1,size1,in2,size2,out) {int i=0;\ + for (i=0;i<size1[0]*size2[1];i++) out[i]=crdivs(FloatComplex(in1[i],0),in2[i]);} + +#define z2d2OpDotSlashz2(in1,size1,in2,size2,out) {int i=0;\ + for (i=0;i<size1[0]*size2[1];i++) out[i]=zrdivs(in1[i],DoubleComplex(in2[i],0));} + +#define d2z2OpDotSlashz2(in1,size1,in2,size2,out) {int i=0;\ + for (i=0;i<size1[0]*size2[1];i++) out[i]=zrdivs(DoubleComplex(in1[i],0),in2[i]);} + + + +#endif /* !__INT_OPDOTSLASH_H__ */ diff --git a/src/c/operations/interfaces/int_OpDotStar.h b/src/c/operations/interfaces/int_OpDotStar.h new file mode 100644 index 00000000..22e09a92 --- /dev/null +++ b/src/c/operations/interfaces/int_OpDotStar.h @@ -0,0 +1,111 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ + +#ifndef __INT_OPDOTSTAR_H__ +#define __INT_OPDOTSTAR_H__ + +/* Scalar .* Scalar */ + +#define s0s0OpDotStars0(in1,in2) smuls(in1,in2) + +#define d0d0OpDotStard0(in1,in2) dmuls(in1,in2) + +#define c0c0OpDotStarc0(in1,in2) cmuls(in1,in2) + +#define z0z0OpDotStarz0(in1,in2) zmuls(in1,in2) + +#define s0c0OpDotStarc0(in1,in2) cmuls(FloatComplex(in1,0),in2) + +#define c0s0OpDotStarc0(in1,in2) cmuls(in1,FloatComplex(in2,0)) + +#define d0z0OpDotStarz0(in1,in2) zmuls(DoubleComplex(in1,0),in2) + +#define z0d0OpDotStarz0(in1,in2) zmuls(in1,DoubleComplex(in2,0)) + + +/* Scalar .* Matrix */ + +#define s0s2OpDotStars2(in1,in2,size,out) {int i=0;\ + for(i=0;i<size[0]*size[1];i++) out[i]= smuls(in1,in2[i]);} + +#define d0d2OpDotStard2(in1,in2,size,out) {int i=0;\ + for(i=0;i<size[0]*size[1];i++) out[i]= dmuls(in1,in2[i]);} + +#define c0c2OpDotStarc2(in1,in2,size,out) {int i=0;\ + for(i=0;i<size[0]*size[1];i++) out[i]= cmuls(in1,in2[i]);} + +#define z0z2OpDotStarz2(in1,in2,size,out) {int i=0;\ + for(i=0;i<size[0]*size[1];i++) out[i]= zmuls(in1,in2[i]);} + +#define s0c2OpDotStarc2(in1,in2,size,out) c0c2OpDotStarc2(FloatComplex(in1,0),in2,size,out) + +#define d0z2OpDotStarz2(in1,in2,size,out) z0z2OpDotStarz2(DoubleComplex(in1,0),in2,size,out) + +#define c0s2OpDotStarc2(in1,in2,size,out) {int i=0;\ + for(i=0;i<size[0]*size[1];i++) out[i]= cmuls(in1,FloatComplex(in2[i],0));} + +#define z0d2OpDotStarz2(in1,in2,size,out) {int i=0;\ + for(i=0;i<size[0]*size[1];i++) out[i]= zmuls(in1,DoubleComplex(in2[i],0));} + + +/* Matrix .* Scalar */ + +#define s2s0OpDotStars2(in1,size,in2,out) {int i=0;\ + for(i=0;i<size[0]*size[1];i++) out[i]= smuls(in1[i],in2);} + +#define d2d0OpDotStard2(in1,size,in2,out) {int i=0;\ + for(i=0;i<size[0]*size[1];i++) out[i]= dmuls(in1[i],in2);} + +#define c2c0OpDotStarc2(in1,size,in2,out) {int i=0;\ + for(i=0;i<size[0]*size[1];i++) out[i]= cmuls(in1[i],in2);} + +#define z2z0OpDotStarz2(in1,size,in2,out) {int i=0;\ + for(i=0;i<size[0]*size[1];i++) out[i]= zmuls(in1[i],in2);} + +#define s2c0OpDotStarc2(in1,size,in2,out) {int i=0;\ + for(i=0;i<size[0]*size[1];i++) out[i]= cmuls(FloatComplex(in1[i],0),in2);} + +#define d2z0OpDotStarz2(in1,size,in2,out) {int i=0;\ + for(i=0;i<size[0]*size[1];i++) out[i]= zmuls(DoubleComplex(in1[i],0),in2);} + +#define c2s0OpDotStarc2(in1,size,in2,out) c2c0OpDotStarc2(in1,size,FloatComplex(in2,0),out) + +#define z2d0OpDotStarz2(in1,size,in2,out) z2z0OpDotStarz2(in1,size,DoubleComplex(in2,0),out) + +/* Matrix .* Matrix */ + +#define s2s2OpDotStars2(in1,size1,in2,size2,out) smula(in1,in2,size1[0]*size2[1],out) + +#define d2d2OpDotStard2(in1,size1,in2,size2,out) dmula(in1,in2,size1[0]*size2[1],out) + +#define c2c2OpDotStarc2(in1,size1,in2,size2,out) cmula(in1,in2,size1[0]*size2[1],out) + +#define z2z2OpDotStarz2(in1,size1,in2,size2,out) zmula(in1,in2,size1[0]*size2[1],out) + + +#define c2s2OpDotStarc2(in1,size1,in2,size2,out) {int i=0;\ + for(i=0;i<size1[0]*size2[1];i++) out[i]= cmuls(in1[i],FloatComplex(in2[i],0));} + +#define s2c2OpDotStarc2(in1,size1,in2,size2,out) {int i=0;\ + for(i=0;i<size1[0]*size2[1];i++) out[i]= cmuls(FloatComplex(in1[i],0),in2[i]);} + + +#define z2d2OpDotStarz2(in1,size1,in2,size2,out) {int i=0;\ + for(i=0;i<size1[0]*size2[1];i++) out[i]= zmuls(in1[i],DoubleComplex(in2[i],0));} + +#define d2z2OpDotStarz2(in1,size1,in2,size2,out) {int i=0;\ + for(i=0;i<size1[0]*size2[1];i++) out[i]= zmuls(DoubleComplex(in1[i],0),in2[i]);} + + +#endif /* !__INT_OPDOTSTAR_H__ */ diff --git a/src/c/operations/interfaces/int_OpEqual.h b/src/c/operations/interfaces/int_OpEqual.h new file mode 100644 index 00000000..869b28dc --- /dev/null +++ b/src/c/operations/interfaces/int_OpEqual.h @@ -0,0 +1,39 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ + +#ifndef __INT_OPEQUAL_H__ +#define __INT_OPEQUAL_H__ + + +#define s0OpEquals0(in) in + +#define d0OpEquald0(in) in + +#define c0OpEqualc0(in) in + +#define z0OpEqualz0(in) in + +#define s2OpEquals2(in1,size,out) {int i=0; \ + for (i = 0 ; i<size[0] * size[1] ; i++) out[i]=in1[i]; \ + } + +#define d2OpEquald2(in1,size,out) {int i=0; \ + for (i = 0 ; i<size[0] * size[1] ; i++) out[i]=in1[i]; \ + } + +#define g2OpEqualg2(in1,size,out) {int i=0; \ + for (i = 0 ; i<size[0] * size[1] ; i++) out[i]=in1[i]; \ + } + +#endif /* !__INT_OPEQUAL_H__ */ diff --git a/src/c/operations/interfaces/int_OpExt.h b/src/c/operations/interfaces/int_OpExt.h new file mode 100644 index 00000000..8d796f73 --- /dev/null +++ b/src/c/operations/interfaces/int_OpExt.h @@ -0,0 +1,104 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ + +#ifndef __INT_OPEXT_H__ +#define __INT_OPEXT_H__ + +#define s2s0OpExts0(in1,size,in2) in1[((int)in2)-1]; +#define d2d0OpExtd0(in1,size,in2) in1[((int)in2)-1]; +#define c2s0OpExtc0(in1,size,in2) in1[((int)in2)-1]; +#define z2d0OpExtz0(in1,size,in2) in1[((int)in2)-1]; + + +#define s2s0s0OpExts0(in1,size,row,col) in1[(((int) col)-1)*size[0]+((int) row)-1]; +#define d2d0d0OpExtd0(in1,size,row,col) in1[(((int) col)-1)*size[0]+((int) row)-1]; +#define c2s0s0OpExtc0(in1,size,row,col) in1[(((int) col)-1)*size[0]+((int) row)-1]; +#define z2d0d0OpExtz0(in1,size,row,col) in1[(((int) col)-1)*size[0]+((int) row)-1]; + + +#define s2s2OpExts2(in1,size1,in2,size2,out) {int i; \ + for (i=0;i<size2[0]*size2[1];i++) out[i]=in1[(int)in2[i]-1]; \ + } + +#define d2d2OpExtd2(in1,size1,in2,size2,out) {int i; \ + for (i=0;i<size2[0]*size2[1];i++) out[i]=in1[(int)in2[i]-1]; \ + } + +#define c2s2OpExtc2(in1,size1,in2,size2,out) {int i; \ + for (i=0;i<size2[0]*size2[1];i++) out[i]=in1[(int)in2[i]-1]; \ + } + +#define z2d2OpExtz2(in1,size1,in2,size2,out) {int i; \ + for (i=0;i<size2[0]*size2[1];i++) out[i]=in1[(int)in2[i]-1]; \ + } + + +#define s2s2s0OpExts2(in1,size1,rows,size2,col,out) {int i; \ + for (i=0;i<size2[0]*size2[1];i++) out[i]=s2s0s0OpExts0(in1,size1,(int)rows[i],((int) col)); \ + } + +#define d2d2d0OpExtd2(in1,size1,rows,size2,col,out) {int i; \ + for (i=0;i<size2[0]*size2[1];i++) out[i]=d2d0d0OpExtd0(in1,size1,(int)rows[i],((int) col)); \ + } + +#define c2s2s0OpExtc2(in1,size1,rows,size2,col,out) {int i; \ + for (i=0;i<size2[0]*size2[1];i++) out[i]=c2s0s0OpExtc0(in1,size1,(int)rows[i],((int) col)); \ + } + +#define z2d2d0OpExtz2(in1,size1,rows,size2,col,out) {int i; \ + for (i=0;i<size2[0]*size2[1];i++) out[i]=z2d0d0OpExtz0(in1,size1,(int)rows[i],((int) col)); \ + } + +#define s2s0s2OpExts2(in1,size1,row,cols,size2,out) {int i; \ + for (i=0;i<size2[0]*size2[1];i++) out[i]=s2s0s0OpExts0(in1,size1,((int) row),(int)cols[i]); \ + } + +#define d2d0d2OpExtd2(in1,size1,row,cols,size2,out) {int i; \ + for (i=0;i<size2[0]*size2[1];i++) out[i]=d2d0d0OpExtd0(in1,size1,((int) row),(int)cols[i]); \ + } + +#define c2s0s2OpExtc2(in1,size1,row,cols,size2,out) {int i; \ + for (i=0;i<size2[0]*size2[1];i++) out[i]=c2s0s0OpExtc0(in1,size1,((int) row),(int)cols[i]); \ + } + +#define z2d0d2OpExtz2(in1,size1,row,cols,size2,out) {int i; \ + for (i=0;i<size2[0]*size2[1];i++) out[i]=z2d0d0OpExtz0(in1,size1,((int) row),(int)cols[i]); \ + } + + +#define s2s2s2OpExts2(in1,size1,rows,size2,cols,size3,out) {int i,j; \ + for (i=0;i<size2[0]*size2[1];i++) \ + for (j=0;j<size3[0]*size3[1];j++) \ + out[i+j*size2[0]*size2[1]] = in1[((int)(cols[j])-1)*size1[0]+(int)(rows[i])-1]; \ + } + +#define d2d2d2OpExtd2(in1,size1,rows,size2,cols,size3,out) {int i,j; \ + for (i=0;i<size2[0]*size2[1];i++) \ + for (j=0;j<size3[0]*size3[1];j++) \ + out[i+j*size2[0]*size2[1]] = in1[((int)(cols[j])-1)*size1[0]+(int)(rows[i])-1]; \ + } + +#define c2s2s2OpExtc2(in1,size1,rows,size2,cols,size3,out) {int i,j; \ + for (i=0;i<size2[0]*size2[1];i++) \ + for (j=0;j<size3[0]*size3[1];j++) \ + out[i+j*size2[0]*size2[1]] = in1[((int)(cols[j])-1)*size1[0]+(int)(rows[i])-1]; \ + } + +#define z2d2d2OpExtz2(in1,size1,rows,size2,cols,size3,out) {int i,j; \ + for (i=0;i<size2[0]*size2[1];i++) \ + for (j=0;j<size3[0]*size3[1];j++) \ + out[i+j*size2[0]*size2[1]] = in1[((int)(cols[j])-1)*size1[0]+(int)(rows[i])-1]; \ + } + +#endif /* !__INT_OPEXT_H__ */ diff --git a/src/c/operations/interfaces/int_OpIns.h b/src/c/operations/interfaces/int_OpIns.h new file mode 100644 index 00000000..6f6d0227 --- /dev/null +++ b/src/c/operations/interfaces/int_OpIns.h @@ -0,0 +1,352 @@ +/* +** -*- C -*- +** +** +** Made by Raffaele.Nutricato@tiscali.it +** +** Copyright Raffaele Nutricato +*/ + +/* + Modify by Arnaud Torset : 20/02/09 +*/ + +#ifndef __OPINS_H__ +#define __OPINS_H__ + + +/* a(3)=2 */ +#define s2s0s0OpIns(in,size,indice,newVal) in[(int) indice-1]=newVal; + +#define d2d0d0OpIns(in,size,indice,newVal) in[(int) indice-1]=newVal; + +#define c2s0c0OpIns(in,size,indice,newVal) in[(int) indice-1]=newVal; + +#define z2d0z0OpIns(in,size,indice,newVal) in[(int) indice-1]=newVal; + +/* a([1 2])=2 */ +#define s2s2s0OpIns(in,size1,indices,size2,newVal) {int i;\ + for (i=0;i<size2[0]*size2[1];i++) in[(int)indices[i]-1]=newVal;\ + } + + +#define d2d2d0OpIns(in,size1,indices,size2,newVal) {int i;\ + for (i=0;i<size2[0]*size2[1];i++) in[(int)indices[i]-1]=newVal;\ + } + +#define c2s2c0OpIns(in,size1,indices,size2,newVal) {int i;\ + for (i=0;i<size2[0]*size2[1];i++) in[(int)indices[i]-1]=newVal;\ + } + +#define z2d2z0OpIns(in,size1,indices,size2,newVal) {int i;\ + for (i=0;i<size2[0]*size2[1];i++) in[(int)indices[i]-1]=newVal;\ + } +/* a([1 2])=[3,1] */ +#define s2s2s2OpIns(in,size1,indices,size2,newVals,size3) {int i;\ + for (i=0;i<size2[0]*size3[1];i++) in[(int)indices[i]-1]=newVals[i];\ + } + + +#define d2d2d2OpIns(in,size1,indices,size2,newVals,size3) {int i;\ + for (i=0;i<size2[0]*size3[1];i++) in[(int)indices[i]-1]=newVals[i];\ + } + +#define c2s2c2OpIns(in,size1,indices,size2,newVals,size3) {int i;\ + for (i=0;i<size2[0]*size3[1];i++) in[(int)indices[i]-1]=newVals[i];\ + } + +#define z2d2z2OpIns(in,size1,indices,size2,newVals,size3) {int i;\ + for (i=0;i<size2[0]*size3[1];i++) in[(int)indices[i]-1]=newVals[i];\ + } + + +/* a(1,3)=2 */ +#define s2s0s0s0OpIns(in,size,row,col,newVal) in[(int)(col-1)*size[0]+(int)row-1]=newVal; + +#define d2d0d0d0OpIns(in,size,row,col,newVal) in[(int)(col-1)*size[0]+(int)row-1]=newVal; + +#define c2s0s0c0OpIns(in,size,row,col,newVal) in[(int)(col-1)*size[0]+(int)row-1]=newVal; + +#define z2d0d0z0OpIns(in,size,row,col,newVal) in[(int)(col-1)*size[0]+(int)row-1]=newVal; + + +/* a(1,[3,1])=2 */ +#define s2s0s2s0OpIns(in,size1,row,cols,size2,newVal) {int i;\ + for (i=0;i<size2[0]*size2[1];i++) in[(int)(cols[i]-1)*size1[0]+(int)row-1]=newVal;\ + } + +#define d2d0d2d0OpIns(in,size1,row,cols,size2,newVal) {int i;\ + for (i=0;i<size2[0]*size2[1];i++) in[(int)(cols[i]-1)*size1[0]+(int)row-1]=newVal;\ + } + +#define c2s0s2c0OpIns(in,size1,row,cols,size2,newVal) {int i;\ + for (i=0;i<size2[0]*size2[1];i++) in[(int)(cols[i]-1)*size1[0]+(int)row-1]=newVal;\ + } + +#define z2d0d2z0OpIns(in,size1,row,cols,size2,newVal) {int i;\ + for (i=0;i<size2[0]*size2[1];i++) in[(int)(cols[i]-1)*size1[0]+(int)row-1]=newVal;\ + } + + +/* a([3,1],1)=2 */ +#define s2s2s0s0OpIns(in,size1,rows,size2,col,newVal) {int i;\ + for (i=0;i<size2[0]*size2[1];i++) in[(int)(col-1)*size1[0]+(int)rows[i]-1]=newVal;\ + } + +#define d2d2d0d0OpIns(in,size1,rows,size2,col,newVal) {int i;\ + for (i=0;i<size2[0]*size2[1];i++) in[(int)(col-1)*size1[0]+(int)rows[i]-1]=newVal;\ + } + +#define c2s2s0c0OpIns(in,size1,rows,size2,col,newVal) {int i;\ + for (i=0;i<size2[0]*size2[1];i++) in[(int)(col-1)*size1[0]+(int)rows[i]-1]=newVal;\ + } + +#define z2d2d0z0OpIns(in,size1,rows,size2,col,newVal) {int i;\ + for (i=0;i<size2[0]*size2[1];i++) in[(int)(col-1)*size1[0]+(int)rows[i]-1]=newVal;\ + } + +/* a([3,1],[1 2])=2 */ +#define s2s2s2s0OpIns(in,size1,rows,size2,cols,size3,newVal) {int i,j;\ + for (i=0;i<size3[0]*size3[1];i++)\ + for (j=0;j<size2[0]*size2[1];j++)\ + in[(int)(cols[i]-1)*size1[0]+(int)rows[j]-1]=newVal;\ + } + +#define d2d2d2d0OpIns(in,size1,rows,size2,cols,size3,newVal) {int i,j;\ + for (i=0;i<size3[0]*size3[1];i++)\ + for (j=0;j<size2[0]*size2[1];j++)\ + in[(int)(cols[i]-1)*size1[0]+(int)rows[j]-1]=newVal;\ + } + +#define c2s2s2c0OpIns(in,size1,rows,size2,cols,size3,newVal) {int i,j;\ + for (i=0;i<size3[0]*size3[1];i++)\ + for (j=0;j<size2[0]*size2[1];j++)\ + in[(int)(cols[i]-1)*size1[0]+(int)rows[j]-1]=newVal;\ + } + +#define z2d2d2z0OpIns(in,size1,rows,size2,cols,size3,newVal) {int i,j;\ + for (i=0;i<size3[0]*size3[1];i++)\ + for (j=0;j<size2[0]*size2[1];j++)\ + in[(int)(cols[i]-1)*size1[0]+(int)rows[j]-1]=newVal;\ + } +/* a(1,[3,1])=[2,5] */ +#define s2s0s2s2OpIns(in,size1,row,cols,size2,newVals,size3) {int i;\ + for (i=0;i<size2[0]*size2[1];i++)\ + in[(int)(cols[i]-1)*size1[0]+(int)row-1]=newVals[i];\ + } + +#define d2d0d2d2OpIns(in,size1,row,cols,size2,newVals,size3) {int i;\ + for (i=0;i<size2[0]*size2[1];i++)\ + in[(int)(cols[i]-1)*size1[0]+(int)row-1]=newVals[i];\ + } + +#define c2s0s2c2OpIns(in,size1,row,cols,size2,newVals,size3) {int i;\ + for (i=0;i<size2[0]*size2[1];i++)\ + in[(int)(cols[i]-1)*size1[0]+(int)row-1]=newVals[i];\ + } + +#define z2d0d2z2OpIns(in,size1,row,cols,size2,newVals,size3) {int i;\ + for (i=0;i<size2[0]*size2[1];i++)\ + in[(int)(cols[i]-1)*size1[0]+(int)row-1]=newVals[i];\ + } +/* a([3,1],1)=[2,5] */ +#define s2s2s0s2OpIns(in,size1,rows,size2,col,newVals,size3) {int i;\ + for (i=0;i<size2[0]*size2[1];i++)\ + in[(int)(col-1)*size1[0]+(int)rows[i]-1]=newVals[i];\ + } + +#define d2d2d0d2OpIns(in,size1,rows,size2,col,newVals,size3) {int i;\ + for (i=0;i<size2[0]*size2[1];i++)\ + in[(int)(col-1)*size1[0]+(int)rows[i]-1]=newVals[i];\ + } + +#define c2s2s0c2OpIns(in,size1,rows,size2,col,newVals,size3) {int i;\ + for (i=0;i<size2[0]*size2[1];i++)\ + in[(int)(col-1)*size1[0]+(int)rows[i]-1]=newVals[i];\ + } + +#define z2d2d0z2OpIns(in,size1,rows,size2,col,newVals,size3) {int i;\ + for (i=0;i<size2[0]*size2[1];i++)\ + in[(int)(col-1)*size1[0]+(int)rows[i]-1]=newVals[i];\ + } + +/* a([3,1],[1 2])=[2,1,3,5] */ +#define s2s2s2s2OpIns(in,size1,rows,size2,cols,size3,newVals,size4) {int i,j;\ + for (i=0;i<size3[0]*size3[1];i++)\ + for (j=0;j<size2[0]*size2[1];j++)\ + in[(int)(cols[i]-1)*size1[0]+(int)rows[j]-1]=newVals[i*size4[0]+j];\ + } + +#define d2d2d2d2OpIns(in,size1,rows,size2,cols,size3,newVals,size4) {int i,j;\ + for (i=0;i<size3[0]*size3[1];i++)\ + for (j=0;j<size2[0]*size2[1];j++)\ + in[(int)(cols[i]-1)*size1[0]+(int)rows[j]-1]=newVals[i*size4[0]+j];\ + } + +#define c2s2s2c2OpIns(in,size1,rows,size2,cols,size3,newVals,size4) {int i,j;\ + for (i=0;i<size3[0]*size3[1];i++)\ + for (j=0;j<size2[0]*size2[1];j++)\ + in[(int)(cols[i]-1)*size1[0]+(int)rows[j]-1]=newVals[i*size4[0]+j];\ + } + +#define z2d2d2z2OpIns(in,size1,rows,size2,cols,size3,newVals,size4) {int i,j;\ + for (i=0;i<size3[0]*size3[1];i++)\ + for (j=0;j<size2[0]*size2[1];j++)\ + in[(int)(cols[i]-1)*size1[0]+(int)rows[j]-1]=newVals[i*size4[0]+j];\ + } + + +/* Mixed types +2 cases : we assign a real in a complex array => ok, we just have put the imaginary part to 0 + we assign a complex in a real array => ko, we can't enlarge the input matrix. So we just replace by the real part of the complex +*/ + +/* a(3)=2 */ +#define s2s0c0OpIns(in,size,indice,newVal) s2s0s0OpIns(in,size,indice,creals(newVal)) + +#define d2d0z0OpIns(in,size,indice,newVal) d2d0d0OpIns(in,size,indice,zreals(newVal)) + +#define c2s0s0OpIns(in,size,indice,newVal) c2s0c0OpIns(in,size,indice,FloatComplex(newVal,0)) + +#define z2d0d0OpIns(in,size,indice,newVal) z2d0z0OpIns(in,size,indice,DoubleComplex(newVal,0)) + + +/* a([1 2])=2 */ +#define s2s2c0OpIns(in,size1,indices,size2,newVal) s2s2s0OpIns(in,size1,indices,size2,creals(newVal)) + +#define d2d2z0OpIns(in,size1,indices,size2,newVal) d2d2d0OpIns(in,size1,indices,size2,zreals(newVal)) + +#define c2s2s0OpIns(in,size1,indices,size2,newVal) c2s2c0OpIns(in,size1,indices,size2,FloatComplex(newVal,0)) + +#define z2d2d0OpIns(in,size1,indices,size2,newVal) z2d2z0OpIns(in,size1,indices,size2,DoubleComplex(newVal,0)) + + +/* a([1 2])=[3,1] */ +#define s2s2c2OpIns(in,size1,indices,size2,newVals,size3) {int i;\ + for (i=0;i<size2[0]*size3[1];i++) in[(int)indices[i]-1]=creals(newVals[i]);\ + } + + +#define d2d2z2OpIns(in,size1,indices,size2,newVals,size3) {int i;\ + for (i=0;i<size2[0]*size3[1];i++) in[(int)indices[i]-1]=zreals(newVals[i]);\ + } + +#define c2s2s2OpIns(in,size1,indices,size2,newVals,size3) {int i;\ + for (i=0;i<size2[0]*size3[1];i++) in[(int)indices[i]-1]=FloatComplex(newVals[i],0);\ + } + +#define z2d2d2OpIns(in,size1,indices,size2,newVals,size3) {int i;\ + for (i=0;i<size2[0]*size3[1];i++) in[(int)indices[i]-1]=DoubleComplex(newVals[i],0);\ + } + + +/* a(1,3)=2 */ +#define s2s0s0c0OpIns(in,size,row,col,newVal) s2s0s0s0OpIns(in,size,row,col,creals(newVal)) + +#define d2d0d0z0OpIns(in,size,row,col,newVal) d2d0d0d0OpIns(in,size,row,col,zreals(newVal)) + +#define c2s0s0s0OpIns(in,size,row,col,newVal) c2s0s0c0OpIns(in,size,row,col,FloatComplex(newVal,0)) + +#define z2d0d0d0OpIns(in,size,row,col,newVal) z2d0d0z0OpIns(in,size,row,col,DoubleComplex(newVal,0)) + + +/* a(1,[3,1])=2 */ +#define s2s0s2c0OpIns(in,size1,row,cols,size2,newVal) s2s0s2s0OpIns(in,size1,row,cols,size2,creals(newVal)) + +#define d2d0d2z0OpIns(in,size1,row,cols,size2,newVal) d2d0d2d0OpIns(in,size1,row,cols,size2,zreals(newVal)) + +#define c2s0s2s0OpIns(in,size1,row,cols,size2,newVal) c2s0s2c0OpIns(in,size1,row,cols,size2,FloatComplex(newVal,0)) + +#define z2d0d2d0OpIns(in,size1,row,cols,size2,newVal) z2d0d2z0OpIns(in,size1,row,cols,size2,DoubleComplex(newVal,0)) + + +/* a([3,1],1)=2 */ +#define s2s2s0c0OpIns(in,size1,rows,size2,col,newVal) s2s2s0s0OpIns(in,size1,rows,size2,col,creals(newVal)) + +#define d2d2d0z0OpIns(in,size1,rows,size2,col,newVal) d2d2d0d0OpIns(in,size1,rows,size2,col,zreals(newVal)) + +#define c2s2s0s0OpIns(in,size1,rows,size2,col,newVal) c2s2s0c0OpIns(in,size1,rows,size2,col,FloatComplex(newVal,0)) + +#define z2d2d0d0OpIns(in,size1,rows,size2,col,newVal) z2d2d0z0OpIns(in,size1,rows,size2,col,DoubleComplex(newVal,0)) + +/* a([3,1],[1 2])=2 */ +#define s2s2s2c0OpIns(in,size1,rows,size2,cols,size3,newVal) s2s2s2s0OpIns(in,size1,rows,size2,cols,size3,creals(newVal)) + +#define d2d2d2z0OpIns(in,size1,rows,size2,cols,size3,newVal) d2d2d2d0OpIns(in,size1,rows,size2,cols,size3,zreals(newVal)) + +#define c2s2s2s0OpIns(in,size1,rows,size2,cols,size3,newVal) c2s2s2c0OpIns(in,size1,rows,size2,cols,size3,FloatComplex(newVal,0)) + +#define z2d2d2d0OpIns(in,size1,rows,size2,cols,size3,newVal) z2d2d2z0OpIns(in,size1,rows,size2,cols,size3,DoubleComplex(newVal,0)) + + +/* a(1,[3,1])=[2,5] */ +#define s2s0s2c2OpIns(in,size1,row,cols,size2,newVals,size3) {int i;\ + for (i=0;i<size2[0]*size2[1];i++)\ + in[(int)(cols[i]-1)*size1[0]+(int)row-1]=creals(newVals[i]);\ + } + +#define d2d0d2z2OpIns(in,size1,row,cols,size2,newVals,size3) {int i;\ + for (i=0;i<size2[0]*size2[1];i++)\ + in[(int)(cols[i]-1)*size1[0]+(int)row-1]=zreals(newVals[i]);\ + } + +#define c2s0s2s2OpIns(in,size1,row,cols,size2,newVals,size3) {int i;\ + for (i=0;i<size2[0]*size2[1];i++)\ + in[(int)(cols[i]-1)*size1[0]+(int)row-1]=FloatComplex(newVals[i],0);\ + } + +#define z2d0d2d2OpIns(in,size1,row,cols,size2,newVals,size3) {int i;\ + for (i=0;i<size2[0]*size2[1];i++)\ + in[(int)(cols[i]-1)*size1[0]+(int)row-1]=DoubleComplex(newVals[i],0);\ + } +/* a([3,1],1)=[2,5] */ +#define s2s2s0c2OpIns(in,size1,rows,size2,col,newVals,size3) {int i;\ + for (i=0;i<size2[0]*size2[1];i++)\ + in[(int)(col-1)*size1[0]+(int)rows[i]-1]=creals(newVals[i]);\ + } + +#define d2d2d0z2OpIns(in,size1,rows,size2,col,newVals,size3) {int i;\ + for (i=0;i<size2[0]*size2[1];i++)\ + in[(int)(col-1)*size1[0]+(int)rows[i]-1]=zreals(newVals[i]);\ + } + +#define c2s2s0s2OpIns(in,size1,rows,size2,col,newVals,size3) {int i;\ + for (i=0;i<size2[0]*size2[1];i++)\ + in[(int)(col-1)*size1[0]+(int)rows[i]-1]=FloatComplex(newVals[i],0);\ + } + +#define z2d2d0d2OpIns(in,size1,rows,size2,col,newVals,size3) {int i;\ + for (i=0;i<size2[0]*size2[1];i++)\ + in[(int)(col-1)*size1[0]+(int)rows[i]-1]=DoubleComplex(newVals[i],0);\ + } + +/* a([3,1],[1 2])=[2,1,3,5] */ +#define s2s2s2c2OpIns(in,size1,rows,size2,cols,size3,newVals,size4)\ + {int i,j;\ + for (i=0;i<size3[0]*size3[1];i++)\ + for (j=0;j<size2[0]*size2[1];j++)\ + in[(int)(cols[i]-1)*size1[0]+(int)rows[j]-1]=creals(newVals[i*size4[0]+j]);\ + } + +#define d2d2d2z2OpIns(in,size1,rows,size2,cols,size3,newVals,size4)\ + {int i,j;\ + for (i=0;i<size3[0]*size3[1];i++)\ + for (j=0;j<size2[0]*size2[1];j++)\ + in[(int)(cols[i]-1)*size1[0]+(int)rows[j]-1]=zreals(newVals[i*size4[0]+j]);\ + } + +#define c2s2s2s2OpIns(in,size1,rows,size2,cols,size3,newVals,size4)\ + {int i,j;\ + for (i=0;i<size3[0]*size3[1];i++)\ + for (j=0;j<size2[0]*size2[1];j++)\ + in[(int)(cols[i]-1)*size1[0]+(int)rows[j]-1]=FloatComplex(newVals[i*size4[0]+j],0);\ + } + +#define z2d2d2d2OpIns(in,size1,rows,size2,cols,size3,newVals,size4)\ + {int i,j;\ + for (i=0;i<size3[0]*size3[1];i++)\ + for (j=0;j<size2[0]*size2[1];j++)\ + in[(int)(cols[i]-1)*size1[0]+(int)rows[j]-1]=DoubleComplex(newVals[i*size4[0]+j],0);\ + } + +#endif /* !__OPINS_H__ */ diff --git a/src/c/operations/interfaces/int_OpLogAnd.h b/src/c/operations/interfaces/int_OpLogAnd.h new file mode 100644 index 00000000..460c81ca --- /dev/null +++ b/src/c/operations/interfaces/int_OpLogAnd.h @@ -0,0 +1,122 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ + +#ifndef __INT_OPLOGAND_H__ +#define __INT_OPLOGAND_H__ + +#define Bool2Float(in) ((in) ? 1.0f : 0.0f) + +#define Bool2Double(in) ((in) ? 1.0 : 0.0) + +/*scalar and scalar*/ + +#define s0s0OpLogAnds0(in1, in2) Bool2Float(in1 != 0.0 && in2 != 0.0) + +#define s0c0OpLogAnds0(in1, in2) Bool2Float(in1 != 0.0 && (creals(in2) != 0.0 || cimags(in2))) + +#define c0s0OpLogAnds0(in1, in2) Bool2Float((creals(in1) != 0.0 || cimags(in1) != 0.0) && in2 != 0.0) + +#define c0c0OpLogAnds0(in1, in2) Bool2Float((creals(in1) != 0.0 || cimags(in1) != 0.0) && (creals(in2) != 0.0 || cimags(in2))) + + +#define d0d0OpLogAndd0(in1, in2) Bool2Double(in1 != 0.0 && in2 != 0.0) + +#define z0z0OpLogAndd0(in1, in2) Bool2Double((zreals(in1) != 0.0 || zimags(in1) != 0.0) && (zreals(in2) != 0.0 || zimags(in2))) + +#define d0z0OpLogAndd0(in1, in2) Bool2Double(in1 != 0.0 && (zreals(in2) != 0.0 || zimags(in2))) + +#define z0d0OpLogAndd0(in1, in2) Bool2Double((zreals(in1) != 0.0 || zimags(in1) != 0.0) && in2 != 0.0) + +/*matrix and scalar*/ + +#define s2s0OpLogAnds2(in1, size1, in2, out) {int i = 0 ;\ + for (i = 0 ; i < size1[0]*size1[1] ; i++ ) out[i] = Bool2Float(in1[i] != 0.0 && in2 != 0.0);} + +#define s2c0OpLogAnds2(in1, size1, in2, out) {int i = 0 ;\ + for (i = 0 ; i < size1[0]*size1[1] ; i++ ) out[i] = Bool2Float(in1[i] != 0.0 && (creals(in2) != 0.0 || cimags(in2)));} + +#define c2s0OpLogAnds2(in1, size1, in2, out) {int i = 0 ;\ + for (i = 0 ; i < size1[0]*size1[1] ; i++ ) out[i] = Bool2Float((creals(in1[i]) != 0.0 || cimags(in1[i]) != 0.0) && in2 != 0.0);} + +#define c2c0OpLogAnds2(in1, size1, in2, out) {int i = 0 ;\ + for (i = 0 ; i < size1[0]*size1[1] ; i++ ) out[i] = Bool2Float((creals(in1[i]) != 0.0 || cimags(in1[i]) != 0.0) && (creals(in2) != 0.0 || cimags(in2)));} + + +#define d2d0OpLogAndd2(in1, size1, in2, out) {int i = 0 ;\ + for (i = 0 ; i < size1[0]*size1[1] ; i++ ) out[i] = Bool2Double(in1[i] != 0.0 && in2 != 0.0);} + +#define z2z0OpLogAndd2(in1, size1, in2, out) {int i = 0 ;\ + for (i = 0 ; i < size1[0]*size1[1] ; i++ ) out[i] = Bool2Double((zreals(in1[i]) != 0.0 || zimags(in1[i]) != 0.0) && (zreals(in2) != 0.0 || zimags(in2)));} + +#define d2z0OpLogAndd2(in1, size1, in2, out) {int i = 0 ;\ + for (i = 0 ; i < size1[0]*size1[1] ; i++ ) out[i] = Bool2Double(in1[i] != 0.0 && (zreals(in2) != 0.0 || zimags(in2)));} + +#define z2d0OpLogAndd2(in1, size1, in2, out) {int i = 0 ;\ + for (i = 0 ; i < size1[0]*size1[1] ; i++ ) out[i] = Bool2Double((zreals(in1[i]) != 0.0 || zimags(in1[i]) != 0.0) && in2 != 0.0);} + +/*scalar and matrix*/ + +#define s0s2OpLogAnds2(in1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float(in1 != 0.0 && in2[i] != 0.0);} + +#define s0c2OpLogAnds2(in1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float(in1 != 0.0 && (creals(in2[i]) != 0.0 || cimags(in2[i])));} + +#define c0s2OpLogAnds2(in1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float((creals(in1) != 0.0 || cimags(in1) != 0.0) && in2[i] != 0.0);} + +#define c0c2OpLogAnds2(in1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float((creals(in1) != 0.0 || cimags(in1) != 0.0) && (creals(in2[i]) != 0.0 || cimags(in2[i])));} + + +#define d0d2OpLogAndd2(in1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double(in1 != 0.0 && in2[i] != 0.0);} + +#define z0z2OpLogAndd2(in1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double((zreals(in1) != 0.0 || zimags(in1) != 0.0) && (zreals(in2[i]) != 0.0 || zimags(in2[i])));} + +#define d0z2OpLogAndd2(in1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double(in1 != 0.0 && (zreals(in2[i]) != 0.0 || zimags(in2[i])));} + +#define z0d2OpLogAndd2(in1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double((zreals(in1) != 0.0 || zimags(in1) != 0.0) && in2[i] != 0.0);} + +/*TODO matrix and matrix*/ + +#define s2s2OpLogAnds2(in1, size1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float(in1[i] != 0.0 && in2[i] != 0.0);} + +#define s2c2OpLogAnds2(in1, size1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float(in1[i] != 0.0 && (creals(in2[i]) != 0.0 || cimags(in2[i])));} + +#define c2s2OpLogAnds2(in1, size1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float((creals(in1[i]) != 0.0 || cimags(in1[i]) != 0.0) && in2[i] != 0.0);} + +#define c2c2OpLogAnds2(in1, size1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float((creals(in1[i]) != 0.0 || cimags(in1[i]) != 0.0) && (creals(in2[i]) != 0.0 || cimags(in2[i])));} + + +#define d2d2OpLogAndd2(in1, size1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double(in1[i] != 0.0 && in2[i] != 0.0);} + +#define z2z2OpLogAndd2(in1, size1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double((zreals(in1[i]) != 0.0 || zimags(in1[i]) != 0.0) && (zreals(in2[i]) != 0.0 || zimags(in2[i])));} + +#define d2z2OpLogAndd2(in1, size1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double(in1[i] != 0.0 && (zreals(in2[i]) != 0.0 || zimags(in2[i])));} + +#define z2d2OpLogAndd2(in1, size1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double((zreals(in1[i]) != 0.0 || zimags(in1[i]) != 0.0) && in2[i] != 0.0;)} + +#endif /* !__INT_OPLOGAND_H__ */ diff --git a/src/c/operations/interfaces/int_OpLogEq.h b/src/c/operations/interfaces/int_OpLogEq.h new file mode 100644 index 00000000..b15a8b6a --- /dev/null +++ b/src/c/operations/interfaces/int_OpLogEq.h @@ -0,0 +1,94 @@ +/* +** -*- C -*- +** +** +** Made by Raffaele.Nutricato@tiscali.it +** +** Copyright Raffaele Nutricato +*/ +/* Modified by Arnaud Torset */ + + +#ifndef __OPLOGEQ_H__ +#define __OPLOGEQ_H__ + +#include "floatComplex.h" +#include "doubleComplex.h" + +#define s0s0OpLogEqs0(in1,in2) (float) (in1 == in2) +#define d0d0OpLogEqd0(in1,in2) (double) (in1 == in2) +#define c0c0OpLogEqs0(in1,in2) (float) ((creals(in1) == creals(in2)) && (cimags(in1) == cimags(in2))) +#define z0z0OpLogEqd0(in1,in2) (double) ((zreals(in1) == zreals(in2)) && (zimags(in1) == zimags(in2))) + +#define s0c0OpLogEqs0(in1,in2) (float) ((in1==creals(in2)) && (0==cimags(in2))) +#define d0z0OpLogEqd0(in1,in2) (double) ((in1==zreals(in2)) && (0==zimags(in2))) +#define c0s0OpLogEqs0(in1,in2) s0c0OpLogEqs0(in2,in1) +#define z0d0OpLogEqd0(in1,in2) d0z0OpLogEqd0(in2,in1) + + + +#define s2s0OpLogEqs2(in1,size,in2,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=(float)(in1[i]==in2);\ + } +#define d2d0OpLogEqd2(in1,size,in2,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=(double)(in1[i]==in2);\ + } +#define c2c0OpLogEqs2(in1,size,in2,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=(float)((creals(in1[i])==creals(in2))&&(cimags(in1[i])==cimags(in2)));\ + } +#define z2z0OpLogEqd2(in1,size,in2,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=(double)((zreals(in1[i])==zreals(in2))&&(zimags(in1[i])==zimags(in2)));\ + } + + +#define c2s0OpLogEqs2(in1,size,in2,out) c2c0OpLogEqs2(in1,size,FloatComplex(in2,0),out) +#define z2d0OpLogEqd2(in1,size,in2,out) z2z0OpLogEqd2(in1,size,DoubleComplex(in2,0),out) + +#define s2c0OpLogEqs2(in1,size,in2,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=(float)((in1[i]==creals(in2))&&(cimags(in2)==0));\ + } + +#define d2z0OpLogEqd2(in1,size,in2,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=(double)((in1[i]==zreals(in2))&&(zimags(in2)==0));\ + } + + + +#define s0s2OpLogEqs2(in1,in2,inSize,out) s2s0OpLogEqs2(in2,inSize,in1,out) +#define c0s2OpLogEqs2(in1,in2,inSize,out) s2c0OpLogEqs2(in2,inSize,in1,out) +#define d0d2OpLogEqd2(in1,in2,inSize,out) d2d0OpLogEqd2(in2,inSize,in1,out) +#define z0d2OpLogEqd2(in1,in2,inSize,out) d2z0OpLogEqd2(in2,inSize,in1,out) +#define s0c2OpLogEqs2(in1,in2,inSize,out) c2s0OpLogEqs2(in2,inSize,in1,out) +#define c0c2OpLogEqs2(in1,in2,inSize,out) c2c0OpLogEqs2(in2,inSize,in1,out) +#define d0z2OpLogEqd2(in1,in2,inSize,out) z2d0OpLogEqd2(in2,inSize,in1,out) +#define z0z2OpLogEqd2(in1,in2,inSize,out) z2z0OpLogEqd2(in2,inSize,in1,out) + +/* we must have size1=size2 */ + +#define s2s2OpLogEqs2(in1,size1,in2,size2,out) {int i;\ + for (i=0;i<size1[0]*size2[1];i++) out[i]=(float)(in1[i]==in2[i]);\ + } +#define d2d2OpLogEqd2(in1,size1,in2,size2,out) {int i;\ + for (i=0;i<size1[0]*size2[1];i++) out[i]=(double)(in1[i]==in2[i]);\ + } +#define c2c2OpLogEqs2(in1,size1,in2,size2,out) {int i;\ + for (i=0;i<size1[0]*size2[1];i++) \ + out[i]=(float)((creals(in1[i])==creals(in2[i]))&&(cimags(in1[i])==cimags(in2[i])));\ + } +#define z2z2OpLogEqd2(in1,size1,in2,size2,out) {int i;\ + for (i=0;i<size1[0]*size2[1];i++) \ + out[i]=(double)((zreals(in1[i])==zreals(in2[i]))&&(zimags(in1[i])==zimags(in2[i])));\ + } + +#define s2c2OpLogEqs2(in1,size1,in2,size2,out) {int i;\ + for (i=0;i<size1[0]*size2[1];i++) \ + out[i]=(float)((in1[i]==creals(in2[i]))&&(0==cimags(in2[i])));\ + } +#define d2z2OpLogEqd2(in1,size1,in2,size2,out) {int i;\ + for (i=0;i<size1[0]*size2[1];i++) \ + out[i]=(double)((in1[i]==zreals(in2[i]))&&(0==zimags(in2[i])));\ + } + +#define c2s2OpLogEqs2(in1,size1,in2,size2,out) s2c2OpLogEqs2(in2,size2,in1,size1,out) +#define z2d2OpLogEqd2(in1,size1,in2,size2,out) d2z2OpLogEqd2(in2,size2,in1,size1,out) +#endif /* !__OPLOGGT_H__ */ diff --git a/src/c/operations/interfaces/int_OpLogGe.h b/src/c/operations/interfaces/int_OpLogGe.h new file mode 100644 index 00000000..0ce1ad81 --- /dev/null +++ b/src/c/operations/interfaces/int_OpLogGe.h @@ -0,0 +1,50 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2007 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +/* + Update 23/02/09 by Arnaud Torset : Add matrix comparaison, remove include(floatComplex and doubleComplex) +*/ + +#ifndef __OPLOGGE_H__ +#define __OPLOGGE_H__ + + +#define s0s0OpLogGes0(in1,in2) (float) (in1 >= in2) +#define d0d0OpLogGed0(in1,in2) (double) (in1 >= in2) + + +#define s2s0OpLogGes2(in1, size1, in2, out) {int i;\ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = s0s0OpLogGes0(in1[i],in2);\ + } + +#define s0s2OpLogGes2(in1, in2, size2, out) {int i; \ + for(i = 0 ; i < size2[0] * size2[1] ; ++i) out[i] = s0s0OpLogGes0(in1,in2[i]);\ + } + +/* we must have size1=size2 */ +#define s2s2OpLogGes2(in1, size1, in2, size2, out) {int i; \ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = s0s0OpLogGes0(in1[i],in2[i]);\ + } + +#define d2d0OpLogGed2(in1, size1, in2, out) {int i;\ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = d0d0OpLogGed0(in1[i],in2);\ + } + +#define d0d2OpLogGed2(in1, in2, size2, out) {int i; \ + for(i = 0 ; i < size2[0] * size2[1] ; ++i) out[i] = d0d0OpLogGed0(in1,in2[i]);\ + } + +/* we must have size1=size2 */ +#define d2d2OpLogGed2(in1, size1, in2, size2, out) {int i; \ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = d0d0OpLogGed0(in1[i],in2[i]);\ + } +#endif /* !__OPLOGGE_H__ */ diff --git a/src/c/operations/interfaces/int_OpLogGt.h b/src/c/operations/interfaces/int_OpLogGt.h new file mode 100644 index 00000000..161b654f --- /dev/null +++ b/src/c/operations/interfaces/int_OpLogGt.h @@ -0,0 +1,50 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2007 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +/* + Update 23/02/09 by Arnaud Torset : Add matrix comparaison, remove include(floatComplex and doubleComplex) +*/ + +#ifndef __OPLOGGT_H__ +#define __OPLOGGT_H__ + + +#define s0s0OpLogGts0(in1,in2) (float) (in1 > in2) +#define d0d0OpLogGtd0(in1,in2) (double) (in1 > in2) + + +#define s2s0OpLogGts2(in1, size1, in2, out) {int i;\ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = s0s0OpLogGts0(in1[i],in2);\ + } + +#define s0s2OpLogGts2(in1, in2, size2, out) {int i; \ + for(i = 0 ; i < size2[0] * size2[1] ; ++i) out[i] = s0s0OpLogGts0(in1,in2[i]);\ + } + +/* we must have size1=size2 */ +#define s2s2OpLogGts2(in1, size1, in2, size2, out) {int i; \ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = s0s0OpLogGts0(in1[i],in2[i]);\ + } + +#define d2d0OpLogGtd2(in1, size1, in2, out) {int i;\ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = d0d0OpLogGtd0(in1[i],in2);\ + } + +#define d0d2OpLogGtd2(in1, in2, size2, out) {int i; \ + for(i = 0 ; i < size2[0] * size2[1] ; ++i) out[i] = d0d0OpLogGtd0(in1,in2[i]);\ + } + +/* we must have size1=size2 */ +#define d2d2OpLogGtd2(in1, size1, in2, size2, out) {int i; \ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = d0d0OpLogGtd0(in1[i],in2[i]);\ + } +#endif /* !__OPLOGGT_H__ */ diff --git a/src/c/operations/interfaces/int_OpLogLe.h b/src/c/operations/interfaces/int_OpLogLe.h new file mode 100644 index 00000000..ebb09c7b --- /dev/null +++ b/src/c/operations/interfaces/int_OpLogLe.h @@ -0,0 +1,50 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2007 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +/* + Update 23/02/09 by Arnaud Torset : Add matrix comparaison, remove include(floatComplex and doubleComplex) +*/ + +#ifndef __OPLOGLE_H__ +#define __OPLOGLE_H__ + + +#define s0s0OpLogLes0(in1,in2) (float) (in1 <= in2) +#define d0d0OpLogLed0(in1,in2) (double) (in1 <= in2) + + +#define s2s0OpLogLes2(in1, size1, in2, out) {int i;\ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = s0s0OpLogLes0(in1[i],in2);\ + } + +#define s0s2OpLogLes2(in1, in2, size2, out) {int i; \ + for(i = 0 ; i < size2[0] * size2[1] ; ++i) out[i] = s0s0OpLogLes0(in1,in2[i]);\ + } + +/* we must have size1=size2 */ +#define s2s2OpLogLes2(in1, size1, in2, size2, out) {int i; \ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = s0s0OpLogLes0(in1[i],in2[i]);\ + } + +#define d2d0OpLogLed2(in1, size1, in2, out) {int i;\ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = d0d0OpLogLed0(in1[i],in2);\ + } + +#define d0d2OpLogLed2(in1, in2, size2, out) {int i; \ + for(i = 0 ; i < size2[0] * size2[1] ; ++i) out[i] = d0d0OpLogLed0(in1,in2[i]);\ + } + +/* we must have size1=size2 */ +#define d2d2OpLogLed2(in1, size1, in2, size2, out) {int i; \ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = d0d0OpLogLed0(in1[i],in2[i]);\ + } +#endif /* !__OPLOGLE_H__ */ diff --git a/src/c/operations/interfaces/int_OpLogLt.h b/src/c/operations/interfaces/int_OpLogLt.h new file mode 100644 index 00000000..2c5d8639 --- /dev/null +++ b/src/c/operations/interfaces/int_OpLogLt.h @@ -0,0 +1,50 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2007 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +/* + Update 23/02/09 by Arnaud Torset : Add matrix comparaison, remove include(floatComplex and doubleComplex) +*/ + +#ifndef __OPLOGLT_H__ +#define __OPLOGLT_H__ + + +#define s0s0OpLogLts0(in1,in2) (float) (in1 < in2) +#define d0d0OpLogLtd0(in1,in2) (double) (in1 < in2) + + +#define s2s0OpLogLts2(in1, size1, in2, out) {int i;\ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = s0s0OpLogLts0(in1[i],in2);\ + } + +#define s0s2OpLogLts2(in1, in2, size2, out) {int i; \ + for(i = 0 ; i < size2[0] * size2[1] ; ++i) out[i] = s0s0OpLogLts0(in1,in2[i]);\ + } + +/* we must have size1=size2 */ +#define s2s2OpLogLts2(in1, size1, in2, size2, out) {int i; \ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = s0s0OpLogLts0(in1[i],in2[i]);\ + } + +#define d2d0OpLogLtd2(in1, size1, in2, out) {int i;\ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = d0d0OpLogLtd0(in1[i],in2);\ + } + +#define d0d2OpLogLtd2(in1, in2, size2, out) {int i; \ + for(i = 0 ; i < size2[0] * size2[1] ; ++i) out[i] = d0d0OpLogLtd0(in1,in2[i]);\ + } + +/* we must have size1=size2 */ +#define d2d2OpLogLtd2(in1, size1, in2, size2, out) {int i; \ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = d0d0OpLogLtd0(in1[i],in2[i]);\ + } +#endif /* !__OPLOGLT_H__ */ diff --git a/src/c/operations/interfaces/int_OpLogNe.h b/src/c/operations/interfaces/int_OpLogNe.h new file mode 100644 index 00000000..238ef483 --- /dev/null +++ b/src/c/operations/interfaces/int_OpLogNe.h @@ -0,0 +1,98 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Aranud Torset + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +/* Idem that OpLogEq with a !(negation) behind*/ + +#ifndef __OPLOGNE_H__ +#define __OPLOGNE_H__ + +#include "floatComplex.h" +#include "doubleComplex.h" + +#define s0s0OpLogNes0(in1,in2) (float) !(in1 == in2) +#define d0d0OpLogNed0(in1,in2) (double) !(in1 == in2) +#define c0c0OpLogNes0(in1,in2) (float) !((creals(in1) == creals(in2)) && (cimags(in1) == cimags(in2))) +#define z0z0OpLogNed0(in1,in2) (double) !((zreals(in1) == zreals(in2)) && (zimags(in1) == zimags(in2))) + +#define s0c0OpLogNes0(in1,in2) (float) !((in1==creals(in2)) && (0==cimags(in2))) +#define d0z0OpLogNed0(in1,in2) (double) !((in1==zreals(in2)) && (0==zimags(in2))) +#define c0s0OpLogNes0(in1,in2) s0c0OpLogNes0(in2,in1) +#define z0d0OpLogNed0(in1,in2) d0z0OpLogNed0(in2,in1) + + + +#define s2s0OpLogNes2(in1,size,in2,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=(float)!(in1[i]==in2);\ + } +#define d2d0OpLogNed2(in1,size,in2,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=(double)!(in1[i]==in2);\ + } +#define c2c0OpLogNes2(in1,size,in2,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=(float)!((creals(in1[i])==creals(in2))&&(cimags(in1[i])==cimags(in2)));\ + } +#define z2z0OpLogNed2(in1,size,in2,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=(double)!((zreals(in1[i])==zreals(in2))&&(zimags(in1[i])==zimags(in2)));\ + } + + +#define c2s0OpLogNes2(in1,size,in2,out) c2c0OpLogNes2(in1,size,FloatComplex(in2,0),out) +#define z2d0OpLogNed2(in1,size,in2,out) z2z0OpLogNed2(in1,size,DoubleComplex(in2,0),out) + +#define s2c0OpLogNes2(in1,size,in2,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=(float)!((in1[i]==creals(in2))&&(cimags(in2)==0));\ + } + +#define d2z0OpLogNed2(in1,size,in2,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=(double)!((in1[i]==zreals(in2))&&(zimags(in2)==0));\ + } + + + +#define s0s2OpLogNes2(in1,in2,inSize,out) s2s0OpLogNes2(in2,inSize,in1,out) +#define c0s2OpLogNes2(in1,in2,inSize,out) s2c0OpLogNes2(in2,inSize,in1,out) +#define d0d2OpLogNed2(in1,in2,inSize,out) d2d0OpLogNed2(in2,inSize,in1,out) +#define z0d2OpLogNed2(in1,in2,inSize,out) d2z0OpLogNed2(in2,inSize,in1,out) +#define s0c2OpLogNes2(in1,in2,inSize,out) c2s0OpLogNes2(in2,inSize,in1,out) +#define c0c2OpLogNes2(in1,in2,inSize,out) c2c0OpLogNes2(in2,inSize,in1,out) +#define d0z2OpLogNed2(in1,in2,inSize,out) z2d0OpLogNed2(in2,inSize,in1,out) +#define z0z2OpLogNed2(in1,in2,inSize,out) z2z0OpLogNed2(in2,inSize,in1,out) + +/* we must have size1=size2 */ + +#define s2s2OpLogNes2(in1,size1,in2,size2,out) {int i;\ + for (i=0;i<size1[0]*size2[1];i++) out[i]=(float)!(in1[i]==in2[i]);\ + } +#define d2d2OpLogNed2(in1,size1,in2,size2,out) {int i;\ + for (i=0;i<size1[0]*size2[1];i++) out[i]=(double)!(in1[i]==in2[i]);\ + } +#define c2c2OpLogNes2(in1,size1,in2,size2,out) {int i;\ + for (i=0;i<size1[0]*size2[1];i++) \ + out[i]=(float)!((creals(in1[i])==creals(in2[i]))&&(cimags(in1[i])==cimags(in2[i])));\ + } +#define z2z2OpLogNed2(in1,size1,in2,size2,out) {int i;\ + for (i=0;i<size1[0]*size2[1];i++) \ + out[i]=(double)!((zreals(in1[i])==zreals(in2[i]))&&(zimags(in1[i])==zimags(in2[i])));\ + } + +#define s2c2OpLogNes2(in1,size1,in2,size2,out) {int i;\ + for (i=0;i<size1[0]*size2[1];i++) \ + out[i]=(float)!((in1[i]==creals(in2[i]))&&(0==cimags(in2[i])));\ + } +#define d2z2OpLogNed2(in1,size1,in2,size2,out) {int i;\ + for (i=0;i<size1[0]*size2[1];i++) \ + out[i]=(double)!((in1[i]==zreals(in2[i]))&&(0==zimags(in2[i])));\ + } + +#define c2s2OpLogNes2(in1,size1,in2,size2,out) s2c2OpLogNes2(in2,size2,in1,size1,out) +#define z2d2OpLogNed2(in1,size1,in2,size2,out) d2z2OpLogNed2(in2,size2,in1,size1,out) + +#endif /* !__OPLOGNE_H__ */ diff --git a/src/c/operations/interfaces/int_OpLogNot.h b/src/c/operations/interfaces/int_OpLogNot.h new file mode 100644 index 00000000..6184265c --- /dev/null +++ b/src/c/operations/interfaces/int_OpLogNot.h @@ -0,0 +1,42 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ + +#ifndef __INT_OPLOGNOT_H__ +#define __INT_OPLOGNOT_H__ + +#define s0OpLogNots0(in) (in==0) ? (float)1 : (float)0 + +#define d0OpLogNotd0(in) (in==0) ? (double)1 : (double)0 + +#define c0OpLogNotc0(in) (creals(in)==0) ? FloatComplex(1,0) : FloatComplex(0,0) + +#define z0OpLogNotz0(in) (zreals(in)==0) ? DoubleComplex(1,0) : DoubleComplex(0,0) + +#define s2OpLogNots2(in,size,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=s0OpLogNots0(in[i]);\ + } + +#define d2OpLogNotd2(in,size,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=d0OpLogNotd0(in[i]);\ + } + +#define c2OpLogNotc2(in,size,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=c0OpLogNotc0(in[i]);\ + } + +#define z2OpLogNotz2(in,size,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=z0OpLogNotz0(in[i]);\ + } + +#endif /* !__INT_OPLOGNOT_H__ */ diff --git a/src/c/operations/interfaces/int_OpLogOr.h b/src/c/operations/interfaces/int_OpLogOr.h new file mode 100644 index 00000000..b5d55fba --- /dev/null +++ b/src/c/operations/interfaces/int_OpLogOr.h @@ -0,0 +1,116 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ + +#ifndef __INT_OPLOGOR_H__ +#define __INT_OPLOGOR_H__ + +#define Bool2Float(in) ((in) ? 1.0f : 0.0f) + +#define Bool2Double(in) ((in) ? 1.0 : 0.0) + +/*scalar or scalar */ + +#define s0s0OpLogOrs0(in1, in2) Bool2Float(in1 != 0.0f || in2 != 0.0f) + +#define d0d0OpLogOrd0(in1, in2) Bool2Double(in1 != 0.0 || in2 != 0.0) + +#define c0c0OpLogOrs0(in1, in2) Bool2Float((creals(in1) != 0.0f || cimags(in1) != 0.0f) || (creals(in2) != 0.0f || cimags(in2))) + +#define s0c0OpLogOrs0(in1, in2) Bool2Float(in1 != 0.0f && (creals(in2) != 0.0f || cimags(in2))) + +#define c0s0OpLogOrs0(in1, in2) Bool2Float((creals(in1) != 0.0f || cimags(in1) != 0.0f) && in2 != 0.0f) + +#define z0z0OpLogOrd0(in1, in2) Bool2Double((zreals(in1) != 0.0 || zimags(in1) != 0.0) && (zreals(in2) != 0.0 || zimags(in2))) + +#define d0z0OpLogOrd0(in1, in2) Bool2Double(in1 != 0.0 && (zreals(in2) != 0.0 || zimags(in2))) + +#define z0d0OpLogOrd0(in1, in2) Bool2Double((zreals(in1) != 0.0 || zimags(in1) != 0.0) && in2 != 0.0) + +/*matrix or scalar */ + +#define s2s0OpLogOrs2(in1, size1, in2, out) {int i = 0 ;\ + for (i = 0 ; i < size1[0]*size1[1] ; i++ ) out[i] = Bool2Float(in1[i] != 0.0f || in2 != 0.0f);} + +#define d2d0OpLogOrd2(in1, size1, in2, out) {int i = 0 ;\ + for (i = 0 ; i < size1[0]*size1[1] ; i++ ) out[i] = Bool2Double(in1[i] != 0.0 || in2 != 0.0);} + +#define c2c0OpLogOrs2(in1, size1, in2, out) {int i = 0 ;\ + for (i = 0 ; i < size1[0]*size1[1] ; i++ ) out[i] = Bool2Float((creals(in1[i]) != 0.0f || cimags(in1[i]) != 0.0f) || (creals(in2) != 0.0f || cimags(in2)));} + +#define s2c0OpLogOrs2(in1, size1, in2, out) {int i = 0 ;\ + for (i = 0 ; i < size1[0]*size1[1] ; i++ ) out[i] = Bool2Float(in1[i] != 0.0f && (creals(in2) != 0.0f || cimags(in2)));} + +#define c2s0OpLogOrs2(in1, size1, in2, out) {int i = 0 ;\ + for (i = 0 ; i < size1[0]*size1[1] ; i++ ) out[i] = Bool2Float((creals(in1[i]) != 0.0f || cimags(in1[i]) != 0.0f) && in2 != 0.0f);} + +#define z2z0OpLogOrd2(in1, size1, in2, out) {int i = 0 ;\ + for (i = 0 ; i < size1[0]*size1[1] ; i++ ) out[i] = Bool2Double((zreals(in1[i]) != 0.0 || zimags(in1[i]) != 0.0) && (zreals(in2) != 0.0 || zimags(in2)));} + +#define d2z0OpLogOrd2(in1, size1, in2, out) {int i = 0 ;\ + for (i = 0 ; i < size1[0]*size1[1] ; i++ ) out[i] = Bool2Double(in1[i] != 0.0 && (zreals(in2) != 0.0 || zimags(in2)));} + +#define z2d0OpLogOrd2(in1, size1, in2, out) {int i = 0 ;\ + for (i = 0 ; i < size1[0]*size1[1] ; i++ ) out[i] = Bool2Double((zreals(in1[i]) != 0.0 || zimags(in1[i]) != 0.0) && in2 != 0.0);} + +/*scalar or matrix */ + +#define s0s2OpLogOrs2(in1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float(in1 != 0.2f || in2[i] != 0.2f);} + +#define d0d2OpLogOrd2(in1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double(in1 != 0.2 || in2[i] != 0.2);} + +#define c0c2OpLogOrs2(in1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float((creals(in1) != 0.2f || cimags(in1) != 0.2f) || (creals(in2[i]) != 0.2f || cimags(in2[i])));} + +#define s0c2OpLogOrs2(in1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float(in1 != 0.2f && (creals(in2[i]) != 0.2f || cimags(in2[i])));} + +#define c0s2OpLogOrs2(in1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float((creals(in1) != 0.2f || cimags(in1) != 0.2f) && in2[i] != 0.2f);} + +#define z0z2OpLogOrd2(in1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double((zreals(in1) != 0.2 || zimags(in1) != 0.2) && (zreals(in2[i]) != 0.2 || zimags(in2[i])));} + +#define d0z2OpLogOrd2(in1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double(in1 != 0.2 && (zreals(in2[i]) != 0.2 || zimags(in2[i])));} + +#define z0d2OpLogOrd2(in1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double((zreals(in1) != 0.2 || zimags(in1) != 0.2) && in2[i] != 0.2);} +/*matrix or matrix */ + +#define s2s2OpLogOrs2(in1, size1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float(in1[i] != 0.2f || in2[i] != 0.2f);} + +#define d2d2OpLogOrd2(in1, size1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double(in1[i] != 0.2 || in2[i] != 0.2);} + +#define c2c2OpLogOrs2(in1, size1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float((creals(in1[i]) != 0.2f || cimags(in1[i]) != 0.2f) || (creals(in2[i]) != 0.2f || cimags(in2[i])));} + +#define s2c2OpLogOrs2(in1, size1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float(in1[i] != 0.2f && (creals(in2[i]) != 0.2f || cimags(in2[i])));} + +#define c2s2OpLogOrs2(in1, size1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float((creals(in1[i]) != 0.2f || cimags(in1[i]) != 0.2f) && in2[i] != 0.2f);} + +#define z2z2OpLogOrd2(in1, size1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double((zreals(in1[i]) != 0.2 || zimags(in1[i]) != 0.2) && (zreals(in2[i]) != 0.2 || zimags(in2[i])));} + +#define d2z2OpLogOrd2(in1, size1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double(in1[i] != 0.2 && (zreals(in2[i]) != 0.2 || zimags(in2[i])));} + +#define z2d2OpLogOrd2(in1, size1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double((zreals(in1[i]) != 0.2 || zimags(in1[i]) != 0.2) && in2[i] != 0.2);} +#endif /* !__INT_OPLOGOR_H__ */ diff --git a/src/c/operations/interfaces/int_OpMinus.h b/src/c/operations/interfaces/int_OpMinus.h new file mode 100644 index 00000000..ac27ddb6 --- /dev/null +++ b/src/c/operations/interfaces/int_OpMinus.h @@ -0,0 +1,173 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ + +#ifndef __INT_OPMINUS_H__ +#define __INT_OPMINUS_H__ + +/* - Scalar */ + +#define s0OpMinuss0(in) -in + +#define d0OpMinusd0(in) -in + +#define c0OpMinusc0(in) FloatComplex(-creals(in), -cimags(in)) + +#define z0OpMinusz0(in) DoubleComplex(-zreals(in), -zimags(in)) + +/* - Matrix */ + +#define s2OpMinuss2(in, size, out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i] = -in[i]; \ + } + +#define d2OpMinusd2(in, size, out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i] = -in[i]; \ + } + +#define c2OpMinusc2(in, size, out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i] = FloatComplex(-creals(in[i]), -cimags(in[i])); \ + } + +#define z2OpMinusz2(in, size, out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i] = DoubleComplex(-zreals(in[i]), -zimags(in[i])); \ + } + + +/* Scalar - Scalar */ + +#define s0s0OpMinuss0(in1,in2) sdiffs(in1,in2) + +#define d0d0OpMinusd0(in1,in2) ddiffs(in1,in2) + +#define c0c0OpMinusc0(in1,in2) cdiffs(in1,in2) + +#define z0z0OpMinusz0(in1,in2) zdiffs(in1,in2) + +#define s0c0OpMinusc0(in1,in2) cdiffs(FloatComplex(in1,0),in2) + +#define c0s0OpMinusc0(in1,in2) cdiffs(in1,FloatComplex(in2,0)) + +#define d0z0OpMinusz0(in1,in2) zdiffs(DoubleComplex(in1,0),in2) + +#define z0d0OpMinusz0(in1,in2) zdiffs(in1,DoubleComplex(in2,0)) + +/* Matrix - Scalar */ + + +#define s2s0OpMinuss2(in1,size,in2,out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]-in2; \ + } + + +#define d2d0OpMinusd2(in1,size,in2,out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]-in2; \ + } + + +#define c2c0OpMinusc2(in1,size,in2,out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i]=cdiffs(in1[i],in2); \ + } + +#define c2s0OpMinusc2(in1,size,in2,out) c2c0OpMinusc2(in1,size,FloatComplex(in2,0),out) + + +#define s2c0OpMinusc2(in1,size,in2,out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i]=cdiffs(FloatComplex(in1[i],0),in2); \ + } + + +#define z2z0OpMinusz2(in1,size,in2,out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i]=zdiffs(in1[i],in2); \ + } + +#define z2d0OpMinusz2(in1,size,in2,out) z2z0OpMinusz2(in1,size,DoubleComplex(in2,0),out) + + +#define d2z0OpMinusz2(in1,size,in2,out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i]=zdiffs(DoubleComplex(in1[i],0),in2); \ + } + + +/* Scalar - Matrix */ + + +#define s0s2OpMinuss2(in1,in2,size,out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i]=in1-in2[i]; \ + } + + +#define d0d2OpMinusd2(in1,in2,size,out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i]=in1-in2[i]; \ + } + + +#define c0c2OpMinusc2(in1,in2,size,out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i]=cdiffs(in1,in2[i]); \ + } + +#define s0c2OpMinusc2(in1,in2,size,out) c0c2OpMinusc2(FloatComplex(in1,0),in2,size,out) + + +#define c0s2OpMinusc2(in1,in2,size,out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i]=cdiffs(in1,FloatComplex(in2[i],0)); \ + } + + +#define z0z2OpMinusz2(in1,in2,size,out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i]=zdiffs(in1,in2[i]); \ + } + +#define d0z2OpMinusz2(in1,in2,size,out) z0z2OpMinusz2(DoubleComplex(in1,0),in2,size,out) + + +#define z0d2OpMinusz2(in1,in2,size,out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i]=zdiffs(in1,DoubleComplex(in2[i],0)); \ + } + + + +/* Matrix - Matrix */ + +#define s2s2OpMinuss2(in1,size1,in2,size2,out) sdiffa(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) + +#define d2d2OpMinusd2(in1,size1,in2,size2,out) ddiffa(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) + +#define c2c2OpMinusc2(in1,size1,in2,size2,out) cdiffa(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) + + +#define s2c2OpMinusc2(in1,size1,in2,size2,out) {int i; \ + for (i=0;i<size1[0]*size2[1];i++) out[i]=cdiffs(FloatComplex(in1[i],0),in2[i]); \ + } + + +#define c2s2OpMinusc2(in1,size1,in2,size2,out) {int i; \ + for (i=0;i<size1[0]*size2[1];i++) out[i]=cdiffs(in1[i],FloatComplex(in2[i],0));\ + } + +#define z2z2OpMinusz2(in1,size1,in2,size2,out) zdiffa(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) + + +#define d2z2OpMinusz2(in1,size1,in2,size2,out) {int i; \ + for (i=0;i<size1[0]*size2[1];i++) out[i]=zdiffs(DoubleComplex(in1[i],0),in2[i]); \ + } + + +#define z2d2OpMinusz2(in1,size1,in2,size2,out) {int i; \ + for (i=0;i<size1[0]*size2[1];i++) out[i]=zdiffs(in1[i],DoubleComplex(in2[i],0)); \ + } + + + + +#endif /* !__INT_OPMINUS_H__ */ diff --git a/src/c/operations/interfaces/int_OpPlus.h b/src/c/operations/interfaces/int_OpPlus.h new file mode 100644 index 00000000..cb86d815 --- /dev/null +++ b/src/c/operations/interfaces/int_OpPlus.h @@ -0,0 +1,144 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ + +#ifndef __INT_OPPLUS_H__ +#define __INT_OPPLUS_H__ + + +/* Scalar + Scalar */ + +#define s0s0OpPluss0(in1,in2) sadds(in1,in2) + +#define d0d0OpPlusd0(in1,in2) dadds(in1,in2) + +#define c0c0OpPlusc0(in1,in2) cadds(in1,in2) + +#define z0z0OpPlusz0(in1,in2) zadds(in1,in2) + +#define s0c0OpPlusc0(in1,in2) cadds(FloatComplex(in1,0),in2) + +#define c0s0OpPlusc0(in1,in2) cadds(in1,FloatComplex(in2,0)) + +#define d0z0OpPlusz0(in1,in2) zadds(DoubleComplex(in1,0),in2) + +#define z0d0OpPlusz0(in1,in2) zadds(in1,DoubleComplex(in2,0)) + + + +/* Matrix + Scalar */ + +#define s2s0OpPluss2(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]+in2;\ + } + +#define d2d0OpPlusd2(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]+in2;\ + } + +#define c2c0OpPlusc2(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=cadds(in1[i],in2);\ + } + +/*On transforme le scalaire float en scalaire floatComplex pour pouvoir utiliser c2c0...c2*/ +#define c2s0OpPlusc2(in1,size,in2,out) c2c0OpPlusc2(in1,size,FloatComplex(in2,0),out) + +#define s2c0OpPlusc2(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=cadds(FloatComplex(in1[i],0),in2);\ + } + +#define z2z0OpPlusz2(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=zadds(in1[i],in2);\ + } + +/*On transforme le scalaire double en scalaire doubleComplex pour pouvoir utiliser z2z0...z2*/ +#define z2d0OpPlusz2(in1,size,in2,out) z2z0OpPlusz2(in1,size,DoubleComplex(in2,0),out) + +#define d2z0OpPlusz2(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=zadds(DoubleComplex(in1[i],0),in2);\ + } + + +/* Scalar + Matrix */ + +#define s0s2OpPluss2(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1+in2[i];\ + } + +#define d0d2OpPlusd2(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1+in2[i];\ + } + +#define c0c2OpPlusc2(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=cadds(in1,in2[i]);\ + } + +/*On transforme le scalaire float en scalaire floatComplex pour pouvoir utiliser c0c2...c2*/ +#define s0c2OpPlusc2(in1,in2,size,out) c0c2OpPlusc2(FloatComplex(in1,0),in2,size,out) + +#define c0s2OpPlusc2(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=cadds(in1,FloatComplex(in2[i],0));\ + } + +#define z0z2OpPlusz2(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=zadds(in1,in2[i]);\ + } + +/*On transforme le scalaire double en scalaire doubleComplex pour pouvoir utiliser z0z2...z2*/ +#define d0z2OpPlusz2(in1,in2,size,out) z0z2OpPlusz2(DoubleComplex(in1,0),in2,size,out) + +#define z0d2OpPlusz2(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=zadds(in1,DoubleComplex(in2[i],0));\ + } + + + +/* Matrix + Matrix */ + +#define s2s2OpPluss2(in1,size1,in2,size2,out) sadda(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) + +#define d2d2OpPlusd2(in1,size1,in2,size2,out) dadda(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) + +#define c2c2OpPlusc2(in1,size1,in2,size2,out) cadda(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) + + +#define s2c2OpPlusc2(in1,size1,in2,size2,out) {int i=0;\ + for (i=0;i<size1[0]*size2[1];i++) out[i]=cadds(FloatComplex(in1[i],0),in2[i]);\ + } + +#define c2s2OpPlusc2(in1,size1,in2,size2,out) {int i=0;\ + for (i=0;i<size1[0]*size2[1];i++) out[i]=cadds(in1[i],FloatComplex(in2[i],0));\ + } + +#define z2z2OpPlusz2(in1,size1,in2,size2,out) zadda(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) + + +#define d2z2OpPlusz2(in1,size1,in2,size2,out) {int i=0;\ + for (i=0;i<size1[0]*size2[1];i++) out[i]=zadds(DoubleComplex(in1[i],0),in2[i]);\ + } + + +#define z2d2OpPlusz2(in1,size1,in2,size2,out) {int i=0;\ + for (i=0;i<size1[0]*size2[1];i++) out[i]=zadds(in1[i],DoubleComplex(in2[i],0));\ + } + + +/* Strings */ +/* RNU: size1[1]-1 -> "-1" because '\0' of the first string must be removed. */ +#define g2g2OpPlusg2(in1,size1,in2,size2,out) {int i = 0, j = 0; \ + for(i = 0 ; i < size1[1]-1 ; ++i, ++j) out[j] = in1[i]; \ + for(i = 0 ; i < size2[1] ; ++i, ++j) out[j] = in2[i]; \ + } + + +#endif /* !__INT_OPPLUS_H__ */ diff --git a/src/c/operations/interfaces/int_OpSlash.h b/src/c/operations/interfaces/int_OpSlash.h new file mode 100644 index 00000000..fd8dda28 --- /dev/null +++ b/src/c/operations/interfaces/int_OpSlash.h @@ -0,0 +1,168 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ + +#ifndef __INT_OPSLASH_H__ +#define __INT_OPSLASH_H__ + +/* Scalar / Scalar */ + +#define s0s0OpSlashs0(in1,in2) srdivs(in1,in2) + +#define d0d0OpSlashd0(in1,in2) drdivs(in1,in2) + +#define c0c0OpSlashc0(in1,in2) crdivs(in1,in2) + +#define z0z0OpSlashz0(in1,in2) zrdivs(in1,in2) + +#define s0c0OpSlashc0(in1,in2) crdivs(FloatComplex(in1,0),in2) + +#define c0s0OpSlashc0(in1,in2) crdivs(in1,FloatComplex(in2,0)) + +#define d0z0OpSlashz0(in1,in2) zrdivs(DoubleComplex(in1,0),in2) + +#define z0d0OpSlashz0(in1,in2) zrdivs(in1,DoubleComplex(in2,0)) + + +/* Scalar / Matrix */ + + +#define s0s2OpSlashs2(in1,in2,size,out) {int i=0;\ + sinverma(in2,out,size[0]);\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1*out[i];} + + +#define d0d2OpSlashd2(in1,in2,size,out) {int i=0;\ + dinverma(in2,out,size[0]);\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1*out[i];} + + +#define c0c2OpSlashc2(in1,in2,size,out) {int i=0;\ + cinverma(in2,out,size[0]);\ + for (i=0;i<size[0]*size[1];i++) out[i]=cmuls(in1,out[i]);} + + +#define z0z2OpSlashz2(in1,in2,size,out) {int i=0;\ + zinverma(in2,out,size[0]);\ + for (i=0;i<size[0]*size[1];i++) out[i]=zmuls(in1,out[i]);} + + + +#define s0c2OpSlashc2(in1,in2,size,out) c0c2OpSlashc2(FloatComplex(in1,0),in2,size,out) + + +#define d0z2OpSlashz2(in1,in2,size,out) z0z2OpSlashz2(DoubleComplex(in1,0),in2,size,out) + + +/* FIXME: malloc */ +#define c0s2OpSlashc2(in1,in2,size,out) {int i=0;\ + float* temp = malloc((uint)(size[0]*size[1])*sizeof(float));\ + sinverma(in2,temp,size[0]);\ + for (i=0;i<size[0]*size[1];i++) out[i]=cmuls(in1,FloatComplex(temp[i],0));} + +/* FIXME: malloc */ +#define z0d2OpSlashz2(in1,in2,size,out) {int i=0;\ + double* temp = malloc((uint)(size[0]*size[1])*sizeof(double));\ + dinverma(in2,temp,size[0]);\ + for (i=0;i<size[0]*size[1];i++) out[i]=zmuls(in1,DoubleComplex(temp[i],0));} + + +/* Matrix / Scalar */ + + +#define s2s0OpSlashs2(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]/in2;} + + +#define d2d0OpSlashd2(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]/in2;} + + +#define c2c0OpSlashc2(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=crdivs(in1[i],in2);} + + +#define z2z0OpSlashz2(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=zrdivs(in1[i],in2);} + + +#define s2c0OpSlashc2(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=crdivs(FloatComplex(in1[i],0),in2);} + + +#define d2z0OpSlashz2(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=zrdivs(DoubleComplex(in1[i],0),in2);} + + +#define c2s0OpSlashc2(in1,size,in2,out) c2c0OpSlashc2(in1,size,FloatComplex(in2,0),out) + + +#define z2d0OpSlashz2(in1,size,in2,out) z2z0OpSlashz2(in1,size,DoubleComplex(in2,0),out) + + + + + +/* Matrix / Matrix */ + +#define s2s2OpSlashs2(in1,size1,in2,size2,out) srdivma(in1,size1[0],size1[1],in2,size2[0],size2[1],out) + +#define d2d2OpSlashd2(in1,size1,in2,size2,out) drdivma(in1,size1[0],size1[1],in2,size2[0],size2[1],out) + +#define c2c2OpSlashc2(in1,size1,in2,size2,out) crdivma(in1,size1[0],size1[1],in2,size2[0],size2[1],out) + +#define z2z2OpSlashz2(in1,size1,in2,size2,out) zrdivma(in1,size1[0],size1[1],in2,size2[0],size2[1],out) + +/* FIXME: There is some malloc in the define below, maybe they can be remove */ +#define c2s2OpSlashc2(in1,size1,in2,size2,out) {float* temp;\ + temp=malloc((uint)(size2[0]*size2[1])*sizeof(float));\ + sfilla(temp,size2[0],size2[1],0);\ + c2c2OpSlashc2(in1, size1, FloatComplexMatrix(in2,temp,size2[0]*size2[1]), size2, out);} + +#define s2c2OpSlashc2(in1,size1,in2,size2,out) {float* temp;\ + temp=malloc((uint)(size1[0]*size1[1])*sizeof(float));\ + sfilla(temp,size1[0],size1[1],0);\ + c2c2OpSlashc2(FloatComplexMatrix(in2,temp,size1[0]*size1[1]), size1, in2, size2, out);} + +#define z2d2OpSlashz2(in1,size1,in2,size2,out) {double* temp;\ + temp=malloc((uint)(size2[0]*size2[1])*sizeof(double));\ + dfilla(temp,size2[0],size2[1],0);\ + z2z2OpSlashz2(in1, size1, DoubleComplexMatrix(in2,temp,size2[0]*size2[1]), size2, out);} + +#define d2z2OpSlashz2(in1,size1,in2,size2,out) {double* temp;\ + temp=malloc((uint)(size2[0]*size2[1])*sizeof(double));\ + dfilla(temp,size1[0],size1[1],0);\ + z2z2OpSlashz2(DoubleComplexMatrix(in1,temp,size1[0]*size1[1]), size1, in2, size2, out);} + + +/* Vector * Vector, so there is a scalar output */ + +#define s2s2OpSlashs0(in1, size1, in2, size2) srdivv( in1, in2, size1[1]) + +#define c2s2OpSlashc0(in1, size1, in2, size2) crdivcsv(in1, in2, size1[1]) + +#define s2c2OpSlashc0(in1, size1, in2, size2) crdivscv(in1, in2, size1[1]) + +#define c2c2OpSlashc0(in1, size1, in2, size2) crdivv( in1, in2, size1[1]) + + +#define d2d2OpSlashd0(in1, size1, in2, size2) drdivv( in1, in2, size1[1]) + +#define z2d2OpSlashz0(in1, size1, in2, size2) zrdivzdv(in1, in2, size1[1]) + +#define d2z2OpSlashz0(in1, size1, in2, size2) zrdivdzv(in1, in2, size1[1]) + +#define z2z2OpSlashz0(in1, size1, in2, size2) zrdivv( in1, in2, size1[1]) + + +#endif /* !__INT_OPSLASH_H__ */ diff --git a/src/c/operations/interfaces/int_OpStar.h b/src/c/operations/interfaces/int_OpStar.h new file mode 100644 index 00000000..52ff221c --- /dev/null +++ b/src/c/operations/interfaces/int_OpStar.h @@ -0,0 +1,151 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ + +#ifndef __INT_OPSTAR_H__ +#define __INT_OPSTAR_H__ + +/* Scalar * Scalar */ + +#define s0s0OpStars0(in1,in2) smuls(in1,in2) + +#define d0d0OpStard0(in1,in2) dmuls(in1,in2) + +#define c0c0OpStarc0(in1,in2) cmuls(in1,in2) + +#define z0z0OpStarz0(in1,in2) zmuls(in1,in2) + +#define s0c0OpStarc0(in1,in2) cmuls(FloatComplex(in1,0),in2) + +#define c0s0OpStarc0(in1,in2) cmuls(in1,FloatComplex(in2,0)) + +#define d0z0OpStarz0(in1,in2) zmuls(DoubleComplex(in1,0),in2) + +#define z0d0OpStarz0(in1,in2) zmuls(in1,DoubleComplex(in2,0)) + + +/* Scalar * Matrix */ + + +#define s0s2OpStars2(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1*in2[i];} + + +#define d0d2OpStard2(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1*in2[i];} + + +#define c0c2OpStarc2(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=cmuls(in1,in2[i]);} + + +#define z0z2OpStarz2(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=zmuls(in1,in2[i]);} + +#define s0c2OpStarc2(in1,in2,size,out) c0c2OpStarc2(FloatComplex(in1,0),in2,size,out) + + +#define d0z2OpStarz2(in1,in2,size,out) z0z2OpStarz2(DoubleComplex(in1,0),in2,size,out) + + +#define c0s2OpStarc2(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=cmuls(in1,FloatComplex(in2[i],0));} + +#define z0d2OpStarz2(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=zmuls(in1,DoubleComplex(in2[i],0));} + + +/* Matrix * Scalar */ + + +#define s2s0OpStars2(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]*in2;} + + +#define d2d0OpStard2(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]*in2;} + + +#define c2c0OpStarc2(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=cmuls(in1[i],in2);} + +#define z2z0OpStarz2(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=zmuls(in1[i],in2);} + + +#define s2c0OpStarc2(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=cmuls(FloatComplex(in1[i],0),in2);} + + +#define d2z0OpStarz2(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=zmuls(DoubleComplex(in1[i],0),in2);} + + +#define c2s0OpStarc2(in1,size,in2,out) c2c0OpStarc2(in1,size,FloatComplex(in2,0),out) + + +#define z2d0OpStarz2(in1,size,in2,out) z2z0OpStarz2(in1,size,DoubleComplex(in2,0),out) + +/* Matrix * Matrix */ + +#define s2s2OpStars2(in1,size1,in2,size2,out) smulma(in1,size1[0],size1[1],in2,size2[0],size2[1],out) + +#define d2d2OpStard2(in1,size1,in2,size2,out) dmulma(in1,size1[0],size1[1],in2,size2[0],size2[1],out) + +#define c2c2OpStarc2(in1,size1,in2,size2,out) cmulma(in1,size1[0],size1[1],in2,size2[0],size2[1],out) + +#define z2z2OpStarz2(in1,size1,in2,size2,out) zmulma(in1,size1[0],size1[1],in2,size2[0],size2[1],out) + +/* FIXME: There is some malloc in the define below, maybe they can be remove */ +#define c2s2OpStarc2(in1,size1,in2,size2,out) {float* temp;\ + temp=malloc((uint)(size2[0]*size2[1])*sizeof(float));\ + sfilla(temp,size2[0],size2[1],0);\ + c2c2OpStarc2(in1, size1, FloatComplexMatrix(in2,temp,size2[0]*size2[1]), size2, out);} + +#define s2c2OpStarc2(in1,size1,in2,size2,out) {float* temp;\ + temp=malloc((uint)(size1[0]*size1[1])*sizeof(float));\ + sfilla(temp,size1[0],size1[1],0);\ + c2c2OpStarc2(FloatComplexMatrix(in1,temp,size1[0]*size1[1]), size1, in2, size2, out);} + +#define z2d2OpStarz2(in1,size1,in2,size2,out) {double* temp;\ + temp=malloc((uint)(size2[0]*size2[1])*sizeof(double));\ + dfilla(temp,size2[0],size2[1],0);\ + z2z2OpStarz2(in1, size1, DoubleComplexMatrix(in2,temp,size2[0]*size2[1]), size2, out);} + +#define d2z2OpStarz2(in1,size1,in2,size2,out) {double* temp;\ + temp=malloc((uint)(size2[0]*size2[1])*sizeof(double));\ + dfilla(temp,size1[0],size1[1],0);\ + z2z2OpStarz2(DoubleComplexMatrix(in1,temp,size1[0]*size1[1]), size1, in2, size2, out);} + +/* Vector * Vector, so there is a scalar output */ + +#define MAX(a, b) (a > b ? a : b) + +#define s2s2OpStars0(in1, size1, in2, size2) smulv( in1, in2, MAX(MAX(size1[0], size1[1]), MAX(size2[0], size2[1]))) + +#define c2s2OpStarc0(in1, size1, in2, size2) cmulcsv(in1, in2, MAX(MAX(size1[0], size1[1]), MAX(size2[0], size2[1]))) + +#define s2c2OpStarc0(in1, size1, in2, size2) cmulscv(in1, in2, MAX(MAX(size1[0], size1[1]), MAX(size2[0], size2[1]))) + +#define c2c2OpStarc0(in1, size1, in2, size2) cmulv( in1, in2, MAX(MAX(size1[0], size1[1]), MAX(size2[0], size2[1]))) + + +#define d2d2OpStard0(in1, size1, in2, size2) dmulv( in1, in2, MAX(MAX(size1[0], size1[1]), MAX(size2[0], size2[1]))) + +#define z2d2OpStarz0(in1, size1, in2, size2) zmulzdv(in1, in2, MAX(MAX(size1[0], size1[1]), MAX(size2[0], size2[1]))) + +#define d2z2OpStarz0(in1, size1, in2, size2) zmuldzv(in1, in2, MAX(MAX(size1[0], size1[1]), MAX(size2[0], size2[1]))) + +#define z2z2OpStarz0(in1, size1, in2, size2) zmulv( in1, in2, MAX(MAX(size1[0], size1[1]), MAX(size2[0], size2[1]))) + +#endif /* !__INT_OPSTAR_H__ */ |