Skip to content

Commit

Permalink
Merge pull request #19 from yuehhua/master
Browse files Browse the repository at this point in the history
Add MatrixMultiplication
  • Loading branch information
yuehhua authored Apr 24, 2020
2 parents 4cb360b + 98496d0 commit a738dde
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 0 deletions.
13 changes: 13 additions & 0 deletions MatrixMultiplication/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name = "MatrixMultiplication"
uuid = "6fb7e565-1e98-4352-a061-49756642246e"
authors = ["Yueh-Hua Tu <[email protected]>"]
version = "0.1.0"

[compat]
julia = "1.4"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
32 changes: 32 additions & 0 deletions MatrixMultiplication/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 矩陣乘法

矩陣乘法是在數值計算中相當基本的運算方式,矩陣乘法的效率常常也決定了數值軟體的效能。矩陣乘法中的每個元素計算依循以下式子:

<img src="https://i.imgur.com/0g2zDzN.png" width="40%">

## 測試

```julia
A = [1 2; 3 4]
B = [1, 0]
C = [1, 3]
@test all(multiply(A, B) .== C)
```

### 測試資料

以下測試資料中,請計算 `A``B` 相乘,並比對正確答案 `C`

```julia
A1 = rand(5, 5)
B1 = rand(5, 5)
C1 = A1*B1

A2 = rand(1, 5)
B2 = rand(5, 1)
C2 = A2*B2

A3 = rand(3, 4)
B3 = rand(4, 5)
C3 = A3*B3
```
10 changes: 10 additions & 0 deletions MatrixMultiplication/src/MatrixMultiplication.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module MatrixMultiplication

src = [
]

for s = src
include("$(s).jl")
end

end # module
11 changes: 11 additions & 0 deletions MatrixMultiplication/test/runtests.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using MatrixMultiplication
using Test

tests = [
]

@testset "MatrixMultiplication.jl" begin
for t in tests
include("$(t).jl")
end
end
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

### 簡單資料結構

* [矩陣乘法](MatrixMultiplication/)

### 排序演算法

* [氣泡排序法](BubbleSort/)
Expand Down

0 comments on commit a738dde

Please sign in to comment.