This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

simple access functions for cheb-polynoms


Are attached as diffs against gsl-1.3 . Should work for cvs-version, too.

Yours, Achim
diff -u6 gsl-1.3/cheb/gsl_chebyshev.h gsl-1.3-devel/cheb/gsl_chebyshev.h
--- gsl-1.3/cheb/gsl_chebyshev.h	2002-06-10 15:04:36.000000000 +0200
+++ gsl-1.3-devel/cheb/gsl_chebyshev.h	2003-01-27 17:14:49.000000000 +0100
@@ -79,12 +79,22 @@
  *
  */
 int gsl_cheb_init(gsl_cheb_series * cs, const gsl_function * func,
                   const double a, const double b);
 
 
+/*
+ * Sets a Chebychef series coefficient
+ */
+int gsl_cheb_set(gsl_cheb_series * cs, size_t n, double c);
+
+/*
+ * gets a Chebychef series coefficient
+ */
+double gsl_cheb_get(gsl_cheb_series * cs, size_t n);
+
 /* Evaluate a Chebyshev series at a given point.
  * No errors can occur for a struct obtained from gsl_cheb_new().
  */
 double gsl_cheb_eval(const gsl_cheb_series * cs, const double x);
 int gsl_cheb_eval_err(const gsl_cheb_series * cs, const double x, 
                       double * result, double * abserr);
Only in gsl-1.3-devel/cheb/: gsl_chebyshev.h~
diff -u6 gsl-1.3/cheb/init.c gsl-1.3-devel/cheb/init.c
--- gsl-1.3/cheb/init.c	2002-05-24 20:24:16.000000000 +0200
+++ gsl-1.3-devel/cheb/init.c	2003-01-27 17:22:29.000000000 +0100
@@ -57,12 +57,13 @@
 {
   free(cs->f);
   free(cs->c);
   free(cs);
 }
 
+
 /*-*-*-*-*-*-*-*-*-*-*-* Initializer *-*-*-*-*-*-*-*-*-*-*-*/
 
 int gsl_cheb_init(gsl_cheb_series * cs, const gsl_function *func,
                   const double a, const double b)
 {
   size_t k, j;
@@ -93,9 +94,33 @@
     
   }
   return GSL_SUCCESS;
 }
 
 
+/*-*-*-*-*-*-*-*-*-*-*-* simple access *-*-*-*-*-*-*-*-*-*-*-*/
+
+/*
+ * Sets a Chebychef series coefficient
+ */
+int gsl_cheb_set(gsl_cheb_series * cs, size_t n, double c) {
+  if (n >= cs->order)
+    {
+      GSL_ERROR_VOID ("index out of range", GSL_EINVAL);
+    }
+  cs->c[n]=c;
+  return GSL_SUCCESS;
+}
+
+/*
+ * gets a Chebychef series coefficient
+ */
+double gsl_cheb_get(gsl_cheb_series * cs, size_t n) {
+  if (n >= cs->order)
+    {
+      GSL_ERROR_VOID ("index out of range", GSL_EINVAL);
+    }
+  return cs->c[n];
+}
 
 
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]