summaryrefslogtreecommitdiff
path: root/src/matrixOperations/jmat/sjmata.c
diff options
context:
space:
mode:
authortorset2008-11-24 15:12:34 +0000
committertorset2008-11-24 15:12:34 +0000
commitce9bcf768006687a3a491174b687b8de785b90f7 (patch)
tree851093190b51024e8d4ca03f6a2a0efe91484969 /src/matrixOperations/jmat/sjmata.c
parentb35e4a7df2360d7a2d27ae78217230a5d257f60a (diff)
downloadscilab2c-ce9bcf768006687a3a491174b687b8de785b90f7.tar.gz
scilab2c-ce9bcf768006687a3a491174b687b8de785b90f7.tar.bz2
scilab2c-ce9bcf768006687a3a491174b687b8de785b90f7.zip
Update files
Diffstat (limited to 'src/matrixOperations/jmat/sjmata.c')
-rw-r--r--src/matrixOperations/jmat/sjmata.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/matrixOperations/jmat/sjmata.c b/src/matrixOperations/jmat/sjmata.c
new file mode 100644
index 00000000..b969fd7a
--- /dev/null
+++ b/src/matrixOperations/jmat/sjmata.c
@@ -0,0 +1,22 @@
+#include <jmat.h>
+
+void sjmata(float n, float m, float *out){
+ int i,nn,mm,j;
+ mm=(int) m;
+ nn=(int) n;
+
+
+ for (i=0;i<n;i++){/*We work by blocs*/
+ for(j=0;j<m;j++){/*then by column*/
+ /*
+ * i*mm*nn : advance to the good column
+ * mm*(nn-(i+1)) : take the first element of the column to be 1, when j=0
+ * j*(mm*nn+1) : advance to the next to be 1
+ * */
+ out[i*mm*mm*nn+(mm*(nn-(i+1))+j*(mm*nn+1))]=1;
+ }
+ }
+
+}
+
+