v2.0.0
Loading...
Searching...
No Matches
FWDLIB::FwdThreadArg Class Reference

Per-thread work packet carrying the dipole-index range, coil set, field/grad callback and write-back view into the shared lead-field matrix — unit of work for the parallel source-space dipole loop. More...

#include <fwd_thread_arg.h>

Public Types

typedef std::unique_ptr< FwdThreadArgUPtr

Public Member Functions

 FwdThreadArg ()
 ~FwdThreadArg ()

Static Public Member Functions

static FwdThreadArg::UPtr create_eeg_multi_thread_duplicate (FwdThreadArg &one, bool bem_model)
static FwdThreadArg::UPtr create_meg_multi_thread_duplicate (FwdThreadArg &one, bool bem_model)

Public Attributes

Eigen::MatrixXf * res
Eigen::MatrixXf * res_grad
int off
fwdFieldFunc field_pot
fwdVecFieldFunc vec_field_pot
fwdFieldGradFunc field_pot_grad
FwdCoilSetcoils_els
void * client
MNELIB::MNESourceSpaces
bool fixed_ori
int comp
int stat
std::function< void()> client_free

Detailed Description

Per-thread work packet carrying the dipole-index range, coil set, field/grad callback and write-back view into the shared lead-field matrix — unit of work for the parallel source-space dipole loop.

Implements a Forward Thread Argument (replaces fwdThreadArg / fwdThreadArgRec from MNE-C compute_forward.c).

Definition at line 78 of file fwd_thread_arg.h.

Member Typedef Documentation

◆ UPtr

typedef std::unique_ptr<FwdThreadArg> FWDLIB::FwdThreadArg::UPtr

Unique pointer type for FwdThreadArg.

Definition at line 81 of file fwd_thread_arg.h.

Constructor & Destructor Documentation

◆ FwdThreadArg()

FwdThreadArg::FwdThreadArg ( )

Constructs the Forward Thread Argument

Definition at line 37 of file fwd_thread_arg.cpp.

◆ ~FwdThreadArg()

FwdThreadArg::~FwdThreadArg ( )

Destroys the Forward Thread Argument

Definition at line 55 of file fwd_thread_arg.cpp.

Member Function Documentation

◆ create_eeg_multi_thread_duplicate()

FwdThreadArg::UPtr FwdThreadArg::create_eeg_multi_thread_duplicate ( FwdThreadArg & one,
bool bem_model )
static

Create a thread-safe duplicate for EEG parallel forward computation.

Parameters
[in]oneTemplate thread argument to duplicate.
[in]bem_modelWhether to duplicate the BEM model sub-object.
Returns
Thread-safe duplicate.

Definition at line 63 of file fwd_thread_arg.cpp.

◆ create_meg_multi_thread_duplicate()

FwdThreadArg::UPtr FwdThreadArg::create_meg_multi_thread_duplicate ( FwdThreadArg & one,
bool bem_model )
static

Create a thread-safe duplicate for MEG parallel forward computation.

Parameters
[in]oneTemplate thread argument to duplicate.
[in]bem_modelWhether to duplicate the BEM model sub-object.
Returns
Thread-safe duplicate.

Definition at line 81 of file fwd_thread_arg.cpp.

Member Data Documentation

◆ client

void* FWDLIB::FwdThreadArg::client

Client data for the field computation function.

Definition at line 125 of file fwd_thread_arg.h.

◆ client_free

std::function<void()> FWDLIB::FwdThreadArg::client_free

Releases owned client sub-objects.

Definition at line 130 of file fwd_thread_arg.h.

◆ coils_els

FwdCoilSet* FWDLIB::FwdThreadArg::coils_els

The coil definitions.

Definition at line 124 of file fwd_thread_arg.h.

◆ comp

int FWDLIB::FwdThreadArg::comp

Which component to compute for free orientations.

Definition at line 128 of file fwd_thread_arg.h.

◆ field_pot

fwdFieldFunc FWDLIB::FwdThreadArg::field_pot

Computes the field or potential for one dipole orientation.

Definition at line 121 of file fwd_thread_arg.h.

◆ field_pot_grad

fwdFieldGradFunc FWDLIB::FwdThreadArg::field_pot_grad

Computes the gradient of field or potential for one dipole orientation.

Definition at line 123 of file fwd_thread_arg.h.

◆ fixed_ori

bool FWDLIB::FwdThreadArg::fixed_ori

Compute fixed orientation solution?

Definition at line 127 of file fwd_thread_arg.h.

◆ off

int FWDLIB::FwdThreadArg::off

Offset within the result to the first source space vertex solution.

Definition at line 120 of file fwd_thread_arg.h.

◆ res

Eigen::MatrixXf* FWDLIB::FwdThreadArg::res

Destination for the solution (ncoil x nsources).

Definition at line 118 of file fwd_thread_arg.h.

◆ res_grad

Eigen::MatrixXf* FWDLIB::FwdThreadArg::res_grad

Gradient result (ncoil x 3*nsources).

Definition at line 119 of file fwd_thread_arg.h.

◆ s

MNELIB::MNESourceSpace* FWDLIB::FwdThreadArg::s

The source space to process.

Definition at line 126 of file fwd_thread_arg.h.

◆ stat

int FWDLIB::FwdThreadArg::stat

Result status (OK or FAIL).

Definition at line 129 of file fwd_thread_arg.h.

◆ vec_field_pot

fwdVecFieldFunc FWDLIB::FwdThreadArg::vec_field_pot

Computes the field or potential for all dipole orientations.

Definition at line 122 of file fwd_thread_arg.h.


The documentation for this class was generated from the following files: