001    package calhoun.analysis.crf.test.slow;
002    
003    import java.util.ArrayList;
004    
005    import org.apache.commons.logging.Log;
006    import org.apache.commons.logging.LogFactory;
007    
008    import calhoun.analysis.crf.features.supporting.MaxentMotifModel;
009    import calhoun.analysis.crf.test.CRFIOTest;
010    import calhoun.util.AbstractTestCase;
011    
012    public class SlowTestMaxentMotifModel extends AbstractTestCase {
013            private static final Log log = LogFactory.getLog(CRFIOTest.class);
014            boolean debug = log.isDebugEnabled();
015            
016            public void testSlowMaxentModel() throws Exception {
017                    ArrayList<int[]> motifExamples = new ArrayList<int[]>();
018                    motifExamples.add(new int[]{0,0,0,0,0,0,0,0,0,0,0});
019                    //motifExamples.add(new int[]{1,1,0});
020                    //motifExamples.add(new int[]{1,0,1});
021                    //motifExamples.add(new int[]{0,1,1});
022                    motifExamples.add(new int[]{1,1,1,1,1,1,1,1,1,1,1});
023                    
024                    double[] pp = MaxentMotifModel.trainMaxentDistributionUsingAllPairwiseConstraints(motifExamples,11,30,1.0);
025                    
026                    assertEquals(pp.length,4194304);        
027            }
028    
029    }