FarFieldExpansion< TKernelAux > Class Template Reference

Far field expansion class in $O(D^p)$ expansion. More...

Collaboration diagram for FarFieldExpansion< TKernelAux >:
[legend]

List of all members.

Public Member Functions

void Accumulate (const Vector &reference_point, double weight, int order)
 Accumulates the contribution of a single reference point as a far-field moment.
void AccumulateCoeffs (const Matrix &data, const Vector &weights, int begin, int end, int order)
 Accumulates the far field moment represented by the given reference data into the coefficients.
double bandwidth_sq () const
 Gets the squared bandwidth value that is being used by the current far-field expansion object.
double ConvolveField (const FarFieldExpansion &fe2, const FarFieldExpansion &fe3, int order1, int order2, int order3) const
 Evaluates the three-way convolution with two other far field expansions.
double ConvolveField (const FarFieldExpansion &fe, int order) const
 Evaluates the convolution with the other farfield expansion.
double EvaluateField (const double *x_q, int order) const
double EvaluateField (const Matrix &data, int row_num, int order) const
 Evaluates the far-field coefficients at the given point.
const Vectorget_center () const
Vectorget_center ()
 Gets the center of expansion.
const Vectorget_coeffs () const
 Gets the set of far-field coefficients.
int get_max_order () const
 Gets the maximum possible approximation order.
int get_order () const
 Gets the approximation order.
double get_weight_sum () const
 Gets the weight sum.
void Init (const TKernelAux &ka)
void Init (const Vector &center, const TKernelAux &ka)
 Initializes the current far field expansion object with the given center.
double MixField (const Matrix &data, int node1_begin, int node1_end, int node2_begin, int node2_end, const FarFieldExpansion &fe2, const FarFieldExpansion &fe3, int order2, int order3) const
 Evaluates the two-way convolution mixed with exhaustive computations with two other far field expansions.
template<typename TBound >
int OrderForConvertingToLocal (const TBound &far_field_region, const TBound &local_field_region, double min_dist_sqd_regions, double max_dist_sqd_regions, double required_bound, double *actual_error) const
 Computes the required order for converting to the local expansion inside another region, so that the total error (truncation error of the far field expansion plus the conversion error) is bounded above by the given user bound.
template<typename TBound >
int OrderForConvolving (const TBound &far_field_region, const Vector &far_field_region_centroid, const TBound &local_field_region, const Vector &local_field_region_centroid, double min_dist_sqd_regions, double max_dist_dsqd_regons, double max_error, double *actual_error) const
template<typename TBound >
int OrderForEvaluating (const TBound &far_field_region, const TBound &local_field_region, double min_dist_sqd_regions, double max_dist_sqd_regions, double max_error, double *actual_error) const
 Computes the required order for evaluating the far field expansion for any query point within the specified region for a given bound.
void PrintDebug (const char *name="", FILE *stream=stderr) const
 Prints out the series expansion represented by this object.
void RefineCoeffs (const Matrix &data, const Vector &weights, int begin, int end, int order)
 Refine the far field moment that has been computed before up to a new order.
void set_center (const Vector &center)
 Set the center of the expansion - assumes that the center has been initialized before.
void set_order (int new_order)
 Sets the approximation order of the far-field expansion.
void TranslateFromFarField (const FarFieldExpansion &se)
 Translate from a far field expansion to the expansion here.
void TranslateToLocal (LocalExpansion< TKernelAux > &se, int truncation_order)
 Translate to the given local expansion.

Detailed Description

template<typename TKernelAux>
class FarFieldExpansion< TKernelAux >

Far field expansion class in $O(D^p)$ expansion.

$O(D^p)$ expansion for a kernel is a traditional expansion generated by the multivariate Taylor expansion.

   //Declare a far-field expansion for the Gaussian kernel.
   FarFieldExpansion<GaussianKernelAux> fe;

Definition at line 65 of file farfield_expansion.h.


Member Function Documentation

template<typename TKernelAux>
void FarFieldExpansion< TKernelAux >::Accumulate ( const Vector reference_point,
double  weight,
int  order 
)

