Write a Solver for Systems of Equations Using LAPACK on Mac OS

Apple provides the Accelerate library which includes the linear algebra library (LAPACK). In this post, we will go through writing a simple C++ program to use this library on Mac OS.

Let's solve the following equations:

Equations

We can rewrite the equations as:

Equations in matrix form

Now, let's write our code:

Now, run the code by using the following commands in a terminal: