/*
 * Copyright (C) 2008-2015 by Holger Arndt
 *
 * This file is part of the Universal Java Matrix Package (UJMP).
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership and licensing.
 *
 * UJMP is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * UJMP is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with UJMP; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 * Boston, MA  02110-1301  USA
 */

package org.ujmp.core.util;

import org.ujmp.core.Matrix;
import org.ujmp.core.doublematrix.calculation.general.decomposition.Chol;
import org.ujmp.core.doublematrix.calculation.general.decomposition.Eig;
import org.ujmp.core.doublematrix.calculation.general.decomposition.Inv;
import org.ujmp.core.doublematrix.calculation.general.decomposition.InvSPD;
import org.ujmp.core.doublematrix.calculation.general.decomposition.LU;
import org.ujmp.core.doublematrix.calculation.general.decomposition.QR;
import org.ujmp.core.doublematrix.calculation.general.decomposition.SVD;
import org.ujmp.core.doublematrix.calculation.general.decomposition.Solve;
import org.ujmp.core.doublematrix.calculation.general.decomposition.SolveSPD;

@SuppressWarnings("unchecked")
public abstract class DecompositionOps {

	public static SVD SVD_UJMP = org.ujmp.core.doublematrix.calculation.general.decomposition.SVD.INSTANCE;

	public static SVD SVD_EJML = null;

	public static SVD SVD_OJALGO = null;

	public static SVD SVD_MTJ = null;

	public static Inv INV_UJMP = org.ujmp.core.doublematrix.calculation.general.decomposition.Inv.INSTANCE;

	public static Inv INV_EJML = null;

	public static Inv INV_OJALGO = null;

	public static Inv INV_JBLAS = null;

	public static Inv INV_MTJ = null;

	public static InvSPD INVSPD_UJMP = org.ujmp.core.doublematrix.calculation.general.decomposition.InvSPD.INSTANCE;

	public static InvSPD INVSPD_EJML = null;

	public static InvSPD INVSPD_OJALGO = null;

	public static InvSPD INVSPD_JBLAS = null;

	public static InvSPD INVSPD_MTJ = null;

	public static InvSPD INVSPD_PARALLELCOLT = null;

	public static Solve SOLVE_UJMP = org.ujmp.core.doublematrix.calculation.general.decomposition.Solve.INSTANCE;

	public static Solve SOLVE_EJML = null;

	public static Solve SOLVE_OJALGO = null;

	public static Solve SOLVE_PARALLELCOLT = null;

	public static Solve SOLVE_MTJ = null;

	public static Solve SOLVE_JBLAS = null;

	public static SolveSPD SOLVESPD_UJMP = org.ujmp.core.doublematrix.calculation.general.decomposition.SolveSPD.INSTANCE;

	public static SolveSPD SOLVESPD_EJML = null;

	public static SolveSPD SOLVESPD_OJALGO = null;

	public static SolveSPD SOLVESPD_MTJ = null;

	public static SolveSPD SOLVESPD_JBLAS = null;

	public static LU LU_UJMP = org.ujmp.core.doublematrix.calculation.general.decomposition.LU.INSTANCE;

	public static LU LU_EJML = null;

	public static LU LU_OJALGO = null;

	public static LU LU_MTJ = null;

	public static LU LU_JBLAS = null;

	public static QR QR_UJMP = org.ujmp.core.doublematrix.calculation.general.decomposition.QR.INSTANCE;

	public static QR QR_EJML = null;

	public static QR QR_OJALGO = null;

	public static QR QR_MTJ = null;

	public static Chol CHOL_UJMP = org.ujmp.core.doublematrix.calculation.general.decomposition.Chol.INSTANCE;

	public static Chol CHOL_EJML = null;

	public static Chol CHOL_OJALGO = null;

	public static Chol CHOL_MTJ = null;

	public static Chol CHOL_JBLAS = null;

	public static Eig EIG_UJMP = org.ujmp.core.doublematrix.calculation.general.decomposition.Eig.INSTANCE;

	public static Eig EIG_EJML = null;

	public static Eig EIG_OJALGO = null;

	public static Eig EIG_MTJ = null;

	public static Eig EIG_JBLAS = null;

	static {
		init();
	}

	public static void init() {
		initSVD();
		initInv();
		initInvSPD();
		initSolve();
		initSolveSPD();
		initLU();
		initQR();
		initChol();
		initEig();
	}

	public static void initSVD() {
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.ejml.Plugin").newInstance();
			if (p.isAvailable()) {
				SVD_EJML = (SVD) Class.forName("org.ujmp.ejml.calculation.SVD")
						.newInstance();
			}
		} catch (Throwable t) {
		}
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.ojalgo.Plugin")
					.newInstance();
			if (p.isAvailable()) {
				SVD_OJALGO = (SVD) Class.forName("org.ujmp.ojalgo.calculation.SVD")
						.newInstance();
			}
		} catch (Throwable t) {
		}
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.mtj.Plugin").newInstance();
			if (p.isAvailable()) {
				SVD_MTJ = (SVD) Class.forName("org.ujmp.mtj.calculation.SVD").newInstance();
			}
		} catch (Throwable t) {
		}
	}

	public static void initInv() {
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.ejml.Plugin").newInstance();
			if (p.isAvailable()) {
				INV_EJML = (Inv) Class.forName("org.ujmp.ejml.calculation.Inv")
						.newInstance();
			}
		} catch (Throwable t) {
		}
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.ojalgo.Plugin")
					.newInstance();
			if (p.isAvailable()) {
				INV_OJALGO = (Inv) Class.forName("org.ujmp.ojalgo.calculation.Inv")
						.newInstance();
			}
		} catch (Throwable t) {
		}
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.jblas.Plugin")
					.newInstance();
			if (p.isAvailable()) {
				INV_JBLAS = (Inv) Class.forName("org.ujmp.jblas.calculation.Inv")
						.newInstance();
			}
		} catch (Throwable t) {
		}
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.mtj.Plugin").newInstance();
			if (p.isAvailable()) {
				INV_MTJ = (Inv) Class.forName("org.ujmp.mtj.calculation.Inv").newInstance();
			}
		} catch (Throwable t) {
		}
	}

	public static void initInvSPD() {
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.ejml.Plugin").newInstance();
			if (p.isAvailable()) {
				INVSPD_EJML = (InvSPD) Class.forName("org.ujmp.ejml.calculation.InvSPD")
						.newInstance();
			}
		} catch (Throwable t) {
		}
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.ojalgo.Plugin")
					.newInstance();
			if (p.isAvailable()) {
				INVSPD_OJALGO = (InvSPD) Class
						.forName("org.ujmp.ojalgo.calculation.InvSPD").newInstance();
			}
		} catch (Throwable t) {
		}
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.jblas.Plugin")
					.newInstance();
			if (p.isAvailable()) {
				INVSPD_JBLAS = (InvSPD) Class.forName("org.ujmp.jblas.calculation.InvSPD")
						.newInstance();
			}
		} catch (Throwable t) {
		}
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.mtj.Plugin").newInstance();
			if (p.isAvailable()) {
				INVSPD_MTJ = (InvSPD) Class.forName("org.ujmp.mtj.calculation.InvSPD")
						.newInstance();
			}
		} catch (Throwable t) {
		}
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.parallelcolt.Plugin")
					.newInstance();
			if (p.isAvailable()) {
				INVSPD_PARALLELCOLT = (InvSPD) Class.forName(
						"org.ujmp.parallelcolt.calculation.InvSPD").newInstance();
			}
		} catch (Throwable t) {
		}
	}

	public static void initSolve() {
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.ejml.Plugin").newInstance();
			if (p.isAvailable()) {
				SOLVE_EJML = (Solve) Class.forName("org.ujmp.ejml.calculation.Solve")
						.newInstance();
			}
		} catch (Throwable t) {
		}
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.ojalgo.Plugin")
					.newInstance();
			if (p.isAvailable()) {
				SOLVE_OJALGO = (Solve) Class.forName("org.ujmp.ojalgo.calculation.Solve")
						.newInstance();
			}
		} catch (Throwable t) {
		}
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.jblas.Plugin")
					.newInstance();
			if (p.isAvailable()) {
				SOLVE_JBLAS = (Solve) Class.forName("org.ujmp.jblas.calculation.Solve")
						.newInstance();
			}
		} catch (Throwable t) {
		}
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.mtj.Plugin").newInstance();
			if (p.isAvailable()) {
				SOLVE_MTJ = (Solve) Class.forName("org.ujmp.mtj.calculation.Solve")
						.newInstance();
			}
		} catch (Throwable t) {
		}
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.parallelcolt.Plugin")
					.newInstance();
			if (p.isAvailable()) {
				SOLVE_PARALLELCOLT = (Solve) Class.forName(
						"org.ujmp.parallelcolt.calculation.Solve").newInstance();
			}
		} catch (Throwable t) {
		}
	}

	public static void initSolveSPD() {
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.ejml.Plugin").newInstance();
			if (p.isAvailable()) {
				SOLVESPD_EJML = (SolveSPD) Class.forName(
						"org.ujmp.ejml.calculation.SolveSPD").newInstance();
			}
		} catch (Throwable t) {
		}
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.ojalgo.Plugin")
					.newInstance();
			if (p.isAvailable()) {
				SOLVESPD_OJALGO = (SolveSPD) Class.forName(
						"org.ujmp.ojalgo.calculation.SolveSPD").newInstance();
			}
		} catch (Throwable t) {
		}
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.jblas.Plugin")
					.newInstance();
			if (p.isAvailable()) {
				SOLVESPD_JBLAS = (SolveSPD) Class.forName(
						"org.ujmp.jblas.calculation.SolveSPD").newInstance();
			}
		} catch (Throwable t) {
		}
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.mtj.Plugin").newInstance();
			if (p.isAvailable()) {
				SOLVESPD_MTJ = (SolveSPD) Class
						.forName("org.ujmp.mtj.calculation.SolveSPD").newInstance();
			}
		} catch (Throwable t) {
		}
	}

	public static void initLU() {
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.ejml.Plugin").newInstance();
			if (p.isAvailable()) {
				LU_EJML = (LU) Class.forName("org.ujmp.ejml.calculation.LU").newInstance();
			}
		} catch (Throwable t) {
		}
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.ojalgo.Plugin")
					.newInstance();
			if (p.isAvailable()) {
				LU_OJALGO = (LU) Class.forName("org.ujmp.ojalgo.calculation.LU")
						.newInstance();
			}
		} catch (Throwable t) {
		}
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.mtj.Plugin").newInstance();
			if (p.isAvailable()) {
				LU_MTJ = (LU) Class.forName("org.ujmp.mtj.calculation.LU").newInstance();
			}
		} catch (Throwable t) {
		}
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.jblas.Plugin")
					.newInstance();
			if (p.isAvailable()) {
				LU_JBLAS = (LU) Class.forName("org.ujmp.jblas.calculation.LU")
						.newInstance();
			}
		} catch (Throwable t) {
		}
	}

	public static void initQR() {
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.ejml.Plugin").newInstance();
			if (p.isAvailable()) {
				QR_EJML = (QR) Class.forName("org.ujmp.ejml.calculation.QR").newInstance();
			}
		} catch (Throwable t) {
		}
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.ojalgo.Plugin")
					.newInstance();
			if (p.isAvailable()) {
				QR_OJALGO = (QR) Class.forName("org.ujmp.ojalgo.calculation.QR")
						.newInstance();
			}
		} catch (Throwable t) {
		}
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.mtj.Plugin").newInstance();
			if (p.isAvailable()) {
				QR_MTJ = (QR) Class.forName("org.ujmp.mtj.calculation.QR").newInstance();
			}
		} catch (Throwable t) {
		}
	}

	public static void initChol() {
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.ejml.Plugin").newInstance();
			if (p.isAvailable()) {
				CHOL_EJML = (Chol) Class.forName("org.ujmp.ejml.calculation.Chol")
						.newInstance();
			}
		} catch (Throwable t) {
		}
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.ojalgo.Plugin")
					.newInstance();
			if (p.isAvailable()) {
				CHOL_OJALGO = (Chol) Class.forName("org.ujmp.ojalgo.calculation.Chol")
						.newInstance();
			}
		} catch (Throwable t) {
		}
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.mtj.Plugin").newInstance();
			if (p.isAvailable()) {
				CHOL_MTJ = (Chol) Class.forName("org.ujmp.mtj.calculation.Chol")
						.newInstance();
			}
		} catch (Throwable t) {
		}
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.jblas.Plugin")
					.newInstance();
			if (p.isAvailable()) {
				CHOL_JBLAS = (Chol) Class.forName("org.ujmp.jblas.calculation.Chol")
						.newInstance();
			}
		} catch (Throwable t) {
		}
	}

	public static void initEig() {
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.ejml.Plugin").newInstance();
			if (p.isAvailable()) {
				EIG_EJML = (Eig) Class.forName("org.ujmp.ejml.calculation.Eig")
						.newInstance();
			}
		} catch (Throwable t) {
		}
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.ojalgo.Plugin")
					.newInstance();
			if (p.isAvailable()) {
				EIG_OJALGO = (Eig) Class.forName("org.ujmp.ojalgo.calculation.Eig")
						.newInstance();
			}
		} catch (Throwable t) {
		}
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.mtj.Plugin").newInstance();
			if (p.isAvailable()) {
				EIG_MTJ = (Eig) Class.forName("org.ujmp.mtj.calculation.Eig").newInstance();
			}
		} catch (Throwable t) {
		}
		try {
			AbstractPlugin p = (AbstractPlugin) Class.forName("org.ujmp.jblas.Plugin")
					.newInstance();
			if (p.isAvailable()) {
				EIG_JBLAS = (Eig) Class.forName("org.ujmp.jblas.calculation.Eig")
						.newInstance();
			}
		} catch (Throwable t) {
		}
	}

}

 

Ads help maintain this website.