Package main

Class MatrixLoader


  • public class MatrixLoader
    extends java.lang.Object
    Utilidades para cargar y leer archivos csv y convertirlos a matrices de float.

    Los arhivos csv necesariamente debe estar separados por , y no contener espacios entre los datos.

    Author:
    Toyos,Vallcorba
    • Constructor Summary

      Constructors 
      Constructor Description
      MatrixLoader()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static float[][] readCSV​(java.lang.String url)
      Lee una matriz y la carga en un arreglo de floats
      static float[] slice​(int x, float[] m)  
      static float[][] slice​(int x, int y, float[][] m)  
      static void writeCSV​(float[][] m, java.lang.String fileName)
      Permite escribir un arreglo de floats en un archivo csv.
      static void writeCSV​(float[] m, java.lang.String fileName)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MatrixLoader

        public MatrixLoader()
    • Method Detail

      • readCSV

        public static float[][] readCSV​(java.lang.String url)
                                 throws java.io.IOException
        Lee una matriz y la carga en un arreglo de floats
        Parameters:
        url - : path del archivo a leer
        Returns:
        arreglo 2d correspondiente a la matriz leĆ­da.
        Throws:
        java.io.IOException
      • writeCSV

        public static void writeCSV​(float[][] m,
                                    java.lang.String fileName)
        Permite escribir un arreglo de floats en un archivo csv.
        Parameters:
        m - : arreglo a persistir
        fileName - : nombre del archivo a crear
      • writeCSV

        public static void writeCSV​(float[] m,
                                    java.lang.String fileName)
      • slice

        public static float[][] slice​(int x,
                                      int y,
                                      float[][] m)
      • slice

        public static float[] slice​(int x,
                                    float[] m)