Example usage for org.apache.commons.math3.complex ComplexFormat format

List of usage examples for org.apache.commons.math3.complex ComplexFormat format

Introduction

In this page you can find the example usage for org.apache.commons.math3.complex ComplexFormat format.

Prototype

public String format(Double c) 

Source Link

Document

This method calls #format(Object,StringBuffer,FieldPosition) .

Usage

From source file:net.sf.dsp4j.octave.packages.signal_1_0_11.SfTrans.java

public static void addComplexArray(StringBuilder sb, ComplexFormat cf, String name, Complex[] arr) {
    sb.append(name);// w  ww.  j  a va2s  .  co  m
    sb.append(" = [");
    for (int i = 0; i < arr.length; i++) {
        sb.append(cf.format(arr[i]));
        if (i < arr.length - 1) {
            sb.append(", ");
        }
    }
    sb.append("]");

}