gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat
-rw-r--r--benchmarks/lmfit/hahn1_benchmark.lua 6
-rw-r--r--benchmarks/lmfit/nist_test.lua 8
-rw-r--r--benchmarks/ode/ode-benchmark-rk8pd.lua 2
-rw-r--r--benchmarks/ode/ode-benchmark.lua 2
-rw-r--r--demo-init.lua 6
-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
-rw-r--r--doc/user-manual/intro-example.lua 6
-rw-r--r--graph-init.lua 2
-rw-r--r--gslext.lua 2
-rw-r--r--iter.lua 1
14 files changed, 33 insertions, 34 deletions
diff --git a/benchmarks/lmfit/hahn1_benchmark.lua b/benchmarks/lmfit/hahn1_benchmark.lua
index b3b0f77a..6136974e 100644
--- a/benchmarks/lmfit/hahn1_benchmark.lua
+++ b/benchmarks/lmfit/hahn1_benchmark.lua
@@ -27,10 +27,10 @@ local function nist_test(data_name, model_name)
return s, iter
end
-echo 'starting benchmark'
+print 'starting benchmark'
local t0 = time.ms()
for k= 1, 80 do
local s, iter = nist_test('hahn1', 'rat43')
- echo(k, ':', 'iter=', iter, 'chisq=', s.chisq)
+ print(k, ':', 'iter=', iter, 'chisq=', s.chisq)
end
-echo('benchmark terminated, execution time= ', time.ms() - t0, 'ms')
+print('benchmark terminated, execution time= ', time.ms() - t0, 'ms')
diff --git a/benchmarks/lmfit/nist_test.lua b/benchmarks/lmfit/nist_test.lua
index 1e916ce3..71012d68 100644
--- a/benchmarks/lmfit/nist_test.lua
+++ b/benchmarks/lmfit/nist_test.lua
@@ -21,13 +21,13 @@ local function nist_test(data_name, model_name)
for i=1, 200 do
s:iterate()
- echo(i, ':', ' chisq=', s.chisq)
+ print(i, ':', ' chisq=', s.chisq)
if s:test(0, 1e-8) then break end
end
- echo 'Solution:'
- for j=1, p do echo(string.format('x[%i] = %14g ', j, s.x[j])) end
- echo('chisq= ', s.chisq)
+ print 'Solution:'
+ for j=1, p do print(string.format('x[%i] = %14g ', j, s.x[j])) end
+ print('chisq= ', s.chisq)
local p = plot()
local pts = ipath(dataset.iter())
diff --git a/benchmarks/ode/ode-benchmark-rk8pd.lua b/benchmarks/ode/ode-benchmark-rk8pd.lua
index 92d3d46b..c3d1e18f 100644
--- a/benchmarks/ode/ode-benchmark-rk8pd.lua
+++ b/benchmarks/ode/ode-benchmark-rk8pd.lua
@@ -25,5 +25,5 @@ for k=1, 10 do
end
for i, line in ipairs(results) do
- echo(i, line)
+ print(i, line)
end
diff --git a/benchmarks/ode/ode-benchmark.lua b/benchmarks/ode/ode-benchmark.lua
index 04236ab4..4566653a 100644
--- a/benchmarks/ode/ode-benchmark.lua
+++ b/benchmarks/ode/ode-benchmark.lua
@@ -25,5 +25,5 @@ for k=1, 10 do
end
for i, line in ipairs(results) do
- echo(i, line)
+ print(i, line)
end
diff --git a/demo-init.lua b/demo-init.lua
index bfb118ed..fd1e0ee9 100644
--- a/demo-init.lua
+++ b/demo-init.lua
@@ -24,11 +24,11 @@ end
local function print_demos_list()
for group, t in pairs(demo_list) do
- echo('*** ', group)
+ print('*** ', group)
for k, v in ipairs(t) do
- echo(v.name .. ' - ' .. v.description)
+ print(v.name .. ' - ' .. v.description)
end
- echo ''
+ print ''
end
end
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)
diff --git a/doc/user-manual/intro-example.lua b/doc/user-manual/intro-example.lua
index 61e36fc9..446cf2ed 100644
--- a/doc/user-manual/intro-example.lua
+++ b/doc/user-manual/intro-example.lua
@@ -21,13 +21,13 @@ for d=2, max_dim do
--Obtaining monte carlo vegas callback
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))
--Increasing the number of calls to reach a satisfying result
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/graph-init.lua b/graph-init.lua
index 46cdab0a..20b9f786 100644
--- a/graph-init.lua
+++ b/graph-init.lua
@@ -13,7 +13,7 @@ local function check_sampling(n)
if n <= 1 then
error('sampling points should be > 1')
elseif n > n_sampling_max then
- echo('warning: too many sampling points requested, ' ..
+ print('warning: too many sampling points requested, ' ..
'limiting to ' .. n_sampling_max)
n = n_sampling_max
end
diff --git a/gslext.lua b/gslext.lua
index aba7cecc..94e1cd63 100644
--- a/gslext.lua
+++ b/gslext.lua
@@ -26,7 +26,7 @@ function demo(name)
if not entry then
demomod.list()
else
- echo(entry.description)
+ print(entry.description)
entry.f()
end
end
diff --git a/iter.lua b/iter.lua
index 05e474e1..5dc0e696 100644
--- a/iter.lua
+++ b/iter.lua
@@ -95,7 +95,6 @@ local function myprint(...)
io.write('\n')
end
-echo = print
print = myprint
local function sequence(f, a, b)
generated by cgit v1.2.3 (git 2.25.1) at 2025年09月16日 11:54:59 +0000

AltStyle によって変換されたページ (->オリジナル) /