Skip to content
Snippets Groups Projects
Commit 13036385 authored by Sebastien Blaise's avatar Sebastien Blaise
Browse files

fullMatrix: added getDataPtr const and non const

parent 5d25180e
No related branches found
No related tags found
No related merge requests found
...@@ -111,6 +111,13 @@ class fullVector ...@@ -111,6 +111,13 @@ class fullVector
*/ */
inline const scalar * getDataPtr() const { return _data; } inline const scalar * getDataPtr() const { return _data; }
/**
@return Returns a pointer to this fullVector data.@n
This pointer will point to the following memory segment:
[(*this)(0), (*this)(1), ..., (*this)(this->size() - 1)].
*/
inline scalar * getDataPtr() { return _data; }
/** /**
@param i A vector index between 0 and size() - 1. @param i A vector index between 0 and size() - 1.
@returns Returns the ith scalar of this fullVector. @returns Returns the ith scalar of this fullVector.
...@@ -444,6 +451,9 @@ class fullMatrix ...@@ -444,6 +451,9 @@ class fullMatrix
return (*this)(r, c); return (*this)(r, c);
} }
inline const scalar * getDataPtr() const { return _data; }
inline scalar * getDataPtr() { return _data; }
// operations // operations
inline void set(int r, int c, scalar v){ inline void set(int r, int c, scalar v){
#ifdef _DEBUG #ifdef _DEBUG
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment