Calling directly blas functions in Oct file

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Calling directly blas functions in Oct file

niconeuman
Hi,
I have to do a lot of matrix operations that involve real symmetric matrices, and it would be much faster to store the lower triangular part in a vector form. I understand that blas operations can work directly with these packed forms. But as far as I know octave functions require the full matrices for operations such as matrix multiplications, am I wrong?
I was wondering if there is a simple way to call blas functions directly from Oct files (I have some experience with them, but only c++ code). If someone has an example of these they could provide I think I could work from that. Any help on this direction will be appreciated!
Thank you very much,
Nicolas


Reply | Threaded
Open this post in threaded view
|

Re: Calling directly blas functions in Oct file

Nicklas Karlsson
> Hi,
> I have to do a lot of matrix operations that involve real symmetric
> matrices, and it would be much faster to store the lower triangular part in
> a vector form. I understand that blas operations can work directly with
> these packed forms. But as far as I know octave functions require the full
> matrices for operations such as matrix multiplications, am I wrong?
> I was wondering if there is a simple way to call blas functions directly
> from Oct files (I have some experience with them, but only c++ code). If
> someone has an example of these they could provide I think I could work
> from that. Any help on this direction will be appreciated!
> Thank you very much,
> Nicolas

Maybe the sparse matrices functions will help https://octave.org/doc/v4.0.3/Creating-Sparse-Matrices.html


Regards Nicklas SB Karlsson


Reply | Threaded
Open this post in threaded view
|

Re: Calling directly blas functions in Oct file

niconeuman
Hi, thank you very much for your answer, and sorry for the delay in answering
myself.
I will look into sparse matrices, they will probably be of use for some of
the stuff. Still I am interested in knowing how to call blas functions
directly from an oct-file, if anyone knows.
Thanks again,
best regards
Nicolas



--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: Calling directly blas functions in Oct file

siko1056
On 4/20/20 11:29 PM, niconeuman wrote:
> Hi, thank you very much for your answer, and sorry for the delay in answering
> myself.
> I will look into sparse matrices, they will probably be of use for some of
> the stuff. Still I am interested in knowing how to call blas functions
> directly from an oct-file, if anyone knows.
> Thanks again,
> best regards
> Nicolas
>

Dear Nicolas,

Last year I made an example for LAPACK [1,2].  BLAS should be quite
similar.  Another interesting reference is in the manual [3].

HTH,
Kai

[1]
https://github.com/octave-de/octave_slides/blob/master/hands_on/fortran.ipynb
[2]
https://github.com/octave-de/octave_slides/blob/master/hands_on/functions/call_dgesv.cc
[3]
https://octave.org/doc/v5.2.0/Calling-External-Code-from-Oct_002dFiles.html#Calling-External-Code-from-Oct_002dFiles


Reply | Threaded
Open this post in threaded view
|

Re: Calling directly blas functions in Oct file

niconeuman
Thank you very much Kai,
that example is exactly what I needed!
I can work from that.
Best wishes,
Nicolas



--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html