aboutsummaryrefslogtreecommitdiff
path: root/sys/mwcs/gen/mwvmulr.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/mwcs/gen/mwvmulr.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/mwcs/gen/mwvmulr.x')
-rw-r--r--sys/mwcs/gen/mwvmulr.x20
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/mwcs/gen/mwvmulr.x b/sys/mwcs/gen/mwvmulr.x
new file mode 100644
index 00000000..54a0776e
--- /dev/null
+++ b/sys/mwcs/gen/mwvmulr.x
@@ -0,0 +1,20 @@
+# MW_VMUL -- Vector multiply.
+
+procedure mw_vmulr (a, b, c, ndim)
+
+real a[ndim,ndim] #I input matrix
+real b[ndim] #I input vector
+real c[ndim] #O output vector
+int ndim #I system dimension
+
+int i, j
+real v
+
+begin
+ do j = 1, ndim {
+ v = 0
+ do i = 1, ndim
+ v = v + a[i,j] * b[i]
+ c[j] = v
+ }
+end