|
|
@ -1,38 +1,40 @@ |
|
|
|
package mightypork.test; |
|
|
|
package mightypork.test; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import mightypork.utils.math.constraints.vect.Vect; |
|
|
|
import mightypork.utils.math.constraints.vect.Vect; |
|
|
|
import mightypork.utils.math.constraints.vect.VectCache; |
|
|
|
import mightypork.utils.math.constraints.vect.VectCache; |
|
|
|
import mightypork.utils.math.constraints.vect.VectVar; |
|
|
|
import mightypork.utils.math.constraints.vect.VectVar; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class TestConstCaching { |
|
|
|
public class TestConstCaching { |
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) |
|
|
|
public static void main(String[] args) |
|
|
|
{ |
|
|
|
{ |
|
|
|
VectVar in = Vect.makeVar(0, 0); |
|
|
|
final VectVar in = Vect.makeVar(0, 0); |
|
|
|
VectCache cache = in.cached(); |
|
|
|
final VectCache cache = in.cached(); |
|
|
|
cache.enableDigestCaching(true); |
|
|
|
cache.enableDigestCaching(true); |
|
|
|
|
|
|
|
|
|
|
|
System.out.println("in = "+in); |
|
|
|
System.out.println("in = " + in); |
|
|
|
System.out.println("cache = "+cache); |
|
|
|
System.out.println("cache = " + cache); |
|
|
|
System.out.println("cache digest = " + cache.digest()); |
|
|
|
System.out.println("cache digest = " + cache.digest()); |
|
|
|
System.out.println("\n-- in := 100, 50, 25 --\n"); |
|
|
|
System.out.println("\n-- in := 100, 50, 25 --\n"); |
|
|
|
in.setTo(100,50,25); |
|
|
|
in.setTo(100, 50, 25); |
|
|
|
System.out.println("in = "+in); |
|
|
|
System.out.println("in = " + in); |
|
|
|
System.out.println("cache = "+cache); |
|
|
|
System.out.println("cache = " + cache); |
|
|
|
System.out.println("cache digest = " + cache.digest()); |
|
|
|
System.out.println("cache digest = " + cache.digest()); |
|
|
|
System.out.println("\n-- cache.poll() --\n"); |
|
|
|
System.out.println("\n-- cache.poll() --\n"); |
|
|
|
cache.poll(); |
|
|
|
cache.poll(); |
|
|
|
System.out.println("in = "+in); |
|
|
|
System.out.println("in = " + in); |
|
|
|
System.out.println("cache = "+cache); |
|
|
|
System.out.println("cache = " + cache); |
|
|
|
System.out.println("cache digest = " + cache.digest()); |
|
|
|
System.out.println("cache digest = " + cache.digest()); |
|
|
|
System.out.println("\n-- in := 1, 2, 3 --\n"); |
|
|
|
System.out.println("\n-- in := 1, 2, 3 --\n"); |
|
|
|
in.setTo(1,2,3); |
|
|
|
in.setTo(1, 2, 3); |
|
|
|
System.out.println("in = "+in); |
|
|
|
System.out.println("in = " + in); |
|
|
|
System.out.println("cache = "+cache); |
|
|
|
System.out.println("cache = " + cache); |
|
|
|
System.out.println("cache digest = " + cache.digest()); |
|
|
|
System.out.println("cache digest = " + cache.digest()); |
|
|
|
System.out.println("\n-- cache.poll() --\n"); |
|
|
|
System.out.println("\n-- cache.poll() --\n"); |
|
|
|
cache.poll(); |
|
|
|
cache.poll(); |
|
|
|
System.out.println("cache = "+cache); |
|
|
|
System.out.println("cache = " + cache); |
|
|
|
System.out.println("cache digest = " + cache.digest()); |
|
|
|
System.out.println("cache digest = " + cache.digest()); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|