/* * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab * Copyright (C) 2009 - POLIBA - Raffaele NUTRICATO * Copyright (C) 2009 - INRIA - Arnaud TORSET * Copyright (C) 2010-2010 - DIGITEO - 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 * */ #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; #define s3s0s0OpIns(in,size,indice,newVal) in[(int) indice-1]=newVal; #define d3d0d0OpIns(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 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