frechet.c
/* Computes a contribution to the Frechet derivative for one transmitter. */
Computes a contribution to the Frechet derivative for one transmitter.
Computes a contribution to the Frechet derivative for one transmitter .
int frechet (cplx *crt, cplx *fld,
		cplx *sol, measdesc *obs, solveparm *slv) {
	long j, nelt = (long)fmaconf.numbases * (long)fmaconf.bspboxvol;
	cplx *zwork, *zwcrt;
	zwork = malloc (2L * nelt * sizeof(cplx));
	zwcrt = zwork + nelt;
	for (j = 0; j < nelt; ++j) zwcrt[j] = crt[j] * fld[j];
	ScaleME_applyParFMA (zwcrt, zwork);
	bicgstab (zwork, zwork, 0, slv->maxit, slv->epscg, 1);
	for (j = 0; j < nelt; ++j)
		zwork[j] = fmaconf.contrast[j] * zwork[j] + zwcrt[j];
	farfield (zwork, obs, sol);
	free (zwork);
	return obs->count;
}
int frechet ( cplx * crt , cplx * fld , cplx * sol , measdesc * obs , solveparm * slv ) { long j , nelt = ( long ) fmaconf . numbases * ( long ) fmaconf . bspboxvol ; cplx * zwork , * zwcrt ; zwork = malloc ( 2L * nelt * sizeof ( cplx ) ) ; zwcrt = zwork + nelt ; for ( j = 0 ; j < nelt ; ++ j ) zwcrt [ j ] = crt [ j ] * fld [ j ] ; ScaleME_applyParFMA ( zwcrt , zwork ) ; bicgstab ( zwork , zwork , 0 , slv -> maxit , slv -> epscg , 1 ) ; for ( j = 0 ; j < nelt ; ++ j ) zwork [ j ] = fmaconf . contrast [ j ] * zwork [ j ] + zwcrt [ j ] ; farfield ( zwork , obs , sol ) ; free ( zwork ) ; return obs -> count ; }
Computes a contribution to the Frechet derivative for one transmitter.
Computes a contribution to the Frechet derivative for one transmitter .
/* Set up the workspaces. */ /* Given the test vector and field distribution, compute the currents. */ /* Compute the RHS for the given current distribution.
	 * Store it in the buffer space. */ /* Compute the Frechet derivative field. */ /* Convert this into a current distribution. */ /* Compute the measured scattered field. */