The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Photonic::ExtraUtils - Glue for utility Fortran routines

VERSION

version 0.015

COPYRIGHT NOTICE

Photonic - A perl package for calculations on photonics and metamaterials.

Copyright (C) 2016 by W. Luis Mochán

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA

mochan@fis.unam.mx

Instituto de Ciencias Físicas, UNAM
Apartado Postal 48-3
62251 Cuernavaca, Morelos
México

SYNOPSIS

use Photonic::ExtraUtils;
($b, my $info) = cgtsv($c, $d, $e, $b);

DESCRIPTION

Call some fortran routines from perl code.

cgtsv

Solves a general complex tridiagonal system of equations. Uses an LAPACK function, "cgtsv" in PDL::LinearAlgebra::Complex.

($b, my $info) = cgtsv($c, $d, $e, $b);

where $c(2,0..$n-2) is the subdiagonal, $d(2,0..$n-1) the diagonal and $e(2,0..$n-2) the supradiagonal of an $nX$n tridiagonal complex double precision matrix. $b(2,0..$n-1) is the right hand side vector. $b is replaced by the solution. $info returns 0 for success or k if the k-1-th element of the diagonal became zero. Either 2Xn pdl's are used to represent complex numbers, as in PDL::Complex.

NB The LAPACK function, like its LINPACK equivalent, mutates its inputs. This function is a wrapper that copies its inputs so they are not mutated, and instead returns results.