Markus Mottl avatar Markus Mottl committed bacd114

Optimized creation of fresh vectors and matrices

Comments (0)

Files changed (2)

   let k = get_k_mat_sb loc a_str a ar k_str k in
   let ofsx, incx = get_vec_geom loc x_str ofsx incx in
   let ofsy, incy = get_vec_geom loc y_str ofsy incy in
-  let y = get_vec loc y_str y ofsy incy n Vec.make0 in
+  let y = get_vec loc y_str y ofsy incy n Vec.create in
   check_vec loc x_str x (ofsx + (n - 1) * abs incx);
   direct_sbmv
     ~ofsy ~incy ~y ~ar ~ac ~a ~n ~k ~uplo:(get_uplo_char up)
       ?(ar = 1) ?(ac = 1) a ?ofsx ?incx x =
   let loc = "Lacaml.Impl.NPREC.gemv" in
   let m, n, ofsx, incx, ofsy, incy, y, trans =
-    gXmv_get_params loc Vec.make0 ar ac a m n ofsx incx x ofsy incy y trans
+    gXmv_get_params loc Vec.create ar ac a m n ofsx incx x ofsy incy y trans
   in
   direct_gemv
     ~ofsy ~incy ~y ~ar ~ac ~a ~m ~n ~trans ~alpha ~beta ~ofsx ~incx ~x;
   check_var_ltz loc kl_str kl;
   check_var_ltz loc ku_str ku;
   let m, n, ofsx, incx, ofsy, incy, y, trans =
-    gXmv_get_params loc Vec.make0 ar ac a m n ofsx incx x ofsy incy y trans in
+    gXmv_get_params loc Vec.create ar ac a m n ofsx incx x ofsy incy y trans in
   let min_dim1 = kl + ku + 1 in
   if min_dim1 > m then
     invalid_arg (sprintf "%s: m: valid=[%d..[ got=%d" loc min_dim1 m);
       ?(ar = 1) ?(ac = 1) a ?ofsx ?incx x =
   let loc = "Lacaml.Impl.NPREC.symv" in
   let n, ofsx, incx, ofsy, incy, y, uplo =
-    symv_get_params loc Vec.make0 ar ac a n ofsx incx x ofsy incy y up in
+    symv_get_params loc Vec.create ar ac a n ofsx incx x ofsy incy y up in
   direct_symv ~ofsy ~incy ~y ~ar ~ac ~a ~n ~uplo ~alpha ~beta ~ofsx ~incx ~x;
   y
 
       ?(transb = `N) ?(br = 1) ?(bc = 1) b =
   let loc = "Lacaml.Impl.NPREC.gemm" in
   let m, n, k, transa, transb, c =
-    gemm_get_params loc Mat.make0 ar ac a transa br bc b cr transb cc c m n k in
+    gemm_get_params loc Mat.create ar ac a transa br bc b cr transb cc c m n k in
   direct_gemm
     ~transa ~transb ~m ~n ~k ~ar ~ac ~a ~br ~bc ~b ~cr ~cc ~c ~alpha ~beta;
   c
       ?(alpha = 1.0) ?(ar = 1) ?(ac = 1) a ?(br = 1) ?(bc = 1) b =
   let loc = "Lacaml.Impl.NPREC.symm" in
   let m, n, side, uplo, c =
-    symm_get_params loc Mat.make0 ar ac a br bc b cr cc c m n side up in
+    symm_get_params loc Mat.create ar ac a br bc b cr cc c m n side up in
   direct_symm ~side ~uplo ~m ~n ~ar ~ac ~a ~br ~bc ~b ~cr ~cc ~c ~alpha ~beta;
   c
 
       ?(trans = `N) ?(alpha = 1.0) ?(ar = 1) ?(ac = 1) a =
   let loc = "Lacaml.Impl.NPREC.syrk" in
   let n, k, uplo, trans, c =
-    syrk_get_params loc Mat.make0 ar ac a cr cc c n k up trans in
+    syrk_get_params loc Mat.create ar ac a cr cc c n k up trans in
   direct_syrk ~uplo ~trans ~n ~k ~ar ~ac ~a ~cr ~cc ~c ~alpha ~beta;
   c
 
       ?(trans = `N) ?(alpha = 1.0) ?(ar = 1) ?(ac = 1) a ?(br = 1) ?(bc = 1) b =
   let loc = "Lacaml.Impl.NPREC.syr2k" in
   let n, k, uplo, trans, c =
-    syr2k_get_params loc Mat.make0 ar ac a br bc b cr cc c n k up trans
+    syr2k_get_params loc Mat.create ar ac a br bc b cr cc c n k up trans
   in
   direct_syr2k ~uplo ~trans ~n ~k ~ar ~ac ~a ~br ~bc ~b ~cr ~cc ~c ~alpha ~beta;
   c
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.