1   /*
2    * $Id: AbstractMatrixTest.java,v 1.1 2009/09/07 16:06:11 pah Exp $
3    * 
4    * Created on 11 Dec 2008 by Paul Harrison (paul.harrison@manchester.ac.uk)
5    * Copyright 2008 Astrogrid. All rights reserved.
6    *
7    * This software is published under the terms of the Astrogrid 
8    * Software License, a copy of which has been included 
9    * with this distribution in the LICENSE.txt file.  
10   *
11   */
12  
13  package org.astrogrid.matrix;
14  
15  import static org.junit.Assert.fail;
16  
17  public abstract class AbstractMatrixTest {
18  
19      public AbstractMatrixTest() {
20          super();
21      }
22  
23      protected void assertResult(Matrix result, Matrix expected, String func) {
24          expected.add(-1.0, result);
25          double norm = expected.norm(Matrix.Norm.Maxvalue);
26          if(Math.abs(norm)> 1e-8){
27              fail(func+ " function does not return correct value - diff="+norm);
28          }
29      }
30  
31  }
32  
33  /*
34   * $Log: AbstractMatrixTest.java,v $
35   * Revision 1.1  2009/09/07 16:06:11  pah
36   * initial transcription of the core
37   *
38   */