changeset 1101:38dabbe2feb5

[project @ 1995-02-14 01:56:51 by jwe]
author jwe
date Tue, 14 Feb 1995 01:56:51 +0000
parents 3b6f6c5217e7
children 954cfe6fa85d
files liboctave/CRowVector.cc
diffstat 1 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/CRowVector.cc	Tue Feb 14 01:45:09 1995 +0000
+++ b/liboctave/CRowVector.cc	Tue Feb 14 01:56:51 1995 +0000
@@ -604,6 +604,24 @@
     elem (i) = f (elem (i));
 }
 
+ComplexRowVector
+linspace (const Complex& x1, const Complex& x2, int n)
+{
+  ComplexRowVector retval;
+
+  if (n > 0)
+    {
+      retval.resize (n);
+      Complex delta = (x2 - x1) / (n - 1);
+      retval.elem (0) = x1;
+      for (int i = 1; i < n-1; i++)
+	retval.elem (i) = x1 + i * delta;
+      retval.elem (n-1) = x2;
+    }
+
+  return retval;
+}
+
 Complex
 ComplexRowVector::min (void) const
 {