o
    8Va	                     @   s   d dl mZ d dlmZmZmZmZmZmZ d dl	m
Z
mZmZmZ d dlmZ d dlmZ ed\ZZZZdd Zd	d
 Zdd Zdd Zdd Zdd Zdd Zdd ZdS )    )symbols)betaEizetaMaxMinsqrt)CXX98CodePrinterCXX11CodePrinterCXX17CodePrintercxxcode)log1p)warns_deprecated_sympyzx y u vc                  C   s|   t  ttddv sJ t  ttdttdksJ t  } | jdks'J | jdks.J d| jv s5J d| jvs<J d S )N   )zstd::max(x, 3)zstd::max(3, x)z&std::min(3, std::min(x, std::sqrt(x)))C++zC++98templateZalignas)	r	   doprintr   xr   r   languagestandardreserved_words)Zcxx98printer r   ?/usr/lib/python3/dist-packages/sympy/printing/tests/test_cxx.pytest_CXX98CodePrinter   s    r   c                  C   sh   t  ttdksJ t  } | jdksJ | jdksJ d| jv s$J d| jv s+J d| jvs2J d S )Nstd::log1p(x)r   zC++11operatorZnoexceptZconcept)r
   r   r   r   r   r   r   )Zcxx11printerr   r   r   test_CXX11CodePrinter   s   r   c                  C   s,   G dd dt } |  ttdksJ d S )Nc                   @   s   e Zd Zdd ZdS )z-test_subclass_print_method.<locals>.MyPrinterc                 S   s   dd t| j|j S )Nzmy_library::log1p(%s)z, )joinmapZ_printargs)selfexprr   r   r   _print_log1p"   s   z:test_subclass_print_method.<locals>.MyPrinter._print_log1pN)__name__
__module____qualname__r"   r   r   r   r   	MyPrinter!   s    r&   my_library::log1p(x)r
   r   r   r   )r&   r   r   r   test_subclass_print_method    s   r)   c                  C   sL   G dd dt } t  }|  }|ttdksJ |ttdks$J d S )Nc                   @   s   e Zd ZdZdS )z1test_subclass_print_method__ns.<locals>.MyPrinterzmy_library::N)r#   r$   r%   Z_nsr   r   r   r   r&   )   s    r&   r   r'   r(   )r&   pZmypr   r   r   test_subclass_print_method__ns(   s
   r+   c                   C   sN   t  tttdksJ t  ttdksJ t  ttdks%J d S )Nzstd::beta(x, y)zstd::expint(x)zstd::riemann_zeta(x))r   r   r   r   yr   r   r   r   r   r   test_CXX17CodePrinter3   s   r-   c                   C   s.   t tttd dt ddgksJ d S )Ng      ?*z0.5zstd::sqrt(x))sortedr   r   r   splitr   r   r   r   test_cxxcode9   s   .r1   c                  C   s4   t   dd l} W d    d S 1 sw   Y  d S )Nr   )r   Zsympy.printing.cxxcode)sympyr   r   r   test_cxxcode_submodule<   s   
"r3   c                   C   sH   t tttttttdksJ t tttttttdks"J d S )Nz(std::max(std::min(u, v), std::min(x, y))z(std::min(std::max(u, v), std::max(x, y)))r   r   r   r   r,   uvr   r   r   r   test_cxxcode_nested_minmaxA   s   r6   N)r2   r   Zsympy.functionsr   r   r   r   r   r   Zsympy.printing.cxxr	   r
   r   r   Zsympy.codegen.cfunctionsr   Zsympy.testing.pytestr   r   r,   r4   r5   r   r   r)   r+   r-   r1   r3   r6   r   r   r   r   <module>   s     
