/** * <a href="http://math.nist.gov/javanumerics/jama/">Jama</a> [math.nist.gov] style: * construct a 2D real matrix from <code>byte[][]</code> * * Note: array is converted to Byte[] * * @param name - array name * @param vals - two-dimensional array of values */ public MLInt8(String name, byte[][] vals) { this(name, byte2DToByte(vals), vals.length); }
/** * <a href="http://math.nist.gov/javanumerics/jama/">Jama</a> [math.nist.gov] style: * construct a matrix from a one-dimensional packed array * * @param name - array name * @param vals - One-dimensional array of doubles, packed by columns (ala Fortran). * @param m - Number of rows */ public MLInt8(String name, byte[] vals, int m) { this(name, castToByte(vals), m); }
public Byte buldFromBytes(byte[] bytes) { if ( bytes.length != getBytesAllocated() ) { throw new IllegalArgumentException( "To build from byte array I need array of size: " + getBytesAllocated() ); } return bytes[0]; } public byte[] getByteArray(Byte value)
mlArray = new MLInt8(name, dims, type, attributes);
mlArray = new MLInt8(name, dims, type, attributes);
public Byte buldFromBytes(byte[] bytes) { if (bytes.length != getBytesAllocated()) { throw new IllegalArgumentException( "To build from byte array I need array of size: " + getBytesAllocated()); } return bytes[0]; }
/** * <a href="http://math.nist.gov/javanumerics/jama/">Jama</a> [math.nist.gov] style: * construct a 2D real matrix from <code>byte[][]</code> * * Note: array is converted to Byte[] * * @param name - array name * @param vals - two-dimensional array of values */ public MLInt8(String name, byte[][] vals) { this(name, byte2DToByte(vals), vals.length); }
/** * <a href="http://math.nist.gov/javanumerics/jama/">Jama</a> [math.nist.gov] style: * construct a matrix from a one-dimensional packed array * * @param name - array name * @param vals - One-dimensional array of doubles, packed by columns (ala Fortran). * @param m - Number of rows */ public MLInt8(String name, byte[] vals, int m) { this(name, castToByte( vals ), m ); } /* (non-Javadoc)
mlArray = new MLInt8(name, dims, type, attributes);
/** * Gets two-dimensional real array. * * @return - 2D real array */ public byte[][] getArray() { final int M = getM(); final int N = getN(); byte[][] result = new byte[M][]; for ( int m = 0; m < M; m++ ){ result[m] = new byte[N]; for ( int n = 0; n < N; n++ ){ result[m][n] = getReal(m,n); } } return result; } /**
public Byte buldFromBytes(byte[] bytes) { if ( bytes.length != getBytesAllocated() ) { throw new IllegalArgumentException( "To build from byte array I need array of size: " + getBytesAllocated() ); } return bytes[0]; } public byte[] getByteArray(Byte value)
/** * <a href="http://math.nist.gov/javanumerics/jama/">Jama</a> [math.nist.gov] style: * construct a 2D real matrix from <code>byte[][]</code> * * Note: array is converted to Byte[] * * @param name - array name * @param vals - two-dimensional array of values */ public MLInt8( String name, byte[][] vals ) { this( name, byte2DToByte(vals), vals.length ); } /**
/** * <a href="http://math.nist.gov/javanumerics/jama/">Jama</a> [math.nist.gov] style: * construct a matrix from a one-dimensional packed array * * @param name - array name * @param vals - One-dimensional array of doubles, packed by columns (ala Fortran). * @param m - Number of rows */ public MLInt8(String name, byte[] vals, int m) { this(name, castToByte( vals ), m ); } /**
mlArray = new MLInt8(name, dims, type, attributes);
public Byte buldFromBytes(byte[] bytes) { if ( bytes.length != getBytesAllocated() ) { throw new IllegalArgumentException( "To build from byte array I need array of size: " + getBytesAllocated() ); } return bytes[0]; } public byte[] getByteArray(Byte value)
/** * <a href="http://math.nist.gov/javanumerics/jama/">Jama</a> [math.nist.gov] style: * construct a 2D real matrix from <code>byte[][]</code> * * Note: array is converted to Byte[] * * @param name - array name * @param vals - two-dimensional array of values */ public MLInt8( String name, byte[][] vals ) { this( name, byte2DToByte(vals), vals.length ); } /**