Armadillo (C++ Library) - Example

Example

Here is a trivial example demonstrating Armadillo functionality:

#include #include using namespace std; using namespace arma; int main { vec b; b << 2.0 << 5.0 << 2.0; mat A; A << 1.0 << 2.0 << endr << 2.0 << 3.0 << endr << 1.0 << 3.0 << endr; cout << "Least squares solution:" << endl; cout << solve(A,b) << endl; return 0; }

Read more about this topic:  Armadillo (C++ Library)

Famous quotes containing the word example:

    Our intellect is not the most subtle, the most powerful, the most appropriate, instrument for revealing the truth. It is life that, little by little, example by example, permits us to see that what is most important to our heart, or to our mind, is learned not by reasoning but through other agencies. Then it is that the intellect, observing their superiority, abdicates its control to them upon reasoned grounds and agrees to become their collaborator and lackey.
    Marcel Proust (1871–1922)