1 the origin

Expect to understand the algorithm beyond the python API level, using go to achieve a deeper understanding, avoid complex pointer operations, and bypass the tedious c++ syntax

In addition, the low hardware resource consumption of GO language is convenient for porting to cheaper chips to reduce costs, and it is expected to use the distributed characteristics of GO to achieve large matrix operations (such as eigenvalue problems).

At the same time, go’s algorithm library is more convenient to call from the cloud, and more convenient to compile into the client program (such as combining H5 to realize the scientific calculator).

2 ideas

The advantage of using slices to represent matrices is that there is no need to write down the width and height of matrices when defining functions

The key point is one-dimensional slice creation

3 implementation

/ / func addMatrix(a [][]int, b [][]int, m int, n int) [][]int {res := make([][]int, m) for I := 0; i < m; i++ { resI := make([]int, n) for j := 0; j < n; J ++ {resI[j] = a[I][j] + b[I][j]} res[I] = resI return res} /** matrix (a [][]int, b [][]int, m int, n int, k int) [][]int { res := make([][]int, m) for i := 0; i < m; i++ { resI := make([]int, k) for j := 0; j < n; j++ { for kk := 0; kk < k; kk++ { resI[kk] += a[i][j] * b[j][kk] } } res[i] = resI } return res }Copy the code

4 look

  • Scientific calculator
  • Matrix decomposition, distributed task scheduling to achieve operational acceleration
  • Rewrite the Python library pandas, Numpy, sklearn, etc
  • Transplant to STM32 and other chips
  • Matlab go cloud version

5 Network Resources

You can refer to its packaging on the structure, as well as the division of modules

What are the GO matrix libraries? Cloud.tencent.com/developer/a…

Golang, determinant, matrix multiplication inverse matrix www.cnblogs.com/zheng123/p/…

A Update records

= = = = = = = = = = = = = = = = = = = = = =

The 2021-10-15 11

Remove some of the test code highlights

An implementation scheme to supplement existing network resources