Exemplo n.º 1
0
 public static RealMatrix randMatrix(int rows, int cols) {
   RealMatrix res = MathFactory.createRealMatrix(rows, cols);
   for (int i = 0; i < rows; i++) {
     res.setRow(i, randVector(cols).getData());
   }
   return res;
 }
Exemplo n.º 2
0
 public static RealVector randVector(int dim) {
   Random r = new Random();
   r.setSeed(System.currentTimeMillis());
   RealVector res = MathFactory.createRealVector(dim);
   for (int i = 0; i < dim; i++) {
     res.setEntry(i, r.nextDouble());
   }
   return res;
 }
Exemplo n.º 3
0
 /* (非 Javadoc)
  * @see jp.ac.ritsumei.is.hpcss.cellMLonGPU.mathML.MathFactor#createCopy()
  */
 public MathFactor createCopy() throws MathException {
   return MathFactory.createOperand(m_operandKind, m_strPresentText, m_dValue);
 }