shunwang / numexpr

Automatically exported from code.google.com/p/numexpr
MIT License
0 stars 0 forks source link

Adding conj function #117

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I propose the inclusion of a conj() function, as the numpy np.conj() function.

I have attempted it, but two errors show up (see at the end).

Grepping the code does not show any conjugate, but the numpy function conj 
corresponds to the ufunc conjugate.

Find attached the output of 

$ hg export tip > patch_conj

======================================================================
ERROR: test_reductions (numexpr.tests.test_numexpr.test_numexpr)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/numexpr-2.3_dev.dev-py2.7-linux-x86_64.egg/numexpr/tests/test_numexpr.py", line 128, in test_reductions
    assert_allclose(evaluate("conj(x)"), conj(x))
  File "/usr/lib64/python2.7/site-packages/numexpr-2.3_dev.dev-py2.7-linux-x86_64.egg/numexpr/necompiler.py", line 738, in evaluate
    NumExpr(ex, signature, **context)
  File "/usr/lib64/python2.7/site-packages/numexpr-2.3_dev.dev-py2.7-linux-x86_64.egg/numexpr/necompiler.py", line 554, in NumExpr
    precompile(ex, signature, context)
  File "/usr/lib64/python2.7/site-packages/numexpr-2.3_dev.dev-py2.7-linux-x86_64.egg/numexpr/necompiler.py", line 498, in precompile
    ast = typeCompileAst(ast)
  File "/usr/lib64/python2.7/site-packages/numexpr-2.3_dev.dev-py2.7-linux-x86_64.egg/numexpr/necompiler.py", line 163, in typeCompileAst
    % (ast.value + '_' + retsig+basesig))
NotImplementedError: couldn't find matching opcode for 'conjugate_cc'

======================================================================
ERROR: test_reductions (numexpr.tests.test_numexpr.test_numexpr2)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/numexpr-2.3_dev.dev-py2.7-linux-x86_64.egg/numexpr/tests/test_numexpr.py", line 128, in test_reductions
    assert_allclose(evaluate("conj(x)"), conj(x))
  File "/usr/lib64/python2.7/site-packages/numexpr-2.3_dev.dev-py2.7-linux-x86_64.egg/numexpr/necompiler.py", line 738, in evaluate
    NumExpr(ex, signature, **context)
  File "/usr/lib64/python2.7/site-packages/numexpr-2.3_dev.dev-py2.7-linux-x86_64.egg/numexpr/necompiler.py", line 554, in NumExpr
    precompile(ex, signature, context)
  File "/usr/lib64/python2.7/site-packages/numexpr-2.3_dev.dev-py2.7-linux-x86_64.egg/numexpr/necompiler.py", line 498, in precompile
    ast = typeCompileAst(ast)
  File "/usr/lib64/python2.7/site-packages/numexpr-2.3_dev.dev-py2.7-linux-x86_64.egg/numexpr/necompiler.py", line 163, in typeCompileAst
    % (ast.value + '_' + retsig+basesig))
NotImplementedError: couldn't find matching opcode for 'conjugate_cc'

----------------------------------------------------------------------

Original issue reported on code.google.com by davidmen...@gmail.com on 11 Oct 2013 at 8:39

Attachments: