summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog19
-rw-r--r--README55
-rw-r--r--src/test/testCos.c35
-rw-r--r--src/test/testSin.c34
4 files changed, 137 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index decfe8c2..3bfff36e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2006-12-11 Bruno JOFRET <bruno.jofret@inria.fr>
+
+ * src/test/testCos.c :
+ Add some cosine tests.
+ * src/test/tesSin.c :
+ Add some sine tests.
+ * README :
+ Add some standards and style definitions.
+
+2006-12-08 Bruno JOFRET <bruno.jofret@inria.fr>
+
+ * src/test :
+ Test files for libraries.
+ * src/elementaryFunctions/cos :
+ Cosine functions
+ * src/elementaryFunctions/sin :
+ Sine functions
+
+
2006-12-04 Bruno JOFRET <bruno.jofret@inria.fr>
* Group functions:
diff --git a/README b/README
index 7b1345c7..f9736037 100644
--- a/README
+++ b/README
@@ -5,9 +5,60 @@
## Made by Bruno JOFRET <bruno.jofret@inria.fr>
##
## Started on Tue Nov 21 15:21:25 2006 jofret
-## Last update Tue Nov 21 15:22:43 2006 jofret
+## Last update Mon Dec 11 11:25:58 2006 jofret
##
## Copyright INRIA 2006
##
-Feel free to add everything you find useful for hArtes and the scilab2c tool. \ No newline at end of file
+Feel free to add everything you find useful for hArtes and the scilab2c tool.
+
+/*
+** Type definition
+*/
+We define types that way (but it can evolve in the future) :
+I - Scalar
+-----------
+
+ I.1 - Real
+ I.1.1 - Simple precision (float)
+ I.1.2 - Double precision (double)
+
+ I.2 - Complex
+ I.2.1 - Simple precision (float)
+ I.2.2 - Double precision (double)
+
+ I.3 - Integer (NOT IMPLEMENTED YET)
+
+ I.4 - Boolean (NOT IMPLEMENTED YET)
+
+II - Matrix
+------------
+
+ I.1 - Real
+ I.1.1 - Simple precision (float)
+ I.1.2 - Double precision (double)
+
+ I.2 - Complex
+ I.2.1 - Simple precision (float)
+ I.2.2 - Double precision (double)
+
+ I.3 - Integer (NOT IMPLEMENTED YET)
+
+ I.4 - Boolean (NOT IMPLEMENTED YET)
+
+
+/*
+** Functions Naming style
+*/
+We define this coding style for functions names :
+<precision><function_name><variable_type>.
+
+variable_type :
+- 's' : Scalar
+- 'a' : Matrix
+
+precision :
+- 's' : Real simple precision (float)
+- 'd' : Real double precision (double)
+- 'c' : Complex simple precision (float)
+- 'z' : Complex double precision (double)
diff --git a/src/test/testCos.c b/src/test/testCos.c
index 31ed49ee..f4c024bd 100644
--- a/src/test/testCos.c
+++ b/src/test/testCos.c
@@ -5,21 +5,52 @@
** Made by Bruno JOFRET <bruno.jofret@inria.fr>
**
** Started on Fri Dec 8 15:05:44 2006 jofret
-** Last update Fri Dec 8 16:58:25 2006 jofret
+** Last update Mon Dec 11 10:58:24 2006 jofret
**
** Copyright INRIA 2006
*/
#include <stdio.h>
+#define PI 3.1415826535
+
float scoss(float);
+double dcoss(double);
+
void scossTest() {
+ printf(">> Float scalar\n");
printf("scoss(0) = %f\n", scoss((float) 0));
+ printf("scoss(PI) = %f\n", scoss(PI));
+ printf("scoss(PI/2) = %f\n", scoss(PI/2));
+ printf("scoss(PI/3) = %f\n", scoss(PI/3));
+ printf("scoss(PI/4) = %f\n", scoss(PI/4));
+ printf("scoss(PI/6) = %f\n", scoss(PI/6));
+ printf("scoss(-PI) = %f\n", scoss(-PI));
+ printf("scoss(-PI/2) = %f\n", scoss(-PI/2));
+ printf("scoss(-PI/3) = %f\n", scoss(-PI/3));
+ printf("scoss(-PI/4) = %f\n", scoss(-PI/4));
+ printf("scoss(-PI/6) = %f\n", scoss(-PI/6));
+}
+
+void dcossTest() {
+ printf(">> Double scalar\n");
+ printf("dcoss(0) = %e\n", dcoss((double) 0));
+ printf("dcoss(PI) = %e\n", dcoss(PI));
+ printf("dcoss(PI/2) = %e\n", dcoss(PI/2));
+ printf("dcoss(PI/3) = %e\n", dcoss(PI/3));
+ printf("dcoss(PI/4) = %e\n", dcoss(PI/4));
+ printf("dcoss(PI/6) = %e\n", dcoss(PI/6));
+ printf("dcoss(-PI) = %e\n", dcoss(-PI));
+ printf("dcoss(-PI/2) = %e\n", dcoss(-PI/2));
+ printf("dcoss(-PI/3) = %e\n", dcoss(-PI/3));
+ printf("dcoss(-PI/4) = %e\n", dcoss(-PI/4));
+ printf("dcoss(-PI/6) = %e\n", dcoss(-PI/6));
}
int testCos() {
- printf(">> Cosine Tests\n");
+ printf(">>>> Cosine Tests\n");
scossTest();
+ dcossTest();
return 0;
}
diff --git a/src/test/testSin.c b/src/test/testSin.c
index 0e74250c..30a24501 100644
--- a/src/test/testSin.c
+++ b/src/test/testSin.c
@@ -5,21 +5,51 @@
** Made by Bruno JOFRET <bruno.jofret@inria.fr>
**
** Started on Fri Dec 8 15:06:16 2006 jofret
-** Last update Fri Dec 8 16:56:19 2006 jofret
+** Last update Mon Dec 11 10:59:39 2006 jofret
**
** Copyright INRIA 2006
*/
#include <stdio.h>
+#define PI 3.1415826535
+
float ssins(float);
+double dsins(double);
void ssinsTest() {
+ printf(">> Float scalar\n");
printf("ssins(0) = %f\n", ssins((float) 0));
+ printf("ssins(PI) = %f\n", ssins(PI));
+ printf("ssins(PI/2) = %f\n", ssins(PI/2));
+ printf("ssins(PI/3) = %f\n", ssins(PI/3));
+ printf("ssins(PI/4) = %f\n", ssins(PI/4));
+ printf("ssins(PI/6) = %f\n", ssins(PI/6));
+ printf("ssins(-PI) = %f\n", ssins(-PI));
+ printf("ssins(-PI/2) = %f\n", ssins(-PI/2));
+ printf("ssins(-PI/3) = %f\n", ssins(-PI/3));
+ printf("ssins(-PI/4) = %f\n", ssins(-PI/4));
+ printf("ssins(-PI/6) = %f\n", ssins(-PI/6));
+}
+
+void dsinsTest() {
+ printf(">> Double scalar\n");
+ printf("dsins(0) = %e\n", dsins((double) 0));
+ printf("dsins(PI) = %e\n", dsins(PI));
+ printf("dsins(PI/2) = %e\n", dsins(PI/2));
+ printf("dsins(PI/3) = %e\n", dsins(PI/3));
+ printf("dsins(PI/4) = %e\n", dsins(PI/4));
+ printf("dsins(PI/6) = %e\n", dsins(PI/6));
+ printf("dsins(-PI) = %e\n", dsins(-PI));
+ printf("dsins(-PI/2) = %e\n", dsins(-PI/2));
+ printf("dsins(-PI/3) = %e\n", dsins(-PI/3));
+ printf("dsins(-PI/4) = %e\n", dsins(-PI/4));
+ printf("dsins(-PI/6) = %e\n", dsins(-PI/6));
}
int testSin() {
- printf(">> Sine Tests\n");
+ printf(">>>> Sine Tests\n");
ssinsTest();
+ dsinsTest();
return 0;
}