comparison PoliMI2012/examples/standalone.cc @ 4:0a1567794b40

[mq]: folder_reorganization
author Carlo de Falco <cdf@users.sourceforge.net>
date Thu, 08 Nov 2012 09:55:34 +0100
parents
children
comparison
equal deleted inserted replaced
3:acc25d26e9e5 4:0a1567794b40
1 #include <iostream>
2 #include <octave/oct.h>
3
4 int main (void)
5 {
6
7 Matrix A (4, 4);
8 for (octave_idx_type i = 0; i < 4; i++)
9 for (octave_idx_type j = 0; j < 4; j++)
10 A(i,j) = 1.0 / (static_cast<double> (i) +
11 static_cast<double> (j) + 1.0);
12
13 ColumnVector b (4, 1.0);
14 ColumnVector x = A.solve (b);
15
16 std::cout << "A = " << std::endl << A << std::endl
17 << "b = " << std::endl << b << std::endl
18 << "x = " << std::endl << x << std::endl;
19
20 return 0;
21 }