Toast++  1.0.2 (r.539)
Forward and inverse modelling in optical tomography
jacobian.h
1 // -*-C++-*-
2 // =========================================================================
3 // jacobian.h (libstoast)
4 // Interface for Jacobian calculation
5 //
6 // Jacobian of forward operator: derivative of measurables with respect to
7 // parameters (frequency domain case)
8 // The Jacobian is a real matrix is composed of 4 blocks:
9 //
10 // | dlnamp | dlnamp |
11 // | ------ | ------ |
12 // | dmua | dkappa |
13 // |----------+----------|
14 // | dphase | dphase |
15 // | ------ | ------ |
16 // | dmua | dkappa |
17 //
18 // Each row corresponds to a measurement (source-detector pair), each column
19 // corresponds to a voxel in solution space.
20 // The returned Jacobian does not contain any data or parameter scalings.
21 // =========================================================================
22 
23 #ifndef __JACOBIAN_H
24 #define __JACOBIAN_H
25 
26 #include "mathlib.h"
27 #include "felib.h"
28 #include "toasttype.h"
29 
30 // Flags for computing Jacobian on nodal/element basis rather than
31 // basis provided by a raster object
32 #define INT_NDBASIS 0
33 #define INT_ELBASIS -1
34 #define RASTER_NDBASIS ((Raster*)INT_NDBASIS)
35 #define RASTER_ELBASIS ((Raster*)INT_ELBASIS)
36 
45 
62 STOASTLIB void GenerateJacobian (const Raster *raster, const QMMesh *mesh,
63  const CCompRowMatrix &mvec, const CVector *dphi, const CVector *aphi,
64  DataScale dscale, RDenseMatrix &J);
65 
80 STOASTLIB void GenerateJacobian (const Raster *raster, const QMMesh *mesh,
81  const CVector *dphi, const CVector *aphi, const CVector *proj,
82  DataScale dscale, RDenseMatrix &J);
83 
101 STOASTLIB void GenerateJacobian_cw (const Raster *raster, const QMMesh *mesh,
102  const RVector *dphi, const RVector *aphi,
103  RDenseMatrix *Jmua = NULL, RDenseMatrix *Jkap = NULL);
104 
123 STOASTLIB void GenerateJacobian_cw (const Raster *raster,
124  const QMMesh *mesh, const RCompRowMatrix &mvec,
125  const RVector *dphi, const RVector *aphi,
126  DataScale dscale, RDenseMatrix *Jmua = NULL, RDenseMatrix *Jkap = NULL);
127 
144 STOASTLIB void GenerateJacobian_cw (const Raster *raster,
145  const QMMesh *mesh, const RVector *dphi, const RVector *aphi,
146  const RVector *proj, DataScale dscale,
147  RDenseMatrix *Jmua = NULL, RDenseMatrix *Jkap = NULL);
148 
150 
151 template<class T>
152 STOASTLIB void ImageGradient (const IVector &dim, const RVector &size,
153  const TVector<T> &im, TVector<T> *grad, const int *mask = 0);
154 
155 #endif // !__JACOBIAN_H
STOASTLIB void GenerateJacobian_cw(const Raster *raster, const QMMesh *mesh, const RVector *dphi, const RVector *aphi, RDenseMatrix *Jmua=NULL, RDenseMatrix *Jkap=NULL)
Generate raw Jacobian matrix for CW intensity data (real case)
DataScale
Definition: fwdsolver.h:27
Base class for mapping between mesh and an independent basis representation.
Definition: raster.h:20
Definition: qmmesh.h:22
Compressed-row sparse matrix class.
Definition: cdmatrix.h:27
STOASTLIB void GenerateJacobian(const Raster *raster, const QMMesh *mesh, const CCompRowMatrix &mvec, const CVector *dphi, const CVector *aphi, DataScale dscale, RDenseMatrix &J)
Generate Jacobian matrix of forward operator (complex case)
Dense matrix class.
Definition: crmatrix.h:38