API Reference
dhllinalg.bla
Basic linear algebra module
- class dhllinalg.bla.Vector
- __add__(self: dhllinalg.bla.Vector, other: dhllinalg.bla.Vector) dhllinalg.bla.Vector
Vector addition
- __getitem__(self: dhllinalg.bla.Vector, index: int) float
Get value of item with index “index”
- __init__(self: dhllinalg.bla.Vector, size: int) None
Create vector of length “size”
- __len__(self: dhllinalg.bla.Vector) int
Return length of vector
- __mul__(self: dhllinalg.bla.Vector, other: dhllinalg.bla.Vector) float
Vector product
- __rmul__(self: dhllinalg.bla.Vector, scal: float) dhllinalg.bla.Vector
Vector scaling
- __setitem__(*args, **kwargs)
Overloaded function.
__setitem__(self: dhllinalg.bla.Vector, index: int, value: float) -> None
Set value of item with index “index”
__setitem__(self: dhllinalg.bla.Vector, indices: slice, value: float) -> None
Set value of items with index in “indices”
- __str__(self: dhllinalg.bla.Vector) str
Print vector elements.
- class dhllinalg.bla.Matrix
- I(self: dhllinalg.bla.Matrix) dhllinalg.bla.Matrix
Matrix inverse.
- T(self: dhllinalg.bla.Matrix) dhllinalg.bla.Matrix
Matrix transpose.
- __add__(self: dhllinalg.bla.Matrix, other: dhllinalg.bla.Matrix) dhllinalg.bla.Matrix
Matrix addition
- __getitem__(*args, **kwargs)
Overloaded function.
__getitem__(self: dhllinalg.bla.Matrix, index: Tuple[int, int]) -> float
Get value of item with index “index”
__getitem__(self: dhllinalg.bla.Matrix, indices: Tuple[int, slice]) -> dhllinalg.bla.Vector
Get values of items with index in “indices”
__getitem__(self: dhllinalg.bla.Matrix, indices: Tuple[slice, int]) -> dhllinalg.bla.Vector
Get values of items with index in “indices”
__getitem__(self: dhllinalg.bla.Matrix, indices: Tuple[slice, slice]) -> dhllinalg.bla.Matrix
Get values of items with index in “indices”
- __init__(self: dhllinalg.bla.Matrix, rows: int, cols: int) None
Create matrix of “rows” rows and “cols” columns.
- __mul__(*args, **kwargs)
Overloaded function.
__mul__(self: dhllinalg.bla.Matrix, scal: float) -> dhllinalg.bla.Matrix
Matrix scaling
__mul__(self: dhllinalg.bla.Matrix, other: dhllinalg.bla.Matrix) -> dhllinalg.bla.Matrix
Matrix multipliaction (deprecated, use InnerProduct instead)
__mul__(self: dhllinalg.bla.Matrix, vec: dhllinalg.bla.Vector) -> dhllinalg.bla.Vector
Matrix vector multipliaction
- __rmul__(*args, **kwargs)
Overloaded function.
__rmul__(self: dhllinalg.bla.Matrix, scal: float) -> dhllinalg.bla.Matrix
Matrix scaling
__rmul__(self: dhllinalg.bla.Matrix, vec: dhllinalg.bla.Vector) -> dhllinalg.bla.Vector
Matrix vector multipliaction
- __setitem__(*args, **kwargs)
Overloaded function.
__setitem__(self: dhllinalg.bla.Matrix, index: Tuple[int, int], value: float) -> None
Set value of item with index “index” to “value”
__setitem__(self: dhllinalg.bla.Matrix, indices: Tuple[int, slice], value: float) -> None
Set value of items with index “indices” to “value”
__setitem__(self: dhllinalg.bla.Matrix, indices: Tuple[slice, int], value: float) -> None
Set value of items with index “indices” to “value”
__setitem__(self: dhllinalg.bla.Matrix, indices: Tuple[slice, slice], value: float) -> None
Set value of items with index “indices” to “value”
- __str__(self: dhllinalg.bla.Matrix) str
Print matrix elements.
- property ncols
Get number of columns.
- property nrows
Get number of rows.
- property shape
Get matrix shape as tuple[rows, cols].
- class dhllinalg.bla.ParallelComputing
- __enter__(self: dhllinalg.bla.ParallelComputing) None
Start parallel computing (multithreading).
- __exit__(self: dhllinalg.bla.ParallelComputing, arg0: object, arg1: object, arg2: object) None
Stop parallel computing (multithreading).
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: dhllinalg.bla.ParallelComputing) -> None
Set number of threads to hardware concurrency.
__init__(self: dhllinalg.bla.ParallelComputing, nThreads: int) -> None
Set number of threads to “nThreads”.
__init__(self: dhllinalg.bla.ParallelComputing, Trace: bool) -> None
Set number of threads to hardware concurrency and prepare to write trace file.
__init__(self: dhllinalg.bla.ParallelComputing, nThreads: int, Trace: bool) -> None
Set number of threads to “nThreads” and prepare to write trace file.
- dhllinalg.bla.InnerProduct(u: bla::Matrix<double, (bla::ORDERING)1>, v: bla::Matrix<double, (bla::ORDERING)1>) bla::Matrix<double, (bla::ORDERING)1>
Matrix multiplication of u and v.
- dhllinalg.bla.NumThreads() int
Get number of threads in use