1 |
#! /usr/bin/perl -w |
#! /usr/bin/perl -w |
2 |
|
|
3 |
|
# This file is part of ff3d - http://www.freefem.org/ff3d |
4 |
|
|
5 |
|
# This program is free software; you can redistribute it and/or modify |
6 |
|
# it under the terms of the GNU General Public License as published by |
7 |
|
# the Free Software Foundation; either version 2, or (at your option) |
8 |
|
# any later version. |
9 |
|
|
10 |
|
# This program is distributed in the hope that it will be useful, |
11 |
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 |
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 |
|
# GNU General Public License for more details. |
14 |
|
|
15 |
|
# You should have received a copy of the GNU General Public License |
16 |
|
# along with this program; if not, write to the Free Software Foundation, |
17 |
|
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 |
|
|
19 |
|
# $Id$ |
20 |
|
|
21 |
# A detailed analysis of all operations on type vector/vertex. |
# A detailed analysis of all operations on type vector/vertex. |
22 |
|
|
23 |
# Currently, vectors and vertices are identical types. When this |
# Currently, vectors and vertices are identical types. When this |
25 |
|
|
26 |
require 'check.ph'; |
require 'check.ph'; |
27 |
|
|
|
# It is currently (as of 18/7/03) impossible to display the value of |
|
|
# one vector with "cout", even by saying "cout << x(vector)". So this |
|
|
# test cannot be fully developed yet. |
|
|
|
|
28 |
Run(<< 'EOF'); |
Run(<< 'EOF'); |
29 |
vector v = (1,2,3); |
|
30 |
|
// vector |
31 |
|
vector v = (1,0,0) + (0,2,0) + (0,0,3); |
32 |
cout << "x(v) = " << x(v) << "\n"; |
cout << "x(v) = " << x(v) << "\n"; |
33 |
cout << "y(v) = " << y(v) << "\n"; |
cout << "y(v) = " << y(v) << "\n"; |
34 |
cout << "z(v) = " << z(v) << "\n"; |
cout << "z(v) = " << z(v) << "\n"; |
35 |
|
|
36 |
|
// vertex |
37 |
|
vertex w = <1,0,0> + <0,2,0> + <0,0,3>; |
38 |
|
cout << "x(w) = " << x(w) << "\n"; |
39 |
|
cout << "y(w) = " << y(w) << "\n"; |
40 |
|
cout << "z(w) = " << z(w) << "\n"; |
41 |
EOF |
EOF |
42 |
|
|
43 |
NumCheck('x\v\) = ',1); |
# vector |
44 |
NumCheck('y\v\) = ',2); |
NumCheck('x\(v\) = ',1); |
45 |
NumCheck('z\v\) = ',3); |
NumCheck('y\(v\) = ',2); |
46 |
|
NumCheck('z\(v\) = ',3); |
47 |
|
|
48 |
|
# vertex |
49 |
|
NumCheck('x\(w\) = ',1); |
50 |
|
NumCheck('y\(w\) = ',2); |
51 |
|
NumCheck('z\(w\) = ',3); |
52 |
|
|
53 |
Report(); |
Report(); |