[cig-commits] r11432 - cs/benchmark/cigma/trunk/src

luis at geodynamics.org luis at geodynamics.org
Wed Mar 12 11:03:38 PDT 2008


Author: luis
Date: 2008-03-12 11:03:38 -0700 (Wed, 12 Mar 2008)
New Revision: 11432

Modified:
   cs/benchmark/cigma/trunk/src/Misc.cpp
Log:
Added linspace() function for generating tapered faults


Modified: cs/benchmark/cigma/trunk/src/Misc.cpp
===================================================================
--- cs/benchmark/cigma/trunk/src/Misc.cpp	2008-03-12 18:03:36 UTC (rev 11431)
+++ cs/benchmark/cigma/trunk/src/Misc.cpp	2008-03-12 18:03:38 UTC (rev 11432)
@@ -29,4 +29,20 @@
 }
 
 
+void linspace(double **x, double a, double b, int n)
+{
+    int i;
+    double dx = (b - a)/n;
+    double *y;
+
+    y = new double[n];
+
+    for (i = 0; i < n; i++)
+    {
+        y[i] = a + i * dx;
+    }
+
+    *x = y;
+}
+
 // ---------------------------------------------------------------------------



More information about the cig-commits mailing list