64 NumJaggedDiagonals_(Matrix.MaxNumEntries())
101 Indices = curIndices.
Values();
102 Values = curValues.
Values();
130 for (
int i=0; i<numMyRows; i++) {
142 for (
int i=0; i<numMyRows; i++)
InvRowPerm_[RowPerm[i]] = i;
149 int curOffset = numMyRows;
151 for (
int i=1; i<NumJaggedDiagonals_+1; i++) {
153 while (*curIndex==0) {
154 if (
Profile_[curOffset-1]<i) curOffset--;
155 else *curIndex = *(curIndex-1) + curOffset;
170 for (
int i1=0; i1<numMyRows; i1++) {
175 for (
int j=0; j< NumEntries; j++) {
177 Indices_[IndexOffset_[j]+i] = Indices[j];
185 Indices = curIndices.
Values();
186 Values = curValues.
Values();
187 for (
int i1=0; i1<numMyRows; i1++) {
188 Matrix.
ExtractMyRowCopy(i1, NumJaggedDiagonals_, NumEntries, Values, Indices);
190 for (
int j=0; j< NumEntries; j++) {
192 Indices_[IndexOffset_[j]+i] = Indices[j];
211 if(NumEntries > Length)
229 double** Xp = (
double**) X.
Pointers();
230 double** Yp = (
double**) Y.
Pointers();
255 GeneralMM(TransA, Xp, LDX, Yp, LDY, NumVectors);
284 GeneralMM(TransA, Xp, LDX, Yp, LDY, NumVectors);
299 if (LDX==0 || LDY==0 || NumVectors==1) {
300 for (
int k=0; k<NumVectors; k++)
GeneralMV(TransA, X[k], Y[k]);
302 else if (NumVectors==2)
314 #define Pragma(S) _Pragma(S)
325 for (
int j=0; j<NumVectors; j++) {
333 int nv = NumVectors%5;
if (nv==0) nv=5;
338 for (
int k=0; k<NumVectors; k+=5) {
341 const int * curIndices = Indices+IndexOffset[j];
342 const double * curValues = Values+IndexOffset[j];
343 int jaggedDiagonalLength = IndexOffset[j+1]-IndexOffset[j];
349 for (
int i=0; i<jaggedDiagonalLength; i++) {
350 int ix = curIndices[i];
352 double val = curValues[i];
358 for (
int i=0; i<jaggedDiagonalLength; i++) {
359 int iy = curIndices[i];
361 double val = curValues[i];
371 for (
int i=0; i<jaggedDiagonalLength; i++) {
372 int ix = curIndices[i];
374 double val = curValues[i];
382 for (
int i=0; i<jaggedDiagonalLength; i++) {
383 int iy = curIndices[i];
385 double val = curValues[i];
397 for (
int i=0; i<jaggedDiagonalLength; i++) {
398 int ix = curIndices[i];
400 double val = curValues[i];
410 for (
int i=0; i<jaggedDiagonalLength; i++) {
411 int iy = curIndices[i];
413 double val = curValues[i];
427 for (
int i=0; i<jaggedDiagonalLength; i++) {
428 int ix = curIndices[i];
430 double val = curValues[i];
442 for (
int i=0; i<jaggedDiagonalLength; i++) {
443 int iy = curIndices[i];
445 double val = curValues[i];
461 for (
int i=0; i<jaggedDiagonalLength; i++) {
462 int ix = curIndices[i];
464 double val = curValues[i];
478 for (
int i=0; i<jaggedDiagonalLength; i++) {
479 int iy = curIndices[i];
481 double val = curValues[i];
526 int jaggedDiagonalLength = IndexOffset[j+1]-IndexOffset[j];
529 while ((j<
NumJaggedDiagonals_-1) && (IndexOffset[j+1]-IndexOffset[j]==jaggedDiagonalLength) && (j-j0<2)) j++;
532 assert(numDiags<3 && numDiags>0);
538 const int * curIndices = Indices+IndexOffset[j0];
539 const double * curValues = Values+IndexOffset[j0];
542 for (
int i=0; i<jaggedDiagonalLength; i++) {
543 int ix = curIndices[i];
545 y[iy] += curValues[i]*x[ix];
547 y[iy] += curValues[i]*x[ix];
552 for (
int i=0; i<jaggedDiagonalLength; i++){
553 int iy = curIndices[i];
555 y[iy] += curValues[i]*x[ix];
557 y[iy] += curValues[i]*x[ix];
564 const int * curIndices0 = Indices+IndexOffset[j0];
565 const double * curValues0 = Values+IndexOffset[j0++];
566 const int * curIndices1 = Indices+IndexOffset[j0];
567 const double * curValues1 = Values+IndexOffset[j0];
570 for (
int i=0; i<jaggedDiagonalLength; i++) {
571 int ix0 = curIndices0[i];
572 int ix1 = curIndices1[i];
575 curValues0[i]*x[ix0] +
576 curValues1[i]*x[ix1];
577 iy+=ldy; ix0+=ldx; ix1+=ldx;
579 curValues0[i]*x[ix0] +
580 curValues1[i]*x[ix1];
585 for (
int i=0; i<jaggedDiagonalLength; i++) {
586 int iy0 = curIndices0[i];
587 int iy1 = curIndices1[i];
590 y[iy0] += curValues0[i]*xval;
591 y[iy1] += curValues1[i]*xval;
592 ix+=ldx; iy0+=ldy; iy1+=ldy;
594 y[iy0] += curValues0[i]*xval;
595 y[iy1] += curValues1[i]*xval;
619 int jaggedDiagonalLength = IndexOffset[j+1]-IndexOffset[j];
622 while ((j<
NumJaggedDiagonals_-1) && (IndexOffset[j+1]-IndexOffset[j]==jaggedDiagonalLength) && (j-j0<5)) j++;
625 assert(numDiags<6 && numDiags>0);
631 const int * curIndices = Indices+IndexOffset[j0];
632 const double * curValues = Values+IndexOffset[j0];
635 for (
int i=0; i<jaggedDiagonalLength; i++)
636 y[RowPerm[i]] += curValues[i]*x[curIndices[i]];
640 for (
int i=0; i<jaggedDiagonalLength; i++)
641 y[curIndices[i]] += curValues[i]*x[RowPerm[i]];
647 const int * curIndices0 = Indices+IndexOffset[j0];
648 const double * curValues0 = Values+IndexOffset[j0++];
649 const int * curIndices1 = Indices+IndexOffset[j0];
650 const double * curValues1 = Values+IndexOffset[j0];
653 for (
int i=0; i<jaggedDiagonalLength; i++) {
655 curValues0[i]*x[curIndices0[i]] +
656 curValues1[i]*x[curIndices1[i]];
661 for (
int i=0; i<jaggedDiagonalLength; i++) {
662 double xval = x[RowPerm[i]];
663 y[curIndices0[i]] += curValues0[i]*xval;
664 y[curIndices1[i]] += curValues1[i]*xval;
671 const int * curIndices0 = Indices+IndexOffset[j0];
672 const double * curValues0 = Values+IndexOffset[j0++];
673 const int * curIndices1 = Indices+IndexOffset[j0];
674 const double * curValues1 = Values+IndexOffset[j0++];
675 const int * curIndices2 = Indices+IndexOffset[j0];
676 const double * curValues2 = Values+IndexOffset[j0];
679 for (
int i=0; i<jaggedDiagonalLength; i++) {
681 curValues0[i]*x[curIndices0[i]] +
682 curValues1[i]*x[curIndices1[i]] +
683 curValues2[i]*x[curIndices2[i]];
688 for (
int i=0; i<jaggedDiagonalLength; i++) {
689 double xval = x[RowPerm[i]];
690 y[curIndices0[i]] += curValues0[i]*xval;
691 y[curIndices1[i]] += curValues1[i]*xval;
692 y[curIndices2[i]] += curValues2[i]*xval;
699 const int * curIndices0 = Indices+IndexOffset[j0];
700 const double * curValues0 = Values+IndexOffset[j0++];
701 const int * curIndices1 = Indices+IndexOffset[j0];
702 const double * curValues1 = Values+IndexOffset[j0++];
703 const int * curIndices2 = Indices+IndexOffset[j0];
704 const double * curValues2 = Values+IndexOffset[j0++];
705 const int * curIndices3 = Indices+IndexOffset[j0];
706 const double * curValues3 = Values+IndexOffset[j0];
709 for (
int i=0; i<jaggedDiagonalLength; i++) {
711 curValues0[i]*x[curIndices0[i]] +
712 curValues1[i]*x[curIndices1[i]] +
713 curValues2[i]*x[curIndices2[i]] +
714 curValues3[i]*x[curIndices3[i]];
719 for (
int i=0; i<jaggedDiagonalLength; i++) {
720 double xval = x[RowPerm[i]];
721 y[curIndices0[i]] += curValues0[i]*xval;
722 y[curIndices1[i]] += curValues1[i]*xval;
723 y[curIndices2[i]] += curValues2[i]*xval;
724 y[curIndices3[i]] += curValues3[i]*xval;
731 const int * curIndices0 = Indices+IndexOffset[j0];
732 const double * curValues0 = Values+IndexOffset[j0++];
733 const int * curIndices1 = Indices+IndexOffset[j0];
734 const double * curValues1 = Values+IndexOffset[j0++];
735 const int * curIndices2 = Indices+IndexOffset[j0];
736 const double * curValues2 = Values+IndexOffset[j0++];
737 const int * curIndices3 = Indices+IndexOffset[j0];
738 const double * curValues3 = Values+IndexOffset[j0++];
739 const int * curIndices4 = Indices+IndexOffset[j0];
740 const double * curValues4 = Values+IndexOffset[j0];
743 for (
int i=0; i<jaggedDiagonalLength; i++) {
745 curValues0[i]*x[curIndices0[i]] +
746 curValues1[i]*x[curIndices1[i]] +
747 curValues2[i]*x[curIndices2[i]] +
748 curValues3[i]*x[curIndices3[i]] +
749 curValues4[i]*x[curIndices4[i]];
754 for (
int i=0; i<jaggedDiagonalLength; i++) {
755 double xval = x[RowPerm[i]];
756 y[curIndices0[i]] += curValues0[i]*xval;
757 y[curIndices1[i]] += curValues1[i]*xval;
758 y[curIndices2[i]] += curValues2[i]*xval;
759 y[curIndices3[i]] += curValues3[i]*xval;
760 y[curIndices4[i]] += curValues4[i]*xval;
void UpdateImportVector(int NumVectors) const
Epetra_MultiVector: A class for constructing and using dense multi-vectors, vectors and matrices in p...
bool DistributedGlobal() const
Returns true if map is defined across more than one processor.
Epetra_IntSerialDenseVector: A class for constructing and using dense vectors.
virtual const Epetra_Map & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this operator.
void SetMaps(const Epetra_Map &RowMap, const Epetra_Map &ColMap)
Set maps (Version 1); call this function or the next, but not both.
virtual const Epetra_Map & RowMatrixRowMap() const =0
Returns the Epetra_Map object associated with the rows of this matrix.
int Resize(int Length_in)
Resize a Epetra_IntSerialDenseVector object.
bool HaveNumericConstants_
virtual const Epetra_Comm & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this matrix.
void GeneralMM2RHS(bool TransA, double *x, int ldx, double *y, int ldy) const
virtual long long NumGlobalNonzeros64() const
virtual ~Epetra_JadMatrix()
Epetra_JadMatrix Destructor.
int PutScalar(double ScalarConstant)
Initialize all values in a multi-vector with constant value.
virtual void SetLabel(const char *const Label)
Epetra_Object Label definition using char *.
double ** Pointers() const
Get pointer to individual vector pointers.
#define EPETRA_CHK_ERR(a)
int Multiply(bool TransA, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of a Epetra_JadMatrix multiplied by a Epetra_MultiVector X in Y.
Epetra_JadMatrix(const Epetra_RowMatrix &Matrix)
Epetra_JadMatrix constuctor.
virtual const Epetra_Map & OperatorDomainMap() const =0
Returns the Epetra_Map object associated with the domain of this operator.
void GeneralMV(bool TransA, double *x, double *y) const
int NumVectors() const
Returns the number of vectors in the multi-vector.
Epetra_IntSerialDenseVector Indices_
int Resize(int Length_in)
Resize a Epetra_SerialDenseVector object.
int ExtractMyRowView(int MyRow, int &NumEntries, double *&Values, int *&Indices) const
Returns a view of the specified local row values via pointers to internal data.
void UpdateExportVector(int NumVectors) const
Epetra_Util: The Epetra Util Wrapper Class.
Epetra_SerialDenseVector: A class for constructing and using dense vectors.
virtual int NumMyRowEntries(int MyRow, int &NumEntries) const =0
Returns the number of nonzero entries in MyRow.
virtual const Epetra_Map & OperatorRangeMap() const =0
Returns the Epetra_Map object associated with the range of this operator.
int Export(const Epetra_SrcDistObject &A, const Epetra_Import &Importer, Epetra_CombineMode CombineMode, const Epetra_OffsetIndex *Indexor=0)
Exports an Epetra_DistObject using the Epetra_Import object.
Epetra_MultiVector * ExportVector_
Epetra_IntSerialDenseVector Profile_
Epetra_IntSerialDenseVector IndexOffset_
Epetra_SerialDenseVector Values_
virtual int NumMyRows() const =0
Returns the number of matrix rows owned by the calling processor.
virtual bool Filled() const =0
If FillComplete() has been called, this query returns true, otherwise it returns false.
int UpdateValues(const Epetra_RowMatrix &Matrix, bool CheckStructure=false)
Update values using a matrix with identical structure.
Epetra_BasicRowMatrix: A class for simplifying the development of Epetra_RowMatrix adapters...
Epetra_IntSerialDenseVector InvRowPerm_
Epetra_IntSerialDenseVector RowPerm_
int Stride() const
Returns the stride between vectors in the multi-vector (only meaningful if ConstantStride() is true)...
void Allocate(const Epetra_RowMatrix &Matrix)
bool ConstantStride() const
Returns true if this multi-vector has constant stride between vectors.
int NumMyRowEntries(int MyRow, int &NumEntries) const
Return the current number of values stored for the specified local row.
int ExtractMyRowCopy(int MyRow, int Length, int &NumEntries, double *Values, int *Indices) const
Returns a copy of the specified local row in user-provided arrays.
virtual const Epetra_Import * Importer() const
Returns the Epetra_Import object that contains the import operations for distributed operations...
virtual const Epetra_Map & OperatorRangeMap() const
Returns the Epetra_Map object associated with the range of this operator (same as domain)...
virtual int NumProc() const =0
Returns total number of processes.
Epetra_CrsMatrix: A class for constructing and using real-valued double-precision sparse compressed r...
static void EPETRA_LIB_DLL_EXPORT Sort(bool SortAscending, int NumKeys, T *Keys, int NumDoubleCompanions, double **DoubleCompanions, int NumIntCompanions, int **IntCompanions, int NumLongLongCompanions, long long **LongLongCompanions)
Epetra_Util Sort Routine (Shell sort)
virtual const Epetra_Export * Exporter() const
Returns the Epetra_Export object that contains the export operations for distributed operations...
virtual int ExtractMyRowCopy(int MyRow, int Length, int &NumEntries, double *Values, int *Indices) const =0
Returns a copy of the specified local row in user-provided arrays.
void GeneralMM3RHS(bool TransA, double **X, int LDX, double **Y, int LDY, int NumVectors) const
virtual int ReportError(const std::string Message, int ErrorCode) const
Error reporting method.
virtual const Epetra_Map & RowMatrixColMap() const =0
Returns the Epetra_Map object associated with the columns of this matrix.
double * Values() const
Returns pointer to the values in vector.
Epetra_RowMatrix: A pure virtual class for using real-valued double-precision row matrices...
int * Values()
Returns pointer to the values in vector.
int Import(const Epetra_SrcDistObject &A, const Epetra_Import &Importer, Epetra_CombineMode CombineMode, const Epetra_OffsetIndex *Indexor=0)
Imports an Epetra_DistObject using the Epetra_Import object.
virtual int NumMyNonzeros() const =0
Returns the number of nonzero entries in the calling processor's portion of the matrix.
void UpdateFlops(int Flops_in) const
Increment Flop count for this object.
void GeneralMM(bool TransA, double **X, int LDX, double **Y, int LDY, int NumVectors) const
Epetra_MultiVector * ImportVector_