PyGSL application programming interface

pygsl

Wrapper for the GNU Scientific Library.

This module provides the following submodules:
  • blas

  • chebyshev

  • combination

  • const

  • diff

  • eigen

  • fit

  • histogram

  • ieee

  • integrate

  • interpolation

  • linalg

  • math

  • minimize

  • multifit

  • multifit_nlin

  • multimin

  • multiroots

  • odeiv

  • permutation

  • poly

  • qrng

  • rng

  • roots

  • siman

  • sf

  • statistics

Homepage: https://github.com/pygsl/pygsl

Warning

If you want to use setup from the environement you have to call pygsl.ieee.env_setup() and pygsl.rng.env_setup() explicitly!

pygsl.set_debug_level(level)[source]

Allows to set the debug level if implemented in the init function.

Parameters:

level – A level of 0 deactivates all messages. The higher the level gets the more messages are printed.

Silently ignores this function if the functionality was not compiled into pygsl during build time.

These messages are compiled into the modules written in C. The level is stored as a c variable in the module level for each module. This can be useful to find the reason why PyGSL crashes during execution.

pygsl.get_debug_level()[source]

Get the debug level

See pygsl.set_debug_level() for details.

Submodules

errno

The error numbers as provided by GSL. Typically the error numbers are converted to exceptions. These exceptions are listed in pygsl.errors. Some functions (e.g. iterators or steppers) use return values to show that progress can be made (e.g. GSL_CONTINUE).

See also <gsl/gsl_errno.h>

pygsl.errno.GSL_SUCCESS = 0

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_FAILURE = -1

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_CONTINUE = -2

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_EDOM = 1

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_ERANGE = 2

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_EFAULT = 3

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_EINVAL = 4

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_EFAILED = 5

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_EFACTOR = 6

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_ESANITY = 7

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_ENOMEM = 8

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_EBADFUNC = 9

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_ERUNAWAY = 10

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_EMAXITER = 11

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_EZERODIV = 12

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_EBADTOL = 13

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_ETOL = 14

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_EUNDRFLW = 15

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_EOVRFLW = 16

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_ELOSS = 17

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_EROUND = 18

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_EBADLEN = 19

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_ENOTSQR = 20

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_ESING = 21

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_EDIVERGE = 22

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_EUNSUP = 23

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_EUNIMPL = 24

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_ECACHE = 25

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_ETABLE = 26

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_ENOPROG = 27

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_ENOPROGJ = 28

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_ETOLF = 29

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_ETOLX = 30

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_ETOLG = 31

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.GSL_EOF = 32

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.PyGSL_ESTRIDE = 64

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.PyGSL_EUNIMPL = 65

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.errno.PyGSL_EINIT = 66

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

errors

Exceptions raised by pygsl

GSL error codes are translated to python exceptions. These exceptions are listed here. As far as appropriate the exceptions are derived from python exceptions.

The GSL error codes can be accessed from pygsl.errno

pygsl.errors.get_exceptions()[source]

Returns the exceptions defined within this module

Used by the pygsl.init module. This is used by the C helper functions to turn an error reported by gsl by the C error code to the appropriate python exception

pygsl.errors.get_warnings()[source]

Returns the warnings defined within this module

Used by the pygsl.init module. This is used by the C helper functions to turn an error reported by gsl by the C error code to the appropriate python warning

exception pygsl.errors.gsl_AccuracyLossError[source]

Bases: gsl_ArithmeticError

failed to reach the specified tolerance

errno = 17

gsl error number pygsl.errno.GSL_ELOSS

exception pygsl.errors.gsl_ArithmeticError[source]

Bases: gsl_Error, ArithmeticError

base of all common arithmetic exceptions

exception pygsl.errors.gsl_BadFuncError[source]

Bases: gsl_Error

problem with user-supplied function

errno = 9

gsl error number pygsl.errno.GSL_EBADFUNC

exception pygsl.errors.gsl_BadLength[source]

Bases: gsl_Error

matrix; vector lengths are not conformant

errno = 19

gsl error number pygsl.errno.GSL_EBADLEN

exception pygsl.errors.gsl_BadToleranceError[source]

Bases: gsl_Error

user specified an invalid tolerance

errno = 13

gsl error number pygsl.errno.GSL_EBADTOL

exception pygsl.errors.gsl_CacheLimitError[source]

Bases: gsl_Error

cache limit exceeded

errno = 25

gsl error number pygsl.errno.GSL_ECACHE

exception pygsl.errors.gsl_DivergeError[source]

Bases: gsl_ArithmeticError

integral or series is divergent

errno = 22

gsl error number pygsl.errno.GSL_EDIVERGE

exception pygsl.errors.gsl_DomainError[source]

Bases: gsl_Error

Domain Error. e.g. sqrt(-1)

errno = 1

gsl error number pygsl.errno.GSL_EDOM

exception pygsl.errors.gsl_DomainWarning[source]

Bases: gsl_Warning

used by pygsl.histogram

errno = 1

error number pygsl.errno.GSL_EDOM

exception pygsl.errors.gsl_EOFError[source]

Bases: gsl_Error, EOFError

end of file

errno = 32

gsl error number pygsl.errno.GSL_EOF

exception pygsl.errors.gsl_Error[source]

Bases: Exception

base of all gsl exceptions

IsA = 'gsl_Error'
errno = None
exception pygsl.errors.gsl_FactorizationError[source]

Bases: gsl_Error

factorization failed

errno = 6

gsl error number pygsl.errno.GSL_EFACTOR

exception pygsl.errors.gsl_FloatingPointError[source]

Bases: gsl_Error, FloatingPointError

base of all common floating point errors

exception pygsl.errors.gsl_GenericError[source]

Bases: gsl_Error

generic failure

errno = 5

gsl error number pygsl.errno.GSL_EFAILED

exception pygsl.errors.gsl_InvalidArgumentError[source]

Bases: gsl_Error

invalid argument supplied by user

errno = 4

gsl error number pygsl.errno.GSL_EINVAL

exception pygsl.errors.gsl_JacobianEvaluationError[source]

Bases: gsl_ArithmeticError

jacobian evaluations are not improving the solution

errno = 28

gsl error number pygsl.errno.GSL_ENOPROGJ

exception pygsl.errors.gsl_MatrixNotSquare[source]

Bases: gsl_Error

matrix not square

errno = 20

gsl error number pygsl.errno.GSL_ENOTSQR

exception pygsl.errors.gsl_MaximumIterationError[source]

Bases: gsl_ArithmeticError

exceeded max number of iterations

errno = 11

gsl error number pygsl.errno.GSL_EMAXITER

exception pygsl.errors.gsl_NoHardwareSupportError[source]

Bases: gsl_Error

requested feature is not supported by the hardware

errno = 23

gsl error number pygsl.errno.GSL_EUNSUP

exception pygsl.errors.gsl_NoProgressError[source]

Bases: gsl_ArithmeticError

iteration is not making progress towards solution

errno = 27

gsl error number pygsl.errno.GSL_ENOPROG

exception pygsl.errors.gsl_NotImplementedError[source]

Bases: gsl_Error, NotImplementedError

requested feature not (yet) implemented

errno = 24

gsl error number pygsl.errno.GSL_EUNIMPL

exception pygsl.errors.gsl_OverflowError[source]

Bases: gsl_Error, OverflowError

Overflow Error

errno = 16

gsl error number pygsl.errno.GSL_EOVERFLW

exception pygsl.errors.gsl_PointerError[source]

Bases: gsl_Error

invalid pointer

This error is typically raised if GSL is checking a pointer and that pointer is NULL.

errno = 3

gsl error number pygsl.errno.GSL_EFAULT

exception pygsl.errors.gsl_RangeError[source]

Bases: gsl_ArithmeticError

output range error, e.g. exp(1e100)

errno = 2

gsl error number pygsl.errno.GSL_ERANGE

exception pygsl.errors.gsl_RoundOffError[source]

Bases: gsl_ArithmeticError

failed because of roundoff error

errno = 18

gsl error number pygsl.errno.GSL_EFOUND

exception pygsl.errors.gsl_RunAwayError[source]

Bases: gsl_ArithmeticError

iterative process is out of control

errno = 10

gsl error number pygsl.errno.GSL_ERUNAWAY

exception pygsl.errors.gsl_SanityCheckError[source]

Bases: gsl_Error

sanity check failed - shouldn’t happen

errno = 7

gsl error number pygsl.errno.GSL_ESANITY

exception pygsl.errors.gsl_SingularityError[source]

Bases: gsl_ArithmeticError

apparent singularity detected

errno = 21

gsl error number pygsl.errno.GSL_ESING

exception pygsl.errors.gsl_TableLimitError[source]

Bases: gsl_Error

Table limit exceeded

errno = 26

gsl error number pygsl.errno.GSL_ETABLE

exception pygsl.errors.gsl_ToleranceError[source]

Bases: gsl_ArithmeticError

failed to reach the specified tolerance

errno = 14

gsl error number pygsl.errno.GSL_ETOL

exception pygsl.errors.gsl_ToleranceFError[source]

Bases: gsl_ArithmeticError

cannot reach the specified tolerance in F

errno = 29

gsl error number pygsl.errno.GSL_ETOLF

exception pygsl.errors.gsl_ToleranceGradientError[source]

Bases: gsl_ArithmeticError

cannot reach the specified tolerance in gradient

errno = 31

gsl error number pygsl.errno.GSL_ETOLG

exception pygsl.errors.gsl_ToleranceXError[source]

Bases: gsl_ArithmeticError

cannot reach the specified tolerance in X

errno = 30

gsl error number pygsl.errno.GSL_ETOLX

exception pygsl.errors.gsl_UnderflowError[source]

Bases: gsl_Error, OverflowError

Underflow error

errno = 15

gsl error number pygsl.errno.GSL_EUNDRFLW

exception pygsl.errors.gsl_Warning[source]

Bases: Warning

base of all gsl warnings

errno = None
exception pygsl.errors.gsl_ZeroDivisionError[source]

Bases: gsl_Error, ZeroDivisionError

zero Division Error

errno = 12

gsl error number pygsl.errno.GSL_EZERODIV

exception pygsl.errors.pygsl_NotImplementedError[source]

Bases: gsl_NotImplementedError

Base for all Errors, which are known but not implemented yet!

errno = 65

pygsl error number pygsl.errno.PyGSL_EUNIMPL

exception pygsl.errors.pygsl_NotInitalised[source]

Bases: gsl_SanityCheckError

gsl_error calls a c callback, which saves the reason, file name, line number and the GSL errno.

This errno is stored when the save state is initalised and flags that gsl_error was not yet called.

errno = 66

pygsl error number pygsl.errno.PyGSL_EINIT

exception pygsl.errors.pygsl_StrideError[source]

Bases: gsl_SanityCheckError

Could not recalculate a stride of a python array object to the stride of a gsl_vector or gsl_matrix.

errno = 64

pygsl error number pygsl.errno.PyGSL_ESTRIDE

class pygsl.errors._ErrorSafeState[source]

Access to the last error stored by gsl

If PyGSL does not set gsl_error handler to off, the installed error handler will store the arguments passed by gsl_error_handler to a single static variable in pygsl.init. This variable is exported to python space by this class.

If pygsl raises an exception, this state here should be automatically reset.

Used gsl functions:
  • gsl_set_error_handler_off()

  • gsl_set_error_handler()

pygsl.errors.error_safe_state = <pygsl.errors._ErrorSafeState object>

Access to the last error stored by gsl

If PyGSL does not set gsl_error handler to off, the installed error handler will store the arguments passed by gsl_error_handler to a single static variable in pygsl.init. This variable is exported to python space by this class.

If pygsl raises an exception, this state here should be automatically reset.

Used gsl functions:
  • gsl_set_error_handler_off()

  • gsl_set_error_handler()

math

Special Functions

Airy Functions

Bessel Functions

Clausen Functions

Coulomb Functions

Coupling Functions

Dawson Function

Debye Functions

Dilogarithm

Elementary Operations

Ellipitcal Integrals

Error Functions

Exponential Functions and Integrals

Fermi Dirac Functions

Gamma and Beta Functions

Gegenbauer Functions

Hermite Polynomials and Functions

Hypergeometric Functions

Laguerre Functions

Lambert Functions

Legendre Functions and Spherical Harmonics

Mathieu functions

Power functions

Psi functions

Synchrotron functions

Transport Functions

Trigonometric Functions

Zeta Functions

Complex implementations of standard functions

Unsorted functions

Hydrogenic functions

poly

Wrapper over the functions as described in Chaper 6 of the reference manual.

There are routines for finding real and complex roots of quadratic and cubic equations using analytic methods. An iterative polynomial solver is also available for finding the roots of general polynomials with real coefficients (of any order).

All the doc strings were taken form the gsl reference document.

pygsl.poly.complex_solve_cubic(*args)[source]

This function finds the complex roots of the cubic equation,

z^3 + a z^2 + b z + c = 0

The number of complex roots is returned (always three) and the locations of the roots are stored in z0, z1 and z2. The roots are returned in ascending order, sorted first by their real components and then by their imaginary components.

input : a, b, c

outputn, r1, r2

n … number of roots found r1 … first root r2 … second root r3 … third root

pygsl.poly.complex_solve_quadratic(*args)[source]

The complex version of solve quadratic. See solve_quadratic for explanation.

class pygsl.poly.poly_complex(dimension)[source]

Bases: object

The roots of polynomial equations cannot be found analytically beyond the special cases of the quadratic, cubic and quartic equation. This class uses an iterative method to find the approximate locations of roots of higher order polynomials.

solve(a)[source]

This function computes the roots of the general polynomial P(x) = a_0 + a_1 x + a_2 x^2 + … + a_{n-1} x^{n-1} using balanced-QR reduction of the companion matrix. The parameter n specifies the length of the coefficient array. The coefficient of the highest order term must be non-zero. The function requires a workspace w of the appropriate size. The n-1 roots are returned in the packed complex array z of length 2(n-1), alternating real and imaginary parts.

The function returns GSL_SUCCESS if all the roots are found and GSL_EFAILED if the QR reduction does not converge.

inputz

z … Array of complex coefficients.

outputflag, z_out

flag … GSL_SUCCESS or GSL_FAILURE z … Array of complex roots

class pygsl.poly.poly_dd(xa, ya)[source]

Bases: object

This class manipulates polynomials stored in Newton’s divided-difference representation. The use of divided-differences is described in Abramowitz & Stegun sections 25.1.4, 25.2.26.

eval(x)[source]

This method evaluates the polynomial stored in divided-difference form at point x.

inputx

x … point

output : y

taylor(xp)[source]

This method converts the internal divided-difference representation of a polynomial to a Taylor expansion.

inputxp

xp … point to expand about

pygsl.poly.poly_eval(*args)[source]

This function evaluates the polynomial c[0] + c[1] x + c[2] x^2 + dots + c[len-1] x^{len-1} using Horner’s method for stability

input: c, x

c … array of coefficients x …

output: y

pygsl.poly.solve_cubic(*args)[source]

This function finds the real roots of the cubic equation,

x^3 + a x^2 + b x + c = 0

with a leading coefficient of unity. The number of real roots (either one or three) is returned, and their locations are stored in x0, x1 and x2. If one real root is found then only x0 is modified. When three real roots are found they are stored in x0, x1 and x2 in ascending order. The case of coincident roots is not considered special. For example, the equation (x-1)^3=0 will have three roots with exactly equal values.

input : a, b, c

outputn, r1, r2

n … number of roots found r1 … first root r2 … second root r3 … third root

pygsl.poly.solve_quadratic(*args)[source]

a x^2 + b x + c = 0

The number of real roots (either zero or two) is returned, and their locations are stored in x0 and x1. If no real roots are found then x0 and x1 are not modified. When two real roots are found they are stored in x0 and x1 in ascending order. The case of coincident roots is not considered special. For example (x-1)^2=0 will have two roots, which happen to have exactly equal values.

The number of roots found depends on the sign of the discriminant b^2 - 4 a c. This will be subject to rounding and cancellation errors when computed in double precision, and will also be subject to errors if the coefficients of the polynomial are inexact. These errors may cause a discrete change in the number of roots. However, for polynomials with small integer coefficients the discriminant can always be computed exactly.

input : a, b, c

outputn, r1, r2

n … number of roots found r1 … first root r2 … second root

permutation

Permutation

This chapter describes functions for creating and manipulating permutations. A permutation p is represented by an array of n integers in the range 0 .. n-1, where each value \(p_i\) occurs once and only once. The application of a permutation p to a vector \(v\) yields a new vector \(v'\) where \(v'_i = v_{p_i}.\) For example, the array (0,1,3,2) represents a permutation which exchanges the last two elements of a four element vector. The corresponding identity permutation is (0,1,2,3).

class pygsl.permutation.Permutation(n)[source]

Bases: Permutation

canonical_to_linear()[source]

Computes the linear form of the current permutation and returns it in a new permutation

inverse()[source]

Computes the inverse form of the current permutation and returns it in a new permutation.

linear_to_canonical()[source]

Computes the canonical form of the current permutation and returns it in a new permutation

mul(b)[source]

Mutliplies this permutation with an other permutation and returns the result in a new permutation.

combination

Wrapper for the combination.

Usage:

Initalisation:

c = Combination(n, k)

Testing for validness:

c.valid() returns 0 = GSL_SUCCESS if ok. Raises a gsl_DomainError if invalid.

The gsl_combination_get is wrapped by:
  • c.tolist()

  • c.toarray()

Both will return the actual combination.

Stepping between the various combinations:
  • c.prev()

  • c.next()

Both return 0 in case of success and -1 in case of failure.

class pygsl.combination.Combination(n, k)[source]

Proxy of C gsl_combination_struct struct.

blas

BLAS - Basic Linear Algebra Subprograms

GSL provides dense vector and matrix objects, based on the relevant built-in types. The library provides an interface to the BLAS operations which apply to these objects.

PyGSL only provides the functions working on “native” Python datatypes, i.e. double and complex_double.

Functions with the postfix “_cr” are functions that support call by reference. This is faster than the original version but may confuse real Python programmers. Use this, if speed matters!!

Functions that are naturally done using functions of the underlying numerical package are left out here.

pygsl.blas.dasum(x)[source]

This function computes the absolute sum M{sum |x_i|} of the elements of the vector x.

pygsl.blas.daxpy(alpha, x, y)[source]

This function computes the sum M{y = S{alpha} x + y} for the vectors x and y.

pygsl.blas.daxpy_cr(alpha, x, y_CR)[source]

This function computes the sum M{y = S{alpha} x + y} for the vectors x and y.

pygsl.blas.ddot(x, y)[source]

This function computes the scalar product M{x^T y} for the vectors x and y, returning the result.

pygsl.blas.dgemm(alpha, A, B, beta, C, TransA=111, TransB=111)[source]

returns C’

This function computes the matrix-matrix product and sum M{C’ = S{alpha} op(A) op(B) + S{beta} C} where op(A) = A, A^T, A^H for TransA = CblasNoTrans, CblasTrans, CblasConjTrans and similarly for the parameter TransB.

pygsl.blas.dgemv(alpha, a, x, beta, y, TransA=111)[source]

This function computes the matrix-vector product and sum M{y = S{alpha} op(A) x + S{beta} y}, where op(A) = M{A, A^T, A^H} for TransA = CblasNoTrans, CblasTrans, CblasConjTrans.

pygsl.blas.dger(alpha, X, Y, A)[source]

returns A’

This function computes the rank-1 update M{A’ = S{alpha} x y^T + A} of the matrix A.

pygsl.blas.dnrm2(x)[source]

This function computes the Euclidean norm M{||x||_2 = sqrt {sum x_i^2}} of the vector x.

pygsl.blas.drot(x, y, c, s)[source]

This function applies a Givens rotation M{(x’, y’) = (c x + s y, -s x + c y)} to the vectors x, y.

pygsl.blas.drot_cr(x_CR, y_CR, c, s)[source]

This function applies a Givens rotation M{(x’, y’) = (c x + s y, -s x + c y)} to the vectors x, y.

pygsl.blas.dsymm(alpha, A, B, beta, C, Side=141, Uplo=122)[source]

returns C’

This function computes the matrix-matrix product and sum M{C’ = S{alpha} A B + S{beta} C} for Side is CblasLeft and M{C’ = S{alpha} B A + S{beta} C} for Side is CblasRight, where the matrix A is symmetric. When Uplo is CblasUpper then the upper triangle and diagonal of A are used, and when Uplo is CblasLower then the lower triangle and diagonal of A are used.

pygsl.blas.dsymv(alpha, A, X, beta, Y, Uplo=122)[source]

returns y’

This function computes the matrix-vector product and sum M{y’ = S{alpha} A x + S{beta} y} for the symmetric matrix A. Since the matrix A is symmetric only its upper half or lower half need to be stored. When Uplo is CblasUpper then the upper triangle and diagonal of A are used, and when Uplo is CblasLower then the lower triangle and diagonal of A are used.

pygsl.blas.dsyr(alpha, X, A, Uplo=122)[source]

returns A’

This function computes the symmetric rank-1 update M{A’ = S{alpha} x x^T + A} of the symmetric matrix A. Since the matrix A is symmetric only its upper half or lower half need to be stored. When Uplo is CblasUpper then the upper triangle and diagonal of A are used, and when Uplo is CblasLower then the lower triangle and diagonal of A are used.

pygsl.blas.dsyr2(alpha, X, Y, A, Uplo=122)[source]

returns A’

This function computes the symmetric rank-2 update M{A’ = S{alpha} x y^T + S{alpha} y x^T + A} of the symmetric matrix A. Since the matrix A is symmetric only its upper half or lower half need to be stored. When Uplo is CblasUpper then the upper triangle and diagonal of A are used, and when Uplo is CblasLower then the lower triangle and diagonal of A are used.

pygsl.blas.dsyr2k(alpha, A, B, beta, C, Uplo=122, Trans=111)[source]

returns C’

This function computes a rank-2k update of the symmetric matrix C, M{C’ = S{alpha} A B^T + S{alpha} B A^T + S{beta} C} when Trans is CblasNoTrans and M{C’ = S{alpha} A^T B + S{alpha} B^T A + S{beta} C} when Trans is CblasTrans. Since the matrix C is symmetric only its upper half or lower half need to be stored. When Uplo is CblasUpper then the upper triangle and diagonal of C are used, and when Uplo is CblasLower then the lower triangle and diagonal of C are used.

pygsl.blas.dsyrk(alpha, A, beta, C, Uplo=122, Trans=111)[source]

returns C’

This function computes a rank-k update of the symmetric matrix C, M{C’ = S{alpha} A A^T + S{beta} C} when Trans is CblasNoTrans and M{C’ = S{alpha} A^T A + S{beta} C} when Trans is CblasTrans. Since the matrix C is symmetric only its upper half or lower half need to be stored. When Uplo is CblasUpper then the upper triangle and diagonal of C are used, and when Uplo is CblasLower then the lower triangle and diagonal of C are used.

pygsl.blas.dtrmm(alpha, A, B, Side=141, Uplo=122, TransA=111, Diag=131)[source]

returns B’

This function computes the matrix-matrix product M{B’ = S{alpha} op(A) B} for Side is CblasLeft and M{B’ = S{alpha} B op(A)} for Side is CblasRight. The matrix A is triangular and op(A) = A, A^T, A^H for TransA = CblasNoTrans, CblasTrans, CblasConjTrans When Uplo is CblasUpper then the upper triangle of A is used, and when Uplo is CblasLower then the lower triangle of A is used. If Diag is CblasNonUnit then the diagonal of A is used, but if Diag is CblasUnit then the diagonal elements of the matrix A are taken as unity and are not referenced.

pygsl.blas.dtrmv(A, x, Uplo=122, TransA=111, Diag=131)[source]

This function computes the matrix-vector product returns x’

This function computes the matrix-vector product and x’ = op(A) x for the triangular matrix A, where op(A) = A, A^T, A^H for TransA = CblasNoTrans, CblasTrans, CblasConjTrans. When Uplo is CblasUpper then the upper triangle of A is used, and when Uplo is CblasLower then the lower triangle of A is used. If Diag is CblasNonUnit then the diagonal of the matrix is used, but if Diag is CblasUnit then the diagonal elements of the matrix A are taken as unity and are not referenced.

pygsl.blas.dtrsm(alpha, A, B, Side=141, Uplo=122, TransA=111, Diag=131)[source]

returns B’

This function computes the matrix-matrix product M{B’ = S{alpha} op(inv(A)) B} for Side is CblasLeft and M{B’ = S{alpha} B op(inv(A))} for Side is CblasRight. The matrix A is triangular and op(A) = A, A^T, A^H for TransA = CblasNoTrans, CblasTrans, CblasConjTrans When Uplo is CblasUpper then the upper triangle of A is used, and when Uplo is CblasLower then the lower triangle of A is used. If Diag is CblasNonUnit then the diagonal of A is used, but if Diag is CblasUnit then the diagonal elements of the matrix A are taken as unity and are not referenced.

pygsl.blas.dtrsv(A, x, Uplo=122, TransA=111, Diag=131)[source]

This function computes inv(op(A)) x for x, where op(A) = A, A^T, A^H for TransA = CblasNoTrans, CblasTrans, CblasConjTrans. When Uplo is CblasUpper then the upper triangle of A is used, and when Uplo is CblasLower then the lower triangle of A is used. If Diag is CblasNonUnit then the diagonal of the matrix is used, but if Diag is CblasUnit then the diagonal elements of the matrix A are taken as unity and are not referenced.

Return type:

x

pygsl.blas.dzasum(x)[source]

This function computes the absolute sum M{sum |\Re(x_i)| + |\Im(x_i)|} of the elements of the vector x.

pygsl.blas.dznrm2(x)[source]

This function computes the Euclidean norm of the complex vector x, M{||x||_2 = sqrt {sum (Re(x_i)^2 + Im(x_i)^2)}}.

pygsl.blas.idamax(x)[source]

This function returns the index of the largest element of the vector x. The largest element is determined by its absolute magnitude. If the largest value occurs several times then the index of the first occurrence is returned.

pygsl.blas.izamax(x)[source]

This function returns the index of the largest element of the vector x. The largest element is determined by the sum of the magnitudes of the real and imaginary parts M{|\Re(x_i)| + |\Im(x_i)|}. If the largest value occurs several times then the index of the first occurrence is returned.

pygsl.blas.triang2herm(A, Uplo=122, Diag=131)[source]

returns A’

This function creates an hermitian matrix from a triangular matrix. When Uplo is CblasUpper then the upper triangle and diagonal of A are used, and when Uplo is CblasLower then the lower triangle and diagonal of A are used. If Diag is CblasNonUnit then the diagonal of A is used, but if Diag is CblasUnit then the diagonal elements of the matrix A are taken as unity and are not referenced.

pygsl.blas.triang2symm(A, Uplo=122, Diag=131)[source]

returns A’

This function creates an symmetric matrix from a triangular matrix. When Uplo is CblasUpper then the upper triangle and diagonal of A are used, and when Uplo is CblasLower then the lower triangle and diagonal of A are used. If Diag is CblasNonUnit then the diagonal of A is used, but if Diag is CblasUnit then the diagonal elements of the matrix A are taken as unity and are not referenced.

pygsl.blas.zaxpy(alpha, x, y)[source]

This function computes the sum M{y = S{alpha} x + y} for the vectors x and y.

pygsl.blas.zaxpy_cr(alpha, x, y_CR)[source]

This function computes the sum M{y = S{alpha} x + y} for the vectors x and y.

pygsl.blas.zdotc(x, y)[source]

This function computes the complex conjugate scalar product M{x^H y} for the vectors x and y, returning the result.

pygsl.blas.zdotu(x, y)[source]

This function computes the complex scalar product M{x^T y} for the vectors x and y, returning the result.

pygsl.blas.zgemm(alpha, A, B, beta, C, TransA=111, TransB=111)[source]

returns C’

This function computes the matrix-matrix product and sum M{C’ = S{alpha} op(A) op(B) + S{beta} C} where op(A) = A, A^T, A^H for TransA = CblasNoTrans, CblasTrans, CblasConjTrans and similarly for the parameter TransB.

pygsl.blas.zgemv(alpha, a, x, beta, y, TransA=111)[source]

This function computes the matrix-vector product and sum M{y = S{alpha} op(A) x + S{beta} y}, where M{op(A) = A, A^T, A^H} for TransA = CblasNoTrans, CblasTrans, CblasConjTrans.

pygsl.blas.zgerc(alpha, X, Y, A)[source]

returns A’

This function computes the conjugate rank-1 update M{A = S{alpha} x y^H + A} of the matrix A.

pygsl.blas.zgeru(alpha, X, Y, A)[source]

returns A’

This function computes the rank-1 update M{A’ = S{alpha} x y^T + A} of the matrix A.

pygsl.blas.zhemm(alpha, A, B, beta, C, Side=141, Uplo=122)[source]

returns C’

This function computes the matrix-matrix product and sum M{C’ = S{alpha} A B + S{beta} C} for Side is CblasLeft and M{C’ = S{alpha} B A + S{beta} C} for Side is CblasRight, where the matrix A is hermitian. When Uplo is CblasUpper then the upper triangle and diagonal of A are used, and when Uplo is CblasLower then the lower triangle and diagonal of A are used. The imaginary elements of the diagonal are automatically set to zero.

pygsl.blas.zhemv(alpha, A, X, beta, Y, Uplo=122)[source]

returns y’

This function computes the matrix-vector product and sum M{y’ = S{alpha} A x + S{beta} y} for the hermitian matrix A. Since the matrix A is hermitian only its upper half or lower half need to be stored. When Uplo is CblasUpper then the upper triangle and diagonal of A are used, and when Uplo is CblasLower then the lower triangle and diagonal of A are used. The imaginary elements of the diagonal are automatically assumed to be zero and are not referenced.

pygsl.blas.zher(alpha, X, A, Uplo=122)[source]

returns A’

This function computes the hermitian rank-1 update M{A’ = S{alpha} x x^H + A} of the hermitian matrix A. Since the matrix A is hermitian only its upper half or lower half need to be stored. When Uplo is CblasUpper then the upper triangle and diagonal of A are used, and when Uplo is CblasLower then the lower triangle and diagonal of A are used. The imaginary elements of the diagonal are automatically set to zero.

pygsl.blas.zher2(alpha, X, Y, A, Uplo=122)[source]

returns A’

This function computes the hermitian rank-2 update M{A’ = S{alpha} x y^H + S{alpha}^* y x^H A} of the hermitian matrix A. Since the matrix A is hermitian only its upper half or lower half need to be stored. When Uplo is CblasUpper then the upper triangle and diagonal of A are used, and when Uplo is CblasLower then the lower triangle and diagonal of A are used. The imaginary elements of the diagonal are automatically set to zero.

pygsl.blas.zher2k(alpha, A, B, beta, C, Uplo=122, Trans=111)[source]

returns C’

This function computes a rank-2k update of the hermitian matrix C, M{C’ = S{alpha} A B^H + S{alpha}^* B A^H + S{beta} C} when Trans is CblasNoTrans and M{C’ = S{alpha} A^H B + S{alpha}^* B^H A + S{beta} C} when Trans is CblasTrans. Since the matrix C is hermitian only its upper half or lower half need to be stored. When Uplo is CblasUpper then the upper triangle and diagonal of C are used, and when Uplo is CblasLower then the lower triangle and diagonal of C are used. The imaginary elements of the diagonal are automatically set to zero.

Calls function:

pygsl.blas.zherk(alpha, A, beta, C, Uplo=122, Trans=111)[source]

returns C’

This function computes a rank-k update of the hermitian matrix C, M{C’ = S{alpha} A A^H + S{beta} C} when Trans is CblasNoTrans and M{C’ = S{alpha} A^H A + S{beta} C} when Trans is CblasTrans. Since the matrix C is hermitian only its upper half or lower half need to be stored. When Uplo is CblasUpper then the upper triangle and diagonal of C are used, and when Uplo is CblasLower then the lower triangle and diagonal of C are used. The imaginary elements of the diagonal are automatically set to zero.

pygsl.blas.zsymm(alpha, A, B, beta, C, Side=141, Uplo=122)[source]

returns C’

This function computes the matrix-matrix product and sum M{C’ = S{alpha} A B + S{beta} C} for Side is CblasLeft and M{C’ = S{alpha} B A + S{beta} C} for Side is CblasRight, where the matrix A is symmetric. When Uplo is CblasUpper then the upper triangle and diagonal of A are used, and when Uplo is CblasLower then the lower triangle and diagonal of A are used.

pygsl.blas.zsyr2k(alpha, A, B, beta, C, Uplo=122, Trans=111)[source]

returns C’

This function computes a rank-2k update of the symmetric matrix C, M{C’ = S{alpha} A B^T + S{alpha} B A^T + S{beta} C} when Trans is CblasNoTrans and M{C’ = S{alpha} A^T B + S{alpha} B^T A + S{beta} C} when Trans is CblasTrans. Since the matrix C is symmetric only its upper half or lower half need to be stored. When Uplo is CblasUpper then the upper triangle and diagonal of C are used, and when Uplo is CblasLower then the lower triangle and diagonal of C are used.

pygsl.blas.zsyrk(alpha, A, beta, C, Uplo=122, Trans=111)[source]

returns C’

This function computes a rank-k update of the symmetric matrix C, M{C’ = S{alpha} A A^T + S{beta} C} when Trans is CblasNoTrans and M{C’ = S{alpha} A^T A + S{beta} C} when Trans is CblasTrans. Since the matrix C is symmetric only its upper half or lower half need to be stored. When Uplo is CblasUpper then the upper triangle and diagonal of C are used, and when Uplo is CblasLower then the lower triangle and diagonal of C are used.

pygsl.blas.ztrmm(alpha, A, B, Side=141, Uplo=122, TransA=111, Diag=131)[source]

returns B’

This function computes the matrix-matrix product M{B’ = S{alpha} op(A) B} for Side is CblasLeft and M{B’ = S{alpha} B op(A)} for Side is CblasRight. The matrix A is triangular and op(A) = A, A^T, A^H for TransA = CblasNoTrans, CblasTrans, CblasConjTrans When Uplo is CblasUpper then the upper triangle of A is used, and when Uplo is CblasLower then the lower triangle of A is used. If Diag is CblasNonUnit then the diagonal of A is used, but if Diag is CblasUnit then the diagonal elements of the matrix A are taken as unity and are not referenced.

pygsl.blas.ztrmv(A, x, Uplo=122, TransA=111, Diag=131)[source]

returns x’

This function computes the matrix-vector product and x’ = op(A) x for the triangular matrix A, where op(A) = A, A^T, A^H for TransA = CblasNoTrans, CblasTrans, CblasConjTrans. When Uplo is CblasUpper then the upper triangle of A is used, and when Uplo is CblasLower then the lower triangle of A is used. If Diag is CblasNonUnit then the diagonal of the matrix is used, but if Diag is CblasUnit then the diagonal elements of the matrix A are taken as unity and are not referenced.

pygsl.blas.ztrsm(alpha, A, B, Side=141, Uplo=122, TransA=111, Diag=131)[source]
Returns:

\(B'\)

This function computes the matrix-matrix product M{B’ = S{alpha} op(inv(A)) B} for Side is CblasLeft and M{B’ = S{alpha} B op(inv(A))} for Side is CblasRight. The matrix A is triangular and op(A) = A, A^T, A^H for TransA = CblasNoTrans, CblasTrans, CblasConjTrans When Uplo is CblasUpper then the upper triangle of A is used, and when Uplo is CblasLower then the lower triangle of A is used. If Diag is CblasNonUnit then the diagonal of A is used, but if Diag is CblasUnit then the diagonal elements of the matrix A are taken as unity and are not referenced.

pygsl.blas.ztrsv(A, x, Uplo=122, TransA=111, Diag=131)[source]

returns x’

This function computes inv(op(A)) x for x, where op(A) = A, A^T, A^H for TransA = CblasNoTrans, CblasTrans, CblasConjTrans. When Uplo is CblasUpper then the upper triangle of A is used, and when Uplo is CblasLower then the lower triangle of A is used. If Diag is CblasNonUnit then the diagonal of the matrix is used, but if Diag is CblasUnit then the diagonal elements of the matrix A are taken as unity and are not referenced.

linalg

Functions for solving linear systems.

The library provides simple linear algebra operations which operate directly on the gsl_vector and gsl_matrix objects. These are intended for use with “small” systems where simple algorithms are acceptable.

Anyone interested in large systems will want to use the sophisticated routines found in LAPACK. The Fortran version of LAPACK is recommended as the standard package for linear algebra. It supports blocked algorithms, specialized data representations and other optimizations.

pygsl.linalg.HH_solve(A, b)[source]

returns x

This function solves the system A x = b directly using Householder transformations. On output the solution is stored in x and b is not modified.

pygsl.linalg.LU_decomp(A)[source]

returns (LU, P, signum)

This function factorizes the square matrix A into the LU decomposition PA = LU. On output the diagonal and upper triangular part of the return matrix contain the matrix U. The lower triangular part of the input matrix (excluding the diagonal) contains L. The diagonal elements of L are unity, and are not stored.

The permutation matrix P is encoded in the permutation p. The j-th column of the matrix P is given by the k-th column of the identity matrix, where k = p_j the j-th element of the permutation vector. The sign of the permutation is given by signum. It has the value (-1)^n, where n is the number of interchanges in the permutation.

The algorithm used in the decomposition is Gaussian Elimination with partial pivoting (Golub & Van Loan, Matrix Computations, Algorithm 3.4.1).

Todo

Check if creating a copy of array A is required

pygsl.linalg.LU_det(LU, signum)[source]

returns determinant

This function computes the determinant of a matrix A from its LU decomposition, LU. The determinant is computed as the product of the diagonal elements of U and the sign of the row permutation signum.

pygsl.linalg.LU_invert(LU, p)[source]

returns inverse

This function computes the inverse of a matrix A from its LU decomposition (LU,p), storing the result in the matrix inverse. The inverse is computed by solving the system A x = b for each column of the identity matrix. It is preferable to avoid direct computation of the inverse whenever possible.

pygsl.linalg.LU_lndet(LU)[source]

This function computes the logarithm of the absolute value of the determinant of a matrix A, ln|det(A)|, from its LU decomposition, LU. This function may be useful if the direct computation of the determinant would overflow or underflow.

pygsl.linalg.LU_refine(A, LU, p, b, x)[source]

returns (x, residual)

This functions applies an iterative improvement to x, the solution of A x = b, using the LU decomposition of A into (LU,p). The initial residual r = A x - b is also computed and stored in residual.

pygsl.linalg.LU_sgndet(LU, signum)[source]

This function computes the sign or phase factor of the determinant of a matrix A, det(A)/|det(A)|, from its LU decomposition, LU.

pygsl.linalg.LU_solve(LU, p, b)[source]

This function solves the system A x = b using the LU decomposition of A into (LU, p) given by LU_decomp.

pygsl.linalg.LU_unpack(LU)[source]

returns (L,U)

This function splits the matrix LU into the the upper matrix U and the lower matrix L. The diagonal of L is the identity.

pygsl.linalg.QR_QRsolve(Q, R, b)[source]

returns x

This function solves the system R x = Q^T b for x. It can be used when the QR decomposition of a matrix is available in unpacked form as (Q,R).

pygsl.linalg.QR_QTvec(QR, tau, v)[source]

returns v’

This function applies the matrix Q^T encoded in the decomposition (QR,tau) to the vector v, storing the result Q^T v in v’. The matrix multiplication is carried out directly using the encoding of the Householder vectors without needing to form the full matrix Q^T.

pygsl.linalg.QR_Qvec(QR, tau, v)[source]

returns v’

This function applies the matrix Q encoded in the decomposition (QR,tau) to the vector v, storing the result Q v in v’. The matrix multiplication is carried out directly using the encoding of the Householder vectors without needing to form the full matrix Q.

pygsl.linalg.QR_Rsolve(QR, b)[source]

returns x

This function solves the triangular system R x = b for x. It may be useful if the product b’ = Q^T b has already been computed using gsl.linalg.QR_QTvec.

pygsl.linalg.QR_decomp(A)[source]

returns (QR, tau)

Function: int gsl_linalg_QR_decomp (gsl_matrix * A, gsl_vector * tau) This function factorizes the M-by-N matrix A into the QR decomposition A = Q R. On output the diagonal and upper triangular part of the input matrix contain the matrix R. The vector tau and the columns of the lower triangular part of the matrix QR contain the Householder coefficients and Householder vectors which encode the orthogonal matrix Q. The vector tau must be of length k=min(M,N). The matrix Q is related to these components by, Q = Q_k … Q_2 Q_1 where Q_i = I - tau_i v_i v_i^T and v_i is the Householder vector v_i = (0,…,1,A(i+1,i),A(i+2,i),…,A(m,i)). This is the same storage scheme as used by LAPACK.

The algorithm used to perform the decomposition is Householder QR (Golub & Van Loan, Matrix Computations, Algorithm 5.2.1).

pygsl.linalg.QR_lssolve(QR, tau, b)[source]

returns (x, residual)

This function finds the least squares solution to the overdetermined system A x = b where the matrix A has more rows than columns. The least squares solution minimizes the Euclidean norm of the residual, ||Ax - b||. The routine uses the QR decomposition of A into (QR, tau) given by gsl_linalg_QR_decomp. The solution is returned in x. The residual is computed as a by-product and stored in residual.

pygsl.linalg.QR_solve(QR, tau, b)[source]

returns x

This function solves the system A x = b using the QR decomposition of A into (QR, tau) given by gsl_linalg_QR_decomp.

pygsl.linalg.QR_unpack(QR, tau)[source]

returns (Q, R)

This function unpacks the encoded QR decomposition (QR,tau) into the matrices Q and R, where Q is M-by-M and R is M-by-N.

pygsl.linalg.QR_update(Q, R, w, v)[source]

This function performs a rank-1 update w v^T of the QR decomposition (Q, R). The update is given by Q’R’ = Q R + w v^T where the output matrices Q’ and R’ are also orthogonal and right triangular. Note that Q and R are overwritten with Q’ and R’!

pygsl.linalg.R_solve(R, b)[source]

returns x

This function solves the triangular system R x = b for the N-by-N matrix R.

pygsl.linalg.SV_decomp(A)[source]

returns (U, V, S)

This function factorizes the M-by-N matrix A into the singular value decomposition A = U S V^T. The diagonal elements of the singular value matrix S are stored in the vector S. The singular values are non-negative and form a non-increasing sequence from S_1 to S_N. The matrix V contains the elements of V in untransposed form. To form the product U S V^T it is necessary to take the transpose of V. A workspace of length N is required in work.

This routine uses the Golub-Reinsch SVD algorithm.

pygsl.linalg.SV_decomp_jacobi(A)[source]

returns (u, v, s)

This function computes the SVD using one-sided Jacobi orthogonalization (see references for details). The Jacobi method can compute singular values to higher relative accuracy than Golub-Reinsch algorithms.

pygsl.linalg.SV_decomp_mod(A)[source]

returns (u, v, s)

This function computes the SVD using the modified Golub-Reinsch algorithm, which is faster for M>>N. It requires the vector work and the N-by-N matrix X as additional working space.

pygsl.linalg.SV_solve(U, V, S, b)[source]

returns x

This function solves the system A x = b using the singular value decomposition (U, S, V) of A given by gsl_linalg_SV_decomp.

Only non-zero singular values are used in computing the solution. The parts of the solution corresponding to singular values of zero are ignored. Other singular values can be edited out by setting them to zero before calling this function.

In the over-determined case where A has more rows than columns the system is solved in the least squares sense, returning the solution x which minimizes ||A x - b||_2.

pygsl.linalg.bidiag_decomp(A)[source]

returns (BUV, tau_U, tau_V)

This function factorizes the M-by-N matrix A into bidiagonal form U B V^T. The diagonal and superdiagonal of the matrix B are stored in the diagonal and superdiagonal of BUV. The orthogonal matrices U and V are stored as compressed Householder vectors in the remaining elements of BUV. The Householder coefficients are stored in the vectors tau_U and tau_V. The length of tau_U must equal the number of elements in the diagonal of A and the length of tau_V should be one element shorter.

pygsl.linalg.bidiag_unpack(A, tau_U, tau_V)[source]

returns (U, V, diag, superdiag)

This function unpacks the bidiagonal decomposition of A given by gsl.linalg.bidiag_decomp, (A, tau_U, tau_V) into the separate orthogonal matrices U, V and the diagonal vector diag and superdiagonal superdiag.

pygsl.linalg.bidiag_unpack_B(A)[source]

returns (diag, superdiag)

This function unpacks the diagonal and superdiagonal of the bidiagonal decomposition of A given by gsl_linalg_bidiag_decomp, into the diagonal vector diag and superdiagonal vector superdiag.

pygsl.linalg.bidiag_unpack_diag(diag, superdiag)[source]

returns B

This functions unpacks the bidiagonal matrix T of the diagonal and superdiagonal obtained from gsl_linalg_bidiag_unpack[_B]

pygsl.linalg.cholesky_decomp(A)[source]

Function: int gsl_linalg_cholesky_decomp (gsl_matrix * A)

This function factorizes the positive-definite square matrix A into the Cholesky decomposition A = L L^T. On output the diagonal and lower triangular part of the input matrix A contain the matrix L. The upper triangular part of the input matrix contains L^T, the diagonal terms being identical for both L and L^T. If the matrix is not positive-definite then the decomposition will fail, returning the error code GSL_EDOM.

pygsl.linalg.cholesky_solve(cholesky, b)[source]

returns x

This function solves the system A x = b using the Cholesky decomposition of A into the matrix cholesky given by cholesky_decomp.

pygsl.linalg.cholesky_unpack(L)[source]

returns (L, L^T)

This function splits the matrix L into the the upper matrix L^T and the lower matrix L. The diagonal of L is the identical for both.

pygsl.linalg.hermtd_decomp(A)[source]

returns (QT, tau)

This function factorizes the hermitian matrix A into the symmetric tridiagonal decomposition U T U^T. On output the real parts of the diagonal and subdiagonal part of the input matrix A contain the tridiagonal matrix T. The remaining lower triangular part of the input matrix contains the Householder vectors which, together with the Householder coefficients tau, encode the orthogonal matrix Q. This storage scheme is the same as used by LAPACK. The upper triangular part of A and imaginary parts of the diagonal are not referenced.

pygsl.linalg.hermtd_unpack(A, tau)[source]

returns (Q, diag, subdiag)

This function unpacks the encoded tridiagonal decomposition (A, tau) obtained from gsl_linalg_hermtd_decomp into the unitary matrix U, the real vector of diagonal elements diag and the real vector of subdiagonal elements subdiag.

pygsl.linalg.hermtd_unpack_diag(diag, subdiag)[source]

returns T

This functions unpacks the tridiagonal matrix T of the diagonal and subdiagonal obtained from gsl_linalg_hermtd_unpack[_T]

pygsl.linalg.solve_symm_cyc_tridiag(diag, e, b)[source]

returns x

This function solves the general N-by-N system A x = b where A is symmetric cyclic tridiagonal. The form of A for the 4-by-4 case is shown below,

A = ( d_0 e_0 e_3 )

( e_0 d_1 e_1 ) ( e_1 d_2 e_2 ) ( e_3 e_2 d_3 )

pygsl.linalg.solve_symm_tridiag(diag, e, b)[source]

returns x

This function solves the general N-by-N system A x = b where A is symmetric tridiagonal. The form of A for the 4-by-4 case is shown below,

A = ( d_0 e_0 )

( e_0 d_1 e_1 ) ( e_1 d_2 e_2 ) ( e_2 d_3 )

pygsl.linalg.solve_tridiag(diag, e, f, b)[source]

returns x

This function solves the general N-by-N system A x = b where A is tridiagonal. The form of A for the 4-by-4 case is shown below,

A = ( d_0 e_0 )

( f_0 d_1 e_1 ) ( f_1 d_2 e_2 ) ( f_2 d_3 )

pygsl.linalg.symmtd_decomp(A)[source]

returns (QT, tau)

This function factorizes the symmetric square matrix A into the symmetric tridiagonal decomposition Q T Q^T. On output the diagonal and subdiagonal part of the input matrix A contain the tridiagonal matrix T. The remaining lower triangular part of the input matrix contains the Householder vectors which, together with the Householder coefficients tau, encode the orthogonal matrix Q. This storage scheme is the same as used by LAPACK. The upper triangular part of A is not referenced.

pygsl.linalg.symmtd_unpack(A, tau)[source]

returns (Q, diag, subdiag)

This function unpacks the encoded symmetric tridiagonal decomposition (A, tau) obtained from gsl_linalg_symmtd_decomp into the orthogonal matrix Q, the vector of diagonal elements diag and the vector of subdiagonal elements subdiag.

pygsl.linalg.symmtd_unpack_T(A)[source]

returns (diag, subdiag)

This function unpacks the diagonal and subdiagonal of the encoded tridiagonal decomposition (A, tau) obtained from gsl_linalg_hermtd_decomp into the real vectors diag and subdiag.

pygsl.linalg.symmtd_unpack_diag(diag, subdiag)[source]

returns T

This functions unpacks the tridiagonal matrix T of the diagonal and subdiagonal obtained from gsl_linalg_symmtd_unpack[_T]

eigen

This module provides functions for computing eigenvalues and eigenvectors of matrices using the gsl.

There are routines for real symmetric and complex hermitian matrices, and eigenvalues can be computed with or without eigenvectors. The algorithms used are symmetric bidiagonalization followed by QR reduction.

These routines are intended for “small” systems where simple algorithms are acceptable. Anyone interested finding eigenvalues and eigenvectors of large matrices will want to use the sophisticated routines found in LAPACK. The Fortran version of LAPACK is recommended as the standard package for linear algebra.

pygsl.eigen.Heigenvalues(a, ws=None) eval[source]

This function computes the eigenvalues of the complex hermitian matrix a. The imaginary parts of the diagonal are assumed to be zero and are not referenced. The eigenvalues are stored in the vector eval and are unordered.

pygsl.eigen.Heigenvectors(a, ws=None)[source]

This function computes the eigenvalues and eigenvectors of the complex hermitian matrix A.The imaginary parts of the diagonal are assumed to be zero and are not referenced. The eigenvalues are stored in the vector eval and are unordered. The corresponding complex eigenvectors are stored in the columns of the matrix evec. For example, the eigenvector in the first column corresponds to the first eigenvalue. The eigenvectors are guaranteed to be mutually orthogonal and normalised to unit magnitude.

pygsl.eigen.eigenvalues(a, ws=None) array[source]

This function computes the eigenvalues of the real symmetric matrix a. The eigenvalues are returned as NumPy array and are unordered.

pygsl.eigen.eigenvectors(a, ws=None)[source]

This function computes the eigenvalues and eigenvectors of the real symmetric matrix a. The eigenvalues are stored in the vector eval and are unordered. The corresponding eigenvectors are stored in the columns of the matrix evec. For example, the eigenvector in the first column corresponds to the first eigenvalue. The eigenvectors are

guaranteed to be mutually orthogonal and normalised to unit magnitude.

fft

Wrapper for the FFT tranform as provided by GSL

pygsl.fft.complex_backward()

Complex backward transform

The output is not scaled! :param data: an array of complex numbers :param space: a workspace of approbriate type and size :param table: a wavetable of approbriate type and size :param output: array to store the output into. GSL computes the FFT

in place. So if this array is provided, the wrapper will use this array as output array. If the input and output array are identical no internal copy will be made. This works only for the complex transform types!

Optional objects will be generated by the function automatically if required

pygsl.fft.complex_forward()

Complex forward transform :param data: an array of complex numbers :param space: a workspace of approbriate type and size :param table: a wavetable of approbriate type and size :param output: array to store the output into. GSL computes the FFT

in place. So if this array is provided, the wrapper will use this array as output array. If the input and output array are identical no internal copy will be made. This works only for the complex transform types!

Optional objects will be generated by the function automatically if required

pygsl.fft.complex_backward_float()

Float Version. See the corresponding double version. Remove the trailing _float

pygsl.fft.complex_forward_float()

Float Version. See the corresponding double version. Remove the trailing _float

pygsl.fft.complex_inverse()

Complex inverse transform

The output is to scale. :param data: an array of complex numbers :param space: a workspace of approbriate type and size :param table: a wavetable of approbriate type and size :param output: array to store the output into. GSL computes the FFT

in place. So if this array is provided, the wrapper will use this array as output array. If the input and output array are identical no internal copy will be made. This works only for the complex transform types!

Optional objects will be generated by the function automatically if required

pygsl.fft.complex_inverse_float()

Float Version. See the corresponding double version. Remove the trailing _float

pygsl.fft.complex_radix2_backward()

Complex backward radix2 transform

The output is not scaled! :param data: an array of complex numbers :param output: array to store the output into. GSL computes the FFT

in place. So if this array is provided, the wrapper will use this array as output array. If the input and output array are identical no internal copy will be made. This works only for the complex transform types!

Optional objects will be generated by the function automatically if required

pygsl.fft.complex_radix2_backward_float()

Float Version. See the corresponding double version. Remove the trailing _float

pygsl.fft.complex_radix2_dif_backward()

Complex backward radix2 decimation-in-frequency transform

The output is not scaled! :param data: an array of complex numbers :param output: array to store the output into. GSL computes the FFT

in place. So if this array is provided, the wrapper will use this array as output array. If the input and output array are identical no internal copy will be made. This works only for the complex transform types!

Optional objects will be generated by the function automatically if required

pygsl.fft.complex_radix2_dif_backward_float()

Float Version. See the corresponding double version. Remove the trailing _float

pygsl.fft.complex_radix2_dif_forward()

Complex forward radix2 decimation-in-frequency transform :param data: an array of complex numbers :param output: array to store the output into. GSL computes the FFT

in place. So if this array is provided, the wrapper will use this array as output array. If the input and output array are identical no internal copy will be made. This works only for the complex transform types!

Optional objects will be generated by the function automatically if required

pygsl.fft.complex_radix2_dif_forward_float()

Float Version. See the corresponding double version. Remove the trailing _float

pygsl.fft.complex_radix2_dif_inverse()

Complex inverse radix2 decimation-in-frequency transform

The output is to scale. :param data: an array of complex numbers :param output: array to store the output into. GSL computes the FFT

in place. So if this array is provided, the wrapper will use this array as output array. If the input and output array are identical no internal copy will be made. This works only for the complex transform types!

Optional objects will be generated by the function automatically if required

pygsl.fft.complex_radix2_dif_inverse_float()

Float Version. See the corresponding double version. Remove the trailing _float

pygsl.fft.complex_radix2_forward()

Complex forward radix2 transform :param data: an array of complex numbers :param output: array to store the output into. GSL computes the FFT

in place. So if this array is provided, the wrapper will use this array as output array. If the input and output array are identical no internal copy will be made. This works only for the complex transform types!

Optional objects will be generated by the function automatically if required

pygsl.fft.complex_radix2_forward_float()

Float Version. See the corresponding double version. Remove the trailing _float

pygsl.fft.complex_radix2_inverse()

Complex inverse radix2 transform

The output is to scale. :param data: an array of complex numbers :param output: array to store the output into. GSL computes the FFT

in place. So if this array is provided, the wrapper will use this array as output array. If the input and output array are identical no internal copy will be made. This works only for the complex transform types!

Optional objects will be generated by the function automatically if required

pygsl.fft.complex_radix2_inverse_float()

Float Version. See the corresponding double version. Remove the trailing _float

pygsl.fft.halfcomplex_inverse()

Half complex inverse :param data: an array of complex numbers :param n: length of the real array. From the complex input I can not

compute the original length if it was odd or even. Thus I allow to give the input here. If not given the routine will guess the input length. If the last imaginary part is zero it will assume an real output array of even length

Parameters:
  • space – a workspace of approbriate type and size

  • table – a wavetable of approbriate type and size

  • eps – epsilon to use in the comparisons (default 1e-8)

If arguments objects are not provided, they will be generated by the function automatically.

pygsl.fft.halfcomplex_inverse_float()

Float Version. See the corresponding double version. Remove the trailing _float

pygsl.fft.halfcomplex_radix2_inverse()

Half complex radix2 inverse :param data: an array of real data containing the complex data

as required by this transform. See the GSL Reference Document

pygsl.fft.halfcomplex_radix2_inverse_float()

Float Version. See the corresponding double version. Remove the trailing _float

pygsl.fft.halfcomplex_radix2_transform()

Half complex radix2 transform

The output is not scaled! :param data: an array of real data containing the complex data

as required by this transform. See the GSL Reference Document

pygsl.fft.halfcomplex_radix2_transform_float()

Float Version. See the corresponding double version. Remove the trailing _float

pygsl.fft.halfcomplex_radix2_unpack()

Unpack the frequency data from the output of a real radix 2 transform to an approbriate complex array.

pygsl.fft.halfcomplex_radix2_unpack_float()

Float Version. See the corresponding double version. Remove the trailing _float

pygsl.fft.halfcomplex_transform()

Half complex transform

The output is not scaled! :param data: an array of complex numbers :param n: length of the real array. From the complex input I can not

compute the original length if it was odd or even. Thus I allow to give the input here. If not given the routine will guess the input length. If the last imaginary part is zero it will assume an real output array of even length

Parameters:
  • space – a workspace of approbriate type and size

  • table – a wavetable of approbriate type and size

  • eps – epsilon to use in the comparisons (default 1e-8)

If arguments objects are not provided, they will be generated by the function automatically.

pygsl.fft.halfcomplex_transform_float()

Float Version. See the corresponding double version. Remove the trailing _float

pygsl.fft.halfcomplex_wavetable()

Half Complex Wavetable

Stores the precomputed trigonometric functions

Parameters:

n – Length of the data to transform

pygsl.fft.halfcomplex_wavetable_float()

Half Complex Wavetable

Stores the precomputed trigonometric functions

Parameters:

n – Length of the data to transform

pygsl.fft.real_radix2_transform()

Real radix2 transform :param data: an array of real numbers

Returns:

the transformed data in its special storage. Halfcomplex data in an real array. Use halfcomplex_radix2_unpack() to transform it into an approbriate complex array.

pygsl.fft.real_radix2_transform_float()

Float Version. See the corresponding double version. Remove the trailing _float

pygsl.fft.real_transform()

Real transform :param data: an array of real numbers :param space: a workspace of approbriate type and size :param table: a wavetable of approbriate type and size :param output: array to store the output into. GSL computes the FFT

in place. So if this array is provided, the wrapper will use this array as output array. If the input and output array are identical no internal copy will be made. This works only for the complex transform types!

Optional objects will be generated by the function automatically if required

pygsl.fft.real_transform_float()

Float Version. See the corresponding double version. Remove the trailing _float

class pygsl.fft.complex_wavetable

Bases:

Complex Wavetable

Stores the precomputed trigonometric functions

Parameters:

n – Length of the data to transform

class pygsl.fft.complex_wavetable_float

Bases:

Complex Wavetable

Stores the precomputed trigonometric functions

Parameters:

n – Length of the data to transform

class pygsl.fft.complex_workspace

Bases:

Complex Workspace

Needed as working space for mixed radix routines.

Parameters:

n – Length of the data to transform

class pygsl.fft.complex_workspace_float

Bases:

Complex Workspace

Needed as working space for mixed radix routines.

Parameters:

n – Length of the data to transform

class pygsl.fft.real_wavetable

Bases:

Real Wavetable

Stores the precomputed trigonometric functions

Parameters:

n – Length of the data to transform

class pygsl.fft.real_wavetable_float

Bases:

Real Wavetable

Stores the precomputed trigonometric functions

Parameters:

n – Length of the data to transform

class pygsl.fft.real_workspace

Bases:

Real Workspace

Needed as working space for mixed radix routines.

Parameters:

n – Length of the data to transform

class pygsl.fft.real_workspace_float

Bases:

Real Workspace

Needed as working space for mixed radix routines.

Parameters:

n – Length of the data to transform

integrate

Routines for numerical integration

This modules defines routines for performing numerical integration (quadrature) of a function in one dimension. There are routines for adaptive and non-adaptive integration of general functions, with specialised routines for specific cases. These include integration over infinite and semi-infinite ranges, singular integrals, including logarithmic singularities, computation of Cauchy principal values and oscillatory integrals. The library reimplements the algorithms used in QUADPACK, a numerical integration package written by Piessens, Doncker-Kapenga, Uberhuber and Kahaner. Fortran code for QUADPACK is available on Netlib.

pygsl.integrate.qag(f, a, b, epsabs, epsrel, limit, key, workspace)[source]

The QAG algorithm is a simple adaptive integration procedure. The integration region is divided into subintervals, and on each iteration the subinterval with the largest estimated error is bisected. This reduces the overall error rapidly, as the subintervals become concentrated around local difficulties in the integrand. These subintervals are managed by a `gsl_integration_workspace’ struct, which handles the memory for the subinterval ranges, results and error estimates.

This function applies an integration rule adaptively until an estimate of the integral of f over (a,b) is achieved within the desired absolute and relative error limits, EPSABS and EPSREL. The function returns the final approximation, RESULT, and an estimate of the absolute error, ABSERR. The integration rule is determined by the value of KEY, which should be chosen from the following symbolic names,

GAUSS15 GAUSS21 GAUSS31 GAUSS41 GAUSS51 GAUSS61

corresponding to the 15, 21, 31, 41, 51 and 61 point Gauss-Kronrod rules. The higher-order rules give better accuracy for smooth functions, while lower-order rules save time when the function contains local difficulties, such as discontinuities.

On each iteration the adaptive integration strategy bisects the with the largest error estimate. The subintervals and their results are stored in the memory provided by WORKSPACE. The maximum number of subintervals is given by LIMIT, which may not exceed the allocated size of the workspace.

inputf, a, b, epsabs, epsrel, limit, key, workspace

f … gsl_function

pygsl.integrate.qagi(f, epsabs, epsrel, limit, workspace)[source]
This function computes the integral of the function F over the

infinite interval (-infty,+infty). The integral is mapped onto the interval (0,1] using the transformation x = (1-t)/t,

int_{-infty}^{+infty} dx f(x) =

int_0^1 dt (f((1-t)/t) + f((-1+t)/t))/t^2.

It is then integrated using the QAGS algorithm. The normal 21-point Gauss-Kronrod rule of QAGS is replaced by a 15-point rule, because the transformation can generate an integrable singularity at the origin. In this case a lower-order rule is more efficient.

inputf, epsabs, epsrel, limit, workspace

f … gsl_function

pygsl.integrate.qagil(f, b, epsabs, epsrel, limit, workspace)[source]
This function computes the integral of the function F over the

semi-infinite interval (-infty,b). The integral is mapped onto the region (0,1] using the transformation x = b - (1-t)/t,

int_{+infty}^{b} dx f(x) =

int_0^1 dt f(b - (1-t)/t)/t^2

and then integrated using the QAGS algorithm.

inputf, b, epsabs, epsrel, limit, workspace

f … gsl_function

pygsl.integrate.qagiu(f, a, epsabs, epsrel, limit, workspace)[source]

This function computes the integral of the function F over the semi-infinite interval (a,+infty). The integral is mapped onto the interval (0,1] using the transformation x = a + (1-t)/t,

int_{a}^{+infty} dx f(x) =

int_0^1 dt f(a + (1-t)/t)/t^2

and then integrated using the QAGS algorithm.

inputf, a, epsabs, epsrel, limit, workspace

f … gsl_function

pygsl.integrate.qagp(f, pts, epsabs, epsrel, limit, workspace)[source]

This function applies the adaptive integration algorithm QAGS taking account of the user-supplied locations of singular points. The array PTS of length NPTS should contain the endpoints of the integration ranges defined by the integration region and locations of the singularities. For example, to integrate over the region (a,b) with break-points at x_1, x_2, x_3 (where a < x_1 < x_2 < x_3 < b) the following PTS array should be used

pts[0] = a pts[1] = x_1 pts[2] = x_2 pts[3] = x_3 pts[4] = b

with NPTS = 5.

If you know the locations of the singular points in the integration region then this routine will be faster than `QAGS’.

inputf, pts, epsabs, epsrel, limit, workspace

f … gsl_function

pygsl.integrate.qags(f, a, b, epsabs, epsrel, limit, workspace)[source]
This function applies the Gauss-Kronrod 21-point integration rule

adaptively until an estimate of the integral of f over (a,b) is achieved within the desired absolute and relative error limits, EPSABS and EPSREL. The results are extrapolated using the epsilon-algorithm, which accelerates the convergence of the integral in the presence of discontinuities and integrable singularities. The function returns the final approximation from the extrapolation, RESULT, and an estimate of the absolute error, ABSERR. The subintervals and their results are stored in the memory provided by WORKSPACE. The maximum number of subintervals is given by LIMIT, which may not exceed the allocated size of the workspace.

inputf.get_ptr(), a, b, epsabs, epsrel, limit, key, workspace

f … gsl_function

pygsl.integrate.qawc(f, a, b, c, epsabs, epsrel, limit, workspace)[source]

This function computes the Cauchy principal value of the integral of f over (a,b), with a singularity at C,

I = int_a^b dx f(x) / (x - c)

The adaptive bisection algorithm of QAG is used, with modifications to ensure that subdivisions do not occur at the singular point x = c. When a subinterval contains the point x = c or is close to it then a special 25-point modified Clenshaw-Curtis rule is used to control the singularity. Further away from the singularity the algorithm uses an ordinary 15-point Gauss-Kronrod integration rule.

inputf, a, b, c, epsabs, epsrel, limit, workspace

f … gsl_function

pygsl.integrate.qawf(f, a, epsabs, limit, workspace, cycleworkspace, qwao_table)[source]

This function attempts to compute a Fourier integral of the

function F over the semi-infinite interval [a,+infty).

I = int_a^{+infty} dx f(x) sin(omega x) I = int_a^{+infty} dx f(x) cos(omega x)

The parameter omega is taken from the table WF (the length L can take any value, since it is overridden by this function to a value appropriate for the fourier integration). The integral is computed using the QAWO algorithm over each of the subintervals,

C_1 = [a, a + c] C_2 = [a + c, a + 2 c] … = … C_k = [a + (k-1) c, a + k c]

where c = (2 floor(|\omega|) + 1) pi/|\omega|. The width c is chosen to cover an odd number of periods so that the contributions from the intervals alternate in sign and are monotonically decreasing when F is positive and monotonically decreasing. The sum of this sequence of contributions is accelerated using the epsilon-algorithm.

This function works to an overall absolute tolerance of ABSERR. The following strategy is used: on each interval C_k the algorithm tries to achieve the tolerance

TOL_k = u_k abserr

where u_k = (1 - p)p^{k-1} and p = 9/10. The sum of the geometric series of contributions from each interval gives an overall tolerance of ABSERR.

If the integration of a subinterval leads to difficulties then the accuracy requirement for subsequent intervals is relaxed,

TOL_k = u_k max(abserr, max_{i<k}{E_i})

where E_k is the estimated error on the interval C_k.

The subintervals and their results are stored in the memory provided by WORKSPACE. The maximum number of subintervals is given by LIMIT, which may not exceed the allocated size of the workspace. The integration over each subinterval uses the memory provided by CYCLE_WORKSPACE as workspace for the QAWO algorithm.

inputf, a, b, qwas_table, epsabs, epsrel, limit, workspace

qwao_table

f … gsl_function

pygsl.integrate.qawo(f, a, epsabs, epsrel, limit, workspace, qwao_table)[source]
This function uses an adaptive algorithm to compute the integral of

f over (a,b) with the weight function sin(omega x) or cos(omega x) defined by the table WF.

I = int_a^b dx f(x) sin(omega x) I = int_a^b dx f(x) cos(omega x)

The results are extrapolated using the epsilon-algorithm to accelerate the convergence of the integral. The function returns the final approximation from the extrapolation, RESULT, and an estimate of the absolute error, ABSERR. The subintervals and their results are stored in the memory provided by WORKSPACE. The maximum number of subintervals is given by LIMIT, which may not exceed the allocated size of the workspace.

Those subintervals with “large” widths d, domega > 4 are computed using a 25-point Clenshaw-Curtis integration rule, which handles the oscillatory behavior. Subintervals with a “small” width domega < 4 are computed using a 15-point Gauss-Kronrod integration.

inputf, a, b, qwas_table, epsabs, epsrel, limit, workspace

qwao_table

f … gsl_function

class pygsl.integrate.qawo_table(omega, L, sine, n)[source]

Bases: _workspace

Table for qawo

This class manages space for a `qawo_table’

and its associated workspace describing a sine or cosine

weight function W(x) with the parameters (omega, L),

W(x) = sin(omega x) W(x) = cos(omega x)

The parameter L must be the length of the interval over which the function will be integrated L = b - a. The choice of sine or cosine is made with the parameter SINE which should be chosen from one of the two following symbolic values:

COSINE SINE

The `gsl_integration_qawo_table’ is a table of the trigonometric coefficients required in the integration process. The parameter N determines the number of levels of coefficients that are computed. Each level corresponds to one bisection of the interval L, so that N levels are sufficient for subintervals down to the length L/2^n. The integration routine `gsl_integration_qawo’ returns the error `GSL_ETABLE’ if the number of levels is insufficient for the requested accuracy.

input : omega, L, sine, n

set(omega, L, sine, n)[source]

Change the parameters OMEGA, L and SINE

set_length(L)[source]

Change the length parameter L

pygsl.integrate.qaws(f, a, b, qwas_table, epsabs, epsrel, limit, workspace)[source]
This function computes the integral of the function f(x) over the

interval (a,b) with the singular weight function (x-a)^alpha (b-x)^beta log^mu (x-a) log^nu (b-x). The parameters of the weight function (alpha, beta, mu, nu) are taken from the table T. The integral is,

I = int_a^b dx f(x) (x-a)^alpha (b-x)^beta log^mu (x-a) log^nu (b-x).

The adaptive bisection algorithm of QAG is used. When a subinterval contains one of the endpoints then a special 25-point modified Clenshaw-Curtis rule is used to control the singularities. For subintervals which do not include the endpoints an ordinary 15-point Gauss-Kronrod integration rule is used.

inputf, a, b, qwas_table, epsabs, epsrel, limit, workspace

f … gsl_function

class pygsl.integrate.qaws_table(alpha, beta, mu, nu)[source]

Bases: _workspace

Integration table for qaws

This class allocates space for a `gsl_integration_qaws_table’ struct and associated workspace describing a singular weight function W(x) with the parameters (alpha, beta, mu, nu),

W(x) = (x-a)^alpha (b-x)^beta log^mu (x-a) log^nu (b-x)

where alpha < -1, beta < -1, and mu = 0, 1, nu = 0, 1. The weight function can take four different forms depending on the

values of mu and nu,

W(x) = (x-a)^alpha (b-x)^beta (mu = 0, nu = 0) W(x) = (x-a)^alpha (b-x)^beta log(x-a) (mu = 1, nu = 0) W(x) = (x-a)^alpha (b-x)^beta log(b-x) (mu = 0, nu = 1) W(x) = (x-a)^alpha (b-x)^beta log(x-a) log(b-x) (mu = 1, nu = 1)

The singular points (a,b) do not have to be specified until the integral is computed, where they are the endpoints of the integration range.

The function returns a pointer to the newly allocated `gsl_integration_qaws_table’ if no errors were detected, and 0 in the case of error.

set(alpha, beta, mu, nu)[source]

This function modifies the parameters (alpha, beta, mu, nu)

input : alpha, beta, mu, nu

pygsl.integrate.qng(f, a, b, epsabs, epsrel)[source]

This function applies the Gauss-Kronrod 10-point, 21-point, 43-point and 87-point integration rules in succession until an estimate of the integral of f over (a,b) is achieved within the desired absolute and relative error limits, EPSABS and EPSREL. The function returns the final approximation, RESULT, an estimate of the absolute error, ABSERR and the number of function evaluations used, NEVAL. The Gauss-Kronrod rules are designed in such a way that each rule uses all the results of its predecessors, in order to minimize the total number of function evaluations.

inputf, a, b, epsabs, epsrel

f … gsl_function

class pygsl.integrate.workspace(size)[source]

Bases: _workspace

Workspace for integratinn

This class provides a workspace sufficient to hold N double precision intervals, their integration results and error estimates.

inputsize

size … size of the workspace

get_size()[source]

Get the size of the workspace

rng

GSL Random-number generators implemented as C extension types.

Use rng(Random-number generator types) to create an instance of a new random generator. All known random generator types are listed below. The different distributions are methods of the random generator instances. Consult the GSL manual for full details.

Random-number generator types:
  • borosh13

  • cmrg

  • coveyou

  • fishman18

  • fishman20

  • fishman2x

  • gfsr4

  • knuthran

  • knuthran2

  • lecuyer21

  • minstd

  • mrg

  • mt19937

  • mt19937_1999

  • r250

  • ran0

  • ran1

  • ran2

  • ran3

  • rand

  • rand48

  • random128_bsd

  • random128_glibc2

  • random128_libc5

  • random256_bsd

  • random256_glibc2

  • random256_libc5

  • random32_bsd

  • random32_glibc2

  • random32_libc5

  • random64_bsd

  • random64_glibc2

  • random64_libc5

  • random8_bsd

  • random8_glibc2

  • random8_libc5

  • random_bsd

  • random_glibc2

  • random_libc5

  • randu

  • ranf

  • ranlux

  • ranlux389

  • ranlxd1

  • ranlxd2

  • ranlxs0

  • ranlxs1

  • ranlxs2

  • ranmar

  • slatec

  • taus

  • taus2

  • taus113

  • transputer

  • tt800

  • uni

  • uni32

  • vax

  • waterman14

  • zuf

pygsl.rng.bernoulli_pdf()

Computes the probability density p(k) at k for the bernoulli distribution with probability parameter P. Usage: p = bernoulli_pdf(k, P)

k can be an array. In this case this function will iterate over it and

return an array of p(k).

pygsl.rng.beta_pdf()

Computes the probability density p(x) at X for the beta distribution Usage: p = beta_pdf(x, a, b)

x can be an array. In this case this function will iterate over it and

return an array of p(x).

pygsl.rng.binomial_pdf()
Computes the probability density p(k) of obtaining K from a

binomial distribution with parameters P and N

Usage: p = binomial_pdf(k, P, N)

k can be an array. In this case this function will iterate over it and

return an array of p(k).

pygsl.rng.bivariate_gaussian_pdf()

Computes the probability density p(x,y) at (X,Y) for a bivariate gaussian distribution with standard deviations SIGMA_X, SIGMA_Y and correlation coefficient RHO Usage : p_x, p_y = bivariate_gaussian_pdf(x, y, sigma_x, sigma_y, rho)

If x and y are arrays, the function will iterate over them and return arrays

pygsl.rng.borosh13()
pygsl.rng.cauchy_pdf()

Computes the probability density p(x) at X for a Cauchy distribution with scale parameter A Usage: p = cauchy_pdf(x, a)

x can be an array. In this case this function will iterate over it and

return an array of p(x).

pygsl.rng.chisq_pdf()

Computes the probability density p(x) at X for the chisq distribution Usage: p = chisq_pdf(x, nu)

x can be an array. In this case this function will iterate over it and

return an array of p(x).

pygsl.rng.cmrg()
pygsl.rng.coveyou()
pygsl.rng.dirichlet_lnpdf()
Computes logarithmic of the probability density

p( heta_1, … , heta_K) at THETA[K] for a Dirichlet distribution with parameters ALPHA[K]

Usage:

pygsl.rng.dirichlet_pdf()

Computes the probability density p( heta_1, … , heta_K) at THETA[K] for a Dirichlet distribution with parameters ALPHA[K] Usage:

pygsl.rng.env_setup()

This function reads the environment variables `GSL_RNG_TYPE’ and `GSL_RNG_SEED’. The environment variable `GSL_RNG_TYPE’ should be the name of a generator, such as `taus’ or `mt19937’. The environment variable `GSL_RNG_SEED’ should contain the desired seed value. It is converted to an `unsigned long int’ using the C library function `strtoul’.

pygsl.rng.erlang_pdf()
pygsl.rng.exponential_pdf()

Computes the probability density p(x) at X for an exponential distribution with mean MU Usage: p = exponential_pdf(x, mu)

x can be an array. In this case this function will iterate over it and

return an array of p(x).

pygsl.rng.exppow_pdf()

Computes the probability density p(x) at X for an exponential power distribution with scale parameter A and exponent B Usage: p = exppow_pdf(x, a, b)

x can be an array. In this case this function will iterate over it and

return an array of p(x).

pygsl.rng.fdist_pdf()

Computes the probability density p(x) at X for the F-distribution with NU degrees of freedom. Usage: p = fdist_pdf(x, nu1)

x can be an array. In this case this function will iterate over it and

return an array of p(x).

pygsl.rng.fishman18()
pygsl.rng.fishman20()
pygsl.rng.fishman2x()
pygsl.rng.flat_pdf()

Computes the probability density p(x) at X for the flat (uniform) distribution Usage: p = flat_pdf(x, a, b)

x can be an array. In this case this function will iterate over it and

return an array of p(x).

pygsl.rng.gamma_pdf()

Computes the probability density p(x) at X for the gamma distribution Usage: p = gamma_pdf(x, a, b)

x can be an array. In this case this function will iterate over it and

return an array of p(x).

pygsl.rng.gaussian_pdf()

Computes the probability density p(x) at x for a Gaussian distribution with standard deviation SIGMA Usage: p = gaussian_pdf(x, sigma)

x can be an array. In this case this function will iterate over it and

return an array of p(x).

pygsl.rng.gaussian_tail_pdf()
Computes the probability density p(x) at X for a Gaussian tail

distribution with standard deviation SIGMA and lower limit A Usage: p = gaussian_tail_pdf(x, a, sigma)

x can be an array. In this case this function will iterate over it and

return an array of p(x).

pygsl.rng.geometric_pdf()
Computes the probability density p(k) of obtaining K from a

geometric distribution with parameters P

Usage: p = geometric_pdf(k, P)

k can be an array. In this case this function will iterate over it and

return an array of p(k).

pygsl.rng.gfsr4()
pygsl.rng.gumbel1_pdf()

Computes the probability density p(x) at X for the gumbel1 distribution with parameters a and b Usage: p = gumbel1_pdf(x, a, b)

x can be an array. In this case this function will iterate over it and

return an array of p(x).

pygsl.rng.gumbel2_pdf()

Computes the probability density p(x) at X for the gumbel2 distribution with parameters a and b Usage: p = gumbel2_pdf(x, a, b)

x can be an array. In this case this function will iterate over it and

return an array of p(x).

pygsl.rng.hypergeometric_pdf()
Computes the probability density p(k) of obtaining K from a

hypergeometric distribution with parameters N1, N2, N3

Usage: p = hypergeometric_pdf(k, n1, n2, n3)

k can be an array. In this case this function will iterate over it and

return an array of p(k).

pygsl.rng.knuthran()
pygsl.rng.knuthran2()
pygsl.rng.knuthran2002()
pygsl.rng.landau_pdf()

Computes the probability density p(x) at X for the Landau distribution using an approximation. Usage: p = landau_pdf(x)

x can be an array. In this case this function will iterate over it and

return an array of p(x).

pygsl.rng.laplace_pdf()

Computes the probability density p(x) at X for a Laplace distribution with mean A Usage: p = laplace_pdf(x, a)

x can be an array. In this case this function will iterate over it and

return an array of p(x).

pygsl.rng.lecuyer21()
pygsl.rng.list_available_rngs()
pygsl.rng.logarithmic_pdf()
Computes the probability density p(k) of obtaining K from a

logarithmic distribution with parameters P and N

Usage: p = logarithmic_pdf(k, P, N)

k can be an array. In this case this function will iterate over it and

return an array of p(k).

pygsl.rng.logistic_pdf()

Computes the probability density p(x) at X for the logistic distribution Usage: p = logistic_pdf(x, a)

x can be an array. In this case this function will iterate over it and

return an array of p(x).

pygsl.rng.lognormal_pdf()

Computes the probability density p(x) at X for the log normal distribution Usage: p = lognormal_pdf(x, zeta, sigma)

x can be an array. In this case this function will iterate over it and

return an array of p(x).

pygsl.rng.minstd()
pygsl.rng.mrg()
pygsl.rng.mt19937()
pygsl.rng.mt19937_1998()
pygsl.rng.mt19937_1999()
pygsl.rng.multinomial_lnpdf()
Computes the probability P(n_1, n_2, …, n_K) of sampling N[K]

from a multinomial distribution with parameters P[K].

Usage: p = multinomial_pdf(phi, n)

phi … probability distribution over possible events. n … an two dimensional array, where each pdf is stored in one row

pygsl.rng.multinomial_pdf()
Computes the probability P(n_1, n_2, …, n_K) of sampling N[K]

from a multinomial distribution with parameters P[K].

Usage: p = multinomial_pdf(phi, n)

phi … probability distribution over possible events. n … an two dimensional array, where each pdf is stored in one row

pygsl.rng.negative_binomial_pdf()
Computes the probability density p(k) of obtaining K from a

negative binomial distribution with parameters P and N.

Usage: p = negative_binomial_pdf(k, P, N)

k can be an array. In this case this function will iterate over it and

return an array of p(k).

pygsl.rng.pareto_pdf()

Computes the probability density p(x) at X for the pareto distribution with exponent a and scale b Usage: p = pareto_pdf(x, a)

x can be an array. In this case this function will iterate over it and

return an array of p(x).

pygsl.rng.pascal_pdf()
Computes the probability density p(k) of obtaining K from a

pascal distribution with parameters P and N

Usage: p = pascal_pdf(k, P, N)

k can be an array. In this case this function will iterate over it and

return an array of p(k).

pygsl.rng.poisson_pdf()

Computes the probability density p(k) at k for the poisson distribution with mean MU Usage: p = poisson_pdf(k, mu)

k can be an array. In this case this function will iterate over it and

return an array of p(k).

pygsl.rng.r250()
pygsl.rng.ran0()
pygsl.rng.ran1()
pygsl.rng.ran2()
pygsl.rng.ran3()
pygsl.rng.rand()
pygsl.rng.rand48()
pygsl.rng.random128_bsd()
pygsl.rng.random128_glibc2()
pygsl.rng.random128_libc5()
pygsl.rng.random256_bsd()
pygsl.rng.random256_glibc2()
pygsl.rng.random256_libc5()
pygsl.rng.random32_bsd()
pygsl.rng.random32_glibc2()
pygsl.rng.random32_libc5()
pygsl.rng.random64_bsd()
pygsl.rng.random64_glibc2()
pygsl.rng.random64_libc5()
pygsl.rng.random8_bsd()
pygsl.rng.random8_glibc2()
pygsl.rng.random8_libc5()
pygsl.rng.random_bsd()
pygsl.rng.random_glibc2()
pygsl.rng.random_libc5()
pygsl.rng.randu()
pygsl.rng.ranf()
pygsl.rng.ranlux()
pygsl.rng.ranlux389()
pygsl.rng.ranlxd1()
pygsl.rng.ranlxd2()
pygsl.rng.ranlxs0()
pygsl.rng.ranlxs1()
pygsl.rng.ranlxs2()
pygsl.rng.ranmar()
pygsl.rng.rayleigh_pdf()

Computes the probability density p(x) at X for a Rayleigh distribution with scale parameter SIGMA Usage: p = rayleigh_pdf(x, a, sigma)

x can be an array. In this case this function will iterate over it and

return an array of p(x).

pygsl.rng.rayleigh_tail_pdf()

Computes the probability density p(x) at X for a Rayleigh tail distribution with scale parameter SIGMA and lower limit A. Usage: p = rayleigh_tail_pdf(x, a, sigma)

x can be an array. In this case this function will iterate over it and

return an array of p(x).

pygsl.rng.rng()

RNG Object Constructor Usage: rng(rng_type) Input:

rng_type … one of the many rng types GSL provides.

pygsl.rng.slatec()
pygsl.rng.taus()
pygsl.rng.taus113()
pygsl.rng.taus2()
pygsl.rng.tdist_pdf()

Computes the probability density p(x) at X for the t-distribution with NU1 and NU2 degrees of freedom. Usage: p = tdist_pdf(x, nu1, nu2)

x can be an array. In this case this function will iterate over it and

return an array of p(x).

pygsl.rng.transputer()
pygsl.rng.tt800()
pygsl.rng.ugaussian_pdf()
Computes the probability density p(x) at x for a Gaussian distribution

with standard deviation SIGMA=1 Usage: p = ugaussian_pdf(x)

x can be an array. In this case this function will iterate over it and

return an array of p(x).

pygsl.rng.ugaussian_tail_pdf()
Computes the probability density p(x) at X for a Gaussian tail

distribution with standard deviation SIGMA=1 and lower limit A Usage: p = gaussian_tail_pdf(x, a, sigma)

x can be an array. In this case this function will iterate over it and

return an array of p(x).

pygsl.rng.uni()
pygsl.rng.uni32()
pygsl.rng.vax()
pygsl.rng.waterman14()
pygsl.rng.weibull_pdf()

Computes the probability density p(x) at X for the weibull distribution with scale a and exponent b Usage: p = weibull_pdf(x, a)

x can be an array. In this case this function will iterate over it and

return an array of p(x).

pygsl.rng.zuf()
class pygsl.rng.mt19937

Bases:

qrng

A quasi-random sequence progressively covers a d-dimensional space with a set of points that are uniformly distributed. Quasi-random sequences are also known as low-discrepancy sequences. The quasi-random sequence generators use an interface that is similar to the interface for random number generators.

Currently two implementations are available: sobol and niederreiter_base_2.

The generators provide the following methods:

__init__(dim) … intalizes the random generator to dim dimensions. __call__(sample) … returns a two dimensional array with the shape

(sample, dim).

init() … initalizes the random generator to the original state. name() … get the name of the used generator __copy___() … returns an identical copy of the current generator.

pygsl.qrng.niederreiter_base_2(dimension)[source]

This generator uses the algorithm described in Bratley, Fox, Niederreiter, `ACM Trans. Model. Comp. Sim.’ 2, 195 (1992). It is valid up to 12 dimensions.

pygsl.qrng.sobol(dimension)[source]

This generator uses the Sobol sequence described in Antonov, Saleev, `USSR Comput. Maths. Math. Phys.’ 19, 252 (1980). It is valid up to 40 dimensions.

statistics

monte

Wrapper for the Monte carlo integrators provided by GSL.

class pygsl.monte.miser(dim)[source]

Bases: _Monte

get_alpha()[source]
get_dither()[source]
get_estimate_frac()[source]
get_min_calls()[source]
get_min_calls_per_bisection()[source]
set_alpha(arg1)[source]
set_dither(arg1)[source]
set_estimate_frac(arg1)[source]
set_min_calls(arg1)[source]
set_min_calls_per_bisection(arg1)[source]
class pygsl.monte.plain(dim)[source]

Bases: _Monte

class pygsl.monte.vegas(dim)[source]

Bases: _Monte

get_alpha()[source]
get_chisq()[source]
get_iterations()[source]
get_mode()[source]
get_ostream()[source]
get_result()[source]
get_sigma()[source]
get_stage()[source]
get_verbose()[source]
set_alpha(arg1)[source]
set_chisq(arg1)[source]
set_iterations(arg1)[source]
set_mode(arg1)[source]
set_ostream(arg1)[source]
set_result(arg1)[source]
set_sigma(arg1)[source]
set_stage(arg1)[source]
set_verbose(arg1)[source]
class pygsl.monte._Monte(dim)[source]

Bases: object

Base Wrapper class. This class does not implement any solver itself, so you should use a derived class eg. miser, vegas, or plain.

__del__()[source]
get_name()[source]

To be compatible with the other solvers I added this method

init()[source]

(Re)initialises the solver

integrate(func, xl, xu, ncalls, r)[source]
Input:

func … the function to solve. Must be a gsl_monte_function xl … the lower limits for the integration xu … the upper limits for the integration ncalls … number of calls r … random generator from pygsl.rng

Output:

val … the value abserr … the error estimate for that value

siman

Wrapper for the Simulated Annealing Solver provided by GSL.

The simulated annealing algorithm takes random walks through the problem space, looking for points with low energies; in these random walks, the probability of taking a step is determined by the Boltzmann distribution,

\[p = e^{-(E_{i+1} - E_i)/(kT)}\]

if E_{i+1} > E_i, and p = 1 when E_{i+1} <= E_i.

In other words, a step will occur if the new energy is lower. If the new

energy is higher, the transition can still occur, and its likelihood is proportional to the temperature T and inversely proportional to the energy difference E_{i+1} - E_i.

The temperature T is initially set to a high value, and a random walk is

carried out at that temperature. Then the temperature is lowered very slightly according to a “cooling schedule”, for example: T -> T/mu_T where mu_T is slightly greater than 1.

The slight probability of taking a step that gives higher energy is what

allows simulated annealing to frequently get out of local minima.

This wrapper does not follow the GSL interface as closely as the other wrappers in this package. Instead it expects an object describing the problem with the required methods. NumericEnsemble illustrates the necessary methods.

The function solve does the real job.

Have a look in the examples directory for the pythonic version of the simple problem as described in the GSL reference document.

class pygsl.siman.NumericEnsemble[source]

Bases: object

A base class implementation to support the use of numeric arrays as configurations. You must overload the following functions

in a derived class.

If you want, that the solver prints it status to the stdout add a * Print() method.

Clone()[source]

Make a clone of the current object. Please be careful how you step and clone so that your objects are different!

Output:

clone … a identical clone of this object.

abstract EFunc() float[source]

Calculate the energy of the current status.

Returns:

a Python float of the current energy

Return type:

energy

GetData()[source]
abstract Metric(other) float[source]

Calculate the distance between this object and the other.

Parameters:

other – a instance of the same type

Returns:

a python float for the distance between this instance

and the other.

Return type:

length

Print()[source]

Print the current state of the ensemble

SetData(data)[source]
abstract Step(rng, step_size) None[source]

Take a step

Parameters:
  • rng – a pygsl.rng instance

  • step_size – a python float for the step size to be taken

pygsl.siman.solve()

Simulated annealing driver.

Usage: result = solve(r, x0, …)

Parameters:
  • r – a random generator from pygsl.rng

  • x0

    a configuration. It must be an object providing the following .. method:: * EFunc()

    \* Metric()
    \* Step()
    \* Clone()

    If you want to use the print functionality you must provide the following method:

    \* Print()

Keyword Arguments:
  • 200 (n_tries =) – how many points to try for each step

  • 10 (step_size =) – how many iterations at each temperature?

  • 10

    max step size in the random walk

    parameters for the Boltzmann distribution

  • 1.0 (k =) – Boltzmann constant

  • 0.002 (t_initial =) – initial temperature

  • 1.005 (mu_t =) – damping factor for the temperature

  • 2.0e-6 (t_min =)

  • 0 (do_print =) – print the status of the annealing process (== 0: do not print) ( > 0: print)

Returns:

a object of type x0 with the final value.

Return type:

result

odeiv2

Wrapper for the ODEIV2 module

class pygsl.odeiv2.system

Bases: SwigPyObject

::pygsl_odeiv2_system

acquire()

acquires ownership of the pointer

append(object, /)

appends another ‘this’ object

disown()

releases ownership of the pointer

next()

returns the next ‘this’ object

own()

returns/sets ownership of the pointer

set_dimension(system self, size_t dimension) gsl_error_flag_drop
Parameters:

dimension (size_t)

set_func(system self, PyObject * cb) gsl_error_flag_drop
Parameters:

cb (PyObject *)

set_jacobian(system self, PyObject * cb) gsl_error_flag_drop
Parameters:

cb (PyObject *)

this
thisown
class pygsl.odeiv2.pygsl_odeiv2_step

Bases: SwigPyObject

::pygsl_odeiv2_step

acquire()

acquires ownership of the pointer

append(object, /)

appends another ‘this’ object

apply(pygsl_odeiv2_step self, double t, double h, PyObject * y_o, PyObject * dydt_in_o, PyObject * dydt_out_o, system dydt) PyObject *
Parameters:
  • t (double)

  • h (double)

  • y_o (PyObject *)

  • dydt_in_o (PyObject *)

  • dydt_out_o (PyObject *)

  • dydt (pygsl_odeiv2_system *)

disown()

releases ownership of the pointer

name(pygsl_odeiv2_step self) char const *
next()

returns the next ‘this’ object

order(pygsl_odeiv2_step self) unsigned int
own()

returns/sets ownership of the pointer

reset(pygsl_odeiv2_step self) gsl_error_flag_drop
this
thisown
class pygsl.odeiv2.pygsl_odeiv2_control

Bases: SwigPyObject

::pygsl_odeiv2_control

acquire()

acquires ownership of the pointer

append(object, /)

appends another ‘this’ object

disown()

releases ownership of the pointer

errlevel(pygsl_odeiv2_control self, double const y, double const dydt, double const h, size_t const ind, double * errlev) gsl_error_flag_drop
Parameters:
  • y (double const)

  • dydt (double const)

  • h (double const)

  • ind (size_t const)

  • errlev (double *)

hadjust(pygsl_odeiv2_control self, pygsl_odeiv2_step s, PyObject * y_o, PyObject * yerr_o, PyObject * dydt_o, double h_in) PyObject *
Parameters:
  • s (pygsl_odeiv2_step *)

  • y_o (PyObject *)

  • yerr_o (PyObject *)

  • dydt_o (PyObject *)

  • h_in (double)

init(pygsl_odeiv2_control self, double eps_abs, double eps_rel, double a_y, double a_dydt) gsl_error_flag_drop
Parameters:
  • eps_abs (double)

  • eps_rel (double)

  • a_y (double)

  • a_dydt (double)

name(pygsl_odeiv2_control self) char const *
next()

returns the next ‘this’ object

own()

returns/sets ownership of the pointer

this
thisown
class pygsl.odeiv2.pygsl_odeiv2_evolve

Bases: SwigPyObject

::pygsl_odeiv2_evolve

acquire()

acquires ownership of the pointer

append(object, /)

appends another ‘this’ object

apply(pygsl_odeiv2_evolve self, pygsl_odeiv2_control con, pygsl_odeiv2_step step, system sys, double const t_in, double const t1, double const h_in, PyObject * y_in_o) PyObject *
Parameters:
  • con (pygsl_odeiv2_control *)

  • step (pygsl_odeiv2_step *)

  • sys (pygsl_odeiv2_system const *)

  • t_in (double const)

  • t1 (double const)

  • h_in (double const)

  • y_in_o (PyObject *)

apply_fixed_step(pygsl_odeiv2_evolve self, pygsl_odeiv2_control con, pygsl_odeiv2_step step, system sys, double const t_in, double const h0, PyObject * y_in_o) PyObject *
Parameters:
  • con (pygsl_odeiv2_control *)

  • step (pygsl_odeiv2_step *)

  • sys (pygsl_odeiv2_system const *)

  • t_in (double const)

  • h0 (double const)

  • y_in_o (PyObject *)

disown()

releases ownership of the pointer

get_yerr(pygsl_odeiv2_evolve self) PyObject *
next()

returns the next ‘this’ object

own()

returns/sets ownership of the pointer

reset(pygsl_odeiv2_evolve self) gsl_error_flag_drop
this
thisown
system.set_dimension(system self, size_t dimension) gsl_error_flag_drop
Parameters:

dimension (size_t)

system.set_func(system self, PyObject * cb) gsl_error_flag_drop
Parameters:

cb (PyObject *)

system.set_jacobian(system self, PyObject * cb) gsl_error_flag_drop
Parameters:

cb (PyObject *)

class pygsl.odeiv2.pygsl_odeiv2_step

::pygsl_odeiv2_step

class pygsl.odeiv2.pygsl_odeiv2_control

::pygsl_odeiv2_control

pygsl.odeiv2.hadj_nil = 0

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.odeiv2.hadj_inc = 1

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.odeiv2.hadj_dec = -1

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.odeiv2.step_rk2 = <Swig Object of type 'gsl_odeiv2_step_type *'>

Swig object carries a C/C++ instance pointer

pygsl.odeiv2.step_rk4 = <Swig Object of type 'gsl_odeiv2_step_type *'>

Swig object carries a C/C++ instance pointer

pygsl.odeiv2.step_rkf45 = <Swig Object of type 'gsl_odeiv2_step_type *'>

Swig object carries a C/C++ instance pointer

pygsl.odeiv2.step_rkck = <Swig Object of type 'gsl_odeiv2_step_type *'>

Swig object carries a C/C++ instance pointer

pygsl.odeiv2.step_rk8pd = <Swig Object of type 'gsl_odeiv2_step_type *'>

Swig object carries a C/C++ instance pointer

pygsl.odeiv2.step_rk2imp = <Swig Object of type 'gsl_odeiv2_step_type *'>

Swig object carries a C/C++ instance pointer

pygsl.odeiv2.step_rk4imp = <Swig Object of type 'gsl_odeiv2_step_type *'>

Swig object carries a C/C++ instance pointer

pygsl.odeiv2.step_bsimp = <Swig Object of type 'gsl_odeiv2_step_type *'>

Swig object carries a C/C++ instance pointer

pygsl.odeiv2.step_rk1imp = <Swig Object of type 'gsl_odeiv2_step_type *'>

Swig object carries a C/C++ instance pointer

pygsl.odeiv2.step_msadams = <Swig Object of type 'gsl_odeiv2_step_type *'>

Swig object carries a C/C++ instance pointer

pygsl.odeiv2.step_msbdf = <Swig Object of type 'gsl_odeiv2_step_type *'>

Swig object carries a C/C++ instance pointer

interpolation

Wrapper for the interpolations of gsl. This solver wraps all features as described in sec_interpolation

Difference between spline and interpolation module:

In the interpolation module the data for the independent and dependent data are kept as reference in the various objects,whereas the spline module copies these data into the internal C gsl_spline struct.

class pygsl.interpolation.akima(n)[source]

Bases: _interpolation

Akima spline with natural boundary conditions

accel_find(x)

This method performs a lookup action on the data array X_ARRAY of size SIZE, using the given accelerator A. This is how lookups are performed during evaluation of an interpolation. The function returns an index i such that `xarray[i] <= x < xarray[i+1]’.

accel_reset()
eval(x)

eval the interpolation at point x

Parameters:

x – value of the independent variable

Returns:

the interpolated value at x

Return type:

y

eval_deriv(x)
inputx

x … value of the independent variable

outputy

y … returns the value of the derivative at x

eval_deriv2(x)
inputx

x … value of the independent variable

outputy

y … the value of the second derivative at x

eval_deriv2_e(x)
inputx

x … value of the independent variable

outputflag, y

flag error flag y … the value of the second derivative at x

eval_deriv_e(x)
inputx

x … value of the independent variable

outputflag, y

flag error flag y … returns the value of the derivative at x

eval_e(x)

evaluate and flag error if it occurs

Parameters:

x – value of the independent variable

Returns:

error flag y: interpolated value at x

Return type:

flag

eval_integ(a, b)

Evaluate the integral

Parameters:
  • a – lower boundary

  • b – upper boundary

Returns:

the integral of the object over the range [a,b]

Return type:

y

eval_integ_e(a, b)
inputa, b,

a … lower boundary b … upper boundary

outputflag, y

flag error flag y … the integral of the object over the range [a,b]

init(xa, ya)

Initalise the interpolation object

Argsxa, ya

xa … array of independent values ya … array of dependent values

This method initializes this for the data (xa,ay) where ya and ya are arrays of the size, which was set, when this object was initialised. The interpolation object only keeps references to the data arrays xa and ya and and stores the static state computed from the data. The ya data array is always assumed to be strictly ordered; the behavior for other arrangements is not defined.

min_size()

Returns the minimum number of points required by the interpolation.

name()

Returns the name of the interpolation type used

class pygsl.interpolation.akima_periodic(n)[source]

Bases: _interpolation

Akima spline with periodic boundary conditions

accel_find(x)

This method performs a lookup action on the data array X_ARRAY of size SIZE, using the given accelerator A. This is how lookups are performed during evaluation of an interpolation. The function returns an index i such that `xarray[i] <= x < xarray[i+1]’.

accel_reset()
eval(x)

eval the interpolation at point x

Parameters:

x – value of the independent variable

Returns:

the interpolated value at x

Return type:

y

eval_deriv(x)
inputx

x … value of the independent variable

outputy

y … returns the value of the derivative at x

eval_deriv2(x)
inputx

x … value of the independent variable

outputy

y … the value of the second derivative at x

eval_deriv2_e(x)
inputx

x … value of the independent variable

outputflag, y

flag error flag y … the value of the second derivative at x

eval_deriv_e(x)
inputx

x … value of the independent variable

outputflag, y

flag error flag y … returns the value of the derivative at x

eval_e(x)

evaluate and flag error if it occurs

Parameters:

x – value of the independent variable

Returns:

error flag y: interpolated value at x

Return type:

flag

eval_integ(a, b)

Evaluate the integral

Parameters:
  • a – lower boundary

  • b – upper boundary

Returns:

the integral of the object over the range [a,b]

Return type:

y

eval_integ_e(a, b)
inputa, b,

a … lower boundary b … upper boundary

outputflag, y

flag error flag y … the integral of the object over the range [a,b]

init(xa, ya)

Initalise the interpolation object

Argsxa, ya

xa … array of independent values ya … array of dependent values

This method initializes this for the data (xa,ay) where ya and ya are arrays of the size, which was set, when this object was initialised. The interpolation object only keeps references to the data arrays xa and ya and and stores the static state computed from the data. The ya data array is always assumed to be strictly ordered; the behavior for other arrangements is not defined.

min_size()

Returns the minimum number of points required by the interpolation.

name()

Returns the name of the interpolation type used

pygsl.interpolation.bsearch(xa, x, index_lo, index_high)[source]

input : x, index_lo, index_high

This function returns the index i of the array X_ARRAY such that `x_array[i] <= x < x_array[i+1]’. The index is searched for in the range [INDEX_LO,INDEX_HI].

class pygsl.interpolation.cspline(n)[source]

Bases: _interpolation

Cubic spline with natural boundary conditions.

accel_find(x)

This method performs a lookup action on the data array X_ARRAY of size SIZE, using the given accelerator A. This is how lookups are performed during evaluation of an interpolation. The function returns an index i such that `xarray[i] <= x < xarray[i+1]’.

accel_reset()
eval(x)

eval the interpolation at point x

Parameters:

x – value of the independent variable

Returns:

the interpolated value at x

Return type:

y

eval_deriv(x)
inputx

x … value of the independent variable

outputy

y … returns the value of the derivative at x

eval_deriv2(x)
inputx

x … value of the independent variable

outputy

y … the value of the second derivative at x

eval_deriv2_e(x)
inputx

x … value of the independent variable

outputflag, y

flag error flag y … the value of the second derivative at x

eval_deriv_e(x)
inputx

x … value of the independent variable

outputflag, y

flag error flag y … returns the value of the derivative at x

eval_e(x)

evaluate and flag error if it occurs

Parameters:

x – value of the independent variable

Returns:

error flag y: interpolated value at x

Return type:

flag

eval_integ(a, b)

Evaluate the integral

Parameters:
  • a – lower boundary

  • b – upper boundary

Returns:

the integral of the object over the range [a,b]

Return type:

y

eval_integ_e(a, b)
inputa, b,

a … lower boundary b … upper boundary

outputflag, y

flag error flag y … the integral of the object over the range [a,b]

init(xa, ya)

Initalise the interpolation object

Argsxa, ya

xa … array of independent values ya … array of dependent values

This method initializes this for the data (xa,ay) where ya and ya are arrays of the size, which was set, when this object was initialised. The interpolation object only keeps references to the data arrays xa and ya and and stores the static state computed from the data. The ya data array is always assumed to be strictly ordered; the behavior for other arrangements is not defined.

min_size()

Returns the minimum number of points required by the interpolation.

name()

Returns the name of the interpolation type used

class pygsl.interpolation.cspline_periodic(n)[source]

Bases: _interpolation

Cubic spline with periodic boundary conditions

accel_find(x)

This method performs a lookup action on the data array X_ARRAY of size SIZE, using the given accelerator A. This is how lookups are performed during evaluation of an interpolation. The function returns an index i such that `xarray[i] <= x < xarray[i+1]’.

accel_reset()
eval(x)

eval the interpolation at point x

Parameters:

x – value of the independent variable

Returns:

the interpolated value at x

Return type:

y

eval_deriv(x)
inputx

x … value of the independent variable

outputy

y … returns the value of the derivative at x

eval_deriv2(x)
inputx

x … value of the independent variable

outputy

y … the value of the second derivative at x

eval_deriv2_e(x)
inputx

x … value of the independent variable

outputflag, y

flag error flag y … the value of the second derivative at x

eval_deriv_e(x)
inputx

x … value of the independent variable

outputflag, y

flag error flag y … returns the value of the derivative at x

eval_e(x)

evaluate and flag error if it occurs

Parameters:

x – value of the independent variable

Returns:

error flag y: interpolated value at x

Return type:

flag

eval_integ(a, b)

Evaluate the integral

Parameters:
  • a – lower boundary

  • b – upper boundary

Returns:

the integral of the object over the range [a,b]

Return type:

y

eval_integ_e(a, b)
inputa, b,

a … lower boundary b … upper boundary

outputflag, y

flag error flag y … the integral of the object over the range [a,b]

init(xa, ya)

Initalise the interpolation object

Argsxa, ya

xa … array of independent values ya … array of dependent values

This method initializes this for the data (xa,ay) where ya and ya are arrays of the size, which was set, when this object was initialised. The interpolation object only keeps references to the data arrays xa and ya and and stores the static state computed from the data. The ya data array is always assumed to be strictly ordered; the behavior for other arrangements is not defined.

min_size()

Returns the minimum number of points required by the interpolation.

name()

Returns the name of the interpolation type used

class pygsl.interpolation.linear(n)[source]

Bases: _interpolation

Linear interpolation.

accel_find(x)

This method performs a lookup action on the data array X_ARRAY of size SIZE, using the given accelerator A. This is how lookups are performed during evaluation of an interpolation. The function returns an index i such that `xarray[i] <= x < xarray[i+1]’.

accel_reset()
eval(x)

eval the interpolation at point x

Parameters:

x – value of the independent variable

Returns:

the interpolated value at x

Return type:

y

eval_deriv(x)
inputx

x … value of the independent variable

outputy

y … returns the value of the derivative at x

eval_deriv2(x)
inputx

x … value of the independent variable

outputy

y … the value of the second derivative at x

eval_deriv2_e(x)
inputx

x … value of the independent variable

outputflag, y

flag error flag y … the value of the second derivative at x

eval_deriv_e(x)
inputx

x … value of the independent variable

outputflag, y

flag error flag y … returns the value of the derivative at x

eval_e(x)

evaluate and flag error if it occurs

Parameters:

x – value of the independent variable

Returns:

error flag y: interpolated value at x

Return type:

flag

eval_integ(a, b)

Evaluate the integral

Parameters:
  • a – lower boundary

  • b – upper boundary

Returns:

the integral of the object over the range [a,b]

Return type:

y

eval_integ_e(a, b)
inputa, b,

a … lower boundary b … upper boundary

outputflag, y

flag error flag y … the integral of the object over the range [a,b]

init(xa, ya)

Initalise the interpolation object

Argsxa, ya

xa … array of independent values ya … array of dependent values

This method initializes this for the data (xa,ay) where ya and ya are arrays of the size, which was set, when this object was initialised. The interpolation object only keeps references to the data arrays xa and ya and and stores the static state computed from the data. The ya data array is always assumed to be strictly ordered; the behavior for other arrangements is not defined.

min_size()

Returns the minimum number of points required by the interpolation.

name()

Returns the name of the interpolation type used

class pygsl.interpolation.polynomial(n)[source]

Bases: _interpolation

Polynomial interpolation.

This method should only be used for interpolating small numbers of points because polynomial interpolation introduces large oscillations, even for well-behaved datasets. The number of terms in the interpolating polynomial is equal to the number of points.

accel_find(x)

This method performs a lookup action on the data array X_ARRAY of size SIZE, using the given accelerator A. This is how lookups are performed during evaluation of an interpolation. The function returns an index i such that `xarray[i] <= x < xarray[i+1]’.

accel_reset()
eval(x)

eval the interpolation at point x

Parameters:

x – value of the independent variable

Returns:

the interpolated value at x

Return type:

y

eval_deriv(x)
inputx

x … value of the independent variable

outputy

y … returns the value of the derivative at x

eval_deriv2(x)
inputx

x … value of the independent variable

outputy

y … the value of the second derivative at x

eval_deriv2_e(x)
inputx

x … value of the independent variable

outputflag, y

flag error flag y … the value of the second derivative at x

eval_deriv_e(x)
inputx

x … value of the independent variable

outputflag, y

flag error flag y … returns the value of the derivative at x

eval_e(x)

evaluate and flag error if it occurs

Parameters:

x – value of the independent variable

Returns:

error flag y: interpolated value at x

Return type:

flag

eval_integ(a, b)

Evaluate the integral

Parameters:
  • a – lower boundary

  • b – upper boundary

Returns:

the integral of the object over the range [a,b]

Return type:

y

eval_integ_e(a, b)
inputa, b,

a … lower boundary b … upper boundary

outputflag, y

flag error flag y … the integral of the object over the range [a,b]

init(xa, ya)

Initalise the interpolation object

Argsxa, ya

xa … array of independent values ya … array of dependent values

This method initializes this for the data (xa,ay) where ya and ya are arrays of the size, which was set, when this object was initialised. The interpolation object only keeps references to the data arrays xa and ya and and stores the static state computed from the data. The ya data array is always assumed to be strictly ordered; the behavior for other arrangements is not defined.

min_size()

Returns the minimum number of points required by the interpolation.

name()

Returns the name of the interpolation type used

class pygsl.interpolation._common[source]

Bases: object

accel_find(x)[source]

This method performs a lookup action on the data array X_ARRAY of size SIZE, using the given accelerator A. This is how lookups are performed during evaluation of an interpolation. The function returns an index i such that `xarray[i] <= x < xarray[i+1]’.

accel_reset()[source]
eval(x)[source]

eval the interpolation at point x

Parameters:

x – value of the independent variable

Returns:

the interpolated value at x

Return type:

y

eval_deriv(x)[source]
inputx

x … value of the independent variable

outputy

y … returns the value of the derivative at x

eval_deriv2(x)[source]
inputx

x … value of the independent variable

outputy

y … the value of the second derivative at x

eval_deriv2_e(x)[source]
inputx

x … value of the independent variable

outputflag, y

flag error flag y … the value of the second derivative at x

eval_deriv_e(x)[source]
inputx

x … value of the independent variable

outputflag, y

flag error flag y … returns the value of the derivative at x

eval_e(x)[source]

evaluate and flag error if it occurs

Parameters:

x – value of the independent variable

Returns:

error flag y: interpolated value at x

Return type:

flag

eval_integ(a, b)[source]

Evaluate the integral

Parameters:
  • a – lower boundary

  • b – upper boundary

Returns:

the integral of the object over the range [a,b]

Return type:

y

eval_integ_e(a, b)[source]
inputa, b,

a … lower boundary b … upper boundary

outputflag, y

flag error flag y … the integral of the object over the range [a,b]

min_size()[source]

Returns the minimum number of points required by the interpolation.

name()[source]

Returns the name of the interpolation type used

class pygsl.interpolation._interpolation(n)[source]

Bases: _common

accel_find(x)

This method performs a lookup action on the data array X_ARRAY of size SIZE, using the given accelerator A. This is how lookups are performed during evaluation of an interpolation. The function returns an index i such that `xarray[i] <= x < xarray[i+1]’.

accel_reset()
eval(x)

eval the interpolation at point x

Parameters:

x – value of the independent variable

Returns:

the interpolated value at x

Return type:

y

eval_deriv(x)
inputx

x … value of the independent variable

outputy

y … returns the value of the derivative at x

eval_deriv2(x)
inputx

x … value of the independent variable

outputy

y … the value of the second derivative at x

eval_deriv2_e(x)
inputx

x … value of the independent variable

outputflag, y

flag error flag y … the value of the second derivative at x

eval_deriv_e(x)
inputx

x … value of the independent variable

outputflag, y

flag error flag y … returns the value of the derivative at x

eval_e(x)

evaluate and flag error if it occurs

Parameters:

x – value of the independent variable

Returns:

error flag y: interpolated value at x

Return type:

flag

eval_integ(a, b)

Evaluate the integral

Parameters:
  • a – lower boundary

  • b – upper boundary

Returns:

the integral of the object over the range [a,b]

Return type:

y

eval_integ_e(a, b)
inputa, b,

a … lower boundary b … upper boundary

outputflag, y

flag error flag y … the integral of the object over the range [a,b]

init(xa, ya)[source]

Initalise the interpolation object

Argsxa, ya

xa … array of independent values ya … array of dependent values

This method initializes this for the data (xa,ay) where ya and ya are arrays of the size, which was set, when this object was initialised. The interpolation object only keeps references to the data arrays xa and ya and and stores the static state computed from the data. The ya data array is always assumed to be strictly ordered; the behavior for other arrangements is not defined.

min_size()

Returns the minimum number of points required by the interpolation.

name()

Returns the name of the interpolation type used

spline

Wrapper for the splines of gsl. This solver wraps all features as described in Chapter 26 of the gsl documentation.

Difference between spline and interpolation module:

In the interpolation module the data for the independent and dependent data are kept as reference in the various objects,whereas the spline module copies these data into the internal C gsl_spline struct.

class pygsl.spline.akima(n)[source]

Bases: _spline

Akima spline with natural boundary conditions

GetAccelCObject()

Useful when using GSL in C code.

GetSplineCObject()

Useful when using GSL in C code.

accel_find(x)

This method performs a lookup action on the data array X_ARRAY of size SIZE, using the given accelerator A. This is how lookups are performed during evaluation of an interpolation. The function returns an index i such that `xarray[i] <= x < xarray[i+1]’.

accel_reset()
eval(x)

eval the interpolation at point x

Parameters:

x – value of the independent variable

Returns:

the interpolated value at x

Return type:

y

eval_deriv(x)
inputx

x … value of the independent variable

outputy

y … returns the value of the derivative at x

eval_deriv2(x)
inputx

x … value of the independent variable

outputy

y … the value of the second derivative at x

eval_deriv2_e(x)
inputx

x … value of the independent variable

outputflag, y

flag error flag y … the value of the second derivative at x

eval_deriv2_e_vector(x)
inputx

a vector of independent values

eval_deriv2_vector(x)
inputx

a vector of independent values

eval_deriv_e(x)
inputx

x … value of the independent variable

outputflag, y

flag error flag y … returns the value of the derivative at x

eval_deriv_e_vector(x)
inputx

a vector of independent values

eval_deriv_vector(x)
inputx

a vector of independent values

eval_e(x)

evaluate and flag error if it occurs

Parameters:

x – value of the independent variable

Returns:

error flag y: interpolated value at x

Return type:

flag

eval_e_vector(x)
inputx

a vector of independent values

eval_integ(a, b)

Evaluate the integral

Parameters:
  • a – lower boundary

  • b – upper boundary

Returns:

the integral of the object over the range [a,b]

Return type:

y

eval_integ_e(a, b)
inputa, b,

a … lower boundary b … upper boundary

outputflag, y

flag error flag y … the integral of the object over the range [a,b]

eval_integ_e_vector(a, b)
inputa, b

two vector of independent values of same length

eval_integ_vector(a, b)
inputa, b

two vector of independent values of same length

eval_vector(x)
inputx

a vector of independent values

init(xa, ya)
inputxa, ya

xa … array of independent values ya … array of dependent values

This method initializes this for the data (xa,ay) where ya and ya are arrays of the size, which was set, when this object was initialised. The interpolation object copys the data arrays xa and ya and and stores the static state computed from the data. The ya data array is always assumed to be strictly ordered; the behavior for other arrangements is not defined.

min_size()

Returns the minimum number of points required by the interpolation.

name()

Returns the name of the interpolation type used

class pygsl.spline.akima_periodic(n)[source]

Bases: _spline

Akima spline with periodic boundary conditions

GetAccelCObject()

Useful when using GSL in C code.

GetSplineCObject()

Useful when using GSL in C code.

accel_find(x)

This method performs a lookup action on the data array X_ARRAY of size SIZE, using the given accelerator A. This is how lookups are performed during evaluation of an interpolation. The function returns an index i such that `xarray[i] <= x < xarray[i+1]’.

accel_reset()
eval(x)

eval the interpolation at point x

Parameters:

x – value of the independent variable

Returns:

the interpolated value at x

Return type:

y

eval_deriv(x)
inputx

x … value of the independent variable

outputy

y … returns the value of the derivative at x

eval_deriv2(x)
inputx

x … value of the independent variable

outputy

y … the value of the second derivative at x

eval_deriv2_e(x)
inputx

x … value of the independent variable

outputflag, y

flag error flag y … the value of the second derivative at x

eval_deriv2_e_vector(x)
inputx

a vector of independent values

eval_deriv2_vector(x)
inputx

a vector of independent values

eval_deriv_e(x)
inputx

x … value of the independent variable

outputflag, y

flag error flag y … returns the value of the derivative at x

eval_deriv_e_vector(x)
inputx

a vector of independent values

eval_deriv_vector(x)
inputx

a vector of independent values

eval_e(x)

evaluate and flag error if it occurs

Parameters:

x – value of the independent variable

Returns:

error flag y: interpolated value at x

Return type:

flag

eval_e_vector(x)
inputx

a vector of independent values

eval_integ(a, b)

Evaluate the integral

Parameters:
  • a – lower boundary

  • b – upper boundary

Returns:

the integral of the object over the range [a,b]

Return type:

y

eval_integ_e(a, b)
inputa, b,

a … lower boundary b … upper boundary

outputflag, y

flag error flag y … the integral of the object over the range [a,b]

eval_integ_e_vector(a, b)
inputa, b

two vector of independent values of same length

eval_integ_vector(a, b)
inputa, b

two vector of independent values of same length

eval_vector(x)
inputx

a vector of independent values

init(xa, ya)
inputxa, ya

xa … array of independent values ya … array of dependent values

This method initializes this for the data (xa,ay) where ya and ya are arrays of the size, which was set, when this object was initialised. The interpolation object copys the data arrays xa and ya and and stores the static state computed from the data. The ya data array is always assumed to be strictly ordered; the behavior for other arrangements is not defined.

min_size()

Returns the minimum number of points required by the interpolation.

name()

Returns the name of the interpolation type used

class pygsl.spline.cspline(n)[source]

Bases: _spline

Cubic spline with natural boundary conditions.

GetAccelCObject()

Useful when using GSL in C code.

GetSplineCObject()

Useful when using GSL in C code.

accel_find(x)

This method performs a lookup action on the data array X_ARRAY of size SIZE, using the given accelerator A. This is how lookups are performed during evaluation of an interpolation. The function returns an index i such that `xarray[i] <= x < xarray[i+1]’.

accel_reset()
eval(x)

eval the interpolation at point x

Parameters:

x – value of the independent variable

Returns:

the interpolated value at x

Return type:

y

eval_deriv(x)
inputx

x … value of the independent variable

outputy

y … returns the value of the derivative at x

eval_deriv2(x)
inputx

x … value of the independent variable

outputy

y … the value of the second derivative at x

eval_deriv2_e(x)
inputx

x … value of the independent variable

outputflag, y

flag error flag y … the value of the second derivative at x

eval_deriv2_e_vector(x)
inputx

a vector of independent values

eval_deriv2_vector(x)
inputx

a vector of independent values

eval_deriv_e(x)
inputx

x … value of the independent variable

outputflag, y

flag error flag y … returns the value of the derivative at x

eval_deriv_e_vector(x)
inputx

a vector of independent values

eval_deriv_vector(x)
inputx

a vector of independent values

eval_e(x)

evaluate and flag error if it occurs

Parameters:

x – value of the independent variable

Returns:

error flag y: interpolated value at x

Return type:

flag

eval_e_vector(x)
inputx

a vector of independent values

eval_integ(a, b)

Evaluate the integral

Parameters:
  • a – lower boundary

  • b – upper boundary

Returns:

the integral of the object over the range [a,b]

Return type:

y

eval_integ_e(a, b)
inputa, b,

a … lower boundary b … upper boundary

outputflag, y

flag error flag y … the integral of the object over the range [a,b]

eval_integ_e_vector(a, b)
inputa, b

two vector of independent values of same length

eval_integ_vector(a, b)
inputa, b

two vector of independent values of same length

eval_vector(x)
inputx

a vector of independent values

init(xa, ya)
inputxa, ya

xa … array of independent values ya … array of dependent values

This method initializes this for the data (xa,ay) where ya and ya are arrays of the size, which was set, when this object was initialised. The interpolation object copys the data arrays xa and ya and and stores the static state computed from the data. The ya data array is always assumed to be strictly ordered; the behavior for other arrangements is not defined.

min_size()

Returns the minimum number of points required by the interpolation.

name()

Returns the name of the interpolation type used

class pygsl.spline.cspline_periodic(n)[source]

Bases: _spline

Cubic spline with periodic boundary conditions

GetAccelCObject()

Useful when using GSL in C code.

GetSplineCObject()

Useful when using GSL in C code.

accel_find(x)

This method performs a lookup action on the data array X_ARRAY of size SIZE, using the given accelerator A. This is how lookups are performed during evaluation of an interpolation. The function returns an index i such that `xarray[i] <= x < xarray[i+1]’.

accel_reset()
eval(x)

eval the interpolation at point x

Parameters:

x – value of the independent variable

Returns:

the interpolated value at x

Return type:

y

eval_deriv(x)
inputx

x … value of the independent variable

outputy

y … returns the value of the derivative at x

eval_deriv2(x)
inputx

x … value of the independent variable

outputy

y … the value of the second derivative at x

eval_deriv2_e(x)
inputx

x … value of the independent variable

outputflag, y

flag error flag y … the value of the second derivative at x

eval_deriv2_e_vector(x)
inputx

a vector of independent values

eval_deriv2_vector(x)
inputx

a vector of independent values

eval_deriv_e(x)
inputx

x … value of the independent variable

outputflag, y

flag error flag y … returns the value of the derivative at x

eval_deriv_e_vector(x)
inputx

a vector of independent values

eval_deriv_vector(x)
inputx

a vector of independent values

eval_e(x)

evaluate and flag error if it occurs

Parameters:

x – value of the independent variable

Returns:

error flag y: interpolated value at x

Return type:

flag

eval_e_vector(x)
inputx

a vector of independent values

eval_integ(a, b)

Evaluate the integral

Parameters:
  • a – lower boundary

  • b – upper boundary

Returns:

the integral of the object over the range [a,b]

Return type:

y

eval_integ_e(a, b)
inputa, b,

a … lower boundary b … upper boundary

outputflag, y

flag error flag y … the integral of the object over the range [a,b]

eval_integ_e_vector(a, b)
inputa, b

two vector of independent values of same length

eval_integ_vector(a, b)
inputa, b

two vector of independent values of same length

eval_vector(x)
inputx

a vector of independent values

init(xa, ya)
inputxa, ya

xa … array of independent values ya … array of dependent values

This method initializes this for the data (xa,ay) where ya and ya are arrays of the size, which was set, when this object was initialised. The interpolation object copys the data arrays xa and ya and and stores the static state computed from the data. The ya data array is always assumed to be strictly ordered; the behavior for other arrangements is not defined.

min_size()

Returns the minimum number of points required by the interpolation.

name()

Returns the name of the interpolation type used

class pygsl.spline.linear(n)[source]

Bases: _spline

Linear interpolation.

GetAccelCObject()

Useful when using GSL in C code.

GetSplineCObject()

Useful when using GSL in C code.

accel_find(x)

This method performs a lookup action on the data array X_ARRAY of size SIZE, using the given accelerator A. This is how lookups are performed during evaluation of an interpolation. The function returns an index i such that `xarray[i] <= x < xarray[i+1]’.

accel_reset()
eval(x)

eval the interpolation at point x

Parameters:

x – value of the independent variable

Returns:

the interpolated value at x

Return type:

y

eval_deriv(x)
inputx

x … value of the independent variable

outputy

y … returns the value of the derivative at x

eval_deriv2(x)
inputx

x … value of the independent variable

outputy

y … the value of the second derivative at x

eval_deriv2_e(x)
inputx

x … value of the independent variable

outputflag, y

flag error flag y … the value of the second derivative at x

eval_deriv2_e_vector(x)
inputx

a vector of independent values

eval_deriv2_vector(x)
inputx

a vector of independent values

eval_deriv_e(x)
inputx

x … value of the independent variable

outputflag, y

flag error flag y … returns the value of the derivative at x

eval_deriv_e_vector(x)
inputx

a vector of independent values

eval_deriv_vector(x)
inputx

a vector of independent values

eval_e(x)

evaluate and flag error if it occurs

Parameters:

x – value of the independent variable

Returns:

error flag y: interpolated value at x

Return type:

flag

eval_e_vector(x)
inputx

a vector of independent values

eval_integ(a, b)

Evaluate the integral

Parameters:
  • a – lower boundary

  • b – upper boundary

Returns:

the integral of the object over the range [a,b]

Return type:

y

eval_integ_e(a, b)
inputa, b,

a … lower boundary b … upper boundary

outputflag, y

flag error flag y … the integral of the object over the range [a,b]

eval_integ_e_vector(a, b)
inputa, b

two vector of independent values of same length

eval_integ_vector(a, b)
inputa, b

two vector of independent values of same length

eval_vector(x)
inputx

a vector of independent values

init(xa, ya)
inputxa, ya

xa … array of independent values ya … array of dependent values

This method initializes this for the data (xa,ay) where ya and ya are arrays of the size, which was set, when this object was initialised. The interpolation object copys the data arrays xa and ya and and stores the static state computed from the data. The ya data array is always assumed to be strictly ordered; the behavior for other arrangements is not defined.

min_size()

Returns the minimum number of points required by the interpolation.

name()

Returns the name of the interpolation type used

class pygsl.spline.polynomial(n)[source]

Bases: _spline

Polynomial interpolation. This method should only be used for interpolating small numbers of points because polynomial interpolation introduces large oscillations, even for well-behaved datasets. The number of terms in the interpolating polynomial is equal to the number of points.

GetAccelCObject()

Useful when using GSL in C code.

GetSplineCObject()

Useful when using GSL in C code.

accel_find(x)

This method performs a lookup action on the data array X_ARRAY of size SIZE, using the given accelerator A. This is how lookups are performed during evaluation of an interpolation. The function returns an index i such that `xarray[i] <= x < xarray[i+1]’.

accel_reset()
eval(x)

eval the interpolation at point x

Parameters:

x – value of the independent variable

Returns:

the interpolated value at x

Return type:

y

eval_deriv(x)
inputx

x … value of the independent variable

outputy

y … returns the value of the derivative at x

eval_deriv2(x)
inputx

x … value of the independent variable

outputy

y … the value of the second derivative at x

eval_deriv2_e(x)
inputx

x … value of the independent variable

outputflag, y

flag error flag y … the value of the second derivative at x

eval_deriv2_e_vector(x)
inputx

a vector of independent values

eval_deriv2_vector(x)
inputx

a vector of independent values

eval_deriv_e(x)
inputx

x … value of the independent variable

outputflag, y

flag error flag y … returns the value of the derivative at x

eval_deriv_e_vector(x)
inputx

a vector of independent values

eval_deriv_vector(x)
inputx

a vector of independent values

eval_e(x)

evaluate and flag error if it occurs

Parameters:

x – value of the independent variable

Returns:

error flag y: interpolated value at x

Return type:

flag

eval_e_vector(x)
inputx

a vector of independent values

eval_integ(a, b)

Evaluate the integral

Parameters:
  • a – lower boundary

  • b – upper boundary

Returns:

the integral of the object over the range [a,b]

Return type:

y

eval_integ_e(a, b)
inputa, b,

a … lower boundary b … upper boundary

outputflag, y

flag error flag y … the integral of the object over the range [a,b]

eval_integ_e_vector(a, b)
inputa, b

two vector of independent values of same length

eval_integ_vector(a, b)
inputa, b

two vector of independent values of same length

eval_vector(x)
inputx

a vector of independent values

init(xa, ya)
inputxa, ya

xa … array of independent values ya … array of dependent values

This method initializes this for the data (xa,ay) where ya and ya are arrays of the size, which was set, when this object was initialised. The interpolation object copys the data arrays xa and ya and and stores the static state computed from the data. The ya data array is always assumed to be strictly ordered; the behavior for other arrangements is not defined.

min_size()

Returns the minimum number of points required by the interpolation.

name()

Returns the name of the interpolation type used

class pygsl.spline._spline(n)[source]

Bases: _common

GetAccelCObject()[source]

Useful when using GSL in C code.

GetSplineCObject()[source]

Useful when using GSL in C code.

accel_find(x)

This method performs a lookup action on the data array X_ARRAY of size SIZE, using the given accelerator A. This is how lookups are performed during evaluation of an interpolation. The function returns an index i such that `xarray[i] <= x < xarray[i+1]’.

accel_reset()
eval(x)

eval the interpolation at point x

Parameters:

x – value of the independent variable

Returns:

the interpolated value at x

Return type:

y

eval_deriv(x)
inputx

x … value of the independent variable

outputy

y … returns the value of the derivative at x

eval_deriv2(x)
inputx

x … value of the independent variable

outputy

y … the value of the second derivative at x

eval_deriv2_e(x)
inputx

x … value of the independent variable

outputflag, y

flag error flag y … the value of the second derivative at x

eval_deriv2_e_vector(x)[source]
inputx

a vector of independent values

eval_deriv2_vector(x)[source]
inputx

a vector of independent values

eval_deriv_e(x)
inputx

x … value of the independent variable

outputflag, y

flag error flag y … returns the value of the derivative at x

eval_deriv_e_vector(x)[source]
inputx

a vector of independent values

eval_deriv_vector(x)[source]
inputx

a vector of independent values

eval_e(x)

evaluate and flag error if it occurs

Parameters:

x – value of the independent variable

Returns:

error flag y: interpolated value at x

Return type:

flag

eval_e_vector(x)[source]
inputx

a vector of independent values

eval_integ(a, b)

Evaluate the integral

Parameters:
  • a – lower boundary

  • b – upper boundary

Returns:

the integral of the object over the range [a,b]

Return type:

y

eval_integ_e(a, b)
inputa, b,

a … lower boundary b … upper boundary

outputflag, y

flag error flag y … the integral of the object over the range [a,b]

eval_integ_e_vector(a, b)[source]
inputa, b

two vector of independent values of same length

eval_integ_vector(a, b)[source]
inputa, b

two vector of independent values of same length

eval_vector(x)[source]
inputx

a vector of independent values

init(xa, ya)[source]
inputxa, ya

xa … array of independent values ya … array of dependent values

This method initializes this for the data (xa,ay) where ya and ya are arrays of the size, which was set, when this object was initialised. The interpolation object copys the data arrays xa and ya and and stores the static state computed from the data. The ya data array is always assumed to be strictly ordered; the behavior for other arrangements is not defined.

min_size()

Returns the minimum number of points required by the interpolation.

name()[source]

Returns the name of the interpolation type used

interpolation2d

Wrapper for the 2D interpolation

References to the arrays are kept within the interp2d (swig) class next to the accelerator objects.

class pygsl.interpolation2d.bicubic(x_size, y_size)[source]

Bases: interp2d

class pygsl.interpolation2d.bilinear(x_size, y_size)[source]

Bases: interp2d

deriv

Numerical differentation

This module allows to differentiate functions numerically. It provides the following functions:

backward central forward

All have the same usage:
func(callback, x, h, [args])
callback … foo(x, args):

… some calculation here … return y

x … the position where to differentate the callback h … initial step size used to calculate the optimal one args … additional object to be passed to the function.

It is optional. In this case None is passed as args to foo

chebyshev

Chebyshev approximation

This module describes routines for computing Chebyshev approximations to univariate functions. A Chebyshev approximation is a truncation of the series \(\M{f(x) = S{sum} c_n T_n(x)}\), where the Chebyshev polynomials \(\M{T_n(x) = cos(n \arccos x)}\) provide an orthogonal basis of polynomials on the interval [-1,1] with the weight function \(\M{1 / sqrt{1-x^2}}\). The first few Chebyshev polynomials are, \(T_0(x) = 1\), \(T_1(x) = x\), \(T_2(x) = 2 x^2 - 1\).

::
def f(x, p):
if x < 0.5:

return 0.25

else:

return 0.75

n = 10000;

cs = cheb_series(40) F = gsl_function(f, None) cs.init(F, 0.0, 1.0)

nf = float(n) for i in range(100):

x = i / nf r10 = cs.eval_n(10, x) r40 = cs.eval(x) print “%g %g %g %g” % (x, f(x, None), r10, r40)

class pygsl.chebyshev.cheb_series(size)[source]

Bases: _workspace

Chebyshev series class

This class manages all internal detail. It provides the space for a Chebyshev series of order N.

calc_deriv()[source]

compute the derivative of the series CS. It returns a new instance of the cheb_series class.

calc_integ()[source]

Computes the integral of the series CS. It returns a new instance of the cheb_series class.

eval(x)[source]

evaluates the Chebyshev series CS at a given point x

Parameters:

x – value where the series shall be evaluated.

Returns:

interpolation value

eval_err(x)[source]
computes the Chebyshev series at a given point x,

estimating both the series result and its absolute error abserr.

The error estimate is made from the first neglected term in the series.

Args:

x: value where the error shall be evaluated.

Returns:

interpolation value abserr estimate of the error

Return type:

result

eval_n(order, x)[source]

evaluates the Chebyshev series CS at a given point x, to (at most) the given order.

Args :

order: number of cooefficients x : value where the series shall be evaluated.

eval_n_err(order, x)[source]

evaluates acChebyshev series CS at a given point x, estimating both the series result and its absolute error abserr, to (at most) the given order order. The error estimate is made from the first neglected term in the series.

Args :

order: number of cooefficients x : value where the error shall be evaluated.

get_a()[source]

Get the lower boundary of the current representation

get_b()[source]

Get the upper boundary of the current representation

get_coefficients()[source]

get the chebyshev coefficients.

get_f()[source]

Get the value f (what is it ?) The documentation does not tell anything about it.

get_order_sp()[source]

Get the value f (what is it ?) The documentation does not tell anything about it.

init(f, a, b)[source]

computes the Chebyshev approximation for the function F over the range (a,b) to the previously specified order.

The computation of the Chebyshev approximation is an M{O(n^2)} process, and requires n function evaluations.

Parameters:
  • f – a gsl_function

  • a – lower limit

  • b – upper limit

set_a(a)[source]

Set the lower boundary of the current representation

set_b(a)[source]

Set the upper boundary of the current representation

set_coefficients(coefs)[source]

Allows to set the chebyshev coefficients.

set_f(a)[source]

Set the value f (what is it ?)

set_order_sp(a)[source]

Set the value f (what is it ?)

sum

Sum modul for Levin u-transform

This module provides a function for accelerating the convergence of series based on the Levin u-transform. This method takes a small number of terms from the start of a series and uses a systematic approximation to compute an extrapolated value and an estimate of its error. The u-transform works for both convergent and divergent series, including asymptotic series.

pygsl.sum.levin_sum(a, truncate=False, info_dict=None)[source]

Return (sum(a), err) where sum(a) is the extrapolated sum of the infinite series a and err is an error estimate.

Uses the Levin u-transform method.

Parameters:
  • a – A list or array of floating point numbers assumed to be the first terms in a series.

  • truncate – If True, then use a more efficient algorithm, but with a less accurate error estimate

  • info_dict – If info_dict is provided, then two entries will be added: ‘terms_used’ will be the number of terms used and ‘sum_plain’ will be the sum of these terms without acceleration.

Notes: The error estimate is made assuming that the terms a are computed to machined precision.

Example: Computing the zeta function zeta(2) = 1/1**2 + 1/2**2 + 1/3**2 + … = pi**2/6

>>> from math import pi
>>> zeta_2 = pi**2/6
>>> a = [1.0/n**2 for n in range(1,21)]
>>> info_dict = {}
>>> (ans, err_est) = levin_sum(a, info_dict=info_dict)
>>> ans, zeta_2             
1.644934066..., 1.644934066...
>>> err = abs(ans - zeta_2)
>>> err < err_est
True
>>> (ans, err_est) = levin_sum(a, truncate=False)
>>> ans             
1.644934066...

wavelet

Wavelet transfroms as provided by GSL

hankel

roots

Wrapper over the functions as described in Chapter 31 of the reference manual.

Routines for finding the root of a function of one variable.

Example: searching the root of a quadratic using brent:

def quadratic(x, params):

a = params[0] b = params[1] c = params[2] return a * x ** 2 + b * x + c

a = 1.0 b = 0.0 c = -5.0 sys = gsl_function(quadratic, (a,b,c)) solver = brent(sys) while 1:

iter += 1 status = solver.iterate() x_lo = solver.x_lower() x_up = solver.x_upper() status = roots.test_interval(x_lo, x_up, 0, 0.001) r = solver.root() if status == 0:

break

print “Root Found =”, root

class pygsl.roots.bisection(system)[source]

Bases: _fsolver

The “bisection algorithm” is the simplest method of bracketing the

roots of a function. It is the slowest algorithm provided by the library, with linear convergence.

On each iteration, the interval is bisected and the value of the function at the midpoint is calculated. The sign of this value is used to determine which half of the interval does not contain a root. That half is discarded to give a new, smaller interval containing the root. This procedure can be continued indefinitely until the interval is sufficiently small.

At any time the current estimate of the root is taken as the midpoint of the interval.

type = <Swig Object of type 'gsl_root_fsolver_type *'>
class pygsl.roots.brent(system)[source]

Bases: _fsolver

The “Brent-Dekker method” (referred to here as “Brent’s method”)

combines an interpolation strategy with the bisection algorithm. This produces a fast algorithm which is still robust.

On each iteration Brent’s method approximates the function using an interpolating curve. On the first iteration this is a linear interpolation of the two endpoints. For subsequent iterations the algorithm uses an inverse quadratic fit to the last three points, for higher accuracy. The intercept of the interpolating curve with the x-axis is taken as a guess for the root. If it lies within the bounds of the current interval then the interpolating point is accepted, and used to generate a smaller interval. If the interpolating point is not accepted then the algorithm falls back to an ordinary bisection step.

The best estimate of the root is taken from the most recent interpolation or bisection.

type = <Swig Object of type 'gsl_root_fsolver_type *'>
class pygsl.roots.falsepos(system)[source]

Bases: _fsolver

The “false position algorithm” is a method of finding roots based on linear interpolation. Its convergence is linear, but it is usually faster than bisection.

On each iteration a line is drawn between the endpoints (a,f(a)) and (b,f(b)) and the point where this line crosses the x-axis taken as a “midpoint”. The value of the function at this point is calculated and its sign is used to determine which side of the interval does not contain a root. That side is discarded to give a new, smaller interval containing the root. This procedure can be continued indefinitely until the interval is sufficiently small.

The best estimate of the root is taken from the linear interpolation of the interval on the current iteration.

type = <Swig Object of type 'gsl_root_fsolver_type *'>
class pygsl.roots.newton(system)[source]

Bases: _fdfsolver

Newton’s Method is the standard root-polishing algorithm. The algorithm begins with an initial guess for the location of the root. On each iteration, a line tangent to the function f is drawn at that position. The point where this line crosses the x-axis becomes the new guess. The iteration is defined by the following sequence,

x_{i+1} = x_i - f(x_i)/f’(x_i)

Newton’s method converges quadratically for single roots, and linearly for multiple roots.

type = <Swig Object of type 'gsl_root_fdfsolver_type *'>
class pygsl.roots.secant(system)[source]

Bases: _fdfsolver

The “secant method” is a simplified version of Newton’s method does

not require the computation of the derivative on every step.

On its first iteration the algorithm begins with Newton’s method, using the derivative to compute a first step,

x_1 = x_0 - f(x_0)/f’(x_0)

Subsequent iterations avoid the evaluation of the derivative by replacing it with a numerical estimate, the slope through the previous two points,

x_{i+1} = x_i f(x_i) / f’_{est} where

f’_{est} = (f(x_i) - f(x_{i-1})/(x_i - x_{i-1})

When the derivative does not change significantly in the vicinity of the root the secant method gives a useful saving. Asymptotically the secant method is faster than Newton’s method whenever the cost of evaluating the derivative is more than 0.44 times the cost of evaluating the function itself. As with all methods of computing a numerical derivative the estimate can suffer from cancellation errors if the separation of the points becomes too small.

On single roots, the method has a convergence of order (1 + sqrt 5)/2 (approximately 1.62). It converges linearly for multiple roots.

type = <Swig Object of type 'gsl_root_fdfsolver_type *'>
class pygsl.roots.steffenson(system)[source]

Bases: _fdfsolver

The “Steffenson Method” provides the fastest convergence of all the

routines. It combines the basic Newton algorithm with an Aitken “delta-squared” acceleration. If the Newton iterates are x_i then the acceleration procedure generates a new sequence R_i,

R_i = x_i - (x_{i+1} - x_i)^2 / (x_{i+2} - 2 x_{i+1} + x_{i})

which converges faster than the original sequence under reasonable conditions. The new sequence requires three terms before it can produce its first value so the method returns accelerated values on the second and subsequent iterations. On the first iteration it returns the ordinary Newton estimate. The Newton iterate is also returned if the denominator of the acceleration term ever becomes zero.

As with all acceleration procedures this method can become unstable if the function is not well-behaved.

type = <Swig Object of type 'gsl_root_fdfsolver_type *'>
pygsl.roots.test_delta(x_lower, x_upper, eps_abs, eps_rel)[source]
his function tests the residual value F against the absolute

error bound EPSABS. The test returns `GSL_SUCCESS’ if the following condition is achieved,

|f| < epsabs

and returns `GSL_CONTINUE’ otherwise. This criterion is suitable for situations where the precise location of the root, x, is unimportant provided a value can be found where the residual, |f(x)|, is small enough.

input : x_lower, x_upper, eps_abs, eps_rel

pygsl.roots.test_interval(x_lower, x_upper, eps_abs, eps_rel)[source]

This function tests for the convergence of the interval [X_LOWER, X_UPPER] with absolute error EPSABS and relative error EPSREL. The test returns `GSL_SUCCESS’ if the following condition is achieved,

|a - b| < epsabs + epsrel min(|a|,|b|)

when the interval x = [a,b] does not include the origin. If the interval includes the origin then min(|a|,|b|) is replaced by zero (which is the minimum value of |x| over the interval). This ensures that the relative error is accurately estimated for roots close to the origin.

This condition on the interval also implies that any estimate of the root r in the interval satisfies the same condition with respect to the true root r^*,

|r - r^*| < epsabs + epsrel r^*

assuming that the true root r^* is contained within the interval.

input : x_lower, x_upper, eps_abs, eps_rel

class pygsl.roots._fsolver(system)[source]

Bases: _generic_solver

root()[source]

Get the actual guess for the root

set(x_lower, x_upper)[source]

Set the bondary for the solver. input : x_lower, x_upper

x_lower : the lower bound x_upper : the upper bound

type = None
x_lower()[source]

Get the lower bound of the actual interval

x_upper()[source]

Get the upper bound of the actual interval

minimize

Wrapper over the functions as described in Chapter 32 of the reference manual.

Routines for finding the minimum of a function of one variable. Example: searching for pi using brent:

m = 2.0 a = 0.0 b = 6.0

def fn1(x, params):

return cos(x) + 1.0

self.sys = gsl_function(fn1, None) minimizer = brent(self.sys)

minimizer.set(m, a, b) t1 = fn1(a, None) t2 = fn1(b, None)

print “Testing minimizer “, minimizer.name() for iter in range(100):

status = minimizer.iterate() a = minimizer.x_lower() b = minimizer.x_upper() m = minimizer.minimum() status = minimize.test_interval(a, b, 0.001, 0) if status == 0:

break

print “Minimum found at “, m

class pygsl.minimize.brent(system)[source]

Bases: _minsolver

The “Brent minimization algorithm” combines a parabolic interpolation with the golden section algorithm. This produces a fast algorithm which is still robust.

The outline of the algorithm can be summarized as follows: on each iteration Brent’s method approximates the function using an interpolating parabola through three existing points. The minimum of the parabola is taken as a guess for the minimum. If it lies within the bounds of the current interval then the interpolating point is accepted, and used to generate a smaller interval. If the interpolating point is not accepted then the algorithm falls back to an ordinary golden section step. The full details of Brent’s method include some additional checks to improve convergence.

type = <Swig Object of type 'gsl_min_fminimizer_type *'>
class pygsl.minimize.goldensection(system)[source]

Bases: _minsolver

The “golden section algorithm” is the simplest method of bracketing the minimum of a function. It is the slowest algorithm provided by the library, with linear convergence.

On each iteration, the algorithm first compares the subintervals from the endpoints to the current minimum. The larger subinterval is divided in a golden section (using the famous ratio (3-sqrt 5)/2 = 0.3189660…) and the value of the function at this new point is calculated. The new value is used with the constraint f(a’) > f(x’) < f(b’) to a select new interval containing the minimum, by discarding the least useful point. This procedure can be continued indefinitely until the interval is sufficiently small. Choosing the golden section as the bisection ratio can be shown to provide the fastest convergence for this type of algorithm.

type = <Swig Object of type 'gsl_min_fminimizer_type *'>
pygsl.minimize.test_interval(x_lower, x_upper, epsabs, epsrel)[source]
This function tests for the convergence of the interval [X_LOWER,

X_UPPER] with absolute error EPSABS and relative error EPSREL. The test returns `GSL_SUCCESS’ if the following condition is achieved,

|a - b| < epsabs + epsrel min(|a|,|b|)

when the interval x = [a,b] does not include the origin. If the interval includes the origin then min(|a|,|b|) is replaced by zero (which is the minimum value of |x| over the interval). This ensures that the relative error is accurately estimated for minima close to the origin.

This condition on the interval also implies that any estimate of the minimum x_m in the interval satisfies the same condition with respect to the true minimum x_m^*,

|x_m - x_m^*| < epsabs + epsrel x_m^*

assuming that the true minimum x_m^* is contained within the interval.

input : x_lower, x_upper, eps_abs, eps_rel

class pygsl.minimize._minsolver(system)[source]

Bases: _generic_solver

minimum()[source]

Get the current estimation for the minimum

set(x, x_lower, x_upper)[source]

This function sets, or resets, an existing minimizer S to use the function F and the initial search interval [X_LOWER, X_UPPER], with a guess for the location of the minimum X_MINIMUM.

If the interval given does not contain a minimum, then the method raises an exception.

inputx, x_lower, x_upper

x … inital guess for x x_lower … the lower bound of the search interval x_upper … the upper bound of the search interval

set_with_values(x_m, x_lower, x_upper, f_m, f_lower, f_upper)[source]

This method is equat to the set method but uses the values F_MINIMUM, F_LOWER and F_UPPER instead of computing them internaly.

inputx, x_lower, x_upper, f_minimum, f_lower, f_upper

x … inital guess for x x_lower … the lower bound of the search interval x_upper … the upper bound of the search interval f … f(x) f_lower … f(x_lower) f_upper … f(x_upper)

type = None
x_lower()[source]

Get the lower bound

x_upper()[source]

Get the upper bound

multiroots

Wrapper over the functions as described in Chapter 33 of the reference manual.

Routines for finding the root of a function depending on more than one variable.

class pygsl.multiroots.broyden(system, size)[source]

Bases: _fsolver

The “Broyden algorithm” is a version of the discrete Newton

algorithm which attempts to avoids the expensive update of the Jacobian matrix on each iteration. The changes to the Jacobian are also approximated, using a rank-1 update,

J^{-1} to J^{-1} - (J^{-1} df - dx) dx^T J^{-1} / dx^T J^{-1} df

where the vectors dx and df are the changes in x and f. On the first iteration the inverse Jacobian is estimated using finite differences, as in the discrete Newton algorithm.

This approximation gives a fast update but is unreliable if the changes are not small, and the estimate of the inverse Jacobian becomes worse as time passes. The algorithm has a tendency to become unstable unless it starts close to the root. The Jacobian is refreshed if this instability is detected (consult the source for details).

This algorithm is not recommended and is included only for demonstration purposes.

type = <Swig Object of type 'gsl_multiroot_fsolver_type *'>
class pygsl.multiroots.dnewton(system, size)[source]

Bases: _fsolver

The “discrete Newton algorithm” is the simplest method of solving a

multidimensional system. It uses the Newton iteration

x -> x - J^{-1} f(x)

where the Jacobian matrix J is approximated by taking finite differences of the function F. The approximation scheme used by this implementation is,

J_{ij} = (f_i(x + delta_j) - f_i(x)) / delta_j

where delta_j is a step of size sqrtepsilon |x_j| with epsilon being the machine precision (epsilon approx 2.22 times 10^-16). The order of convergence of Newton’s algorithm is quadratic, but the finite differences require n^2 function evaluations on each iteration. The algorithm may become unstable if the finite differences are not a good approximation to the true derivatives.

type = <Swig Object of type 'gsl_multiroot_fsolver_type *'>
class pygsl.multiroots.gnewton(system, size)[source]

Bases: _fdfsolver

This is a modified version of Newton’s method which attempts to

improve global convergence by requiring every step to reduce the Euclidean norm of the residual, |f(x)|. If the Newton step leads to an increase in the norm then a reduced step of relative size,

t = (sqrt(1 + 6 r) - 1) / (3 r)

is proposed, with r being the ratio of norms |f(x’)|^2/|f(x)|^2. This procedure is repeated until a suitable step size is found.

type = <Swig Object of type 'gsl_multiroot_fdfsolver_type *'>
class pygsl.multiroots.hybrid(system, size)[source]

Bases: _fsolver

This is a finite difference version of the Hybrid algorithm without internal scaling.

type = <Swig Object of type 'gsl_multiroot_fsolver_type *'>
class pygsl.multiroots.hybridj(system, size)[source]

Bases: _fdfsolver

This algorithm is an unscaled version of `hybridsj’. The steps are

controlled by a spherical trust region |x' - x| < delta, instead of a generalized region. This can be useful if the generalized region estimated by `hybridsj’ is inappropriate.

type = <Swig Object of type 'gsl_multiroot_fdfsolver_type *'>
class pygsl.multiroots.hybrids(system, size)[source]

Bases: _fsolver

This is a version of the Hybrid algorithm which replaces calls to the Jacobian function by its finite difference approximation. The finite difference approximation is computed using `gsl_multiroots_fdjac’ with a relative step size of `GSL_SQRT_DBL_EPSILON’.

type = <Swig Object of type 'gsl_multiroot_fsolver_type *'>
class pygsl.multiroots.hybridsj(system, size)[source]

Bases: _fdfsolver

This is a modified version of Powell’s Hybrid method as

implemented in the HYBRJ algorithm in MINPACK. Minpack was written by Jorge J. More’, Burton S. Garbow and Kenneth E. Hillstrom. The Hybrid algorithm retains the fast convergence of Newton’s method but will also reduce the residual when Newton’s method is unreliable.

The algorithm uses a generalized trust region to keep each step under control. In order to be accepted a proposed new position x’ must satisfy the condition |D (x' - x)| < delta, where D is a diagonal scaling matrix and delta is the size of the trust region. The components of D are computed internally, using the column norms of the Jacobian to estimate the sensitivity of the residual to each component of x. This improves the behavior of the algorithm for badly scaled functions.

On each iteration the algorithm first determines the standard Newton step by solving the system J dx = - f. If this step falls inside the trust region it is used as a trial step in the next stage. If not, the algorithm uses the linear combination of the Newton and gradient directions which is predicted to minimize the norm of the function while staying inside the trust region.

dx = - alpha J^{-1} f(x) - beta nabla |f(x)|^2

This combination of Newton and gradient directions is referred to as a “dogleg step”.

The proposed step is now tested by evaluating the function at the resulting point, x’. If the step reduces the norm of the function sufficiently then it is accepted and size of the trust region is increased. If the proposed step fails to improve the solution then the size of the trust region is decreased and another trial step is computed.

The speed of the algorithm is increased by computing the changes to the Jacobian approximately, using a rank-1 update. If two successive attempts fail to reduce the residual then the full Jacobian is recomputed. The algorithm also monitors the progress of the solution and returns an error if several steps fail to make any improvement,

`GSL_ENOPROG’

the iteration is not making any progress, preventing the algorithm from continuing.

`GSL_ENOPROGJ’

re-evaluations of the Jacobian indicate that the iteration is not making any progress, preventing the algorithm from continuing.

type = <Swig Object of type 'gsl_multiroot_fdfsolver_type *'>
class pygsl.multiroots.newton(system, size)[source]

Bases: _fdfsolver

Newton’s Method is the standard root-polishing algorithm. The

algorithm begins with an initial guess for the location of the solution. On each iteration a linear approximation to the function F is used to estimate the step which will zero all the components of the residual. The iteration is defined by the following sequence,

x -> x’ = x - J^{-1} f(x)

where the Jacobian matrix J is computed from the derivative functions provided by F. The step dx is obtained by solving the linear system,

J dx = - f(x)

using LU decomposition.

type = <Swig Object of type 'gsl_multiroot_fdfsolver_type *'>
pygsl.multiroots.test_delta(dx, x, epsabs, epsrel)[source]
This function tests for the convergence of the sequence by

comparing the last step DX with the absolute error EPSABS and relative error EPSREL to the current position X. The test returns `GSL_SUCCESS’ if the following condition is achieved,

|dx_i| < epsabs + epsrel |x_i|

for each component of X and returns `GSL_CONTINUE’ otherwise.

input : dx, x, epsabs, epsrel

pygsl.multiroots.test_residual(f, epsabs)[source]
This function tests the residual value F against the absolute

error bound EPSABS. The test returns `GSL_SUCCESS’ if the following condition is achieved,

sum_i |f_i| < epsabs

and returns `GSL_CONTINUE’ otherwise. This criterion is suitable for situations where the precise location of the root, x, is unimportant provided a value can be found where the residual is small enough.

input : f, epsabs

class pygsl.multiroots._fsolver(system, size)[source]

Bases: _generic_solver

getf()[source]

Get the value of f

getx()[source]

Get the value of x

root()[source]

Get the current root estimate

set(x)[source]

Set the initial start guess x

type = None
class pygsl.multiroots._fdfsolver(system, size)[source]

Bases: _fsolver

type = None

multiminimize

Wrapper over the functions as described in Chapter 33 of the reference manual.

Routines for finding the minimum of a function depending on more than one variable.

class pygsl.multiminimize.conjugate_fr(system, size)[source]

Bases: _fdfsolver

This is the Fletcher-Reeves conjugate gradient algorithm. The conjugate gradient algorithm proceeds as a succession of line minimizations. The sequence of search directions is used to build up an approximation to the curvature of the function in the neighborhood of the minimum. An initial search direction P is chosen using the gradient and line minimization is carried out in that direction. The accuracy of the line minimization is specified by the parameter TOL. At the minimum along this line the function gradient G and the search direction P are orthogonal. The line minimization terminates when dot(p,g) < tol |p| |g|. The search direction is updated using the Fletcher-Reeves formula p’ = g’ - eta g where eta=-|g’|^2/|g|^2, and the line minimization is then repeated for the new search direction.

type = <Swig Object of type 'gsl_multimin_fdfminimizer_type *'>
class pygsl.multiminimize.conjugate_pr(system, size)[source]

Bases: _fdfsolver

This is the Polak-Ribiere conjugate gradient algorithm. It is

similar to the Fletcher-Reeves method, differing only in the choice of the coefficient eta. Both methods work well when the evaluation point is close enough to the minimum of the objective function that it is well approximated by a quadratic hypersurface.

type = <Swig Object of type 'gsl_multimin_fdfminimizer_type *'>
class pygsl.multiminimize.nmsimplex(system, size)[source]

Bases: _fsolver

This is the Simplex algorithm by Nelder and Mead. It constructs n vectors p_i from the starting vector X as follows:

that form the n+1 vertices of a simplex in n dimensions. In each iteration step the algorithm tries to improve the parameter vector p_i corresponding to the highest, i. e. worst, function value by simple geometrical transformations. These are reflection, reflection followed by expansion, contraction and multiple contraction. Using these transformations the simplex moves through the parameter space towards the minimum, where it contracts itself.

After each iteration, the best vertex is returned. Note, that due to the nature of the algorithm (getting rid of the worst estimate), every iteration doesn’t necessarily improve the current best parameter vector. Usually several iterations are required.

The routine calculates the minimizer specific characteristic size as the average distance from the geometrical center of the simplex to all its vertices. This size can be used as a stopping criteria, as the simplex contracts itself near the minimum. The size is returned by the function `gsl_multimin_fminimizer_size’.

type = <Swig Object of type 'gsl_multimin_fminimizer_type *'>
class pygsl.multiminimize.nmsimplex2(system, size)[source]

Bases: _fsolver

type = <Swig Object of type 'gsl_multimin_fminimizer_type *'>
class pygsl.multiminimize.nmsimplex2rand(system, size)[source]

Bases: _fsolver

type = <Swig Object of type 'gsl_multimin_fminimizer_type *'>
class pygsl.multiminimize.steepest_descent(system, size)[source]

Bases: _fdfsolver

The steepest descent algorithm follows the downhill gradient of the

function at each step. When a downhill step is successful the step-size is increased by factor of two. If the downhill step leads to a higher function value then the algorithm backtracks and the step size is decreased using the parameter TOL. A suitable value of TOL for most applications is 0.1. The steepest descent method is inefficient and is included only for demonstration purposes.

type = <Swig Object of type 'gsl_multimin_fdfminimizer_type *'>
pygsl.multiminimize.test_gradient(g, epsabs)[source]

This function tests the norm of the gradient against the absolute tolerance epsabs. The gradient of a multidimensional function goes to zero at a minimum. The test returns `GSL_SUCCESS’ if the following condition is achieved,

|g| < epsabs

and returns `GSL_CONTINUE’ otherwise. A suitable choice of EPSABS can be made from the desired accuracy in the function for small variations in x. The relationship between these quantities is given by delta f = g delta x.

pygsl.multiminimize.test_size(gradient, tolerance)[source]

This function tests the minimizer specific characteristic size (if applicable to the used minimizer) against the absolute tolerance.

class pygsl.multiminimize.vector_bfgs(system, size)[source]

Bases: _fdfsolver

This is the vector Broyden-Fletcher-Goldfarb-Shanno (BFGS)

conjugate gradient algorithm. It is a quasi-Newton method which builds up an approximation to the second derivatives of the function f using the difference between successive gradient vectors. By combining the first and second derivatives the algorithm is able to take Newton-type steps towards the function minimum, assuming quadratic behavior in that region.

type = <Swig Object of type 'gsl_multimin_fdfminimizer_type *'>
class pygsl.multiminimize.vector_bfgs2(system, size)[source]

Bases: _fdfsolver

type = <Swig Object of type 'gsl_multimin_fdfminimizer_type *'>
class pygsl.multiminimize._fsolver(system, size)[source]

Bases: _generic_solver

getf()[source]

Get the current function value

getx()[source]

Get the current x value

minimum()[source]

Get the current minimum

set(x, step_size)[source]

This function initializes the minimizer to minimize the function starting from the initial point x. The size of the initial trial steps is given in vector STEP_SIZE. The precise meaning of this parameter depends on the method used.

size()[source]

Get the characteristic size

type = None
class pygsl.multiminimize._fdfsolver(system, size)[source]

Bases: _fsolver

gradient()[source]

Get the last gradient

restart()[source]

Restart the iteration at the current point

set(x, step_size, tolerance)[source]

This function initializes the minimizer S to minimize the function FDF starting from the initial point X. The size of the first trial step is given by STEP_SIZE. The accuracy of the line minimization is specified by TOL. The precise meaning of this parameter depends on the method used. Typically the line minimization is considered successful if the gradient of the function g is orthogonal to the current search direction p to a relative accuracy of TOL, where dot(p,g) < tol |p| |g|.

type = None

fit

The functions described in this section can be used to perform least-squares fits to a straight line model, .. math:: Y = c_0 + c_1 X.

For weighted data the best-fit is found by minimizing the weighted sum of squared residuals, \(\chi^2\),

\[\chi^2 = \sum_i w_i (y_i - (c_0 + c_1 x_i))^2\]

for the parameters c_0, c_1. For unweighted data the sum is computed with w_i = 1.

pygsl.fit.est(x, c0, c1, c00, c01, c10)[source]

return the estimation at point x

Parameters:
  • x – independent data

  • c0 – fit coefficient (intercept)

  • c1 – fit coefficient (slope)

  • c00 – covariance - variance matrix coefficient

  • c01 – covariance - variance matrix coefficient

  • c11 – covariance - variance matrix coefficient

Returns:

y double: y_err

Return type:

double

wrapper of the function gsl_fit_linear_est()

This function uses the best-fit linear regression coefficients

C0,C1 and their estimated covariance COV00,COV01,COV11 to compute the fitted function Y and its standard deviation Y_ERR for the model Y = c_0 + c_1 X at the point X.

pygsl.fit.linear(x, y)[source]

Computes the best fit linear regression

Parameters:
  • data (y ... dependent)

  • data

Returns:

((C0, C1), (COV00, COV01, COV11), sumsq)

Return type:

tuple

wrapper of the function gsl_fit_linear()

This function computes the best-fit linear regression coefficients (C0,C1) of the model Y = c_0 + c_1 X for the datasets (X, Y). The variance-covariance matrix for the parameters (C0, C1) is estimated from the scatter of the points around the best-fit line and returned via the parameters (COV00, COV01, COV11). The sum of squares of the residuals from the best-fit line is returned in SUMSQ.

pygsl.fit.mul(x, y)[source]

compute best linear regression (without abszissa)

Parameters:
  • x – independent data

  • y – dependent data

Returns:

(C1, COV11, sumsq)

Return type:

tuple

wrapper of the function gsl_fit_mul()

This function computes the best-fit linear regression coefficient C1 of the model Y = c_1 X for the datasets (X, Y). The variance of the parameter C1 is estimated from the scatter of the points around the best-fit line and returned via the parameter COV11. The sum of squares of the residuals from the best-fit line is returned in SUMSQ.

pygsl.fit.mul_est(x, c1, c11)[source]
Parameters:
  • x – independent data

  • c1 – fit coefficient (slope)

  • c11 – covariance - variance matrix coefficient

Returns:

y y_err

wrapper of the function gsl_fit_mul_est()

This function uses the best-fit linear regression coefficient C1 and its estimated covariance COV11 to compute the fitted function Y and its standard deviation Y_ERR for the model Y = c_1 X at the point X.

pygsl.fit.wlinear(x, y, w)[source]

Weighted linear fit

Parameters:
  • data (w ... weights for the dependent)

  • data

  • data

Returns:

((C0, C1), (COV00, COV01, COV11), sumsq)

Return type:

tuple

wrapper of the function gsl_fit_wlinear()

This function computes the best-fit linear regression coefficients (C0,C1) of the model Y = c_0 + c_1 X for the weighted datasets (X, Y). The vector W specifies the weight of each datapoint. The weight is the reciprocal of the variance for each datapoint in Y.

The covariance matrix for the parameters (C0, C1) is estimated from weighted data and returned via the parameters (COV00, COV01, COV11). The weighted sum of squares of the residuals from the best-fit line, chi^2, is returned in CHISQ.

pygsl.fit.wmul(x, y, w)[source]

compute weighted best linear regression (without abszissa)

Parameters:
  • x – independent data

  • y – dependent data

  • w – weights for the dependent data

Returns:

(C1, COV11, sumsq)

Return type:

tuple

wrapper of the function gsl_fit_wmul()

This function computes the best-fit linear regression coefficient C1 of the model Y = c_1 X for the weighted datasets (X, Y). The vector W, of length N and stride WSTRIDE, specifies the weight of each datapoint. The weight is the reciprocal of the variance for each datapoint in Y.

The variance of the parameter C1 is estimated from the weighted data and returned via the parameters COV11. The weighted sum of squares of the residuals from the best-fit line, chi^2, is returned in CHISQ.

multifit

The functions described in this section perform least-squares fits

to a general linear model, y = X c where y is a vector of n observations, X is an n by p matrix of predictor variables, and c are the p unknown best-fit parameters, which are to be estimated.

The best-fit is found by minimizing the weighted sums of squared

residuals, chi^2,

chi^2 = (y - X c)^T W (y - X c)

with respect to the parameters c. The weights are specified by the diagonal elements of the n by n matrix W. For unweighted data W is replaced by the identity matrix.

This formulation can be used for fits to any number of functions

and/or variables by preparing the n-by-p matrix X appropriately. For example, to fit to a p-th order polynomial in X, use the following matrix,

X_{ij} = x_i^j

where the index i runs over the observations and the index j runs from 0 to p-1.

To fit to a set of p sinusoidal functions with fixed frequencies

omega_1, omega_2, …, omega_p, use,

X_{ij} = sin(omega_j x_i)

To fit to p independent variables x_1, x_2, …, x_p, use,

X_{ij} = x_j(i)

where x_j(i) is the i-th value of the predictor variable x_j.

The functions described in this section are declared in the header

file `gsl_multifit.h’.

The solution of the general linear least-squares system requires an

additional working space for intermediate results, such as the singular value decomposition of the matrix X.

pygsl.multifit.linear(X, y, work=None)[source]

This function computes the best-fit parameters C of the model y = X c for the observations Y and the matrix of predictor variables X. The variance-covariance matrix of the model parameters COV is estimated from the scatter of the observations about the best-fit. The sum of squares of the residuals from the best-fit, chi^2, is returned in CHISQ.

The best-fit is found by singular value decomposition of the matrix X using the preallocated workspace provided in WORK. The modified Golub-Reinsch SVD algorithm is used, with column scaling to improve the accuracy of the singular values. Any components which have zero singular value (to machine precision) are discarded from the fit.

If work is None, the approbriate workspace will be allocated automatically

pygsl.multifit.linear_est(x, c, cov)[source]

This function uses the best-fit multilinear regression coefficients c and their covariance matrix cov to compute the fitted function value y and its standard deviation y_err for the model y = x.c at the point X.

pygsl.multifit.linear_est_matrix(X, c, cov)[source]

This function is similar to linear_est, but instead of a vector x it iterates over a matrix X

pygsl.multifit.linear_svd(X, y, tol, work=None)[source]
pygsl.multifit.linear_usvd(X, y, tol, work=None)[source]
class pygsl.multifit.linear_workspace(n, p)[source]

Bases: _workspace

Class handling the workspace required for fitting.

pygsl.multifit.wlinear(X, w, y, work=None)[source]

This function computes the best-fit parameters C of the model y = X c for the observations Y and the matrix of predictor variables X. The covariance matrix of the model parameters COV is estimated from the weighted data. The weighted sum of squares of the residuals from the best-fit, chi^2, is returned in CHISQ.

The best-fit is found by singular value decomposition of the matrix X using the preallocated workspace provided in WORK. Any components which have zero singular value (to machine precision) are discarded from the fit.

If work is None, the approbriate workspace will be allocated automatically

pygsl.multifit.wlinear_svd(X, y, w, work=None)[source]

Similar to wlinear, except that this function returns

pygsl.multifit.wlinear_usvd(X, y, w, tol, work=None)[source]

Similar to wlinear, except that this function returns

multifit_nlin

Wrapper over the functions as described in Chapter 33 of the reference manual.

Routines for approximating a data set with a non linear function

pygsl.multifit_nlin.covar(J, epsrel)[source]

compute the covariance matrix from the Jacobian J

This function uses the Jacobian matrix J to compute the covariance matrix of the best-fit parameters, COVAR. The parameter EPSREL is used to remove linear-dependent columns when J is rank deficient.

The covariance matrix is given by,

covar = :math:`(J^T J)^{-1}

and is computed by QR decomposition of J with column-pivoting. Any columns of R which satisfy

\[|R_{kk}| <= epsrel |R_{11}|\]

are considered linearly-dependent and are excluded from the covariance matrix (the corresponding rows and columns of the covariance matrix are set to zero).

Parameters:
  • J – Jacobian matrix

  • epsrel

pygsl.multifit_nlin.gradient(J, f)[source]

computes the gradient

This function computes the gradient G of \(\Phi(x) = (1/2) ||F(x)||^2\) from the Jacobian matrix J and the function values F, using the formula \(g = J^T f\).

class pygsl.multifit_nlin.lmder(system, n, p)[source]

Bases: _fdfsolver

unscaled scaled Levenberg-Marquardt solver

This is an unscaled version of the LMDER algorithm. The elements of the diagonal scaling matrix D are set to 1. This algorithm may be useful in circumstances where the scaled version of LMDER converges too slowly, or the function is already scaled appropriately.

See also gsl_multifit_fdfsolver_lmder

type = <Swig Object of type 'gsl_multifit_fdfsolver_type *'>
class pygsl.multifit_nlin.lmniel(system, n, p)[source]

Bases: _fdfsolver

Levenberg-Marquardt solver

This is a Levenberg-Marquardt solver based on a smoother updating procedure for the damping parameter mu proposed by Nielsen, 1999. It does not use a trust region approach and only performs rudimentary scaling and is therefore not as robust as lmsder. However, on each iteration it solves the normal equation system to compute the next step:

\[|(J^T J + mu I) | = - J^T f\]

which makes it a much more practical method for problems with a large number of residuals \((n >> p)\), since only the p-by-p matrix \(J^T J\) is decomposed rather than the full n-by-p Jacobian. This makes a significant difference in efficiency when solving systems with large amounts of data. While not as robust as lmsder, this algorithm has proven effective on a wide class of problems.

See also gsl_multifit_fdfsolver_lmniel

type = <Swig Object of type 'gsl_multifit_fdfsolver_type *'>
class pygsl.multifit_nlin.lmsder(system, n, p)[source]

Bases: _fdfsolver

scaled Levenberg-Marquardt solver

This is a robust and efficient version of the Levenberg-Marquardt algorithm as implemented in the scaled LMDER routine in MINPACK. Minpack was written by Jorge J. More’, Burton S. Garbow and Kenneth E. Hillstrom.

The algorithm uses a generalized trust region to keep each step under control. In order to be accepted a proposed new position \(x'\) must satisfy the condition \(|D (x' - x)| < \delta\), where D is a diagonal scaling matrix and delta is the size of the trust region. The components of D are computed internally, using the column norms of the Jacobian to estimate the sensitivity of the residual to each component of x. This improves the behavior of the algorithm for badly scaled functions.

On each iteration the algorithm attempts to minimize the linear system \(|F + J p|\) subject to the constraint \(|D p| < \Delta\). The solution to this constrained linear system is found using the Levenberg-Marquardt method.

The proposed step is now tested by evaluating the function at the resulting point, \(x'\). If the step reduces the norm of the function sufficiently, and follows the predicted behavior of the function within the trust region. then it is accepted and size of the trust region is increased. If the proposed step fails to improve the solution, or differs significantly from the expected behavior within the trust region, then the size of the trust region is decreased and another trial step is computed.

The algorithm also monitors the progress of the solution and returns an error if the changes in the solution are smaller than the machine precision. The possible error codes are,

`GSL_ETOLF’

the decrease in the function falls below machine precision

`GSL_ETOLX’

the change in the position vector falls below machine

`GSL_ETOLG’

the norm of the gradient, relative to the norm of the function, falls below machine precision

These error codes indicate that further iterations will be unlikely to change the solution from its current value.

See also gsl_multifit_fdfsolver_lmsder

type = <Swig Object of type 'gsl_multifit_fdfsolver_type *'>
pygsl.multifit_nlin.test_delta(dx, x, epsabs, epsrel)[source]

Test convergence

This function tests for the convergence of the sequence by comparing the last step DX with the absolute error EPSABS and relative error EPSREL to the current position X. The test returns `GSL_SUCCESS’ if the following condition is achieved,

\[|dx_i| < epsabs + epsrel |x_i|\]

for each component of X and returns `GSL_CONTINUE’ otherwise.

pygsl.multifit_nlin.test_gradient(dx, epsabs)[source]

residual gradient test

This function tests the residual gradient G against the absolute error bound EPSABS. Mathematically, the gradient should be exactly zero at the minimum. The test returns `GSL_SUCCESS’ if the following condition is achieved,

\[\sum_i |g_i| < epsabs\]

and returns `GSL_CONTINUE’ otherwise. This criterion is suitable for situations where the precise location of the minimum, x, is unimportant provided a value can be found where the gradient is small enough.

class pygsl.multifit_nlin._fsolver(system, n, p)[source]

Bases: _generic_solver

getdx()[source]
getf()[source]
getx()[source]
position(x)[source]
set(x)[source]
type = None
class pygsl.multifit_nlin._fdfsolver(system, n, p)[source]

Bases: _fsolver

getJ()[source]
type = None

multifit_robust

class pygsl.multifit_robust.stats

::gsl_multifit_robust_stats

Rsq(stats self) double
__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__hash__()

Return hash(self).

__init__(*args, **kwargs)
__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)
adj_Rsq(stats self) double
dof(stats self) size_t
numit(stats self) size_t
residuals(stats self) PyObject *
rmse(stats self) double
sigma(stats self) double
sigma_mad(stats self) double
sigma_ols(stats self) double
sigma_rob(stats self) double
sse(stats self) double
weights(stats self) PyObject *
class pygsl.multifit_robust.workspace

::gsl_multifit_robust_workspace

__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__hash__()

Return hash(self).

__init__(*args, **kwargs)
__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)
fit(workspace self, gsl_matrix const * X, gsl_vector const * y) PyObject *
Parameters:
  • X (gsl_matrix const *)

  • y (gsl_vector const *)

name(workspace self) char const *
statistics(workspace self) stats
tune(workspace self, double t) gsl_error_flag_drop
Parameters:

t (double)

pygsl.multifit_robust.est(gsl_vector const * v, gsl_vector const * c, gsl_matrix const * cov) gsl_error_flag_drop
Parameters:
  • v (gsl_vector const *)

  • c (gsl_vector const *)

  • cov (gsl_matrix const *)

pygsl.multifit_robust.est_vector(gsl_matrix const * X, gsl_vector const * c, gsl_matrix const * cov) PyObject *
Parameters:
  • X (gsl_matrix const *)

  • c (gsl_vector const *)

  • cov (gsl_matrix const *)

pygsl.multifit_robust.default = <Swig Object of type 'gsl_multifit_robust_type *'>

Swig object carries a C/C++ instance pointer

pygsl.multifit_robust.bisquare = <Swig Object of type 'gsl_multifit_robust_type *'>

Swig object carries a C/C++ instance pointer

pygsl.multifit_robust.cauchy = <Swig Object of type 'gsl_multifit_robust_type *'>

Swig object carries a C/C++ instance pointer

pygsl.multifit_robust.fair = <Swig Object of type 'gsl_multifit_robust_type *'>

Swig object carries a C/C++ instance pointer

pygsl.multifit_robust.huber = <Swig Object of type 'gsl_multifit_robust_type *'>

Swig object carries a C/C++ instance pointer

pygsl.multifit_robust.ols = <Swig Object of type 'gsl_multifit_robust_type *'>

Swig object carries a C/C++ instance pointer

pygsl.multifit_robust.welsch = <Swig Object of type 'gsl_multifit_robust_type *'>

Swig object carries a C/C++ instance pointer

bspline

class pygsl.bspline.bspline

Bases: SwigPyObject

::pygsl_bspline

acquire()

acquires ownership of the pointer

append(object, /)

appends another ‘this’ object

coeffs

gsl_vector_view

Type:

coeffs

coeffs_a

p.PyArrayObject

Type:

coeffs_a

cov

gsl_matrix_view

Type:

cov

cov_a

p.PyArrayObject

Type:

cov_a

disown()

releases ownership of the pointer

eval(bspline self, double const X) PyObject *
eval_dep(bspline self, double const x, double * OUT) gsl_error_flag_drop
eval_dep_vector(bspline self, gsl_vector const * X) PyObject *
eval_dep_yerr(bspline self, double const x, double * OUT, double * OUT2) gsl_error_flag_drop
eval_dep_yerr_vector(bspline self, gsl_vector const * X) PyObject *
eval_vector(bspline self, gsl_vector const * IN) PyObject *
get_internal_knots(bspline self) PyObject *
knots(bspline self, PyObject * knots_o) gsl_error_flag_drop
knots_a

p.PyArrayObject

Type:

knots_a

knots_uniform(bspline self, double const a, double const b) gsl_error_flag_drop
next()

returns the next ‘this’ object

own()

returns/sets ownership of the pointer

set_coefficients_and_covariance_matrix(bspline self, PyObject * coeffs_o, PyObject * cov_o) gsl_error_flag_drop
this
thisown
tmp

gsl_vector_view

Type:

tmp

tmp_a

p.PyArrayObject

Type:

tmp_a

w

p.gsl_bspline_workspace

Type:

w

bspline.get_internal_knots(bspline self) PyObject *
bspline.knots(bspline self, PyObject * knots_o) gsl_error_flag_drop
bspline.knots_uniform(bspline self, double const a, double const b) gsl_error_flag_drop
bspline.eval_vector(bspline self, gsl_vector const * IN) PyObject *
bspline.eval_dep(bspline self, double const x, double * OUT) gsl_error_flag_drop
bspline.eval_dep_yerr(bspline self, double const x, double * OUT, double * OUT2) gsl_error_flag_drop

ieee

ieee interface

Wrappers for the functionality provided by chap_ieee

pygsl.ieee.bin_repr()
pygsl.ieee.env_setup()
Set the IEEE mode, the GSL library should use, using the GSL_IEEE_MODE

environement variable

You can also use os.environ[‘GSL_IEEE_MODE’]=’<desired_behaviour>’ to set the variable

Calls gsl_ieee_env_setup()

pygsl.ieee.finite(object, /)

Returns if the number is finite.

Wrapper for gsl_finite()

Parameters:

o – python object

Returns:

if finite or not

Return type:

bool

pygsl.ieee.isinf(object, /)

Returns if the object is inif

Wrapper for gsl_isinf()

Parameters:

o – python object

Return type:

bool

pygsl.ieee.isnan(object, /)

Returns if the object is Nan

Wrapper for gsl_isnan()

Parameters:

o – python object

Returns:

if Nan or not

Return type:

bool

pygsl.ieee.nan()

Returns not a number

pygsl.ieee.neginf()

Returns a negative infinite: Inf

pygsl.ieee.posinf()

Returns a positive infinite: -Inf

pygsl.ieee.set_mode()
pygsl.ieee.set_mode(precision, rounding, exception_mask)

Sets the ieee float handling mode

Parameters:
Each flag can be a combination of the constants defined in this module

Raises gsl_NoHardwareSupportError if support is not available.

Warning

Use with care! It can abort your programm abnormaly!

pygsl.ieee.single_precision = 1

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.ieee.double_precision = 2

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.ieee.extended_precision = 3

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.ieee.mask_all = 31

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.ieee.mask_denormalized = 2

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.ieee.mask_division_by_zero = 4

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.ieee.mask_invalid = 1

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.ieee.mask_overflow = 8

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.ieee.mask_underflow = 16

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.ieee.round_to_nearest = 1

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.ieee.round_down = 2

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.ieee.round_up = 3

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.ieee.round_to_zero = 4

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.ieee.trap_inexact = 32

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.ieee.type_nan = 1

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.ieee.type_inf = 2

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.ieee.type_normal = 3

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.ieee.type_denormal = 4

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

pygsl.ieee.type_zero = 5

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

Modules not considered part of the API

Obsoletes

diff

odeiv

Wrapper for the ode solver of gsl. This solver wraps all features as descirbed in Chapter 25 of the gsl documentation.

The _odeiv file provides the low level wrapper. Direct usage at your special own risk.

Here is the pythonic version of the example from the gsl documentation.

import odeiv mu = 10.0 def func(t, y):

f = Numeric.zeros((2,), Numeric.Float) * 1.0 f[0] = y[1] f[1] = -y[0] - mu * y[1] * (y[0] ** 2 -1); return f

def jac(t, y):

dfdy = Numeric.zeros((2,2), Numeric.Float) dfdy[0, 0] = 0.0 dfdy[0, 1] = 1.0 dfdy[1, 0] = -2.0 * mu * y[0] * y[1] - 1.0 dfdy[1, 1] = -mu * (y[0]**2 - 1.0) dfdt = Numeric.zeros((2,)) return dfdy, dfdt

dimension = 2 step = odeiv.step_gear1(dimension, func, jac) control = odeiv.control_y_new(step, 1e-6, 1e-6) evolve = odeiv.evolve(step, control, dimension) h = 1 t = 0.0 t1 = 100.0 y = (1.0, 0.0) while t<t1:

t, h, y = evolve.apply(t, t1, h, y) print t, y[0], y[1]

class pygsl.odeiv.control_standard_new(step, eps_abs, eps_rel, a_y, a_dydt)[source]

Bases: __control

The standard control object is a four parameter heuristic based on absolute and relative errors eps_abs and eps_rel, and scaling factors a_y and a_dydt for the system state y(t) and derivatives y’(t) respectively.

The step-size adjustment procedure for this method begins by computing the desired error level D_i for each component,

D_i = eps_abs + eps_rel * (a_y |y_i| + a_dydt h |y'_i|)

and comparing it with the observed error E_i = |yerr_i|. If the observed error E exceeds the desired error level D by more than 10% for any component then the method reduces the step-size by an appropriate factor,

h_new = h_old * S * (D/E)^(1/q)

where q is the consistency order of method (e.g. q=4 for 4(5) embedded RK), and S is a safety factor of 0.9. The ratio D/E is taken to be the maximum of the ratios D_i/E_i.

If the observed error E is less than 50% of the desired error level D for the maximum ratio D_i/E_i then the algorithm takes the opportunity to increase the step-size to bring the error in line with the desired level,

h_new = h_old * S * (E/D)^(1/(q+1))

This encompasses all the standard error scaling methods.

class pygsl.odeiv.control_y_new(step, eps_abs, eps_rel)[source]

Bases: __control

Creates a new control object which will keep the local error on each step within an absolute error of eps_abs and relative error of eps_rel with respect to the solution y_i(t). This is equivalent to the standard control object with a_y=1 and a_dydt=0.

See also the documentation of the control_standard_new class

class pygsl.odeiv.control_yp_new(step, eps_abs, eps_rel)[source]

Bases: __control

This function creates a new control object which will keep the local error on each step within an absolute error of eps_abs and relative error of eps_rel with respect to the derivatives of the solution y’_i(t) . This is equivalent to the standard control object with a_y=0 and a_dydt=1.

class pygsl.odeiv.evolve(step, control, dimension)[source]

Bases: object

The highest level of the system is the evolution function which combines the results of a stepping function and control function to reliably advance the solution forward over an interval (t_0, t_1). If the control function signals that the step-size should be decreased the evolution function backs out of the current step and tries the proposed smaller step-size. This is process is continued until an acceptable step-size is found.

apply(t, t1, h, y)[source]
inputt, t1, h, y

t … start time t1 … end time h … initial step size y … start vector

output :

t … reached time in the calculation h … reached step size y … end vector

This method advances the system from time t and position y using the stepping function step. The new time and position are stored in t and y on output. The initial step-size is taken as h, but this will be modified to achieve the appropriate error bound if necessary. The routine may make several calls to the step object in order to determine the optimum step-size. If the step-size has been changed the value of h will be modified on output. The maximum time t1 is guaranteed not to be exceeded by the time-step. On the final time-step the value of t will be set to t1 exactly.

apply_vector(t, t1, h, y, nsteps=1, hmax=None)[source]
reset()[source]

No input. No output

This method resets the evolution. It should be used whenever the next use will not be a continuation of a previous step.

class pygsl.odeiv.step_bsimp(dims, func, jac=None, args=None)[source]

Bases: __step

Implicit Bulirsch-Stoer method of Bader and Deuflhard. This algorithm requires the Jacobian.

need_jacobian = 1
type = <Swig Object of type 'gsl_odeiv_step_type *'>
class pygsl.odeiv.step_gear1(dims, func, jac=None, args=None)[source]

Bases: __step

M=1 implicit Gear method

need_jacobian = 0
type = <Swig Object of type 'gsl_odeiv_step_type *'>
class pygsl.odeiv.step_gear2(dims, func, jac=None, args=None)[source]

Bases: __step

M=2 implicit Gear method

need_jacobian = 0
type = <Swig Object of type 'gsl_odeiv_step_type *'>
class pygsl.odeiv.step_rk2(dims, func, jac=None, args=None)[source]

Bases: __step

Embedded 2nd order Runge-Kutta with 3rd order error estimate.

need_jacobian = 0
type = <Swig Object of type 'gsl_odeiv_step_type *'>
class pygsl.odeiv.step_rk2imp(dims, func, jac=None, args=None)[source]

Bases: __step

Implicit 2nd order Runge-Kutta at Gaussian points

need_jacobian = 0
type = <Swig Object of type 'gsl_odeiv_step_type *'>
class pygsl.odeiv.step_rk4(dims, func, jac=None, args=None)[source]

Bases: __step

4th order (classical) Runge-Kutta.

need_jacobian = 0
type = <Swig Object of type 'gsl_odeiv_step_type *'>
class pygsl.odeiv.step_rk4imp(dims, func, jac=None, args=None)[source]

Bases: __step

Implicit 4th order Runge-Kutta at Gaussian points

need_jacobian = 0
type = <Swig Object of type 'gsl_odeiv_step_type *'>
class pygsl.odeiv.step_rk8pd(dims, func, jac=None, args=None)[source]

Bases: __step

Embedded 8th order Runge-Kutta Prince-Dormand method with 9th order error estimate.

need_jacobian = 0
type = <Swig Object of type 'gsl_odeiv_step_type *'>
class pygsl.odeiv.step_rkck(dims, func, jac=None, args=None)[source]

Bases: __step

Embedded 4th order Runge-Kutta Cash-Karp method with 5th order error estimate.

need_jacobian = 0
type = <Swig Object of type 'gsl_odeiv_step_type *'>
class pygsl.odeiv.step_rkf45(dims, func, jac=None, args=None)[source]

Bases: __step

Embedded 4th order Runge-Kutta-Fehlberg method with 5th order error estimate. This method is a good general-purpose integrator.

need_jacobian = 0
type = <Swig Object of type 'gsl_odeiv_step_type *'>

sf

Not documented here. Name clashes with pygsl.testing.sf could occur.

math

Simple Mathematical functions

fcmp(a, b, epsilon) -> -1, 0, 1

Modules containing wrappers

These wrappers are used by APIs. Typically these are not directly accessed by the user.

init

pygsl.init module

This module is a collection of internal conversion function. These functions typically need not be accessed by the pygsl user. All functionality is wrapped by appropriate functions and exported to the user at a higher level

Warning

Please note the functions given here change the total behaviour of pygsl. If wrongly used it could even crash the program.

pygsl.init.add_c_traceback_frames()

GSL solvers make callbacks to registered python functions at moments often not expected. Therefore traceback frames were added which are automatically inserted by the C Code These traceback frames, however, create a memory leak in the current implementation. So these are disabled by default and can be enabled by setting a true value with this function. Setting to 0/False will disable it again

pygsl.init.complex_transform_counter()

Number of transforms required by complex objects

How many times objects which were passed as complex arguments had to be transformed to appropriate python object?

Parameters:

None

Returns:

number of convertions executed

Return type:

long

pygsl.init.error_handler_state_get()

Get the stored error state

User access best using: pygsl.errors.error_safe_state

pygsl.init.error_handler_state_reset()

Reset the stored error state

User access best using: pygsl.errors.error_safe_state

pygsl.init.float_transform_counter()

Number of transforms required by float objects

How many times objects which were passed as float arguments had to be transformed to appropriate object? (e.g. an integer had to be converted to a float)

Parameters:

None

Returns:

number of convertions executed

Return type:

long

pygsl.init.get_debug_level()

Get the internal debug level

see pygsl.set_debug_level() for details

pygsl.init.matrix_transform_counter()

Number of transforms required by matrix objects

How many times objects which were passed as matrix arguments had to be transformed to appropriate numpy array?

Parameters:

None

Returns:

number of convertions executed

Return type:

long

pygsl.init.register_exceptions()

Used to register all exceptions

Warning

Internal function! Do not use it if not familar!

pygsl.init.register_warnings()

Used to register all exceptions

Warning

Internal function! Do not use it if not familar!

pygsl.init.set_debug_level()

Set the internal debug level

see pygsl.set_debug_level() for details

pygsl.init.vector_transform_counter()

Number of transforms required by vector objects

How many times objects which were passed as vector arguments had to be transformed to appropriate numpy array?

Parameters:

None

Returns:

number of convertions executed

Return type:

long

gsl_function

Collection of Callbacks systems for pygsl. They follow the GSL definitions as close as possible. Instead os a struct python classes are used.

All solvers accept a C void pointer, which is passed to the callback. In Pygsl this is an abitrary python object. See the doc strings of the various classes for further detail.

class pygsl.gsl_function.gsl_function(func, args)[source]

Bases: _gsl_function

This class defines the callbacks known as gsl_function to gsl.

e.g to supply the function f:

def f(x, params):

a = params[0] b = parmas[1] c = params[3] return a * x ** 2 + b * x + c

to some solver, use

function = gsl_function(f, params)

freefunc()
initfunc()
class pygsl.gsl_function.gsl_function_fdf(func, deriv, fdf, args)[source]

Bases: _gsl_function_fdf

This class defines the callbacks known as gsl_function_fdf to gsl.

e.g to supply the function f:

def f(x, None):

return exp(2 * x)

def df(x, None):

return 2 * exp(2 * x)

def fdf(x, None):

myf = f(x, None) mydf = df(x, None) return myf, mydf

to some solver, accepting gsl_function_fdf, use

function = gsl_function_fdf(f, df, fdf, params)

freefunc()
initfunc()
class pygsl.gsl_function.gsl_monte_function(func, args, size)[source]

Bases: gsl_multiroot_function

This class defines the callbacks for gsl_monte_function.

freefunc()
initfunc()
class pygsl.gsl_function.gsl_multifit_function(f, args, n, p)[source]

Bases: _gsl_function

This class defines the callbacks for gsl_multimin_function.

To fit a exponential function to data write the following function:

def exp_f(x, params):

A = x[0] lambda_ = x[1] b = x[2] t= params[0] yi = params[1] sigma = params[2] Yi = A * exp(-lambda_ * t) + b f = yi - Yi / sigma return f

# Number of data samples n = len(data) # Number of paramters p = 3 multifit_nlin.gsl_multifit_function(exp_f, data, n, p)

freefunc()
initfunc()
class pygsl.gsl_function.gsl_multifit_function_fdf(f, df, fdf, args, n, p)[source]

Bases: _gsl_function_fdf

This class defines the callbacks for gsl_multimin_function. def exp_f(x, params):

A = x[0] lambda_ = x[1] b = x[2] t= params[0] yi = params[1] sigma = params[2] Yi = A * exp(-lambda_ * t) + b f = yi - Yi / sigma return f

def exp_df(x, params):

A = x[0] lambda_ = x[1] b = x[2] t= params[0] yi = params[1] sigma = params[2] e = exp(-lambda_ * t) e_s = e/sigma df = Numeric.array((e_s, -t * A * e_s, 1/sigma)) df = Numeric.transpose(df) print df.shape return df

def exp_fdf(x, params):

f = exp_f(x, params) df = exp_df(x, params) return f, df

# Number of data samples n = len(data) # Number of paramters p = 3 multifit_nlin.gsl_multifit_function_fdf(exp_f, exp_df, exp_fdf, data, n, p)

freefunc()
initfunc()
class pygsl.gsl_function.gsl_multimin_function(func, args, size)[source]

Bases: gsl_multiroot_function

This class defines the callbacks for gsl_multimin_function.

The following example function defines a simple paraboloid with two parameters.

To supply the system define the function: def my_f(v, params):

x = v[0] y = v[1]

dp = params t1 = (x - dp[0]) t2 = (y - dp[1]) f = 10.0 * t1 * t1 + 20.0 * t2 * t2 + 30.0 return f

# dimension of x size = 2

sys = multimin.gsl_multifit_function(my_f, params, 2)

freefunc()
initfunc()
class pygsl.gsl_function.gsl_multimin_function_fdf(f, df, fdf, args, size)[source]

Bases: gsl_multiroot_function_fdf

This class defines the callbacks for gsl_multimin_function_fdf.

The following example function defines a simple paraboloid with two parameters.

To supply the system define the function: def my_f(v, params):

x = v[0] y = v[1]

dp = params t1 = (x - dp[0]) t2 = (y - dp[1]) f = 10.0 * t1 * t1 + 20.0 * t2 * t2 + 30.0 return f

def my_df(v, params):

x = v[0] y = v[1] df = Numeric.zeros(v.shape, Numeric.Float) dp = params df[0] = 20. * (x - dp[0]) df[1] = 40. * (y - dp[1]) return df

def my_fdf(v, params):

f = my_f(v, params) df = my_df(v,params) return f, df

# dimension of x size = 2 sys = multimin.gsl_multifit_function(my_f, my_df, my_fdf, params, size)

freefunc()
initfunc()
class pygsl.gsl_function.gsl_multiroot_function(func, args, size)[source]

Bases: _gsl_function

This class defines the callbacks for gsl_multiroot_function.

To supply the function rosenbrock define the function:

def rosenbrock_f(x, params):

a = params[0] b = params[1] y = copy.copy(x) y[0] = a * (1 - x[0]) y[1] = b * (x[1] - x[0] * x[0]) return y

sys = multiroots.gsl_multiroot_function(rosenbrock_f, params, 2)

freefunc()
initfunc()
class pygsl.gsl_function.gsl_multiroot_function_fdf(f, df, fdf, args, size)[source]

Bases: _gsl_function_fdf

This class defines the callbacks for gsl_multiroot_function.

To supply the function rosenbrock define the functions:

def rosenbrock_f(x, params):

a = params[0] b = params[1] y = copy.copy(x) y[0] = a * (1 - x[0]) y[1] = b * (x[1] - x[0] * x[0]) return y

def rosenbrock_df(x, params):

a = params[0] b = params[1] df = Numeric.zeros((x.shape[0], x.shape[0]), Numeric.Float) df[0,0] = -a df[0,1] = 0 df[1,0] = -2 * b * x[0] df[1,1] = b return df

def rosenbrock_fdf(x, params):

f = rosenbrock_f(x, params) df = rosenbrock_df(x, params) return f, df

# dimension of x size = 2 sys = multiroots.gsl_multiroot_function(rosenbrock_f, rosenbrock_df,

rosenbrock_fdf, params, size)

freefunc()
initfunc()

gslwrap

class pygsl.gslwrap.Combination(n, k)[source]

Bases: object

Proxy of C gsl_combination_struct struct.

__getitem__(Combination self, size_t const i) size_t[source]
init_first(Combination self)[source]
init_last(Combination self)[source]
k(Combination self) size_t[source]
n(Combination self) size_t[source]
next(Combination self) int[source]
prev(Combination self) int[source]
property thisown

The membership flag

toarray(Combination self) PyObject *[source]
tolist(Combination self) PyObject *[source]
valid(Combination self) int[source]
class pygsl.gslwrap.Permutation(n)[source]

Bases: object

Proxy of C gsl_permutation_struct struct.

__getitem__(Permutation self, size_t const i) size_t[source]
Parameters:

i (size_t const)

__len__(Permutation self) size_t[source]
__str__(Permutation self) char *[source]
canonical_cycles(Permutation self) size_t[source]
property data

p.size_t

Type:

data

inversions(Permutation self) size_t[source]
linear_cycles(Permutation self) size_t[source]
next(Permutation self) int[source]
prev(Permutation self) int[source]
reverse(Permutation self)[source]
property size

size_t

Type:

size

swap(Permutation self, size_t const i, size_t const j) gsl_error_flag_drop[source]
Parameters:
  • i (size_t const)

  • j (size_t const)

property thisown

The membership flag

toarray(Permutation self) PyObject *[source]
tolist(Permutation self) PyObject *[source]
valid(Permutation self) gsl_error_flag_drop[source]
pygsl.gslwrap.gsl_acosh(double const x) double[source]
pygsl.gslwrap.gsl_asinh(double const x) double[source]
pygsl.gslwrap.gsl_atanh(double const x) double[source]
pygsl.gslwrap.gsl_blas_caxpy(gsl_complex_float const alpha, gsl_vector_complex_float const * X, gsl_vector_complex_float * Y) int[source]
pygsl.gslwrap.gsl_blas_ccopy(gsl_vector_complex_float const * X, gsl_vector_complex_float * Y) int[source]
pygsl.gslwrap.gsl_blas_cdotc(gsl_vector_complex_float const * X, gsl_vector_complex_float const * Y, gsl_complex_float * dotc) int[source]
pygsl.gslwrap.gsl_blas_cdotu(gsl_vector_complex_float const * X, gsl_vector_complex_float const * Y, gsl_complex_float * dotu) int[source]
pygsl.gslwrap.gsl_blas_cgemm(CBLAS_TRANSPOSE_t TransA, CBLAS_TRANSPOSE_t TransB, gsl_complex_float const alpha, gsl_matrix_complex_float const * A, gsl_matrix_complex_float const * B, gsl_complex_float const beta, gsl_matrix_complex_float * C) int[source]
pygsl.gslwrap.gsl_blas_cgemv(CBLAS_TRANSPOSE_t TransA, gsl_complex_float const alpha, gsl_matrix_complex_float const * A, gsl_vector_complex_float const * X, gsl_complex_float const beta, gsl_vector_complex_float * Y) int[source]
pygsl.gslwrap.gsl_blas_cgerc(gsl_complex_float const alpha, gsl_vector_complex_float const * X, gsl_vector_complex_float const * Y, gsl_matrix_complex_float * A) int[source]
pygsl.gslwrap.gsl_blas_cgeru(gsl_complex_float const alpha, gsl_vector_complex_float const * X, gsl_vector_complex_float const * Y, gsl_matrix_complex_float * A) int[source]
pygsl.gslwrap.gsl_blas_chemm(CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, gsl_complex_float const alpha, gsl_matrix_complex_float const * A, gsl_matrix_complex_float const * B, gsl_complex_float const beta, gsl_matrix_complex_float * C) int[source]
pygsl.gslwrap.gsl_blas_chemv(CBLAS_UPLO_t Uplo, gsl_complex_float const alpha, gsl_matrix_complex_float const * A, gsl_vector_complex_float const * X, gsl_complex_float const beta, gsl_vector_complex_float * Y) int[source]
pygsl.gslwrap.gsl_blas_cher(CBLAS_UPLO_t Uplo, float alpha, gsl_vector_complex_float const * X, gsl_matrix_complex_float * A) int[source]
pygsl.gslwrap.gsl_blas_cher2(CBLAS_UPLO_t Uplo, gsl_complex_float const alpha, gsl_vector_complex_float const * X, gsl_vector_complex_float const * Y, gsl_matrix_complex_float * A) int[source]
pygsl.gslwrap.gsl_blas_cher2k(CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t Trans, gsl_complex_float const alpha, gsl_matrix_complex_float const * A, gsl_matrix_complex_float const * B, float beta, gsl_matrix_complex_float * C) int[source]
pygsl.gslwrap.gsl_blas_cherk(CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t Trans, float alpha, gsl_matrix_complex_float const * A, float beta, gsl_matrix_complex_float * C) int[source]
pygsl.gslwrap.gsl_blas_cscal(gsl_complex_float const alpha, gsl_vector_complex_float * X)[source]
pygsl.gslwrap.gsl_blas_csscal(float alpha, gsl_vector_complex_float * X)[source]
pygsl.gslwrap.gsl_blas_cswap(gsl_vector_complex_float * X, gsl_vector_complex_float * Y) int[source]
pygsl.gslwrap.gsl_blas_csymm(CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, gsl_complex_float const alpha, gsl_matrix_complex_float const * A, gsl_matrix_complex_float const * B, gsl_complex_float const beta, gsl_matrix_complex_float * C) int[source]
pygsl.gslwrap.gsl_blas_csyr2k(CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t Trans, gsl_complex_float const alpha, gsl_matrix_complex_float const * A, gsl_matrix_complex_float const * B, gsl_complex_float const beta, gsl_matrix_complex_float * C) int[source]
pygsl.gslwrap.gsl_blas_csyrk(CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t Trans, gsl_complex_float const alpha, gsl_matrix_complex_float const * A, gsl_complex_float const beta, gsl_matrix_complex_float * C) int[source]
pygsl.gslwrap.gsl_blas_ctrmm(CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, gsl_complex_float const alpha, gsl_matrix_complex_float const * A, gsl_matrix_complex_float * B) int[source]
pygsl.gslwrap.gsl_blas_ctrmv(CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, gsl_matrix_complex_float const * A, gsl_vector_complex_float * X) int[source]
pygsl.gslwrap.gsl_blas_ctrsm(CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, gsl_complex_float const alpha, gsl_matrix_complex_float const * A, gsl_matrix_complex_float * B) int[source]
pygsl.gslwrap.gsl_blas_ctrsv(CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, gsl_matrix_complex_float const * A, gsl_vector_complex_float * X) int[source]
pygsl.gslwrap.gsl_blas_dasum(gsl_vector const * X) double[source]
pygsl.gslwrap.gsl_blas_daxpy(double alpha, gsl_vector const * X, gsl_vector * Y) int[source]
pygsl.gslwrap.gsl_blas_dcopy(gsl_vector const * X, gsl_vector * Y) int[source]
pygsl.gslwrap.gsl_blas_ddot(gsl_vector const * X, gsl_vector const * Y) int[source]
pygsl.gslwrap.gsl_blas_dgemm(CBLAS_TRANSPOSE_t TransA, CBLAS_TRANSPOSE_t TransB, double alpha, gsl_matrix const * A, gsl_matrix const * B, double beta, gsl_matrix * C) int[source]
pygsl.gslwrap.gsl_blas_dgemv(CBLAS_TRANSPOSE_t TransA, double alpha, gsl_matrix const * A, gsl_vector const * X, double beta, gsl_vector * Y) int[source]
pygsl.gslwrap.gsl_blas_dger(double alpha, gsl_vector const * X, gsl_vector const * Y, gsl_matrix * A) int[source]
pygsl.gslwrap.gsl_blas_dnrm2(gsl_vector const * X) double[source]
pygsl.gslwrap.gsl_blas_drot(gsl_vector * X, gsl_vector * Y, double const c, double const s) int[source]
pygsl.gslwrap.gsl_blas_drotg(double [] a, double [] b, double [] c, double [] s) int[source]
pygsl.gslwrap.gsl_blas_drotm(gsl_vector * X, gsl_vector * Y, double const [] P) int[source]
pygsl.gslwrap.gsl_blas_drotmg(double [] d1, double [] d2, double [] b1, double b2, double [] P) int[source]
pygsl.gslwrap.gsl_blas_dscal(double alpha, gsl_vector * X)[source]
pygsl.gslwrap.gsl_blas_dsdot(gsl_vector_float const * X, gsl_vector_float const * Y) int[source]
pygsl.gslwrap.gsl_blas_dswap(gsl_vector * X, gsl_vector * Y) int[source]
pygsl.gslwrap.gsl_blas_dsymm(CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, double alpha, gsl_matrix const * A, gsl_matrix const * B, double beta, gsl_matrix * C) int[source]
pygsl.gslwrap.gsl_blas_dsymv(CBLAS_UPLO_t Uplo, double alpha, gsl_matrix const * A, gsl_vector const * X, double beta, gsl_vector * Y) int[source]
pygsl.gslwrap.gsl_blas_dsyr(CBLAS_UPLO_t Uplo, double alpha, gsl_vector const * X, gsl_matrix * A) int[source]
pygsl.gslwrap.gsl_blas_dsyr2(CBLAS_UPLO_t Uplo, double alpha, gsl_vector const * X, gsl_vector const * Y, gsl_matrix * A) int[source]
pygsl.gslwrap.gsl_blas_dsyr2k(CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t Trans, double alpha, gsl_matrix const * A, gsl_matrix const * B, double beta, gsl_matrix * C) int[source]
pygsl.gslwrap.gsl_blas_dsyrk(CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t Trans, double alpha, gsl_matrix const * A, double beta, gsl_matrix * C) int[source]
pygsl.gslwrap.gsl_blas_dtrmm(CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, double alpha, gsl_matrix const * A, gsl_matrix * B) int[source]
pygsl.gslwrap.gsl_blas_dtrmv(CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, gsl_matrix const * A, gsl_vector * X) int[source]
pygsl.gslwrap.gsl_blas_dtrsm(CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, double alpha, gsl_matrix const * A, gsl_matrix * B) int[source]
pygsl.gslwrap.gsl_blas_dtrsv(CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, gsl_matrix const * A, gsl_vector * X) int[source]
pygsl.gslwrap.gsl_blas_dzasum(gsl_vector_complex const * X) double[source]
pygsl.gslwrap.gsl_blas_dznrm2(gsl_vector_complex const * X) double[source]
pygsl.gslwrap.gsl_blas_icamax(gsl_vector_complex_float const * X) CBLAS_INDEX_t[source]
pygsl.gslwrap.gsl_blas_idamax(gsl_vector const * X) CBLAS_INDEX_t[source]
pygsl.gslwrap.gsl_blas_isamax(gsl_vector_float const * X) CBLAS_INDEX_t[source]
pygsl.gslwrap.gsl_blas_izamax(gsl_vector_complex const * X) CBLAS_INDEX_t[source]
pygsl.gslwrap.gsl_blas_sasum(gsl_vector_float const * X) float[source]
pygsl.gslwrap.gsl_blas_saxpy(float alpha, gsl_vector_float const * X, gsl_vector_float * Y) int[source]
pygsl.gslwrap.gsl_blas_scasum(gsl_vector_complex_float const * X) float[source]
pygsl.gslwrap.gsl_blas_scnrm2(gsl_vector_complex_float const * X) float[source]
pygsl.gslwrap.gsl_blas_scopy(gsl_vector_float const * X, gsl_vector_float * Y) int[source]
pygsl.gslwrap.gsl_blas_sdot(gsl_vector_float const * X, gsl_vector_float const * Y, float * result) int[source]
pygsl.gslwrap.gsl_blas_sdsdot(float alpha, gsl_vector_float const * X, gsl_vector_float const * Y, float * result) int[source]
pygsl.gslwrap.gsl_blas_sgemm(CBLAS_TRANSPOSE_t TransA, CBLAS_TRANSPOSE_t TransB, float alpha, gsl_matrix_float const * A, gsl_matrix_float const * B, float beta, gsl_matrix_float * C) int[source]
pygsl.gslwrap.gsl_blas_sgemv(CBLAS_TRANSPOSE_t TransA, float alpha, gsl_matrix_float const * A, gsl_vector_float const * X, float beta, gsl_vector_float * Y) int[source]
pygsl.gslwrap.gsl_blas_sger(float alpha, gsl_vector_float const * X, gsl_vector_float const * Y, gsl_matrix_float * A) int[source]
pygsl.gslwrap.gsl_blas_snrm2(gsl_vector_float const * X) float[source]
pygsl.gslwrap.gsl_blas_srot(gsl_vector_float * X, gsl_vector_float * Y, float c, float s) int[source]
pygsl.gslwrap.gsl_blas_srotg(float [] a, float [] b, float [] c, float [] s) int[source]
pygsl.gslwrap.gsl_blas_srotm(gsl_vector_float * X, gsl_vector_float * Y, float const [] P) int[source]
pygsl.gslwrap.gsl_blas_srotmg(float [] d1, float [] d2, float [] b1, float b2, float [] P) int[source]
pygsl.gslwrap.gsl_blas_sscal(float alpha, gsl_vector_float * X)[source]
pygsl.gslwrap.gsl_blas_sswap(gsl_vector_float * X, gsl_vector_float * Y) int[source]
pygsl.gslwrap.gsl_blas_ssymm(CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, float alpha, gsl_matrix_float const * A, gsl_matrix_float const * B, float beta, gsl_matrix_float * C) int[source]
pygsl.gslwrap.gsl_blas_ssymv(CBLAS_UPLO_t Uplo, float alpha, gsl_matrix_float const * A, gsl_vector_float const * X, float beta, gsl_vector_float * Y) int[source]
pygsl.gslwrap.gsl_blas_ssyr(CBLAS_UPLO_t Uplo, float alpha, gsl_vector_float const * X, gsl_matrix_float * A) int[source]
pygsl.gslwrap.gsl_blas_ssyr2(CBLAS_UPLO_t Uplo, float alpha, gsl_vector_float const * X, gsl_vector_float const * Y, gsl_matrix_float * A) int[source]
pygsl.gslwrap.gsl_blas_ssyr2k(CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t Trans, float alpha, gsl_matrix_float const * A, gsl_matrix_float const * B, float beta, gsl_matrix_float * C) int[source]
pygsl.gslwrap.gsl_blas_ssyrk(CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t Trans, float alpha, gsl_matrix_float const * A, float beta, gsl_matrix_float * C) int[source]
pygsl.gslwrap.gsl_blas_strmm(CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, float alpha, gsl_matrix_float const * A, gsl_matrix_float * B) int[source]
pygsl.gslwrap.gsl_blas_strmv(CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, gsl_matrix_float const * A, gsl_vector_float * X) int[source]
pygsl.gslwrap.gsl_blas_strsm(CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, float alpha, gsl_matrix_float const * A, gsl_matrix_float * B) int[source]
pygsl.gslwrap.gsl_blas_strsv(CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, gsl_matrix_float const * A, gsl_vector_float * X) int[source]
pygsl.gslwrap.gsl_blas_zaxpy(gsl_complex const alpha, gsl_vector_complex const * X, gsl_vector_complex * Y) int[source]
pygsl.gslwrap.gsl_blas_zcopy(gsl_vector_complex const * X, gsl_vector_complex * Y) int[source]
pygsl.gslwrap.gsl_blas_zdotc(gsl_vector_complex const * X, gsl_vector_complex const * Y, gsl_complex * dotc) int[source]
pygsl.gslwrap.gsl_blas_zdotu(gsl_vector_complex const * X, gsl_vector_complex const * Y, gsl_complex * dotu) int[source]
pygsl.gslwrap.gsl_blas_zdscal(double alpha, gsl_vector_complex * X)[source]
pygsl.gslwrap.gsl_blas_zgemm(CBLAS_TRANSPOSE_t TransA, CBLAS_TRANSPOSE_t TransB, gsl_complex const alpha, gsl_matrix_complex const * A, gsl_matrix_complex const * B, gsl_complex const beta, gsl_matrix_complex * C) int[source]
pygsl.gslwrap.gsl_blas_zgemv(CBLAS_TRANSPOSE_t TransA, gsl_complex const alpha, gsl_matrix_complex const * A, gsl_vector_complex const * X, gsl_complex const beta, gsl_vector_complex * Y) int[source]
pygsl.gslwrap.gsl_blas_zgerc(gsl_complex const alpha, gsl_vector_complex const * X, gsl_vector_complex const * Y, gsl_matrix_complex * A) int[source]
pygsl.gslwrap.gsl_blas_zgeru(gsl_complex const alpha, gsl_vector_complex const * X, gsl_vector_complex const * Y, gsl_matrix_complex * A) int[source]
pygsl.gslwrap.gsl_blas_zhemm(CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, gsl_complex const alpha, gsl_matrix_complex const * A, gsl_matrix_complex const * B, gsl_complex const beta, gsl_matrix_complex * C) int[source]
pygsl.gslwrap.gsl_blas_zhemv(CBLAS_UPLO_t Uplo, gsl_complex const alpha, gsl_matrix_complex const * A, gsl_vector_complex const * X, gsl_complex const beta, gsl_vector_complex * Y) int[source]
pygsl.gslwrap.gsl_blas_zher(CBLAS_UPLO_t Uplo, double alpha, gsl_vector_complex const * X, gsl_matrix_complex * A) int[source]
pygsl.gslwrap.gsl_blas_zher2(CBLAS_UPLO_t Uplo, gsl_complex const alpha, gsl_vector_complex const * X, gsl_vector_complex const * Y, gsl_matrix_complex * A) int[source]
pygsl.gslwrap.gsl_blas_zher2k(CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t Trans, gsl_complex const alpha, gsl_matrix_complex const * A, gsl_matrix_complex const * B, double beta, gsl_matrix_complex * C) int[source]
pygsl.gslwrap.gsl_blas_zherk(CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t Trans, double alpha, gsl_matrix_complex const * A, double beta, gsl_matrix_complex * C) int[source]
pygsl.gslwrap.gsl_blas_zscal(gsl_complex const alpha, gsl_vector_complex * X)[source]
pygsl.gslwrap.gsl_blas_zswap(gsl_vector_complex * X, gsl_vector_complex * Y) int[source]
pygsl.gslwrap.gsl_blas_zsymm(CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, gsl_complex const alpha, gsl_matrix_complex const * A, gsl_matrix_complex const * B, gsl_complex const beta, gsl_matrix_complex * C) int[source]
pygsl.gslwrap.gsl_blas_zsyr2k(CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t Trans, gsl_complex const alpha, gsl_matrix_complex const * A, gsl_matrix_complex const * B, gsl_complex const beta, gsl_matrix_complex * C) int[source]
pygsl.gslwrap.gsl_blas_zsyrk(CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t Trans, gsl_complex const alpha, gsl_matrix_complex const * A, gsl_complex const beta, gsl_matrix_complex * C) int[source]
pygsl.gslwrap.gsl_blas_ztrmm(CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, gsl_complex const alpha, gsl_matrix_complex const * A, gsl_matrix_complex * B) int[source]
pygsl.gslwrap.gsl_blas_ztrmv(CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, gsl_matrix_complex const * A, gsl_vector_complex * X) int[source]
pygsl.gslwrap.gsl_blas_ztrsm(CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, gsl_complex const alpha, gsl_matrix_complex const * A, gsl_matrix_complex * B) int[source]
pygsl.gslwrap.gsl_blas_ztrsv(CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, gsl_matrix_complex const * A, gsl_vector_complex * X) int[source]
pygsl.gslwrap.gsl_coerce_double(double const x) double[source]
pygsl.gslwrap.gsl_coerce_float(float const x) float[source]
pygsl.gslwrap.gsl_coerce_long_double(long double const x) long double[source]
pygsl.gslwrap.gsl_eigen_francis(gsl_matrix * H, gsl_vector_complex * eval, gsl_eigen_francis_workspace w) int[source]
pygsl.gslwrap.gsl_eigen_francis_T(int const compute_t, gsl_eigen_francis_workspace w)[source]
pygsl.gslwrap.gsl_eigen_francis_Z(gsl_matrix * H, gsl_vector_complex * eval, gsl_matrix * Z, gsl_eigen_francis_workspace w) int[source]
pygsl.gslwrap.gsl_eigen_francis_alloc() gsl_eigen_francis_workspace[source]
pygsl.gslwrap.gsl_eigen_francis_free(gsl_eigen_francis_workspace w)[source]
class pygsl.gslwrap.gsl_eigen_francis_workspace[source]

Bases: object

Proxy of C gsl_eigen_francis_workspace struct.

property H

p.gsl_matrix

Type:

H

property Z

p.gsl_matrix

Type:

Z

property compute_t

int

Type:

compute_t

property max_iterations

size_t

Type:

max_iterations

property n_evals

size_t

Type:

n_evals

property n_iter

size_t

Type:

n_iter

property size

size_t

Type:

size

property thisown

The membership flag

pygsl.gslwrap.gsl_eigen_gen(gsl_matrix * A, gsl_matrix * B, gsl_vector_complex * alpha, gsl_vector * beta, gsl_eigen_gen_workspace w) int[source]
pygsl.gslwrap.gsl_eigen_gen_QZ(gsl_matrix * A, gsl_matrix * B, gsl_vector_complex * alpha, gsl_vector * beta, gsl_matrix * Q, gsl_matrix * Z, gsl_eigen_gen_workspace w) int[source]
pygsl.gslwrap.gsl_eigen_gen_alloc(size_t const n) gsl_eigen_gen_workspace[source]
pygsl.gslwrap.gsl_eigen_gen_free(gsl_eigen_gen_workspace w)[source]
pygsl.gslwrap.gsl_eigen_gen_params(int const compute_s, int const compute_t, int const balance, gsl_eigen_gen_workspace w)[source]
class pygsl.gslwrap.gsl_eigen_gen_workspace(n)[source]

Bases: object

Proxy of C gsl_eigen_gen_workspace struct.

property H

p.gsl_matrix

Type:

H

property Q

p.gsl_matrix

Type:

Q

property R

p.gsl_matrix

Type:

R

property Z

p.gsl_matrix

Type:

Z

property ascale

double

Type:

ascale

property atol

double

Type:

atol

property bscale

double

Type:

bscale

property btol

double

Type:

btol

property compute_s

int

Type:

compute_s

property compute_t

int

Type:

compute_t

property eshift

double

Type:

eshift

property max_iterations

size_t

Type:

max_iterations

property n_evals

size_t

Type:

n_evals

property n_iter

size_t

Type:

n_iter

property needtop

int

Type:

needtop

property size

size_t

Type:

size

property thisown

The membership flag

property work

p.gsl_vector

Type:

work

pygsl.gslwrap.gsl_eigen_genherm(gsl_matrix_complex * A, gsl_matrix_complex * B, gsl_vector * eval, gsl_eigen_genherm_workspace w) int[source]
pygsl.gslwrap.gsl_eigen_genherm_alloc(size_t const n) gsl_eigen_genherm_workspace[source]
pygsl.gslwrap.gsl_eigen_genherm_free(gsl_eigen_genherm_workspace w)[source]
pygsl.gslwrap.gsl_eigen_genherm_standardize(gsl_matrix_complex * A, gsl_matrix_complex const * B) int[source]
class pygsl.gslwrap.gsl_eigen_genherm_workspace(n)[source]

Bases: object

Proxy of C gsl_eigen_genherm_workspace struct.

property herm_workspace_p

p.gsl_eigen_herm_workspace

Type:

herm_workspace_p

property size

size_t

Type:

size

property thisown

The membership flag

pygsl.gslwrap.gsl_eigen_genhermv(gsl_matrix_complex * A, gsl_matrix_complex * B, gsl_vector * eval, gsl_matrix_complex * evec, gsl_eigen_genhermv_workspace w) int[source]
pygsl.gslwrap.gsl_eigen_genhermv_alloc(size_t const n) gsl_eigen_genhermv_workspace[source]
pygsl.gslwrap.gsl_eigen_genhermv_free(gsl_eigen_genhermv_workspace w)[source]
pygsl.gslwrap.gsl_eigen_genhermv_sort(gsl_vector * eval, gsl_matrix_complex * evec, gsl_eigen_sort_t sort_type) int[source]
class pygsl.gslwrap.gsl_eigen_genhermv_workspace(n)[source]

Bases: object

Proxy of C gsl_eigen_genhermv_workspace struct.

property hermv_workspace_p

p.gsl_eigen_hermv_workspace

Type:

hermv_workspace_p

property size

size_t

Type:

size

property thisown

The membership flag

pygsl.gslwrap.gsl_eigen_gensymm(gsl_matrix * A, gsl_matrix * B, gsl_vector * eval, gsl_eigen_gensymm_workspace w) int[source]
pygsl.gslwrap.gsl_eigen_gensymm_alloc(size_t const n) gsl_eigen_gensymm_workspace[source]
pygsl.gslwrap.gsl_eigen_gensymm_free(gsl_eigen_gensymm_workspace w)[source]
pygsl.gslwrap.gsl_eigen_gensymm_standardize(gsl_matrix * A, gsl_matrix const * B) int[source]
class pygsl.gslwrap.gsl_eigen_gensymm_workspace[source]

Bases: object

Proxy of C gsl_eigen_gensymm_workspace struct.

property size

size_t

Type:

size

property symm_workspace_p

p.gsl_eigen_symm_workspace

Type:

symm_workspace_p

property thisown

The membership flag

pygsl.gslwrap.gsl_eigen_gensymmv(gsl_matrix * A, gsl_matrix * B, gsl_vector * eval, gsl_matrix * evec, gsl_eigen_gensymmv_workspace w) int[source]
pygsl.gslwrap.gsl_eigen_gensymmv_alloc(size_t const n) gsl_eigen_gensymmv_workspace[source]
pygsl.gslwrap.gsl_eigen_gensymmv_free(gsl_eigen_gensymmv_workspace w)[source]
pygsl.gslwrap.gsl_eigen_gensymmv_sort(gsl_vector * eval, gsl_matrix * evec, gsl_eigen_sort_t sort_type) int[source]
class pygsl.gslwrap.gsl_eigen_gensymmv_workspace[source]

Bases: object

Proxy of C gsl_eigen_gensymmv_workspace struct.

property size

size_t

Type:

size

property symmv_workspace_p

p.gsl_eigen_symmv_workspace

Type:

symmv_workspace_p

property thisown

The membership flag

pygsl.gslwrap.gsl_eigen_genv(gsl_matrix * A, gsl_matrix * B, gsl_vector_complex * alpha, gsl_vector * beta, gsl_matrix_complex * evec, gsl_eigen_genv_workspace w) int[source]
pygsl.gslwrap.gsl_eigen_genv_QZ(gsl_matrix * A, gsl_matrix * B, gsl_vector_complex * alpha, gsl_vector * beta, gsl_matrix_complex * evec, gsl_matrix * Q, gsl_matrix * Z, gsl_eigen_genv_workspace w) int[source]
pygsl.gslwrap.gsl_eigen_genv_alloc(size_t const n) gsl_eigen_genv_workspace[source]
pygsl.gslwrap.gsl_eigen_genv_free(gsl_eigen_genv_workspace w)[source]
pygsl.gslwrap.gsl_eigen_genv_sort(gsl_vector_complex * alpha, gsl_vector * beta, gsl_matrix_complex * evec, gsl_eigen_sort_t sort_type) int[source]
class pygsl.gslwrap.gsl_eigen_genv_workspace(n)[source]

Bases: object

Proxy of C gsl_eigen_genv_workspace struct.

property Q

p.gsl_matrix

Type:

Q

property Z

p.gsl_matrix

Type:

Z

property gen_workspace_p

p.gsl_eigen_gen_workspace

Type:

gen_workspace_p

property size

size_t

Type:

size

property thisown

The membership flag

property work1

p.gsl_vector

Type:

work1

property work2

p.gsl_vector

Type:

work2

property work3

p.gsl_vector

Type:

work3

property work4

p.gsl_vector

Type:

work4

property work5

p.gsl_vector

Type:

work5

property work6

p.gsl_vector

Type:

work6

pygsl.gslwrap.gsl_eigen_herm(gsl_matrix_complex * A, gsl_vector * eval, gsl_eigen_herm_workspace w) int[source]
pygsl.gslwrap.gsl_eigen_herm_alloc(size_t const n) gsl_eigen_herm_workspace[source]
pygsl.gslwrap.gsl_eigen_herm_free(gsl_eigen_herm_workspace w)[source]
class pygsl.gslwrap.gsl_eigen_herm_workspace(n)[source]

Bases: object

Proxy of C gsl_eigen_herm_workspace struct.

property d

p.double

Type:

d

property sd

p.double

Type:

sd

property size

size_t

Type:

size

property tau

p.double

Type:

tau

property thisown

The membership flag

pygsl.gslwrap.gsl_eigen_hermv(gsl_matrix_complex * A, gsl_vector * eval, gsl_matrix_complex * evec, gsl_eigen_hermv_workspace w) int[source]
pygsl.gslwrap.gsl_eigen_hermv_alloc(size_t const n) gsl_eigen_hermv_workspace[source]
pygsl.gslwrap.gsl_eigen_hermv_free(gsl_eigen_hermv_workspace w)[source]
pygsl.gslwrap.gsl_eigen_hermv_sort(gsl_vector * eval, gsl_matrix_complex * evec, gsl_eigen_sort_t sort_type) int[source]
class pygsl.gslwrap.gsl_eigen_hermv_workspace(n)[source]

Bases: object

Proxy of C gsl_eigen_hermv_workspace struct.

property d

p.double

Type:

d

property gc

p.double

Type:

gc

property gs

p.double

Type:

gs

property sd

p.double

Type:

sd

property size

size_t

Type:

size

property tau

p.double

Type:

tau

property thisown

The membership flag

pygsl.gslwrap.gsl_eigen_invert_jacobi(gsl_matrix const * matrix, gsl_matrix * ainv, unsigned int max_rot) int[source]
pygsl.gslwrap.gsl_eigen_jacobi(gsl_matrix * matrix, gsl_vector * eval, gsl_matrix * evec, unsigned int max_rot, unsigned int * nrot) int[source]
pygsl.gslwrap.gsl_eigen_nonsymm(gsl_matrix * A, gsl_vector_complex * eval, gsl_eigen_nonsymm_workspace w) int[source]
pygsl.gslwrap.gsl_eigen_nonsymm_Z(gsl_matrix * A, gsl_vector_complex * eval, gsl_matrix * Z, gsl_eigen_nonsymm_workspace w) int[source]
pygsl.gslwrap.gsl_eigen_nonsymm_alloc(size_t const n) gsl_eigen_nonsymm_workspace[source]
pygsl.gslwrap.gsl_eigen_nonsymm_free(gsl_eigen_nonsymm_workspace w)[source]
pygsl.gslwrap.gsl_eigen_nonsymm_params(int const compute_t, int const balance, gsl_eigen_nonsymm_workspace w)[source]
class pygsl.gslwrap.gsl_eigen_nonsymm_workspace(n)[source]

Bases: object

Proxy of C gsl_eigen_nonsymm_workspace struct.

property Z

p.gsl_matrix

Type:

Z

property diag

p.gsl_vector

Type:

diag

property do_balance

int

Type:

do_balance

property francis_workspace_p

p.gsl_eigen_francis_workspace

Type:

francis_workspace_p

property n_evals

size_t

Type:

n_evals

params(gsl_eigen_nonsymm_workspace self, int const compute_t, int const balance) gsl_error_flag_drop[source]
property size

size_t

Type:

size

property tau

p.gsl_vector

Type:

tau

property thisown

The membership flag

pygsl.gslwrap.gsl_eigen_nonsymmv(gsl_matrix * A, gsl_vector_complex * eval, gsl_matrix_complex * evec, gsl_eigen_nonsymmv_workspace w) int[source]
pygsl.gslwrap.gsl_eigen_nonsymmv_Z(gsl_matrix * A, gsl_vector_complex * eval, gsl_matrix_complex * evec, gsl_matrix * Z, gsl_eigen_nonsymmv_workspace w) int[source]
pygsl.gslwrap.gsl_eigen_nonsymmv_alloc(size_t const n) gsl_eigen_nonsymmv_workspace[source]
pygsl.gslwrap.gsl_eigen_nonsymmv_free(gsl_eigen_nonsymmv_workspace w)[source]
pygsl.gslwrap.gsl_eigen_nonsymmv_sort(gsl_vector_complex * eval, gsl_matrix_complex * evec, gsl_eigen_sort_t sort_type) int[source]
class pygsl.gslwrap.gsl_eigen_nonsymmv_workspace[source]

Bases: object

Proxy of C gsl_eigen_nonsymmv_workspace struct.

property Z

p.gsl_matrix

Type:

Z

property nonsymm_workspace_p

p.gsl_eigen_nonsymm_workspace

Type:

nonsymm_workspace_p

property size

size_t

Type:

size

property thisown

The membership flag

property work

p.gsl_vector

Type:

work

property work2

p.gsl_vector

Type:

work2

property work3

p.gsl_vector

Type:

work3

pygsl.gslwrap.gsl_eigen_symm(gsl_matrix * A, gsl_vector * eval, gsl_eigen_symm_workspace w) int[source]
pygsl.gslwrap.gsl_eigen_symm_alloc(size_t const n) gsl_eigen_symm_workspace[source]
pygsl.gslwrap.gsl_eigen_symm_free(gsl_eigen_symm_workspace w)[source]
class pygsl.gslwrap.gsl_eigen_symm_workspace(n)[source]

Bases: object

Proxy of C gsl_eigen_symm_workspace struct.

property d

p.double

Type:

d

property sd

p.double

Type:

sd

property size

size_t

Type:

size

property thisown

The membership flag

pygsl.gslwrap.gsl_eigen_symmv(gsl_matrix * A, gsl_vector * eval, gsl_matrix * evec, gsl_eigen_symmv_workspace w) int[source]
pygsl.gslwrap.gsl_eigen_symmv_alloc(size_t const n) gsl_eigen_symmv_workspace[source]
pygsl.gslwrap.gsl_eigen_symmv_free(gsl_eigen_symmv_workspace w)[source]
pygsl.gslwrap.gsl_eigen_symmv_sort(gsl_vector * eval, gsl_matrix * evec, gsl_eigen_sort_t sort_type) int[source]
class pygsl.gslwrap.gsl_eigen_symmv_workspace(n)[source]

Bases: object

Proxy of C gsl_eigen_symmv_workspace struct.

property d

p.double

Type:

d

property gc

p.double

Type:

gc

property gs

p.double

Type:

gs

property sd

p.double

Type:

sd

property size

size_t

Type:

size

property thisown

The membership flag

pygsl.gslwrap.gsl_expm1(double const x) double[source]
pygsl.gslwrap.gsl_fcmp(double const x1, double const x2, double const epsilon) int[source]
pygsl.gslwrap.gsl_fdiv(double const x, double const y) double[source]
pygsl.gslwrap.gsl_finite(double const x) int[source]
pygsl.gslwrap.gsl_frexp(double const x, int * e) double[source]
pygsl.gslwrap.gsl_hypot(double const x, double const y) double[source]
pygsl.gslwrap.gsl_hypot3(double const x, double const y, double const z) double[source]
class pygsl.gslwrap.gsl_interp_accel[source]

Bases: object

Proxy of C gsl_interp_accel struct.

find(gsl_interp_accel self, double const [] x_array, double x) size_t[source]
reset(gsl_interp_accel self) gsl_error_flag_drop[source]
property thisown

The membership flag

tocobject(gsl_interp_accel self) PyObject *[source]
pygsl.gslwrap.gsl_interp_bsearch(double const [] x_array, double x, size_t index_lo, size_t index_hi) size_t[source]
pygsl.gslwrap.gsl_isinf(double const x) int[source]
pygsl.gslwrap.gsl_isnan(double const x) int[source]
pygsl.gslwrap.gsl_ldexp(double const x, int const e) double[source]
pygsl.gslwrap.gsl_linalg_COD_decomp(gsl_matrix * A, gsl_vector * tau_Q, gsl_vector * tau_Z, Permutation p, size_t * rank, gsl_vector * work) int[source]
Parameters:
  • A (gsl_matrix *)

  • tau_Q (gsl_vector *)

  • tau_Z (gsl_vector *)

  • p (gsl_permutation *)

  • rank (size_t *)

  • work (gsl_vector *)

pygsl.gslwrap.gsl_linalg_COD_decomp_e(gsl_matrix * A, gsl_vector * tau_Q, gsl_vector * tau_Z, Permutation p, double tol, size_t * rank, gsl_vector * work) int[source]
Parameters:
  • A (gsl_matrix *)

  • tau_Q (gsl_vector *)

  • tau_Z (gsl_vector *)

  • p (gsl_permutation *)

  • tol (double)

  • rank (size_t *)

  • work (gsl_vector *)

pygsl.gslwrap.gsl_linalg_COD_lssolve(gsl_matrix const * QRZT, gsl_vector const * tau_Q, gsl_vector const * tau_Z, Permutation perm, size_t const rank, gsl_vector const * b, gsl_vector * x, gsl_vector * residual) int[source]
Parameters:
  • QRZT (gsl_matrix const *)

  • tau_Q (gsl_vector const *)

  • tau_Z (gsl_vector const *)

  • perm (gsl_permutation const *)

  • rank (size_t const)

  • b (gsl_vector const *)

  • x (gsl_vector *)

  • residual (gsl_vector *)

pygsl.gslwrap.gsl_linalg_COD_lssolve2(double const _lambda, gsl_matrix const * QRZT, gsl_vector const * tau_Q, gsl_vector const * tau_Z, Permutation perm, size_t const rank, gsl_vector const * b, gsl_vector * x, gsl_vector * residual, gsl_matrix * S, gsl_vector * work) int[source]
Parameters:
  • lambda (double const)

  • QRZT (gsl_matrix const *)

  • tau_Q (gsl_vector const *)

  • tau_Z (gsl_vector const *)

  • perm (gsl_permutation const *)

  • rank (size_t const)

  • b (gsl_vector const *)

  • x (gsl_vector *)

  • residual (gsl_vector *)

  • S (gsl_matrix *)

  • work (gsl_vector *)

pygsl.gslwrap.gsl_linalg_COD_matZ(gsl_matrix const * QRZT, gsl_vector const * tau_Z, size_t const rank, gsl_matrix * A, gsl_vector * work) int[source]
Parameters:
  • QRZT (gsl_matrix const *)

  • tau_Z (gsl_vector const *)

  • rank (size_t const)

  • A (gsl_matrix *)

  • work (gsl_vector *)

pygsl.gslwrap.gsl_linalg_COD_unpack(gsl_matrix const * QRZT, gsl_vector const * tau_Q, gsl_vector const * tau_Z, size_t const rank, gsl_matrix * Q, gsl_matrix * R, gsl_matrix * Z) int[source]
Parameters:
  • QRZT (gsl_matrix const *)

  • tau_Q (gsl_vector const *)

  • tau_Z (gsl_vector const *)

  • rank (size_t const)

  • Q (gsl_matrix *)

  • R (gsl_matrix *)

  • Z (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_HH_solve(gsl_matrix * A, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • A (gsl_matrix *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_HH_svx(gsl_matrix * A, gsl_vector * x) int[source]
Parameters:
  • A (gsl_matrix *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_LQ_LQsolve(gsl_matrix * Q, gsl_matrix * L, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • Q (gsl_matrix *)

  • L (gsl_matrix *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_LQ_Lsolve_T(gsl_matrix const * LQ, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • LQ (gsl_matrix const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_LQ_Lsvx_T(gsl_matrix const * LQ, gsl_vector * x) int[source]
Parameters:
  • LQ (gsl_matrix const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_LQ_QTvec(gsl_matrix const * LQ, gsl_vector const * tau, gsl_vector * v) int[source]
Parameters:
  • LQ (gsl_matrix const *)

  • tau (gsl_vector const *)

  • v (gsl_vector *)

pygsl.gslwrap.gsl_linalg_LQ_decomp(gsl_matrix * A, gsl_vector * tau) int[source]
Parameters:
  • A (gsl_matrix *)

  • tau (gsl_vector *)

pygsl.gslwrap.gsl_linalg_LQ_lssolve(gsl_matrix const * LQ, gsl_vector const * tau, gsl_vector const * b, gsl_vector * x, gsl_vector * residual) int[source]
Parameters:
  • LQ (gsl_matrix const *)

  • tau (gsl_vector const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

  • residual (gsl_vector *)

pygsl.gslwrap.gsl_linalg_LQ_lssolve_T(gsl_matrix const * LQ, gsl_vector const * tau, gsl_vector const * b, gsl_vector * x, gsl_vector * residual) int[source]
Parameters:
  • LQ (gsl_matrix const *)

  • tau (gsl_vector const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

  • residual (gsl_vector *)

pygsl.gslwrap.gsl_linalg_LQ_solve_T(gsl_matrix const * LQ, gsl_vector const * tau, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • LQ (gsl_matrix const *)

  • tau (gsl_vector const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_LQ_svx_T(gsl_matrix const * LQ, gsl_vector const * tau, gsl_vector * x) int[source]
Parameters:
  • LQ (gsl_matrix const *)

  • tau (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_LQ_unpack(gsl_matrix const * LQ, gsl_vector const * tau, gsl_matrix * Q, gsl_matrix * L) int[source]
Parameters:
  • LQ (gsl_matrix const *)

  • tau (gsl_vector const *)

  • Q (gsl_matrix *)

  • L (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_LQ_update(gsl_matrix * Q, gsl_matrix * R, gsl_vector const * v, gsl_vector * w) int[source]
Parameters:
  • Q (gsl_matrix *)

  • R (gsl_matrix *)

  • v (gsl_vector const *)

  • w (gsl_vector *)

pygsl.gslwrap.gsl_linalg_LQ_vecQ(gsl_matrix const * LQ, gsl_vector const * tau, gsl_vector * v) int[source]
Parameters:
  • LQ (gsl_matrix const *)

  • tau (gsl_vector const *)

  • v (gsl_vector *)

pygsl.gslwrap.gsl_linalg_LQ_vecQT(gsl_matrix const * LQ, gsl_vector const * tau, gsl_vector * v) int[source]
Parameters:
  • LQ (gsl_matrix const *)

  • tau (gsl_vector const *)

  • v (gsl_vector *)

pygsl.gslwrap.gsl_linalg_LU_band_decomp(size_t const M, size_t const lb, size_t const ub, gsl_matrix * AB, gsl_vector_uint * piv) int[source]
Parameters:
  • M (size_t const)

  • lb (size_t const)

  • ub (size_t const)

  • AB (gsl_matrix *)

  • piv (gsl_vector_uint *)

pygsl.gslwrap.gsl_linalg_LU_band_solve(size_t const lb, size_t const ub, gsl_matrix const * LUB, gsl_vector_uint const * piv, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • lb (size_t const)

  • ub (size_t const)

  • LUB (gsl_matrix const *)

  • piv (gsl_vector_uint const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_LU_band_svx(size_t const lb, size_t const ub, gsl_matrix const * LUB, gsl_vector_uint const * piv, gsl_vector * x) int[source]
Parameters:
  • lb (size_t const)

  • ub (size_t const)

  • LUB (gsl_matrix const *)

  • piv (gsl_vector_uint const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_LU_band_unpack(size_t const M, size_t const lb, size_t const ub, gsl_matrix const * LUB, gsl_vector_uint const * piv, gsl_matrix * L, gsl_matrix * U) int[source]
Parameters:
  • M (size_t const)

  • lb (size_t const)

  • ub (size_t const)

  • LUB (gsl_matrix const *)

  • piv (gsl_vector_uint const *)

  • L (gsl_matrix *)

  • U (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_LU_det(gsl_matrix * LU, int signum) double[source]
Parameters:
  • LU (gsl_matrix *)

  • signum (int)

pygsl.gslwrap.gsl_linalg_LU_invert(gsl_matrix const * LU, Permutation p, gsl_matrix * inverse) int[source]
Parameters:
  • LU (gsl_matrix const *)

  • p (gsl_permutation const *)

  • inverse (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_LU_invx(gsl_matrix * LU, Permutation p) int[source]
Parameters:
  • LU (gsl_matrix *)

  • p (gsl_permutation const *)

pygsl.gslwrap.gsl_linalg_LU_lndet(gsl_matrix * LU) double[source]
Parameters:

LU (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_LU_refine(gsl_matrix const * A, gsl_matrix const * LU, Permutation p, gsl_vector const * b, gsl_vector * x, gsl_vector * work) int[source]
Parameters:
  • A (gsl_matrix const *)

  • LU (gsl_matrix const *)

  • p (gsl_permutation const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

  • work (gsl_vector *)

pygsl.gslwrap.gsl_linalg_LU_sgndet(gsl_matrix * lu, int signum) int[source]
Parameters:
  • lu (gsl_matrix *)

  • signum (int)

pygsl.gslwrap.gsl_linalg_LU_solve(gsl_matrix const * LU, Permutation p, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • LU (gsl_matrix const *)

  • p (gsl_permutation const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_LU_svx(gsl_matrix const * LU, Permutation p, gsl_vector * x) int[source]
Parameters:
  • LU (gsl_matrix const *)

  • p (gsl_permutation const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_L_solve_T(gsl_matrix const * L, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • L (gsl_matrix const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_PTLQ_LQsolve_T(gsl_matrix const * Q, gsl_matrix const * L, Permutation p, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • Q (gsl_matrix const *)

  • L (gsl_matrix const *)

  • p (gsl_permutation const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_PTLQ_Lsolve_T(gsl_matrix const * LQ, Permutation p, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • LQ (gsl_matrix const *)

  • p (gsl_permutation const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_PTLQ_Lsvx_T(gsl_matrix const * LQ, Permutation p, gsl_vector * x) int[source]
Parameters:
  • LQ (gsl_matrix const *)

  • p (gsl_permutation const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_PTLQ_decomp(gsl_matrix * A, gsl_vector * tau, Permutation p, gsl_vector * norm) int[source]
Parameters:
  • A (gsl_matrix *)

  • tau (gsl_vector *)

  • p (gsl_permutation *)

  • norm (gsl_vector *)

pygsl.gslwrap.gsl_linalg_PTLQ_decomp2(gsl_matrix const * A, gsl_matrix * q, gsl_matrix * r, gsl_vector * tau, Permutation p, gsl_vector * norm) int[source]
Parameters:
  • A (gsl_matrix const *)

  • q (gsl_matrix *)

  • r (gsl_matrix *)

  • tau (gsl_vector *)

  • p (gsl_permutation *)

  • norm (gsl_vector *)

pygsl.gslwrap.gsl_linalg_PTLQ_solve_T(gsl_matrix const * QR, gsl_vector const * tau, Permutation p, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • QR (gsl_matrix const *)

  • tau (gsl_vector const *)

  • p (gsl_permutation const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_PTLQ_svx_T(gsl_matrix const * LQ, gsl_vector const * tau, Permutation p, gsl_vector * x) int[source]
Parameters:
  • LQ (gsl_matrix const *)

  • tau (gsl_vector const *)

  • p (gsl_permutation const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_PTLQ_update(gsl_matrix * Q, gsl_matrix * L, Permutation p, gsl_vector const * v, gsl_vector * w) int[source]
Parameters:
  • Q (gsl_matrix *)

  • L (gsl_matrix *)

  • p (gsl_permutation const *)

  • v (gsl_vector const *)

  • w (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QL_decomp(gsl_matrix * A, gsl_vector * tau) int[source]
Parameters:
  • A (gsl_matrix *)

  • tau (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QL_unpack(gsl_matrix const * QL, gsl_vector const * tau, gsl_matrix * Q, gsl_matrix * L) int[source]
Parameters:
  • QL (gsl_matrix const *)

  • tau (gsl_vector const *)

  • Q (gsl_matrix *)

  • L (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_QRPT_QRsolve(gsl_matrix const * Q, gsl_matrix const * R, Permutation p, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • Q (gsl_matrix const *)

  • R (gsl_matrix const *)

  • p (gsl_permutation const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QRPT_Rsolve(gsl_matrix const * QR, Permutation p, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • QR (gsl_matrix const *)

  • p (gsl_permutation const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QRPT_Rsvx(gsl_matrix const * QR, Permutation p, gsl_vector * x) int[source]
Parameters:
  • QR (gsl_matrix const *)

  • p (gsl_permutation const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QRPT_decomp(gsl_matrix * A, gsl_vector * tau, Permutation p, gsl_vector * norm) int[source]
Parameters:
  • A (gsl_matrix *)

  • tau (gsl_vector *)

  • p (gsl_permutation *)

  • norm (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QRPT_decomp2(gsl_matrix const * A, gsl_matrix * q, gsl_matrix * r, gsl_vector * tau, Permutation p, gsl_vector * norm) int[source]
Parameters:
  • A (gsl_matrix const *)

  • q (gsl_matrix *)

  • r (gsl_matrix *)

  • tau (gsl_vector *)

  • p (gsl_permutation *)

  • norm (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QRPT_lssolve(gsl_matrix const * QR, gsl_vector const * tau, Permutation p, gsl_vector const * b, gsl_vector * x, gsl_vector * residual) int[source]
Parameters:
  • QR (gsl_matrix const *)

  • tau (gsl_vector const *)

  • p (gsl_permutation const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

  • residual (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QRPT_lssolve2(gsl_matrix const * QR, gsl_vector const * tau, Permutation p, gsl_vector const * b, size_t const rank, gsl_vector * x, gsl_vector * residual) int[source]
Parameters:
  • QR (gsl_matrix const *)

  • tau (gsl_vector const *)

  • p (gsl_permutation const *)

  • b (gsl_vector const *)

  • rank (size_t const)

  • x (gsl_vector *)

  • residual (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QRPT_rank(gsl_matrix const * QR, double const tol) size_t[source]
Parameters:
  • QR (gsl_matrix const *)

  • tol (double const)

pygsl.gslwrap.gsl_linalg_QRPT_rcond(gsl_matrix const * QR, double * rcond, gsl_vector * work) int[source]
Parameters:
  • QR (gsl_matrix const *)

  • rcond (double *)

  • work (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QRPT_solve(gsl_matrix const * QR, gsl_vector const * tau, Permutation p, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • QR (gsl_matrix const *)

  • tau (gsl_vector const *)

  • p (gsl_permutation const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QRPT_svx(gsl_matrix const * QR, gsl_vector const * tau, Permutation p, gsl_vector * x) int[source]
Parameters:
  • QR (gsl_matrix const *)

  • tau (gsl_vector const *)

  • p (gsl_permutation const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QRPT_update(gsl_matrix * Q, gsl_matrix * R, Permutation p, gsl_vector * u, gsl_vector const * v) int[source]
Parameters:
  • Q (gsl_matrix *)

  • R (gsl_matrix *)

  • p (gsl_permutation const *)

  • u (gsl_vector *)

  • v (gsl_vector const *)

pygsl.gslwrap.gsl_linalg_QR_QRsolve(gsl_matrix * Q, gsl_matrix * R, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • Q (gsl_matrix *)

  • R (gsl_matrix *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QR_QTmat(gsl_matrix const * QR, gsl_vector const * tau, gsl_matrix * A) int[source]
Parameters:
  • QR (gsl_matrix const *)

  • tau (gsl_vector const *)

  • A (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_QR_QTmat_r(gsl_matrix const * QR, gsl_matrix const * T, gsl_matrix * B, gsl_matrix * work) int[source]
Parameters:
  • QR (gsl_matrix const *)

  • T (gsl_matrix const *)

  • B (gsl_matrix *)

  • work (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_QR_QTvec(gsl_matrix const * QR, gsl_vector const * tau, gsl_vector * v) int[source]
Parameters:
  • QR (gsl_matrix const *)

  • tau (gsl_vector const *)

  • v (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QR_QTvec_r(gsl_matrix const * QR, gsl_matrix const * T, gsl_vector * b, gsl_vector * work) int[source]
Parameters:
  • QR (gsl_matrix const *)

  • T (gsl_matrix const *)

  • b (gsl_vector *)

  • work (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QR_Qvec(gsl_matrix const * QR, gsl_vector const * tau, gsl_vector * v) int[source]
Parameters:
  • QR (gsl_matrix const *)

  • tau (gsl_vector const *)

  • v (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QR_Rsolve(gsl_matrix const * QR, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • QR (gsl_matrix const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QR_Rsvx(gsl_matrix const * QR, gsl_vector * x) int[source]
Parameters:
  • QR (gsl_matrix const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QR_UD_decomp(gsl_matrix * U, gsl_vector const * D, gsl_matrix * Y, gsl_matrix * T) int[source]
Parameters:
  • U (gsl_matrix *)

  • D (gsl_vector const *)

  • Y (gsl_matrix *)

  • T (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_QR_UD_lssolve(gsl_matrix const * R, gsl_matrix const * Y, gsl_matrix const * T, gsl_vector const * b, gsl_vector * x, gsl_vector * work) int[source]
Parameters:
  • R (gsl_matrix const *)

  • Y (gsl_matrix const *)

  • T (gsl_matrix const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

  • work (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QR_UR_decomp(gsl_matrix * S, gsl_matrix * A, gsl_matrix * T) int[source]
Parameters:
  • S (gsl_matrix *)

  • A (gsl_matrix *)

  • T (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_QR_UU_QTvec(gsl_matrix const * Y, gsl_matrix const * T, gsl_vector * b, gsl_vector * work) int[source]
Parameters:
  • Y (gsl_matrix const *)

  • T (gsl_matrix const *)

  • b (gsl_vector *)

  • work (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QR_UU_decomp(gsl_matrix * U, gsl_matrix * S, gsl_matrix * T) int[source]
Parameters:
  • U (gsl_matrix *)

  • S (gsl_matrix *)

  • T (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_QR_UU_lssolve(gsl_matrix const * R, gsl_matrix const * Y, gsl_matrix const * T, gsl_vector const * b, gsl_vector * x, gsl_vector * work) int[source]
Parameters:
  • R (gsl_matrix const *)

  • Y (gsl_matrix const *)

  • T (gsl_matrix const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

  • work (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QR_UZ_decomp(gsl_matrix * S, gsl_matrix * A, gsl_matrix * T) int[source]
Parameters:
  • S (gsl_matrix *)

  • A (gsl_matrix *)

  • T (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_QR_band_decomp_L2(size_t const M, size_t const p, size_t const q, gsl_matrix * AB, gsl_vector * tau) int[source]
Parameters:
  • M (size_t const)

  • p (size_t const)

  • q (size_t const)

  • AB (gsl_matrix *)

  • tau (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QR_band_unpack_L2(size_t const p, size_t const q, gsl_matrix const * QRB, gsl_vector const * tau, gsl_matrix * Q, gsl_matrix * R) int[source]
Parameters:
  • p (size_t const)

  • q (size_t const)

  • QRB (gsl_matrix const *)

  • tau (gsl_vector const *)

  • Q (gsl_matrix *)

  • R (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_QR_decomp(gsl_matrix * A, gsl_vector * tau) int[source]
Parameters:
  • A (gsl_matrix *)

  • tau (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QR_decomp_old(gsl_matrix * A, gsl_vector * tau) int[source]
Parameters:
  • A (gsl_matrix *)

  • tau (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QR_decomp_r(gsl_matrix * A, gsl_matrix * T) int[source]
Parameters:
  • A (gsl_matrix *)

  • T (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_QR_lssolve(gsl_matrix const * QR, gsl_vector const * tau, gsl_vector const * b, gsl_vector * x, gsl_vector * residual) int[source]
Parameters:
  • QR (gsl_matrix const *)

  • tau (gsl_vector const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

  • residual (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QR_lssolve_r(gsl_matrix const * QR, gsl_matrix const * T, gsl_vector const * b, gsl_vector * x, gsl_vector * work) int[source]
Parameters:
  • QR (gsl_matrix const *)

  • T (gsl_matrix const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

  • work (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QR_rcond(gsl_matrix const * QR, double * rcond, gsl_vector * work) int[source]
Parameters:
  • QR (gsl_matrix const *)

  • rcond (double *)

  • work (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QR_solve(gsl_matrix const * QR, gsl_vector const * tau, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • QR (gsl_matrix const *)

  • tau (gsl_vector const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QR_solve_r(gsl_matrix const * QR, gsl_matrix const * T, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • QR (gsl_matrix const *)

  • T (gsl_matrix const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QR_svx(gsl_matrix const * QR, gsl_vector const * tau, gsl_vector * x) int[source]
Parameters:
  • QR (gsl_matrix const *)

  • tau (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_QR_unpack(gsl_matrix const * QR, gsl_vector const * tau, gsl_matrix * Q, gsl_matrix * R) int[source]
Parameters:
  • QR (gsl_matrix const *)

  • tau (gsl_vector const *)

  • Q (gsl_matrix *)

  • R (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_QR_unpack_r(gsl_matrix const * QR, gsl_matrix const * T, gsl_matrix * Q, gsl_matrix * R) int[source]
Parameters:
  • QR (gsl_matrix const *)

  • T (gsl_matrix const *)

  • Q (gsl_matrix *)

  • R (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_QR_update(gsl_matrix * Q, gsl_matrix * R, gsl_vector * w, gsl_vector const * v) int[source]
Parameters:
  • Q (gsl_matrix *)

  • R (gsl_matrix *)

  • w (gsl_vector *)

  • v (gsl_vector const *)

pygsl.gslwrap.gsl_linalg_R_solve(gsl_matrix const * R, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • R (gsl_matrix const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_R_svx(gsl_matrix const * R, gsl_vector * x) int[source]
Parameters:
  • R (gsl_matrix const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_SV_decomp(gsl_matrix * A, gsl_matrix * V, gsl_vector * S, gsl_vector * work) int[source]
Parameters:
  • A (gsl_matrix *)

  • V (gsl_matrix *)

  • S (gsl_vector *)

  • work (gsl_vector *)

pygsl.gslwrap.gsl_linalg_SV_decomp_jacobi(gsl_matrix * A, gsl_matrix * Q, gsl_vector * S) int[source]
Parameters:
  • A (gsl_matrix *)

  • Q (gsl_matrix *)

  • S (gsl_vector *)

pygsl.gslwrap.gsl_linalg_SV_decomp_mod(gsl_matrix * A, gsl_matrix * X, gsl_matrix * V, gsl_vector * S, gsl_vector * work) int[source]
Parameters:
  • A (gsl_matrix *)

  • X (gsl_matrix *)

  • V (gsl_matrix *)

  • S (gsl_vector *)

  • work (gsl_vector *)

pygsl.gslwrap.gsl_linalg_SV_solve(gsl_matrix const * U, gsl_matrix const * Q, gsl_vector const * S, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • U (gsl_matrix const *)

  • Q (gsl_matrix const *)

  • S (gsl_vector const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_balance_accum(gsl_matrix * A, gsl_vector * D) int[source]
Parameters:
  • A (gsl_matrix *)

  • D (gsl_vector *)

pygsl.gslwrap.gsl_linalg_balance_columns(gsl_matrix * A, gsl_vector * D) int[source]
Parameters:
  • A (gsl_matrix *)

  • D (gsl_vector *)

pygsl.gslwrap.gsl_linalg_balance_matrix(gsl_matrix * A, gsl_vector * D) int[source]
Parameters:
  • A (gsl_matrix *)

  • D (gsl_vector *)

pygsl.gslwrap.gsl_linalg_bidiag_decomp(gsl_matrix * A, gsl_vector * tau_U, gsl_vector * tau_V) int[source]
Parameters:
  • A (gsl_matrix *)

  • tau_U (gsl_vector *)

  • tau_V (gsl_vector *)

pygsl.gslwrap.gsl_linalg_bidiag_unpack(gsl_matrix const * A, gsl_vector const * tau_U, gsl_matrix * U, gsl_vector const * tau_V, gsl_matrix * V, gsl_vector * diag, gsl_vector * superdiag) int[source]
Parameters:
  • A (gsl_matrix const *)

  • tau_U (gsl_vector const *)

  • U (gsl_matrix *)

  • tau_V (gsl_vector const *)

  • V (gsl_matrix *)

  • diag (gsl_vector *)

  • superdiag (gsl_vector *)

pygsl.gslwrap.gsl_linalg_bidiag_unpack2(gsl_matrix * A, gsl_vector * tau_U, gsl_vector * tau_V, gsl_matrix * V) int[source]
Parameters:
  • A (gsl_matrix *)

  • tau_U (gsl_vector *)

  • tau_V (gsl_vector *)

  • V (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_bidiag_unpack_B(gsl_matrix const * A, gsl_vector * diag, gsl_vector * superdiag) int[source]
Parameters:
  • A (gsl_matrix const *)

  • diag (gsl_vector *)

  • superdiag (gsl_vector *)

pygsl.gslwrap.gsl_linalg_cholesky_band_decomp(gsl_matrix * A) int[source]
Parameters:

A (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_cholesky_band_invert(gsl_matrix const * LLT, gsl_matrix * Ainv) int[source]
Parameters:
  • LLT (gsl_matrix const *)

  • Ainv (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_cholesky_band_rcond(gsl_matrix const * LLT, double * rcond, gsl_vector * work) int[source]
Parameters:
  • LLT (gsl_matrix const *)

  • rcond (double *)

  • work (gsl_vector *)

pygsl.gslwrap.gsl_linalg_cholesky_band_scale(gsl_matrix const * A, gsl_vector * S) int[source]
Parameters:
  • A (gsl_matrix const *)

  • S (gsl_vector *)

pygsl.gslwrap.gsl_linalg_cholesky_band_scale_apply(gsl_matrix * A, gsl_vector const * S) int[source]
Parameters:
  • A (gsl_matrix *)

  • S (gsl_vector const *)

pygsl.gslwrap.gsl_linalg_cholesky_band_solve(gsl_matrix const * LLT, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • LLT (gsl_matrix const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_cholesky_band_solvem(gsl_matrix const * LLT, gsl_matrix const * B, gsl_matrix * X) int[source]
Parameters:
  • LLT (gsl_matrix const *)

  • B (gsl_matrix const *)

  • X (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_cholesky_band_svx(gsl_matrix const * LLT, gsl_vector * x) int[source]
Parameters:
  • LLT (gsl_matrix const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_cholesky_band_svxm(gsl_matrix const * LLT, gsl_matrix * X) int[source]
Parameters:
  • LLT (gsl_matrix const *)

  • X (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_cholesky_band_unpack(gsl_matrix const * LLT, gsl_matrix * L) int[source]
Parameters:
  • LLT (gsl_matrix const *)

  • L (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_cholesky_decomp(gsl_matrix * A) int[source]
Parameters:

A (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_cholesky_decomp1(gsl_matrix * A) int[source]
Parameters:

A (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_cholesky_decomp2(gsl_matrix * A, gsl_vector * S) int[source]
Parameters:
  • A (gsl_matrix *)

  • S (gsl_vector *)

pygsl.gslwrap.gsl_linalg_cholesky_decomp_unit(gsl_matrix * A, gsl_vector * D) int[source]
Parameters:
  • A (gsl_matrix *)

  • D (gsl_vector *)

pygsl.gslwrap.gsl_linalg_cholesky_invert(gsl_matrix * cholesky) int[source]
Parameters:

cholesky (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_cholesky_rcond(gsl_matrix const * LLT, double * rcond, gsl_vector * work) int[source]
Parameters:
  • LLT (gsl_matrix const *)

  • rcond (double *)

  • work (gsl_vector *)

pygsl.gslwrap.gsl_linalg_cholesky_scale(gsl_matrix const * A, gsl_vector * S) int[source]
Parameters:
  • A (gsl_matrix const *)

  • S (gsl_vector *)

pygsl.gslwrap.gsl_linalg_cholesky_scale_apply(gsl_matrix * A, gsl_vector const * S) int[source]
Parameters:
  • A (gsl_matrix *)

  • S (gsl_vector const *)

pygsl.gslwrap.gsl_linalg_cholesky_solve(gsl_matrix const * cholesky, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • cholesky (gsl_matrix const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_cholesky_solve2(gsl_matrix const * LLT, gsl_vector const * S, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • LLT (gsl_matrix const *)

  • S (gsl_vector const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_cholesky_solve_mat(gsl_matrix const * cholesky, gsl_matrix const * B, gsl_matrix * X) int[source]
Parameters:
  • cholesky (gsl_matrix const *)

  • B (gsl_matrix const *)

  • X (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_cholesky_svx(gsl_matrix const * cholesky, gsl_vector * x) int[source]
Parameters:
  • cholesky (gsl_matrix const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_cholesky_svx2(gsl_matrix const * LLT, gsl_vector const * S, gsl_vector * x) int[source]
Parameters:
  • LLT (gsl_matrix const *)

  • S (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_cholesky_svx_mat(gsl_matrix const * cholesky, gsl_matrix * X) int[source]
Parameters:
  • cholesky (gsl_matrix const *)

  • X (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_complex_LU_det(gsl_matrix_complex * LU, int signum) gsl_complex[source]
Parameters:
  • LU (gsl_matrix_complex *)

  • signum (int)

pygsl.gslwrap.gsl_linalg_complex_LU_invert(gsl_matrix_complex const * LU, Permutation p, gsl_matrix_complex * inverse) int[source]
Parameters:
  • LU (gsl_matrix_complex const *)

  • p (gsl_permutation const *)

  • inverse (gsl_matrix_complex *)

pygsl.gslwrap.gsl_linalg_complex_LU_invx(gsl_matrix_complex * LU, Permutation p) int[source]
Parameters:
  • LU (gsl_matrix_complex *)

  • p (gsl_permutation const *)

pygsl.gslwrap.gsl_linalg_complex_LU_lndet(gsl_matrix_complex * LU) double[source]
Parameters:

LU (gsl_matrix_complex *)

pygsl.gslwrap.gsl_linalg_complex_LU_refine(gsl_matrix_complex const * A, gsl_matrix_complex const * LU, Permutation p, gsl_vector_complex const * b, gsl_vector_complex * x, gsl_vector_complex * work) int[source]
Parameters:
  • A (gsl_matrix_complex const *)

  • LU (gsl_matrix_complex const *)

  • p (gsl_permutation const *)

  • b (gsl_vector_complex const *)

  • x (gsl_vector_complex *)

  • work (gsl_vector_complex *)

pygsl.gslwrap.gsl_linalg_complex_LU_sgndet(gsl_matrix_complex * LU, int signum) gsl_complex[source]
Parameters:
  • LU (gsl_matrix_complex *)

  • signum (int)

pygsl.gslwrap.gsl_linalg_complex_LU_solve(gsl_matrix_complex const * LU, Permutation p, gsl_vector_complex const * b, gsl_vector_complex * x) int[source]
Parameters:
  • LU (gsl_matrix_complex const *)

  • p (gsl_permutation const *)

  • b (gsl_vector_complex const *)

  • x (gsl_vector_complex *)

pygsl.gslwrap.gsl_linalg_complex_LU_svx(gsl_matrix_complex const * LU, Permutation p, gsl_vector_complex * x) int[source]
Parameters:
  • LU (gsl_matrix_complex const *)

  • p (gsl_permutation const *)

  • x (gsl_vector_complex *)

pygsl.gslwrap.gsl_linalg_complex_QR_QHvec(gsl_matrix_complex const * QR, gsl_vector_complex const * tau, gsl_vector_complex * v) int[source]
Parameters:
  • QR (gsl_matrix_complex const *)

  • tau (gsl_vector_complex const *)

  • v (gsl_vector_complex *)

pygsl.gslwrap.gsl_linalg_complex_QR_QHvec_r(gsl_matrix_complex const * QR, gsl_matrix_complex const * T, gsl_vector_complex * b, gsl_vector_complex * work) int[source]
Parameters:
  • QR (gsl_matrix_complex const *)

  • T (gsl_matrix_complex const *)

  • b (gsl_vector_complex *)

  • work (gsl_vector_complex *)

pygsl.gslwrap.gsl_linalg_complex_QR_Qvec(gsl_matrix_complex const * QR, gsl_vector_complex const * tau, gsl_vector_complex * v) int[source]
Parameters:
  • QR (gsl_matrix_complex const *)

  • tau (gsl_vector_complex const *)

  • v (gsl_vector_complex *)

pygsl.gslwrap.gsl_linalg_complex_QR_decomp(gsl_matrix_complex * A, gsl_vector_complex * tau) int[source]
Parameters:
  • A (gsl_matrix_complex *)

  • tau (gsl_vector_complex *)

pygsl.gslwrap.gsl_linalg_complex_QR_decomp_r(gsl_matrix_complex * A, gsl_matrix_complex * T) int[source]
Parameters:
  • A (gsl_matrix_complex *)

  • T (gsl_matrix_complex *)

pygsl.gslwrap.gsl_linalg_complex_QR_lssolve(gsl_matrix_complex const * QR, gsl_vector_complex const * tau, gsl_vector_complex const * b, gsl_vector_complex * x, gsl_vector_complex * residual) int[source]
Parameters:
  • QR (gsl_matrix_complex const *)

  • tau (gsl_vector_complex const *)

  • b (gsl_vector_complex const *)

  • x (gsl_vector_complex *)

  • residual (gsl_vector_complex *)

pygsl.gslwrap.gsl_linalg_complex_QR_lssolve_r(gsl_matrix_complex const * QR, gsl_matrix_complex const * T, gsl_vector_complex const * b, gsl_vector_complex * x, gsl_vector_complex * work) int[source]
Parameters:
  • QR (gsl_matrix_complex const *)

  • T (gsl_matrix_complex const *)

  • b (gsl_vector_complex const *)

  • x (gsl_vector_complex *)

  • work (gsl_vector_complex *)

pygsl.gslwrap.gsl_linalg_complex_QR_solve(gsl_matrix_complex const * QR, gsl_vector_complex const * tau, gsl_vector_complex const * b, gsl_vector_complex * x) int[source]
Parameters:
  • QR (gsl_matrix_complex const *)

  • tau (gsl_vector_complex const *)

  • b (gsl_vector_complex const *)

  • x (gsl_vector_complex *)

pygsl.gslwrap.gsl_linalg_complex_QR_solve_r(gsl_matrix_complex const * QR, gsl_matrix_complex const * T, gsl_vector_complex const * b, gsl_vector_complex * x) int[source]
Parameters:
  • QR (gsl_matrix_complex const *)

  • T (gsl_matrix_complex const *)

  • b (gsl_vector_complex const *)

  • x (gsl_vector_complex *)

pygsl.gslwrap.gsl_linalg_complex_QR_svx(gsl_matrix_complex const * QR, gsl_vector_complex const * tau, gsl_vector_complex * x) int[source]
Parameters:
  • QR (gsl_matrix_complex const *)

  • tau (gsl_vector_complex const *)

  • x (gsl_vector_complex *)

pygsl.gslwrap.gsl_linalg_complex_QR_unpack(gsl_matrix_complex const * QR, gsl_vector_complex const * tau, gsl_matrix_complex * Q, gsl_matrix_complex * R) int[source]
Parameters:
  • QR (gsl_matrix_complex const *)

  • tau (gsl_vector_complex const *)

  • Q (gsl_matrix_complex *)

  • R (gsl_matrix_complex *)

pygsl.gslwrap.gsl_linalg_complex_QR_unpack_r(gsl_matrix_complex const * QR, gsl_matrix_complex const * T, gsl_matrix_complex * Q, gsl_matrix_complex * R) int[source]
Parameters:
  • QR (gsl_matrix_complex const *)

  • T (gsl_matrix_complex const *)

  • Q (gsl_matrix_complex *)

  • R (gsl_matrix_complex *)

pygsl.gslwrap.gsl_linalg_complex_cholesky_decomp(gsl_matrix_complex * A) int[source]
Parameters:

A (gsl_matrix_complex *)

pygsl.gslwrap.gsl_linalg_complex_cholesky_solve(gsl_matrix_complex const * cholesky, gsl_vector_complex const * b, gsl_vector_complex * x) int[source]
Parameters:
  • cholesky (gsl_matrix_complex const *)

  • b (gsl_vector_complex const *)

  • x (gsl_vector_complex *)

pygsl.gslwrap.gsl_linalg_complex_cholesky_svx(gsl_matrix_complex const * cholesky, gsl_vector_complex * x) int[source]
Parameters:
  • cholesky (gsl_matrix_complex const *)

  • x (gsl_vector_complex *)

pygsl.gslwrap.gsl_linalg_complex_householder_hm(gsl_complex tau, gsl_vector_complex const * v, gsl_matrix_complex * A) int[source]
Parameters:
  • tau (gsl_complex)

  • v (gsl_vector_complex const *)

  • A (gsl_matrix_complex *)

pygsl.gslwrap.gsl_linalg_complex_householder_hv(gsl_complex tau, gsl_vector_complex const * v, gsl_vector_complex * w) int[source]
Parameters:
  • tau (gsl_complex)

  • v (gsl_vector_complex const *)

  • w (gsl_vector_complex *)

pygsl.gslwrap.gsl_linalg_complex_householder_left(gsl_complex const tau, gsl_vector_complex const * v, gsl_matrix_complex * A, gsl_vector_complex * work) int[source]
Parameters:
  • tau (gsl_complex const)

  • v (gsl_vector_complex const *)

  • A (gsl_matrix_complex *)

  • work (gsl_vector_complex *)

pygsl.gslwrap.gsl_linalg_complex_householder_transform(gsl_vector_complex * v) gsl_complex[source]
Parameters:

v (gsl_vector_complex *)

pygsl.gslwrap.gsl_linalg_complex_tri_LHL(gsl_matrix_complex * L) int[source]
Parameters:

L (gsl_matrix_complex *)

pygsl.gslwrap.gsl_linalg_complex_tri_UL(gsl_matrix_complex * LU) int[source]
Parameters:

LU (gsl_matrix_complex *)

pygsl.gslwrap.gsl_linalg_complex_tri_invert(CBLAS_UPLO_t Uplo, CBLAS_DIAG_t Diag, gsl_matrix_complex * T) int[source]
Parameters:
  • Uplo (enum CBLAS_UPLO_t)

  • Diag (enum CBLAS_DIAG_t)

  • T (gsl_matrix_complex *)

pygsl.gslwrap.gsl_linalg_exponential_ss(gsl_matrix const * A, gsl_matrix * eA, gsl_mode_t mode) int[source]
Parameters:
  • A (gsl_matrix const *)

  • eA (gsl_matrix *)

  • mode (gsl_mode_t)

pygsl.gslwrap.gsl_linalg_hermtd_decomp(gsl_matrix_complex * A, gsl_vector_complex * tau) int[source]
Parameters:
  • A (gsl_matrix_complex *)

  • tau (gsl_vector_complex *)

pygsl.gslwrap.gsl_linalg_hermtd_unpack(gsl_matrix_complex const * A, gsl_vector_complex const * tau, gsl_matrix_complex * U, gsl_vector * diag, gsl_vector * sudiag) int[source]
Parameters:
  • A (gsl_matrix_complex const *)

  • tau (gsl_vector_complex const *)

  • U (gsl_matrix_complex *)

  • diag (gsl_vector *)

  • sudiag (gsl_vector *)

pygsl.gslwrap.gsl_linalg_hermtd_unpack_T(gsl_matrix_complex const * A, gsl_vector * diag, gsl_vector * subdiag) int[source]
Parameters:
  • A (gsl_matrix_complex const *)

  • diag (gsl_vector *)

  • subdiag (gsl_vector *)

pygsl.gslwrap.gsl_linalg_hessenberg_set_zero(gsl_matrix * H) int[source]
Parameters:

H (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_hessenberg_submatrix(gsl_matrix * M, gsl_matrix * A, size_t top, gsl_vector * tau) int[source]
Parameters:
  • M (gsl_matrix *)

  • A (gsl_matrix *)

  • top (size_t)

  • tau (gsl_vector *)

pygsl.gslwrap.gsl_linalg_hessenberg_unpack(gsl_matrix * H, gsl_vector * tau, gsl_matrix * U) int[source]
Parameters:
  • H (gsl_matrix *)

  • tau (gsl_vector *)

  • U (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_hessenberg_unpack_accum(gsl_matrix * H, gsl_vector * tau, gsl_matrix * U) int[source]
Parameters:
  • H (gsl_matrix *)

  • tau (gsl_vector *)

  • U (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_hesstri_decomp(gsl_matrix * A, gsl_matrix * B, gsl_matrix * U, gsl_matrix * V, gsl_vector * work) int[source]
Parameters:
  • A (gsl_matrix *)

  • B (gsl_matrix *)

  • U (gsl_matrix *)

  • V (gsl_matrix *)

  • work (gsl_vector *)

pygsl.gslwrap.gsl_linalg_householder_hm(double tau, gsl_vector const * v, gsl_matrix * A) int[source]
Parameters:
  • tau (double)

  • v (gsl_vector const *)

  • A (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_householder_hm1(double tau, gsl_matrix * A) int[source]
Parameters:
  • tau (double)

  • A (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_householder_hv(double tau, gsl_vector const * v, gsl_vector * w) int[source]
Parameters:
  • tau (double)

  • v (gsl_vector const *)

  • w (gsl_vector *)

pygsl.gslwrap.gsl_linalg_householder_left(double const tau, gsl_vector const * v, gsl_matrix * A, gsl_vector * work) int[source]
Parameters:
  • tau (double const)

  • v (gsl_vector const *)

  • A (gsl_matrix *)

  • work (gsl_vector *)

pygsl.gslwrap.gsl_linalg_householder_mh(double tau, gsl_vector const * v, gsl_matrix * A) int[source]
Parameters:
  • tau (double)

  • v (gsl_vector const *)

  • A (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_householder_right(double const tau, gsl_vector const * v, gsl_matrix * A, gsl_vector * work) int[source]
Parameters:
  • tau (double const)

  • v (gsl_vector const *)

  • A (gsl_matrix *)

  • work (gsl_vector *)

pygsl.gslwrap.gsl_linalg_householder_transform(gsl_vector * v) double[source]
Parameters:

v (gsl_vector *)

pygsl.gslwrap.gsl_linalg_householder_transform2(double * alpha, gsl_vector * v) double[source]
Parameters:
  • alpha (double *)

  • v (gsl_vector *)

pygsl.gslwrap.gsl_linalg_invnorm1(size_t const N, int (*)(CBLAS_TRANSPOSE_t, gsl_vector *, void *) Ainvx, void * params, double * Ainvnorm, gsl_vector * work) int[source]
Parameters:
  • N (size_t const)

  • Ainvx (int (*)(CBLAS_TRANSPOSE_t,gsl_vector *,void *))

  • params (void *)

  • Ainvnorm (double *)

  • work (gsl_vector *)

pygsl.gslwrap.gsl_linalg_ldlt_band_decomp(gsl_matrix * A) int[source]
Parameters:

A (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_ldlt_band_rcond(gsl_matrix const * LDLT, double * rcond, gsl_vector * work) int[source]
Parameters:
  • LDLT (gsl_matrix const *)

  • rcond (double *)

  • work (gsl_vector *)

pygsl.gslwrap.gsl_linalg_ldlt_band_solve(gsl_matrix const * LDLT, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • LDLT (gsl_matrix const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_ldlt_band_svx(gsl_matrix const * LDLT, gsl_vector * x) int[source]
Parameters:
  • LDLT (gsl_matrix const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_ldlt_band_unpack(gsl_matrix const * LDLT, gsl_matrix * L, gsl_vector * D) int[source]
Parameters:
  • LDLT (gsl_matrix const *)

  • L (gsl_matrix *)

  • D (gsl_vector *)

pygsl.gslwrap.gsl_linalg_ldlt_decomp(gsl_matrix * A) int[source]
Parameters:

A (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_ldlt_rcond(gsl_matrix const * LDLT, double * rcond, gsl_vector * work) int[source]
Parameters:
  • LDLT (gsl_matrix const *)

  • rcond (double *)

  • work (gsl_vector *)

pygsl.gslwrap.gsl_linalg_ldlt_solve(gsl_matrix const * LDLT, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • LDLT (gsl_matrix const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_ldlt_svx(gsl_matrix const * LDLT, gsl_vector * x) int[source]
Parameters:
  • LDLT (gsl_matrix const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_matmult(gsl_matrix const * A, gsl_matrix const * B, gsl_matrix * C) int[source]
Parameters:
  • A (gsl_matrix const *)

  • B (gsl_matrix const *)

  • C (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_matmult_mod(gsl_matrix const * A, gsl_linalg_matrix_mod_t modA, gsl_matrix const * B, gsl_linalg_matrix_mod_t modB, gsl_matrix * C) int[source]
Parameters:
  • A (gsl_matrix const *)

  • modA (enum gsl_linalg_matrix_mod_t)

  • B (gsl_matrix const *)

  • modB (enum gsl_linalg_matrix_mod_t)

  • C (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_mcholesky_decomp(gsl_matrix * A, Permutation p, gsl_vector * E) int[source]
Parameters:
  • A (gsl_matrix *)

  • p (gsl_permutation *)

  • E (gsl_vector *)

pygsl.gslwrap.gsl_linalg_mcholesky_invert(gsl_matrix const * LDLT, Permutation p, gsl_matrix * Ainv) int[source]
Parameters:
  • LDLT (gsl_matrix const *)

  • p (gsl_permutation const *)

  • Ainv (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_mcholesky_rcond(gsl_matrix const * LDLT, Permutation p, double * rcond, gsl_vector * work) int[source]
Parameters:
  • LDLT (gsl_matrix const *)

  • p (gsl_permutation const *)

  • rcond (double *)

  • work (gsl_vector *)

pygsl.gslwrap.gsl_linalg_mcholesky_solve(gsl_matrix const * LDLT, Permutation p, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • LDLT (gsl_matrix const *)

  • p (gsl_permutation const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_mcholesky_svx(gsl_matrix const * LDLT, Permutation p, gsl_vector * x) int[source]
Parameters:
  • LDLT (gsl_matrix const *)

  • p (gsl_permutation const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_pcholesky_decomp(gsl_matrix * A, Permutation p) int[source]
Parameters:
  • A (gsl_matrix *)

  • p (gsl_permutation *)

pygsl.gslwrap.gsl_linalg_pcholesky_decomp2(gsl_matrix * A, Permutation p, gsl_vector * S) int[source]
Parameters:
  • A (gsl_matrix *)

  • p (gsl_permutation *)

  • S (gsl_vector *)

pygsl.gslwrap.gsl_linalg_pcholesky_invert(gsl_matrix const * LDLT, Permutation p, gsl_matrix * Ainv) int[source]
Parameters:
  • LDLT (gsl_matrix const *)

  • p (gsl_permutation const *)

  • Ainv (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_pcholesky_rcond(gsl_matrix const * LDLT, Permutation p, double * rcond, gsl_vector * work) int[source]
Parameters:
  • LDLT (gsl_matrix const *)

  • p (gsl_permutation const *)

  • rcond (double *)

  • work (gsl_vector *)

pygsl.gslwrap.gsl_linalg_pcholesky_solve(gsl_matrix const * LDLT, Permutation p, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • LDLT (gsl_matrix const *)

  • p (gsl_permutation const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_pcholesky_solve2(gsl_matrix const * LDLT, Permutation p, gsl_vector const * S, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • LDLT (gsl_matrix const *)

  • p (gsl_permutation const *)

  • S (gsl_vector const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_pcholesky_svx(gsl_matrix const * LDLT, Permutation p, gsl_vector * x) int[source]
Parameters:
  • LDLT (gsl_matrix const *)

  • p (gsl_permutation const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_pcholesky_svx2(gsl_matrix const * LDLT, Permutation p, gsl_vector const * S, gsl_vector * x) int[source]
Parameters:
  • LDLT (gsl_matrix const *)

  • p (gsl_permutation const *)

  • S (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_solve_cyc_tridiag(gsl_vector const * diag, gsl_vector const * abovediag, gsl_vector const * belowdiag, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • diag (gsl_vector const *)

  • abovediag (gsl_vector const *)

  • belowdiag (gsl_vector const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_solve_symm_cyc_tridiag(gsl_vector const * diag, gsl_vector const * offdiag, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • diag (gsl_vector const *)

  • offdiag (gsl_vector const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_solve_symm_tridiag(gsl_vector const * diag, gsl_vector const * offdiag, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • diag (gsl_vector const *)

  • offdiag (gsl_vector const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_solve_tridiag(gsl_vector const * diag, gsl_vector const * abovediag, gsl_vector const * belowdiag, gsl_vector const * b, gsl_vector * x) int[source]
Parameters:
  • diag (gsl_vector const *)

  • abovediag (gsl_vector const *)

  • belowdiag (gsl_vector const *)

  • b (gsl_vector const *)

  • x (gsl_vector *)

pygsl.gslwrap.gsl_linalg_symmtd_decomp(gsl_matrix * A, gsl_vector * tau) int[source]
Parameters:
  • A (gsl_matrix *)

  • tau (gsl_vector *)

pygsl.gslwrap.gsl_linalg_symmtd_unpack(gsl_matrix const * A, gsl_vector const * tau, gsl_matrix * Q, gsl_vector * diag, gsl_vector * subdiag) int[source]
Parameters:
  • A (gsl_matrix const *)

  • tau (gsl_vector const *)

  • Q (gsl_matrix *)

  • diag (gsl_vector *)

  • subdiag (gsl_vector *)

pygsl.gslwrap.gsl_linalg_symmtd_unpack_T(gsl_matrix const * A, gsl_vector * diag, gsl_vector * subdiag) int[source]
Parameters:
  • A (gsl_matrix const *)

  • diag (gsl_vector *)

  • subdiag (gsl_vector *)

pygsl.gslwrap.gsl_linalg_tri_LTL(gsl_matrix * L) int[source]
Parameters:

L (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_tri_UL(gsl_matrix * LU) int[source]
Parameters:

LU (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_tri_invert(CBLAS_UPLO_t Uplo, CBLAS_DIAG_t Diag, gsl_matrix * T) int[source]
Parameters:
  • Uplo (enum CBLAS_UPLO_t)

  • Diag (enum CBLAS_DIAG_t)

  • T (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_tri_lower_invert(gsl_matrix * T) int[source]
Parameters:

T (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_tri_lower_rcond(gsl_matrix const * A, double * rcond, gsl_vector * work) int[source]
Parameters:
  • A (gsl_matrix const *)

  • rcond (double *)

  • work (gsl_vector *)

pygsl.gslwrap.gsl_linalg_tri_lower_unit_invert(gsl_matrix * T) int[source]
Parameters:

T (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_tri_rcond(CBLAS_UPLO_t Uplo, gsl_matrix const * A, double * rcond, gsl_vector * work) int[source]
Parameters:
  • Uplo (enum CBLAS_UPLO_t)

  • A (gsl_matrix const *)

  • rcond (double *)

  • work (gsl_vector *)

pygsl.gslwrap.gsl_linalg_tri_upper_invert(gsl_matrix * T) int[source]
Parameters:

T (gsl_matrix *)

pygsl.gslwrap.gsl_linalg_tri_upper_rcond(gsl_matrix const * A, double * rcond, gsl_vector * work) int[source]
Parameters:
  • A (gsl_matrix const *)

  • rcond (double *)

  • work (gsl_vector *)

pygsl.gslwrap.gsl_linalg_tri_upper_unit_invert(gsl_matrix * T) int[source]
Parameters:

T (gsl_matrix *)

pygsl.gslwrap.gsl_log1p(double const x) double[source]
pygsl.gslwrap.gsl_nan() double[source]
pygsl.gslwrap.gsl_neginf() double[source]
pygsl.gslwrap.gsl_permutation_alloc(size_t const n) Permutation[source]
Parameters:

n (size_t const)

pygsl.gslwrap.gsl_permutation_calloc(size_t const n) Permutation[source]
Parameters:

n (size_t const)

pygsl.gslwrap.gsl_permutation_canonical_to_linear(Permutation p, Permutation q) int[source]
Parameters:
  • p (gsl_permutation *)

  • q (gsl_permutation const *)

pygsl.gslwrap.gsl_permutation_data(Permutation p) size_t *[source]
Parameters:

p (gsl_permutation const *)

pygsl.gslwrap.gsl_permutation_fprintf(FILE * stream, Permutation p, char const * format) int[source]
Parameters:
  • stream (FILE *)

  • p (gsl_permutation const *)

  • format (char const *)

pygsl.gslwrap.gsl_permutation_fread(FILE * stream, Permutation p) int[source]
Parameters:
  • stream (FILE *)

  • p (gsl_permutation *)

pygsl.gslwrap.gsl_permutation_free(Permutation p)[source]
Parameters:

p (gsl_permutation *)

pygsl.gslwrap.gsl_permutation_fscanf(FILE * stream, Permutation p) int[source]
Parameters:
  • stream (FILE *)

  • p (gsl_permutation *)

pygsl.gslwrap.gsl_permutation_fwrite(FILE * stream, Permutation p) int[source]
Parameters:
  • stream (FILE *)

  • p (gsl_permutation const *)

pygsl.gslwrap.gsl_permutation_get(Permutation p, size_t const i) size_t[source]
Parameters:
  • p (gsl_permutation const *)

  • i (size_t const)

pygsl.gslwrap.gsl_permutation_init(Permutation p)[source]
Parameters:

p (gsl_permutation *)

pygsl.gslwrap.gsl_permutation_inverse(Permutation inv, Permutation p) int[source]
Parameters:
  • inv (gsl_permutation *)

  • p (gsl_permutation const *)

pygsl.gslwrap.gsl_permutation_linear_to_canonical(Permutation q, Permutation p) int[source]
Parameters:
  • q (gsl_permutation *)

  • p (gsl_permutation const *)

pygsl.gslwrap.gsl_permutation_next(Permutation p) int[source]
Parameters:

p (gsl_permutation *)

pygsl.gslwrap.gsl_permutation_prev(Permutation p) int[source]
Parameters:

p (gsl_permutation *)

pygsl.gslwrap.gsl_permutation_reverse(Permutation p)[source]
Parameters:

p (gsl_permutation *)

pygsl.gslwrap.gsl_permutation_size(Permutation p) size_t[source]
Parameters:

p (gsl_permutation const *)

pygsl.gslwrap.gsl_permutation_swap(Permutation p, size_t const i, size_t const j) int[source]
Parameters:
  • p (gsl_permutation *)

  • i (size_t const)

  • j (size_t const)

pygsl.gslwrap.gsl_permutation_valid(Permutation p) int[source]
Parameters:

p (gsl_permutation const *)

pygsl.gslwrap.gsl_posinf() double[source]
pygsl.gslwrap.gsl_schur_gen_eigvals(gsl_matrix const * A, gsl_matrix const * B, double * wr1, double * wr2, double * wi, double * scale1, double * scale2) int[source]
pygsl.gslwrap.gsl_schur_solve_equation(double ca, gsl_matrix const * A, double z, double d1, double d2, gsl_vector const * b, gsl_vector * x, double * s, double * xnorm, double smin) int[source]
pygsl.gslwrap.gsl_schur_solve_equation_z(double ca, gsl_matrix const * A, gsl_complex * z, double d1, double d2, gsl_vector_complex const * b, gsl_vector_complex * x, double * s, double * xnorm, double smin) int[source]
class pygsl.gslwrap.pygsl_interp(T, n)[source]

Bases: object

Proxy of C pygsl_interp struct.

accel_find(pygsl_interp self, double x) size_t[source]
accel_reset(pygsl_interp self) gsl_error_flag_drop[source]
eval(pygsl_interp self, double x) double[source]
eval_deriv(pygsl_interp self, double x) double[source]
eval_deriv2(pygsl_interp self, double x) double[source]
eval_deriv2_e(pygsl_interp self, double x) gsl_error_flag_drop[source]
eval_deriv_e(pygsl_interp self, double x) gsl_error_flag_drop[source]
eval_e(pygsl_interp self, double x) gsl_error_flag_drop[source]
eval_integ(pygsl_interp self, double a, double b) double[source]
eval_integ_e(pygsl_interp self, double a, double b) gsl_error_flag_drop[source]
init(pygsl_interp self, PyObject * x, PyObject * y) gsl_error_flag_drop[source]
min_size(pygsl_interp self) unsigned int[source]
name(pygsl_interp self) char const *[source]
property thisown

The membership flag

pygsl.gslwrap.pygsl_linalg_LU_decomp(gsl_matrix * A, Permutation p) gsl_error_flag_drop[source]
Parameters:
  • A (gsl_matrix *)

  • p (gsl_permutation *)

pygsl.gslwrap.pygsl_linalg_complex_LU_decomp(gsl_matrix_complex * A, Permutation p) gsl_error_flag_drop[source]
Parameters:
  • A (gsl_matrix_complex *)

  • p (gsl_permutation *)

pygsl.gslwrap.pygsl_linalg_complex_cholesky_invert(gsl_matrix_complex * cholesky) int[source]
Parameters:

cholesky (gsl_matrix_complex *)

pygsl.gslwrap.pygsl_linalg_complex_householder_mh(gsl_complex tau, gsl_vector_complex const * v, gsl_matrix_complex * OUTPUT) int[source]
Parameters:
  • tau (gsl_complex)

  • v (gsl_vector_complex const *)

  • OUTPUT (gsl_matrix_complex * (output))

pygsl.gslwrap.pygsl_linalg_hessenberg_decomp(gsl_matrix * A, gsl_vector * tau) int[source]
Parameters:
  • A (gsl_matrix *)

  • tau (gsl_vector *)

class pygsl.gslwrap.pygsl_spline(T, n)[source]

Bases: object

Proxy of C pygsl_spline struct.

accel_find(pygsl_spline self, double x) size_t[source]
accel_reset(pygsl_spline self) gsl_error_flag_drop[source]
eval(pygsl_spline self, double IN) double[source]
eval_deriv(pygsl_spline self, double IN) double[source]
eval_deriv2(pygsl_spline self, double IN) double[source]
eval_deriv2_e(pygsl_spline self, double IN) gsl_error_flag_drop[source]
eval_deriv2_e_vector(pygsl_spline self, gsl_vector const * IN) PyObject *[source]
eval_deriv2_vector(pygsl_spline self, gsl_vector const * IN) PyObject *[source]
eval_deriv_e(pygsl_spline self, double IN) gsl_error_flag_drop[source]
eval_deriv_e_vector(pygsl_spline self, gsl_vector const * IN) PyObject *[source]
eval_deriv_vector(pygsl_spline self, gsl_vector const * IN) PyObject *[source]
eval_e(pygsl_spline self, double IN) gsl_error_flag_drop[source]
eval_e_vector(pygsl_spline self, gsl_vector const * IN) PyObject *[source]
eval_integ(pygsl_spline self, double a, double b) double[source]
eval_integ_e(pygsl_spline self, double a, double b) gsl_error_flag_drop[source]
eval_integ_e_vector(pygsl_spline self, gsl_vector const * IN, gsl_vector const * IN2) PyObject *[source]
eval_integ_vector(pygsl_spline self, gsl_vector const * IN, gsl_vector const * IN2) PyObject *[source]
eval_vector(pygsl_spline self, gsl_vector const * IN) PyObject *[source]
init(pygsl_spline self, double const [] xa) gsl_error_flag_drop[source]
min_size(pygsl_spline self) unsigned int[source]
name(pygsl_spline self) char const *[source]
property thisown

The membership flag

tocobject(pygsl_spline self) PyObject *[source]

interpolation2d_wrap

Modules for testing internals

Submodules

init

pygsl.init module

This module is a collection of internal conversion function. These functions typically need not be accessed by the pygsl user. All functionality is wrapped by appropriate functions and exported to the user at a higher level

Warning

Please note the functions given here change the total behaviour of pygsl. If wrongly used it could even crash the program.

pygsl.init.add_c_traceback_frames()

GSL solvers make callbacks to registered python functions at moments often not expected. Therefore traceback frames were added which are automatically inserted by the C Code These traceback frames, however, create a memory leak in the current implementation. So these are disabled by default and can be enabled by setting a true value with this function. Setting to 0/False will disable it again

pygsl.init.complex_transform_counter()

Number of transforms required by complex objects

How many times objects which were passed as complex arguments had to be transformed to appropriate python object?

Parameters:

None

Returns:

number of convertions executed

Return type:

long

pygsl.init.error_handler_state_get()

Get the stored error state

User access best using: pygsl.errors.error_safe_state

pygsl.init.error_handler_state_reset()

Reset the stored error state

User access best using: pygsl.errors.error_safe_state

pygsl.init.float_transform_counter()

Number of transforms required by float objects

How many times objects which were passed as float arguments had to be transformed to appropriate object? (e.g. an integer had to be converted to a float)

Parameters:

None

Returns:

number of convertions executed

Return type:

long

pygsl.init.get_debug_level()

Get the internal debug level

see pygsl.set_debug_level() for details

pygsl.init.matrix_transform_counter()

Number of transforms required by matrix objects

How many times objects which were passed as matrix arguments had to be transformed to appropriate numpy array?

Parameters:

None

Returns:

number of convertions executed

Return type:

long

pygsl.init.register_exceptions()

Used to register all exceptions

Warning

Internal function! Do not use it if not familar!

pygsl.init.register_warnings()

Used to register all exceptions

Warning

Internal function! Do not use it if not familar!

pygsl.init.set_debug_level()

Set the internal debug level

see pygsl.set_debug_level() for details

pygsl.init.vector_transform_counter()

Number of transforms required by vector objects

How many times objects which were passed as vector arguments had to be transformed to appropriate numpy array?

Parameters:

None

Returns:

number of convertions executed

Return type:

long

inittest

Functions needed to test the pygsl.init

pygsl.inittest.complex_conversion()

convert python complex to gsl complex and back to python complex

pygsl.inittest.new_array()

create a vector or a matrix. Requires first dimension plus optional a second dimension

pygsl.inittest.test_getptr1()

Prints the offset calculated for the different cols for a matrix using stride or GetPtr1

pygsl.inittest.vector_or_double()

Pass a vector or a double in. It will return a Python Array Object

pygsl.inittest.vector_refcount()

Accepts a vector and returns the refcount to the object

errortest

Functions needed to test the error handling provided by pygsl.init and the gsl error handler gsl_error().

block

vector

Vector module.

This module provides mappings to some functions of gsl vectors as descirebed in Chapter 8.3 of the gsl reference document. All functions accept one dimensional Numeric arrays instead of gsl vectors, or return Numeric arrays.

Warning

When translating alghorithms from C to Python, check if the

functions do the same. Inplace change does not need to have effect here, some of these functions make copies internally.

All functions from Section 8.3.3 take an integer as input and return an approbriate Numeric array as output. The prefix gsl_vector has been discarded. These functions are:

  • set_zero

  • set_all

  • set_basis

Functions to read write the vector from a file are provided as well:
  • fprintf

  • fscanf

  • fread

  • fwrite

Some basic data operations are provided as well (See Section 8.3.7):
  • reverse

  • swap

  • swap_elements

And some functions from Section 8.3.9
  • max

  • min

  • minmax

  • isnull

  • max_index

  • min_index

  • minmax_index

matrix_pierre

The matrix module.

This module provides mappings to some functions of gsl vectors as descirbed in Chapter 8. of the gsl reference document. All functions accept one dimensional Numeric arrays instead of gsl vectors, or return Numeric arrays.

Warning

When translating alghorithms from C to Python, check if the functions do the same. Inplace change does not need to have effect here, some of these functions make copies internally.

All functions from Section 8. take an integer as input and return an approbriate Numeric array as output. The prefix gsl_matrix has been discarded. These functions are:

  • set_zero

  • set_all

  • set_identity

Functions to read write the matrix from a file are provided as well:
  • fprintf

  • fscanf

  • fread

  • fwrite

Some basic data operations are provided as well (See Section 8.):
  • diagonal

  • subdiagonal

  • superdiagonal

  • swap

  • swap_columns

  • swap_rowcol

  • swap_rows

  • transpose

And some functions from Section 8.
  • max

  • min

  • minmax

  • isnull

  • max_index

  • min_index

  • minmax_index