fixed call to deprecated method
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1084596 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ba43534ea8
commit
ff21663c8e
|
@ -55,57 +55,57 @@ public class SparseFieldVectorTest {
|
|||
//octave = v1 .+ 2.0
|
||||
FieldVector<Fraction> v_mapAdd = v1.mapAdd(new Fraction(2));
|
||||
Fraction[] result_mapAdd = {new Fraction(3), new Fraction(4), new Fraction(5)};
|
||||
Assert.assertEquals("compare vectors" ,result_mapAdd,v_mapAdd.getData());
|
||||
Assert.assertArrayEquals("compare vectors" ,result_mapAdd,v_mapAdd.getData());
|
||||
|
||||
//octave = v1 .+ 2.0
|
||||
FieldVector<Fraction> v_mapAddToSelf = v1.copy();
|
||||
v_mapAddToSelf.mapAddToSelf(new Fraction(2));
|
||||
Fraction[] result_mapAddToSelf = {new Fraction(3), new Fraction(4), new Fraction(5)};
|
||||
Assert.assertEquals("compare vectors" ,result_mapAddToSelf,v_mapAddToSelf.getData());
|
||||
Assert.assertArrayEquals("compare vectors" ,result_mapAddToSelf,v_mapAddToSelf.getData());
|
||||
|
||||
//octave = v1 .- 2.0
|
||||
FieldVector<Fraction> v_mapSubtract = v1.mapSubtract(new Fraction(2));
|
||||
Fraction[] result_mapSubtract = {new Fraction(-1), new Fraction(0), new Fraction(1)};
|
||||
Assert.assertEquals("compare vectors" ,result_mapSubtract,v_mapSubtract.getData());
|
||||
Assert.assertArrayEquals("compare vectors" ,result_mapSubtract,v_mapSubtract.getData());
|
||||
|
||||
//octave = v1 .- 2.0
|
||||
FieldVector<Fraction> v_mapSubtractToSelf = v1.copy();
|
||||
v_mapSubtractToSelf.mapSubtractToSelf(new Fraction(2));
|
||||
Fraction[] result_mapSubtractToSelf = {new Fraction(-1), new Fraction(0), new Fraction(1)};
|
||||
Assert.assertEquals("compare vectors" ,result_mapSubtractToSelf,v_mapSubtractToSelf.getData());
|
||||
Assert.assertArrayEquals("compare vectors" ,result_mapSubtractToSelf,v_mapSubtractToSelf.getData());
|
||||
|
||||
//octave = v1 .* 2.0
|
||||
FieldVector<Fraction> v_mapMultiply = v1.mapMultiply(new Fraction(2));
|
||||
Fraction[] result_mapMultiply = {new Fraction(2), new Fraction(4), new Fraction(6)};
|
||||
Assert.assertEquals("compare vectors" ,result_mapMultiply,v_mapMultiply.getData());
|
||||
Assert.assertArrayEquals("compare vectors" ,result_mapMultiply,v_mapMultiply.getData());
|
||||
|
||||
//octave = v1 .* 2.0
|
||||
FieldVector<Fraction> v_mapMultiplyToSelf = v1.copy();
|
||||
v_mapMultiplyToSelf.mapMultiplyToSelf(new Fraction(2));
|
||||
Fraction[] result_mapMultiplyToSelf = {new Fraction(2), new Fraction(4), new Fraction(6)};
|
||||
Assert.assertEquals("compare vectors" ,result_mapMultiplyToSelf,v_mapMultiplyToSelf.getData());
|
||||
Assert.assertArrayEquals("compare vectors" ,result_mapMultiplyToSelf,v_mapMultiplyToSelf.getData());
|
||||
|
||||
//octave = v1 ./ 2.0
|
||||
FieldVector<Fraction> v_mapDivide = v1.mapDivide(new Fraction(2));
|
||||
Fraction[] result_mapDivide = {new Fraction(.5d), new Fraction(1), new Fraction(1.5d)};
|
||||
Assert.assertEquals("compare vectors" ,result_mapDivide,v_mapDivide.getData());
|
||||
Assert.assertArrayEquals("compare vectors" ,result_mapDivide,v_mapDivide.getData());
|
||||
|
||||
//octave = v1 ./ 2.0
|
||||
FieldVector<Fraction> v_mapDivideToSelf = v1.copy();
|
||||
v_mapDivideToSelf.mapDivideToSelf(new Fraction(2));
|
||||
Fraction[] result_mapDivideToSelf = {new Fraction(.5d), new Fraction(1), new Fraction(1.5d)};
|
||||
Assert.assertEquals("compare vectors" ,result_mapDivideToSelf,v_mapDivideToSelf.getData());
|
||||
Assert.assertArrayEquals("compare vectors" ,result_mapDivideToSelf,v_mapDivideToSelf.getData());
|
||||
|
||||
//octave = v1 .^-1
|
||||
FieldVector<Fraction> v_mapInv = v1.mapInv();
|
||||
Fraction[] result_mapInv = {new Fraction(1),new Fraction(0.5d),new Fraction(3.333333333333333e-01d)};
|
||||
Assert.assertEquals("compare vectors" ,result_mapInv,v_mapInv.getData());
|
||||
Assert.assertArrayEquals("compare vectors" ,result_mapInv,v_mapInv.getData());
|
||||
|
||||
//octave = v1 .^-1
|
||||
FieldVector<Fraction> v_mapInvToSelf = v1.copy();
|
||||
v_mapInvToSelf.mapInvToSelf();
|
||||
Fraction[] result_mapInvToSelf = {new Fraction(1),new Fraction(0.5d),new Fraction(3.333333333333333e-01d)};
|
||||
Assert.assertEquals("compare vectors" ,result_mapInvToSelf,v_mapInvToSelf.getData());
|
||||
Assert.assertArrayEquals("compare vectors" ,result_mapInvToSelf,v_mapInvToSelf.getData());
|
||||
|
||||
|
||||
}
|
||||
|
@ -120,12 +120,12 @@ public class SparseFieldVectorTest {
|
|||
//octave = v1 + v2
|
||||
FieldVector<Fraction> v_add = v1.add(v2);
|
||||
Fraction[] result_add = {new Fraction(5), new Fraction(7), new Fraction(9)};
|
||||
Assert.assertEquals("compare vect" ,v_add.getData(),result_add);
|
||||
Assert.assertArrayEquals("compare vect" ,v_add.getData(),result_add);
|
||||
|
||||
SparseFieldVector<Fraction> vt2 = new SparseFieldVector<Fraction>(field,vec2);
|
||||
FieldVector<Fraction> v_add_i = v1.add(vt2);
|
||||
Fraction[] result_add_i = {new Fraction(5), new Fraction(7), new Fraction(9)};
|
||||
Assert.assertEquals("compare vect" ,v_add_i.getData(),result_add_i);
|
||||
Assert.assertArrayEquals("compare vect" ,v_add_i.getData(),result_add_i);
|
||||
|
||||
//octave = v1 - v2
|
||||
SparseFieldVector<Fraction> v_subtract = v1.subtract(v2);
|
||||
|
|
Loading…
Reference in New Issue