Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add rank 1 real matrix update / outer product #14

Open
cartazio opened this issue Mar 10, 2014 · 4 comments
Open

add rank 1 real matrix update / outer product #14

cartazio opened this issue Mar 10, 2014 · 4 comments

Comments

@cartazio
Copy link
Member

sger and dger

http://software.intel.com/sites/products/documentation/hpc/mkl/mklman/GUID-BD2E87B3-5FA7-4E0C-88E2-1982AB0773A2.htm

https://github.com/wellposed/hblas/blob/master/src/Numerical/HBLAS/BLAS/FFI.hs#L247-L250

-- perform the rank 1 operation   A := alpha*x*y' + A,

--void cblas_sger (  enum CBLAS_ORDER order,   CInt M,   CInt N,   Float   alpha,   Float  *X,   CInt incX,   Float  *Y,   CInt incY, Float  *A,   CInt lda);
--void cblas_dger (  enum CBLAS_ORDER order,   CInt M,   CInt N,   Double  alpha,   Double *X,   CInt incX,   Double *Y,   CInt incY, Double *A,   CInt lda);

the haskelly high level version would look like (assuming you punt on dealing with modelling the vectors properly because i've not added strided vector support to hblas yet, and you assume inx and incy are set to 1)

sger ::( PrimMonad s) =>Float -> Float 
   -> Mvector (PrimState s) Float -> MVector (PrimState s) Float 
  ->  MutDenseMatrix (PrimState m) orient Float -> m () 

note this would actually be done slightly differently once I add strided vector support

a mini explanation of some of the API stuff I do currently is on this other ticket #13

don't hesitate to ask for help

@cartazio
Copy link
Member Author

could adapt the very dumb lacking test program https://github.com/wellposed/hblas/blob/master/testing/Test.hs to test this

@adrian-nitu-92
Copy link

Small mistake : the function signature should be :

sger ::( PrimMonad s) =>
Float -> Mvector (PrimState s) Float -> MVector (PrimState s) Float 
  ->  MutDenseMatrix (PrimState m) orient Float -> m () 

@cartazio
Copy link
Member Author

@cartazio
Copy link
Member Author

note that this may not be implemented correctly in terms of certain corner cases, reopening for now and this ticket + associated audit needs to be done before i do the next release

@cartazio cartazio reopened this Mar 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants