Lines Matching refs:exprP
519 // This is a kludge that is only needed to get the ExprP::operator[] syntactic sugar to work.
534 * and statements. ExprP<T> is a shared pointer to an Expr<T>, and StatementP
546 template <typename T> class ExprP;
718 VariableStatement (const VariableP<T>& variable, const ExprP<T>& value,
749 ExprP<T> m_value;
755 const ExprP<T>& value,
762 StatementP variableDeclaration (const VariableP<T>& variable, const ExprP<T>& definiens)
768 StatementP variableAssignment (const VariableP<T>& variable, const ExprP<T>& value)
897 ExprP<typename T::Element> operator[] (int i) const;
901 class ExprP : public ExprPBase<T> {};
906 class ExprP<Void> : public ContainerExprPBase<Void> {};
909 class ExprP<Vector<T, Size> > : public ContainerExprPBase<Vector<T, Size> > {};
912 class ExprP<Matrix<T, Rows, Cols> > : public ContainerExprPBase<Matrix<T, Rows, Cols> > {};
914 template <typename T> ExprP<T> exprP (void)
916 return ExprP<T>();
920 ExprP<T> exprP (const SharedPtr<const Expr<T> >& ptr)
922 ExprP<T> ret;
928 ExprP<T> exprP (const Expr<T>* ptr)
930 return exprP(SharedPtr<const Expr<T> >(ptr));
936 * This is just a narrowing of ExprP for the operations that require a variable
949 operator ExprP<T> (void) const { return exprP(SharedPtr<const Expr<T> >(*this)); }
962 ExprP<float> operator-(const ExprP<float>& arg0);
963 ExprP<float> operator+(const ExprP<float>& arg0,
964 const ExprP<float>& arg1);
965 ExprP<float> operator-(const ExprP<float>& arg0,
966 const ExprP<float>& arg1);
967 ExprP<float> operator*(const ExprP<float>& arg0,
968 const ExprP<float>& arg1);
969 ExprP<float> operator/(const ExprP<float>& arg0,
970 const ExprP<float>& arg1);
972 ExprP<Vector<float, Size> > operator-(const ExprP<Vector<float, Size> >& arg0);
974 ExprP<Vector<float, Size> > operator*(const ExprP<Vector<float, Size> >& arg0,
975 const ExprP<float>& arg1);
977 ExprP<Vector<float, Size> > operator*(const ExprP<Vector<float, Size> >& arg0,
978 const ExprP<Vector<float, Size> >& arg1);
980 ExprP<Vector<float, Size> > operator-(const ExprP<Vector<float, Size> >& arg0,
981 const ExprP<Vector<float, Size> >& arg1);
983 ExprP<Matrix<float, Left, Right> > operator* (const ExprP<Matrix<float, Left, Mid> >& left,
984 const ExprP<Matrix<float, Mid, Right> >& right);
986 ExprP<Vector<float, Rows> > operator* (const ExprP<Vector<float, Cols> >& left,
987 const ExprP<Matrix<float, Rows, Cols> >& right);
989 ExprP<Vector<float, Cols> > operator* (const ExprP<Matrix<float, Rows, Cols> >& left,
990 const ExprP<Vector<float, Rows> >& right);
992 ExprP<Matrix<float, Rows, Cols> > operator* (const ExprP<Matrix<float, Rows, Cols> >& left,
993 const ExprP<float>& right);
995 ExprP<Matrix<float, Rows, Cols> > operator+ (const ExprP<Matrix<float, Rows, Cols> >& left,
996 const ExprP<Matrix<float, Rows, Cols> >& right);
998 ExprP<Matrix<float, Rows, Cols> > operator- (const ExprP<Matrix<float, Rows, Cols> >& mat);
1035 VariableP<T> bindExpression (const string& name, ExpandContext& ctx, const ExprP<T>& expr)
1065 ExprP<T> constant (const T& value)
1067 return exprP(new Constant<T>(value));
1071 const ExprP<Void>& voidP (void)
1073 static const ExprP<Void> singleton = constant(Void());
1132 typedef Tuple4< ExprP<Arg0>, ExprP<Arg1>, ExprP<Arg2>, ExprP<Arg3> > ArgExprs;
1218 ExprP<Ret> operator() (const ExprP<Arg0>& arg0 = voidP(),
1219 const ExprP<Arg1>& arg1 = voidP(),
1220 const ExprP<Arg2>& arg2 = voidP(),
1221 const ExprP<Arg3>& arg3 = voidP()) const;
1272 const ExprP<Arg0>& arg0 = voidP(),
1273 const ExprP<Arg1>& arg1 = voidP(),
1274 const ExprP<Arg2>& arg2 = voidP(),
1275 const ExprP<Arg3>& arg3 = voidP())
1340 ExprP<typename Sig::Ret> createApply (const Func<Sig>& func,
1343 return exprP(new Apply<Sig>(func, args));
1347 ExprP<typename Sig::Ret> createApply (
1349 const ExprP<typename Sig::Arg0>& arg0 = voidP(),
1350 const ExprP<typename Sig::Arg1>& arg1 = voidP(),
1351 const ExprP<typename Sig::Arg2>& arg2 = voidP(),
1352 const ExprP<typename Sig::Arg3>& arg3 = voidP())
1354 return exprP(new Apply<Sig>(func, arg0, arg1, arg2, arg3));
1358 ExprP<typename Sig::Ret> Func<Sig>::operator() (const ExprP<typename Sig::Arg0>& arg0,
1359 const ExprP<typename Sig::Arg1>& arg1,
1360 const ExprP<typename Sig::Arg2>& arg2,
1361 const ExprP<typename Sig::Arg3>& arg3) const
1367 ExprP<typename F::Ret> app (const ExprP<typename F::Arg0>& arg0 = voidP(),
1368 const ExprP<typename F::Arg1>& arg1 = voidP(),
1369 const ExprP<typename F::Arg2>& arg2 = voidP(),
1370 const ExprP<typename F::Arg3>& arg3 = voidP())
1386 ExprP<T> alternatives (const ExprP<T>& arg0,
1387 const ExprP<T>& arg1)
1426 ExprP<typename Sig::Ret> applyVar (const Func<Sig>& func,
1432 return exprP(new ApplyVar<Sig>(func, arg0, arg1, arg2, arg3));
1520 virtual ExprP<Ret> doExpand (ExpandContext& ctx, const ArgExprs& args_) const = 0;
1531 mutable ExprP<Ret> m_ret;
1655 ExprP<bool> operator< (const ExprP<T>& a, const ExprP<T>& b)
1661 ExprP<T> cond (const ExprP<bool>& test,
1662 const ExprP<T>& consequent,
1663 const ExprP<T>& alternative)
2116 ExprP<float> exp2 (const ExprP<float>& x) { return app<Exp2>(x); }
2117 ExprP<float> exp (const ExprP<float>& x) { return app<Exp>(x); }
2150 ExprP<float> log2 (const ExprP<float>& x) { return app<Log2>(x); }
2151 ExprP<float> log (const ExprP<float>& x) { return app<Log>(x); }
2154 ExprP<TRET> NAME (const ExprP<T0>& arg0) { return app<CLASS>(arg0); }
2163 ExprP<TRET> doExpand (ExpandContext&, \
2166 const ExprP<float>& ARG0 = args_.a; \
2176 ExprP<TRET> NAME (const ExprP<T0>& arg0, const ExprP<T1>& arg1) \
2188 ExprP<TRET> doExpand (ExpandContext&, const ArgExprs& args_) const \
2190 const ExprP<T0>& Arg0 = args_.a; \
2191 const ExprP<T1>& Arg1 = args_.b; \
2201 ExprP<TRET> NAME (const ExprP<T0>& arg0, const ExprP<T1>& arg1, const ExprP<T2>& arg2) \
2213 ExprP<TRET> doExpand (ExpandContext&, const ArgExprs& args_) const \
2215 const ExprP<T0>& ARG0 = args_.a; \
2216 const ExprP<T1>& ARG1 = args_.b; \
2217 const ExprP<T2>& ARG2 = args_.c; \
2227 ExprP<TRET> NAME (const ExprP<T0>& arg0, const ExprP<T1>& arg1, \
2228 const ExprP<T2>& arg2, const ExprP<T3>& arg3) \
2343 ExprP<float> sin (const ExprP<float>& x) { return app<Sin>(x); }
2354 ExprP<float> cos (const ExprP<float>& x) { return app<Cos>(x); }
2522 ExprP<typename T::Element> getComponent (const ExprP<T>& container, int ndx)
2551 ExprP<T> doExpand (ExpandContext&, const ArgExprs& args) const { return args.a; }
2692 ExprP<Matrix<T, Rows, 2> > mat2 (const ExprP<Vector<T, Rows> >& arg0,
2693 const ExprP<Vector<T, Rows> >& arg1)
2699 ExprP<Matrix<T, Rows, 3> > mat3 (const ExprP<Vector<T, Rows> >& arg0,
2700 const ExprP<Vector<T, Rows> >& arg1,
2701 const ExprP<Vector<T, Rows> >& arg2)
2707 ExprP<Matrix<T, Rows, 4> > mat4 (const ExprP<Vector<T, Rows> >& arg0,
2708 const ExprP<Vector<T, Rows> >& arg1,
2709 const ExprP<Vector<T, Rows> >& arg2,
2710 const ExprP<Vector<T, Rows> >& arg3)
2866 static ExprP<T> genXType (const ExprP<T>& x) { return x; }
2872 static ExprP<Vector<T, 2> > genXType (const ExprP<T>& x)
2881 static ExprP<Vector<T, 3> > genXType (const ExprP<T>& x)
2890 static ExprP<Vector<T, 4> > genXType (const ExprP<T>& x)
2899 ExprP<typename ContainerOf<T, Size>::Container> genXType (const ExprP<T>& x)
2925 ExprP<float> doExpand (ExpandContext&, const ArgExprs& args) const
2927 ExprP<float> val = args.a[0] * args.b[0];
2945 ExprP<float> doExpand (ExpandContext&, const ArgExprs& args) const
2952 ExprP<float> dot (const ExprP<Vector<float, Size> >& x, const ExprP<Vector<float, Size> >& y)
2957 ExprP<float> dot (const ExprP<float>& x, const ExprP<float>& y)
2975 ExprP<float> doExpand (ExpandContext&, const ArgExprs& args) const
2982 ExprP<float> length (const ExprP<typename ContainerOf<float, Size>::Container>& x)
3003 ExprP<Ret> doExpand (ExpandContext&, const ArgExprs& args) const
3020 ExprP<Vec3> doExpand (ExpandContext&, const ArgExprs& x) const
3045 ExprP<Ret> doExpand (ExpandContext&, const ArgExprs& args) const
3070 ExprP<Ret> doExpand (ExpandContext&, const ArgExprs& args) const
3079 static ExprP<Ret> apply (ExpandContext& ctx,
3080 const ExprP<Arg0>& i,
3081 const ExprP<Arg1>& n)
3083 const ExprP<float> dotNI = bindExpression("dotNI", ctx, dot(n, i));
3093 static ExprP<Ret> apply (ExpandContext&,
3094 const ExprP<Arg0>& i,
3095 const ExprP<Arg1>& n)
3121 ExprP<Ret> doExpand (ExpandContext& ctx, const ArgExprs& args) const
3123 const ExprP<Arg0>& i = args.a;
3124 const ExprP<Arg1>& n = args.b;
3149 ExprP<Ret> doExpand (ExpandContext& ctx, const ArgExprs& args) const
3151 const ExprP<Arg0>& i = args.a;
3152 const ExprP<Arg1>& n = args.b;
3153 const ExprP<float>& eta = args.c;
3154 const ExprP<float> dotNI = bindExpression("dotNI", ctx, dot(n, i));
3155 const ExprP<float> k1 = bindExpression("k1", ctx, constant(1.0f) - eta * eta *
3158 const ExprP<float> k2 = bindExpression("k2", ctx,
3161 const ExprP<float> k = bindExpression("k", ctx, alternatives(k1, k2));
3302 ExprP<float> clamp(const ExprP<float>& x, const ExprP<float>& minVal, const ExprP<float>& maxVal)
3327 ExprP<Ret> doExpand (ExpandContext& ctx, const ArgExprs& args) const
3329 const ExprP<float>& edge0 = args.a;
3330 const ExprP<float>& edge1 = args.b;
3331 const ExprP<float>& x = args.c;
3332 const ExprP<float> tExpr = clamp((x - edge0) / (edge1 - edge0),
3334 const ExprP<float> t = bindExpression("t", ctx, tExpr);
3579 ExprP<Matrix<float, Rows, Cols> > outerProduct (const ExprP<Vector<float, Rows> >& left,
3580 const ExprP<Vector<float, Cols> >& right)
3596 ExprP<float> determinant (ExprP<Matrix<float, Size, Size> > mat)
3605 ExprP<Ret> doExpand (ExpandContext&, const ArgExprs& args) const
3607 ExprP<Mat2> mat = args.a;
3617 ExprP<Ret> doExpand (ExpandContext&, const ArgExprs& args) const
3619 ExprP<Mat3> mat = args.a;
3631 ExprP<Ret> doExpand (ExpandContext& ctx, const ArgExprs& args) const
3633 ExprP<Mat4> mat = args.a;
3634 ExprP<Mat3> minors[4];
3638 ExprP<Vec4> minorColumns[3];
3639 ExprP<Vec3> columns[3];
3663 ExprP<Matrix<float, Size, Size> > inverse (ExprP<Matrix<float, Size, Size> > mat)
3678 ExprP<Ret> doExpand (ExpandContext& ctx, const ArgExprs& args) const
3680 ExprP<Mat2> mat = args.a;
3681 ExprP<float> det = bindExpression("det", ctx, determinant(mat));
3698 ExprP<Ret> doExpand (ExpandContext& ctx, const ArgExprs& args) const
3700 ExprP<Mat3> mat = args.a;
3701 ExprP<Mat2> invA = bindExpression("invA", ctx,
3705 ExprP<Vec2> matB = bindExpression("matB", ctx, vec2(mat[2][0], mat[2][1]));
3706 ExprP<Vec2> matC = bindExpression("matC", ctx, vec2(mat[0][2], mat[1][2]));
3707 ExprP<float> matD = bindExpression("matD", ctx, mat[2][2]);
3709 ExprP<float> schur = bindExpression("schur", ctx,
3713 ExprP<Vec2> t1 = invA * matB;
3714 ExprP<Vec2> t2 = t1 * schur;
3715 ExprP<Mat2> t3 = outerProduct(t2, matC);
3716 ExprP<Mat2> t4 = t3 * invA;
3717 ExprP<Mat2> t5 = invA + t4;
3718 ExprP<Mat2> blockA = bindExpression("blockA", ctx, t5);
3719 ExprP<Vec2> blockB = bindExpression("blockB", ctx,
3721 ExprP<Vec2> blockC = bindExpression("blockC", ctx,
3737 ExprP<Ret> doExpand (ExpandContext& ctx,
3740 ExprP<Mat4> mat = args.a;
3741 ExprP<Mat2> invA = bindExpression("invA", ctx,
3744 ExprP<Mat2> matB = bindExpression("matB", ctx,
3747 ExprP<Mat2> matC = bindExpression("matC", ctx,
3750 ExprP<Mat2> matD = bindExpression("matD", ctx,
3753 ExprP<Mat2> schur = bindExpression("schur", ctx,
3755 ExprP<Mat2> blockA = bindExpression("blockA", ctx,
3757 ExprP<Mat2> blockB = bindExpression("blockB", ctx,
3759 ExprP<Mat2> blockC = bindExpression("blockC", ctx,
3783 ExprP<float> doExpand (ExpandContext&, const ArgExprs& x) const
3794 ExprP<typename T::Element> ContainerExprPBase<T>::operator[] (int i) const
3796 return Functions::getComponent(exprP<T>(*this), i);
3799 ExprP<float> operator+ (const ExprP<float>& arg0, const ExprP<float>& arg1)
3804 ExprP<float> operator- (const ExprP<float>& arg0, const ExprP<float>& arg1)
3809 ExprP<float> operator- (const ExprP<float>& arg0)
3814 ExprP<float> operator* (const ExprP<float>& arg0, const ExprP<float>& arg1)
3819 ExprP<float> operator/ (const ExprP<float>& arg0, const ExprP<float>& arg1)
3963 ExprP<Vector<float, Size> > operator*(const ExprP<Vector<float, Size> >& arg0,
3964 const ExprP<Vector<float, Size> >& arg1)
3970 ExprP<Vector<float, Size> > operator*(const ExprP<Vector<float, Size> >& arg0,
3971 const ExprP<float>& arg1)
3977 ExprP<Vector<float, Size> > operator/(const ExprP<Vector<float, Size> >& arg0,
3978 const ExprP<float>& arg1)
3984 ExprP<Vector<float, Size> > operator-(const ExprP<Vector<float, Size> >& arg0)
3990 ExprP<Vector<float, Size> > operator-(const ExprP<Vector<float, Size> >& arg0,
3991 const ExprP<Vector<float, Size> >& arg1)
3997 ExprP<Matrix<float, LeftRows, RightCols> >
3998 operator* (const ExprP<Matrix<float, LeftRows, Middle> >& left,
3999 const ExprP<Matrix<float, Middle, RightCols> >& right)
4005 ExprP<Vector<float, Rows> > operator* (const ExprP<Vector<float, Cols> >& left,
4006 const ExprP<Matrix<float, Rows, Cols> >& right)
4012 ExprP<Vector<float, Cols> > operator* (const ExprP<Matrix<float, Rows, Cols> >& left,
4013 const ExprP<Vector<float, Rows> >& right)
4019 ExprP<Matrix<float, Rows, Cols> > operator* (const ExprP<Matrix<float, Rows, Cols> >& left,
4020 const ExprP<float>& right)
4026 ExprP<Matrix<float, Rows, Cols> > operator+ (const ExprP<Matrix<float, Rows, Cols> >& left,
4027 const ExprP<Matrix<float, Rows, Cols> >& right)
4033 ExprP<Matrix<float, Rows, Cols> > operator- (const ExprP<Matrix<float, Rows, Cols> >& mat)
4928 ExprP<Ret> expr = applyVar(m_func,
4986 ExprP