|
@@ -371,4 +371,65 @@ namespace Lemma {
|
371
|
371
|
return ;
|
372
|
372
|
} // ----- end of method FHTKey201::ComputeRelated -----
|
373
|
373
|
|
|
374
|
+ //--------------------------------------------------------------------------------------
|
|
375
|
+ // Class: FHTKey201
|
|
376
|
+ // Method: ComputeLaggedRelated
|
|
377
|
+ //--------------------------------------------------------------------------------------
|
|
378
|
+ void FHTKey201::ComputeLaggedRelated ( const Real& rho, const int& nlag, std::shared_ptr<KernelEM1DManager> KernelManager ) {
|
|
379
|
+
|
|
380
|
+ int nrel = (int)(KernelManager->GetSTLVector().size());
|
|
381
|
+ Eigen::Matrix<Complex, 201, Eigen::Dynamic > Zwork;
|
|
382
|
+ Zans= Eigen::Matrix<Complex, Eigen::Dynamic, Eigen::Dynamic>::Zero(nlag, nrel);
|
|
383
|
+ Zwork.resize(201, nrel);
|
|
384
|
+ VectorXr lambda = WT201.col(0).array()/rho;
|
|
385
|
+ int NumFun = 0;
|
|
386
|
+ int idx = 0;
|
|
387
|
+
|
|
388
|
+ // Get Kernel values
|
|
389
|
+ for (int ir=0; ir<lambda.size(); ++ir) {
|
|
390
|
+ // irelated loop
|
|
391
|
+ ++NumFun;
|
|
392
|
+ KernelManager->ComputeReflectionCoeffs(lambda(ir), idx, rho);
|
|
393
|
+ for (int ir2=0; ir2<nrel; ++ir2) {
|
|
394
|
+ // Zwork* needed due to sign convention of filter weights
|
|
395
|
+ Zwork(ir, ir2) = std::conj(KernelManager->GetSTLVector()[ir2]->RelBesselArg(lambda(ir)));
|
|
396
|
+ }
|
|
397
|
+
|
|
398
|
+ }
|
|
399
|
+
|
|
400
|
+ // We diverge slightly from Key here, each kernel is evaluated seperately, whereby instead
|
|
401
|
+ // they prefer to sum them. The reason is that all those terms have been removed from the kernels
|
|
402
|
+ // in the interests of making them as generic and reusable as possible. This approach requires slightly
|
|
403
|
+ // more multiplies, but the same number of kernel evaluations, which is the expensive part.
|
|
404
|
+ // Inner product and scale
|
|
405
|
+ for (int ir2=0; ir2<nrel; ++ir2) {
|
|
406
|
+ Zans(0, ir2) = Zwork.col(ir2).dot(WT201.col(KernelManager->GetSTLVector()[ir2]->GetBesselOrder() + 1))/rho;
|
|
407
|
+ }
|
|
408
|
+
|
|
409
|
+ return ;
|
|
410
|
+ } // ----- end of method FHTKey201::ComputeLaggedRelated -----
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+ //--------------------------------------------------------------------------------------
|
|
414
|
+ // Class: FHTKey201
|
|
415
|
+ // Method: GetABSER
|
|
416
|
+ //--------------------------------------------------------------------------------------
|
|
417
|
+ Real FHTKey201::GetABSER ( ) {
|
|
418
|
+ return WT201(1,0)/WT201(0,0);
|
|
419
|
+ } // ----- end of method FHTKey201::GetABSER -----
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+ //--------------------------------------------------------------------------------------
|
|
423
|
+ // Class: FHTKey201
|
|
424
|
+ // Method: SetLaggedArg
|
|
425
|
+ //--------------------------------------------------------------------------------------
|
|
426
|
+ void FHTKey201::SetLaggedArg ( const Real& rho ) {
|
|
427
|
+ for (int i=0; i<Zans.cols(); ++ i) {
|
|
428
|
+ Zans(0, i) = Complex( splineVecReal[i]->Interpolate(rho),
|
|
429
|
+ splineVecImag[i]->Interpolate(rho) );
|
|
430
|
+ }
|
|
431
|
+ return ;
|
|
432
|
+ } // ----- end of method FHTKey201::SetLaggedArg -----
|
|
433
|
+
|
|
434
|
+
|
374
|
435
|
} // ----- end of Lemma name -----
|