summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortorset2009-02-04 14:11:20 +0000
committertorset2009-02-04 14:11:20 +0000
commit5b4467938b925e178d503ee56a6ad8e9174ea6c2 (patch)
tree1b5f609e5ca4894299794ef9cec17a8e0e68de9b /src
parentcb2404246c35eff9b1a976bac98ba9532d82a6af (diff)
downloadscilab2c-5b4467938b925e178d503ee56a6ad8e9174ea6c2.tar.gz
scilab2c-5b4467938b925e178d503ee56a6ad8e9174ea6c2.tar.bz2
scilab2c-5b4467938b925e178d503ee56a6ad8e9174ea6c2.zip
Add Complex scalar tests and headers
Diffstat (limited to 'src')
-rw-r--r--src/matrixOperations/Makefile.am3
-rw-r--r--src/matrixOperations/Makefile.in3
-rw-r--r--src/matrixOperations/chol/testDoubleChol.c14
-rw-r--r--src/matrixOperations/chol/testFloatChol.c17
-rw-r--r--src/matrixOperations/includes/chol.h13
5 files changed, 43 insertions, 7 deletions
diff --git a/src/matrixOperations/Makefile.am b/src/matrixOperations/Makefile.am
index d9ac75bd..f5a04e88 100644
--- a/src/matrixOperations/Makefile.am
+++ b/src/matrixOperations/Makefile.am
@@ -28,7 +28,8 @@ SUBDIRS= cat \
fill \
magnitude \
squaredMagnitude\
- logm
+ logm \
+ powm
diff --git a/src/matrixOperations/Makefile.in b/src/matrixOperations/Makefile.in
index 8d62a4e1..4f474104 100644
--- a/src/matrixOperations/Makefile.in
+++ b/src/matrixOperations/Makefile.in
@@ -183,7 +183,8 @@ SUBDIRS = cat \
fill \
magnitude \
squaredMagnitude\
- logm
+ logm \
+ powm
all: all-recursive
diff --git a/src/matrixOperations/chol/testDoubleChol.c b/src/matrixOperations/chol/testDoubleChol.c
index 41138b1c..bf58480c 100644
--- a/src/matrixOperations/chol/testDoubleChol.c
+++ b/src/matrixOperations/chol/testDoubleChol.c
@@ -54,6 +54,19 @@ static void dcholaTest(void){
}
}
+
+static void zcholsTest(void){
+ doubleComplex in;
+ double out;
+ in=DoubleComplex(3,1);
+ printf("\n >>> ZCholS <<<\n");
+ out=zchols(in);
+ printf("result : %f\n",out);
+
+}
+
+
+
static void zcholaTest(void){
double inR[9]= {9,4,2,4,5,1,2,1,4};
double inI[9]= {1,-1,2,-1,-4,1,2,1,4};
@@ -85,6 +98,7 @@ static int cholTest(void){
printf("\n >>> Double Chol <<<\n");
dcholsTest();
dcholaTest();
+ zcholsTest();
zcholaTest();
return 0;
}
diff --git a/src/matrixOperations/chol/testFloatChol.c b/src/matrixOperations/chol/testFloatChol.c
index 84dc6d51..eea75ea4 100644
--- a/src/matrixOperations/chol/testFloatChol.c
+++ b/src/matrixOperations/chol/testFloatChol.c
@@ -42,6 +42,22 @@ static void scholaTest(void){
}
+static void ccholsTest(void){
+ floatComplex in;
+ float out;
+ in=FloatComplex(3,1);
+ printf("\n >>> ZCholS <<<\n");
+ out=cchols(in);
+ printf("result : %f\n",out);
+
+}
+
+
+
+
+
+
+
static void ccholaTest(void){
float inR[9]= {9.0f,4.0f,2.0f,4.0f,5.0f,1.0f,2.0f,1.0f,4.0f};
float inI[9]= {0.0f,-1.0f,2.0f,-1.0f,0.0f,1.0f,2.0f,1.0f,0.0f};
@@ -69,6 +85,7 @@ static int cholTest(void){
printf("\n >>> Float Chol <<<\n");
scholsTest();
scholaTest();
+ ccholsTest();
ccholaTest();
return 0;
}
diff --git a/src/matrixOperations/includes/chol.h b/src/matrixOperations/includes/chol.h
index 03a678d8..54daf305 100644
--- a/src/matrixOperations/includes/chol.h
+++ b/src/matrixOperations/includes/chol.h
@@ -19,15 +19,18 @@
-double dchols (double in);
-void dchola (double *in, int size, double *out);
+double dchols(double in);
+void dchola(double *in, int size, double *out);
-float schols (float in);
-void schola (float *in, int size, float *out);
+float schols(float in);
+void schola(float *in, int size, float *out);
+#define zchols(in) dchols(zreals(in))
+
void zchola (doubleComplex *in, int size, doubleComplex *out);
-void cchola (floatComplex *in, int size, floatComplex *out);
+#define cchols(in) schols(creals(in))
+void cchola(floatComplex *in, int size, floatComplex *out);
#endif /* __CHOL_H__ */