/** * <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 MLInt64(String name, long[] vals, int m) { this(name, castToLong(vals), m); }
public Long buldFromBytes(byte[] bytes) { if (bytes.length != getBytesAllocated()) { throw new IllegalArgumentException( "To build from byte array I need array of size: " + getBytesAllocated()); } return ByteBuffer.wrap(bytes).getLong(); }
MLInt64 timestamp = new MLInt64("timestamp", new int[] { elements, 1 }); MLDouble robotTime = new MLDouble("robotTime", new int[] { elements, 1 }); timestamp.setReal(entryTimestamp, i - startPosition); robotTime.setReal(Conversions.nanosecondsToSeconds(entryTimestamp - firstTimestamp), i - startPosition);
/** * <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 MLInt64(String name, long[][] vals) { this(name, long2DToLong(vals), vals.length); }
MLInt64 timestamp = new MLInt64("timestamp", new int[] { elements, 1 }); MLDouble robotTime = new MLDouble("robotTime", new int[] { elements, 1 }); timestamp.setReal(entryTimestamp, i - startPosition); robotTime.setReal(TimeTools.nanoSecondstoSeconds(entryTimestamp - firstTimestamp), i - startPosition);
/** * <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 MLInt64(String name, long[][] vals) { this(name, long2DToLong(vals), vals.length); }
matarr.set((double) idf.Twf, wordI, 1); MLInt64 tfMat = new MLInt64(String.format("tf_%d", timeslot.get()), new long[][] { new long[] { tf } }); MLInt64 TtfMat = new MLInt64(String.format("Ttf_%d", timeslot.get()), new long[][] { new long[] { Ttf } }); ArrayList<MLArray> list = new ArrayList<MLArray>(); list.add(tfMat);
MLInt64 timestamp = new MLInt64("timestamp", new int[] { elements, 1 }); MLDouble robotTime = new MLDouble("robotTime", new int[] { elements, 1 }); timestamp.setReal(entryTimestamp, i - startPosition); robotTime.setReal(TimeTools.nanoSecondstoSeconds(entryTimestamp - firstTimestamp), i - startPosition);
public Long buldFromBytes(byte[] bytes) { if ( bytes.length != getBytesAllocated() ) { throw new IllegalArgumentException( "To build from byte array I need array of size: " + getBytesAllocated() ); } return ByteBuffer.wrap( bytes ).getLong(); } public int getBytesAllocated()
/** * <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 MLInt64(String name, long[] vals, int m) { this(name, castToLong(vals), m); }
/** * <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 MLInt64( String name, long[][] vals ) { this( name, long2DToLong(vals), vals.length ); } /**
matarr.set((double) idf.Twf, wordI, 1); MLInt64 tfMat = new MLInt64(String.format("tf_%d", timeslot.get()), new long[][] { new long[] { tf } }); MLInt64 TtfMat = new MLInt64(String.format("Ttf_%d", timeslot.get()), new long[][] { new long[] { Ttf } }); ArrayList<MLArray> list = new ArrayList<MLArray>(); list.add(tfMat);
/** * Gets two-dimensional real array. * * @return - 2D real array */ public long[][] getArray(){ final int M = getM(); final int N = getN(); long[][] result = new long[M][]; for ( int m = 0; m < M; m++ ) { result[m] = new long[N]; for ( int n = 0; n < N; n++ ) { result[m][n] = getReal(m,n); } } return result; } /**
public Long buldFromBytes(byte[] bytes) { if ( bytes.length != getBytesAllocated() ) { throw new IllegalArgumentException( "To build from byte array I need array of size: " + getBytesAllocated() ); } return ByteBuffer.wrap( bytes ).getLong(); } public int getBytesAllocated()
/** * <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 MLInt64(String name, long[] vals, int m) { this(name, castToLong( vals ), m ); } /**
/** * <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 MLInt64( String name, long[][] vals ) { this( name, long2DToLong(vals), vals.length ); } /**