Far field expansion class in expansion. More...
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 Vector * | get_center () const |
Vector * | get_center () |
Gets the center of expansion. | |
const Vector & | get_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 ¢er, 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 ¢er) |
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. |
Far field expansion class in expansion.
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.
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 as , this function computes for where is a -dimensional multi-index and adds to the currently accumulated far-field moments: where is the current set of far-field moments for the reference node . is an appropriate factor to multiply the bandwidth by; for the Gaussian kernel expansion, it is .
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. |
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 in the reference node , this function computes for where is a -dimensional multi-index and adds to the currently accumulated far-field moments: where is the current set of far-field moments for the reference node . is an appropriate factor to multiply the bandwidth by; for the Gaussian kernel expansion, it is .
data | The entire reference dataset . | |
weights | The entire reference weights . | |
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. |
double FarFieldExpansion< TKernelAux >::bandwidth_sq | ( | ) | const [inline] |
Gets the squared bandwidth value that is being used by the current far-field expansion object.
Definition at line 110 of file farfield_expansion.h.
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.
double FarFieldExpansion< TKernelAux >::ConvolveField | ( | const FarFieldExpansion< TKernelAux > & | fe, | |
int | order | |||
) | const |
Evaluates the convolution with the other farfield expansion.
double FarFieldExpansion< TKernelAux >::EvaluateField | ( | const Matrix & | data, | |
int | row_num, | |||
int | order | |||
) | const |
Evaluates the far-field coefficients at the given point.
Vector* FarFieldExpansion< TKernelAux >::get_center | ( | ) | [inline] |
Gets the center of expansion.
Definition at line 116 of file farfield_expansion.h.
const Vector& FarFieldExpansion< TKernelAux >::get_coeffs | ( | ) | const [inline] |
Gets the set of far-field coefficients.
Definition at line 125 of file farfield_expansion.h.
int FarFieldExpansion< TKernelAux >::get_max_order | ( | ) | const [inline] |
Gets the maximum possible approximation order.
Definition at line 137 of file farfield_expansion.h.
int FarFieldExpansion< TKernelAux >::get_order | ( | ) | const [inline] |
Gets the approximation order.
Definition at line 131 of file farfield_expansion.h.
double FarFieldExpansion< TKernelAux >::get_weight_sum | ( | ) | const [inline] |
Gets the weight sum.
Definition at line 141 of file farfield_expansion.h.
void FarFieldExpansion< TKernelAux >::Init | ( | const Vector & | center, | |
const TKernelAux & | ka | |||
) |
Initializes the current far field expansion object with the given center.
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.
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.
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.
void FarFieldExpansion< TKernelAux >::PrintDebug | ( | const char * | name = "" , |
|
FILE * | stream = stderr | |||
) | const |
Prints out the series expansion represented by this object.
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.
void FarFieldExpansion< TKernelAux >::set_center | ( | const Vector & | center | ) | [inline] |
Set the center of the expansion - assumes that the center has been initialized before.
..
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().
void FarFieldExpansion< TKernelAux >::set_order | ( | int | new_order | ) | [inline] |
Sets the approximation order of the far-field expansion.
new_order | The desired new order of the approximation. |
Definition at line 147 of file farfield_expansion.h.
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.
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.