mlfma.c
/* Computes the far-field pattern for the specified group with the specified
 * center, and stores the output in a provided vector. sgn is positive for
 * radiation pattern and negative for receiving pattern. The list of "basis
 * functions" and center are ignored, since the calling program ensures each
 * FMM basis function is actually a single group of gridded elements with the
 * same affine grid. The center of the finest-level FMM group coincides with
 * the single FMM basis function contained therein. ACA is used to approximate
 * the matrix for efficient computations. */
Computes the far-field pattern for the specified group with the specified
center, and stores the output in a provided vector. sgn is positive for
radiation pattern and negative for receiving pattern. The list of "basis
functions" and center are ignored, since the calling program ensures each
FMM basis function is actually a single group of gridded elements with the
same affine grid. The center of the finest-level FMM group coincides with
the single FMM basis function contained therein. ACA is used to approximate
the matrix for efficient computations.
Computes the far - field pattern for the specified group with the specified center and stores the output in a provided vector . sgn is positive for radiation pattern and negative for receiving pattern . The list of " basis functions " and center are ignored since the calling program ensures each FMM basis function is actually a single group of gridded elements with the same affine grid . The center of the finest - level FMM group coincides with the single FMM basis function contained therein . ACA is used to approximate the matrix for efficient computations .
void acafarpattern (int nbs, int *bsl, void *vcrt, void *vpat, real *cen, int sgn) {
	cplx fact, beta = 1.0, *crt = (cplx *)vcrt,
		*pat = *((cplx **)vpat), *work, *u, *v;
	u = fmaconf.radpats;
	v = fmaconf.radpats + fmaconf.acarank * fmaconf.nsamp;
	work = malloc (fmaconf.acarank * sizeof(cplx));
	if (sgn >= 0) {
		beta = 0.0;
		fact = 1.0;
		GEMV (CblasColMajor, CblasConjTrans, fmaconf.bspboxvol,
				fmaconf.acarank, &fact, v, fmaconf.bspboxvol,
				crt, 1, &beta, work, 1);
		fact = fmaconf.k0;
		GEMV (CblasColMajor, CblasNoTrans, fmaconf.nsamp,
				fmaconf.acarank, &fact, u, fmaconf.nsamp,
				work, 1, &beta, pat, 1);
	} else {
		beta = 0.0;
		fact = 1.0;
		GEMV (CblasColMajor, CblasConjTrans, fmaconf.nsamp,
				fmaconf.acarank, &fact, u, fmaconf.nsamp,
				pat, 1, &beta, work, 1);
		fact = I * fmaconf.k0 * fmaconf.k0 / (4 * M_PI);
		beta = 1.0;
		GEMV (CblasColMajor, CblasNoTrans, fmaconf.bspboxvol,
				fmaconf.acarank, &fact, v, fmaconf.bspboxvol,
				work, 1, &beta, crt, 1);
	}
	free (work);
}
void acafarpattern ( int nbs , int * bsl , void * vcrt , void * vpat , real * cen , int sgn ) { cplx fact , beta = 1.0 , * crt = ( cplx * ) vcrt , * pat = * ( ( cplx * * ) vpat ) , * work , * u , * v ; u = fmaconf . radpats ; v = fmaconf . radpats + fmaconf . acarank * fmaconf . nsamp ; work = malloc ( fmaconf . acarank * sizeof ( cplx ) ) ; if ( sgn >= 0 ) { beta = 0.0 ; fact = 1.0 ; GEMV ( CblasColMajor , CblasConjTrans , fmaconf . bspboxvol , fmaconf . acarank , & fact , v , fmaconf . bspboxvol , crt , 1 , & beta , work , 1 ) ; fact = fmaconf . k0 ; GEMV ( CblasColMajor , CblasNoTrans , fmaconf . nsamp , fmaconf . acarank , & fact , u , fmaconf . nsamp , work , 1 , & beta , pat , 1 ) ; } else { beta = 0.0 ; fact = 1.0 ; GEMV ( CblasColMajor , CblasConjTrans , fmaconf . nsamp , fmaconf . acarank , & fact , u , fmaconf . nsamp , pat , 1 , & beta , work , 1 ) ; fact = I * fmaconf . k0 * fmaconf . k0 / ( 4 * M_PI ) ; beta = 1.0 ; GEMV ( CblasColMajor , CblasNoTrans , fmaconf . bspboxvol , fmaconf . acarank , & fact , v , fmaconf . bspboxvol , work , 1 , & beta , crt , 1 ) ; } free ( work ) ; }
Computes the far-field pattern for the specified group with the specified
 center, and stores the output in a provided vector.
Computes the far - field pattern for the specified group with the specified center and stores the output in a provided vector .
/* Scalar factors for the matrix multiplication. */ /* Perform the matrix-vector product. */ /* Distribute the far-field patterns to the basis functions. */ /* Scalar factors for the matrix multiplication. */ /* Perform the matrix-vector product. */