Linear algebra, eigenvalues, FFT, Bessel, elliptic, orthogonal polys, geometry, NURBS, numerical quadrature, 3D transfinite interpolation, random numbers, Mersenne twister, probability distributions, optimisation, differential equations.
Gosl is a set of tools for developing scientific simulations using the Go language. We mainly consider the development of numerical methods and solvers for differential equations but also present some functions for fast Fourier transforms, the generation of random numbers, probability distributions, and computational geometry.
This library contains essential functions for linear algebra computations (operations between all combinations of vectors and matrices, eigenvalues and eigenvectors, linear solvers) and the development of numerical methods (e.g. numerical quadrature).
We link Gosl with existent libraries written in C and Fortran, such as OpenBLAS, LAPACK, UMFPACK, MUMPS, QUADPACK and FFTW3. These existing libraries have been fundamental for the development of high-performant simulations over many years. We believe that it is nearly impossible to rewrite these libraries in native Go and at the same time achieve the same speed delivered by them. Just for reference, a naive implementation of matrix-matrix multiplication in Go is more than 100 times slower than OpenBLAS.
Because of other (awesome) libraries, the easiest way to work with Gosl is via Docker. Having Docker and VS Code installed, you can start developing powerful numerical simulations using Gosl in a matter of minutes. Furthermore, the best part of it is that it works on Windows, Linux, and macOS out of the box.
Done. And your system will "remain clean."
Our Docker Image also contains Go and the Go Tools for working with VS Code (or not). Below is a video showing the convenience of VS Code + the Go tools + Gosl. Note how fast VS Code is in finding the function ReadLines and the package gosl/io even under a clash with Go's io package. Upon file save, the Go tools automatically add the required imports. Note also the very convenient auto-completion of the callback function given to ReadLines. Also, Code + the Go tools nicely fill the function arguments with default values.
Another great thing about VS Code is it's IntelliSense. Here, as soon as we start typing "m comma n two-dot equal T dot", VS Code immediately offers
Size()as the first option because it matches the preceding code. Fantastic!
First we have to first install some extra libraries before calling go get.
sudo apt-get install -y --no-install-recommends \ gcc \ gfortran \ libopenmpi-dev \ liblapacke-dev \ libopenblas-dev \ libmetis-dev \ libsuitesparse-dev \ libmumps-dev \ libfftw3-dev \ libfftw3-mpi-dev
go get github.com/cpmech/gosl
Done. Installation completed.
Gosl includes the following essential packages:
Gosl includes the following main packages:
(see each subdirectory for more information)
Please check out https://github.com/cpmech/gosl-examples
Please check out https://github.com/cpmech/gosl-benchmarks
These other packages, such as machine learning, plotting, etc., have been removed because they do not depend on CGO and may be developed independently. We can now maintain the core of Gosl more efficiently, which has a focus on the foundation for other scientific code.