Out of the box performance of python numerical integration is poor. Here we present three python versions of the trapezoidal rule.
import math
import time
! -------------------------------------------------------- | |
! compile command line: | |
! ifort -O2 -i8 -mcmodel=medium -qmkl=parallel ./hermitianEigen-small.f90 -o ./hermitianEigen-small ${MKLROOT}/lib/intel64/libmkl_lapack95_ilp64.a -L${MKLROOT}/lib/intel64 -lpthread -lm -ldl | |
! -------------------------------------------------------- | |
program hermitianEigen | |
use, intrinsic :: iso_fortran_env | |
use lapack95, only: heevd |
! -------------------------------------------------------------------------------------- | |
! | |
! 01. Purpose: Solves a simple eigenvalue/eigenvector problem in order to check | |
! for the zheev thread locking bug #1560 | |
! https://github.com/xianyi/OpenBLAS/issues/1560 | |
! | |
! 02. Compile and build | |
! | |
! export MAX_THREADS=4 | |
! export OPENBLAS_NUM_THREADS=$MAX_THREADS |
cat <<EOF > $HOME/.minirc.dfl
pu localecho Yes
pu addlinefeed Yes
pu linewrap Yes
pu addcarreturn Yes
EOF
2022-03-27 |
''' | |
Dados os dois anos abaixo, este programa exibe todas as datas | |
que são tanto palíndromas (capicuas) como ambigramas (rotacionais). | |
''' | |
ANO_INI = 2000 | |
ANO_FIM = 2100 | |
import datetime as dt |