Loading...
Searching...
No Matches
 
 
 
 
Go to the documentation of this file.
   14#ifndef PLASK__SOLVER_OPTICAL_MODAL_TOEPLITZ_H 
   15#define PLASK__SOLVER_OPTICAL_MODAL_TOEPLITZ_H 
   18#include "../matrices.hpp" 
   20namespace plask { 
namespace optical { 
namespace modal {
 
   32    const size_t n = (TM.
size() + 1) / 2;
 
   33    const size_t n2 = TM.
size() - 1;
 
   34    const size_t nx = X.cols();
 
   36    std::unique_ptr<D[]> 
F(
new D[
n]);
 
   37    std::unique_ptr<D[]> B(
new D[
n]);
 
   38    std::unique_ptr<D[]> 
eX(
new D[
nx]);
 
   40    if (TM[0] == 0.) 
throw ComputationError(
"ToeplitzLevinson", 
"cannot invert Fourier coefficients matrix");
 
   44    for (
size_t r = 0, 
dx = 0; r < 
nx; ++r, 
dx += 
n)
 
   47    for (
size_t i = 1; i < 
n; i++) {
 
   51        for (
size_t r = 0; r < 
nx; r++) 
eX[r] = 0.;
 
   53        for (
size_t j = 0; j < i; j++) {
 
   56            eb += TM[n2-j] * B[j];
 
   57            for (
size_t r = 0, 
mj = j; r < 
nx; ++r, 
mj += 
n)
 
   62        if (
scal == 0.) 
throw ComputationError(
"ToeplitzLevinson", 
"cannot invert Fourier coefficients matrix");
 
   68        for (
size_t j = 1; j <= i; j++) {
 
   76        for (
size_t r = 0, 
dx = 0; r < 
nx; ++r, 
dx += 
n) {
 
   78            for (
size_t j = 0; j < i; j++)
 
   79                X[
dx+j] += (X[
ix] - 
eX[r]) * B[j];
 
   80            X[
ix] = (X[
ix] - 
eX[r]) * B[i];