Let's start with a really simple example. Try to complile the following program:
using std::cout;
using std::endl;
int main()
{
b = "0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0";
c = a + b;
cout << "a = " << a << endl;
cout << "b = " << b << endl;
cout << "c = " << c << endl;
A = "1.0 2.0;3.0 4.0";
cout << "A = " << A << endl;
cout << "B = " << B << endl;
return 0;
}
Mat< double > mat
Default Matrix Type.
Vec< double > vec
Definition of double vector type.
bool inv(const mat &X, mat &Y)
Inverse of real square matrix.
vec linspace(double from, double to, int points)
linspace (works in the same way as the MATLAB version)
Include file for the IT++ base module.
When you run this program, the output shall look like this
a = [1 1.11111 1.22222 1.33333 1.44444 1.55556 1.66667 1.77778 1.88889 2]
b = [0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1]
c = [1.1 1.31111 1.52222 1.73333 1.94444 2.15556 2.36667 2.57778 2.78889 3]
A = [[1 2]
[3 4]]
B = [[-2 1]
[1.5 -0.5]]
If this is what you see, then congratulations! You have managed to compile your first it++ program!