You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gilles (JIRA)" <ji...@apache.org> on 2015/07/20 15:54:04 UTC
[jira] [Resolved] (MATH-1249) BlockRealMatrix BLOCK_SIZE value
change
[ https://issues.apache.org/jira/browse/MATH-1249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gilles resolved MATH-1249.
--------------------------
Resolution: Invalid
> BlockRealMatrix BLOCK_SIZE value change
> ---------------------------------------
>
> Key: MATH-1249
> URL: https://issues.apache.org/jira/browse/MATH-1249
> Project: Commons Math
> Issue Type: Bug
> Reporter: alberto trivellato
> Priority: Minor
>
> Changing the value of the filed BlockRealMatrix.BLOCK_SIZE takes to a java.lang.ArrayIndexOutOfBoundsException in the method multiply(); The
> thest is the following (aftre recompiling without the FINAL keyword for BlockRealMatrix.BLOCK_SIZE):
> public void testBlockRealMatrix() throws Exception{
> logger.debug("testBlockRealMatrix");
>
> long seed = 12345L;
> Random random = new Random(seed);
> int rows = 100;
> int cols = 100;
> double[][] data = new double[rows][cols];
> for(int i=0; i<rows; i++){
> for(int j=0; j<cols; j++){
> data[i][j] = random.nextDouble();
> }
> }
>
> BlockRealMatrix m1 = new BlockRealMatrix(data);
> BlockRealMatrix m2 = new BlockRealMatrix(data);
>
> BlockRealMatrix.BLOCK_SIZE = 52;
> long t0 = System.currentTimeMillis();
> m2.multiply(m1);
> logger.debug("time : " + (System.currentTimeMillis() - t0));
>
> BlockRealMatrix.BLOCK_SIZE = 26;
> t0 = System.currentTimeMillis();
> m2.multiply(m1);
> logger.debug("time : " + (System.currentTimeMillis() - t0));
>
> BlockRealMatrix.BLOCK_SIZE = 104;
> t0 = System.currentTimeMillis();
> m2.multiply(m1);
> logger.debug("time : " + (System.currentTimeMillis() - t0));
> }
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)