Did I find the right examples for you? yes no      Crawl my project      Python Jobs

# cogent.maths.scipy_optimize.brent

All Samples(8)  |  Call(4)  |  Derive(0)  |  Import(4)

```#!/usr/bin/env python

from __future__ import division
import numpy, math, warnings
from cogent.maths.scipy_optimize import fmin_bfgs, fmin_powell, fmin, brent
```
```        fb = func(xb)
assert xb != xa, "Can't find a second in-bounds point on this line"
return brent(func, brack=(xa, xb), **kw)

```

```#!/usr/bin/env python

from __future__ import division
import numpy, math, warnings
from cogent.maths.scipy_optimize import fmin_bfgs, fmin_powell, fmin, brent
```
```        fb = func(xb)
assert xb != xa, "Can't find a second in-bounds point on this line"
return brent(func, brack=(xa, xb), **kw)

```

```        of the one scipy function that still needs to be removed
"""
from cogent.maths.scipy_optimize import fmin, brent
from cogent.util.array import scale_trace, norm_diff, \
has_neg_off_diags, sum_neg_off_diags, with_diag, without_diag
```
```                def similarity_f(t):
return abs(sum(diagonal(expm(q)(t)*freqs))-similarity)
return brent(similarity_f)

def toSimilarProbs(self, similarity, freqs=None):
```

```        of the one scipy function that still needs to be removed
"""
from cogent.maths.scipy_optimize import fmin, brent
from cogent.util.array import scale_trace, norm_diff, \
has_neg_off_diags, sum_neg_off_diags, with_diag, without_diag
```
```                def similarity_f(t):
return abs(sum(diagonal(expm(q)(t)*freqs))-similarity)
return brent(similarity_f)

def toSimilarProbs(self, similarity, freqs=None):
```