Skip to content

Commit 36090fc

Browse files
Formatting changes to lib/symengine.rb
1 parent 26c2199 commit 36090fc

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

lib/symengine.rb

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ def symbols(ary_or_string, *params)
2525

2626
# Make an Array of SymEngine::Symbols from the parameters we received,
2727
# now that they're normalized.
28-
ary_or_string.map do |symbol_or_string|
29-
SymEngine::Symbol.new(symbol_or_string)
30-
end
28+
ary_or_string.map(&SymEngine::Symbol.method(:new))
3129
end
3230

3331
def Function(n) # rubocop:disable Style/MethodName
@@ -53,13 +51,18 @@ def lambdify(exp, *syms)
5351
end
5452
module Utils
5553
class << self
56-
REPLACEMENTS = { sin: 'Math.sin', cos: 'Math.cos', tan: 'Math.tan',
57-
asin: 'Math.asin', acos: 'Math.acos', atan: 'Math.atan',
58-
sinh: 'Math.sinh', cosh: 'Math.cosh', tanh: 'Math.tanh',
59-
asinh: 'Math.asinh', acosh: 'Math.acosh', atanh: 'Math.atanh',
60-
pi: 'Math::PI', E: 'Math::E', I: '::Complex::I',
61-
dirichlet_eta: 'SymEngine::Utils::evalf_dirichlet_eta',
62-
zeta: 'SymEngine::Utils::evalf_zeta', gamma: 'Math.gamma' }.map { |from, to| [/(\b#{from}\b)/, to] }.to_h.freeze
54+
REPLACEMENTS = {
55+
sin: 'Math.sin', cos: 'Math.cos', tan: 'Math.tan',
56+
asin: 'Math.asin', acos: 'Math.acos', atan: 'Math.atan',
57+
sinh: 'Math.sinh', cosh: 'Math.cosh', tanh: 'Math.tanh',
58+
asinh: 'Math.asinh', acosh: 'Math.acosh', atanh: 'Math.atanh',
59+
pi: 'Math::PI', E: 'Math::E', I: '::Complex::I',
60+
dirichlet_eta: 'SymEngine::Utils::evalf_dirichlet_eta',
61+
zeta: 'SymEngine::Utils::evalf_zeta', gamma: 'Math.gamma'
62+
}.map { |from, to|
63+
[/(\b#{from}\b)/, to]
64+
}.to_h.freeze
65+
6366
def evalf_dirichlet_eta(exp)
6467
SymEngine.evalf(SymEngine.dirichlet_eta(exp))
6568
end

0 commit comments

Comments
 (0)