31 | | mepdf A1(&f1); |
32 | | mepdf A2(&f2); |
33 | | A ( 0 ) =&A1; |
34 | | A ( 1 ) =&A2; |
35 | | |
36 | | int Npoints=100; |
37 | | mat x_grid(1,Npoints); |
38 | | x_grid.set_row(0,linspace ( -2.0, 4.0, Npoints )); |
39 | | mat y_grid(1,Npoints); |
40 | | y_grid.set_row(0,linspace ( -2.0, 4.0, Npoints )); |
41 | | |
42 | | mat Grid (2,Npoints*Npoints); |
43 | | Grid.set_submatrix ( 0,0, kron(x_grid,ones(1,Npoints)) ); |
44 | | Grid.set_submatrix ( 1,0, kron(ones(1,Npoints), y_grid) ); |
45 | | |
| 34 | mepdf A1 ( &f1 ); |
| 35 | mepdf A2 ( &f2 ); |
| 36 | A ( 0 ) = &A1; |
| 37 | A ( 1 ) = &A2; |
| 38 | |
| 39 | int Npoints = 100; |
| 40 | mat x_grid ( 1, Npoints ); |
| 41 | x_grid.set_row ( 0, linspace ( -2.0, 4.0, Npoints ) ); |
| 42 | mat y_grid ( 1, Npoints ); |
| 43 | y_grid.set_row ( 0, linspace ( -2.0, 4.0, Npoints ) ); |
| 44 | |
| 45 | mat Grid ( 2, Npoints*Npoints ); |
| 46 | Grid.set_submatrix ( 0, 0, kron ( x_grid, ones ( 1, Npoints ) ) ); |
| 47 | Grid.set_submatrix ( 1, 0, kron ( ones ( 1, Npoints ), y_grid ) ); |
| 48 | |
57 | | |
58 | | vec Res1 = M.evallog_m(Grid); |
59 | | mat Res2 = (MP)->evallog_M(Grid); |
60 | | |
61 | | it_file it("merger_2d_test.it"); |
62 | | it << Name("Npoints") << Npoints; |
63 | | it << Name("Grid") << Grid; |
64 | | it << Name("Res1") << Res1; |
65 | | it << Name("Res2") << Res2; |
66 | | it << Name("S1") << f1.evallog_m(Grid); |
67 | | it << Name("S2") << f2.evallog_m(Grid); |
68 | | cout << ((enorm<ldmat>*)(MP->_Coms(0)))->_R().to_mat() << endl; |
| 61 | |
| 62 | vec Res1 = M.evallog_m ( Grid ); |
| 63 | mat Res2 = ( MP )->evallog_M ( Grid ); |
| 64 | |
| 65 | it_file it ( "merger_2d_test.it" ); |
| 66 | it << Name ( "Npoints" ) << Npoints; |
| 67 | it << Name ( "Grid" ) << Grid; |
| 68 | it << Name ( "Res1" ) << Res1; |
| 69 | it << Name ( "Res2" ) << Res2; |
| 70 | it << Name ( "S1" ) << f1.evallog_m ( Grid ); |
| 71 | it << Name ( "S2" ) << f2.evallog_m ( Grid ); |
| 72 | cout << ( ( enorm<ldmat>* ) ( MP->_Coms ( 0 ) ) )->_R().to_mat() << endl; |