Package cern.colt.matrix

Examples of cern.colt.matrix.DoubleMatrix2D.rows()


  {
    final DoubleMatrix2D matrix = DoubleFactory2D.sparse.make(size,size);
    matrix.assign(randomGenerator);
    final DoubleMatrix1D b = DoubleFactory1D.dense.make(size);
    b.assign(randomGenerator);
    final LSolver solver = new LSolver(matrix,DoubleFactory1D.dense.make(matrix.rows(), 0));

    boolean singular = false;
    try
    {
      solver.solveExternally();
View Full Code Here


    if (!singular)
      TestSolver.verifyAxb(solver);
   
    LUDecompositionQuick coltSolver = new LUDecompositionQuick();
    coltSolver.decompose(matrix);coltSolver.setLU(matrix);
    DoubleMatrix1D vector = DoubleFactory1D.dense.make(matrix.rows(), 0);
   
    try
    {
      coltSolver.solve(vector);
    }
View Full Code Here

        throw ex;
    }

    if (!singular)
    {
      for(int i=0;i<matrix.rows();++i)
        Assert.assertEquals(solver.j_x[i], vector.getQuick(i),Configuration.fpAccuracy);
      TestSolver.verifyAxb(matrix,solver.toDoubleMatrix1D(),vector);
    }
   
    try
View Full Code Here

      TestSolver.verifyAxb(matrix,solver.toDoubleMatrix1D(),vector);
    }
   
    try
    {
      for(int i=0;i<matrix.rows();++i) solver.j_x[i]=0;
      solver.solveUsingColt();
    }
    catch(IllegalArgumentException ex)
    {
      if (ex.getMessage().contains("singular"))
View Full Code Here

        throw ex;
    }
   
    if (!singular)
    {
      for(int i=0;i<matrix.rows();++i)
        Assert.assertEquals(solver.j_x[i], vector.getQuick(i),Configuration.fpAccuracy);
      TestSolver.verifyAxb(solver);
    }
  }
}
View Full Code Here

   
    tmStarted = new Date().getTime();
    solver.solveExternally();
    tmFinished = new Date().getTime();
    System.out.println(" time taken: "+((double)tmFinished-tmStarted)/1000);   
    for(int i=0;i<matrix.rows();++i)
      Assert.assertEquals(solver.j_x[i], vector.getQuick(i),comparisonAccuracy);
    verifyAxb(solver);
  }

  /** Builds a sparse random matrix for the solver. I have to use this for large
View Full Code Here

  {
    DoubleMatrix2D matrix = solver.toDoubleMatrix2D();
    DoubleMatrix1D b = solver.toDoubleMatrix1D();
    StringBuffer result = new StringBuffer();
   
    for(int row=0;row<matrix.rows();++row)
    {
      int indexRow = findIndexOf(incompatiblePairs, row);
      assert indexRow >= 0;
      PairScore pairRow = getPairScore(indexRow, 0,0);
     
View Full Code Here

  {
    final DoubleMatrix2D matrix = DoubleFactory2D.sparse.make(size,size);
    matrix.assign(randomGenerator);
    final DoubleMatrix1D b = DoubleFactory1D.dense.make(size);
    b.assign(randomGenerator);
    final LSolver solver = new LSolver(matrix,DoubleFactory1D.dense.make(matrix.rows(), 0));

    boolean singular = false;
    try
    {
      solver.solveExternally(1);
View Full Code Here

    if (!singular)
      TestSolver.verifyAxb(solver);
   
    LUDecompositionQuick coltSolver = new LUDecompositionQuick();
    coltSolver.decompose(matrix);coltSolver.setLU(matrix);
    DoubleMatrix1D vector = DoubleFactory1D.dense.make(matrix.rows(), 0);
   
    try
    {
      coltSolver.solve(vector);
    }
View Full Code Here

        throw ex;
    }

    if (!singular)
    {
      for(int i=0;i<matrix.rows();++i)
        Assert.assertEquals(solver.j_x[i], vector.getQuick(i),Configuration.fpAccuracy);
      TestSolver.verifyAxb(matrix,solver.toDoubleMatrix1D(),vector);
    }
   
    try
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.