package scipy

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
val get_py : string -> Py.Object.t

Get an attribute of this module as a Py.Object.t. This is useful to pass a Python function to another function.

val cgegv : ?kwds:(string * Py.Object.t) list -> Py.Object.t list -> Py.Object.t

`cgegv` is deprecated! The `*gegv` family of routines has been deprecated in LAPACK 3.6.0 in favor of the `*ggev` family of routines. The corresponding wrappers will be removed from SciPy in a future release.

alpha,beta,vl,vr,info = cgegv(a,b,compute_vl,compute_vr,lwork,overwrite_a,overwrite_b)

Wrapper for ``cgegv``.

Parameters ---------- a : input rank-2 array('F') with bounds (n,n) b : input rank-2 array('F') with bounds (n,n)

Other Parameters ---------------- compute_vl : input int, optional Default: 1 compute_vr : input int, optional Default: 1 overwrite_a : input int, optional Default: 0 overwrite_b : input int, optional Default: 0 lwork : input int, optional Default: max(2*n,1)

Returns ------- alpha : rank-1 array('F') with bounds (n) beta : rank-1 array('F') with bounds (n) vl : rank-2 array('F') with bounds (ldvl,n) vr : rank-2 array('F') with bounds (ldvr,n) info : int

val dgegv : ?kwds:(string * Py.Object.t) list -> Py.Object.t list -> Py.Object.t

`dgegv` is deprecated! The `*gegv` family of routines has been deprecated in LAPACK 3.6.0 in favor of the `*ggev` family of routines. The corresponding wrappers will be removed from SciPy in a future release.

alphar,alphai,beta,vl,vr,info = dgegv(a,b,compute_vl,compute_vr,lwork,overwrite_a,overwrite_b)

Wrapper for ``dgegv``.

Parameters ---------- a : input rank-2 array('d') with bounds (n,n) b : input rank-2 array('d') with bounds (n,n)

Other Parameters ---------------- compute_vl : input int, optional Default: 1 compute_vr : input int, optional Default: 1 overwrite_a : input int, optional Default: 0 overwrite_b : input int, optional Default: 0 lwork : input int, optional Default: max(8*n,1)

Returns ------- alphar : rank-1 array('d') with bounds (n) alphai : rank-1 array('d') with bounds (n) beta : rank-1 array('d') with bounds (n) vl : rank-2 array('d') with bounds (ldvl,n) vr : rank-2 array('d') with bounds (ldvr,n) info : int

