Thread overview
Linear algebra for Win64?
Jul 09, 2013
Kevin McTaggart
Jul 10, 2013
dnewbie
Jul 12, 2013
Kevin McTaggart
Jul 12, 2013
David
July 09, 2013
Does anyone know of a good D linear algebra library for Win64?  I tried scid a year ago and liked it on Win32, but have been unable to get it to link on Win64.  When trying to run scid on Win64, I've been using prebuilt LAPACK 3.4.1 libraries from http://icl.cs.utk.edu/lapack-for-windows/lapack/, but have unresolved external symbol dgesv_
July 10, 2013
On Tuesday, 9 July 2013 at 19:02:09 UTC, Kevin McTaggart wrote:
> Does anyone know of a good D linear algebra library for Win64?  I tried scid a year ago and liked it on Win32, but have been unable to get it to link on Win64.  When trying to run scid on Win64, I've been using prebuilt LAPACK 3.4.1 libraries from http://icl.cs.utk.edu/lapack-for-windows/lapack/, but have unresolved external symbol dgesv_

You can try this:

/*
1. Create ABC.DEF with MS-NOTEPAD
------------ cut ---------------
LIBRARY LIBLAPACK.DLL
EXPORTS
dgesv_
------------ cut ---------------

2. Create ABC.LIB with MS-LIB
"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\Bin\amd64\lib.EXE" /DEF:ABC.DEF /MACHINE:X64 /OUT:ABC.LIB

3. Compile & link
dmd -m64 test1.d ABC.lib

4. Run
test1.exe
The solution is -0.661082 9.456125 -16.014625
*/

import std.stdio;

extern(System) void dgesv_(const(int)* N, const(int)* nrhs, double* A, const(int)* lda,
	int* ipiv, double* b, const(int)* ldb, int* info);

void main()
{
    /* 3x3 matrix A
     * 76 25 11
     * 27 89 51
     * 18 60 32
     */
    double A[9] = [76, 27, 18, 25, 89, 60, 11, 51, 32];
    double b[3] = [10, 7, 43];

    int N = 3;
    int nrhs = 1;
    int lda = 3;
    int ipiv[3];
    int ldb = 3;
    int info;

    dgesv_(&N, &nrhs, A.ptr, &lda, ipiv.ptr, b.ptr, &ldb, &info);

    if (info == 0) /* succeed */
		writefln("The solution is %f %f %f", b[0], b[1], b[2]);
    else
		writefln("dgesv_ fails %d", info);

}
July 12, 2013
On further consideration, I think my best option is to write D code for the small number of linear algebra routines that I require.
July 12, 2013
Am 12.07.2013 13:52, schrieb Kevin McTaggart:
> On further consideration, I think my best option is to write D code for the small number of linear algebra routines that I require.

What do you need? Maybe gl3n.liang[1] is enough? gl3n isn't a scientific linear algebra library, aims more for gamedevelopment, still it has all the basic operations on matrices, vectors, quaternions.



[1] https://github.com/Dav1dde/gl3n