la4j-0.2.0.zip
la4j
bin
la4j-0.2.0.jar
LICENSE
README
src
main
java
la4j
decomposition
err
factory
inversion
io
linear
matrix
dense
sparse
util
vector
dense
sparse
test
java
la4j
decomposition
inversion
linear
matrix
dense
sparse
vector
dense
sparse
|
/*
* Copyright 2011, Vladimir Kostyukov
*
* This file is part of la4j project (http://la4j.googlecode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package la4j.inversion;
import junit.framework.TestCase;
import la4j.err.MatrixException;
import la4j.err.MatrixInversionException;
import la4j.factory.DenseFactory;
import la4j.factory.Factory;
import la4j.factory.SparseFactory;
import la4j.matrix.Matrix;
public abstract class AbstractInvertorTest extends TestCase {
public abstract MatrixInvertor invertor();
public abstract double[][] data();
public Factory[] factories() {
return new Factory[] {
new SparseFactory(),
new DenseFactory()
};
}
public void testInverse() throws MatrixInversionException, MatrixException {
for (Factory factory: factories()) {
Matrix a = factory.createMatrix(data());
Matrix b = a.inverse(invertor());
assertEquals(factory.createIdentityMatrix(a.rows()), a.multiply(b));
Matrix c = a.inverse(invertor(), factory);
assertEquals(factory.createIdentityMatrix(a.rows()), a.multiply(c));
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of use and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I've received a Master's Degree in Computer Science at the IT Faculty of Altai State Technical University, Russia.
Currently, I am Software Engineer at Intel Corporation.