summaryrefslogtreecommitdiff
path: root/src/c/elementaryFunctions/nanmax
diff options
context:
space:
mode:
Diffstat (limited to 'src/c/elementaryFunctions/nanmax')
-rw-r--r--src/c/elementaryFunctions/nanmax/dnanmax1a.c (renamed from src/c/elementaryFunctions/nanmax/znanmaxa.c)25
-rw-r--r--src/c/elementaryFunctions/nanmax/znanmaxcola.c36
-rw-r--r--src/c/elementaryFunctions/nanmax/znanmaxrowa.c37
3 files changed, 13 insertions, 85 deletions
diff --git a/src/c/elementaryFunctions/nanmax/znanmaxa.c b/src/c/elementaryFunctions/nanmax/dnanmax1a.c
index 6283bf1..a0e7eed 100644
--- a/src/c/elementaryFunctions/nanmax/znanmaxa.c
+++ b/src/c/elementaryFunctions/nanmax/dnanmax1a.c
@@ -15,31 +15,30 @@
#include <math.h>
#include "nanmax.h"
#include "types.h"
-#include "doubleComplex.h"
-#include "abs.h"
-
-doubleComplex znanmaxa(doubleComplex* in, int size)
+double dnanmax1a(double* in, int row, int col, double* out)
{
-doubleComplex high=0; int k=0;
-for(int i=0; i<size; i++)
+double high;
+int ival=0;
+for(int i=0; i<row*col; i++)
{
if( !(isnan(in[i])) )
{
high= in[i];
break;
- k= 1;
+
}
}
- for(int i=0; i< size; i++)
+ for(int i=0; i< row*col; i++)
{
if( !(isnan(in[i])) )
{
- if( zabss(in[i]) > zabss(high))
+ if( in[i] > high)
{
high= in[i];
+ ival=i;
}
@@ -48,10 +47,12 @@ for(int i=0; i<size; i++)
}
+
+out[0]= ival%row +1;
+out[1]= ival/row +1;
-if(k != 0)
+
return high;
-else
-return - 0.0/0.0;
+
}
diff --git a/src/c/elementaryFunctions/nanmax/znanmaxcola.c b/src/c/elementaryFunctions/nanmax/znanmaxcola.c
deleted file mode 100644
index ffb96b2..0000000
--- a/src/c/elementaryFunctions/nanmax/znanmaxcola.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* 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 "nanmax.h"
-#include "types.h"
-#include "uint16.h"
-#include "doubleComplex.h"
-
-void znanmaxcola(doubleComplex *in, int row, int col, doubleComplex* out)
-{
- doubleComplex inter[col];
-
-
-for(int i=0; i< row; i++)
- {
- for(int j=0 ; j< col; j++)
- {
- inter[j]= in[i+ (j*row)];
-
- }
- out[i]= znanmaxa( inter, col);
-
- }
-
-
-}
diff --git a/src/c/elementaryFunctions/nanmax/znanmaxrowa.c b/src/c/elementaryFunctions/nanmax/znanmaxrowa.c
deleted file mode 100644
index e035e77..0000000
--- a/src/c/elementaryFunctions/nanmax/znanmaxrowa.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* 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 "nanmax.h"
-#include "types.h"
-#include "uint16.h"
-#include "doubleComplex.h"
-
-void znanmaxrowa(doubleComplex *in, int row, int col, doubleComplex* out)
-{
- doubleComplex inter[row];
-
-
-
-for(int i=0; i< col; i++)
- {
- for(int j=0 ; j< row; j++)
- {
- inter[j]= in[j+ (i*row)];
-
- }
- out[i]= znanmaxa( inter, row);
-
- }
-
-
-}