Package ca.nengo.util.MU

Examples of ca.nengo.util.MU.MatrixExpander


   *            this string
   * @return The matrix represented by the string
   */
  public static float[][] fromString(String s, char colDelim, String rowDelim) {
    String colDelimString = String.valueOf(colDelim);
    MatrixExpander result = new MatrixExpander();

    StringTokenizer rowTokenizer = new StringTokenizer(s, rowDelim, false);
    while (rowTokenizer.hasMoreTokens()) {
      StringTokenizer elemTokenizer = new StringTokenizer(rowTokenizer.nextToken(),
          colDelimString, false);
      VectorExpander row = new VectorExpander();
      while (elemTokenizer.hasMoreTokens()) {
        row.add(Float.parseFloat(elemTokenizer.nextToken()));
      }
      result.add(row.toArray());
    }
    return result.toArray();
  }
View Full Code Here

TOP

Related Classes of ca.nengo.util.MU.MatrixExpander

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.