swift language examples


  These swift language examples are designed to run on
  MacOSX, linux, and Windows 10

math routines  sin, cos, ...  exp, log, ...
math.swift  source code
math_swift.out  output

function to compute factorial
fact.swift  source code
fact_swift.out  output

function to compute greatest common divisor
test_gcd.swift  source code
test_gcd_swift.out  output

more functions that show more inputs and returns
funct1.swift  source code
funct1_swift.out  output
funct2.swift  source code
funct2_swift.out  output
funct3.swift  source code
funct3_swift.out  output
funct4.swift  source code
funct4_swift.out  output

Function to compute inverse of matrix
matinv.swift  source code
test_matinv.swift  source code
test_matinv_swift.out  output

Function to compute determinant of matrix
matdet.swift  source code
test_matdet.swift  source code
test_matdet_swift.out  output

Function to solve system of simultaneous equations  simeq A X = Y
and  simeqb AY = X   and  simeq2  n,A,X,Y
simeq.swift  source code
test_simeq.swift  source code
test_simeq_swift.out  output

Function to solve nonlinear system of simultaneous equations  simeq A X = Y
simeq_newton3.swift  source code
test_simeq_nweton3.swift  source code
test_simeq_newton3_swift.out  output
test_simeq_nweton3a.swift  source code
test_simeq_newton3a_swift.out  output

More matrix functions
matrix.swift  source code
matrix_swift.out  output

More matrix2 functions
matrix2.swift  source code
matrix2_swift.out  output



Functions used when solving partial differential equations
rderiv.swift  source code
test_rderiv.swift  source code
test_rderiv_swift.out  output
nuderiv.swift  source code
test_nuderiv.swift  source code
test_nuderiv_swift.out  output

four dimensions D4_swift needed by pde44
D4.swift  source code
D4_swift.out  output

4 dimensional, 4 th order partial differential equation solved
pde44_eq.swift  source code
pde44_eq_swift.out  output

4 dimensional, 4 th order partial differential equation solved
previous using  nuderiv,  this using  rderiv
pde44_eqr.swift  source code
pde44_eqr_swift.out  output

A weird function I saw on the web
babana.swift  source code
banana_swift.out  output

Another  while  statement
while.swift  source code
while_swift.out  output