Login
Login

Re: Vector.equals()

Home 21090308 Forums Re: Vector.equals()

#1954
haksunli
Keymaster

The method to check [tt:1n1cmq34]Matrix[/tt:1n1cmq34] equality with a precision is:

public static boolean equal(DoubleMatrix A1,
                            DoubleMatrix A2,
                            double epsilon)

Check the equality of two matrices. Two matrices are equal iff
1.the dimensions are the same;
2.all entries are equal
Parameters:
A1 – a matrix
A2 – a matrix
epsilon – a precision parameter: when a number |x| ≤ ε, it is considered 0
Returns:
true iff all entries are equal, entry by entry

For example, in JUnit test cases, we write: