Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef EP21R_SLEP
00018 #define EP21R_SLEP
00019
00020 #include <stdlib.h>
00021 #include <stdio.h>
00022 #include <time.h>
00023 #include <math.h>
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 void ep21R(double * x, double *t, double * u, double * v, int n, int k)
00040 {
00041 int i, j, tn=n*k;
00042 double temp;
00043
00044
00045
00046
00047 for(j=0;j<n;j++){
00048 temp=0;
00049 for(i=j; i< tn; i+=n)
00050 temp+= u[i]* u[i];
00051 temp=sqrt(temp);
00052
00053
00054 if(temp > fabs(v[j])){
00055 t[j]=(temp + v[j])/2;
00056 for (i=j; i<tn; i+=n)
00057 x[i]= t[j] / temp * u[i];
00058 }
00059 else
00060 if(temp <= v[j]){
00061 t[j]=v[j];
00062
00063 for (i=j; i<tn; i+=n)
00064 x[i]= u[i];
00065 }
00066 else{
00067 t[j]=0;
00068
00069 for (i=j; i<tn; i+=n)
00070 x[i]=0;
00071 }
00072
00073 }
00074 }
00075 #endif
00076