Markus Mottl avatar Markus Mottl committed 2492754

Fixed installation. Added Mat.detri

Comments (0)

Files changed (5)

-2007-01-02:  New major release due to restructuring.  The library is now
+2008-01-11:  Fixed installation of new release.  Added new function:
+
+               * Mat.detri
+
+2008-01-02:  New major release due to restructuring.  The library is now
              packed into a separate namespace (Lacaml), and the previously
              visible Lacaml-module is now called "Impl".
 
-release-4-0-0
+release-4-1-0
   mat_SDCZ.mli mat_SD.mli mat_CZ.mli \
   float32.ml float64.ml \
   complex32.ml complex64.ml \
+  io.cmi utils.cmi common.cmi \
   lacaml.cmi lacaml.cma lacaml_top.cma lacaml.cmxa lacaml.a \
   liblacaml_stubs.a $(INSTALL_DLL)
 
   done;
   res
 
+let detri ?(up = true) ?(ar = 1) ?(ac = 1) ?n a =
+  let loc = "Lacaml.Impl.NPREC.Mat.detri" in
+  let n = get_n_of_square "a" loc ar ac a n in
+  if up then
+    for c = 1 to n - 1 do
+      let ar_c = ar + c in
+      let ac_c = ac + c in
+      for r = 0 to c - 1 do
+        a.{ar_c, ac + r} <- a.{ar + r, ac_c}
+      done
+    done
+  else
+    for c = 1 to n - 1 do
+      let ar_c = ar + c in
+      let ac_c = ac + c in
+      for r = 0 to c - 1 do
+        a.{ar + r, ac_c} <- a.{ar_c, ac + r}
+      done
+    done
+
 external direct_scal_mat :
   int -> (* M *)
   int -> (* N *)
 val transpose : mat -> mat
 (** [transpose m] @return the transpose of matrix [m]. *)
 
+val detri : ?up : bool -> ?ar : int -> ?ac : int -> ?n : int -> mat -> unit
+(** [detri ?up ?ar ?ac ?n a] takes a triangular (sub-)matrix [a], i.e. one
+    where only the upper (iff [up] is true) or lower triangle is defined,
+    and makes it a symmetric matrix by mirroring the defined triangle
+    along the diagonal.
+
+    @param up default = [true]
+    @param ar default = [1]
+    @param ac default = [1]
+    @param n default = [Mat.dim1 a]
+*)
+
 
 (** {6 Arithmetic operations} *)
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.