benchmarks/matrix-multiplication/src/main/java/org/apidesign/benchmark/matrixmul/Main.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Thu, 13 Dec 2012 08:40:39 +0100
branchbenchmarks
changeset 314 1a3f102e5ea5
parent 268 e01b65623f72
permissions -rw-r--r--
Fixing licenses for benchmarks module, so it can be merged to default branch
jaroslav@314
     1
/**
jaroslav@314
     2
 * Back 2 Browser Bytecode Translator
jaroslav@314
     3
 * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
jaroslav@314
     4
 *
jaroslav@314
     5
 * This program is free software: you can redistribute it and/or modify
jaroslav@314
     6
 * it under the terms of the GNU General Public License as published by
jaroslav@314
     7
 * the Free Software Foundation, version 2 of the License.
jaroslav@314
     8
 *
jaroslav@314
     9
 * This program is distributed in the hope that it will be useful,
jaroslav@314
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
jaroslav@314
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
jaroslav@314
    12
 * GNU General Public License for more details.
jaroslav@314
    13
 *
jaroslav@314
    14
 * You should have received a copy of the GNU General Public License
jaroslav@314
    15
 * along with this program. Look for COPYING file in the top folder.
jaroslav@314
    16
 * If not, see http://opensource.org/licenses/GPL-2.0.
jaroslav@314
    17
 */
Martin@268
    18
package org.apidesign.benchmark.matrixmul;
Martin@268
    19
Martin@268
    20
public class Main {
Martin@268
    21
Martin@268
    22
    public static final int ITERATION_COUNT = 100000;
Martin@268
    23
    
Martin@268
    24
    public static void main(String[] args) {
Martin@268
    25
        Matrix m1 = new Matrix(5);
Martin@268
    26
        Matrix m2 = new Matrix(5);
Martin@268
    27
        
Martin@268
    28
        m1.generateData();
Martin@268
    29
        m2.generateData();
Martin@268
    30
        
Martin@268
    31
        //m1.printOn(System.out);
Martin@268
    32
        //System.out.println("x");
Martin@268
    33
        //m2.printOn(System.out);
Martin@268
    34
        
Martin@268
    35
        for (int i = 0; i < ITERATION_COUNT; i++) {
Martin@268
    36
            m1.multiply(m2);
Martin@268
    37
        }
Martin@268
    38
        
Martin@268
    39
        //System.out.println("=");
Martin@268
    40
        //m1.printOn(System.out);
Martin@268
    41
    }
Martin@268
    42
}