realroot_doc 0.1.1
bzenv< X > Struct Template Reference

#include <bernstein_bzenv.hpp>

List of all members.

Public Types

Public Member Functions

Public Attributes

Static Public Attributes


Detailed Description

template<class X>
struct mmx::bernstein::bzenv< X >

Definition at line 17 of file bernstein_bzenv.hpp.


Member Typedef Documentation

typedef int size_t

Definition at line 19 of file bernstein_bzenv.hpp.


Constructor & Destructor Documentation

bzenv ( int  n = 100) [inline]

Definition at line 23 of file bernstein_bzenv.hpp.

: m_bins(n) {};

Member Function Documentation

const X& binomial ( size_t  n,
size_t  i 
) [inline]

Definition at line 97 of file bernstein_bzenv.hpp.

References binomials< T >::binomial(), and bzenv< X >::m_bins.

{ return m_bins.binomial(n,i); };
void elevate ( T *  dst,
T *  src,
size_t  sz,
int  sts,
int  stdst,
size_t  n 
) [inline]

Definition at line 54 of file bernstein_bzenv.hpp.

References bzenv< X >::scale(), bzenv< X >::scaled_elevate(), and bzenv< X >::uscale().

    {
      scale(src,sz,sts);
      scaled_elevate(dst,src,sz,sts,stdst,n);
      uscale(src,sz,sts);
      uscale(dst,sz+n,stdst);
    };
void fromMonoms ( T *  bzc,
size_t  sz,
int  st = 1 
) [inline]

Definition at line 91 of file bernstein_bzenv.hpp.

References bzenv< X >::fromMonomsToScaled(), and bzenv< X >::uscale().

    {
      fromMonomsToScaled( bzc, sz, st );
      uscale(bzc,sz,st);
    };
void fromMonomsToScaled ( T *  bzc,
size_t  sz,
int  st 
) [inline]

Definition at line 75 of file bernstein_bzenv.hpp.

References binomials< T >::get(), and bzenv< X >::m_bins.

Referenced by bzenv< X >::fromMonoms().

    {
      T tmp[sz];
      int i,k,p,l;
      X * bin;
      for ( p = 0, i = 0; i < sz; i++, p += st ) 
        { tmp[i] = bzc[p]; bzc[p] = 0; };
      for ( p = 0, i = 0; i < sz; i++, p += st )
        {
          bin = m_bins.get( sz-i-1 );
          for ( l = p, k = 0; k < sz-i; k++, l += st )
            bzc[l] += tmp[i]*bin[k];
        };
    };
X* get ( size_t  i) [inline]

Definition at line 96 of file bernstein_bzenv.hpp.

References binomials< T >::get(), and bzenv< X >::m_bins.

{ return m_bins.get(i); };
void scale ( T *  bzc,
size_t  sz,
int  st = 1 
) [inline]

conversion from bernstein basis to the scaled bernstein basis

Definition at line 27 of file bernstein_bzenv.hpp.

References binomials< T >::get(), and bzenv< X >::m_bins.

Referenced by bzenv< X >::elevate(), and bzenv< X >::toMonoms().

    {
      X * bins = m_bins.get(sz-1);
      int p = 0;
      for ( size_t i = 0; i < sz; i++, p += st ) bzc[p] *= bins[i]; 
    };
void scaled_elevate ( T *  dst,
T *  src,
size_t  sz,
int  sts,
int  stdst,
size_t  n 
) [inline]

Definition at line 46 of file bernstein_bzenv.hpp.

References mmx::vctops::convolution(), binomials< T >::get(), and bzenv< X >::m_bins.

Referenced by bzenv< X >::elevate().

    {
      X * bins = m_bins.get(n);
      vctops::convolution( dst, src, bins, sz, n+1, sts, 1, stdst );
    };
void toMonoms ( T *  bzc,
size_t  sz,
int  st = 1 
) [inline]

Definition at line 64 of file bernstein_bzenv.hpp.

References bzenv< X >::scale().

Referenced by bsearch< real_t >::bsearch(), bsearch_newton< real_t >::bsearch_newton(), and bsearch_newton2< real_t >::bsearch_newton2().

    {
      int i,k;
      for ( i = st; i != sz*st; i += st )
        for ( k = (sz-1)*st; k != i-st; k -= st )
          bzc[k] -= bzc[k-st];
      scale(bzc,sz,st);
    };
void uscale ( T *  bzc,
size_t  sz,
int  st = 1 
) [inline]

conversion from scaled bernstein basis to bernstein basis

Definition at line 36 of file bernstein_bzenv.hpp.

References binomials< T >::get(), and bzenv< X >::m_bins.

Referenced by bzenv< X >::elevate(), and bzenv< X >::fromMonoms().

    {
      X * bins = m_bins.get(sz-1);
      int p = 0;
      for ( int i = 0; i < sz; i++, p+= st ) bzc[p] /= bins[i];
    };

Member Data Documentation

bzenv< X > *const _default_ = (bzenv<X>*)(&(binomials<X>::_default_)) [static]

Definition at line 21 of file bernstein_bzenv.hpp.


The documentation for this struct was generated from the following file: