summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/auxiliaryFunctions/abs/cabsa.c4
-rw-r--r--src/auxiliaryFunctions/abs/dabsa.c4
-rw-r--r--src/auxiliaryFunctions/abs/sabsa.c4
-rw-r--r--src/auxiliaryFunctions/abs/testAbs.c66
-rw-r--r--src/auxiliaryFunctions/abs/zabsa.c4
5 files changed, 48 insertions, 34 deletions
diff --git a/src/auxiliaryFunctions/abs/cabsa.c b/src/auxiliaryFunctions/abs/cabsa.c
index a8e0a048..a7d41efc 100644
--- a/src/auxiliaryFunctions/abs/cabsa.c
+++ b/src/auxiliaryFunctions/abs/cabsa.c
@@ -5,14 +5,14 @@
** Made by Bruno JOFRET <bruno.jofret@inria.fr>
**
** Started on Wed Apr 25 13:23:20 2007 jofret
-** Last update Wed Apr 25 13:24:32 2007 jofret
+** Last update Mon Oct 22 10:46:16 2007 bruno
**
** Copyright INRIA 2007
*/
#include "abs.h"
-void cabsa(floatComplex *in, float* out, int size) {
+void cabsa(floatComplex *in, int size, float* out) {
int i = 0;
for (i = 0; i < size; ++i) {
out[i] = cabss(in[i]);
diff --git a/src/auxiliaryFunctions/abs/dabsa.c b/src/auxiliaryFunctions/abs/dabsa.c
index 681c277e..5081fa25 100644
--- a/src/auxiliaryFunctions/abs/dabsa.c
+++ b/src/auxiliaryFunctions/abs/dabsa.c
@@ -5,14 +5,14 @@
** Made by Bruno JOFRET <bruno.jofret@inria.fr>
**
** Started on Wed Apr 25 11:17:25 2007 jofret
-** Last update Wed Apr 25 11:26:54 2007 jofret
+** Last update Mon Oct 22 10:45:56 2007 bruno
**
** Copyright INRIA 2007
*/
#include "abs.h"
-void dabsa(double *in, double* out, int size){
+void dabsa(double *in, int size, double* out){
int i = 0;
for (i = 0; i < size; ++i) {
out[i] = dabss(in[i]);
diff --git a/src/auxiliaryFunctions/abs/sabsa.c b/src/auxiliaryFunctions/abs/sabsa.c
index e958ad13..df5af141 100644
--- a/src/auxiliaryFunctions/abs/sabsa.c
+++ b/src/auxiliaryFunctions/abs/sabsa.c
@@ -5,14 +5,14 @@
** Made by Bruno JOFRET <bruno.jofret@inria.fr>
**
** Started on Wed Apr 25 10:53:09 2007 jofret
-** Last update Wed Apr 25 11:26:19 2007 jofret
+** Last update Mon Oct 22 10:45:22 2007 bruno
**
** Copyright INRIA 2007
*/
#include "abs.h"
-void sabsa(float *in, float* out, int size) {
+void sabsa(float *in, int size, float* out) {
int i = 0;
for (i = 0; i < size; ++i) {
out[i] = sabss(in[i]);
diff --git a/src/auxiliaryFunctions/abs/testAbs.c b/src/auxiliaryFunctions/abs/testAbs.c
index cba881b4..c7c27faa 100644
--- a/src/auxiliaryFunctions/abs/testAbs.c
+++ b/src/auxiliaryFunctions/abs/testAbs.c
@@ -5,7 +5,7 @@
** Made by Bruno JOFRET <bruno.jofret@inria.fr>
**
** Started on Wed Feb 14 15:50:15 2007 jofret
-** Last update Wed Apr 25 13:37:54 2007 jofret
+** Last update Mon Oct 22 15:27:49 2007 bruno
**
** Copyright INRIA 2007
*/
@@ -13,9 +13,9 @@
#include "testAbs.h"
int sabssTest() {
- printf(">> Floats \n");
float value1 = -123456.789;
float value2 = 987654.321;
+ printf(">> Floats \n");
assert(sabss(value1) == -value1);
assert(sabss(value2) == value2);
assert(sabss(0) == 0);
@@ -25,9 +25,9 @@ int sabssTest() {
}
int dabssTest() {
- printf(">> Doubles \n");
double value1 = -123456.789;
double value2 = 987654.321;
+ printf(">> Doubles \n");
assert(dabss(value1) == -value1);
assert(dabss(value2) == value2);
assert(dabss(0) == 0);
@@ -37,27 +37,32 @@ int dabssTest() {
}
int cabssTest() {
- printf(">> Float Complex \n");
floatComplex value1 = FloatComplex(4,3);
+ printf(">> Float Complex \n");
assert(cabss(value1) == 5);
return 0;
}
int zabssTest() {
+ doubleComplex value1 = DoubleComplex(4,3);
printf(">> Double Complex \n");
- doubleComplex value1 = DoubleComplex(4,3);
- assert(zabss(value1) == 5);
+ assert(zabss(value1) == 5);
return 0;
}
int sabsaTest() {
- printf(">> Floats Array\n");
float value1 = -123456.789;
float value2 = 987654.321;
float value3 = 0;
- float in[3] = {value1, value2, value3};
+ float in[3];
float out[3];
- sabsa(in, out, 3);
+
+ in[0] = value1;
+ in[1] = value2;
+ in[2] = value3;
+
+ printf(">> Floats Array\n");
+ sabsa(in, 3, out);
assert(out[0] == -value1);
assert(out[1] == value2);
assert(out[2] == value3);
@@ -66,13 +71,18 @@ int sabsaTest() {
}
int dabsaTest() {
- printf(">> Doubles Array\n");
double value1 = -123456.789;
double value2 = 987654.321;
double value3 = 0;
- double in[3] = {value1, value2, value3};
+ double in[3];
double out[3];
- dabsa(in, out, 3);
+
+ in[0] = value1;
+ in[1] = value2;
+ in[2] = value3;
+
+ printf(">> Doubles Array\n");
+ dabsa(in, 3, out);
assert(out[0] == -value1);
assert(out[1] == value2);
assert(out[2] == value3);
@@ -81,14 +91,16 @@ int dabsaTest() {
}
int cabsaTest() {
- printf(">> Float Complex Array\n");
- floatComplex value1 = FloatComplex(4,3);
- floatComplex value2 = FloatComplex(-4,3);
- floatComplex value3 = FloatComplex(4,-3);
- floatComplex value4 = FloatComplex(-4,-3);
- floatComplex in[4] = {value1, value2, value3, value4};
+ floatComplex in[4];
float out[4];
- cabsa(in, out, 4);
+
+ in[0] = FloatComplex(4,3);
+ in[1] = FloatComplex(-4,3);
+ in[2] = FloatComplex(4,-3);
+ in[3] = FloatComplex(-4,-3);
+
+ printf(">> Float Complex Array\n");
+ cabsa(in, 4, out);
assert(out[0] == 5);
assert(out[1] == 5);
assert(out[2] == 5);
@@ -97,14 +109,16 @@ int cabsaTest() {
}
int zabsaTest() {
- printf(">> Double Complex Array\n");
- doubleComplex value1 = DoubleComplex(4,3);
- doubleComplex value2 = DoubleComplex(-4,3);
- doubleComplex value3 = DoubleComplex(4,-3);
- doubleComplex value4 = DoubleComplex(-4,-3);
- doubleComplex in[4] = {value1, value2, value3, value4};
+ doubleComplex in[4];
double out[4];
- zabsa(in, out, 4);
+
+ in[0] = DoubleComplex(4,3);
+ in[1] = DoubleComplex(-4,3);
+ in[2] = DoubleComplex(4,-3);
+ in[3] = DoubleComplex(-4,-3);
+
+ printf(">> Double Complex Array\n");
+ zabsa(in, 4, out);
assert(out[0] == 5);
assert(out[1] == 5);
assert(out[2] == 5);
diff --git a/src/auxiliaryFunctions/abs/zabsa.c b/src/auxiliaryFunctions/abs/zabsa.c
index 0867a754..56b24ce9 100644
--- a/src/auxiliaryFunctions/abs/zabsa.c
+++ b/src/auxiliaryFunctions/abs/zabsa.c
@@ -5,14 +5,14 @@
** Made by Bruno JOFRET <bruno.jofret@inria.fr>
**
** Started on Wed Apr 25 13:24:43 2007 jofret
-** Last update Wed Apr 25 13:25:04 2007 jofret
+** Last update Mon Oct 22 10:47:00 2007 bruno
**
** Copyright INRIA 2007
*/
#include "abs.h"
-void zabsa(doubleComplex *in, double* out, int size) {
+void zabsa(doubleComplex *in, int size, double* out) {
int i = 0;
for (i = 0; i < size; ++i) {
out[i] = zabss(in[i]);