Accumulates the contribution of a single reference point as a far-field moment.

For the reference point $r$ and the current expansion centroid in the reference node $R$ as $R.c$, this function computes $\left( \frac{r - R.c}{kh} \right)^{\alpha}$ for $0 \leq \alpha \leq p$ where $\alpha$ is a $D$-dimensional multi-index and adds to the currently accumulated far-field moments: $ F(R) \leftarrow F(R) + w [ \left( \frac{r - R.c}{kh} \right)^{\alpha}]_{0 \leq p \leq \alpha}$ where $F(R)$ is the current set of far-field moments for the reference node $R$. $k$ is an appropriate factor to multiply the bandwidth $h$ by; for the Gaussian kernel expansion, it is $\sqrt{2}$.

Parameters:
reference_point The coordinates of the reference point.
weight The weight of the reference point v.
order The order up to which the far-field moments should be accumulated up to.
template<typename TKernelAux>
void FarFieldExpansion< TKernelAux >::AccumulateCoeffs ( const Matrix &  data,
const Vector weights,
int  begin,
int  end,
int  order 
)

Accumulates the far field moment represented by the given reference data into the coefficients.

Given the set of reference points $r_{j_n} \in R$ in the reference node $R$, this function computes $\sum\limits_{r_{j_n} \in R} w_{j_n} \left( \frac{r_{j_n} - R.c}{kh} \right)^{\alpha}$ for $0 \leq \alpha \leq p$ where $\alpha$ is a $D$-dimensional multi-index and adds to the currently accumulated far-field moments: $ F(R) \leftarrow F(R) + \left[ \sum\limits_{r_{j_n} \in R} w_{j_n} \left( \frac{r_{j_n} - R.c}{kh} \right)^{\alpha} \right]_{0 \leq p \leq \alpha}$ where $F(R)$ is the current set of far-field moments for the reference node $R$. $k$ is an appropriate factor to multiply the bandwidth $h$ by; for the Gaussian kernel expansion, it is $\sqrt{2}$.

Parameters:
data The entire reference dataset $\mathcal{R}$.
weights The entire reference weights $\mathcal{W}$.
begin The beginning index of the reference points for which we would like to accumulate the moments for.
end The upper limit on the index of the reference points for which we would like to accumulate the moments for.
order The order up to which the far-field moments should be accumulated up to.
template<typename TKernelAux>
double FarFieldExpansion< TKernelAux >::bandwidth_sq (  )  const [inline]

Gets the squared bandwidth value that is being used by the current far-field expansion object.

Returns:
The squared bandwidth value.

Definition at line 110 of file farfield_expansion.h.

template<typename TKernelAux>
double FarFieldExpansion< TKernelAux >::ConvolveField ( const FarFieldExpansion< TKernelAux > &  fe2,
const FarFieldExpansion< TKernelAux > &  fe3,
int  order1,
int  order2,
int  order3 
) const

Evaluates the three-way convolution with two other far field expansions.

template<typename TKernelAux>
double FarFieldExpansion< TKernelAux >::ConvolveField ( const FarFieldExpansion< TKernelAux > &  fe,
int  order 
) const

Evaluates the convolution with the other farfield expansion.

template<typename TKernelAux>
double FarFieldExpansion< TKernelAux >::EvaluateField ( const Matrix &  data,
int  row_num,
int  order 
) const

Evaluates the far-field coefficients at the given point.

template<typename TKernelAux>
Vector* FarFieldExpansion< TKernelAux >::get_center (  )  [inline]

Gets the center of expansion.

Returns:
The center of expansion for the current far-field expansion.

Definition at line 116 of file farfield_expansion.h.

template<typename TKernelAux>
const Vector& FarFieldExpansion< TKernelAux >::get_coeffs (  )  const [inline]

Gets the set of far-field coefficients.

Returns:
The const reference to the vector containing the far-field coefficients.

Definition at line 125 of file farfield_expansion.h.

