©
Sum of a vector
Python calls Fortran and C.
2024.Jul.03 15:18:16
n Size (dimension) of vector.

Calculates the sum of a vector of size n. The vector has the given size n, and contains the first consecutive integers (from 1). The computation is done by calling Fortran and C, through Python.

The result will be, of course, S = n (1 + n) ⁄ 2 (or 55 for the given n = 10).

Files involved (download):  vec_sum.f90vec_sum.cVecsum.py

Advantage is taken from: PHP, for the web page; Python, as "glue"; Fortran and C for the numerical computing.

References: Plate: SquarePython

• (Wikipedia) PHP (from Personal Home Page) • Python (programming language) • Fortran 90

• Python as glue • Using Python as glue • F2PY Users Guide and Reference Manual

• 1937-06-12: Arnold, Vladimir Igorevich (Владимир Игоревич Арнольд) (†2010-06-03, 72 yrs.).

 
 
Valid HTML 5! IST http://web.tecnico.ulisboa.pt/~mcasquilho/compute/meeting/guide/P-vecsum.php
Created: 2023-06-12 — Last modified: 2023-07-03