Mercurial > hg > kwantix
annotate src/main-profiling.cpp @ 40:eaa99e09607d
Remove indentation due to namespace scope
author | Jordi Gutiérrez Hermoso <jordigh@gmail.com> |
---|---|
date | Fri, 12 Mar 2010 09:21:07 -0600 |
parents | 7f31f9e2d196 |
children |
rev | line source |
---|---|
0 | 1 #include <ctime> |
2 #include <iostream> | |
3 | |
4 #include "include/linalg.hpp" | |
5 #include "include/rbf.hpp" | |
6 #include "include/utils.hpp" | |
7 | |
8 #define P1 12.21331231231 | |
9 #define P2 5.435765745 | |
10 #define Q1 4.23422342 | |
11 #define Q2 3.32424242342423 | |
12 | |
13 //********************** Main ****************************************** | |
14 int main(){ | |
34
7f31f9e2d196
Rename kwantxi to kwantix
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
30
diff
changeset
|
15 gsl_set_error_handler(&kwantix::errorHandler); |
0 | 16 |
17 try | |
18 { | |
19 using namespace std; | |
34
7f31f9e2d196
Rename kwantxi to kwantix
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
30
diff
changeset
|
20 using namespace kwantix |
0 | 21 |
40
eaa99e09607d
Remove indentation due to namespace scope
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
34
diff
changeset
|
22 point p(2),q(2); |
0 | 23 p(1) = P1; |
24 p(2) = P2; | |
25 q(1) = Q1; | |
26 q(2) = Q2; | |
34
7f31f9e2d196
Rename kwantxi to kwantix
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
30
diff
changeset
|
27 kwantix::radial_basis_function::set_dimension(2); |
7f31f9e2d196
Rename kwantxi to kwantix
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
30
diff
changeset
|
28 kwantix::multiquadric phi(p); |
0 | 29 double out; |
30 for(size_t i = 0; i < 10000000; i++){ | |
31 // out = phi(q); | |
32 | |
33 out = sqrt(1 | |
40
eaa99e09607d
Remove indentation due to namespace scope
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
34
diff
changeset
|
34 + sqrt(1+ |
eaa99e09607d
Remove indentation due to namespace scope
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
34
diff
changeset
|
35 (p(1)-q(1))*(p(1)-q(1)) |
eaa99e09607d
Remove indentation due to namespace scope
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
34
diff
changeset
|
36 + (p(2)-q(2))*(p(2)-q(2)) |
eaa99e09607d
Remove indentation due to namespace scope
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
34
diff
changeset
|
37 ) |
eaa99e09607d
Remove indentation due to namespace scope
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
34
diff
changeset
|
38 ); |
eaa99e09607d
Remove indentation due to namespace scope
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
34
diff
changeset
|
39 // out = sqrt(1 |
eaa99e09607d
Remove indentation due to namespace scope
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
34
diff
changeset
|
40 // + sqrt(1+ |
eaa99e09607d
Remove indentation due to namespace scope
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
34
diff
changeset
|
41 // (P1-Q1)*(P1-Q1) + (P2-Q2)*(P2-Q2) |
eaa99e09607d
Remove indentation due to namespace scope
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
34
diff
changeset
|
42 // ) |
eaa99e09607d
Remove indentation due to namespace scope
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
34
diff
changeset
|
43 // ); |
0 | 44 } |
45 cout << out << endl; | |
46 return 0; | |
47 } | |
34
7f31f9e2d196
Rename kwantxi to kwantix
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
30
diff
changeset
|
48 catch(kwantix::error exc) |
0 | 49 { |
34
7f31f9e2d196
Rename kwantxi to kwantix
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
30
diff
changeset
|
50 kwantix::show_exception(exc); |
0 | 51 return 1; |
52 } | |
53 | |
54 } | |
55 |