Use std::vector in la interface in place of pointers
Replace pointers with std::vector in linear algebra interface where appropriate. See
http://
for the initial discussion.
Blueprint information
- Status:
- Started
- Approver:
- None
- Priority:
- High
- Drafter:
- None
- Direction:
- Approved
- Assignee:
- None
- Definition:
- Approved
- Series goal:
- None
- Implementation:
- Started
- Milestone target:
- 0.9.7
- Started by
- Garth Wells
- Completed by
Whiteboard
Summary (GNW): Use std::vector or dolfin::Array in la interface, depending on which is appropriate.
Implications for PyDOLFIN:
Using std::vectors instead of double* in exchanging data will force us to copy data in the python interface. Sometimes this is OK but sometimes we loose functionality, for example copying Mesh::coordinates does not make sense.
When do we copy Mesh::coordinates into a Vector?
JH: Never(?) I misinterpreted the design suggestion to change all argument handling from double * to std::vector. (Mesh::coordinates might still be a bad example for this :P)
GNW: I suggest that we use dolfin::Array. This provides safety and a simple interface to Python.
Logg: Yes. I think we should just change to Array everywhere. (comment grabbed from email list)
The only problem is it requires some work since we have used std::vector in quite a few places. I count ca 150 occurences of std::vector in the C++ interface.
JH: I agree with Garth. The Blueprint is about using std::vector in the LA interface, not the whole DOLFIN interface. I think that discussion should be taken in the Array typemap blueprint. As pointed out in that blueprint, we have not yet solved the issue when an std::vector (Array) need to be resized. For this situation std::vector suites us quite well at the moment.