Creation routines for building Komplex systems.
More...
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "az_aztec.h"
#include "azk_komplex.h"
|
| void | AZK_create_linsys_c2k (double *xc, double *bc, int *options, double *params, int *proc_config, AZ_MATRIX *Amat_complex, double **x, double **b, AZ_MATRIX **Amat_komplex) |
| | Create Komplex System from Complex System. More...
|
| |
| void | AZK_create_linsys_g2k (double *xr, double *xi, double *br, double *bi, int *options, double *params, int *proc_config, double c0r, double c0i, AZ_MATRIX *Amat_mat0, double c1r, double c1i, AZ_MATRIX *Amat_mat1, double **x, double **b, AZ_MATRIX **Amat_komplex) |
| | Create Komplex System from General System. More...
|
| |
| void | AZK_create_linsys_ri2k (double *xr, double *xi, double *br, double *bi, int *options, double *params, int *proc_config, AZ_MATRIX *Amat_real, double *val_imag, double **x, double **b, AZ_MATRIX **Amat_komplex) |
| | Create Komplex System from Real and Imaginary Parts. More...
|
| |
Creation routines for building Komplex systems.
KOMPLEX is an add-on module to AZTEC that allows users to solve complex-valued linear systems.
KOMPLEX solves a complex-valued linear system Ax = b by solving an equivalent real-valued system of twice the dimension. Specifically, writing in terms of real and imaginary parts, we have
or by separating into real and imaginary equations we have
which is a real-valued system of twice the size. If we find xr and xi, we can form the solution to the original system as x = xr +i*xi.
KOMPLEX accept user linear systems in three forms with either global or local index values.
1) The first form is true complex. The user passes in an MSR or VBR format matrix where the values are stored like Fortran complex numbers. Thus, the values array is of type double that is twice as long as the number of complex values. Each complex entry is stored with real part followed by imaginary part (as in Fortran).
2) The second form stores real and imaginary parts separately, but the pattern for each is identical. Thus only the values of the imaginary part are passed to the creation routines.
3) The third form accepts two real-valued matrices with no assumption about the structure of the matrices. Each matrix is multiplied by a user-supplied complex constant. This is the most general form.
Each of the above forms supports a global or local index set. By this we mean that the index values (stored in bindx) refer to the global problem indices, or the local indices (for example after calling AZ_transform).
◆ AZK_create_linsys_c2k()
| void AZK_create_linsys_c2k |
( |
double * |
xc, |
|
|
double * |
bc, |
|
|
int * |
options, |
|
|
double * |
params, |
|
|
int * |
proc_config, |
|
|
AZ_MATRIX * |
Amat_complex, |
|
|
double ** |
x, |
|
|
double ** |
b, |
|
|
AZ_MATRIX ** |
Amat_komplex |
|
) |
| |
Create Komplex System from Complex System.
Transforms a complex-valued system
Amat_complex * xc = bc
where double precision arrays hold the complex values of Amat_complex, xc and bc in Fortran complex format, i.e., if dimension of complex system is N then xc is of length 2*N and the first complex value is stored with the real part in xc[0] and the imaginary part in xc[1] and so on.
- Parameters
-
| xc | (In) Contains the complex initial guess/solution vector with the real/imag parts interleaved as in Fortran complex format. |
| bc | (In) RHS in Fortran complex format. |
| options | (In) Determines specific solution method and other parameters. |
| params | (In) Drop tolerance and convergence tolerance info.
|
| proc_config | (In) Machine configuration. proc_config[AZ_node] is the node number. proc_config[AZ_N_procs] is the number of processors. |
| Amat_complex | (In) An AZ_MATRIX structure where Amat_complex->val contain the values of the complex matrix in Fortran complex format. |
| x | (Out) Komplex version of initial guess and solution. |
| b | (Out) Komplex version of RHS. |
| Amat_komplex | (Out) Komplex version of matrix stored as an AZ_MATRIX structure. |
References AZK_create_matrix_c2k(), AZK_create_vector_c2k(), and AZK_permute_ri().
◆ AZK_create_linsys_g2k()
| void AZK_create_linsys_g2k |
( |
double * |
xr, |
|
|
double * |
xi, |
|
|
double * |
br, |
|
|
double * |
bi, |
|
|
int * |
options, |
|
|
double * |
params, |
|
|
int * |
proc_config, |
|
|
double |
c0r, |
|
|
double |
c0i, |
|
|
AZ_MATRIX * |
Amat_mat0, |
|
|
double |
c1r, |
|
|
double |
c1i, |
|
|
AZ_MATRIX * |
Amat_mat1, |
|
|
double ** |
x, |
|
|
double ** |
b, |
|
|
AZ_MATRIX ** |
Amat_komplex |
|
) |
| |
Create Komplex System from General System.
Transforms a complex-valued system
(c0r+i*c0i)*A0 +(c1r+i*c1i)*A1) * (xr+i*xi) = (br+i*bi)
to a Komplex system.
- Parameters
-
| xr | (In) Real part of initial guess. |
| xi | (In) Imaginary part of initial guess. |
| br | (In) Real part of right hand side of linear system. |
| bi | (In) Imaginary part of right hand side of linear system. |
| options | (In) Determines specific solution method and other parameters. |
| params | (In) Drop tolerance and convergence tolerance info.
|
| proc_config | (In) Machine configuration. proc_config[AZ_node] is the node number. proc_config[AZ_N_procs] is the number of processors. |
| c0r | (In) Real part of constant to be multiplied with first matrix. |
| c0i | (In) Imaginary part of constant to be multiplied with first matrix. |
| c1r | (In) Real part of constant to be multiplied with second matrix. |
| c1i | (In) Imaginary part of constant to be multiplied with second matrix. |
| Amat_mat0 | (In) AZ_MATRIX object containing first real-valued matrix. |
| Amat_mat1 | (In) AZ_MATRIX object containing second real-valued matrix. |
| x | (Out) Komplex version of initial guess and solution. |
| b | (Out) Komplex version of RHS. |
| Amat_komplex | (Out) Komplex version of matrix stored as an AZ_MATRIX structure. |
References AZK_create_matrix_g2k(), AZK_create_vector_g2k(), and AZK_permute_ri().
◆ AZK_create_linsys_ri2k()
| void AZK_create_linsys_ri2k |
( |
double * |
xr, |
|
|
double * |
xi, |
|
|
double * |
br, |
|
|
double * |
bi, |
|
|
int * |
options, |
|
|
double * |
params, |
|
|
int * |
proc_config, |
|
|
AZ_MATRIX * |
Amat_real, |
|
|
double * |
val_imag, |
|
|
double ** |
x, |
|
|
double ** |
b, |
|
|
AZ_MATRIX ** |
Amat_komplex |
|
) |
| |
Create Komplex System from Real and Imaginary Parts.
Transforms a complex-valued system
(Ar +i*Ai) * (xr + i*xi) = (br + i*bi)
where double precision arrays hold the real and imaginary parts separately. The pattern of the imaginary part matches the real part. Thus no structure for the imaginary part is passed in.
- Parameters
-
| xr | (In) Real part of initial guess. |
| xi | (In) Imaginary part of initial guess. |
| br | (In) Real part of right hand side of linear system. |
| bi | (In) Imaginary part of right hand side of linear system. |
| options | (In) Determines specific solution method and other parameters. |
| params | (In) Drop tolerance and convergence tolerance info.
|
| proc_config | (In) Machine configuration. proc_config[AZ_node] is the node number. proc_config[AZ_N_procs] is the number of processors. |
| Amat_real | (In) AZ_MATRIX object containing real matrix. |
| val_imag | (In) Double arrya containing the values ONLY for imaginary matrix. |
| x | (Out) Komplex version of initial guess and solution. |
| b | (Out) Komplex version of RHS. |
| Amat_komplex | (Out) Komplex version of matrix stored as an AZ_MATRIX structure. |
References AZK_create_matrix_ri2k(), AZK_create_vector_ri2k(), and AZK_permute_ri().
void AZK_create_linsys_g2k(double *xr, double *xi, double *br, double *bi, int *options, double *params, int *proc_config, double c0r, double c0i, AZ_MATRIX *Amat_mat0, double c1r, double c1i, AZ_MATRIX *Amat_mat1, double **x, double **b, AZ_MATRIX **Amat_komplex)
Create Komplex System from General System.
Definition: azk_create_linsys.c:227
Definition: Komplex_RowMatrix.h:70
const Epetra_Map & OperatorRangeMap() const
Returns the Epetra_Map object associated with the range of this matrix operator.
int Length() const
Returns the length of the vector.
Definition: Komplex_Vector.cpp:158
int ReplaceMap(const Epetra_BlockMap &map)
Definition: Komplex_Vector.cpp:163
void AZK_create_vector_g2k(int *options, double *params, int *proc_config, AZ_MATRIX *Amat_komplex, double *vr, double *vi, double **vk)
Create Komplex vector from Real and Imaginary Parts.
Definition: azk_create_vector.c:205
const Epetra_Comm & Comm() const
void AZK_destroy_linsys(int *options, double *params, int *proc_config, double **x, double **b, AZ_MATRIX **Amat_komplex)
Destroy a Komplex System.
Definition: azk_destroy_linsys.c:141
bool UseTranspose() const
Returns the current UseTranspose setting.
Definition: Komplex_RowMatrix.cpp:365
int Norm1(double *Result) const
Compute the 1-norm of each vector in multivector.
Definition: Komplex_MultiVector.cpp:652
int NumMyElements() const
int ReplaceGlobalValue(int GlobalRow, int VectorIndex, double ScalarValue)
int LeftScale(const Epetra_Vector &x)
Scales the Komplex_RowMatrix on the left with a Epetra_Vector x.
Definition: Komplex_RowMatrix.cpp:236
virtual int NumProc() const=0
virtual ~Komplex_Vector()
Komplex_Vector destructor.
Definition: Komplex_Vector.cpp:73
Epetra_LinearProblem * KomplexProblem() const
Returns pointer to the Epetra_LinearProblem object that defines the Komplex formulation.
Definition: Komplex_LinearProblem.h:167
int ReplaceMyValue(int MyRow, int VectorIndex, double ScalarValue)
Replace current value at the specified (MyRow, VectorIndex) location with ScalarValue.
Definition: Komplex_MultiVector.cpp:350
const Epetra_CrsGraph & Graph() const
Returns a reference to the Epetra_CrsGraph object associated with this matrix.
Definition: Komplex_RowMatrix.cpp:154
bool RHS() const
Returns true if this is a right-hand side multivector, false otherwise.
bool StorageOptimized() const
If OptimizeStorage() has been called, this query returns true; otherwise it returns false.
Definition: Komplex_RowMatrix.cpp:130
void AZK_create_linsys_c2k(double *xc, double *bc, int *options, double *params, int *proc_config, AZ_MATRIX *Amat_complex, double **x, double **b, AZ_MATRIX **Amat_komplex)
Create Komplex System from Complex System.
Definition: azk_create_linsys.c:150
int NumGlobalCols() const
Returns the number of global matrix columns.
Definition: Komplex_RowMatrix.cpp:276
int InvRowSums(Epetra_Vector &x) const
Computes the sum of absolute values of the rows of the Komplex_RowMatrix, results returned in x.
Definition: Komplex_RowMatrix.cpp:232
double NormInf() const
Returns the infinity norm of the global matrix.
Definition: Komplex_RowMatrix.cpp:256
int * FirstPointInElementList() const
void AZK_create_matrix_ri2k(int options[], double params[], int proc_config[], AZ_MATRIX *Amat_real, double *val_imag, AZ_MATRIX **Amat_komplex)
Create Komplex Matrix from Real and Imaginary Parts.
Definition: azk_create_matrix.c:1073
void Reset(Komplex_KForms NewKForm)
Reset the values of P_ and D_ to their original state and set KForm_ to NewKForm.
Definition: Komplex_Ordering.cpp:168
int PutScalar(double ScalarConstant)
int SetUseTranspose(bool UseTranspose)
If set true, transpose of this operator will be applied.
Definition: Komplex_RowMatrix.cpp:347
Komplex_Ordering: A class for manipulating the KForm of various Komplex objects.
Definition: Komplex_Ordering.h:59
bool UpperTriangular() const
If matrix is upper triangular in local index space, this query returns true; otherwise it returns fal...
Definition: Komplex_RowMatrix.cpp:252
int SwitchKForm(Komplex_KForms NewKForm)
Switches the current K form.
Definition: Komplex_Ordering.cpp:92
void AZK_create_precon(int *options, double *params, int *proc_config, double *x, double *b, AZ_MATRIX *Amat, AZ_PRECOND **Prec)
Create a Preconditioner for a Komplex matrix.
Definition: azk_create_precon.c:93
int InvColSums(Epetra_Vector &x) const
Computes the sum of absolute values of the columns of the Komplex_RowMatrix, results returned in x.
Definition: Komplex_RowMatrix.cpp:240
Definition: Komplex_DataAccess.hpp:56
virtual ~Komplex_RowMatrix()
Komplex_RowMatrix Destructor.
Definition: Komplex_RowMatrix.cpp:118
const Epetra_BlockMap & Map() const
int FillComplete()
Signal that data entry is complete. Perform transformations to local index space.
Definition: Komplex_RowMatrix.cpp:198
int MyScaling(int MyRow, double &Scalar)
Definition: Komplex_Ordering.cpp:162
Komplex_RowMatrix(Epetra_DataAccess CV, const Epetra_BlockMap &RowMap, int NumEntriesPerRow, Komplex_KForms KForm=K1)
Default Komplex_RowMatrix constuctor with fixed number of indices per row.
Definition: Komplex_RowMatrix.cpp:45
int NumVectors() const
Returns the number of vectors in the multivector.
Definition: Komplex_MultiVector.cpp:1483
int ScalingVector(double *Scales)
Definition: Komplex_Ordering.cpp:125
int RightScale(const Epetra_Vector &x)
Scales the Komplex_RowMatrix on the right with a Epetra_Vector x.
Definition: Komplex_RowMatrix.cpp:244
int MyLength() const
Returns the local vector length on the calling processor of vectors in the multivector.
Definition: Komplex_MultiVector.cpp:1488
Komplex_MultiVector: A class for constructing and using equivalent real formulations of dense complex...
Definition: Komplex_MultiVector.h:157
void AZK_create_vector_ri2k(int *options, double *params, int *proc_config, AZ_MATRIX *Amat_komplex, double *vr, double *vi, double **vk)
Create Komplex vector from Real and Imaginary Parts.
Definition: azk_create_vector.c:245
void AZK_destroy_vector(int *options, double *params, int *proc_config, AZ_MATRIX *Amat_komplex, double **vk)
Destroy a Komplex vector.
Definition: azk_destroy_vector.c:140
void AZK_extract_solution_k2c(int *options, double *params, int *proc_config, AZ_MATRIX *Amat_komplex, AZ_PRECOND *Prec, double *vk, double *vc)
Extract a Complex vector from a Komplex vector.
Definition: azk_extract_solution.c:144
int NumGlobalNonzeros() const
Returns the number of nonzero entries in the global matrix.
Definition: Komplex_RowMatrix.cpp:280
int Apply(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of a Epetra_Operator applied to a Epetra_MultiVector X in Y.
Definition: Komplex_Operator.cpp:70
double *& ImagValues(int i) const
Vector access function.
Definition: Komplex_MultiVector.cpp:1439
int NumMyCols() const
Returns the number of matrix columns owned by the calling processor.
Definition: Komplex_RowMatrix.cpp:268
int MinValue(double *Result) const
const Epetra_Map & ColMap() const
Returns the Epetra_Map object that describes the set of column-indices that appear in each processor'...
Definition: Komplex_RowMatrix.cpp:162
int MeanValue(double *Result) const
virtual void Barrier() const=0
Komplex_DataAccess
Definition: Komplex_DataAccess.hpp:54
int GlobalLength() const
Returns the global vector length of vectors in the multivector.
Definition: Komplex_MultiVector.cpp:1497
void AZK_permute_ri(int *options, double *params, int *proc_config, double *b, AZ_MATRIX *Amat_komplex)
Permute a Komplex system for better numerical stability.
Definition: azk_permute_ri.c:168
int SumIntoMyValues(int NumEntries, double *Values, int *Indices)
Sum values into a vector with a given indexed list of values, indices are in local index space.
Definition: Komplex_Vector.cpp:93
int MaxElementSize() const
const Epetra_Import * RowMatrixImporter() const
Returns the Epetra_Import object that contains the import operations for distributed operations.
Definition: Komplex_RowMatrix.cpp:335
void AZK_create_matrix_c2k(int options[], double params[], int proc_config[], AZ_MATRIX *Amat_complex, AZ_MATRIX **Amat_komplex)
Create Komplex matrix from Complex matrix.
Definition: azk_create_matrix.c:137
int MinValue(double *Result) const
Compute minimum value of each vector in multivector.
Definition: Komplex_MultiVector.cpp:926
void AZK_destroy_vector(int *options, double *params, int *proc_config, AZ_MATRIX *Amat_komplex, double **vk)
Destroy a Komplex vector.
Definition: azk_destroy_vector.c:140
int Apply(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of a Epetra_Operator applied to a Epetra_MultiVector X in Y.
Definition: Komplex_RowMatrix.cpp:351
int SumIntoMyValue(int MyRow, int VectorIndex, double ScalarValue)
void AZK_create_linsys_ri2k(double *xr, double *xi, double *br, double *bi, int *options, double *params, int *proc_config, AZ_MATRIX *Amat_real, double *val_imag, double **x, double **b, AZ_MATRIX **Amat_komplex)
Create Komplex System from Real and Imaginary Parts.
Definition: azk_create_linsys.c:300
int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of a Epetra_Operator inverse applied to an Epetra_MultiVector X in Y.
Definition: Komplex_RowMatrix.cpp:356
int Scale(double ScalarConstant)
Multiply all values in the matrix by a constant value (in place: A <- ScalarConstant * A).
Definition: Komplex_RowMatrix.cpp:190
double & operator[](int index)
Element access function.
Definition: Komplex_Vector.cpp:148
int NumMyRowEntries(int MyRow, int &NumEntries) const
Return the current number of values stored for the specified local row.
Definition: Komplex_RowMatrix.cpp:315
int ReplaceGlobalValue(int GlobalRow, int VectorIndex, double ScalarValue)
Replace current value at the specified (GlobalRow, VectorIndex) location with ScalarValue.
Definition: Komplex_MultiVector.cpp:242
int ExtractDiagonalCopy(Epetra_Vector &Diagonal) const
Returns a copy of the main diagonal in a user-provided vector.
Definition: Komplex_RowMatrix.cpp:319
bool IndicesAreLocal() const
If matrix indices have been transformed to local, this query returns true; otherwise it returns false...
Definition: Komplex_RowMatrix.cpp:138
Komplex_KForms KForm(void)
Returns the current K form.
Definition: Komplex_Ordering.cpp:87
int SumIntoMyValue(int MyRow, int VectorIndex, double ScalarValue)
Add ScalarValue to existing value at the specified (MyRow, VectorIndex) location.
Definition: Komplex_MultiVector.cpp:404
Epetra_MultiVector * EpetraMultiVector() const
Vector access function.
Definition: Komplex_MultiVector.cpp:1311
int Abs(const Epetra_MultiVector &A)
void AZK_create_vector_g2k(int *options, double *params, int *proc_config, AZ_MATRIX *Amat_komplex, double *vr, double *vi, double **vk)
Create Komplex vector from Real and Imaginary Parts.
Definition: azk_create_vector.c:205
int NumGlobalElements() const
int ComplexNorm1(double *Result) const
Compute the 1-norm of each vector, regarded as a complex vector, in multivector.
Definition: Komplex_MultiVector.cpp:678
int Norm1(double &Result) const
Compute 1-norm of the this vector.
Definition: Komplex_Vector.cpp:128
int SumIntoGlobalValue(int GlobalRow, int VectorIndex, double ScalarValue)
void AZK_create_matrix_g2k(int options[], double params[], int proc_config[], double c0r, double c0i, AZ_MATRIX *Amat_mat0, double c1r, double c1i, AZ_MATRIX *Amat_mat1, AZ_MATRIX **Amat_komplex)
Create Komplex Matrix from General Matrix.
Definition: azk_create_matrix.c:436
bool Filled() const
If this matrix has been filled, this query returns true; otherwise it returns false.
Definition: Komplex_RowMatrix.cpp:126
int ReplaceMyValue(int MyRow, int VectorIndex, double ScalarValue)
int NormInf(double &Result) const
Compute Inf-norm of the this vector.
Definition: Komplex_Vector.cpp:138
void AZK_create_matrix_g2k(int options[], double params[], int proc_config[], double c0r, double c0i, AZ_MATRIX *Amat_mat0, double c1r, double c1i, AZ_MATRIX *Amat_mat1, AZ_MATRIX **Amat_komplex)
Create Komplex Matrix from General Matrix.
Definition: azk_create_matrix.c:436
void CreateOtherMap()
Creates a map one-half or twice the size of the existing map, allowing for return of the real parts,...
Definition: Komplex_MultiVector.cpp:528
Komplex_LinearProblem(double c0r, double c0i, const Epetra_RowMatrix &A0, double c1r, double c1i, const Epetra_RowMatrix &A1, const Epetra_MultiVector &Xr, const Epetra_MultiVector &Xi, const Epetra_MultiVector &Br, const Epetra_MultiVector &Bi)
Komplex_LinearProblem constructor.
Definition: Komplex_LinearProblem.cpp:52
int Update(double ScalarA, const Komplex_MultiVector &A, double ScalarThis)
Update multivector values with scaled values of A, this = ScalarThis*this + ScalarA*A.
Definition: Komplex_MultiVector.cpp:612
const Epetra_Comm & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this operator.
Definition: Komplex_Operator.cpp:96
const Epetra_Map & RowMap() const
Returns the Epetra_Map object associated with the rows of this matrix.
Definition: Komplex_RowMatrix.cpp:158
virtual const Epetra_Map & RowMatrixRowMap() const=0
int NumMyDiagonals() const
Returns the number of local nonzero diagonal entries, based on global row/column index comparisons.
Definition: Komplex_RowMatrix.cpp:284
int ExtractCopy(double *V) const
bool NoDiagonal() const
If matrix has no diagonal entries in global index space, this query returns true; otherwise it return...
Definition: Komplex_RowMatrix.cpp:146
Epetra_Vector * ImagVector(int index) const
Single vector conversion to Epetra_Vector, including only the imaginary values.
Definition: Komplex_MultiVector.cpp:1382
int MaxNumEntries() const
Returns the maximum of NumMyRowEntries() over all rows.
Definition: Komplex_RowMatrix.cpp:323
Definition: Komplex_DataAccess.hpp:54
const Epetra_Import * Importer() const
Returns the Epetra_Import object that contains the import operations for distributed operations.
Definition: Komplex_RowMatrix.cpp:174
int SumIntoGlobalValues(int NumEntries, double *Values, int *Indices)
Sum values into a vector with a given indexed list of values, indices are in global index space.
Definition: Komplex_Vector.cpp:88
virtual int NumMyRows() const=0
int NormInf(double *Result) const
Compute the Inf-norm of each vector in multivector.
Definition: Komplex_MultiVector.cpp:744
void AZK_destroy_matrix(int options[], double params[], int proc_config[], AZ_MATRIX **Amat_komplex)
Destroy a Komplex Matrix.
Definition: azk_destroy_matrix.c:134
const Epetra_Map & OperatorRangeMap() const
Returns the Epetra_Map object associated with the range of this operator.
Definition: Komplex_Operator.cpp:104
bool IndicesAreContiguous() const
If matrix indices are packed into single array (done in OptimizeStorage()) return true,...
Definition: Komplex_RowMatrix.cpp:142
int ExtractSolution(Epetra_MultiVector &Xr, Epetra_MultiVector &Xi)
Extrac a solution for the original complex-valued problem using the solution of the Komplex problem.
Definition: Komplex_LinearProblem.cpp:313
double ** Pointers() const
void AZK_create_linsys_ri2k(double *xr, double *xi, double *br, double *bi, int *options, double *params, int *proc_config, AZ_MATRIX *Amat_real, double *val_imag, double **x, double **b, AZ_MATRIX **Amat_komplex)
Create Komplex System from Real and Imaginary Parts.
Definition: azk_create_linsys.c:300
int IndexBase() const
Returns the index base for row and column indices for this graph.
Definition: Komplex_RowMatrix.cpp:150
int GlobalIndex(int GlobalRow, int &Index)
Definition: Komplex_Ordering.cpp:130
int NormWeighted(const Epetra_MultiVector &Weights, double *Result) const
int SetSeed(unsigned int Seed_in)
int ReplaceMyValues(int NumEntries, double *Values, int *Indices)
Replace values in a vector with a given indexed list of values, indices are in local index space.
Definition: Komplex_Vector.cpp:83
void AZK_create_vector_ri2k(int *options, double *params, int *proc_config, AZ_MATRIX *Amat_komplex, double *vr, double *vi, double **vk)
Create Komplex vector from Real and Imaginary Parts.
Definition: azk_create_vector.c:245
Komplex_Vector(const Epetra_BlockMap &Map, bool zeroOut=true)
Basic Komplex_Vector constuctor.
Definition: Komplex_Vector.cpp:48
const Epetra_Map & RowMatrixColMap() const
Returns the Epetra_Map object associated with columns of this matrix.
Definition: Komplex_RowMatrix.cpp:331
double *& RealValues(int i) const
Vector access function.
Definition: Komplex_MultiVector.cpp:1395
int ComplexNorm2(double *Result) const
Compute the 2-norm of each vector, regarded as a complex vector, in multivector.
Definition: Komplex_MultiVector.cpp:739
const Epetra_Map & DomainMap() const
Returns the Epetra_Map object associated with the domain of this matrix operator.
Definition: Komplex_RowMatrix.cpp:166
virtual ~Komplex_LinearProblem()
Komplex_LinearProblem Destructor.
Definition: Komplex_LinearProblem.cpp:194
int Scale(double ScalarValue)
int PutScalar(double ScalarConstant)
Initialize all values in the matrix with constant value.
Definition: Komplex_RowMatrix.cpp:186
int NormWeighted(const Epetra_MultiVector &Weights, double *Result) const
Compute the Weighted 2-norm (RMS Norm) of each vector in multivector.
Definition: Komplex_MultiVector.cpp:823
int NumMyRows() const
Returns the number of matrix rows owned by the calling processor.
int Dot(const Komplex_MultiVector &A, double *Result) const
Computes dot product of each corresponding pair of vectors.
Definition: Komplex_MultiVector.cpp:537
int ExtractGlobalRowCopy(int GlobalRow, int Length, int &NumEntries, double *Values, int *Indices) const
Returns a copy of the specified global row in user-provided arrays.
Definition: Komplex_RowMatrix.cpp:292
bool LowerTriangular() const
If matrix is lower triangular in local index space, this query returns true; otherwise it returns fal...
Definition: Komplex_RowMatrix.cpp:248
Komplex_MultiVector & operator=(const Komplex_MultiVector &Source)
= Operator.
Definition: Komplex_MultiVector.cpp:1143
void AZK_destroy_precon(int *options, double *params, int *proc_config, AZ_MATRIX *Amat, AZ_PRECOND **Prec)
Destroy a Komplex preconditioner.
Definition: azk_destroy_precon.c:87
int Random()
Set multivector values to random numbers.
Definition: Komplex_MultiVector.cpp:511
int SetUseTranspose(bool UseTranspose)
If set true, the transpose of this operator will be applied.
Definition: Komplex_Operator.cpp:66
int Scale(double ScalarValue)
Scale the current values of a multivector, this = ScalarValue*this.
Definition: Komplex_MultiVector.cpp:577
int MaxValue(double *Result) const
int ExtractMyRowView(int MyRow, int &NumEntries, double *&Values, int *&Indices) const
void AZK_create_linsys_c2k(double *xc, double *bc, int *options, double *params, int *proc_config, AZ_MATRIX *Amat_complex, double **x, double **b, AZ_MATRIX **Amat_komplex)
Create Komplex System from Complex System.
Definition: azk_create_linsys.c:150
Komplex_Operator: A class for using complex-valued double-precision operators stored in equivalent re...
Definition: Komplex_Operator.h:81
const char * Label() const
Returns a character string describing the operator.
Definition: Komplex_RowMatrix.cpp:343
void AZK_destroy_matrix(int options[], double params[], int proc_config[], AZ_MATRIX **Amat_komplex)
Destroy a Komplex Matrix.
Definition: azk_destroy_matrix.c:134
int ReplaceMap(const Epetra_BlockMap &map)
int PutScalar(double ScalarConstant)
Initialize all values in a multivector with constant value.
Definition: Komplex_MultiVector.cpp:458
int NumGlobalDiagonals() const
Returns the number of global nonzero diagonal entries, based on global row/column index comparisons.
Definition: Komplex_RowMatrix.cpp:288
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.
Definition: Komplex_RowMatrix.cpp:307
int ReplaceDiagonalValues(const Epetra_Vector &Diagonal)
Replaces diagonal values of the matrix with those in the user-provided vector.
Definition: Komplex_RowMatrix.cpp:194
void AZK_destroy_linsys(int *options, double *params, int *proc_config, double **x, double **b, AZ_MATRIX **Amat_komplex)
Destroy a Komplex System.
Definition: azk_destroy_linsys.c:141
int MyGlobalElements(int *MyGlobalElementList) const
int UpdateValues(double c0r, double c0i, const Epetra_RowMatrix &A0, double c1r, double c1i, const Epetra_RowMatrix &A1, const Epetra_MultiVector &Xr, const Epetra_MultiVector &Xi, const Epetra_MultiVector &Br, const Epetra_MultiVector &Bi)
Update the values of the equivalent real valued system.
Definition: Komplex_LinearProblem.cpp:65
int NumGlobalRows() const
Returns the number of global matrix rows.
Definition: Komplex_RowMatrix.cpp:272
int MyIndex(int MyRow, int &Index)
Definition: Komplex_Ordering.cpp:156
~Komplex_Operator()
Destructor.
Definition: Komplex_Operator.cpp:62
Komplex_DataAccess Mode enumerable type.
bool SameAs(const Epetra_BlockMap &Map) const
Epetra_MultiVector * ImagMultiVector() const
Conversion of imaginary parts to Epetra_MultiVector.
Definition: Komplex_MultiVector.cpp:1341
virtual ~Komplex_Ordering(void)
Komplex_Ordering destructor.
Definition: Komplex_Ordering.cpp:83
Komplex_LinearProblem: A class for forming an equivalent real formulation of a complex valued problem...
Definition: Komplex_LinearProblem.h:108
double NormInf() const
Returns the infinity norm of the global matrix.
Definition: Komplex_Operator.cpp:80
const Epetra_Map & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this operator.
Definition: Komplex_Operator.cpp:100
virtual void Print(ostream &os) const
Print method.
Definition: Komplex_MultiVector.cpp:1533
bool HasNormInf() const
Returns true if the this object can provide an approximate Inf-norm, false otherwise.
Definition: Komplex_Operator.cpp:92
int ReplaceMap(const Epetra_BlockMap &map)
Replace map, only if new map has same point-structure as current map.
Definition: Komplex_MultiVector.cpp:1516
int ComplexNormInf(double *Result) const
Compute the Inf-norm of each vector, regarded as a comnplex vector, in multivector.
Definition: Komplex_MultiVector.cpp:791
bool HasNormInf() const
Returns true because this class can compute an Inf-norm.
Definition: Komplex_RowMatrix.cpp:361
virtual ~Komplex_MultiVector()
Komplex_MultiVector destructor.
Definition: Komplex_MultiVector.cpp:229
Komplex_MultiVector(const Epetra_BlockMap &Map, int NumVectors, bool RHS, bool zeroOut=true, Komplex_KForms KForm=K1)
Basic Komplex_MultiVector constuctor.
Definition: Komplex_MultiVector.cpp:52
void Print(ostream &os) const
Print method.
Definition: Komplex_Vector.cpp:168
virtual int ExtractMyRowCopy(int MyRow, int Length, int &NumEntries, double *Values, int *Indices) const=0
const Epetra_Map & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this matrix operator.
Komplex_KForms KForm() const
Returns the current K form.
Definition: Komplex_MultiVector.cpp:1506
void AZK_permute_ri(int *options, double *params, int *proc_config, double *b, AZ_MATRIX *Amat_komplex)
Permute a Komplex system for better numerical stability.
Definition: azk_permute_ri.c:168
int Reciprocal(const Epetra_MultiVector &A)
int MaxValue(double *Result) const
Compute maximum value of each vector in multivector.
Definition: Komplex_MultiVector.cpp:993
virtual const Epetra_Map & RowMatrixColMap() const=0
int Norm2(double &Result) const
Compute 2-norm of the this vector.
Definition: Komplex_Vector.cpp:133
virtual int MaxNumEntries() const=0
int ReplaceGlobalValues(int NumEntries, double *Values, int *Indices)
Replace values in a vector with a given indexed list of values, indices are in global index space.
Definition: Komplex_Vector.cpp:78
const char * Label() const
Returns a character string describing the operator.
Definition: Komplex_Operator.cpp:84
void Print(ostream &os) const
Print method.
Definition: Komplex_RowMatrix.cpp:339
void AZK_destroy_precon(int *options, double *params, int *proc_config, AZ_MATRIX *Amat, AZ_PRECOND **Prec)
Destroy a Komplex preconditioner.
Definition: azk_destroy_precon.c:87
int Dot(const Epetra_MultiVector &A, double *Result) const
int NumMyNonzeros() const
Returns the number of nonzero entries owned by the calling processor.
Definition: Komplex_RowMatrix.cpp:264
void AZK_create_matrix_ri2k(int options[], double params[], int proc_config[], AZ_MATRIX *Amat_real, double *val_imag, AZ_MATRIX **Amat_komplex)
Create Komplex Matrix from Real and Imaginary Parts.
Definition: azk_create_matrix.c:1073
int SumIntoGlobalValue(int GlobalRow, int VectorIndex, double ScalarValue)
Add ScalarValue to existing value at the specified (GlobalRow, VectorIndex) location.
Definition: Komplex_MultiVector.cpp:296
Include file for Aztec Komplex Library.
void AZK_create_matrix_c2k(int options[], double params[], int proc_config[], AZ_MATRIX *Amat_complex, AZ_MATRIX **Amat_komplex)
Create Komplex matrix from Complex matrix.
Definition: azk_create_matrix.c:137
virtual const Epetra_Map & OperatorRangeMap() const=0
Komplex_Operator(Epetra_DataAccess CV, Epetra_Operator *Operator, Komplex_KForms KForm=K1)
Komplex_Operator constructor from one object.
Definition: Komplex_Operator.cpp:45
const Epetra_Map & RangeMap() const
Returns the Epetra_Map object associated with the range of this matrix operator.
Definition: Komplex_RowMatrix.cpp:170
Epetra_Vector * EpetraVector(int index) const
Single vector conversion to Epetra_Vector.
Definition: Komplex_MultiVector.cpp:1356
const Epetra_Export * Exporter() const
Returns the Epetra_Export object that contains the export operations for distributed operations.
Definition: Komplex_RowMatrix.cpp:178
bool IndicesAreGlobal() const
If matrix indices have not been transformed to local, this query returns true; otherwise it returns f...
Definition: Komplex_RowMatrix.cpp:134
Epetra_MultiVector * RealMultiVector() const
Conversion of real parts to Epetra_MultiVector.
Definition: Komplex_MultiVector.cpp:1326
Komplex_Vector & operator=(const Komplex_Vector &Source)
= Operator.
Definition: Komplex_Vector.cpp:143
unsigned int Seed() const
Get seed from Random function.
Definition: Komplex_MultiVector.cpp:1138
void AZK_extract_solution_k2ri(int *options, double *params, int *proc_config, AZ_MATRIX *Amat_komplex, AZ_PRECOND *Prec, double *vk, double *vr, double *vi)
Extract real/imaginary parts of a complex vector from a Komplex vector.
Definition: azk_extract_solution.c:232
void AZK_create_precon(int *options, double *params, int *proc_config, double *x, double *b, AZ_MATRIX *Amat, AZ_PRECOND **Prec)
Create a Preconditioner for a Komplex matrix.
Definition: azk_create_precon.c:93
int SwitchKForm(Komplex_KForms NewKForm)
Switches the current K form.
Definition: Komplex_MultiVector.cpp:1511
int SetSeed(unsigned int Seed)
Set seed for Random function.
Definition: Komplex_MultiVector.cpp:1121
int Abs(const Komplex_MultiVector &A)
Puts element-wise absolute values of input multivector in target.
Definition: Komplex_MultiVector.cpp:543
int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of a Epetra_Operator inverse applied to an Epetra_MultiVector X in Y.
Definition: Komplex_Operator.cpp:75
void AZK_create_linsys_g2k(double *xr, double *xi, double *br, double *bi, int *options, double *params, int *proc_config, double c0r, double c0i, AZ_MATRIX *Amat_mat0, double c1r, double c1i, AZ_MATRIX *Amat_mat1, double **x, double **b, AZ_MATRIX **Amat_komplex)
Create Komplex System from General System.
Definition: azk_create_linsys.c:227
double NormOne() const
Returns the one norm of the global matrix.
Definition: Komplex_RowMatrix.cpp:260
Epetra_Vector * RealVector(int index) const
Single vector conversion to Epetra_Vector, including only the real values.
Definition: Komplex_MultiVector.cpp:1369
int PermutationVector(int *Perms)
Definition: Komplex_Ordering.cpp:115
const Epetra_Comm & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this matrix.
Definition: Komplex_RowMatrix.cpp:182
int Reciprocal(const Komplex_MultiVector &A)
Puts element-wise reciprocal values of input multivector in target.
Definition: Komplex_MultiVector.cpp:560
void AZK_create_vector_c2k(int *options, double *params, int *proc_config, AZ_MATRIX *Amat_komplex, double *vc, double **vk)
Create Komplex vector from Complex vector.
Definition: azk_create_vector.c:142
double *& operator[](int i)
Vector access function.
Definition: Komplex_MultiVector.cpp:1171
bool UseTranspose() const
Returns the current UseTranspose setting.
Definition: Komplex_Operator.cpp:88
virtual const Epetra_Map & OperatorDomainMap() const=0
int Scale(double ScalarValue)
Scale the current values of the this vector, this = ScalarValue*this.
Definition: Komplex_Vector.cpp:118
virtual int MyPID() const=0
Komplex_Vector: A class for constructing and using dense vectors on a parallel computer.
Definition: Komplex_Vector.h:106
int Solve(bool Upper, bool Trans, bool UnitDiagonal, const Epetra_Vector &x, Epetra_Vector &y) const
Returns the result of a solve using the Komplex_RowMatrix on a Epetra_Vector x in y.
Definition: Komplex_RowMatrix.cpp:214
bool MyGID(int GID_in) const
int GlobalScaling(int GlobalRow, double &Scalar)
Definition: Komplex_Ordering.cpp:143
Komplex_Ordering(const Epetra_BlockMap &Map, Komplex_KForms KForm, bool IsOneObject)
Basic Komplex_Ordering constuctor.
Definition: Komplex_Ordering.cpp:48
int Multiply(bool TransA, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of a Komplex_RowMatrix multiplied by a Epetra_MultiVector X in Y.
Definition: Komplex_RowMatrix.cpp:207
const Epetra_Map & RowMatrixRowMap() const
Returns the Epetra_Map object associated with the rows of this matrix.
Definition: Komplex_RowMatrix.cpp:327
int MeanValue(double *Result) const
Compute mean (average) value of each vector in multivector.
Definition: Komplex_MultiVector.cpp:1062
int Norm2(double *Result) const
Compute the 2-norm of each vector in multivector.
Definition: Komplex_MultiVector.cpp:710
Definition: azk_komplex.h:166
int Update(double ScalarA, const Epetra_MultiVector &A, double ScalarThis)
void AZK_create_vector_c2k(int *options, double *params, int *proc_config, AZ_MATRIX *Amat_komplex, double *vc, double **vk)
Create Komplex vector from Complex vector.
Definition: azk_create_vector.c:142