1

I am using Visual Studio 2017. I get an error on vector below:

Severity    Code    Description Project File    Line    Suppression State
Error   FS0039  The value or constructor 'vector' is not defined. Maybe you want one of the following:
   Vector   TestFSharp  c:\users\administrator\documents\visual studio 2017\Projects\TestFSharp\TestFSharp\Program.fs   88  Active

The program:

open System
open System.Net

open MathNet
open MathNet.Numerics
open MathNet.Numerics.LinearAlgebra.Double

let v = vector [ 1.0; 2.0; 3.0 ]
Ivan
  • 7,448
  • 14
  • 69
  • 134
  • 3
    I haven't worked with Math.NET, but by quick glance at their F# script example (https://github.com/mathnet/mathnet-numerics/blob/master/src/FSharpExamples/Vectors.fsx): Are you referencing the MathNet.Numerics.FSharp.dll for the F# APIs? If so, I can also see the example opens `MathNet.Numerics.LinearAlgebra` namespace/module which is missing in your code. – Honza Brestan Jun 24 '17 at 02:06
  • 1
    Thanks that is the problem. – Ivan Jun 24 '17 at 02:43
  • 2
    You're welcome. Which one was the problem? Or was it both the dll and the namespace? Now that we know it worked, I'd like to make it an answer so that your question doesn't remain unanswered – Honza Brestan Jun 24 '17 at 08:14
  • 1
    I was forgetting to say "open MathNet.Numerics.LinearAlgebra" – Ivan Jun 24 '17 at 18:59

1 Answers1

3

The vector function is defined in MathNet.Numerics.LinearAlgebra, you need to open that namespace as well.

Honza Brestan
  • 10,637
  • 2
  • 32
  • 43