Commit 34500a86 authored by Andre Heydt's avatar Andre Heydt
Browse files

organized some tests

parent de4d6069
......@@ -124,7 +124,7 @@ public class AngleOptimization2D
if( cosAngle == null || cosAngle.length != 3 * numOfElements )
cosAngle = new double[ 3 * numOfElements ];
for( int i=0, n=0; i<numOfElements; i++ )
for( int i=0; i<numOfElements; i++ )
for( int j=0; j<3; j++ ) {
final double a = length( i, (j+2)%3 );
final double b = length( i, (j+1)%3 );
......
......@@ -1026,7 +1026,7 @@ public class MatrixOperationsTest extends TestCase {
public final void testMinus_doubleArrayTwo_intArrayTwo_doubleArrayTwo(){
for( int j = 2; j < range; j++ ){
setUp(j);
final int index = (int) Math.random()*j;
// final int index = (int) Math.random()*j;
MatrixOperations.random( doubleA );
MatrixOperations.random( intA, 100 );
......@@ -1041,7 +1041,7 @@ public class MatrixOperationsTest extends TestCase {
public final void testMinus_intArrayTwo_doubleArrayTwo_doubleArrayTwo(){
for( int j = 2; j < range; j++ ){
setUp(j);
final int index = (int) Math.random()*j;
// final int index = (int) Math.random()*j;
MatrixOperations.random( doubleA );
MatrixOperations.random( intA, 100 );
......
......@@ -56,7 +56,7 @@ public class ExtrapIntegratorTest extends TestCase {
double result = ExtrapIntegrator.integrate(f, 0, Math.PI, acc);
this.assertEquals( "acc="+acc, 2, result, acc );
assertEquals( "acc="+acc, 2, result, acc );
}
}
......@@ -84,8 +84,8 @@ public class ExtrapIntegratorTest extends TestCase {
ExtrapIntegrator
.integrate(result, g, 0, Math.PI, acc);
this.assertEquals("acc=" + acc, 2, result[0], acc);
this.assertEquals("acc=" + acc, 0, result[1], acc);
assertEquals("acc=" + acc, 2, result[0], acc);
assertEquals("acc=" + acc, 0, result[1], acc);
}
}
......
......@@ -56,9 +56,9 @@ public class ConjugateGradientTest
d[0] = 0.;
d[1] = 1.;
final long begin = System.currentTimeMillis();
// final long begin = System.currentTimeMillis();
final double res = ConjugateGradient.search(d, 1e-8,new Quadr());
final long end = System.currentTimeMillis();
// final long end = System.currentTimeMillis();
//System.out.println("Time to search: "+(end-begin));
assertEquals(res, 0.344617, 1e-6);
......
......@@ -56,9 +56,9 @@ public class SteepestDescentTest
d[0] = 0.;
d[1] = 1.;
final long begin = System.currentTimeMillis();
// final long begin = System.currentTimeMillis();
final double res = SteepestDescent.search(d, 1e-8,new Quadr());
final long end = System.currentTimeMillis();
// final long end = System.currentTimeMillis();
assertEquals(res, 0.344617, 1e-2);
......@@ -70,9 +70,9 @@ public class SteepestDescentTest
d[0] = 0.;
d[1] = 1.;
final long begin2 = System.currentTimeMillis();
// final long begin2 = System.currentTimeMillis();
final double res2 = ConjugateGradient.search(d, 1e-8,new Quadr());
final long end2 = System.currentTimeMillis();
// final long end2 = System.currentTimeMillis();
//System.out.println(" Time to search(SteepestDecsent-ConjugateGradient): "+((end-begin)-(end2-begin2)) );
......
......@@ -77,8 +77,8 @@ public class BulirschStoerTest extends TestCase {
odeSolver.odex( ode, y, 0, Math.PI, acc, checkIntermediate );
this.assertEquals("acc=" + acc, -1, y[0], acc);
this.assertEquals("acc=" + acc, 0, y[1], acc);
assertEquals("acc=" + acc, -1, y[0], acc);
assertEquals("acc=" + acc, 0, y[1], acc);
}
}
......
......@@ -73,8 +73,8 @@ public class ExtrapTest extends TestCase {
Extrap.solve( ode, x, 0.0, Math.PI, acc, checkIntermediate );
this.assertEquals("acc=" + acc, -1, x[0], acc);
this.assertEquals("acc=" + acc, 0, x[1], acc);
assertEquals("acc=" + acc, -1, x[0], acc);
assertEquals("acc=" + acc, 0, x[1], acc);
}
}
......
......@@ -78,8 +78,8 @@ public class RungeKuttaFehlbergTest extends TestCase {
//Runge-Kutta-Fehlberg fails sometimes criteria, take half
odeSolver.odex( ode, y, 0, Math.PI, acc/2, checkIntermediate );
this.assertEquals("acc=" + acc, -1, y[0], acc);
this.assertEquals("acc=" + acc, 0, y[1], acc);
assertEquals("acc=" + acc, -1, y[0], acc);
assertEquals("acc=" + acc, 0, y[1], acc);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment