Markus Mottl avatar Markus Mottl committed 9c9d842

Bug fixes for last feature

Comments (0)

Files changed (4)

-release-4-6-1
+release-4-6-2
 name="lacaml"
-version="4.6.1"
+version="4.6.2"
 description="LACAML - BLAS/LAPACK-interface for OCaml"
 
 requires="lacaml.core"
 let packed ?(up = true) ?n ?(ar = 1) ?(ac = 1) a =
   let loc = "Lacaml.Impl.NPREC.Mat.packed" in
   let n = get_n_of_square "a" loc ar ac a n in
-  let dst = Array1.create prec fortran_layout n in
+  let dst = Array1.create prec fortran_layout ((n * n + n) / 2) in
   let pos_ref = ref 1 in
   if up then
     for c = 1 to n do
 let unpacked ?(up = true) src =
   let n_vec = Array1.dim src in
   let n = truncate (sqrt (float (8 * n_vec + 1)) /. 2.) in
-  if n * n + n <> n_vec then
+  if (n * n + n) / 2 <> n_vec then
     let loc = "Lacaml.Impl.NPREC.Mat.unpacked" in
     failwith (sprintf "%s: illegal vector length: %d" loc n_vec)
   else
 *)
 
 val unpacked : ?up : bool -> vec -> mat
-(** [packed ?up x] @return an upper or lower (depending on [up])
+(** [unpacked ?up x] @return an upper or lower (depending on [up])
     triangular matrix from packed representation [vec].  The other
     triangle of the matrix will be filled with zeros.
 
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.