UNPKG

@compute.ts/math

Version:

Provide math operators for the computeTS package

1 lines 1.19 kB
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var array_1=require("@compute.ts/array"),number_1=require("@compute.ts/number"),chai_1=require("chai");require("mocha");var ComputeMathLibrary_1=require("../ComputeMathLibrary");describe("The the argMax operator",function(){it("Should be able to perform an evaluation of the argMax operator (values array)",function(){var r=ComputeMathLibrary_1.argMax([1,2,3]);chai_1.expect(r.eval()).to.equal(2)}),it("Should be able to perform an evaluation of the argMax operator (expression array)",function(){var r=number_1.number(1),a=number_1.number(2),e=number_1.number(3),e=ComputeMathLibrary_1.argMax([r,a,e]);chai_1.expect(e.eval()).to.equal(2)}),it("Should be able to perform an evaluation of the argMax operator (array of values)",function(){var r=array_1.array.ofNumber([1,2,3]),r=ComputeMathLibrary_1.argMax(r);chai_1.expect(r.eval()).to.equal(2)}),it("Should be able to perform an evaluation of the argMax operator (array of expressions)",function(){var r=number_1.number(1),a=number_1.number(2),e=number_1.number(3),e=array_1.array.ofNumber([r,a,e]),e=ComputeMathLibrary_1.argMax(e);chai_1.expect(e.eval()).to.equal(2)})});