Pastix.cxx
1 // Copyright (C) 2001-2010 Marc DuruflĂ©
2 //
3 // This file is part of the linear-algebra library Seldon,
4 // http://seldon.sourceforge.net/.
5 //
6 // Seldon is free software; you can redistribute it and/or modify it under the
7 // terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 2.1 of the License, or (at your option)
9 // any later version.
10 //
11 // Seldon is distributed in the hope that it will be useful, but WITHOUT ANY
12 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
14 // more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public License
17 // along with Seldon. If not, see http://www.gnu.org/licenses/.
18 
19 #ifndef SELDON_FILE_PASTIX_CXX
20 
21 #include "Pastix.hxx"
22 
23 namespace Seldon
24 {
25 
27  template<class T>
29  {
30  comm_ = MPI_COMM_WORLD;
31  pastix_data = NULL;
32  spm = NULL;
33  n = 0;
34  for (int i = 0; i < IPARM_SIZE; i++)
35  iparm[i] = 0;
36 
37  for (int i = 0; i < DPARM_SIZE; i++)
38  dparm[i] = 0;
39 
40  // Factorization of a matrix on a single processor.
41  distributed = false;
42 
43  // No refinement by default.
44  refine_solution = false;
45 
46  // initializing parameters
47  pastixInitParam(iparm, dparm);
48  spm = (spmatrix_t*)malloc(sizeof(spmatrix_t));
49 
50  iparm[IPARM_VERBOSE] = PastixVerboseNot;
51  iparm[IPARM_FREE_CSCUSER] = 1;
52 
53  threshold_pivot = 0.0;
54  adjust_threshold_pivot = false;
55  cholesky = false;
56  }
57 
58 
60  template<class T>
62  {
63  Clear();
64  free(spm);
65  }
66 
67 
68  template<class T>
69  bool MatrixPastix<T>::UseInteger8() const
70  {
71  if (sizeof(pastix_int_t) == 8)
72  return true;
73 
74  return false;
75  }
76 
77 
79  template<class T>
81  {
82  if (n > 0)
83  {
84  pastixFinalize(&pastix_data);
85  spmExit(spm);
86  n = 0;
87  pastix_data = NULL;
88  distributed = false;
89  }
90  }
91 
92 
94  template<class T>
96  {
97  iparm[IPARM_VERBOSE] = PastixVerboseNot;
98  }
99 
100 
102  template<class T>
104  {
105  iparm[IPARM_VERBOSE] = PastixVerboseNo;
106  }
107 
108 
110  template<class T>
112  {
113  iparm[IPARM_VERBOSE] = PastixVerboseYes;
114  }
115 
116 
118  template<class T>
120  {
121  iparm[IPARM_ORDERING] = type;
122  }
123 
124 
126  template<class T>
128  {
129  iparm[IPARM_ORDERING] = PastixOrderPersonal;
130  pastixOrderAlloc(&ord, permut.GetM(), 0);
131  for (int i = 0; i < permut.GetM(); i++)
132  {
133  ord.permtab[i] = permut(i);
134  ord.peritab[permut(i)] = i;
135  }
136  }
137 
138 
140  template<class T>
142  {
143  cholesky = chol;
144  }
145 
146 
148  template<class T>
150  {
151  adjust_threshold_pivot = true;
152  threshold_pivot = eps;
153  }
154 
155 
157  template<class T>
159  {
160  refine_solution = true;
161  }
162 
163 
165  template<class T>
167  {
168  refine_solution = false;
169  }
170 
171 
173  template<class T>
175  {
176  size_t taille = 0;
177  if (n <= 0)
178  return taille;
179 
180  // assuming that for each term, a value and an index is needed
181  taille += (sizeof(T)+sizeof(pastix_int_t))*iparm[IPARM_NNZEROS];
182  return taille;
183  }
184 
185 
186  template<class T>
188  {
189  return 0;
190  }
191 
192 
194  template<class T>
195  template<class T0, class Prop, class Storage, class Allocator, class Tint>
196  void MatrixPastix<T>::
198  Vector<Tint>& numbers, bool keep_matrix)
199  {
200  // We clear the previous factorization, if any.
201  Clear();
202 
203  distributed = false;
204 
205  n = mat.GetN();
206  if (n <= 0)
207  return;
208 
209  Vector<pastix_int_t> Ptr, Ind;
210 
211  GetSymmetricPattern(mat, Ptr, Ind);
212  if (!keep_matrix)
213  mat.Clear();
214 
215  cout << "Not implemented" << endl;
216  abort();
217  }
218 
219 
221  template<class T> template<class T0, class Storage, class Allocator>
222  void MatrixPastix<T>
224  bool keep_matrix)
225  {
226  // we clear previous factorization if present
227  Clear();
228 
229  Vector<pastix_int_t> Ptr, IndRow;
230  Vector<T> Val;
231 
232  General prop;
233  ConvertToCSC(mat, prop, Ptr, IndRow, Val, true);
234  if (!keep_matrix)
235  mat.Clear();
236 
237  FactorizeCSC(Ptr, IndRow, Val, false);
238  }
239 
240 
241  template<class T>
243  Vector<T>& Val, bool sym, const Vector<int>& glob_number,
244  MPI_Comm comm_facto)
245  {
246  spmInit(spm);
247 
248  pastix_int_t nnz = IndRow.GetM();
249  spm->fmttype = SpmCSC;
250  spm->dof = 1;
251  if (glob_number.GetM() < n)
252  spm->loc2glob = NULL;
253  else
254  {
255  Vector<int> glob_num(glob_number);
256  spm->loc2glob = glob_num.GetData();
257  spm->comm = comm_facto;
258  int nb_proc, rank_proc;
259  MPI_Comm_size(comm_facto, &nb_proc);
260  MPI_Comm_rank(comm_facto, &rank_proc);
261  spm->clustnum = rank_proc;
262  spm->clustnbr = nb_proc;
263  glob_num.Nullify();
264  }
265 
266  spm->baseval = 0;
267  spm->n = n;
268  spm->nnz = nnz;
269  spm->layout = SpmColMajor;
270 
271  if (sizeof(T) == 8)
272  spm->flttype = SpmDouble;
273  else
274  spm->flttype = SpmComplex64;
275 
276  if (sym)
277  spm->mtxtype = SpmSymmetric;
278  else
279  spm->mtxtype = SpmGeneral;
280 
281  spm->colptr = Ptr.GetData();
282  spm->rowptr = IndRow.GetData();
283  spm->values = (double*)Val.GetData();
284 
285  spmUpdateComputedFields( spm );
286 
287  spmatrix_t spm2;
288  int rc = spmCheckAndCorrect( spm, &spm2 );
289  if (rc != 0)
290  {
291  cout << "Error in the matrix" << endl;
292  abort();
293  }
294 
295  Ptr.Nullify(); IndRow.Nullify(); Val.Nullify();
296  }
297 
298 
299  template<class T>
300  void MatrixPastix<T>
301  ::FactorizeCSC(Vector<pastix_int_t>& Ptr, Vector<pastix_int_t>& IndRow,
302  Vector<T>& Val, bool sym)
303  {
304  distributed = false;
305  n = Ptr.GetM()-1;
306  if (n <= 0)
307  return;
308 
309  Vector<int> glob_num; // void because of sequential matrix
310  FillSpmMatrix(Ptr, IndRow, Val, sym, glob_num, MPI_COMM_SELF);
311 
312  if (sym)
313  {
314  if (cholesky)
315  iparm[IPARM_FACTORIZATION] = PastixFactLLT;
316  else
317  iparm[IPARM_FACTORIZATION] = PastixFactLDLT;
318  }
319  else
320  iparm[IPARM_FACTORIZATION] = PastixFactLU;
321 
322  // pivot threshold
323  if (adjust_threshold_pivot)
324  dparm[DPARM_EPSILON_MAGN_CTRL] = threshold_pivot;
325 
326  pastixInit(&pastix_data, MPI_COMM_SELF, iparm, dparm);
327 
328  // analyze
329  pastix_task_analyze(pastix_data, spm);
330 
331  // numerical factorization
332  pastix_task_numfact(pastix_data, spm);
333 
334  if (iparm[IPARM_VERBOSE] != PastixVerboseNot)
335  cout << "Factorization successful" << endl;
336  }
337 
338 
340  template<class T> template<class T0, class Storage, class Allocator>
341  void MatrixPastix<T>::
343  bool keep_matrix)
344  {
345  // we clear previous factorization if present
346  Clear();
347 
348  Vector<pastix_int_t> Ptr, IndRow;
349  Vector<T> Val;
350 
351  Symmetric prop;
352  ConvertToCSR(mat, prop, Ptr, IndRow, Val);
353 
354  FactorizeCSC(Ptr, IndRow, Val, true);
355  }
356 
357 
359  template<class T> template<class Allocator2>
361  {
362  Solve(SeldonNoTrans, x);
363  }
364 
365 
367  template<class T> template<class Allocator2>
370  {
371  Solve(TransA, x.GetData(), 1);
372  }
373 
374 
376  template<class T>
377  void MatrixPastix<T>::Solve(const SeldonTranspose& TransA, T* x_ptr, int nrhs_)
378  {
379  pastix_int_t nrhs = nrhs_;
380 
381  if (cholesky)
382  {
383  spm_coeftype_t flttype;
384  if (sizeof(T) == 8)
385  flttype = SpmDouble;
386  else
387  flttype = SpmComplex64;
388 
389  if (TransA.NoTrans())
390  {
391  pastix_subtask_applyorder(pastix_data, flttype, PastixDirForward,
392  n, nrhs, (void*)x_ptr, n);
393 
394  pastix_subtask_trsm(pastix_data, flttype, PastixLeft, PastixLower,
395  PastixNoTrans, PastixNonUnit, nrhs, (void*)x_ptr, n);
396  }
397  else
398  {
399  pastix_subtask_trsm(pastix_data, flttype, PastixLeft, PastixLower,
400  PastixTrans, PastixNonUnit, nrhs, (void*)x_ptr, n);
401 
402  pastix_subtask_applyorder(pastix_data, flttype, PastixDirBackward,
403  n, nrhs, (void*)x_ptr, n);
404  }
405 
406  return;
407  }
408 
409  if (TransA.Trans())
410  iparm[IPARM_TRANSPOSE_SOLVE] = PastixTrans;
411  else
412  iparm[IPARM_TRANSPOSE_SOLVE] = PastixNoTrans;
413 
414  T* b_ptr = NULL;
415  if (refine_solution)
416  {
417  b_ptr = (T*) malloc(nrhs*n*sizeof(T));
418  memcpy(b_ptr, x_ptr, nrhs*n*sizeof(T));
419  }
420 
421  pastix_task_solve(pastix_data, nrhs, (void*)x_ptr, n);
422  if (refine_solution)
423  pastix_task_refine(pastix_data, n, nrhs, (void*)b_ptr, n, (void*)x_ptr, n);
424  }
425 
426 
428  template<class T> template<class Allocator2>
431  {
432  Solve(TransA, x.GetData(), x.GetN());
433  }
434 
435 
437  template<class T> template<class Allocator2>
440  {
441  Mlt(TransA, x.GetData(), 1);
442  }
443 
444 
446  template<class T>
447  void MatrixPastix<T>::Mlt(const SeldonTranspose& TransA, T* x_ptr, int nrhs_)
448  {
449  // pastix_int_t nrhs = nrhs_;
450 
451  if (cholesky)
452  {
453  cout << "Multiplication with L Not implemented in MatrixPastix" << endl;
454  abort();
455  /* if (TransA.Trans())
456  iparm[IPARM_TRANSPOSE_SOLVE] = API_SOLVE_UTRMV;
457  else
458  iparm[IPARM_TRANSPOSE_SOLVE] = API_SOLVE_LTRMV;
459 
460  iparm[IPARM_END_TASK] = API_TASK_SOLVE; */
461  }
462  else
463  {
464  cout << "Mlt is defined for Cholesky only" << endl;
465  abort();
466  }
467  }
468 
469 
471  template<class T>
473  {
474  iparm[IPARM_THREAD_NBR] = num_thread;
475  }
476 
477 
478  template<class T>
479  void MatrixPastix<T>::
480  FactorizeDistributedMatrix(MPI_Comm& comm_facto, Vector<long>& Ptr,
481  Vector<int>& IndRow, Vector<T>& Val,
482  const Vector<int>& glob_number,
483  bool sym, bool keep_matrix)
484  {
485  Vector<int> PtrInt(Ptr.GetM());
486  for (int i = 0; i < Ptr.GetM(); i++)
487  PtrInt(i) = Ptr(i);
488 
489  FactorizeParallel(comm_facto, PtrInt, IndRow, Val,
490  glob_number, sym, keep_matrix);
491  }
492 
493 
494  template<class T>
495  void MatrixPastix<T>::
496  FactorizeDistributedMatrix(MPI_Comm& comm_facto, Vector<int64_t>& Ptr,
497  Vector<int64_t>& IndRow, Vector<T>& Val,
498  const Vector<int>& glob_number,
499  bool sym, bool keep_matrix)
500  {
501  FactorizeParallel(comm_facto, Ptr, IndRow, Val,
502  glob_number, sym, keep_matrix);
503  }
504 
505 
506  template<class T> template<class Tint>
507  void MatrixPastix<T>::
508  FactorizeParallel(MPI_Comm& comm_facto,
509  Vector<Tint>&, Vector<Tint>&,
510  Vector<T>&,
511  const Vector<int>& glob_num,
512  bool sym, bool keep_matrix)
513  {
514  cout << "Not available for this type of integers " << endl;
515  cout << "Size of Tint = " << sizeof(Tint) << endl;
516  abort();
517  }
518 
519 
521  template<class T>
522  void MatrixPastix<T>::
523  FactorizeParallel(MPI_Comm& comm_facto,
525  Vector<pastix_int_t>& IndRow,
526  Vector<T>& Val, const Vector<int>& glob_number,
527  bool sym, bool keep_matrix)
528  {
529  Clear();
530 
531  iparm[IPARM_FREE_CSCUSER] = 0;
532  distributed = true; n = Ptr.GetM()-1;
533  FillSpmMatrix(Ptr, IndRow, Val, sym, glob_number, comm_facto);
534 
535  if (sym)
536  {
537  if (cholesky)
538  iparm[IPARM_FACTORIZATION] = PastixFactLLT;
539  else
540  iparm[IPARM_FACTORIZATION] = PastixFactLDLT;
541  }
542  else
543  iparm[IPARM_FACTORIZATION] = PastixFactLU;
544 
545  // pivot threshold
546  if (adjust_threshold_pivot)
547  dparm[DPARM_EPSILON_MAGN_CTRL] = threshold_pivot;
548 
549  pastixInit(&pastix_data, comm_facto, iparm, dparm);
550 
551  // analyze
552  pastix_task_analyze(pastix_data, spm);
553 
554  // numerical factorization
555  pastix_task_numfact(pastix_data, spm);
556  }
557 
558 
560  template<class T> template<class Allocator2>
561  void MatrixPastix<T>::SolveDistributed(MPI_Comm& comm_facto,
562  const SeldonTranspose& TransA,
564  const Vector<int>& glob_num)
565  {
566  SolveDistributed(comm_facto, TransA, x.GetData(), 1, glob_num);
567  }
568 
569 
571  template<class T>
572  void MatrixPastix<T>::SolveDistributed(MPI_Comm& comm_facto,
573  const SeldonTranspose& TransA,
574  T* x_ptr, int nrhs_,
575  const IVect& glob_num)
576  {
577  pastix_int_t nrhs = nrhs_;
578 
579  if (cholesky)
580  {
581  cout << "Not implemented" << endl;
582  abort();
583  /*if (TransA.Trans())
584  iparm[IPARM_TRANSPOSE_SOLVE] = API_SOLVE_BACKWARD_ONLY;
585  else
586  iparm[IPARM_TRANSPOSE_SOLVE] = API_SOLVE_FORWARD_ONLY; */
587  }
588  else
589  {
590  if (TransA.Trans())
591  iparm[IPARM_TRANSPOSE_SOLVE] = PastixTrans;
592  else
593  iparm[IPARM_TRANSPOSE_SOLVE] = PastixNoTrans;
594  }
595 
596  T* b_ptr;
597  if (refine_solution)
598  {
599  b_ptr = (T*) malloc(nrhs*n*sizeof(T));
600  memcpy(b_ptr, x_ptr, nrhs*n*sizeof(T));
601  }
602 
603  pastix_task_solve(pastix_data, nrhs, (void*)x_ptr, n);
604  if (refine_solution)
605  pastix_task_refine(pastix_data, n, nrhs, (void*)b_ptr, n, (void*)x_ptr, n);
606  }
607 
608 
610  template<class T> template<class Allocator2>
611  void MatrixPastix<T>::SolveDistributed(MPI_Comm& comm_facto,
612  const SeldonTranspose& TransA,
614  const Vector<int>& glob_num)
615  {
616  SolveDistributed(comm_facto, TransA, x.GetData(), x.GetN(), glob_num);
617  }
618 
619 
621  template<class T> template<class Allocator2>
622  void MatrixPastix<T>::MltDistributed(MPI_Comm& comm_facto,
623  const SeldonTranspose& TransA,
625  const Vector<int>& glob_num)
626  {
627  MltDistributed(comm_facto, TransA, x.GetData(), 1, glob_num);
628  }
629 
630 
632  template<class T>
633  void MatrixPastix<T>::MltDistributed(MPI_Comm& comm_facto,
634  const SeldonTranspose& TransA,
635  T* x_ptr, int nrhs_,
636  const IVect& glob_num)
637  {
638  /*
639  pastix_int_t nrhs = nrhs_;
640 
641  for (int k = 0; k < nrhs_; k++)
642  {
643  // workaround : each linear system is solved separately
644  nrhs = 1;
645 
646  if (cholesky)
647  {
648  if (TransA.Trans())
649  iparm[IPARM_TRANSPOSE_SOLVE] = API_SOLVE_UTRMV;
650  else
651  iparm[IPARM_TRANSPOSE_SOLVE] = API_SOLVE_LTRMV;
652 
653  iparm[IPARM_END_TASK] = API_TASK_SOLVE;
654  }
655  else
656  {
657  cout << "Mlt is defined for Cholesky only" << endl;
658  abort();
659  }
660 
661  iparm[IPARM_START_TASK] = API_TASK_SOLVE;
662  //CallPastix(comm_facto, NULL, NULL, NULL, x_ptr, nrhs);
663 
664  CallPastix(comm_facto, NULL, NULL, NULL, x_ptr, nrhs);
665  x_ptr += n;
666  }
667  */
668  }
669 
670 
672  template<class T> template<class Allocator2>
673  void MatrixPastix<T>::MltDistributed(MPI_Comm& comm_facto,
674  const SeldonTranspose& TransA,
676  const Vector<int>& glob_num)
677  {
678  MltDistributed(comm_facto, TransA, x.GetData(), x.GetN(), glob_num);
679  }
680 
681 
683  template<class MatrixSparse, class T>
684  void GetLU(MatrixSparse& A, MatrixPastix<T>& mat_lu, bool keep_matrix, T& x)
685  {
686  mat_lu.FactorizeMatrix(A, keep_matrix);
687  }
688 
689 
691  template<class MatrixSparse, class T>
692  void GetLU(MatrixSparse& A, MatrixPastix<T>& mat_lu, bool keep_matrix, complex<T>& x)
693  {
694  throw WrongArgument("GetLU(Matrix<complex<T> >& A, MatrixPastix<T>& mat_lu, bool)",
695  "The LU matrix must be complex");
696  }
697 
698 
700  template<class MatrixSparse, class T>
701  void GetLU(MatrixSparse& A, MatrixPastix<complex<T> >& mat_lu, bool keep_matrix, T& x)
702  {
703  throw WrongArgument("GetLU(Matrix<T>& A, MatrixMumps<Pastix<T> >& mat_lu, bool)",
704  "The sparse matrix must be complex");
705  }
706 
707 
709  template<class T0, class Prop, class Storage, class Allocator, class T>
711  bool keep_matrix)
712  {
713  // we check if the type of non-zero entries of matrix A
714  // and of the Pastix object (T) are different
715  // we call one of the GetLUs written above
716  // such a protection avoids to compile the factorisation of a complex
717  // matrix with a real Pastix object
719  GetLU(A, mat_lu, keep_matrix, x);
720  }
721 
722 
724  template<class T, class Allocator>
726  {
727  mat_lu.Solve(x);
728  }
729 
730 
733  template<class T, class Allocator>
734  void SolveLU(const SeldonTranspose& TransA,
736  {
737  mat_lu.Solve(TransA, x);
738  }
739 
740 
742  template<class T, class Prop, class Allocator>
743  void SolveLU(MatrixPastix<T>& mat_lu,
745  {
746  mat_lu.Solve(SeldonNoTrans, x);
747  }
748 
749 
752  template<class T, class Prop, class Allocator>
753  void SolveLU(const SeldonTranspose& TransA,
755  {
756  mat_lu.Solve(TransA, x);
757  }
758 
759 
761  template<class Allocator>
762  void SolveLU(MatrixPastix<double>& mat_lu,
763  Vector<complex<double>, VectFull, Allocator>& x)
764  {
765  Matrix<double, General, ColMajor> y(x.GetM(), 2);
766 
767  for (int i = 0; i < x.GetM(); i++)
768  {
769  y(i, 0) = real(x(i));
770  y(i, 1) = imag(x(i));
771  }
772 
773  SolveLU(mat_lu, y);
774 
775  for (int i = 0; i < x.GetM(); i++)
776  x(i) = complex<double>(y(i, 0), y(i, 1));
777  }
778 
779 
781  template<class Allocator>
782  void SolveLU(const SeldonTranspose& TransA,
783  MatrixPastix<double>& mat_lu, Vector<complex<double>, VectFull, Allocator>& x)
784  {
785  Matrix<double, General, ColMajor> y(x.GetM(), 2);
786 
787  for (int i = 0; i < x.GetM(); i++)
788  {
789  y(i, 0) = real(x(i));
790  y(i, 1) = imag(x(i));
791  }
792 
793  SolveLU(TransA, mat_lu, y);
794 
795  for (int i = 0; i < x.GetM(); i++)
796  x(i) = complex<double>(y(i, 0), y(i, 1));
797 
798  }
799 
800 
802  template<class Allocator>
803  void SolveLU(MatrixPastix<complex<double> >& mat_lu,
805  {
806  throw WrongArgument("SolveLU(MatrixPastix<complex<double> >, Vector<double>)",
807  "The result should be a complex vector");
808  }
809 
810 
812  template<class Allocator>
813  void SolveLU(const SeldonTranspose& TransA,
814  MatrixPastix<complex<double> >& mat_lu,
816  {
817  throw WrongArgument("SolveLU(MatrixPastix<complex<double> >, Vector<double>)",
818  "The result should be a complex vector");
819  }
820 
821 
822  template<class T, class Prop, class Storage, class Allocator>
823  void GetCholesky(Matrix<T, Prop, Storage, Allocator>& A,
824  MatrixPastix<T>& mat_chol, bool keep_matrix)
825  {
826  mat_chol.SetCholeskyFacto(true);
827  //IVect permut(A.GetM()); permut.Fill();
828  //mat_chol.SetPermutation(permut);
829  mat_chol.FactorizeMatrix(A, keep_matrix);
830  }
831 
832 
833  template<class T, class Allocator>
834  void
835  SolveCholesky(const SeldonTranspose& TransA,
836  MatrixPastix<T>& mat_chol, Vector<T, VectFull, Allocator>& x)
837  {
838  mat_chol.Solve(TransA, x);
839  }
840 
841 
842  template<class T, class Allocator>
843  void
844  MltCholesky(const SeldonTranspose& TransA,
845  MatrixPastix<T>& mat_chol, Vector<T, VectFull, Allocator>& x)
846  {
847  mat_chol.Mlt(TransA, x);
848  }
849 
850 } // end namespace
851 
852 #define SELDON_FILE_PASTIX_CXX
853 #endif
Seldon::MatrixPastix::GetMemorySize
size_t GetMemorySize() const
Returns the size of memory used by the factorisation in bytes.
Definition: Pastix.cxx:174
Seldon::MatrixPastix
Definition: Pastix.hxx:39
Seldon::SeldonTranspose
Definition: MatrixFlag.hxx:32
Seldon::MatrixPastix::MltDistributed
void MltDistributed(MPI_Comm &comm_facto, const SeldonTranspose &TransA, Vector< T, VectFull, Allocator2 > &x, const Vector< int > &glob_num)
computes L x or L^T x
Definition: Pastix.cxx:622
Seldon::Vector< int, VectFull >
Seldon::MatrixPastix::RefineSolution
void RefineSolution()
You can require that solution is refined after LU resolution.
Definition: Pastix.cxx:158
Seldon::MatrixPastix::SetCholeskyFacto
void SetCholeskyFacto(bool chol)
sets Cholesky factorisation
Definition: Pastix.cxx:141
Seldon::MatrixPastix::Mlt
void Mlt(const SeldonTranspose &TransA, Vector< T, VectFull, Allocator2 > &x)
Computes x = L b or x = L^T b (A = L L^T)
Definition: Pastix.cxx:438
Seldon::Matrix
Definition: SeldonHeader.hxx:226
Seldon::MatrixPastix::SetNumberOfThreadPerNode
void SetNumberOfThreadPerNode(int)
Modifies the number of threads per node.
Definition: Pastix.cxx:472
Seldon::VectFull
Definition: StorageInline.cxx:74
Seldon::MatrixPastix::Solve
void Solve(Vector< T, VectFull, Allocator2 > &x)
solving A x = b (A is already factorized)
Definition: Pastix.cxx:360
Seldon::MatrixPastix::MatrixPastix
MatrixPastix()
Default constructor.
Definition: Pastix.cxx:28
Seldon::MatrixPastix::SetPivotThreshold
void SetPivotThreshold(double)
you can change the threshold used for static pivoting
Definition: Pastix.cxx:149
Seldon::MatrixPastix::SetPermutation
void SetPermutation(const IVect &permut)
provides a permutation array (instead of using Scotch reordering)
Definition: Pastix.cxx:127
Seldon::MatrixPastix::ShowFullHistory
void ShowFullHistory()
Displaying all messages.
Definition: Pastix.cxx:111
Seldon::General
Definition: Properties.hxx:26
Seldon::Vector< T, VectFull, Allocator >
Full vector class.
Definition: Vector.hxx:88
Seldon::GetLU
void GetLU(Matrix< T0, Prop0, Storage0, Allocator0 > &A)
Returns the LU factorization of a matrix.
Definition: Functions_Matrix.cxx:2073
Seldon::MatrixPastix::Clear
void Clear()
Clearing factorization.
Definition: Pastix.cxx:80
Seldon::MatrixPastix::FactorizeMatrix
void FactorizeMatrix(Matrix< T0, General, Storage, Allocator > &mat, bool keep_matrix=false)
Factorization of unsymmetric matrix.
Definition: Pastix.cxx:223
Seldon::MatrixPastix::FindOrdering
void FindOrdering(Matrix< T0, Prop, Storage, Allocator > &mat, Vector< Tint > &numbers, bool keep_matrix=false)
Returning ordering found by Scotch.
Definition: Pastix.cxx:197
Seldon::MatrixPastix::DoNotRefineSolution
void DoNotRefineSolution()
You can require that solution is not refined (faster).
Definition: Pastix.cxx:166
Seldon::MatrixPastix::SelectOrdering
void SelectOrdering(int type)
selects the algorithm used for reordering
Definition: Pastix.cxx:119
Seldon::MatrixPastix::~MatrixPastix
~MatrixPastix()
destructor
Definition: Pastix.cxx:61
Seldon::WrongArgument
Definition: Errors.hxx:76
Seldon::MatrixPastix::ShowMessages
void ShowMessages()
Low level of display.
Definition: Pastix.cxx:103
Seldon::MatrixPastix::SolveDistributed
void SolveDistributed(MPI_Comm &comm_facto, const SeldonTranspose &TransA, Vector< T, VectFull, Allocator2 > &x, const Vector< int > &glob_num)
solves A x = b or A^T x = b in parallel
Definition: Pastix.cxx:561
Seldon::Symmetric
Definition: Properties.hxx:30
Seldon::MatrixPastix::HideMessages
void HideMessages()
no message will be displayed
Definition: Pastix.cxx:95
Seldon
Seldon namespace.
Definition: Array.cxx:24
Seldon::Matrix< T, Prop, ColMajor, Allocator >
Column-major full-matrix class.
Definition: Matrix_Pointers.hxx:176