[Wavetiling-commits] r16 - pkg/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Dec 21 10:35:29 CET 2011


Author: kdbeuf
Date: 2011-12-21 10:35:29 +0100 (Wed, 21 Dec 2011)
New Revision: 16

Added:
   pkg/src/MAPmarlikEqSmooth.c
   pkg/src/MAPmarlikImpEqSmooth.c
Modified:
   pkg/src/MAPmarlikImp.c
Log:


Added: pkg/src/MAPmarlikEqSmooth.c
===================================================================
--- pkg/src/MAPmarlikEqSmooth.c	                        (rev 0)
+++ pkg/src/MAPmarlikEqSmooth.c	2011-12-21 09:35:29 UTC (rev 16)
@@ -0,0 +1,37 @@
+void MAPMARGEQSMOOTH(double *Din,int *K, double *vareps,double *Bout,double *varBout,double *Phiout, double *X, double *XtX, int *q,int *N,int *ends)
+{
+int i,j,m,n,Jcount=0;
+double phi,XDm,XD;
+for (i=0;i<*K;i++) 
+{
+	if (i>=ends[Jcount]) Jcount++;
+	XD=0;
+	for (m=0;m<*q;m++) 
+	{
+		XDm=0;
+		for (j=0;j<*N;j++) 
+		{	
+			XDm+=X[j+m*(*N)]*Din[j+i*(*N)];
+		}
+		Bout[m*(*K)+i]=XDm;
+		XD+=XDm;
+	}
+	phi=XD*XD/(*q)/(vareps[Jcount])-1;
+	for (m=0;m<*q;m++)
+	{
+		if (phi<=0) 
+			{
+				Bout[m*(*K)+i]=0;	
+				varBout[m*(*K)+i]=0;
+				Phiout[m*(*K)+i]=0;
+			}
+		else 	
+			{
+				Bout[m*(*K)+i]=Bout[m*(*K)+i]/(XtX[m]+1/phi);
+				varBout[m*(*K)+i]=(vareps[Jcount])/(XtX[m]+1/phi);
+				Phiout[m*(*K)+i]=phi;
+			};
+	
+	}
+}
+}

Modified: pkg/src/MAPmarlikImp.c
===================================================================
--- pkg/src/MAPmarlikImp.c	2011-12-19 09:12:00 UTC (rev 15)
+++ pkg/src/MAPmarlikImp.c	2011-12-21 09:35:29 UTC (rev 16)
@@ -29,4 +29,4 @@
 	
 	}
 }
-} 
+}

Added: pkg/src/MAPmarlikImpEqSmooth.c
===================================================================
--- pkg/src/MAPmarlikImpEqSmooth.c	                        (rev 0)
+++ pkg/src/MAPmarlikImpEqSmooth.c	2011-12-21 09:35:29 UTC (rev 16)
@@ -0,0 +1,37 @@
+void MAPMARGIMPEQSMOOTH(double *Din,int *K, double *vareps,double *Bout,double *varBout,double *Phiout, double *X, double *XtX, int *q,int *N,int *ends)
+{
+int i,j,m,n,Jcount=0;
+double phi,XDm,XD;
+for (i=0;i<*K;i++) 
+{
+	if (i>=ends[Jcount]) Jcount++;
+	XD=0;
+	for (m=0;m<*q;m++) 
+	{
+		XDm=0;
+		for (j=0;j<*N;j++) 
+		{
+			XDm+=X[j+m*(*N)]*Din[j+i*(*N)];
+		}
+		Bout[m*(*K)+i]=XDm;
+		XD+=XDm;
+	}
+	phi=XD*XD/(*q+2)/(vareps[Jcount])-1;
+	for (m=0;m<*q;m++)
+	{
+		if (phi<=0) 
+			{
+				Bout[m*(*K)+i]=0;	
+				varBout[m*(*K)+i]=0;
+				Phiout[m*(*K)+i]=0;
+			}
+		else 	
+			{
+				Bout[m*(*K)+i]=Bout[m*(*K)+i]/(XtX[m]+1/phi);
+				varBout[m*(*K)+i]=(vareps[Jcount])/(XtX[m]+1/phi);
+				Phiout[m*(*K)+i]=phi;
+			};
+	
+	}
+}
+}



More information about the Wavetiling-commits mailing list