/[escript]
ViewVC logotype

Revision 5896


Jump to revision: Previous Next
Author: jfenwick
Date: Fri Jan 29 03:43:52 2016 UTC (21 months, 3 weeks ago)
Changed paths: 12
Log Message:
Can now add two complex constant data together.

getDataAtOffsetRO and getDataAtOffsetRW now take an extra dummy param.
The type of this parameter determines whether the method returns a
real reference or a complex reference.
The rationale for this method is that it works in templated functions (without
needing to have type checking logic).
At the lower levels (DataAbstract etc) there are separate real and complex versions.
eg: getVectorRW vs getVectorRWC

tensor_binary_operation is templated instead of always expecting doubles.

Modified the MAKELAZYBIN2 macro to prevent it being called with complex.

Weaknesses in the work so far.
- Creating a Constant and then complicate()ing it is fine, but it would be better
if we could create Data objects with the appropriate complexity. This would seem like
a job for an optional parameter on the Data constructors. Problem is, there are already
a number of optionals there already (functionspace and expanded). So it does not make sense
to just add another one and hope the booleans line up.  Looks like we would need to remove
the current uses of the optional params; ie make all uses supply all required arguments.
Not all of the constructors would need the param though, because some could infer it from
the arguments.

- Should do something about trapping calls to the wrong form of getVectorRW/getVectorRWC.


Changed paths

Path Details
Directorybranches/complex/escriptcore/src/Data.cpp modified , text changed
Directorybranches/complex/escriptcore/src/Data.h modified , text changed
Directorybranches/complex/escriptcore/src/DataConstant.cpp modified , text changed
Directorybranches/complex/escriptcore/src/DataConstant.h modified , text changed
Directorybranches/complex/escriptcore/src/DataEmpty.cpp modified , text changed
Directorybranches/complex/escriptcore/src/DataEmpty.h modified , text changed
Directorybranches/complex/escriptcore/src/DataExpanded.cpp modified , text changed
Directorybranches/complex/escriptcore/src/DataExpanded.h modified , text changed
Directorybranches/complex/escriptcore/src/DataReady.h modified , text changed
Directorybranches/complex/escriptcore/src/DataTagged.cpp modified , text changed
Directorybranches/complex/escriptcore/src/DataTagged.h modified , text changed
Directorybranches/complex/escriptcore/src/LocalOps.h modified , text changed

  ViewVC Help
Powered by ViewVC 1.1.26