imo-utils is a command-line interface (CLI) tool designed to perform various mathematical computations, particularly focused on linear algebra and calculus. It provides a simple and interactive way to solve systems of linear equations, compute gradients, Hessians, and inverse matrices.
Run this command to automatically download and install the latest release:
curl -fsSL https://github.com/OMikkel/imo-utils/releases/latest/download/install.sh | bashOr with wget:
wget -qO- https://github.com/OMikkel/imo-utils/releases/latest/download/install.sh | bashDownload the appropriate binary for your platform:
| Platform | Download |
|---|---|
| Linux | imo-linux |
| macOS | imo-macos |
| Windows | imo-windows.exe |
Linux/macOS:
chmod +x imo-linux # or imo-macos
sudo mv imo-linux /usr/local/bin/imoWindows:
Move imo-windows.exe to a directory in your PATH, or run it directly.
The imo-utils CLI offers the following functionalities:
- Gradient Calculation: Computes the gradient of a multi-variable function.
- Hessian Calculation: Computes the Hessian matrix of a multi-variable function or a given matrix.
- Inverse Matrix Calculation: Computes the inverse of a square matrix.
- Gaussian Elimination: Solves a system of linear equations using the Gaussian elimination method.
The CLI operates in an interactive shell. Below are the available commands and their expected inputs.
Computes the gradient of a function.
Arguments:
function: The mathematical function to be differentiated, provided as a string.variables: A comma-separated string of the variables in the function.
Example:
(imo) gradient x**2+y**2 x,y
Computes the Hessian matrix of a function.
Arguments:
function: The mathematical function, provided as a string.variables: A comma-separated string of the variables in the function.
Example:
(imo) hessian_fnc x**2+y**2 x,y
Computes the Hessian of a matrix.
Argument:
matrix: The matrix provided as a string in the format[[row1_val1,row1_val2],[row2_val1,row2_val2]].
Example:
(imo) hessian [[1,2],[3,4]]
Computes the inverse of a matrix.
Argument:
matrix: The matrix provided as a string in the format[[row1_val1,row1_val2],[row2_val1,row2_val2]].
Example:
(imo) inverse_matrix [[1,2],[3,4]]
Solves a system of linear equations using Gaussian Elimination.
Arguments:
matrix: The augmented matrix (with the last column being the constants) as a string.variables(optional): A comma-separated string of the variable names.
Example:
(imo) gaussian [[1,2,9],[3,4,20]] x,y
Exits the imo-utils CLI.