Mercurial > hg > what-is-octave
comparison OctConf2013/examples/standalone.cc @ 8:50abddcc3409 default tip
Presentation delivered by cdf at OctConf 2013.
author | Carlo de Falco <cdf@users.sourceforge.net> |
---|---|
date | Mon, 22 Jul 2013 21:54:27 +0200 |
parents | FEMTEC2013/examples/standalone.cc@60233b0075a9 |
children |
comparison
equal
deleted
inserted
replaced
7:229882e81c78 | 8:50abddcc3409 |
---|---|
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 } |