Fixes file link

This commit is contained in:
Roman Galochkin 2020-02-25 08:20:11 +03:00
parent eaea7cc69a
commit e55993527e
3 changed files with 8 additions and 25 deletions

View File

@ -7,7 +7,7 @@ describe("CDF", () => {
expect(() => {
module CDF =
CDFunctor.Make({
let shape: DistributionTypes.xyShape = {
let shape: DistTypes.xyShape = {
xs: [|10., 4., 8.|],
ys: [|8., 9., 2.|],
};
@ -20,7 +20,7 @@ describe("CDF", () => {
expect(() => {
module CDF =
CDFunctor.Make({
let shape: DistributionTypes.xyShape = {
let shape: DistTypes.xyShape = {
xs: [|1., 4., 8.|],
ys: [|8., 9., 2.|],
};
@ -32,24 +32,18 @@ describe("CDF", () => {
});
test("order#1", () => {
let a = CDFunctor.order({xs: [|1., 4., 8.|], ys: [|8., 9., 2.|]});
let b: DistributionTypes.xyShape = {
xs: [|1., 4., 8.|],
ys: [|8., 9., 2.|],
};
let b: DistTypes.xyShape = {xs: [|1., 4., 8.|], ys: [|8., 9., 2.|]};
expect(a) |> toEqual(b);
});
test("order#2", () => {
let a = CDFunctor.order({xs: [|10., 5., 12.|], ys: [|8., 9., 2.|]});
let b: DistributionTypes.xyShape = {
xs: [|5., 10., 12.|],
ys: [|9., 8., 2.|],
};
let b: DistTypes.xyShape = {xs: [|5., 10., 12.|], ys: [|9., 8., 2.|]};
expect(a) |> toEqual(b);
});
test("minX", () => {
module CDF =
CDFunctor.Make({
let shape: DistributionTypes.xyShape =
let shape: DistTypes.xyShape =
CDFunctor.order({xs: [|20., 4., 8.|], ys: [|8., 9., 2.|]});
});
expect(CDF.minX()) |> toEqual(4.);
@ -57,7 +51,7 @@ describe("CDF", () => {
test("maxX", () => {
module CDF =
CDFunctor.Make({
let shape: DistributionTypes.xyShape =
let shape: DistTypes.xyShape =
CDFunctor.order({xs: [|20., 4., 8.|], ys: [|8., 9., 2.|]});
});
expect(CDF.maxX()) |> toEqual(20.);

View File

@ -1,11 +0,0 @@
'use strict';
var React = require("react");
var ReactDOMRe = require("reason-react/src/ReactDOMRe.js");
var App$ProbExample = require("./App.bs.js");
((import('./styles/index.css')));
ReactDOMRe.renderToElementWithId(React.createElement(App$ProbExample.make, { }), "app");
/* Not a pure module */

View File

@ -1,8 +1,8 @@
module type Config = {let shape: DistributionTypes.xyShape;};
module type Config = {let shape: DistTypes.xyShape;};
exception ShapeWrong(string);
let order = (shape: DistributionTypes.xyShape): DistributionTypes.xyShape => {
let order = (shape: DistTypes.xyShape): DistTypes.xyShape => {
let xy =
shape.xs
|> Array.mapi((i, x) => [x, shape.ys |> Array.get(_, i)])