-rw-r--r-- | demos/graphics.lua | 2 | ||||
-rw-r--r-- | demos/plot.lua | 2 | ||||
-rw-r--r-- | demos/svg.lua | 4 | ||||
-rw-r--r-- | demos/vegas.lua | 14 | ||||
-rw-r--r-- | demos/wave-particle.lua | 10 |
diff --git a/demos/graphics.lua b/demos/graphics.lua index 76fa315b..bcae8092 100644 --- a/demos/graphics.lua +++ b/demos/graphics.lua @@ -50,7 +50,7 @@ end local function save_svg(p, name) p:save_svg(name, 400, 400) - echo('Plot saved in file \"' .. name .. '\".') + print('Plot saved in file \"' .. name .. '\".') end local function demo1() diff --git a/demos/plot.lua b/demos/plot.lua index 6b53453d..b0687a57 100644 --- a/demos/plot.lua +++ b/demos/plot.lua @@ -135,7 +135,7 @@ local function legend_demo() p:save_svg('demo.svg', 600, 400) - echo('Plot saved in "demo.svg".') + print('Plot saved in "demo.svg".') end return {'Plotting', { diff --git a/demos/svg.lua b/demos/svg.lua index 26d5fd6d..afb4b892 100644 --- a/demos/svg.lua +++ b/demos/svg.lua @@ -70,7 +70,7 @@ end local save_svg = function(p) p:save_svg('demo.svg', 600, 400) - echo 'Plot saved in SVG format in file "demo.svg".' + print 'Plot saved in SVG format in file "demo.svg".' end -- create a plot and save in SVG format @@ -78,7 +78,7 @@ local function demo1() local p = do_plot(save_svg, 'circle', 5, true) p:save('demo', 600, 400) - echo 'Plot saved in BMP format in demo.bmp (demo.ppm on linuex).' + print 'Plot saved in BMP format in demo.bmp (demo.ppm on linuex).' p:show() end diff --git a/demos/vegas.lua b/demos/vegas.lua index 9bd5bbf6..4fd3f3ac 100644 --- a/demos/vegas.lua +++ b/demos/vegas.lua @@ -10,10 +10,10 @@ local function testdim(n) return s end local a, b = ilist(|| lo, n), ilist(|| hi, n) - echo("Integrating SUM_(k=1,"..n..") k*x[k]^2") + print("Integrating SUM_(k=1,"..n..") k*x[k]^2") local calls = 1e4*n local result,sigma,runs,cont=monte_vegas(integrand,a,b,calls) - echo( string.format([[ + print( string.format([[ result = %.6f sigma = %.6f exact = %.6f @@ -50,17 +50,17 @@ local function demo2() local ln = graph.path(1, 2) -- 1-sphere = [-1, 1] (length 2) local max_dim = 14 for d=2, max_dim do - echo("==========================================") - echo("Calculating the volume of a unit ",d,"-sphere.") + print("==========================================") + print("Calculating the volume of a unit ",d,"-sphere.") local a, b = ilist(|| 0, d), ilist(|| 1, d) local calls, n = d*1e4,1 local res,sig,num,cont = num.monte_vegas(getunitsphere(d),a,b,calls) local fmt = "Volume = %.3f +/- %.3f " - echo(string.format(fmt,res*2^d,sig*2^d)) + print(string.format(fmt,res*2^d,sig*2^d)) while(sig/res > 0.005) do - echo("Increasing accuracy, doubling number of calls...") + print("Increasing accuracy, doubling number of calls...") res,sig,num = cont(calls*(2^n)) - echo(string.format(fmt,res*2^d,sig*2^d)) + print(string.format(fmt,res*2^d,sig*2^d)) n=n+1 end ln:line_to(d,res*2^d) diff --git a/demos/wave-particle.lua b/demos/wave-particle.lua index 11899639..6368fafc 100644 --- a/demos/wave-particle.lua +++ b/demos/wave-particle.lua @@ -316,11 +316,11 @@ end local function wave_demo() info 'Finding energy eigenvalues (roots)...' roots = root_grid_search(energy_limit) - echo 'done' + print 'done' info 'Calculating energy eigenstates...' As_mat = As_mat_compute(roots) - echo 'done' + print 'done' initstate = {x0= -14, p0= 8, sigma= 1.5} @@ -335,7 +335,7 @@ local function wave_demo() coeffs.data[2*i ] = cr coeffs.data[2*i+1] = ci end - echo 'done' + print 'done' plot_coeffs() @@ -356,7 +356,7 @@ local function wave_demo() fxv.data[2*n*k + 2*i + 1] = fi end end - echo 'done' + print 'done' local pcs = graph.canvas() pcs:limits(x1, 0, x2, 1.4) @@ -366,7 +366,7 @@ local function wave_demo() pcs:pushlayer() - echo 'READY: press enter' + print 'READY: press enter' io.read '*l' anim(pcs) |