Lattice Builder Manual
Software Package for Constructing Rank-1 Lattices
|
Assume that we want to introduce a new coordinate-uniform figure of merit. The first thing we need to do is to add a new functor and a new kernel, by writing the following to latbuilder/include/latbuilder/Functor/MyFigure.h
:
and the following to latbuilder/include/latbuilder/Kernel/MyFigure.h
:
Then, teach the kernel parser to recognize the string my-figure
as our new figure of merit by appending the try
block in Parser::Kernel::parse() with the following code:
Also make sure to add the relevant include file in latbuilder/include/latbuilder/Parser/Kernel.h
:
Then it should work out of the box if you recompile Lattice Builder, then run latbuilder
with the option –figure-of-merit CU:my-figure
.
To compute weight values for any of the supported weight types (product, order-dependent, POD, projection-dependent), it is possible to use the enter an expression function from the web user interface. But let us assuming that we want to do this by deriving a new class of weights from an existing one. Consider product weights that depend a single parameter \(\eta\) and that take the value
\[ \gamma_{\mathfrak u} = \prod_{j \in \mathfrak u} (1 / j^\eta) \]
for projection \(\mathfrak u\). First, we define the new weights class that overrides ProductWeights::getWeightForCoordinate() in latcommon/include/latcommon/MyWeights.h
:
Next, we declare a new member function in Parser::Weights in latbuilder/include/latbuilder/Parser/Weights.h
:
and implement it in latbuilder/src/Parser/Weights.cc
:
after, of course, adding the new header with:
We also need to add a conditional block in Parser::Weights::parse:
Then, after recompiling Lattice Builder, the new weights should be available to use by invoking latbuilder
with the option –weights MyWeights:1.5
, for example.