Manipulating result table outside DBMS with MATLAB, LAPACK
Lets suppose I get a result table that can be seen as a matrix, like in the example
(the matrix is the result of a Store Procedure
or a UDF
applied to a table in SQL Server 2008
)
So suppose I get something like:
a1 a2 a3 a4
---------------------------------
1 0,16461 0,34719 -0,01701
2 0,16461 0,34719 -0,01701
3 0,16363 0,14719 -0,11701
I want to 开发者_StackOverflow中文版manipulate this kind of result (gotten from Store procedure or a UDF) outside the DBMS
, I would like to do it in 2 ways:
1.- Send the complete matrix
as some kind of binary file, I mean avoid passing through a text file
(then I would like to use MATLAB
or LAPACK
to read this binary file and manipulate it
).
2.- Send this complete matrix as a direct memory pointer
Or maybe chunks of memory of size 1 MB
having the information of the matrix, then MATLAB
or LAPACK
would access
this pointer or those chuncks of memory and be able to manipulate the matrix.
- Is any of this procedures feasible?, if so
- What would be the steps?
- Can all of this be done in a
Store procedure
, Is it necessary to use Visual C/C++ or somethink like that?
LAPACK is not a programming language itself. It's just an interface for the linear algebra, nothing else. If you have a chunk of memory containing your matrix, then you'll need LAPACK bindings for whatever language you're using (they exist for C++, fortran, python and many others), and then, yes, you'll be able to delegate the matrix manipulations to the appropriate BLAS and/or LAPACK calls.
Don't you want to extract data from the database directly in MATLAB? There is Database Toolbox in MATLAB that allows to do it without much problems. MS SQL Server is supported. Then you don't have to worry about moving the data from one application to another.
精彩评论