Docs GODI Archive
Projects Blog Link DB

Search GODI:


More options
File lib/ocaml/pkg-lib/lacaml/impl_SD.mli GODI Package godi-lacaml
Library lacaml
 
   impl_SD.mli    Sources  
(* File: impl_SD.mli

   Copyright (C) 2001-

     Markus Mottl
     email: markus.mottl@gmail.com
     WWW: http://www.ocaml.info

     Liam Stewart
     email: liam@cs.toronto.edu
     WWW: http://www.cs.toronto.edu/~liam

     Christophe Troestler
     email: Christophe.Troestler@umh.ac.be
     WWW: http://math.umh.ac.be/an/

     Oleg Trott
     email: ot14@columbia.edu
     WWW: http://www.columbia.edu/~ot14

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*)

open Bigarray
open Common
open Floatxx

(** {6 BLAS-1 interface} *)

val dot :
  ?n : int ->
  ?ofsx : int ->
  ?incx : int ->
  x : vec ->
  ?ofsy : int ->
  ?incy : int ->
  vec
  -> float
(** [dot ?n ?ofsy ?incy y ?ofsx ?incx x] see BLAS documentation!
    @param n default = greater n s.t. [ofsx+(n-1)(abs incx) <= dim x]
    @param ofsy default = 1
    @param incy default = 1
    @param ofsx default = 1
    @param incx default = 1 *)

val nrm2 : ?n : int -> ?ofsx : int -> ?incx : int -> vec -> float
(** [nrm2 ?n ?ofsx ?incx x] see BLAS documentation!
    @param n default = greater n s.t. [ofsx+(n-1)(abs incx) <= dim x]
    @param ofsx default = 1
    @param incx default = 1 *)

val asum : ?n : int -> ?ofsx : int -> ?incx : int -> vec -> float
(** [asum ?n ?ofsx ?incx x] see BLAS documentation!
    @param n default = greater n s.t. [ofsx+(n-1)(abs incx) <= dim x]
    @param ofsx default = 1
    @param incx default = 1 *)


(** {6 BLAS-2 interface} *)

val sbmv :
  ?ofsy : int ->
  ?incy : int ->
  ?y : vec ->
  ?ar : int ->
  ?ac : int ->
  mat ->
  ?n : int ->
  ?k : int ->
  ?up : bool ->
  ?alpha : float ->
  ?beta : float ->
  ?ofsx : int ->
  ?incx : int ->
  vec
  -> vec
(** [sbmv ?ofsy ?incy ?y ?ar ?ac a ?n ?k ?up ?alpha ?beta ?ofsx ?incx x] see
    BLAS documentation!
    @return vector [y], which is overwritten.
    @param ofsy default = 1
    @param incy default = 1
    @param ar default = 1
    @param ac default = 1
    @param y default = uninitialized vector of minimal length (see BLAS)
    @param n default = number of available columns to the right of [ac].
    @param k default = number of available rows in matrix [a] - 1
    @param up default = true i.e., upper band of [a] is supplied
    @param alpha default = 1.0
    @param beta default = 0.0
    @param ofsx default = 1
    @param incx default = 1 *)

val syr :
  ?alpha : float ->
  ?up : bool ->
  ?ofsx : int ->
  ?incx : int ->
  vec ->
  ?n : int ->
  ?ar : int ->
  ?ac : int ->
  mat
  -> mat
(** [syr ?alpha ?up ?ofsx ?incx x ?n ?ar ?ac a] see BLAS documentation!
    @return vector [a], which is overwritten
    @param alpha default = 1.0
    @param up default = true i.e., upper triangle of [a] is supplied
    @param ofsx default = 1
    @param incx default = 1
    @param ar default = 1
    @param ac default = 1
    @param n default = number of rows of [a] *)

(** {6 LAPACK interface} *)

(** Auxiliary routines *)

val lansy_min_lwork : int -> norm4 -> int
(** [lansy_min_lwork m norm]
    @return the minimum length of the work array used by the [lansy]-function.
    @param norm type of norm that will be computed by [lansy]
    @param n the number of columns (and rows) in the matrix *)

val lansy :
  ?n : int ->
  ?up : bool ->
  ?norm : norm4 ->
  ?work : vec ->
  ?ar : int ->
  ?ac : int ->
  mat
  -> float
(** [lansy ?norm ?up ?n ?ar ?ac ?work a] see LAPACK documentation!
    @param norm default = `O
    @param up default = true (reference upper triangular part of [a])
    @param n default = number of columns of matrix [a]
    @param work default = allocated work space for norm `I *)

val lamch :  [ `E | `S | `B | `P | `N | `R | `M | `U | `L | `O ] -> float
(** [lamch cmach] see LAPACK documentation! *)


(** Linear equations (computational routines) *)

(* GECON *)

val gecon_min_lwork : int -> int
(** [gecon_min_lwork n] @return the minimum length of the work array
    used by the [gecon]-function.
    @param n the logical dimensions of the matrix given to
             the [gecon]-function *)

val gecon_min_liwork : int -> int
(** [gecon_min_liwork n] @return the minimum length of the iwork array
    used by the [gecon]-function.
    @param n the logical dimensions of the matrix given to [gecon]-function *)

val gecon :
  ?n : int ->
  ?norm : norm2 ->
  ?anorm : float ->
  ?work : vec ->
  ?iwork : int_vec ->
  ?ar : int ->
  ?ac : int ->
  mat
  -> float
(** [gecon ?n ?norm ?anorm ?work ?rwork ?ar ?ac a]
    @return estimate of the reciprocal of the condition number of matrix [a]
    @param n default = available number of columns of matrix [a]
    @param norm default = 1-norm
    @param anorm default = norm of the matrix [a] as returned by [lange]
    @param work default = automatically allocated workspace
    @param iwork default = automatically allocated workspace
    @param ar default = 1
    @param ac default = 1 *)

(* SYCON *)

val sycon_min_lwork : int -> int
(** [sycon_min_lwork n] @return the minimum length of the work array
    used by the [sycon]-function.
    @param n the logical dimensions of the matrix given to
             the [sycon]-function *)

val sycon_min_liwork : int -> int
(** [sycon_min_liwork n] @return the minimum length of the iwork array
    used by the [sycon]-function.
    @param n the logical dimensions of the matrix given to [sycon]-function *)

val sycon :
    ?n : int ->
    ?up : bool ->
    ?ipiv : int_vec ->
    ?anorm : float ->
    ?work : vec ->
    ?iwork : int_vec ->
    ?ar : int ->
    ?ac : int ->
    mat
    -> float
(** [sycon ?n ?up ?ipiv ?anorm ?work ?iwork ?ar ?ac a]
    @return estimate of the reciprocal of the condition number
            of symmetric matrix [a]
    @param n default = available number of columns of matrix [a]
    @param up default = upper triangle of the factorization of [a] is stored
    @param ipiv default = vec of length [n]
    @param anorm default = 1-norm of the matrix [a] as returned by [lange]
    @param work default = automatically allocated workspace
    @param iwork default = automatically allocated workspace *)

(* POCON *)

val pocon_min_lwork : int -> int
(** [pocon_min_lwork n] @return the minimum length of the work array
    used by the [pocon]-function.
    @param n the logical dimensions of the matrix given to
             the [pocon]-function *)

val pocon_min_liwork : int -> int
(** [pocon_min_liwork n] @return the minimum length of the iwork array
    used by the [pocon]-function.
    @param n the logical dimensions of the matrix given to [pocon]-function *)

val pocon :
    ?n : int ->
    ?up : bool ->
    ?anorm : float ->
    ?work : vec ->
    ?iwork : int_vec ->
    ?ar : int ->
    ?ac : int ->
    mat
    -> float
(** [pocon ?n ?up ?anorm ?work ?iwork ?ar ?ac a]
    @return estimate of the reciprocal of the condition number of
            symmetric positive definite matrix [a]
    @param n default = available number of columns of matrix [a]
    @param up default = upper triangle of Cholesky factorization
                        of [a] is stored
    @param work default = automatically allocated workspace
    @param iwork default = automatically allocated workspace
    @param anorm default = 1-norm of the matrix [a] as returned by [lange] *)

(** Least squares (expert drivers) *)

val gelsy_min_lwork : m : int -> n : int -> nrhs : int -> int
(** [gelsy_min_lwork ~m ~n ~nrhs] @return the minimum length of the
    work-array used by the [gelsy]-function if the logical dimensions
    of the matrix are [m] rows and [n] columns and if there are [nrhs]
    right hand side vectors. *)

val gelsy_opt_lwork :
  ?m : int ->
  ?n : int ->
  ?ar : int ->
  ?ac : int ->
  mat ->
  ?nrhs : int ->
  ?br : int ->
  ?bc : int ->
  mat
  -> int
(** [gelsy_opt_lwork ?m ?n ?ar ?ac a ?nrhs ?br ?bc b] @return the optimum
    length of the work-array used by the [gelsy]-function given matrix
    [a], optionally its logical dimensions [m] and [n] and given right
    hand side matrix [b] with an optional number [nrhs] of <