summaryrefslogtreecommitdiff
path: root/2.3-1/src/c/linearAlgebra/proj/dproja.c
diff options
context:
space:
mode:
authorBrijeshcr2017-07-06 15:24:41 +0530
committerGitHub2017-07-06 15:24:41 +0530
commita7eeecce4c7c39ea52a2d434815c574a2c42730d (patch)
tree9968264546fd54f9eaa6ad80ee7db47e366f8601 /2.3-1/src/c/linearAlgebra/proj/dproja.c
parent3308ea7a973e2c1e1c8bea99ac7cc783ce8e8b06 (diff)
parent115efeb443a7e6da44f628537811b69a01553ab2 (diff)
downloadScilab2C-a7eeecce4c7c39ea52a2d434815c574a2c42730d.tar.gz
Scilab2C-a7eeecce4c7c39ea52a2d434815c574a2c42730d.tar.bz2
Scilab2C-a7eeecce4c7c39ea52a2d434815c574a2c42730d.zip
Merge pull request #3 from sandeepgupta007/master
LinearAlgebra Function Added
Diffstat (limited to '2.3-1/src/c/linearAlgebra/proj/dproja.c')
-rw-r--r--2.3-1/src/c/linearAlgebra/proj/dproja.c73
1 files changed, 73 insertions, 0 deletions
diff --git a/2.3-1/src/c/linearAlgebra/proj/dproja.c b/2.3-1/src/c/linearAlgebra/proj/dproja.c
new file mode 100644
index 00000000..e27cd6f2
--- /dev/null
+++ b/2.3-1/src/c/linearAlgebra/proj/dproja.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 2017 - 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: Sandeep Gupta
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+/* Scilab function proj code in C */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "proj.h"
+#include "eye.h"
+#include "matrixTranspose.h"
+#include "matrixMultiplication.h"
+#include <math.h>
+#include "norm.h"
+
+
+double dproja(double *x1,int l,int k,double *x2,int m2,int n2,double *y){
+ int i,j;
+ double *w;
+ w = (double *)malloc(l*l*sizeof(double));
+ double rk;
+ rk = drowcompa(1,x1,l,k,NULL,0,w);
+
+ double *w1;
+ w1 = (double *)malloc(rk*l*sizeof(double));
+
+ for(i=0;i<l*rk;i++){
+ w1[i]=w[i];
+ }
+
+ double *x1t;
+ x1t = (double *)malloc((l-n)*l*sizeof(double);
+
+ for(i=n;i<l;i++){
+ for(j=0;j<l;j++){
+ x1t[i-n+j*l] = w1[i+j*l];
+ }
+ }
+
+ double x1x2;
+ x1x2 = (double *)malloc((l-n+1)*n2*sizeof(double));
+ dmulma(x1t,l-n+1,l,x2,m2,n2,x1x2);
+
+ double *inx1x2;
+ inx1x2 = (double *)malloc();
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}