[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Freepooma-devel] [PATCH] Fix Field/Array mixed expressions
From: |
Richard Guenther |
Subject: |
[Freepooma-devel] [PATCH] Fix Field/Array mixed expressions |
Date: |
Thu, 14 Apr 2005 14:02:26 +0200 (CEST) |
More fallout from the fact we have different Field and Array.
Adds capability to mix Field/Array in expressions like
Field == iota(...)
or
Field == iota(...) + 2
should also enable
Field = iota(...) + Field
(untested)
Will be excercised in functionality I'm going to submit later.
Tested ok, applied to HEAD.
Richard.
2005Apr14 Richard Guenther <address@hidden>
* src/Field/Field.h: Add LeafFunctor specialization for
Array and SubFieldViewFunctorTag.
src/Field/FieldEngine/FieldEngine.ExprEngine.h: Add
Combine2 specialization for ErrorType and FarLeftTag.
Add LeafFunctor specialization for Array and FarLeftTag.
Index: Field.h
===================================================================
RCS file: /cvsroot/freepooma/freepooma/src/Field/Field.h,v
retrieving revision 1.90
diff -u -r1.90 Field.h
--- Field.h 16 Dec 2004 14:16:12 -0000 1.90
+++ Field.h 14 Apr 2005 11:56:42 -0000
@@ -1865,6 +1865,12 @@
typedef Field<Mesh, T, EngineTag> Type_t;
};
+template<int Dim, class T, class EngineTag>
+struct LeafFunctor<Array<Dim, T, EngineTag>, SubFieldViewFunctorTag>
+{
+ typedef ErrorType Type_t;
+};
+
template<class T>
struct LeafFunctor<Scalar<T>, SubFieldViewFunctorTag>
{
Index: FieldEngine/FieldEngine.ExprEngine.h
===================================================================
RCS file:
/cvsroot/freepooma/freepooma/src/Field/FieldEngine/FieldEngine.ExprEngine.h,v
retrieving revision 1.8
diff -u -r1.8 FieldEngine.ExprEngine.h
--- FieldEngine/FieldEngine.ExprEngine.h 10 Nov 2004 22:05:01 -0000
1.8
+++ FieldEngine/FieldEngine.ExprEngine.h 14 Apr 2005 11:56:42 -0000
@@ -107,6 +107,30 @@
}
};
+template<class T, class Op>
+struct Combine2<ErrorType, T, Op, FarLeftTag>
+{
+ typedef T Type_t;
+ inline static
+ const Type_t &combine(const ErrorType& e, const T& t,
+ FarLeftTag)
+ {
+ return t;
+ }
+};
+
+template<class T, class Op>
+struct Combine2<T, ErrorType, Op, FarLeftTag>
+{
+ typedef T Type_t;
+ inline static
+ const Type_t &combine(const T& t, const ErrorType& e,
+ FarLeftTag)
+ {
+ return t;
+ }
+};
+
template<class A,class B,class C,class Op>
struct Combine3<A, B, C, Op, FarLeftTag>
{
@@ -140,6 +164,18 @@
}
};
+template<int Dim, class T, class EngineTag>
+struct LeafFunctor<Array<Dim, T, EngineTag>, FarLeftTag>
+{
+ typedef ErrorType Type_t;
+ inline static
+ const Type_t &apply(const Array<Dim, T, EngineTag> &a,
+ const FarLeftTag &)
+ {
+ return Type_t();
+ }
+};
+
template<class T>
struct LeafFunctor<Scalar<T>, FarLeftTag>
{
- [Freepooma-devel] [PATCH] Fix Field/Array mixed expressions,
Richard Guenther <=