Re: [petsc-dev] TAO method selection (was "coding style")

2016-08-19 Thread Jed Brown
"Oxberry, Geoffrey Malcolm" writes: > I can’t think of one either. What is the origin of the algorithm PETSc > uses for MatMultEqual, and why use this algorithm instead of > Freivalds' algorithm? I realize you can probably use similar > probabilistic arguments for the PETSc algorithm as those used

Re: [petsc-dev] TAO method selection (was "coding style")

2016-08-19 Thread Oxberry, Geoffrey Malcolm
> On Aug 19, 2016, at 4:08 PM, Jed Brown wrote: > > "Oxberry, Geoffrey Malcolm" writes: >> Something similar can be used for quadratics. Here you evaluate >> the Hessian at two random points. You really want to calculate >> the distance between the matrices. I did not find that method >> in

Re: [petsc-dev] TAO method selection (was "coding style")

2016-08-19 Thread Jed Brown
"Oxberry, Geoffrey Malcolm" writes: > Something similar can be used for quadratics. Here you evaluate > the Hessian at two random points. You really want to calculate > the distance between the matrices. I did not find that method > in the PETSc documentation. Therefore, I would compare the >

Re: [petsc-dev] TAO method selection (was "coding style")

2016-08-19 Thread Oxberry, Geoffrey Malcolm
On Aug 19, 2016, at 4:13 AM, Munson, Todd mailto:tmun...@mcs.anl.gov>> wrote: Hi! The only provable way to test for linearity of a function is using code analysis. A quick hack that should work okay is to evaluate the gradient at two (or more) random points and calculate the distance between

Re: [petsc-dev] TAO method selection (was "coding style")

2016-08-19 Thread Munson, Todd
Hi! The only provable way to test for linearity of a function is using code analysis. A quick hack that should work okay is to evaluate the gradient at two (or more) random points and calculate the distance between the gradients. Note: this is not a good test for piecewise linear functions, as

[petsc-dev] TAO method selection (was "coding style")

2016-08-19 Thread Marco Zocca
How does a numerical method test for linearity (or in general order of nonlinearity) of an operator? By comparing function value with the first two Taylor terms, within machine precision? I suspect only code analysis ("reification", as in analysis of the expression syntax tree) would be feasible an