File: forall.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 (41 lines) | stat: -rw-r--r-- 760 bytes parent folder | download
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
35
36
37
38
39
40
41
real [int,int] a(10,10);
real [int] b(10);
for [i,bi : b] {bi=i+1; cout << i << " " << bi << endl;}
cout << " b="<< b<< endl;  
for [i,j,aij : a] 
{
   aij= 1./(2+i+j);
   if(abs(aij)<0.2) aij=0;
}
cout << " a= "<< a << endl; 
matrix A=a;
string[string] ss;
ss["1"]= 1;
ss["2"]= 2;
ss["3"]= 5;
for [i,bi : ss] 
    bi=i+6+"-dddd"; 
cout <<" ss = "<< ss << endl;
int[string] si;
si[1]=2;
si[50]=1;
for [i,vi : si]
   {
   cout << " i " << setw(3) << i << " " << setw(10) <<vi << endl;
    vi= atoi(i)*2;
    }

cout <<" si = "<< si << endl;
for [i,j,aij : A]
{
    cout << i<< " " << j <<" " <<  aij << endl; 
    aij= -aij;
}
cout << A << endl; 
real[string] sd;
sd["1"]= 1;
sd["2"]= 2;
sd["3"]= 5;
for [i,bi : sd] 
    bi=bi*bi;
cout << "sd=\n"<< sd <<endl ;