package ec.gp.semantic.geometry;

import Jama.Matrix;
import ec.Setup;
import ec.gp.semantic.ISemantics;
import ec.gp.semantic.func.SimpleNodeBase;

import java.util.List;

/**
 * @author Tomasz Pawlak
 */
public interface IBasisProcessor extends Setup {

	/**
	 * Makes matrix of semantics for given list of programs. Each semantics in one column.
	 *
	 * @param programs
	 * @return
	 */
	Matrix getMatrix(List<SimpleNodeBase<?>> programs);

	/**
	 * Determines basis in list of semantics of given programs. If semantics is not part of basis, it is removed
	 * from the list.
	 *
	 * @param programs
	 */
	void extractBasis(List<SimpleNodeBase<?>> programs);

	boolean isInFeasibleRange(ISemantics semantics);


	/**
	 * Linearly combines given programs, such that the semantics of the combination is equal to semantics of target.
	 *
	 * @param target
	 * @param basis
	 * @return
	 */
	SimpleNodeBase<?> makeLinearCombination(ISemantics target, List<SimpleNodeBase<?>> basis);
}
