Examples of Gray


Examples of com.nr.lna.Gray

    // Test Gray
    System.out.println("Testing Gray");

    Ran myran = new Ran(17);
    Gray g=new Gray();
    for (i=0;i<N;i++) {
      j=myran.int32();
      k=g.gray(j);
      m=g.gray(j+1);
      p = m ^ k;    // p should be a power of 2 (i.e. 1 bit set)
//      System.out.printf(k << " %f\n", m << " %f\n", p);
      localflag = localflag || (p & (p-1)) != 0// test for a power of 2
    }
    globalflag = globalflag || localflag;
    if (localflag) {
      fail("*** Gray: Gray code gave a value that differed from argument in more than 1 bit position");
     
    }

    // Test invgray
    System.out.println("Testing invgray");
    for (i=0;i<N;i++) {
      j=myran.int32();
      k=g.gray(j);
      m=g.invgray(k);
//      System.out.printf(j << " %f\n", m);
      localflag = localflag || (m != j);
    }
    globalflag = globalflag || localflag;
    if (localflag) {
      fail("*** Gray: Round trip test of gray() and invgray() did not lead back to origial integer");
     
    }

    // See if all values are being used
    int[] map=new int[8192];
    for (i=0;i<8192;i++) map[g.gray(i)]=1;
    localflag=false;
    for (i=0;i<8192;i++)
      localflag = localflag || map[i] != 1;
    globalflag = globalflag || localflag;
    if (localflag) {
View Full Code Here

Examples of org.aiotrade.lib.charting.laf.Gray

        } else if (lafStr.equalsIgnoreCase("City Lights")) {
            laf = new CityLights();
        } else if (lafStr.equalsIgnoreCase("Modern")) {
            laf = new Modern();
        } else {
            laf = new Gray();
        }
        LookFeel.update(laf);
       
        QuoteChart.Type type = (QuoteChart.Type)optionsPanel.quoteChartTypeBox.getSelectedItem();
        LookFeel.apply().setQuoteChartType(type);
View Full Code Here

Examples of org.aiotrade.lib.charting.laf.Gray

            } else if (lafStr.equalsIgnoreCase("City Lights")) {
                laf = new CityLights();
            } else if (lafStr.equalsIgnoreCase("Modern")) {
                laf = new Modern();
            } else {
                laf = new Gray();
            }
            LookFeel.update(laf);

            boolean reversedPositiveNegativeColor = reverseColorBox.isSelected();
            LookFeel.apply().setPositiveNegativeColorReversed(reversedPositiveNegativeColor);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.