From 9fc55b8370323fd8f7364a5abfcee3af65899a97 Mon Sep 17 00:00:00 2001 From: ukashanoor Date: Thu, 29 Jun 2017 20:26:08 +0530 Subject: till disp complete --- src/c/interpolation/interp1/sinterp13a.c | 75 ++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 src/c/interpolation/interp1/sinterp13a.c (limited to 'src/c/interpolation/interp1') diff --git a/src/c/interpolation/interp1/sinterp13a.c b/src/c/interpolation/interp1/sinterp13a.c new file mode 100644 index 0000000..b8cb085 --- /dev/null +++ b/src/c/interpolation/interp1/sinterp13a.c @@ -0,0 +1,75 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + 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 + Author: Ukasha Noor + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "interp1.h" +#include + +void sinterp13a(float *x,int size1,float *fx,int size2,float *q,int size3,char *ch,int size4,float *out) +{ + int i,j,k,f; + float a,b; + if(strcmp(ch,"linear")==0) + { + for(i=0;ix[j]) + { + j++; + } + a=x[j-1]; + b=x[j]; + out[i]=fx[j-1]+(q[i]-a)*((fx[j]-fx[j-1])/(b-a)); + } + } + } + else if(strcmp(ch,"nearest")==0) + { + for(i=0;ix[j]) + { + j++; + } + out[i]=fx[j]; + } + } + } +} + + -- cgit