FNFT
Functions
fnft__akns_scatter.h File Reference

Slow forward scattering. More...

#include "fnft__akns_discretization.h"
#include <stdio.h>
#include <string.h>
#include "fnft__errwarn.h"
#include "fnft__misc.h"
Include dependency graph for fnft__akns_scatter.h:
This graph shows which files directly or indirectly include this file:

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...
 

Detailed Description

Slow forward scattering.

Function Documentation

◆ fnft__akns_scatter_matrix()

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 ).

Parameters
[in]DNumber of samples
[in]qArray 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]rArray 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_tStep-size, eps_t \(= (T[1]-T[0])/(D-1) \).
[in]KNumber of values of \(\lambda\).
[in]lambdaArray of length K, contains the values of \(\lambda\).
[out]resultArray 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]discretizationThe 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_flagShould 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.
Returns
FNFT_SUCCESS or one of the FNFT_EC_... error codes defined in fnft_errwarn.h.