Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 6ba95eb068aab5480bfe9a9a0d0fa03c > files > 212

blitz-devel-0.9-13.fc13.x86_64.rpm

#define BZ_DISABLE_KCC_COPY_PROPAGATION_KLUDGE

#include <blitz/tinyvec-et.h>

using namespace blitz;

typedef TinyVector<double,3> vec;

inline void reflect(vec& reflection, const vec& incident, 
    const vec& surfaceNormal)
{
    // The surface normal must be unit length to use this equation.

    reflection = incident - 2 * dot(incident,surfaceNormal) * surfaceNormal;
}

template<typename T>
void optimizationSink(T&);

void foo(TinyVector<double,3>& x)
{
    TinyVector<double,3> y, z;

    y =  1.00,  0.40, -1.00;
    z =  0.31,  0.20,  0.93;

    reflect(x, y, z);
}