RVLAlg::BallProjTerminator< Scalar > Class Template Reference

Terminator which takes x and a max for the norm r. More...

#include <vectorterm.hh>

Inheritance diagram for RVLAlg::BallProjTerminator< Scalar >:

RVLAlg::Terminator List of all members.

Public Types

typedef ScalarFieldTraits<
Scalar >::AbsType 
NormRetType

Public Member Functions

 BallProjTerminator (Vector< Scalar > &ty, NormRetType _maxstep, ostream &_str=cout)
virtual bool query ()

Protected Attributes

Vector< Scalar > & y
NormRetType maxstep
bool queryres
ostream & str

Detailed Description

template<class Scalar>
class RVLAlg::BallProjTerminator< Scalar >

Terminator which takes x and a max for the norm r.

Returns false if

$\|x\| < r$

Returns true otherwise, and projects x onto the ball of radius r centered at 0, that is, replaces x by

$ x \leftarrow \frac{r}{\|x\|}x $

Special case of DiffBallProjTerminator with x0=0.

In order to avoid possible false positive return due to roundoff when query() is called repeatedly on the same data, scale $x$ by slightly smaller factor than returned by floating point division.

Definition at line 421 of file vectorterm.hh.


Member Typedef Documentation

template<class Scalar>
typedef ScalarFieldTraits<Scalar>::AbsType RVLAlg::BallProjTerminator< Scalar >::NormRetType

Definition at line 423 of file vectorterm.hh.


Constructor & Destructor Documentation

template<class Scalar>
RVLAlg::BallProjTerminator< Scalar >::BallProjTerminator ( Vector< Scalar > &  ty,
NormRetType  _maxstep,
ostream &  _str = cout 
)

Definition at line 425 of file vectorterm.hh.


Member Function Documentation

template<class Scalar>
virtual bool RVLAlg::BallProjTerminator< Scalar >::query (  )  [virtual]

Implements RVLAlg::Terminator.

Definition at line 429 of file vectorterm.hh.

References RVLAlg::BallProjTerminator< Scalar >::maxstep, ProtectedDivision(), RVLAlg::BallProjTerminator< Scalar >::queryres, RVLAlg::BallProjTerminator< Scalar >::str, and RVLAlg::BallProjTerminator< Scalar >::y.


Member Data Documentation

template<class Scalar>
Vector<Scalar>& RVLAlg::BallProjTerminator< Scalar >::y [protected]

Definition at line 451 of file vectorterm.hh.

Referenced by RVLAlg::BallProjTerminator< Scalar >::query().

template<class Scalar>
NormRetType RVLAlg::BallProjTerminator< Scalar >::maxstep [protected]

Definition at line 452 of file vectorterm.hh.

Referenced by RVLAlg::BallProjTerminator< Scalar >::query().

template<class Scalar>
bool RVLAlg::BallProjTerminator< Scalar >::queryres [mutable, protected]

Definition at line 453 of file vectorterm.hh.

Referenced by RVLAlg::BallProjTerminator< Scalar >::query().

template<class Scalar>
ostream& RVLAlg::BallProjTerminator< Scalar >::str [protected]

Definition at line 454 of file vectorterm.hh.

Referenced by RVLAlg::BallProjTerminator< Scalar >::query().


The documentation for this class was generated from the following file:
Generated on 5 Jan 2017 for RvlAlg by  doxygen 1.4.7