let m = matrix ] let v = vector let v' = m * v let m' = m + 2.0 * m Arithmetic Instance MethodsĪll other operations are covered by methods, like Transpose and Conjugate, ArithmeticsĪll the common arithmetic operators like +, -, *, / and % are provided,īetween matrices, vectors and scalars. Or using any other of all the available functions. random 3 4 ( ContinuousUniform ( - 2.0, 4.0 ) ) let m7b = DenseMatrix. randomStandard 3 4 // random matrix with a uniform and one with a Gamma distribution: let m7a = DenseMatrix. ofColumnSeq x // random matrix with standard distribution: let m6 = DenseMatrix. init 3 ( fun r -> float ( 100 * r + c ) ) ) let m5 = DenseMatrix. identity 4 // dense 3x4 matrix created from a sequence of sequence-columns let x = Seq. init 3 4 ( fun i j -> float ( i + j ) ) // diagonal 4x4 identity matrix of single precision let m4 = DiagonalMatrix. zero 3 4 // dense 3x4 matrix initialized by a function let m3 = DenseMatrix. (usually the type is inferred, but not for zero matrices) let m2 = DenseMatrix. In F# we can use the builders just like in C#, but we can also use the F# modules: let m1 = matrix ] let v1 = vector // dense 3x4 matrix filled with zeros. Directly bind to an existing array without copying (note: no "Of") double x = existing. They support both single and double precision, real and complex floating point numbers.Ī_ Math.NET Numerics includes rich types for matrices and vectors.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |