m2m模型翻译
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
366 B

6 months ago
  1. from sympy.core.symbol import Symbol
  2. from sympy.codegen.ast import Type
  3. from sympy.codegen.cxxnodes import using
  4. from sympy.printing.codeprinter import cxxcode
  5. x = Symbol('x')
  6. def test_using():
  7. v = Type('std::vector')
  8. u1 = using(v)
  9. assert cxxcode(u1) == 'using std::vector'
  10. u2 = using(v, 'vec')
  11. assert cxxcode(u2) == 'using vec = std::vector'