summaryrefslogtreecommitdiff
path: root/macros/CFiles/sci2ccode
diff options
context:
space:
mode:
Diffstat (limited to 'macros/CFiles/sci2ccode')
-rw-r--r--macros/CFiles/sci2ccode/ConvertPrecision.c41
-rw-r--r--macros/CFiles/sci2ccode/FileManagement.c12
-rw-r--r--macros/CFiles/sci2ccode/OpEqual.c90
-rw-r--r--macros/CFiles/sci2ccode/OpExt.c11
-rw-r--r--macros/CFiles/sci2ccode/OpIns.c11
-rw-r--r--macros/CFiles/sci2ccode/OpLogAnd.c38
-rw-r--r--macros/CFiles/sci2ccode/OpLogGe.c37
-rw-r--r--macros/CFiles/sci2ccode/OpLogGt.c37
-rw-r--r--macros/CFiles/sci2ccode/OpLogLe.c37
-rw-r--r--macros/CFiles/sci2ccode/OpLogLt.c37
-rw-r--r--macros/CFiles/sci2ccode/OpLogOr.c38
-rw-r--r--macros/CFiles/sci2ccode/RealToComplex.c134
-rw-r--r--macros/CFiles/sci2ccode/SCI2Cconvol.c2
-rw-r--r--macros/CFiles/sci2ccode/SCI2Cfft.c13
14 files changed, 538 insertions, 0 deletions
diff --git a/macros/CFiles/sci2ccode/ConvertPrecision.c b/macros/CFiles/sci2ccode/ConvertPrecision.c
new file mode 100644
index 00000000..ee3ecc3a
--- /dev/null
+++ b/macros/CFiles/sci2ccode/ConvertPrecision.c
@@ -0,0 +1,41 @@
+/*
+** -*- C -*-
+**
+** ConvertPrecision.c
+** Made by Raffaele Nutricato <raffaele.nutricato@tiscali.it>
+**
+** Copyright Raffaele Nutricato 2008
+*/
+
+
+double s0doubled0(float in)
+{
+ double out;
+ out = (double) in;
+ return (out);
+}
+
+void s2doubled2(float* in, int* inSize, double* out)
+{
+ int i;
+ for (i=0; i<inSize[0]*inSize[1]; i++)
+ {
+ out[i] = (double) in[i];
+ }
+}
+
+float d0floats0(double in)
+{
+ float out;
+ out = (float) in;
+ return (out);
+}
+
+void d2floats2(double* in, int* inSize, float* out)
+{
+ int i;
+ for (i=0; i<inSize[0]*inSize[1]; i++)
+ {
+ out[i] = (float) in[i];
+ }
+}
diff --git a/macros/CFiles/sci2ccode/FileManagement.c b/macros/CFiles/sci2ccode/FileManagement.c
new file mode 100644
index 00000000..427b3551
--- /dev/null
+++ b/macros/CFiles/sci2ccode/FileManagement.c
@@ -0,0 +1,12 @@
+/*
+** -*- C -*-
+**
+** FileManagement.c
+** Made by Raffaele Nutricato <raffaele.nutricato@tiscali.it>
+**
+**
+** Copyright Rubby Nutricato 2007
+*/
+
+#include "FileManagement.h"
+
diff --git a/macros/CFiles/sci2ccode/OpEqual.c b/macros/CFiles/sci2ccode/OpEqual.c
new file mode 100644
index 00000000..70f3d504
--- /dev/null
+++ b/macros/CFiles/sci2ccode/OpEqual.c
@@ -0,0 +1,90 @@
+/*
+** -*- C -*-
+**
+** OpEqual.c
+** Made by Raffaele Nutricato <raffaele.nutricato@tiscali.it>
+**
+**
+** Copyright Raffaele Nutricato 2007
+*/
+
+#include "OpEqual.h"
+
+float sOpEquals1(float x)
+{
+ return (x);
+}
+
+double dOpEquals1(double x)
+{
+ return x;
+}
+
+floatComplex c0OpEqualc0(floatComplex x)
+{
+ return x;
+}
+
+doubleComplex z0OpEqualz0(doubleComplex x)
+{
+ return x;
+}
+
+char g0OpEqualg0(char x)
+{
+ return x;
+}
+
+void sOpEquala1(float* x, int size, float* y)
+{
+ int i = 0;
+ for (i = 0; i < size; ++i)
+ {
+ y[i] = x[i];
+ }
+}
+
+void dOpEquala1(double* x, int size, double* y)
+{
+ int i = 0;
+ for (i = 0; i < size; ++i)
+ {
+ y[i] = x[i];
+ }
+}
+
+void c2OpEqualc2(floatComplex* x, int* xSize, floatComplex* y)
+{
+ int i = 0;
+ int size;
+ size = xSize[0]*xSize[1];
+
+ for (i = 0; i < size; ++i)
+ {
+ y[i] = x[i];
+ }
+}
+
+void z2OpEqualz2(doubleComplex* x, int* xSize, doubleComplex* y)
+{
+ int i = 0;
+ int size;
+ size = xSize[0]*xSize[1];
+
+ for (i = 0; i < size; ++i)
+ {
+ y[i] = x[i];
+ }
+}
+
+void g2OpEqualg2(char* x, int* xSize, char* y)
+{
+ int i = 0;
+ int size;
+ size = xSize[0]*xSize[1];
+
+ for (i = 0; i < size; ++i)
+ {
+ y[i] = x[i];
+ }
+}
diff --git a/macros/CFiles/sci2ccode/OpExt.c b/macros/CFiles/sci2ccode/OpExt.c
new file mode 100644
index 00000000..0b137b14
--- /dev/null
+++ b/macros/CFiles/sci2ccode/OpExt.c
@@ -0,0 +1,11 @@
+/*
+** -*- C -*-
+**
+**
+** Made by Raffaele.Nutricato@tiscali.it
+**
+** Copyright Raffaele Nutricato
+*/
+
+#include "OpExt.h"
+
diff --git a/macros/CFiles/sci2ccode/OpIns.c b/macros/CFiles/sci2ccode/OpIns.c
new file mode 100644
index 00000000..df386894
--- /dev/null
+++ b/macros/CFiles/sci2ccode/OpIns.c
@@ -0,0 +1,11 @@
+/*
+** -*- C -*-
+**
+**
+** Made by Raffaele.Nutricato@tiscali.it
+**
+** Copyright Raffaele Nutricato
+*/
+
+#include "OpIns.h"
+
diff --git a/macros/CFiles/sci2ccode/OpLogAnd.c b/macros/CFiles/sci2ccode/OpLogAnd.c
new file mode 100644
index 00000000..86deee72
--- /dev/null
+++ b/macros/CFiles/sci2ccode/OpLogAnd.c
@@ -0,0 +1,38 @@
+/*
+** -*- C -*-
+**
+** OpLogAnd.c
+** Made by Raffaele Nutricato <raffaele.nutricato@tiscali.it>
+**
+**
+** Copyright Raffaele Nutricato 2007
+*/
+
+#include "OpLogAnd.h"
+
+void s2s0OpLogAnds2(float* in1, int* in1Size, float in2, float* out)
+{
+ int rows = 0;
+ int cols = 0;
+ for (rows = 0; rows < in1Size[0];rows++)
+ {
+ for (cols = 0; cols < in1Size[1];cols++)
+ {
+ out[rows*in1Size[1]+cols] = (float) (in1[rows*in1Size[1]+cols] && in2);
+ }
+ }
+}
+
+void d2d0OpLogAndd2(double* in1, int* in1Size, double in2, double* out)
+{
+ int rows = 0;
+ int cols = 0;
+ for (rows = 0; rows < in1Size[0];rows++)
+ {
+ for (cols = 0; cols < in1Size[1];cols++)
+ {
+ out[rows*in1Size[1]+cols] = (double) (in1[rows*in1Size[1]+cols] && in2);
+ }
+ }
+}
+
diff --git a/macros/CFiles/sci2ccode/OpLogGe.c b/macros/CFiles/sci2ccode/OpLogGe.c
new file mode 100644
index 00000000..3664f2e1
--- /dev/null
+++ b/macros/CFiles/sci2ccode/OpLogGe.c
@@ -0,0 +1,37 @@
+/*
+** -*- C -*-
+**
+** OpDotSlash.c
+** Made by Raffaele Nutricato <raffaele.nutricato@tiscali.it>
+**
+**
+** Copyright Raffaele Nutricato 2007
+*/
+
+#include "OpLogGe.h"
+
+void s2s0OpLogGes2(float* in1, int* in1Size, float in2, float* out)
+{
+ int rows = 0;
+ int cols = 0;
+ for (rows = 0; rows < in1Size[0];rows++)
+ {
+ for (cols = 0; cols < in1Size[1];cols++)
+ {
+ out[rows*in1Size[1]+cols] = (float) (in1[rows*in1Size[1]+cols] >= in2);
+ }
+ }
+}
+
+void d2d0OpLogGed2(double* in1, int* in1Size, double in2, double* out)
+{
+ int rows = 0;
+ int cols = 0;
+ for (rows = 0; rows < in1Size[0];rows++)
+ {
+ for (cols = 0; cols < in1Size[1];cols++)
+ {
+ out[rows*in1Size[1]+cols] = (double) (in1[rows*in1Size[1]+cols] >= in2);
+ }
+ }
+}
diff --git a/macros/CFiles/sci2ccode/OpLogGt.c b/macros/CFiles/sci2ccode/OpLogGt.c
new file mode 100644
index 00000000..25e4bd96
--- /dev/null
+++ b/macros/CFiles/sci2ccode/OpLogGt.c
@@ -0,0 +1,37 @@
+/*
+** -*- C -*-
+**
+** OpDotSlash.c
+** Made by Raffaele Nutricato <raffaele.nutricato@tiscali.it>
+**
+**
+** Copyright Raffaele Nutricato 2007
+*/
+
+#include "OpLogGt.h"
+
+void s2s0OpLogGts2(float* in1, int* in1Size, float in2, float* out)
+{
+ int rows = 0;
+ int cols = 0;
+ for (rows = 0; rows < in1Size[0];rows++)
+ {
+ for (cols = 0; cols < in1Size[1];cols++)
+ {
+ out[rows*in1Size[1]+cols] = (float) (in1[rows*in1Size[1]+cols] > in2);
+ }
+ }
+}
+
+void d2d0OpLogGtd2(double* in1, int* in1Size, double in2, double* out)
+{
+ int rows = 0;
+ int cols = 0;
+ for (rows = 0; rows < in1Size[0];rows++)
+ {
+ for (cols = 0; cols < in1Size[1];cols++)
+ {
+ out[rows*in1Size[1]+cols] = (double) (in1[rows*in1Size[1]+cols] > in2);
+ }
+ }
+}
diff --git a/macros/CFiles/sci2ccode/OpLogLe.c b/macros/CFiles/sci2ccode/OpLogLe.c
new file mode 100644
index 00000000..a1544489
--- /dev/null
+++ b/macros/CFiles/sci2ccode/OpLogLe.c
@@ -0,0 +1,37 @@
+/*
+** -*- C -*-
+**
+** OpDotSlash.c
+** Made by Raffaele Nutricato <raffaele.nutricato@tiscali.it>
+**
+**
+** Copyright Raffaele Nutricato 2007
+*/
+
+#include "OpLogLe.h"
+
+void s2s0OpLogLes2(float* in1, int* in1Size, float in2, float* out)
+{
+ int rows = 0;
+ int cols = 0;
+ for (rows = 0; rows < in1Size[0];rows++)
+ {
+ for (cols = 0; cols < in1Size[1];cols++)
+ {
+ out[rows*in1Size[1]+cols] = (float) (in1[rows*in1Size[1]+cols] <= in2);
+ }
+ }
+}
+
+void d2d0OpLogLed2(double* in1, int* in1Size, double in2, double* out)
+{
+ int rows = 0;
+ int cols = 0;
+ for (rows = 0; rows < in1Size[0];rows++)
+ {
+ for (cols = 0; cols < in1Size[1];cols++)
+ {
+ out[rows*in1Size[1]+cols] = (double) (in1[rows*in1Size[1]+cols] <= in2);
+ }
+ }
+}
diff --git a/macros/CFiles/sci2ccode/OpLogLt.c b/macros/CFiles/sci2ccode/OpLogLt.c
new file mode 100644
index 00000000..a7e6d774
--- /dev/null
+++ b/macros/CFiles/sci2ccode/OpLogLt.c
@@ -0,0 +1,37 @@
+/*
+** -*- C -*-
+**
+** OpDotSlash.c
+** Made by Raffaele Nutricato <raffaele.nutricato@tiscali.it>
+**
+**
+** Copyright Raffaele Nutricato 2007
+*/
+
+#include "OpLogLt.h"
+
+void s2s0OpLogLts2(float* in1, int* in1Size, float in2, float* out)
+{
+ int rows = 0;
+ int cols = 0;
+ for (rows = 0; rows < in1Size[0];rows++)
+ {
+ for (cols = 0; cols < in1Size[1];cols++)
+ {
+ out[rows*in1Size[1]+cols] = (float) (in1[rows*in1Size[1]+cols] < in2);
+ }
+ }
+}
+
+void d2d0OpLogLtd2(double* in1, int* in1Size, double in2, double* out)
+{
+ int rows = 0;
+ int cols = 0;
+ for (rows = 0; rows < in1Size[0];rows++)
+ {
+ for (cols = 0; cols < in1Size[1];cols++)
+ {
+ out[rows*in1Size[1]+cols] = (double) (in1[rows*in1Size[1]+cols] < in2);
+ }
+ }
+}
diff --git a/macros/CFiles/sci2ccode/OpLogOr.c b/macros/CFiles/sci2ccode/OpLogOr.c
new file mode 100644
index 00000000..eb553b33
--- /dev/null
+++ b/macros/CFiles/sci2ccode/OpLogOr.c
@@ -0,0 +1,38 @@
+/*
+** -*- C -*-
+**
+** OpLogOr.c
+** Made by Raffaele Nutricato <raffaele.nutricato@tiscali.it>
+**
+**
+** Copyright Raffaele Nutricato 2007
+*/
+
+#include "OpLogOr.h"
+
+void s2s0OpLogOrs2(float* in1, int* in1Size, float in2, float* out)
+{
+ int rows = 0;
+ int cols = 0;
+ for (rows = 0; rows < in1Size[0];rows++)
+ {
+ for (cols = 0; cols < in1Size[1];cols++)
+ {
+ out[rows*in1Size[1]+cols] = (float) (in1[rows*in1Size[1]+cols] || in2);
+ }
+ }
+}
+
+void d2d0OpLogOrd2(double* in1, int* in1Size, double in2, double* out)
+{
+ int rows = 0;
+ int cols = 0;
+ for (rows = 0; rows < in1Size[0];rows++)
+ {
+ for (cols = 0; cols < in1Size[1];cols++)
+ {
+ out[rows*in1Size[1]+cols] = (double) (in1[rows*in1Size[1]+cols] || in2);
+ }
+ }
+}
+
diff --git a/macros/CFiles/sci2ccode/RealToComplex.c b/macros/CFiles/sci2ccode/RealToComplex.c
new file mode 100644
index 00000000..dd7b5ecf
--- /dev/null
+++ b/macros/CFiles/sci2ccode/RealToComplex.c
@@ -0,0 +1,134 @@
+/*
+** -*- C -*-
+**
+**
+** Made by Raffaele.Nutricato@tiscali.it
+**
+** Copyright Raffaele Nutricato
+*/
+
+#include "RealToComplex.h"
+
+floatComplex s0floatcomplexc0(float in)
+{
+ floatComplex out;
+ out = FloatComplex(in,0);
+ return out;
+}
+
+floatComplex d0floatcomplexc0(double in)
+{
+ floatComplex out;
+ out = FloatComplex(in,0);
+ return out;
+}
+
+floatComplex c0floatcomplexc0(floatComplex in)
+{
+ return in;
+}
+
+floatComplex z0floatcomplexc0(doubleComplex in)
+{
+ floatComplex out;
+ out = FloatComplex((float)zreals(in),(float)zimags(in));
+ return out;
+}
+
+void s2floatcomplexc2(float* in, int* inSize, floatComplex* out)
+{
+ int i = 0;
+ for (i=0;i<inSize[0]*inSize[1];i++)
+ {
+ out[i] = s0floatcomplexc0(in[i]);
+ }
+}
+
+void d2floatcomplexc2(double* in, int* inSize, floatComplex* out)
+{
+ int i = 0;
+ for (i=0;i<inSize[0]*inSize[1];i++)
+ {
+ out[i] = d0floatcomplexc0(in[i]);
+ }
+}
+
+void c2floatcomplexc2(floatComplex* in, int* inSize, floatComplex* out)
+{
+ int i = 0;
+ for (i=0;i<inSize[0]*inSize[1];i++)
+ {
+ out[i] = c0floatcomplexc0(in[i]);
+ }
+}
+
+void z2floatcomplexc2(doubleComplex* in, int* inSize, floatComplex* out)
+{
+ int i = 0;
+ for (i=0;i<inSize[0]*inSize[1];i++)
+ {
+ out[i] = z0floatcomplexc0(in[i]);
+ }
+}
+
+doubleComplex s0doublecomplexz0(float in)
+{
+ doubleComplex out;
+ out = DoubleComplex((double)(in),0);
+ return out;
+}
+
+doubleComplex d0doublecomplexz0(double in)
+{
+ doubleComplex out;
+ out = DoubleComplex(in,0);
+ return out;
+}
+
+doubleComplex c0doublecomplexz0(floatComplex in)
+{
+ doubleComplex out;
+ out = DoubleComplex((double) creals(in),(double) cimags(in));
+ return out;
+}
+
+doubleComplex z0doublecomplexz0(doubleComplex in)
+{
+ return in;
+}
+
+void s2doublecomplexz2(float* in, int* inSize, doubleComplex* out)
+{
+ int i = 0;
+ for (i=0;i<inSize[0]*inSize[1];i++)
+ {
+ out[i] = s0doublecomplexz0(in[i]);
+ }
+}
+
+void d2doublecomplexz2(double* in, int* inSize, doubleComplex* out)
+{
+ int i = 0;
+ for (i=0;i<inSize[0]*inSize[1];i++)
+ {
+ out[i] = d0doublecomplexz0(in[i]);
+ }
+}
+
+void c2doublecomplexz2(floatComplex* in, int* inSize, doubleComplex* out)
+{
+ int i = 0;
+ for (i=0;i<inSize[0]*inSize[1];i++)
+ {
+ out[i] = c0doublecomplexz0(in[i]);
+ }
+}
+
+void z2doublecomplexz2(doubleComplex* in, int* inSize, doubleComplex* out)
+{
+ int i = 0;
+ for (i=0;i<inSize[0]*inSize[1];i++)
+ {
+ out[i] = z0doublecomplexz0(in[i]);
+ }
+}
diff --git a/macros/CFiles/sci2ccode/SCI2Cconvol.c b/macros/CFiles/sci2ccode/SCI2Cconvol.c
new file mode 100644
index 00000000..989cb9de
--- /dev/null
+++ b/macros/CFiles/sci2ccode/SCI2Cconvol.c
@@ -0,0 +1,2 @@
+#include "SCI2Cconvol.h"
+
diff --git a/macros/CFiles/sci2ccode/SCI2Cfft.c b/macros/CFiles/sci2ccode/SCI2Cfft.c
new file mode 100644
index 00000000..9cced2e1
--- /dev/null
+++ b/macros/CFiles/sci2ccode/SCI2Cfft.c
@@ -0,0 +1,13 @@
+/*
+** -*- C -*-
+**
+** OpDotSlash.c
+** Made by Raffaele Nutricato <raffaele.nutricato@tiscali.it>
+**
+**
+** Copyright Raffaele Nutricato 2007
+*/
+
+#include "SCI2Cfft.h"
+
+