All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gov.sandia.cognition.math.matrix.mtj.DenseMatrixFactoryMTJ Maven / Gradle / Ivy

There is a newer version: 4.0.1
Show newest version
/*
 * File:                DenseMatrixFactoryMTJ.java
 * Authors:             Kevin R. Dixon
 * Company:             Sandia National Laboratories
 * Project:             Cognitive Foundry
 *
 * Copyright May 18, 2007, Sandia Corporation.  Under the terms of Contract
 * DE-AC04-94AL85000, there is a non-exclusive license for use of this work by
 * or on behalf of the U.S. Government. Export of this program may require a
 * license from the United States Government. See CopyrightHistory.txt for
 * complete details.
 *
 */

package gov.sandia.cognition.math.matrix.mtj;

import gov.sandia.cognition.math.matrix.Matrix;
import gov.sandia.cognition.math.matrix.MatrixFactory;

/**
 * MatrixFactory for creating MTJ's DenseMatrix-based Matrix
 *
 * @author Kevin R. Dixon
 * @since  1.0
 *
 */
public class DenseMatrixFactoryMTJ
    extends MatrixFactory
{
    
    /**
     * Default instance of this
     */
    public static final DenseMatrixFactoryMTJ INSTANCE = 
        new DenseMatrixFactoryMTJ();
    
    /**
     * Creates a new instance of DenseMatrixFactoryMTJ
     */
    public DenseMatrixFactoryMTJ()
    {
        super();
    }

    public DenseMatrix copyMatrix(
        Matrix m)
    {
        return new DenseMatrix( m );
    }

    public DenseMatrix createMatrix(
        int numRows,
        int numColumns)
    {
        return new DenseMatrix( numRows, numColumns );
    }
    
    /**
     * Creates a new wrapper for a dense MTJ matrix.
     * 
     * @param internalMatrix The MTJ matrix to wrap.
     * @return A wrapper of the given MTJ matrix.
     */
    public DenseMatrix createWrapper(
        final no.uib.cipr.matrix.DenseMatrix internalMatrix)
    {
        return new DenseMatrix(internalMatrix);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy