Markus Mottl avatar Markus Mottl committed 411777e

Added trsv

Comments (0)

Files changed (7)

+2008-10-30:  Added new matrix-vector function:
+
+               * trsv
+
 2008-10-26:  Added two new matrix functions:
 
                * packed
-release-4-6-2
+release-4-6-3
 name="lacaml"
-version="4.6.2"
+version="4.6.3"
 description="LACAML - BLAS/LAPACK-interface for OCaml"
 
 requires="lacaml.core"
       ?(ar = 1) ?(ac = 1) a ?ofsx ?incx x =
   let loc = "Lacaml.Impl.NPREC.trmv" in
   let n, ofsx, incx, uplo_char, trans_char, diag_char =
-    trmv_get_params loc ar ac a n ofsx incx x up trans diag
+    trXv_get_params loc ar ac a n ofsx incx x up trans diag
   in
   direct_trmv ar ac a n uplo_char trans_char diag_char ofsx incx x
 
 
+(* TRSV *)
+
+external direct_trsv :
+  int -> (* AR *)
+  int -> (* AC *)
+  mat -> (* A *)
+  int -> (* N *)
+  char -> (* UPLO *)
+  char -> (* TRANS *)
+  char -> (* DIAG *)
+  int -> (* OFSX *)
+  int -> (* INCX *)
+  vec (* X *)
+  -> unit = "lacaml_NPRECtrsv_stub_bc" "lacaml_NPRECtrsv_stub"
+
+let trsv
+      ?n ?(trans = `N) ?(diag = `N) ?(up = true)
+      ?(ar = 1) ?(ac = 1) a ?ofsx ?incx x =
+  let loc = "Lacaml.Impl.NPREC.trsv" in
+  let n, ofsx, incx, uplo_char, trans_char, diag_char =
+    trXv_get_params loc ar ac a n ofsx incx x up trans diag
+  in
+  direct_trsv ar ac a n uplo_char trans_char diag_char ofsx incx x
+
+
 (* BLAS-3 *)
 
 (* GEMM *)

lib/impl_SDCZ.mli

     @param ofsx default = 1
     @param incx default = 1 *)
 
+val trsv :
+  ?n : int ->
+  ?trans : trans3 ->
+  ?diag : diag ->
+  ?up : bool ->
+  ?ar : int ->
+  ?ac : int ->
+  mat ->
+  ?ofsx : int ->
+  ?incx : int ->
+  vec
+  -> unit
+(** [trsv ?n ?trans ?diag ?up ?ar ?ac a ?ofsx ?incx x]
+    see BLAS documentation!
+    @param n default = dimension of triangular matrix [a]
+    @param trans default = `N
+    @param diag default = false (not a unit triangular matrix)
+    @param up default = true (upper triangular portion of [a] is accessed)
+    @param ar default = 1
+    @param ac default = 1
+    @param ofsx default = 1
+    @param incx default = 1 *)
+
 
 (** {6 BLAS-3 interface} *)
 

lib/impl_SDCZ_c.c

 }
 
 
+/** TRSV */
+
+extern void FUN(trsv)(
+  char *UPLO,
+  char *TRANS,
+  char *DIAG,
+  integer *N,
+  NUMBER *A, integer *LDA,
+  NUMBER *X, integer *INCX);
+
+CAMLprim value LFUN(trsv_stub)(
+  value vAR,
+  value vAC,
+  value vA,
+  value vN,
+  value vUPLO,
+  value vTRANS,
+  value vDIAG,
+  value vOFSX, value vINCX, value vX)
+{
+  CAMLparam2(vA, vX);
+
+  char GET_INT(UPLO),
+       GET_INT(TRANS),
+       GET_INT(DIAG);
+
+  integer GET_INT(N),
+          GET_INT(INCX);
+
+  MAT_PARAMS(A);
+  VEC_PARAMS(X);
+
+  caml_enter_blocking_section();  /* Allow other threads */
+  FUN(trsv)(
+    &UPLO,
+    &TRANS,
+    &DIAG,
+    &N,
+    A_data, &rows_A,
+    X_data, &INCX);
+  caml_leave_blocking_section();  /* Disallow other threads */
+
+  CAMLreturn(Val_unit);
+}
+
+CAMLprim value LFUN(trsv_stub_bc)(value *argv, int argn)
+{
+  return
+    LFUN(trsv_stub)(
+      argv[0], argv[1], argv[2], argv[3], argv[4], argv[5], argv[6],
+      argv[7], argv[8], argv[9]);
+}
+
+
 /** TODO: SPMV */
 
 /** TODO: TBMV */
 
 /** TODO: TPMV */
 
-/** TODO: TRSV */
-
 /** TODO: TBSV */
 
 /** TODO: TPSV */
   check_vec loc y_str y (ofsy + (n - 1) * abs incy);
   n, ofsx, incx, ofsy, incy, y, get_uplo_char up
 
-(* trmv -- auxiliary functions *)
-let trmv_get_params loc ar ac a n ofsx incx x up trans unit_triangular =
+(* tr?v -- auxiliary functions *)
+let trXv_get_params loc ar ac a n ofsx incx x up trans unit_triangular =
   let n = get_dim1_mat loc a_str a ar n_str n in
   check_dim2_mat loc a_str a ac n_str n;
   let trans_char = get_trans_char trans in
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.