/usr/include/choreonoid-1.1/cnoid/src/Util/Interpolator.h is in libcnoid-dev 1.1.0+dfsg-6.1+b4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | /**
@file
@author Shin'ichiro Nakaoka
*/
#ifndef CNOID_UTIL_INTERPOLATOR_H_INCLUDED
#define CNOID_UTIL_INTERPOLATOR_H_INCLUDED
#include <vector>
#include "exportdecl.h"
namespace cnoid {
class CNOID_EXPORT Interpolator
{
public:
void clear();
int appendSample(double x, double y);
void setEndPoint(int sampleIndex, bool isNatural = false);
int numSamples();
bool update();
void getDomain(double& out_lower, double& out_upper);
double interpolate(double x);
//bool interpolate(double x, double& out_y, double& out_d2, double& out_d3);
//bool interpolate(double xBegin, double step, double* out_ybuf);
//bool interpolate(double xBegin, double step, double* out_ybuf, double* out_d2buf, double* out_d3buf);
private:
int updateCubicSplineSegment(int begin);
int updateSegmentBetweenTwoSamples(int begin);
enum SegmentType { UNDETERMINED, CUBIC_SPLINE, POLYNOMINAL };
struct Sample
{
double x;
double y;
double yp;
// coefficients
double a;
double a_end;
double b;
double c;
bool isEdge;
bool isNaturalEdge;
SegmentType segmentType;
};
std::vector<Sample> samples;
int prevReferredSegments;
};
}
#endif
|