FNFT
|
Slow forward scattering. More...
#include "fnft__akns_discretization.h"
#include <stdio.h>
#include <string.h>
#include "fnft__errwarn.h"
#include "fnft__misc.h"
Go to the source code of this file.
Functions | |
FNFT_INT | fnft__akns_scatter_matrix (const FNFT_UINT D, FNFT_COMPLEX const *const q, FNFT_COMPLEX const *const r, const FNFT_REAL eps_t, const FNFT_UINT K, FNFT_COMPLEX const *const lambda, FNFT_COMPLEX *const result, fnft__akns_discretization_t discretization, const FNFT_UINT derivative_flag) |
Computes the scattering matrix and its derivative. More... | |
Slow forward scattering.
FNFT_INT fnft__akns_scatter_matrix | ( | const FNFT_UINT | D, |
FNFT_COMPLEX const *const | q, | ||
FNFT_COMPLEX const *const | r, | ||
const FNFT_REAL | eps_t, | ||
const FNFT_UINT | K, | ||
FNFT_COMPLEX const *const | lambda, | ||
FNFT_COMPLEX *const | result, | ||
fnft__akns_discretization_t | discretization, | ||
const FNFT_UINT | derivative_flag | ||
) |
Computes the scattering matrix and its derivative.
The function computes the scattering matrix and the derivative of the scattering matrix with respect to \(\lambda\). The function performs slow direct scattering and is primarily based on the reference Boffetta and Osborne (J. Comput. Physics 1992 ).
[in] | D | Number of samples |
[in] | q | Array of length D, contains samples \( q_n\) for \(n=0,1,\dots,D-1\) in ascending order (i.e., \( q_0, q_1, \dots, q_{D-1} \)). The values should be specifically precalculated based on the chosen discretization. |
[in,out] | r | Array of length D, contains samples \( r_n\) for \(n=0,1,\dots,D-1\) in ascending order (i.e., \( r_0, r_1, \dots, r_{D-1} \)). The values should be specifically precalculated based on the chosen discretization. |
[in] | eps_t | Step-size, eps_t \(= (T[1]-T[0])/(D-1) \). |
[in] | K | Number of values of \(\lambda\). |
[in] | lambda | Array of length K, contains the values of \(\lambda\). |
[out] | result | Array of length 8*K or 4*K, If derivative_flag=0 returns [S11 S12 S21 S22] in result where S = [S11, S12; S21, S22] is the scattering matrix computed using the chosen discretization. If derivative_flag=1 returns [S11 S12 S21 S22 S11' S12' S21' S22'] in result where S11' is the derivative of S11 w.r.t to \(\lambda\). Should be preallocated with size 4*K or 8*K accordingly. |
[in] | discretization | The type of discretization to be used. Should be of type fnft__akns_discretization_t. Not all akns_discretization_t discretizations are supported. Check fnft__akns_discretization_t for list of supported types. |
[in] | derivative_flag | Should be set to either 0 or 1. If set to 1 the derivatives [S11' S12' S21' S22'] are calculated. result should be preallocated with size 8*K if flag is set to 1. |