weight-gen(1) | General Commands Manual | weight-gen(1) |
weight-gen - Generate a distribution of weights for a given mesh
weight-gen [options...] [input.mesh [output.weights]]
weight-gen generates weights for a given mesh.
If input.mesh is omitted or is -, it is read from standard input. If output.weights is omitted or is -, it is written to standard output.
Unless -i, --integers is specified, the generated weights are floating-point numbers.
Only some specific mesh formats are supported. See apply-part(1)'s INPUT FORMAT for details.
See WEIGHT FILE for a description of the output format.
-h, --help
--version
-d, --distribution <spec>
-i, --integers
The option -d, --distribution defines how input weights are laid out. It can be specified multiple times, one for each criterion. Its value must follow the following syntax:
distribution := name *( "," param) param := value / axis name := STRING value := FLOAT axis := "x" / "y" / "z" / "0" / "1" / "2"
For example, the following will lay out weights in ascending order on the horizontal (X, abscissa) axis, from 0 to 100:
And the following example shows how to form a spike of height 4.2 at the origin:
The following distributions are supported:
constant,VALUE
linear,AXIS,FROM,TO
spike,HEIGHT,POSITION,...
A weight file is a binary file that consists of a header followed by a list of weights, which can either be integers or floating points. Below is the ABNF representation of the file:
file = magic version flags criterion-count weight-count weights magic = %x4d %x65 %x57 %x65 ; "MeWe" version = %x01 ; Version 1 flags = %x00-FF ; see the Flags paragraph criterion-count = U16 ; Number of criteria weight-count = U64 ; Number of weights per criterion weights = *I64 / *F64 ; criterion-count times weight-count weights
Some notes:
The flags byte has the following meaning, from the least significant bit to the most:
This executable is part of coupe, which is maintained by Hubert Hirtz <hubert@hirtz.pm> under the direction of Franck Ledoux <franck.ledoux@cea.fr> and the supervision of Cédric Chevalier <cedric.chevalier@cea.fr> and Sébastien Morais <sebastien.morais@cea.fr>.
For more information on coupe development, see <https://github.com/LIHPC-Computational-Geometry/coupe>.
2024-02-06 |