SQL Server 2008 和 LAPACK 绑定中的内存块
LAPACK 绑定是什么?我如何使用它们来读取该内存块?
- 如何在 SQL Server 2008 中创建包含此矩阵“表”的内存块?
- 如果这是不可能的,包含矩阵的内存指针是否可行?
What is it LAPACK bindings
How do I use them to read that chunk of memory?
- How to make a memory chunk containing this matrix "table" in
SQL Server 2008
? - If that is not possible, a memory pointer, containing the matrix is feasible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
LAPACK 是一个用 Fortran 或 C(不记得是哪一个)编写的线性代数库。要从不同的编程环境使用它,您需要库的包装器,有时称为“绑定”。
我不清楚您是否想要进行计算并在存储过程中使用结果,或者只是想从数据库中提取数据并对其运行计算。
如果您需要在存储过程中使用 LAPACK,最可能使用的选项是创建一个 CLR 存储过程(即 C#)来包装使用 LAPACK 库的代码。您可能需要构建一个包装器(可能使用托管 C++)才能从 .Net 使用它。 LAPACK 将提供允许您分配该内存并返回指向它的指针或句柄的功能。
CLR 存储过程可以呈现结果(例如作为表值函数),该结果将以可在查询中使用的形式返回矩阵计算的结果。
如果要提取数据以在 LAPACK 中使用,则需要从数据库中查询数据,然后将其加载到矩阵(“内存块”)中。您可以使用任何既能绑定到 LAPACK 又能从数据库读取的语言来执行此操作。为此,您需要有一个包装器,可用于使用查询中的数据构建矩阵。如果不需要驻留在数据库中,那么您可以使用具有 LAPACK 和 ODBC 绑定的任何语言编写它。如果它确实需要驻留在数据库中(如果可能,请避免这种情况),那么您可以按照与上面大致相同的方式使用 CLR 存储过程。
LAPACK is a linear algebra library written in Fortran or C (can't remember which). To use it from a different programming environment you need a wrapper for the library, sometimes called 'Bindings'.
I'm not clear whether you want to do a computation and use the results within a stored procedure, or just want to extract data from the database and run the computation on it.
If you need to use LAPACK from within a stored procedure, the most likely option to use would be to make a CLR stored procedure (i.e. C#) that wraps your code that uses the LAPACK library. You may need to build a wrapper (maybe using managed C++) to use it from .Net. LAPACK will provide functionality that allows you to allocate this memory and return a pointer or handle to it.
The CLR Stored Procedure could present the results (as a table-valued function for example) that would return the results of the matrix computation in a form that could be used within a query.
If you want to extract data to use within LAPACK, you need to query the data from the database and then load it into the matrix ('chunk of memory'). You can do this from any language that can both bind to LAPACK and read from the database. In order to do this, you need to have a wrapper that you can use to construct the matrix with data from your query. If this doesn't need to reside within the database then you could write this in any language with both LAPACK and ODBC bindings. If it does need to reside within the database (avoid this if possible) then you can use a CLR stored procedure in much the same way as above.