![JAR search and dependency download from the Maven repository](/logo.png)
com.asher_stern.crf.utilities.VectorUtilities Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of CRF Show documentation
Show all versions of CRF Show documentation
Implementation of linear-chain Conditional Random Fields (CRF) in pure Java
The newest version!
package com.asher_stern.crf.utilities;
import static com.asher_stern.crf.utilities.ArithmeticUtilities.*;
import java.math.BigDecimal;
/**
* 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 BigDecimal product(BigDecimal[] rowVector, BigDecimal[] columnVector)
{
if (rowVector.length!=columnVector.length) throw new CrfException("Cannot multiply vector of different sizes.");
BigDecimal ret = BigDecimal.ZERO;
for (int i=0;i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy