diff options
author | 2007-10-14 14:45:31 +0000 | |
---|---|---|
committer | 2007-10-14 14:45:31 +0000 | |
commit | a94a8c68e8d66fa2b06e37f3a47f1b7e1ddfa1bc (patch) | |
tree | 40edc0947b2dfe87181c4b62c0ba00e925a9f1b4 /src/Core/Object.h | |
parent | 3f979187600897221c7e807373eb267af4db1ada (diff) |
add fromArray() and wrapArray().
For example, the following now works:
double a1[3] = {1.0, 3.0, 2.0}, a2[3];
Vector3d::wrapArray(a2) = 2 * Vector3d::fromArray(a1);
cout << Vector3d::fromArray(a2) << endl; // output: 2,6,4
Diffstat (limited to 'src/Core/Object.h')
-rw-r--r-- | src/Core/Object.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Core/Object.h b/src/Core/Object.h index 5792385e6..6a3be1d05 100644 --- a/src/Core/Object.h +++ b/src/Core/Object.h @@ -117,6 +117,10 @@ template<typename Scalar, typename Derived> class Object zero(int rows = RowsAtCompileTime, int cols = ColsAtCompileTime); static Identity<Derived> identity(int rows = RowsAtCompileTime); + static FromArray<Derived> + fromArray(const Scalar* array, int rows = RowsAtCompileTime, int cols = ColsAtCompileTime); + static WrapArray<Derived> + wrapArray(Scalar* array, int rows = RowsAtCompileTime, int cols = ColsAtCompileTime); template<typename OtherDerived> bool isApprox( |