program example use polymorphic_complextaylor implicit none integer no,nv,n,i type(real_8) f,g integer, allocatable :: j(:),k(:),jj(:) no=6; nv= 4; ! no: the order of the polynomial nv: the number of variables call init(no,nv) ! initializes taylor series without maps call alloc(f,g) ! must be constructed after init n=2 allocate(j(nv),k(n),jj(nv)) j=0 j(1)=1;j(2)=2;j(3)=2;j(4)=1; jj=0 jj(1)=1;jj(2)=1;jj(3)=0;jj(4)=3; k=0 do i=1, n k(i)=j(i) end do f=(2.d0.mono.j )+ (3.d0.mono.jj ) + 5.d0 ! Creates 2.d0 x_1 x_ 2 ^2 x_3^2 x_ 4 + 3.d0 x_1 x_ 2 x_ 4^3 + 5.d0 g=f.par.k ! Creates 2.d0 x_3^2 x_4 call print(f,6) call print(g,6) ! If f is real, returns a Taylor Series ! k=0 f=6.d0 g=f.par.k call print(f,6) call print(g,6) deallocate(j,k,jj) f=(2.d0.mono.'1111') + (4.d0.mono.'211') + (1.d0.mono.'1112' ) + 5.d0 ! Creates 2.d0 x_1 x_ 2 x_3 x_ 4 + 4.d0 x_1^2 x_ 2 x_3 + x_1 x_ 2 x_3 x_ 4^2+ 5.d0 g=f.par.'11' ! Creates 2.d0 x_3 x_4 + x_3 x_4^2 call print(f,6) call print(g,6) ! If f is real, returns a Taylor Series. f=6.d0 g=f.par.'11' call print(f,6) call print(g,6) call kill(f,g) ! must be destroyed end program example