Merge from rc2.0
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@2713 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
71864c2a6e
commit
409a1b21b8
1731 changed files with 104909 additions and 64375 deletions
34
trunk/eo/contrib/mathsym/test/test_lambda.cpp
Normal file
34
trunk/eo/contrib/mathsym/test/test_lambda.cpp
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#include <FunDef.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
|
||||
Sym x = SymVar(0);
|
||||
Sym y = SymVar(1);
|
||||
|
||||
Sym f = y + x*x;
|
||||
|
||||
Sym l = SymLambda(f);
|
||||
|
||||
SymVec args = l.args();
|
||||
args[0] = x;
|
||||
args[1] = y;
|
||||
l = Sym(l.token(), args);
|
||||
|
||||
vector<double> v(3);
|
||||
v[0] = 2.0;
|
||||
v[1] = 3.0;
|
||||
v[2] = 4.0;
|
||||
|
||||
double v1 = eval(f,v);
|
||||
double v2 = eval(l,v);
|
||||
|
||||
cout << v1 << ' ' << v2 << endl;
|
||||
cout << f << endl;
|
||||
cout << l << endl;
|
||||
|
||||
if (v1 != 7.0) return 1;
|
||||
if (v2 != 11.0) return 1;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue