Step 3
This commit is contained in:
parent
36ad96d129
commit
8448b388fa
|
@ -12,4 +12,12 @@ module Make = (Config: Config) => {
|
|||
if (!validateSize()) {
|
||||
raise(ShapeWrong("Arrays of \"xs\" and \"ys\" have different sizes."));
|
||||
};
|
||||
|
||||
let order = (): DistributionTypes.xyShape => {
|
||||
let xy =
|
||||
Config.shape.xs
|
||||
|> Array.mapi((i, x) => [x, Config.shape.ys[i]])
|
||||
|> Belt.SortArray.stableSortBy(_, ([a], [b]) => a > b ? (-1) : 1);
|
||||
{xs: xy |> Array.map(([x]) => x), ys: xy |> Array.map(([_, y]) => y)};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user