Package weka.core.matrix

Examples of weka.core.matrix.FlexibleDecimalFormat


   * Converts the discrete function to string.
   */
  public String  toString()
  {
    StringBuffer text = new StringBuffer();
    FlexibleDecimalFormat nf1 = new FlexibleDecimalFormat( 5 );
    nf1.grouping( true );
    FlexibleDecimalFormat nf2 = new FlexibleDecimalFormat( 5 );
    nf2.grouping( true );
    for(int i = 0; i < size(); i++) {
      nf1.update( points.get(i) );
      nf2.update( values.get(i) );
    }

    text.append("\t" + nf1.formatString("Points") +
    "\t" + nf2.formatString("Values") + "\n\n");
    for(int i = 0; i <= size() - 1; i++) {
      text.append( "\t" + nf1.format( points.get(i) ) + "\t" +
       nf2.format( values.get(i) ) + "\n" );
    }
 
    return text.toString();
  }
View Full Code Here


   @param trailing
   *  @return the decimal format
   */
  protected DecimalFormat  format(int i0, int i1, int j, int digits,
          boolean trailing) {
    FlexibleDecimalFormat df = new FlexibleDecimalFormat(digits, trailing);
    df.grouping( true );
    for(int i = i0; i <= i1; i ++ )
      df.update( A[i][j] );
    return df;
  }
View Full Code Here

TOP

Related Classes of weka.core.matrix.FlexibleDecimalFormat

Copyright © 2018 www.massapicom. 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.