gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/igsl.lua
diff options
context:
space:
mode:
Diffstat (limited to 'igsl.lua')
-rw-r--r--igsl.lua 32
1 files changed, 11 insertions, 21 deletions
diff --git a/igsl.lua b/igsl.lua
index 29098078..0e0d421c 100644
--- a/igsl.lua
+++ b/igsl.lua
@@ -18,12 +18,6 @@
-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
--
-if not have_complex then
- conj = |x| x
- real = conj
- imag = |x| 0
-end
-
local cat = table.concat
local insert = table.insert
local fmt = string.format
@@ -161,9 +155,7 @@ end
local function add_matrix_method(s, m)
Matrix[s] = m
- if have_complex then
- cMatrix[s] = m
- end
+ cMatrix[s] = m
end
function ode_iter(s, t0, y0, t1, h, tstep)
@@ -192,23 +184,21 @@ local function hc_print(hc)
return cat(hc_reduce(hc, f, {}), '\n')
end
-if have_complex then
- FFT_hc_mixed_radix.__tostring = hc_print
- FFT_hc_radix2.__tostring = hc_print
-end
+FFT_hc_mixed_radix.__tostring = hc_print
+FFT_hc_radix2.__tostring = hc_print
ODE.iter = ode_iter
-if have_complex then cODE.iter = ode_iter end
+cODE.iter = ode_iter
local function add_matrix_meta_method(key, method)
- local m = new(1,1)
- local mt = getmetatable(m)
+ local m, mt
+ m = new(1,1)
+ mt = getmetatable(m)
+ mt[key] = method
+
+ m = cnew(1,1)
+ mt = getmetatable(m)
mt[key] = method
- if have_complex then
- m = cnew(1,1)
- mt = getmetatable(m)
- mt[key] = method
- end
end
add_matrix_meta_method('__tostring', matrix_to_string)
generated by cgit v1.2.3 (git 2.25.1) at 2025年09月17日 06:43:07 +0000

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