Using MathNet.Numerics
Author: Panache
Creation Date: 1/12/2017 6:30 PM
profile picture

Panache

#1
I'd like to be able to use a linear algebra library in Wealth-Lab Pro, specifically https://numerics.mathdotnet.com/.

I assume it isn't possible to use NuGet, so I downloaded the zip file. I also assume there isn't a way to use <loadFromRemoteSources> https://msdn.microsoft.com/en-us/library/dd409252(VS.100).aspx, so I changed the properties of MathNet.Numerics.dll to unblock it's Security. I then added a reference to the .dll in my Strategy, but when I try to use any of the linear algebra functions, I get a runtime error, "Cannot load file or assembly 'MathNet.Numerics, Version 3.16.0.0 . . . . The system cannot find the file specified."

CODE:
Please log in to see this code.


I am sure what I'm doing is unsupported, but I'd appreciate any ideas as to how to make this or another linear algebra library work in Wealth-Lab Pro.

profile picture

Eugene

#2
It works. You don't even have to add a reference to the DLL. When I...

1. uncheck "Downloaded from the internet" in the file's properties,
2. copy the DLL to the WLD main folder under Program Files, and
3. restart WLD,

...this is what I get after running a PrintDebug on your code:
CODE:
Please log in to see this code.


QUOTE:
DenseMatrix 3x4-Double
1 1 1 1
1 2 3 4
4 3 2 1


Last but not least, I took the assembly from /lib/net40 of mathnet.numerics.3.16.0.nupkg (if that matters).
profile picture

Panache

#3
Thanks. It works. The only two things I did differently were to copy the dll to the program directory and restart Wealth-Lab Pro.
profile picture

Eugene

#4
Glad to help.