This module provides basic linear algebra operations such as vector and matrix products as provided by the <Eigen/Core> include.
Cython fused type, a selection of C char, short, int, long, float and double (Python float).
Cython fused type for methods that cannot work with integer types (such as inv()).
Convenience function to create a new vector (cython.view.array) and return a memoryview of it. This function is declared with gil (it can be called without the GIL held, but acquires it during execution) and is rather expensive (as many Python calls are done).
Parameters: | |
---|---|
Return type: |
Convenience function to create a new matrix (cython.view.array) and return a memoryview of it. This function is declared with gil (it can be called without the GIL held, but acquires it during execution) and is rather expensive (as many Python calls are done).
Parameters: | |
---|---|
Return type: |
Vector-vector dot product, returns a scalar of appropriate type.
Parameters: | |
---|---|
Raises : | ValueError if argument dimensions aren’t appropriate for this operation or if arguments are otherwise invalid. |
Raises : | TypeError if you pass an argument that doesn’t support buffer interface (e.g. a plain list). Use preferrably a Cython memoryview and resort to Python array, Cython array or a NumPy array. |
Return type: |
Matrix-(column) vector product, returns a vector of appropriate type.
Parameters: |
|
---|---|
Raises : | ValueError if argument dimensions aren’t appropriate for this operation or if arguments are otherwise invalid. |
Raises : | TypeError if you pass an argument that doesn’t support buffer interface (e.g. a plain list). Use preferrably a Cython memoryview and resort to Python array, Cython array or a NumPy array. |
Return type: |
(Row) vector-matrix product, returns a vector of appropriate type. This is equivalent to dotvm(y.T, x) because there’s no distinction between row and column vectors in Cython memoryviews, but calling this function directly may incur slightly less overhead.
Parameters: |
|
---|---|
Raises : | ValueError if argument dimensions aren’t appropriate for this operation or if arguments are otherwise invalid. |
Raises : | TypeError if you pass an argument that doesn’t support buffer interface (e.g. a plain list). Use preferrably a Cython memoryview and resort to Python array, Cython array or a NumPy array. |
Return type: |
Matrix-matrix product, returns a matrix of appropriate type and dimensions. You may of course use this function to multiply matrices that are in fact vectors, you just need to pay attention to column-vector vs. row-vector distinction this time.
If both x and y are contiguous in some way (either C or Fortran, independently), this function takes optimized code path that doesn’t involve memory allocation in Eigen; speed gains are around 40% for matrices around 2*2 – 24*24 size. No special markup is needed to trigger this. See also set_is_malloc_allowed().
Parameters: |
|
---|---|
Raises : | ValueError if argument dimensions aren’t appropriate for this operation or if arguments are otherwise invalid. |
Raises : | TypeError if you pass an argument that doesn’t support buffer interface (e.g. a plain list). Use preferrably a Cython memoryview and resort to Python array, Cython array or a NumPy array. |
Return type: |
Set the internal Eigen flag whether it is allowed to allocate memory on heap.
If this flag is False and Eigen will try to allocate memory on heap, it will assert which causes ValueError to be raised by Ceygen. This is useful to ensure you use the most optimized code path. Defaults to True. Note: for this to work, Ceygen defines EIGEN_RUNTIME_NO_MALLOC preprocessor directive before including Eigen.
See http://eigen.tuxfamily.org/dox/TopicPreprocessorDirectives.html