anchor.diff:  open System.Diagnostics
   open System.Collections.Generic
   
  -
  +#nowarn "9"
   
   module SVDTests =
       open Microsoft.FSharp.NativeInterop
       open System.Runtime.InteropServices
   
  -    let DecomposeWithArray(m : M33d) =
  +    let DecomposeWithArraySingle(m : M33d) =
           let U = [| M33d() |]
           let S = [| m |]
  -        let Vt = [| M33d() |]
  +        let V = [| M33d() |]
   
           use pU = fixed U
  -        use pS = fixed S
  -        use pVt = fixed Vt
  -
  -        let tU  = NativeMatrix<float>(NativePtr.cast pU,  MatrixInfo(0L, V2l(3,3), V2l(1, 3)))
  -        let tS  = NativeMatrix<float>(NativePtr.cast pS,  MatrixInfo(0L, V2l(3,3), V2l(1, 3)))
  -        let tVt = NativeMatrix<float>(NativePtr.cast pVt, MatrixInfo(0L, V2l(3,3), V2l(1, 3)))
  +        let pS = fixed S
  +        let pV = fixed V
  +
  +        let tU  = NativeMatrix<float>(NativePtr.cast pU, MatrixInfo(0L, V2l(3,3), V2l(1, 3)))
  +        let tS  = NativeMatrix<float>(NativePtr.cast pS, MatrixInfo(0L, V2l(3,3), V2l(1, 3)))
  +        let tVt = NativeMatrix<float>(NativePtr.cast pV, MatrixInfo(0L, V2l(3,3), V2l(1, 3)))
           
           if SVD.DecomposeInPlace(tU, tS, tVt) then 
  -            Some (U.[0], S.[0], Vt.[0])
  +            Some (U.[0], S.[0], V.[0])
           else
               None
   
  -    let DecomposeWithArrayWeirdTranspose(m : M33d) =
  -        // works:
  -        let U = [| M33d() |]
  -        let S = [| m.Transposed |]
  -        let Vt = [| M33d() |]
  -
  -        use pU = fixed U
  -        use pS = fixed S
  -        use pVt = fixed Vt
  -
  -        let tU  = NativeMatrix<float>(NativePtr.cast pU,  MatrixInfo(0L, V2l(3,3), V2l(3, 1)))
  -        let tS  = NativeMatrix<float>(NativePtr.cast pS,  MatrixInfo(0L, V2l(3,3), V2l(3, 1)))
  -        let tVt = NativeMatrix<float>(NativePtr.cast pVt, MatrixInfo(0L, V2l(3,3), V2l(3, 1)))
  +    let DecomposeWithArray(m : M33d) =
  +        let tmp = [| M33d(); m; M33d() |]
  +
  +        use pTmp = fixed tmp
  +        let pS = NativePtr.add pTmp 1
  +        let pV = NativePtr.add pTmp 2
  +
  +        let tU  = NativeMatrix<float>(NativePtr.cast pTmp,  MatrixInfo(0L, V2l(3,3), V2l(1, 3)))
  +        let tS  = NativeMatrix<float>(NativePtr.cast pS,  MatrixInfo(0L, V2l(3,3), V2l(1, 3)))
  +        let tVt = NativeMatrix<float>(NativePtr.cast pV, MatrixInfo(0L, V2l(3,3), V2l(1, 3)))
           
           if SVD.DecomposeInPlace(tU, tS, tVt) then 
  -            Some (U.[0].Transposed, S.[0].Transposed, Vt.[0].Transposed)
  +            Some (tmp.[0], tmp.[1], tmp.[2])
           else
               None
   
  
positive.code:                                     failwithf "Invalid SVD at %d" i
              | _ -> failwith "NONE"
  
  
negative.code:             None
  
      [<Test>]
      let ``[SVD] DecomposeWithArraySingle``() =
  
          let rnd = new RandomSystem(1)
          for i in 0..100000 do
              let mat = M33d.FromCols(rnd.UniformV3d(), rnd.UniformV3d(), rnd.UniformV3d())
  
              let svd = DecomposeWithArraySingle mat
  
              match svd with
              | Some (q, s, v) -> let test = q * s * v
                                  if not (Fun.ApproximateEquals(test, mat, 1e-6)) then
                                      failwithf "Invalid SVD at %d" i
              | _ -> failwith "NONE"
  
      [<Test>]
      let ``[SVD] DecomposeWithArray``() =
  
          let rnd = new RandomSystem(1)
          for i in 0..100000 do
              let mat = M33d.FromCols(rnd.UniformV3d(), rnd.UniformV3d(), rnd.UniformV3d())
  
              let svd = DecomposeWithArray mat
  