|
|
@ -32,6 +32,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double |
|
|
|
|
|
|
|
|
open MathNet.Numerics.LinearAlgebra |
|
|
open MathNet.Numerics.LinearAlgebra |
|
|
open MathNet.Numerics.LinearAlgebra.Generic |
|
|
open MathNet.Numerics.LinearAlgebra.Generic |
|
|
|
|
|
|
|
|
/// A module which implements functional vector operations. |
|
|
/// A module which implements functional vector operations. |
|
|
module Vector = |
|
|
module Vector = |
|
|
|
|
|
|
|
|
@ -173,4 +174,14 @@ module Vector = |
|
|
let mutable p = v.Item(v.Count-1) |
|
|
let mutable p = v.Item(v.Count-1) |
|
|
for i=2 to v.Count do |
|
|
for i=2 to v.Count do |
|
|
p <- f (v.Item(v.Count - i)) p |
|
|
p <- f (v.Item(v.Count - i)) p |
|
|
p |
|
|
p |
|
|
|
|
|
|
|
|
|
|
|
/// Creates a new vector and inserts the given value at the given index. |
|
|
|
|
|
let inline insert index value (v: #Vector<float>) = |
|
|
|
|
|
let newV = new DenseVector(v.Count + 1) |
|
|
|
|
|
for i = 0 to index - 1 do |
|
|
|
|
|
newV.Item(i) <- v.Item(i) |
|
|
|
|
|
newV.Item(index) <- value |
|
|
|
|
|
for i = index + 1 to v.Count do |
|
|
|
|
|
newV.Item(i) <- v.Item(i - 1) |
|
|
|
|
|
newV |