示例#1
0
  BASKER_INLINE
  int Basker<Int,Entry,Exe_Space>::Factor(Int nrow, Int ncol,
	        Int nnz, Int *col_ptr, Int *row_idx, Entry *val) 
  {
    
    int err = A.copy_values(nrow, ncol, nnz, col_ptr, row_idx, val);

    if(err == BASKER_ERROR)
      {
	return BASKER_ERROR;
      }
    //err = sfactor_copy();
    err = sfactor_copy2();
    //printf("Done with sfactor_copy: %d \n", err);
    if(err == BASKER_ERROR)
      {
	return BASKER_ERROR;
      }
    //printf("before notoken\n");
    err = factor_notoken(0);
    if(err == BASKER_ERROR)
      {
	return BASKER_ERROR;
      }

    
    //DEBUG_PRINT();

    return 0;

  }//end Factor()
示例#2
0
  BASKER_INLINE
  int Basker<Int, Entry, Exe_Space>::Factor(Int option)
  {
#ifdef BASKER_KOKKOS_TIME
    Kokkos::Impl::Timer timer;
#endif

    factor_notoken(option);

#ifdef BASKER_KOKKOS_TIME
    stats.time_nfactor += timer.seconds();
#endif

    // NDE
    MALLOC_ENTRY_1DARRAY(x_view_ptr_copy, gn); //used in basker_solve_rhs - move alloc
    MALLOC_ENTRY_1DARRAY(y_view_ptr_copy, gm);
    MALLOC_INT_1DARRAY(perm_inv_comp_array , gm); //y
    MALLOC_INT_1DARRAY(perm_comp_array, gn); //x

    MALLOC_INT_1DARRAY(perm_comp_iworkspace_array, gn); 
    MALLOC_ENTRY_1DARRAY(perm_comp_fworkspace_array, gn);
    permute_composition_for_solve();

    factor_flag = BASKER_TRUE;

    return 0;
  }//end Factor()
示例#3
0
 BASKER_INLINE
 int Basker<Int, Entry, Exe_Space>::Factor(Int option)
 {
   #ifdef BASKER_KOKKOS_TIME
   Kokkos::Impl::Timer timer;
   #endif
   
   factor_notoken(option);
   
   #ifdef BASKER_KOKKOS_TIME
   stats.time_nfactor += timer.seconds();
   #endif
   return 0;
 }//end Factor()
示例#4
0
  BASKER_INLINE
  int Basker<Int,Entry,Exe_Space>::Factor(Int nrow, Int ncol,
	        Int nnz, Int *col_ptr, Int *row_idx, Entry *val) 
  {
    int err = 0;

    if (Options.verbose == BASKER_TRUE)
    {
      std::cout << "Basker Factor Called" << std::endl;
      std::cout << "Matrix: " << nrow << " " << ncol << " " << nnz << std::endl;
    }

    /*
       int err = A.copy_values(nrow, ncol, nnz, col_ptr, 
       row_idx, val);
    */

    if((Options.same_pattern == BASKER_TRUE) && (Options.no_pivot == BASKER_FALSE))
    {
      printf("Warning: Same Pattern will not allow pivoting\n");
      Options.no_pivot = BASKER_TRUE;
    }


    if(Options.transpose == BASKER_FALSE)
    {
      //printf("=======NO TRANS=====\n");
      //A.init_matrix("Original Matrix",
      //	      nrow, ncol, nnz, col_ptr, row_idx, val);
      //A.scol = 0;
      //A.srow = 0;
      A.copy_values(nrow, ncol, nnz, col_ptr,
          row_idx, val);
      //printf("Copy done\n");
      //printMTX("A_LOAD.mtx", A);
    }
    else
    {
      //printf("======TRANS=====\n");
      //Will transpose and put in A using little extra
      matrix_transpose(0, 
          nrow,
          0, 
          ncol,
          nnz,
          col_ptr,
          row_idx,
          val,
          A);
    }
    sort_matrix(A);
    if(Options.verbose_matrix_out == BASKER_TRUE)
    {
      printMTX("A_Factor.mtx", A);
    }

    matrix_flag = BASKER_TRUE;

    if(err == BASKER_ERROR)
    {
      return BASKER_ERROR;
    }
    //err = sfactor_copy();
    err = sfactor_copy2();
    if (Options.verbose == BASKER_TRUE)
    {
      printf("Basker Copy Structure Done \n");
    }

    //printf("Done with sfactor_copy: %d \n", err);
    if(err == BASKER_ERROR)
    {
      return BASKER_ERROR;
    }
    //printf("before notoken\n");

    //Kokkos::Impl::Timer timer;

    if(Options.incomplete == BASKER_FALSE)    
    {
      err = factor_notoken(0);
      //printf("Notoken called\n");
    }
    else
    {
      err = factor_inc_lvl(0);
    }
    if(err == BASKER_ERROR)
    {
      return BASKER_ERROR;
    }

    if(Options.verbose == BASKER_TRUE)
    {
      printf("Basker Factor Done \n");
    }

    /*
       std::cout << "Raw Factor Time: "
       << timer.seconds()
       << std::endl;
       */

    //DEBUG_PRINT();

    // NDE
    MALLOC_ENTRY_1DARRAY(x_view_ptr_copy, gn); //used in basker_solve_rhs - move alloc
    MALLOC_ENTRY_1DARRAY(y_view_ptr_copy, gm);
    MALLOC_INT_1DARRAY(perm_inv_comp_array , gm); //y
    MALLOC_INT_1DARRAY(perm_comp_array, gn); //x

    MALLOC_INT_1DARRAY(perm_comp_iworkspace_array, gn);
    MALLOC_ENTRY_1DARRAY(perm_comp_fworkspace_array, gn);
    permute_composition_for_solve();

    factor_flag = BASKER_TRUE;

    return 0;
  }//end Factor()