When I try to generate 100 x 100 data point using F# and Math.NET using the following code:
let theta0_vals = Generate.LinearSpaced(100, -10.0, 10.0)
let theta1_vals = Generate.LinearSpaced(100, -1.0, 4.0)
let fct a b = 2.0 * a * b
let points = [for i in theta0_vals -> [for j in theta1_vals -> fct (float i) (float j) ]]
then I get the following the following exception:
[System.NullReferenceException: Object reference not set to an instance of an object at Microsoft.FSharp.Core.Operators.FailurePattern (System.Exception error) [0x00001] in <57a12c4adff9fae1a74503834a2ca157>:0 at Microsoft.FSharp.Compiler.ErrorLogger+ErrorLoggerExtensions.ReraiseIfWatsonable (System.Exception exn) [0x0002d] in <5707a356ddab8ea7a745038356a30757>:0 at Microsoft.FSharp.Compiler.ErrorLogger+ErrorLoggerExtensions.ErrorLogger.ErrorRecovery (Microsoft.FSharp.Compiler.ErrorLogger+ErrorLogger x, System.Exception exn, Microsoft.FSharp.Compiler.Range+range m) [0x00087] in <5707a356ddab8ea7a745038356a30757>:0 at Microsoft.FSharp.Compiler.ErrorLogger+ErrorLoggerExtensions.ReraiseIfWatsonable (System.Exception exn) [0x00040] in <5707a356ddab8ea7a745038356a30757>:0 at Microsoft.FSharp.Compiler.ErrorLogger+ErrorLoggerExtensions.ErrorLogger.ErrorRecovery (Microsoft.FSharp.Compiler.ErrorLogger+ErrorLogger x, System.Exception exn, Microsoft.FSharp.Compiler.Range+range m) [0x00087] in <5707a356ddab8ea7a745038356a30757>:0 at Microsoft.FSharp.Compiler.ErrorLogger+ErrorLoggerExtensions.ReraiseIfWatsonable (System.Exception exn) [0x00040] in <5707a356ddab8ea7a745038356a30757>:0 at Microsoft.FSharp.Compiler.ErrorLogger+ErrorLoggerExtensions.ErrorLogger.ErrorRecovery (Microsoft.FSharp.Compiler.ErrorLogger+ErrorLogger x, System.Exception exn, Microsoft.FSharp.Compiler.Range+range m) [0x00087] in <5707a356ddab8ea7a745038356a30757>:0
I am using the F# interactive in Xamarin Studio on a Mac with 16 GB ram. I have no problems doing the same thing in Matlab.
Is this a limitation in F# and/or Math.NET?