001/*
002 * $Id$
003 */
004
005package edu.jas.structure;
006
007
008import java.util.List;
009
010
011/**
012 * Algebra factory interface. Defines conversion from list of lists and sparse
013 * random.
014 * @param <A> algebra type
015 * @param <C> coefficient type
016 * @author Heinz Kredel
017 */
018public interface AlgebraFactory<A extends AlgebraElem<A, C>, C extends RingElem<C>> extends RingFactory<A> {
019
020
021    /**
022     * Convert list of list to matrix.
023     * @param m list of list of ring elements.
024     * @return a matrix with the elements from m.
025     */
026    public A fromList(List<List<C>> m);
027
028
029    /**
030     * Random Matrix.
031     * @param k size of coefficients.
032     * @param q fraction of non zero elements.
033     * @return a random matrix.
034     */
035    public A random(int k, float q);
036
037}