June 2018 Update

This commit is contained in:
Ingy döt Net 2018-06-22 20:57:24 +00:00
parent ba8067c3b7
commit 22f33d4004
5278 changed files with 84726 additions and 14379 deletions

View file

@ -1,5 +1,5 @@
real, dimension(n,m) :: a = reshape( (/ (i, i=1, n*m) /), (/ n, m /) )
real, dimension(m,k) :: b = reshape( (/ (i, i=1, m*k) /), (/ m, k /) )
real, dimension(n,m) :: a = reshape( [ (i, i=1, n*m) ], [ n, m ] )
real, dimension(m,k) :: b = reshape( [ (i, i=1, m*k) ], [ m, k ] )
real, dimension(size(a,1), size(b,2)) :: c ! C is an array whose first dimension (row) size
! is the same as A's first dimension size, and
! whose second dimension (column) size is the same

View file

@ -3,21 +3,21 @@ package main
import (
"fmt"
"github.com/gonum/matrix/mat64"
"gonum.org/v1/gonum/mat"
)
func main() {
a := mat64.NewDense(2, 4, []float64{
a := mat.NewDense(2, 4, []float64{
1, 2, 3, 4,
5, 6, 7, 8,
})
b := mat64.NewDense(4, 3, []float64{
b := mat.NewDense(4, 3, []float64{
1, 2, 3,
4, 5, 6,
7, 8, 9,
10, 11, 12,
})
var m mat64.Dense
var m mat.Dense
m.Mul(a, b)
fmt.Println(mat64.Formatted(&m))
fmt.Println(mat.Formatted(&m))
}

View file

@ -0,0 +1,4 @@
mul::{[a b];b::+y;{a::x;+/'{a*x}'b}'x}
[[1 2] [3 4]] mul [[5 6] [7 8]]
[[19 22]
[43 50]]

View file

@ -0,0 +1,9 @@
. mat a=1,2,3\4,5,6
. mat b=1,1,0,0\1,0,0,1\0,0,1,1
. mat c=a*b
. mat list c
c[2,4]
c1 c2 c3 c4
r1 3 1 3 5
r2 9 4 6 11

View file

@ -0,0 +1,8 @@
: a=1,2,3\4,5,6
: b=1,1,0,0\1,0,0,1\0,0,1,1
: a*b
1 2 3 4
+---------------------+
1 | 3 1 3 5 |
2 | 9 4 6 11 |
+---------------------+