[Trilinos-Users] Teuchos::SerialDenseSolver issues with reciprocalConditionEstimate

Holger Brandsmeier holger.brandsmeier at sam.math.ethz.ch
Thu May 17 10:05:23 MDT 2012

Dear list,

I have two issues with reciprocalConditionEstimate.

-- First and most importantly: does anyone have success using this
function for std::complex<double>? I repeatedly get memory failures
malloc(): memory corruption: 0x00000000022d7bb0 ***

I get this error already for trivial 2x2 matrices, (in numpy syntax)
e.g. for this matrix:
[[ 2.+4.j  4.-1.j]
 [ 1.+2.j  2.+2.j]]

-- Second to the documentation and to `estimateSolutionErrors`:
There is a function reciprocalConditionEstimated() and it is not clear
(from the documentation) if a call to
reciprocalConditionEstimate(MagnitudeType &Value) gives valid results
if `reciprocalConditionEstimated()` is false (in fact it is valid).

There is a function `estimateSolutionErrors (bool flag)` that is
labeled a `Strategy Modifying Methods`, in my code it strangely never
behaves as such. It strongly depends on when you call it.

If I do (in python syntax):
  assert solver.factor() == 0
  assert solver.solve() == 0
  print 'reciprocal condition estimate:', solver.reciprocalConditionEstimate()
(Note that my python wrapper of `reciprocalConditionEstimate()`
returns a magnitudeType and throws an error if the LAPACK return type
is not zero).

Then the output is:
"reciprocal condition estimate: -1.0"

If instead I do
  assert solver.factor() == 0
  assert solver.solve() == 0

Then I even get an exception:

"Throw test that evaluated to true: A_==AF_
SerialDenseSolver<T>::applyRefinement: Cannot apply refinement if no
original copy of A!"

Only if I do:
  assert solver.factor() == 0
  assert solver.solve() == 0
  print 'reciprocal condition estimate:', solver.reciprocalConditionEstimate()
(of if I don't use `solver.estimateSolutionErrors(True)` at all) then
I get the correct result
reciprocal condition estimate: 0.04

All of these tests I did for the real-valued linear system with
A= [[ 2.  3.]
 [ 1.  2.]]
f= [[-1.]
 [ 2.]]

I am using Trilinos_VERSION 10.10.1.

Best regards,
Holger Brandsmeier

Holger Brandsmeier, SAM, ETH Zürich

More information about the Trilinos-Users mailing list