|
Class Summary |
| KSP |
|
| KSP.ComputeEigenvaluesExplicitlyResult |
Result class for KSP.computeEigenvaluesExplicitly(int) |
| KSP.ComputeEigenvaluesResult |
Result class for KSP.computeEigenvalues(int) |
| KSP.ComputeExtremeSingularValuesResult |
Result class for KSP.computeExtremeSingularValues() |
| KSP.GetOperatorsResult |
Result class for KSP.getOperators() |
| KSP.GetOperatorsSetResult |
Result class for KSP.getOperatorsSet() |
| KSP.GetTolerancesResult |
Result class for KSP.getTolerances() |
| Mat |
|
| Mat.CreateCompositeResult |
Result class for Mat.createComposite(int, int) |
| Mat.GetInertiaResult |
Result class for Mat.getInertia() |
| Mat.GetLocalSizeResult |
Result class for Mat.getLocalSize() |
| Mat.GetOwnershipRangeResult |
Result class for Mat.getOwnershipRange() |
| Mat.GetSizeResult |
Result class for Mat.getSize() |
| Mat.GetVecsResult |
Result class for Mat.getVecs() |
| Mat.IsHermitianKnownResult |
Result class for Mat.isHermitianKnown() |
| Mat.IsSymmetricKnownResult |
Result class for Mat.isSymmetricKnown() |
| Mat.StashGetInfoResult |
Result class for Mat.stashGetInfo() |
| MPI |
|
| MPI.TestanyResult |
Result class for MPI.testany(int, int[], de.jtem.jpetsc.MPIStatus) |
| MPIStatus |
|
| Native |
Common parent of PrimitvNatives that always create their native Object when they are created,
without any further information. |
| PETSc |
|
| PETSc.OptionsGetEListResult |
Result class for PETSc.optionsGetEList(java.lang.String, java.lang.String, int) |
| PETSc.OptionsGetIntResult |
Result class for PETSc.optionsGetInt(java.lang.String, java.lang.String) |
| PETSc.OptionsGetRealResult |
Result class for PETSc.optionsGetReal(java.lang.String, java.lang.String) |
| PETSc.OptionsGetScalarResult |
Result class for PETSc.optionsGetScalar(java.lang.String, java.lang.String) |
| PETSc.OptionsGetTruthResult |
Result class for PETSc.optionsGetTruth(java.lang.String, java.lang.String) |
| PrimitivNative |
Common parent of classes that have a corresponding native class. |
| SNES |
|
| SNES.KSPGetParametersEWResult |
Result class for SNES.kSPGetParametersEW() |
| Vec |
|
| Vec.GetOwnershipRangeResult |
Result class for Vec.getOwnershipRange() |
| Vec.MaxResult |
Result class for Vec.max() |
| Vec.MinResult |
Result class for Vec.min() |
| Vec.StashGetInfoResult |
Result class for Vec.stashGetInfo() |
| Vec.StrideMaxAllResult |
Result class for Vec.strideMaxAll() |
| Vec.StrideMaxResult |
Result class for Vec.strideMax(int) |
| Vec.StrideMinAllResult |
Result class for Vec.strideMinAll() |
| Vec.StrideMinResult |
Result class for Vec.strideMin(int) |
This package makes
a part of the functionality of the numeric library
PETSc
accessible for Java programs.
It utilizes the JNI to achieve that.
How to use
It's similar to PETSc
The names of the classes (= structures in c) and methods are the same (only adapted to Java naming conventions) and
especially the functionality of the methods are at least hoped to be the same. Functions that belong
logically to some structure (e.g. Vec or Mat) in both libraries carry the structure Name as Prefix
(e.g. MatGetSize). That prefix is stripped off for those functions, that become members of the corresponding
class the same time.
Some further differences are necessary
Because of the different natures of c and java mainly two big changes to the API were necessary:
-
The exception handling in PETSc is realized with a PetscErrorCode as return value for every function.
This is translated to java exception handling. So every method can throw a PETScError, which is
a child of java.lang.Error (=> you don't have to catch it) and return something else.
-
As the return value is used on the c side for exceptions, the only available ways back to
the caller are reference or pointer arguments. Additionally in both of the libraries it
is quite common to use multiple parameters of methods as "return values".
This problem is solved on the java side by packing multiple return values to one returned object
of an individual class for each concerned function. If the function has only one "return value" it is
just returned. (thanks to the java exception handling that is possible in contrast to the c side situation)
-
For some functions that get arrays by passing its pointer and size as two parameters are
translated to get only one array parameter. Because the correspondence between an array's pointer and its
size is not found automatically this is not done for all functions. If not it is important to
pass the right size besides the array. Otherwise the VM could crash.
To give an example for these changes let's look at the following c prototype:
PetscErrorCode MatGetSize(Mat mat,PetscInt *m,PetscInt* n);
it is translated to java to the following Mat class's members:
public static class GetSizeResult {
public final int m;
public final int n;
}
public native GetSizeResult getSize();