diff options
author | Abhinav Dronamraju | 2017-07-10 21:01:37 +0530 |
---|---|---|
committer | Abhinav Dronamraju | 2017-07-10 21:01:37 +0530 |
commit | c7d123014c05daaa6c7ce32bc5e86e5f3e7e4692 (patch) | |
tree | 35fc5430946676e4a48e13df68b451f28f278dcd /src | |
parent | 1a95de6f010d083eec136cafc9189ae03eb184ff (diff) | |
download | Scilab2C_fossee_old-c7d123014c05daaa6c7ce32bc5e86e5f3e7e4692.tar.gz Scilab2C_fossee_old-c7d123014c05daaa6c7ce32bc5e86e5f3e7e4692.tar.bz2 Scilab2C_fossee_old-c7d123014c05daaa6c7ce32bc5e86e5f3e7e4692.zip |
Nthroot added
Diffstat (limited to 'src')
31 files changed, 713 insertions, 0 deletions
diff --git a/src/c/elementaryFunctions/includes/iscolumn.h b/src/c/elementaryFunctions/includes/iscolumn.h index ac1de9d..e971176 100644 --- a/src/c/elementaryFunctions/includes/iscolumn.h +++ b/src/c/elementaryFunctions/includes/iscolumn.h @@ -17,6 +17,7 @@ #include "types.h" #include "doubleComplex.h" #include "floatComplex.h" +#include "uint16.h" #ifdef __cplusplus extern "C" { @@ -30,6 +31,9 @@ char giscolumna(char* , int); char giscolumns(char); char ziscolumna(doubleComplex*, int); char ziscolumns(doubleComplex); +char u16iscolumna(uint16*, int); +char u16iscolumns(uint16); + #ifdef __cplusplus } /* extern "C" */ diff --git a/src/c/elementaryFunctions/includes/isrow.h b/src/c/elementaryFunctions/includes/isrow.h index 8c9f7ce..2de7da3 100644 --- a/src/c/elementaryFunctions/includes/isrow.h +++ b/src/c/elementaryFunctions/includes/isrow.h @@ -17,6 +17,7 @@ #include "types.h" #include "doubleComplex.h" #include "floatComplex.h" +#include "uint16.h" #ifdef __cplusplus extern "C" { @@ -30,6 +31,8 @@ char gisrowa(char* , int); char gisrows(char); char zisrowa(doubleComplex*, int); char zisrows(doubleComplex); +char u16isrowa(uint16*, int); +char u16isrows(uint16); #ifdef __cplusplus } /* extern "C" */ diff --git a/src/c/elementaryFunctions/includes/issquare.h b/src/c/elementaryFunctions/includes/issquare.h new file mode 100644 index 0000000..70e4c45 --- /dev/null +++ b/src/c/elementaryFunctions/includes/issquare.h @@ -0,0 +1,38 @@ +/* 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: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __ISSQUARE_H__ +#define __ISSQUARE_H__ + + +#include "types.h" +#include "doubleComplex.h" +#include "floatComplex.h" + +#ifdef __cplusplus +extern "C" { +#endif + +char dissquarea(double* , int, int); +char dissquares(double); +char sissquarea( float* , int, int); +char sissquares( float); +char gissquarea(char* , int, int); +char gissquares(char); +char zissquarea(doubleComplex*, int, int); +char zissquares(doubleComplex); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/c/elementaryFunctions/includes/nthroot.h b/src/c/elementaryFunctions/includes/nthroot.h new file mode 100644 index 0000000..62b533a --- /dev/null +++ b/src/c/elementaryFunctions/includes/nthroot.h @@ -0,0 +1,37 @@ +/* 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: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __NTHROOT_H__ +#define __NTHROOT_H__ + + +#include "types.h" +#include "doubleComplex.h" +#include "floatComplex.h" +#include "uint16.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dnthroota(double* , int ,int , double*, int , int, double*); +void dnthroot1a(double*, int , int, double, double*); +double dnthroots(double, double); +void snthroota(float* , int ,int , float*, int , int, double*); +void snthroot1a(float*, int , int, float, double*); +double snthroots(float, float); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/c/elementaryFunctions/includes/pow.h b/src/c/elementaryFunctions/includes/pow.h index de1eb40..2905b7e 100644 --- a/src/c/elementaryFunctions/includes/pow.h +++ b/src/c/elementaryFunctions/includes/pow.h @@ -15,6 +15,11 @@ #include "dynlib_elementaryfunctions.h" #include "multiplication.h" +#include "floatComplex.h" +#include "doubleComplex.h" +#include "uint8.h" +#include "uint16.h" +#include "int16.h" #ifdef __cplusplus extern "C" { diff --git a/src/c/elementaryFunctions/interfaces/int_iscolumn.h b/src/c/elementaryFunctions/interfaces/int_iscolumn.h index f5e8a7d..e1011d7 100644 --- a/src/c/elementaryFunctions/interfaces/int_iscolumn.h +++ b/src/c/elementaryFunctions/interfaces/int_iscolumn.h @@ -21,6 +21,9 @@ #define g0iscolumng0(in) giscolumns(in) #define z2iscolumng0(in,size) ziscolumna(in , size[1]) #define z0iscolumng0(in) ziscolumns(in) +#define u162iscolumng0(in,size) u16iscolumna(in , size[1]) +#define u160iscolumng0(in) u16iscolumns(in) + #endif diff --git a/src/c/elementaryFunctions/interfaces/int_isrow.h b/src/c/elementaryFunctions/interfaces/int_isrow.h index cc6be37..9298de9 100644 --- a/src/c/elementaryFunctions/interfaces/int_isrow.h +++ b/src/c/elementaryFunctions/interfaces/int_isrow.h @@ -21,6 +21,9 @@ #define g0isrowg0(in) gisrows(in) #define z2isrowg0(in, size) zisrowa(in , size[0]) #define z0isrowg0(in) zisrows(in) +#define u162isrowg0(in, size) u16isrowa(in , size[0]) +#define u160isrowg0(in) u16isrows(in) + #endif diff --git a/src/c/elementaryFunctions/interfaces/int_issquare.h b/src/c/elementaryFunctions/interfaces/int_issquare.h new file mode 100644 index 0000000..0535788 --- /dev/null +++ b/src/c/elementaryFunctions/interfaces/int_issquare.h @@ -0,0 +1,25 @@ + /*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: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + + +#ifndef __INT_ISSQUARE_H__ +#define __INT_ISSQUARE_H__ + +#define d2issquareg0(in, size ) dissquarea(in, size[0], size[1]) +#define d0issquareg0(in) dissquares(in) +#define s2issquareg0(in , size) sissquarea(in, size[0], size[1]) +#define s0issquareg0(in) sissquares(in) +#define g2issquareg0(in, size) gissquarea(in, size[0], size[1]) +#define g0issquareg0(in) gissquares(in) +#define z2issquareg0(in, size) zissquarea(in , size[0], size[1]) +#define z0issquareg0(in) zissquares(in) + +#endif diff --git a/src/c/elementaryFunctions/interfaces/int_nthroot.h b/src/c/elementaryFunctions/interfaces/int_nthroot.h new file mode 100644 index 0000000..aa48fcc --- /dev/null +++ b/src/c/elementaryFunctions/interfaces/int_nthroot.h @@ -0,0 +1,23 @@ + /*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: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + + +#ifndef __INT_NTHROOT_H__ +#define __INT_NTHROOT_H__ + +#define d2d2nthrootd2(in1, size1, in2, size2, out) dnthroota(in1, size1[0], size1[1], in2, size2[0], size2[1], out) +#define d2d0nthrootd2(in1, size1, in2, out) dnthroot1a(in1, size1[0], size1[1], in2, out) +#define d0d0nthrootd0(in1, in2) dnthroots(in1, in2) +#define s2s2nthrootd2(in1, size1, in2, size2, out) snthroota(in1, size1[0], size1[1], in2, size2[0], size2[1], out) +#define s2s0nthrootd2(in1, size1, in2, out) snthroot1a(in1, size1[0], size1[1], in2, out) +#define s0s0nthrootd0(in1, in2) snthroots(in1, in2) + +#endif diff --git a/src/c/elementaryFunctions/iscolumn/u16iscolumna.c b/src/c/elementaryFunctions/iscolumn/u16iscolumna.c new file mode 100644 index 0000000..ef0821d --- /dev/null +++ b/src/c/elementaryFunctions/iscolumn/u16iscolumna.c @@ -0,0 +1,27 @@ +/* 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: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "iscolumn.h" +#include "types.h" +#include "uint16.h" +char u16iscolumna(uint16* inp, int size1) +{ + char out='F'; + if(size1==1) + { + out = 'T'; + } + return out; +} diff --git a/src/c/elementaryFunctions/iscolumn/u16iscolumns.c b/src/c/elementaryFunctions/iscolumn/u16iscolumns.c new file mode 100644 index 0000000..7a17464 --- /dev/null +++ b/src/c/elementaryFunctions/iscolumn/u16iscolumns.c @@ -0,0 +1,25 @@ +/* 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: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "iscolumn.h" +#include "types.h" +#include "uint16.h" + +char u16iscolumns(uint16 inp) +{ + char out='T'; + + return out; +} diff --git a/src/c/elementaryFunctions/isrow/u16isrowa.c b/src/c/elementaryFunctions/isrow/u16isrowa.c new file mode 100644 index 0000000..3ddbb0f --- /dev/null +++ b/src/c/elementaryFunctions/isrow/u16isrowa.c @@ -0,0 +1,27 @@ +/* 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: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "isrow.h" +#include "types.h" +#include "uint16.h" +char u16isrowa(uint16* inp, int size1) +{ + char out='F'; + if(size1==1) + { + out = 'T'; + } + return out; +} diff --git a/src/c/elementaryFunctions/isrow/u16isrows.c b/src/c/elementaryFunctions/isrow/u16isrows.c new file mode 100644 index 0000000..2942dd3 --- /dev/null +++ b/src/c/elementaryFunctions/isrow/u16isrows.c @@ -0,0 +1,25 @@ +/* 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: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "isrow.h" +#include "types.h" +#include "uint16.h" + +char u16isrows(uint16 inp) +{ + char out='T'; + + return out; +} diff --git a/src/c/elementaryFunctions/issquare/dissquarea.c b/src/c/elementaryFunctions/issquare/dissquarea.c new file mode 100644 index 0000000..840190d --- /dev/null +++ b/src/c/elementaryFunctions/issquare/dissquarea.c @@ -0,0 +1,26 @@ +/* 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: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "issquare.h" +#include "types.h" +char dissquarea(double* inp, int size1, int size2) +{ + char out= 'F' ; + if(size1==size2) + { + out = 'T'; + } + return out; +} diff --git a/src/c/elementaryFunctions/issquare/dissquares.c b/src/c/elementaryFunctions/issquare/dissquares.c new file mode 100644 index 0000000..ac6d67e --- /dev/null +++ b/src/c/elementaryFunctions/issquare/dissquares.c @@ -0,0 +1,24 @@ +/* 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: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "issquare.h" +#include "types.h" + +char dissquares(double inp) +{ + double out='T'; + + return out; +} diff --git a/src/c/elementaryFunctions/issquare/gissquarea.c b/src/c/elementaryFunctions/issquare/gissquarea.c new file mode 100644 index 0000000..73e2b37 --- /dev/null +++ b/src/c/elementaryFunctions/issquare/gissquarea.c @@ -0,0 +1,27 @@ +/* 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: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "issquare.h" +#include "types.h" +#include "string.h" +char gissquarea(char *inp, int size1, int size2) +{ + char out='F'; + if(size1==size2) + { + out = 'T'; + } + return out; +} diff --git a/src/c/elementaryFunctions/issquare/gissquares.c b/src/c/elementaryFunctions/issquare/gissquares.c new file mode 100644 index 0000000..572afd1 --- /dev/null +++ b/src/c/elementaryFunctions/issquare/gissquares.c @@ -0,0 +1,24 @@ +/* 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: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "issquare.h" +#include "types.h" + +char gissquares(char inp) +{ + char out='T'; + + return out; +} diff --git a/src/c/elementaryFunctions/issquare/sissquarea.c b/src/c/elementaryFunctions/issquare/sissquarea.c new file mode 100644 index 0000000..856cb81 --- /dev/null +++ b/src/c/elementaryFunctions/issquare/sissquarea.c @@ -0,0 +1,26 @@ +/* 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: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "issquare.h" +#include "types.h" +char sissquarea(float* inp, int size1, int size2) +{ + char out='F'; + if(size1==size2) + { + out = 'T'; + } + return out; +} diff --git a/src/c/elementaryFunctions/issquare/sissquares.c b/src/c/elementaryFunctions/issquare/sissquares.c new file mode 100644 index 0000000..1a6fbf8 --- /dev/null +++ b/src/c/elementaryFunctions/issquare/sissquares.c @@ -0,0 +1,24 @@ +/* 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: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "issquare.h" +#include "types.h" + +char sissquares(float inp) +{ + char out='T'; + + return out; +} diff --git a/src/c/elementaryFunctions/issquare/zissquarea.c b/src/c/elementaryFunctions/issquare/zissquarea.c new file mode 100644 index 0000000..023b8fc --- /dev/null +++ b/src/c/elementaryFunctions/issquare/zissquarea.c @@ -0,0 +1,28 @@ +/* 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: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "doubleComplex.h" +#include "issquare.h" +#include "types.h" + +char zissquarea(doubleComplex *inp, int size1, int size2) +{ + char out='F'; + if(size1==size2) + { + out = 'T'; + } + return out; +} diff --git a/src/c/elementaryFunctions/issquare/zissquares.c b/src/c/elementaryFunctions/issquare/zissquares.c new file mode 100644 index 0000000..2c1bb56 --- /dev/null +++ b/src/c/elementaryFunctions/issquare/zissquares.c @@ -0,0 +1,25 @@ +/* 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: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "issquare.h" +#include "types.h" +#include "doubleComplex.h" + +char zissquares(doubleComplex inp) +{ + char out='T'; + + return out; +} diff --git a/src/c/elementaryFunctions/nthroot/dnthroot.c b/src/c/elementaryFunctions/nthroot/dnthroot.c deleted file mode 100644 index e69de29..0000000 --- a/src/c/elementaryFunctions/nthroot/dnthroot.c +++ /dev/null diff --git a/src/c/elementaryFunctions/nthroot/dnthroot1a.c b/src/c/elementaryFunctions/nthroot/dnthroot1a.c new file mode 100644 index 0000000..7c65169 --- /dev/null +++ b/src/c/elementaryFunctions/nthroot/dnthroot1a.c @@ -0,0 +1,28 @@ +/* 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: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "nthroot.h" +#include "types.h" +void dnthroot1a(double* inp1, int irows, int icols, double inp2, double* out) +{ + + + for(int i=0; i< irows*icols; i++) + { + out[i]= dnthroots(inp1[i], inp2); + + } + +} diff --git a/src/c/elementaryFunctions/nthroot/dnthroota.c b/src/c/elementaryFunctions/nthroot/dnthroota.c new file mode 100644 index 0000000..6f33b21 --- /dev/null +++ b/src/c/elementaryFunctions/nthroot/dnthroota.c @@ -0,0 +1,36 @@ +/* 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: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "nthroot.h" +#include "types.h" +void dnthroota(double* inp1, int irows, int icols, double* inp2, int crows, int ccols, double* out) +{ + + if(irows==crows && icols==ccols) + { + for(int i=0; i< irows*icols; i++) + { + + out[i]= dnthroots(inp1[i], inp2[i]); + + } + + + + } + + + +} diff --git a/src/c/elementaryFunctions/nthroot/dnthroots.c b/src/c/elementaryFunctions/nthroot/dnthroots.c new file mode 100644 index 0000000..99beaa1 --- /dev/null +++ b/src/c/elementaryFunctions/nthroot/dnthroots.c @@ -0,0 +1,23 @@ +/* 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: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "nthroot.h" +#include "types.h" + +double dnthroots(double inp1, double inp2) +{ + + return pow(inp1, (1/inp2)); +} diff --git a/src/c/elementaryFunctions/nthroot/snthroot1a.c b/src/c/elementaryFunctions/nthroot/snthroot1a.c new file mode 100644 index 0000000..60fae3d --- /dev/null +++ b/src/c/elementaryFunctions/nthroot/snthroot1a.c @@ -0,0 +1,28 @@ +/* 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: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "nthroot.h" +#include "types.h" +void snthroot1a(float* inp1, int irows, int icols, float inp2, double* out) +{ + + + for(int i=0; i< irows*icols; i++) + { + out[i]= dnthroots(inp1[i], inp2); + + } + +} diff --git a/src/c/elementaryFunctions/nthroot/snthroota.c b/src/c/elementaryFunctions/nthroot/snthroota.c new file mode 100644 index 0000000..4a04c1d --- /dev/null +++ b/src/c/elementaryFunctions/nthroot/snthroota.c @@ -0,0 +1,36 @@ +/* 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: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "nthroot.h" +#include "types.h" +void snthroota(float* inp1, int irows, int icols, float* inp2, int crows, int ccols, double* out) +{ + + if(irows==crows && icols==ccols) + { + for(int i=0; i< irows*icols; i++) + { + + out[i]= dnthroots(inp1[i], inp2[i]); + + } + + + + } + + + +} diff --git a/src/c/elementaryFunctions/nthroot/snthroots.c b/src/c/elementaryFunctions/nthroot/snthroots.c new file mode 100644 index 0000000..ad83dac --- /dev/null +++ b/src/c/elementaryFunctions/nthroot/snthroots.c @@ -0,0 +1,23 @@ +/* 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: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "nthroot.h" +#include "types.h" + +double snthroots(float inp1, float inp2) +{ + + return pow(inp1, (1/inp2)); +} diff --git a/src/c/elementaryFunctions/nthroot/u16nthroot1a.c b/src/c/elementaryFunctions/nthroot/u16nthroot1a.c new file mode 100644 index 0000000..4cb654c --- /dev/null +++ b/src/c/elementaryFunctions/nthroot/u16nthroot1a.c @@ -0,0 +1,29 @@ +/* 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: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "nthroot.h" +#include "types.h" +#include "uint16.h" +void snthroot1a(uint16* inp1, int irows, int icols, uint16 inp2, double* out) +{ + + + for(int i=0; i< irows*icols; i++) + { + out[i]= dnthroots(inp1[i], inp2); + + } + +} diff --git a/src/c/elementaryFunctions/nthroot/u16nthroota.c b/src/c/elementaryFunctions/nthroot/u16nthroota.c new file mode 100644 index 0000000..5d178a1 --- /dev/null +++ b/src/c/elementaryFunctions/nthroot/u16nthroota.c @@ -0,0 +1,37 @@ +/* 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: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "nthroot.h" +#include "types.h" +#include "uint16.h" +void dnthroota(uint16* inp1, int irows, int icols, uint16* inp2, int crows, int ccols, double* out) +{ + + if(irows==crows && icols==ccols) + { + for(int i=0; i< irows*icols; i++) + { + + out[i]= dnthroots(inp1[i], inp2[i]); + + } + + + + } + + + +} diff --git a/src/c/elementaryFunctions/nthroot/u16nthroots.c b/src/c/elementaryFunctions/nthroot/u16nthroots.c new file mode 100644 index 0000000..618d29f --- /dev/null +++ b/src/c/elementaryFunctions/nthroot/u16nthroots.c @@ -0,0 +1,24 @@ +/* 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: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "nthroot.h" +#include "types.h" +#include "uint16.h" + +double dnthroots(uint16 inp1, uint16 inp2) +{ + + return pow(inp1, (1/inp2)); +} |