File: matrixops.dats

package info (click to toggle)
ats2-lang 0.4.2-3
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 40,500 kB
  • sloc: ansic: 389,898; makefile: 7,136; javascript: 1,852; lisp: 811; sh: 657; php: 573; python: 387; perl: 365
file content (40 lines) | stat: -rw-r--r-- 565 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
(* ****** ****** *)
(*
//
// Some matrix ops
//
*)
(* ****** ****** *)

implement
main((*void*)) = 0

(* ****** ****** *)

extern
fun{a:t0p}
mul_scalar_matrix
  {m,n:int}
(
  c: a
, A: &matrix (INV(a), m, n) >> _
, m: size_t m, n: size_t n
) : void // end of [mul_scalar_matrix]

(* ****** ****** *)

implement{a}
mul_scalar_matrix
  (c, A, m, n) = let
//
implement(env)
matrix_foreach$fwork<a><env>
  (x, env) = (x := gmul_val_val<a> (c, x))
//
in
  matrix_foreach<a> (A, m, n)
end // end of [mul_scalar_matrix]

(* ****** ****** *)

(* end of [matrixops.dats] *)