val find_best_lapack_type : ?arrays:[> `Ndarray ] Np.Obj.t list -> ?dtype:[ `S of string | `Dtype of Np.Dtype.t ] -> unit -> string * Np.Dtype.t * bool

Find best-matching BLAS/LAPACK type.

Arrays are used to determine the optimal prefix of BLAS routines.

Parameters ---------- arrays : sequence of ndarrays, optional Arrays can be given to determine optimal prefix of BLAS routines. If not given, double-precision routines will be used, otherwise the most generic type in arrays will be used. dtype : str or dtype, optional Data-type specifier. Not used if `arrays` is non-empty.

Returns ------- prefix : str BLAS/LAPACK prefix character. dtype : dtype Inferred Numpy data type. prefer_fortran : bool Whether to prefer Fortran order routines over C order.

Examples -------- >>> import scipy.linalg.blas as bla >>> a = np.random.rand(10,15) >>> b = np.asfortranarray(a) # Change the memory layout order >>> bla.find_best_blas_type((a,)) ('d', dtype('float64'), False) >>> bla.find_best_blas_type((a*1j,)) ('z', dtype('complex128'), False) >>> bla.find_best_blas_type((b,)) ('d', dtype('float64'), True)

val get_lapack_funcs : ?arrays:[> `Ndarray ] Np.Obj.t list -> ?dtype:[ `S of string | `Dtype of Np.Dtype.t ] -> names:[ `Sequence_of_str of Py.Object.t | `S of string ] -> unit -> [ `ArrayLike | `Ndarray | `Object ] Np.Obj.t

Return available LAPACK function objects from names.

Arrays are used to determine the optimal prefix of LAPACK routines.

Parameters ---------- names : str or sequence of str Name(s) of LAPACK functions without type prefix.

arrays : sequence of ndarrays, optional Arrays can be given to determine optimal prefix of LAPACK routines. If not given, double-precision routines will be used, otherwise the most generic type in arrays will be used.

dtype : str or dtype, optional Data-type specifier. Not used if `arrays` is non-empty.

Returns ------- funcs : list List containing the found function(s).

Notes ----- This routine automatically chooses between Fortran/C interfaces. Fortran code is used whenever possible for arrays with column major order. In all other cases, C code is preferred.

In LAPACK, the naming convention is that all functions start with a type prefix, which depends on the type of the principal matrix. These can be one of 's', 'd', 'c', 'z' for the numpy types float32, float64, complex64, complex128 respectively, and are stored in attribute ``typecode`` of the returned functions.

Examples -------- Suppose we would like to use '?lange' routine which computes the selected norm of an array. We pass our array in order to get the correct 'lange' flavor.

>>> import scipy.linalg as LA >>> a = np.random.rand(3,2) >>> x_lange = LA.get_lapack_funcs('lange', (a,)) >>> x_lange.typecode 'd' >>> x_lange = LA.get_lapack_funcs('lange',(a*1j,)) >>> x_lange.typecode 'z'

Several LAPACK routines work best when its internal WORK array has the optimal size (big enough for fast computation and small enough to avoid waste of memory). This size is determined also by a dedicated query to the function which is often wrapped as a standalone function and commonly denoted as ``###_lwork``. Below is an example for ``?sysv``

>>> import scipy.linalg as LA >>> a = np.random.rand(1000,1000) >>> b = np.random.rand(1000,1)*1j >>> # We pick up zsysv and zsysv_lwork due to b array ... xsysv, xlwork = LA.get_lapack_funcs(('sysv', 'sysv_lwork'), (a, b)) >>> opt_lwork, _ = xlwork(a.shape0) # returns a complex for 'z' prefix >>> udut, ipiv, x, info = xsysv(a, b, lwork=int(opt_lwork.real))

val sgegv : ?kwds:(string * Py.Object.t) list -> Py.Object.t list -> Py.Object.t

`sgegv` is deprecated! The `*gegv` family of routines has been deprecated in LAPACK 3.6.0 in favor of the `*ggev` family of routines. The corresponding wrappers will be removed from SciPy in a future release.

alphar,alphai,beta,vl,vr,info = sgegv(a,b,compute_vl,compute_vr,lwork,overwrite_a,overwrite_b)

Wrapper for ``sgegv``.

Parameters ---------- a : input rank-2 array('f') with bounds (n,n) b : input rank-2 array('f') with bounds (n,n)

Other Parameters ---------------- compute_vl : input int, optional Default: 1 compute_vr : input int, optional Default: 1 overwrite_a : input int, optional Default: 0 overwrite_b : input int, optional Default: 0 lwork : input int, optional Default: max(8*n,1)

Returns ------- alphar : rank-1 array('f') with bounds (n) alphai : rank-1 array('f') with bounds (n) beta : rank-1 array('f') with bounds (n) vl : rank-2 array('f') with bounds (ldvl,n) vr : rank-2 array('f') with bounds (ldvr,n) info : int

val zgegv : ?kwds:(string * Py.Object.t) list -> Py.Object.t list -> Py.Object.t

`zgegv` is deprecated! The `*gegv` family of routines has been deprecated in LAPACK 3.6.0 in favor of the `*ggev` family of routines. The corresponding wrappers will be removed from SciPy in a future release.

alpha,beta,vl,vr,info = zgegv(a,b,compute_vl,compute_vr,lwork,overwrite_a,overwrite_b)

Wrapper for ``zgegv``.

Parameters ---------- a : input rank-2 array('D') with bounds (n,n) b : input rank-2 array('D') with bounds (n,n)

Other Parameters ---------------- compute_vl : input int, optional Default: 1 compute_vr : input int, optional Default: 1 overwrite_a : input int, optional Default: 0 overwrite_b : input int, optional Default: 0 lwork : input int, optional Default: max(2*n,1)

Returns ------- alpha : rank-1 array('D') with bounds (n) beta : rank-1 array('D') with bounds (n) vl : rank-2 array('D') with bounds (ldvl,n) vr : rank-2 array('D') with bounds (ldvr,n) info : int

OCaml

Innovation. Community. Security.