Mercurial > octave-nkf
comparison examples/code/standalonebuiltin.cc @ 19630:0e1f5a750d00
maint: Periodic merge of gui-release to default.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 20 Jan 2015 10:24:46 -0500 |
parents | examples/standalonebuiltin.cc@446c46af4b42 examples/standalonebuiltin.cc@c8240a60dd01 |
children |
comparison
equal
deleted
inserted
replaced
19626:37d37297acf8 | 19630:0e1f5a750d00 |
---|---|
10 | 10 |
11 for (octave_idx_type i = 0; i < n; i++) | 11 for (octave_idx_type i = 0; i < n; i++) |
12 for (octave_idx_type j = 0; j < n; j++) | 12 for (octave_idx_type j = 0; j < n; j++) |
13 a_matrix(i,j) = (i + 1) * 10 + (j + 1); | 13 a_matrix(i,j) = (i + 1) * 10 + (j + 1); |
14 | 14 |
15 std::cout << "This is a matrix:" << std::endl | 15 std::cout << "This is a matrix:" << std::endl |
16 << a_matrix << std::endl; | 16 << a_matrix << std::endl; |
17 | 17 |
18 octave_value_list in; | 18 octave_value_list in; |
19 in(0) = a_matrix; | 19 in(0) = a_matrix; |
20 | 20 |
21 octave_value_list out = Fnorm (in, 1); | 21 octave_value_list out = Fnorm (in, 1); |
22 double norm_of_the_matrix = out(0).double_value (); | 22 double norm_of_the_matrix = out(0).double_value (); |
23 | 23 |
24 std::cout << "This is the norm of the matrix:" << std::endl | 24 std::cout << "This is the norm of the matrix:" << std::endl |
25 << norm_of_the_matrix << std::endl; | 25 << norm_of_the_matrix << std::endl; |
26 | 26 |
27 return 0; | 27 return 0; |
28 } | 28 } |