Description Usage Arguments Details Value Author(s)
View source: R/generic-format_var_aliase.R
The function format_var_aliases
formats KeOps formula arguments to be
understood by the C++ code.
1 |
args |
vector of text string, formula input arguments (see Details). |
Mathematical formula: sum_i e^(lambda*||x_i - y_j||^2)
where x_i
, y_j
are 3d vectors, and lambda
is a scaler parameter.
Corresponding KeOps formula and input parameters:
1 2 |
Input arguments can be of different types:
|———|————————-|———–|
| keyword | meaning | type |
|———|————————-|———–|
| Vi
| variable indexed by i
| 0
|
| Vj
| variable indexed by j
| 1
|
| Pm
| parameter | 2
|
|———|————————-|———–|
An input parameters should be defined as follows "x=YY(dim)"
or
"x=YY(pos, dim)"
where YY
can be Vi
, Vj
or Pm
:
dim
is the dimension of the variable or parameter. For Vi
and Vj
,
the range of i
or j
is not known at compile time, only at runtime.
pos
is the position of the variable as it will be supplied to the
operator, starting from 0
. This position should be specify for all
variable or none, if not specify the natural order in the vector args
is
used.
For the formula "Sum_Reduction(Exp(lambda * SqNorm2(x-y)), 0)"
, both
args = c("x=Vi(3)", "y=Vj(3)", "lambda=Pm(1)")
and
args <- c("x=Vi(0,3)", "y=Vj(1,3)", "beta=Vj(2,3)", "lambda=Pm(3,1)")
are
equivalent. When specifying the pos
parameter, the natural order in the
vector args
may not correspond to the order of the formula input arguments.
Note: we recommand to use the Vi(dim)
notation and let the position be
determined by the argument order.
a list with different information about formula input arguments:
args |
vector of text string, input parameter |
var_name |
vector of text string, corresponding name of formula arguments |
var_type |
vector of text string, corresponding type of formula
arguments (among |
var_pos |
vector of integer, corresponding arguments positions. |
var_aliases |
text string, declaration of formula input arguments for the C++ KeOps API. |
Ghislain Durif
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.