Libbarrett  1.2.4
include/barrett/cdlbt/spline.h
Go to the documentation of this file.
00001 
00044 #ifndef BARRETT_CDLBT_SPLINE_H_
00045 #define BARRETT_CDLBT_SPLINE_H_
00046 #ifdef __cplusplus
00047 extern "C" {
00048 #endif
00049 
00050 #include <gsl/gsl_vector.h>
00051 #include <gsl/gsl_interp.h>
00052 
00053 
00069 enum bt_spline_mode
00070 {
00071    BT_SPLINE_MODE_ARCLEN, /* The spline uses computed arc-length */
00072    BT_SPLINE_MODE_EXTERNAL /* The spline uses an external parameter */
00073 };
00074 
00075 
00079 struct bt_spline
00080 {
00081    enum bt_spline_mode mode;
00082    int dimension;
00083    int npoints;
00084    double * ss;
00085    double length;
00086    double ** points;
00087    gsl_interp_accel * acc;
00088    gsl_interp ** interps;
00089 };
00090 
00091 
00102 int bt_spline_create(struct bt_spline ** splineptr, const gsl_vector * start,
00103                      enum bt_spline_mode mode);
00104 
00105 
00119 int bt_spline_add(struct bt_spline * spline, const gsl_vector * vec, double s);
00120 
00121 
00141 int bt_spline_init(struct bt_spline * spline, gsl_vector * start,
00142                    gsl_vector * direction);
00143 
00144 
00153 int bt_spline_destroy(struct bt_spline * spline);
00154 
00155 
00166 int bt_spline_get(struct bt_spline * spline, gsl_vector * result, double s);
00167 
00168 
00169 #ifdef __cplusplus
00170 }
00171 #endif
00172 #endif /* BARRETT_CDLBT_SPLINE_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Defines