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

com.asher_stern.crf.utilities.VectorUtilities Maven / Gradle / Ivy

Go to download

Implementation of linear-chain Conditional Random Fields (CRF) in pure Java

There is a newer version: 1.2.0
Show newest version
package com.asher_stern.crf.utilities;

/**
 * A collection of linear algebra functions over vectors.
 * 
 * @author Asher Stern
 * Date: Nov 7, 2014
 *
 */
public class VectorUtilities
{
	/**
	 * Returns the inner product of the two given vectors.
	 * @param rowVector
	 * @param columnVector
	 * @return
	 */
	public static double product(double[] rowVector, double[] columnVector)
	{
		if (rowVector.length!=columnVector.length) throw new CrfException("Cannot multiply vector of different sizes.");
		double ret = 0.0;
		for (int i=0;i




© 2015 - 2024 Weber Informatics LLC | Privacy Policy