org.lsmp.djep.jama.JamaUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jep Show documentation
Show all versions of jep Show documentation
JEP is a Java library for parsing and evaluating mathematical expressions.
The newest version!
/* @author rich
* Created on 15-Feb-2005
*
* See LICENSE.txt for license information.
*/
package org.lsmp.djep.jama;
import org.lsmp.djep.vectorJep.values.*;
import org.nfunk.jep.*;
/**
* Utility functions for adding Jama matrix functions.
* To add these functions to a VectorJep or MatrixJep instance use
*
* VectorJep j = new VectorJep();
* j.addStandardFunctions();
* ...
* JamaUtil.addStandardFunctions(j);
*
*
* @author Rich Morris
* Created on 15-Feb-2005
* @see http://math.nist.gov/javanumerics/jama/
*/
public final class JamaUtil
{
public static Jama.Matrix toJama(Matrix m) throws ParseException
{
int rows = m.getNumRows();
int cols = m.getNumCols();
Object data[][] = m.getEles();
double A[][] = new double[rows][cols];
for(int i=0;i