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

de.citec.tcs.alignment.DerivableAlignmentDistance Maven / Gradle / Ivy

/* 
 * TCS Alignment Toolbox Version 3
 * 
 * Copyright (C) 2016
 * Benjamin Paaßen
 * AG Theoretical Computer Science
 * Centre of Excellence Cognitive Interaction Technology (CITEC)
 * University of Bielefeld
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 * 
 * This program 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 Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see .
 */

package de.citec.tcs.alignment;

import de.citec.tcs.alignment.comparators.DerivableComparator;
import java.util.List;
import lombok.NonNull;

/**
 * This is an interface to provide calculation methods for the gradient of an
 * alignment w.r.t. a specific comparator.
 *
 * Please note that this is an interface to be implemented by the results of AlignmentAlgorithms,
 * not the algorithms itself. For example the result of the StrictAlignmentFullAlgorithm is an
 * Alignment, which is an DerivableAlignmentDistance, because the AlignmentPath contains the
 * necessary information to calculate the gradient.
 *
 * @author Benjamin Paassen - bpaassen(at)techfak.uni-bielefeld.de
 * @param  the class of the elements in the left input sequence.
 * @param  the class of the elements in the right input sequence.
 */
public interface DerivableAlignmentDistance {

	/**
	 * This computes the gradient of this DerivableAlignmentDistance w.r.t. the parameters of the
	 * given Comparator.
	 *
	 * @param comp the DerivableComparator that was used in computing this distance.
	 *
	 * @return the derivatives for all parameters of the given comparator.
	 */
	public double[] computeGradient(@NonNull DerivableComparator comp);

	/**
	 * Returns the distance between the two input sequences.
	 *
	 * @return the distance between the two input sequences.
	 */
	public double getDistance();

	/**
	 * Returns the left sequence of this distance.
	 *
	 * @return the left sequence of this distance.
	 */
	public List getLeft();

	/**
	 * Returns the right sequence of this distance.
	 *
	 * @return the right sequence of this distance.
	 */
	public List getRight();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy