tiny2.cpp
来自「A C++ class library for scientific compu」· C++ 代码 · 共 30 行
CPP
30 行
#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);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?