K idZddlmZddlmZmZddlmZddlm Z m Z ddl m Z dgd iZ e dd d gd ze d <e d d d e d <e d jddddddidddddZdD]Zej#ede<dD]Zej#ed e<dZdZGddZGdd ee ZGd!d"ee ZGd#d$ee Zeeed%Zy )&z C++ code printer )chain)Typenone)requires)C89CodePrinterC99CodePrinter)cxxcodeC++98)Jandand_eqasmautobitandbitorboolbreakcasezcatch,charclasscomplconst const_castcontinuedefaultdeletedodouble dynamic_castelseenumexplicitexportexternfalsefloatforfriendgotoifinlineintlongmutable namespacenewnotnot_eqoperatororor_eqprivate protectedpublicregisterreinterpret_castreturnshortsignedsizeofstatic static_caststructswitchtemplatethisthrowtruetrytypedeftypeidtypenameunionunsignedusingvirtualvoidvolatilewchar_twhilexorxor_eqN) alignasalignofchar16_tchar32_t constexprdecltypenoexceptnullptr static_assert thread_localC++11C++17r9fmodceil)Modceilinggammatgammabetaexpint riemann_zeta)rgEizeta)r r_r`)Absexploglog10sqrtsincostanasinacosatanatan2sinhcoshtanhfloor)asinhacoshatanherferfcc~d|z}t||r tdfd}dtz|_t |||y)Nz _print_%sz1Edit method (or subclass) instead of overwriting.c dj|jdjt|j|j S)Nz{}{}({}), )format_nsjoinmap_printargs)selfexpr func_names X/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/sympy/printing/cxx.py _print_methodz+_attach_print_method.._print_methodGs7  9diiDKKQUQZQZ@[6\]]zPrints code for %s)hasattr ValueErrork__doc__setattr)cls sympy_namer meth_namers ` r_attach_print_methodrCsBj(IsILMM^014M CM*rch||jjD]\}}t|||yN)standarditemsr)rcontrcxx_names r_attach_print_methodsrMs4 $S\\ 2 8 8 :8 HS*h78rceZdZdZdZdZd fd ZedhdZedhdZ d Z d Z ed hd Z xZ S)_CXXCodePrinterBase_cxxcodezC++zstd::c,t||xsiyr)super__init__)rsettings __class__s rrz_CXXCodePrinterBase.__init__Ws R(r algorithm)headersc ddlm}t|jdk(r|j |jdS|j d|j |jdd|j ||jdddS)Nr)Maxrzmax(r))(sympy.functions.elementary.miscellaneousrlenrrr)rrrs r _print_Maxz_CXXCodePrinterBase._print_MaxZm@ tyy>Q ;;tyy|, ,"&((DKK ! ,E"&++c499QR=.A"BD Drc ddlm}t|jdk(r|j |jdS|j d|j |jdd|j ||jdddS)Nr)Minrzmin(rr)rrrrrr)rrrs r _print_Minz_CXXCodePrinterBase._print_Minbrrc\|jtk(rd|jzStd)Nzusing %sz#C++98 does not support type aliases)aliasrtyperrrs r _print_usingz _CXXCodePrinterBase._print_usingjs) ::  ) )BC CrcF|j\}d|j|zS)Nzthrow %s)rr)rrsargs r _print_Raisez _CXXCodePrinterBase._print_Raiseps!wwDKK,,,r stdexceptc`|j\}|jd|j|dS)Nzruntime_error(r)rrr)rremessages r_print_RuntimeError_z(_CXXCodePrinterBase._print_RuntimeError_ts%77(,$++g2FGGrr)__name__ __module__ __qualname__ printmethodlanguagerrrrrrrr __classcell__rs@rrrRsyKH C){m$D%D{m$D%DD -{m$H%Hrrc&eZdZdZeedZy)CXX98CodePrinterr N)rrrrsetreservedreserved_wordsrrrrzsH'*+NrrceZdZdZeedZeee jje dddhfe dddhfe dddhfe d d dhfe d d dhfe d ddhfe dddhfe dddhfe dddhfe dddhfe ddi jZ fdZ xZS)CXX11CodePrinterr_int8int8_tcstdintint16int16_tint32int32_tint64int64_tuint8uint8_tuint16uint16_tuint32uint32_tuint64uint64_t complex64zstd::complexcomplex complex128zstd::complexr)rNc|jtk(rt| |Sd|j |j zS)Nzusing %(alias)s = %(type)s)apply)rrrrkwargsr)rrrs rrzCXX11CodePrinter._print_usings9 :: 7'- -/$++DKK+2PP Pr)rrrrrrrdictrr type_mappingsrrrrrs@rrrsH'*+N&&,,. L8i[1 MI {3 MI {3 MI {3 MI {3 NZ)5 NZ)5 NZ)5   5 {C  !7) E L.  %'M"QQrrcdeZdZdZeedZeejfie dZ dZ dZ dZ y)CXX17CodePrinterr`c$|j|Sr_print_math_funcrs r _print_betazCXX17CodePrinter._print_beta$$T**rc$|j|Srrrs r _print_EizCXX17CodePrinter._print_Eirrc$|j|Srrrs r _print_zetazCXX17CodePrinter._print_zetarrN)rrrrrrrrr _kf_math_functionsrrrrrrrrs?H'*+N ~!! >_W%= >C+++rr)zc++98zc++11zc++17)r itertoolsrsympy.codegen.astrr codeprinterrcrr sympy.printing.codeprinterr rremoverrlowerrrrrrrcxx_code_printersrrrrsM(!-/   W%a(,W%a($    L,A"#'')OGQ, 4,A"#'')OGQ,+8 %H%HP,*N,Q*NQ: +*N +&  r