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
This commit is contained in:
Benoit Jacob
2007-10-14 14:45:31 +00:00
parent 3f97918760
commit a94a8c68e8
6 changed files with 152 additions and 1 deletions

View File

@@ -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(