Ejemplo n.º 1
0
    [Fact] public void MinMax()
    {
        Data_Generator dg = new Data_Generator();
        Hand_Generator hg = new Hand_Generator(dg);

        (Joints min, Joints max, Joints j)dat;
        dat.j   = hg.newJoints();
        dat.min = new Joints(dg.newMinVectors(5), dg.newMinVectors(5), dg.newMinVectors(5), dg.newMinVectors(5),
                             dg.newMinVectors(5), dg.newMinVector(), dg.newFloat(100));
        dat.max = new Joints(dg.newZeroVectors(5), dg.newZeroVectors(5), dg.newZeroVectors(5), dg.newZeroVectors(5),
                             dg.newZeroVectors(5), dg.newZeroVector(), dg.newFloat(100));

        (Joints min, Joints max)exp;
        exp.min = dat.min;
        exp.max = dat.j;

        var vH = new VectorHelper();
        var jH = new JointsHelper(vH);

        var act = jH.minMax(dat.min, dat.max, dat.j);

        test.jointsEqual(exp.min, act.min);
        test.jointsEqual(exp.max, act.max);
    }
Ejemplo n.º 2
0
    [Fact] public void MinMaxList()
    {
        var dg = new Data_Generator();
        //var dat_i = 0;
        var dat_len = dg.newInt(100);

        var dat_vA  = dg.newVectors(dat_len);
        var dat_min = dg.newMinVectors(dat_len);
        var dat_max = dg.newZeroVectors(dat_len);

        (Vector[] min, Vector[] max)exp = (new Vector[dat_len], new Vector[dat_len]);
        exp.min = dat_min;
        exp.max = dat_vA;

        var vh = new VectorHelper();

        (Vector[] min, Vector[] max)act = vh.minMaxList(dat_min, dat_max, dat_vA);

        test.vectorsEqual(exp.min, act.min);
        test.vectorsEqual(exp.max, act.max);
    }