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 EP1R_SLEP
00018 #define EP1R_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 ep1R(double * x, double *t, double * u, double * v, int n)
00040 {
00041 int j;
00042
00043
00044 for(j=0;j<n;j++){
00045
00046 if(fabs(u[j]) > fabs(v[j])){
00047 t[j]=(fabs(u[j]) + v[j])/2;
00048
00049 if (u[j] >0)
00050 x[j]=t[j];
00051 else
00052 x[j]=-t[j];
00053 }
00054 else
00055 if(fabs(u[j]) <= v[j]){
00056 t[j]=v[j];
00057 x[j]=u[j];
00058 }
00059 else{
00060 t[j]=x[j]=0;
00061 }
00062
00063 }
00064 }
00065 #endif
00066