File: taboftab.edp

package info (click to toggle)
freefem%2B%2B 3.47%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 132,088 kB
  • ctags: 19,726
  • sloc: cpp: 138,951; ansic: 22,605; sh: 4,951; makefile: 2,935; fortran: 1,147; perl: 768; awk: 282; php: 182
file content (34 lines) | stat: -rw-r--r-- 814 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// version 3.18-2 ...
real[int] a,b(10);
a.resize(b.n); // `
a=b;  
a=[1,2];
a.resize(5); //  Pas init a voir ??? 
cout << "a="<<a << endl;
real[int,int][int] m(10);
real[int][int] v(10);
for(int i=0;i<v.n;++i)
{
  v[i].resize(i+1);
  for(int j=0;j<v[i].n;++j)
    v[i][j] = 100*i + j;   
}

cout << " v = " << v << endl;
v.resize(4);
cout << " v = " << v << endl;
v.resize(10);
cout << " v = " << v << endl;

// test sub array of full matrix ... 
real[int,int] A(10,5);
for(int i=0;i<A.n;++i)
for(int j=0;j<A.m;++j)
  A(i,j)=i*100+j;

cout << " A( 2:4,1:2) =" << A( 2:4,1:2) << endl;
cout << " A( 2,1:2) =" << A( 2,1:2) << endl;
cout << " A( 1:3,1) =" << A( 1:3,1) << endl;
cout << " A( :,1) =" << A( :,1) << endl;
cout << " A( :,1).sum =" << A( :,1).sum << endl;
cout << " A( :,1).min =" << A( :,1).min << endl;