Advertisement
Guest User

Untitled

a guest
Oct 6th, 2016
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.55 KB | None | 0 0
  1. module DenseMatrix =
  2.     type DenseMatrix<'t> =
  3.        {
  4.            NumRows : int;
  5.            NumCols : int;
  6.            Data : 't array
  7.         }
  8.  
  9.         static member inline (+) (x, y) =
  10.             DenseMatrix<_>.map2 (+) x y
  11.             // Failed to inline the value 'map2' marked 'inline',
  12.             //perhaps because a recursive value was marked 'inline'
  13.  
  14.  
  15.         static member inline map2 f x y =
  16.             {
  17.                 NumRows = x.NumRows;
  18.                 NumCols = x.NumCols;
  19.                 Data = Array.map2 f x.Data y.Data
  20.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement