org.netlib.util
Class MatConv

java.lang.Object
  extended by org.netlib.util.MatConv

public class MatConv
extends java.lang.Object

Conversions between one-dimensional linearized arrays and two-dimensional arays.

This file is part of the Fortran-to-Java (f2j) system, developed at the University of Tennessee.

This class contains methods for converting between the linearized arrays used by f2j-generated code and the more natural Java-style two-dimensional arrays.

Author:
Keith Seymour (seymour@cs.utk.edu)

Constructor Summary
MatConv()
           
 
Method Summary
static void copyOneDintoTwoD(double[][] mat, double[] vec)
          Copies a linearized array into an already allocated two-dimensional matrix.
static void copyOneDintoTwoD(float[][] mat, float[] vec)
          Copies a linearized array into an already allocated two-dimensional matrix.
static void copyOneDintoTwoD(int[][] mat, int[] vec)
          Copies a linearized array into an already allocated two-dimensional matrix.
static double[][] doubleOneDtoTwoD(double[] vec, int ld)
          Convert a double precision linearized one-dimensional array to a two-dimensional array.
static double[] doubleTwoDtoOneD(double[][] m)
          Convert a double precision two-dimensional array to a linearized one-dimensional array.
static float[][] floatOneDtoTwoD(float[] vec, int ld)
          Convert a single precision linearized one-dimensional array to a two-dimensional array.
static float[] floatTwoDtoOneD(float[][] m)
          Convert a single precision two-dimensional array to a linearized one-dimensional array.
static int[][] intOneDtoTwoD(int[] vec, int ld)
          Convert an integer linearized one-dimensional array to a two-dimensional array.
static int[] intTwoDtoOneD(int[][] m)
          Convert an integer two-dimensional array to a linearized one-dimensional array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatConv

public MatConv()
Method Detail

doubleTwoDtoOneD

public static double[] doubleTwoDtoOneD(double[][] m)
Convert a double precision two-dimensional array to a linearized one-dimensional array.

Parameters:
m - the matrix to be converted
Returns:
the linearized array

doubleOneDtoTwoD

public static double[][] doubleOneDtoTwoD(double[] vec,
                                          int ld)
Convert a double precision linearized one-dimensional array to a two-dimensional array.

Parameters:
vec - the linearized array to be converted
ld - leading dimension of the array
Returns:
the two-dimensional array

floatTwoDtoOneD

public static float[] floatTwoDtoOneD(float[][] m)
Convert a single precision two-dimensional array to a linearized one-dimensional array.

Parameters:
m - the matrix to be converted
Returns:
the linearized array

floatOneDtoTwoD

public static float[][] floatOneDtoTwoD(float[] vec,
                                        int ld)
Convert a single precision linearized one-dimensional array to a two-dimensional array.

Parameters:
vec - the linearized array to be converted
ld - leading dimension of the array
Returns:
the two-dimensional array

intTwoDtoOneD

public static int[] intTwoDtoOneD(int[][] m)
Convert an integer two-dimensional array to a linearized one-dimensional array.

Parameters:
m - the matrix to be converted
Returns:
the linearized array

intOneDtoTwoD

public static int[][] intOneDtoTwoD(int[] vec,
                                    int ld)
Convert an integer linearized one-dimensional array to a two-dimensional array.

Parameters:
vec - the linearized array to be converted
ld - leading dimension of the array
Returns:
the two-dimensional array

copyOneDintoTwoD

public static void copyOneDintoTwoD(double[][] mat,
                                    double[] vec)
Copies a linearized array into an already allocated two-dimensional matrix. This is typically called from the simplified wrappers after the raw routine has been called and the results need to be copied back into the Java-style two-dimensional matrix.

Parameters:
mat - destination matrix
vec - source array

copyOneDintoTwoD

public static void copyOneDintoTwoD(float[][] mat,
                                    float[] vec)
Copies a linearized array into an already allocated two-dimensional matrix. This is typically called from the simplified wrappers after the raw routine has been called and the results need to be copied back into the Java-style two-dimensional matrix.

Parameters:
mat - destination matrix
vec - source array

copyOneDintoTwoD

public static void copyOneDintoTwoD(int[][] mat,
                                    int[] vec)
Copies a linearized array into an already allocated two-dimensional matrix. This is typically called from the simplified wrappers after the raw routine has been called and the results need to be copied back into the Java-style two-dimensional matrix.

Parameters:
mat - destination matrix
vec - source array