template<typename TKernelAux>
int FarFieldExpansion< TKernelAux >::get_max_order (  )  const [inline]

Gets the maximum possible approximation order.

Returns:
The maximum allowable approximation order.

Definition at line 137 of file farfield_expansion.h.

template<typename TKernelAux>
int FarFieldExpansion< TKernelAux >::get_order (  )  const [inline]

Gets the approximation order.

Returns:
The integer representing the current approximation order.

Definition at line 131 of file farfield_expansion.h.

template<typename TKernelAux>
double FarFieldExpansion< TKernelAux >::get_weight_sum (  )  const [inline]

Gets the weight sum.

Definition at line 141 of file farfield_expansion.h.

template<typename TKernelAux>
void FarFieldExpansion< TKernelAux >::Init ( const Vector center,
const TKernelAux &  ka 
)

Initializes the current far field expansion object with the given center.

template<typename TKernelAux>
double FarFieldExpansion< TKernelAux >::MixField ( const Matrix &  data,
int  node1_begin,
int  node1_end,
int  node2_begin,
int  node2_end,
const FarFieldExpansion< TKernelAux > &  fe2,
const FarFieldExpansion< TKernelAux > &  fe3,
int  order2,
int  order3 
) const

Evaluates the two-way convolution mixed with exhaustive computations with two other far field expansions.

template<typename TKernelAux>
template<typename TBound >
int FarFieldExpansion< TKernelAux >::OrderForConvertingToLocal ( const TBound &  far_field_region,
const TBound &  local_field_region,
double  min_dist_sqd_regions,
double  max_dist_sqd_regions,
double  required_bound,
double *  actual_error 
) const [inline]

Computes the required order for converting to the local expansion inside another region, so that the total error (truncation error of the far field expansion plus the conversion error) is bounded above by the given user bound.

Returns:
the minimum approximation order required for the error, -1 if approximation up to the maximum order is not possible.
template<typename TKernelAux>
template<typename TBound >
int FarFieldExpansion< TKernelAux >::OrderForEvaluating ( const TBound &  far_field_region,
const TBound &  local_field_region,
double  min_dist_sqd_regions,
double  max_dist_sqd_regions,
double  max_error,
double *  actual_error 
) const [inline]

Computes the required order for evaluating the far field expansion for any query point within the specified region for a given bound.

template<typename TKernelAux>
void FarFieldExpansion< TKernelAux >::PrintDebug ( const char *  name = "",
FILE *  stream = stderr 
) const

Prints out the series expansion represented by this object.

template<typename TKernelAux>
void FarFieldExpansion< TKernelAux >::RefineCoeffs ( const Matrix &  data,
const Vector weights,
int  begin,
int  end,
int  order 
)

Refine the far field moment that has been computed before up to a new order.

template<typename TKernelAux>
void FarFieldExpansion< TKernelAux >::set_center ( const Vector center  )  [inline]

Set the center of the expansion - assumes that the center has been initialized before.

..

Parameters:
center The center of expansion whose coordinate values will be copied to the center of the given far-field expansion object.

Definition at line 156 of file farfield_expansion.h.

References GenVector< T >::length().

template<typename TKernelAux>
void FarFieldExpansion< TKernelAux >::set_order ( int  new_order  )  [inline]

Sets the approximation order of the far-field expansion.

Parameters:
new_order The desired new order of the approximation.

Definition at line 147 of file farfield_expansion.h.

template<typename TKernelAux>
void FarFieldExpansion< TKernelAux >::TranslateFromFarField ( const FarFieldExpansion< TKernelAux > &  se  ) 

Translate from a far field expansion to the expansion here.

The translated coefficients are added up to the ones here.

template<typename TKernelAux>
void FarFieldExpansion< TKernelAux >::TranslateToLocal ( LocalExpansion< TKernelAux > &  se,
int  truncation_order 
)

Translate to the given local expansion.

The translated coefficients are added up to the passed-in local expansion coefficients.


The documentation for this class was generated from the following file:
Generated on Mon Jan 24 12:04:40 2011 for FASTlib by  doxygen 1.6.3