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