Page MenuHomec4science

interpolator.hh
No OneTemporary

File Metadata

Created
Fri, May 17, 19:18

interpolator.hh

#ifndef INTERPOLATOR_H
#define INTERPOLATOR_H
/* -------------------------------------------------------------------------- */
#include "surface.hh"
#include <sstream>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include "function.hh"
/* -------------------------------------------------------------------------- */
using namespace std;
/* -------------------------------------------------------------------------- */
enum INTERPOLATION_TYPE { BY_PROFILE, BY_PROFILE_II, VOLUMETRIC };
class Interpolator {
public:
Interpolator() { std::cout << "ERROR: Should not be here" << std::endl; exit(0); }
Interpolator(INTERPOLATION_TYPE it, int n, Real tol) {itype = it; num_inter_points = n; tolerance = tol;}
~Interpolator() {}
//! Interpolate by patch
void make_by_patch(Surface& original, int ix, int iy, int patch_size, int margin, bool parabola, Real max_value, vector<vector<Real> >& pdfs,
Real& area, Real& perimeter, Real& pressure, vector<vector<Real> >& interpolated_surface, string fname="");
//! Interpolate by patch, version 2
void make_by_patch2(Surface& original, int ix, int iy, int patch_size, int margin, bool parabola, Real max_value, vector<vector<Real> >& pdfs,
Real& area, Real& perimeter, Real& pressure, vector<vector<Real> >& interpolated_surface, string fname="");
//! Interpolate profile by profile
void make_by_profile(Surface original, int iline, bool parabola, bool vertical, Real max_value, vector<vector<Real> >& pdfs,
Real& area, Real& perimeter, Real& pressure, string fname="");
//! Interpolate all profiles
vector<vector<Real> > make_by_profile( Surface original, bool parabola, bool vertical=false );
//! Get shifted element for line
Real getRelativeElement(const vector<Real>& line, int act_pos, int shift );
//! Get shifted element for surface
Real getRelativeElement(Surface& surface, int act_pos_x, int act_pos_y, int shift_x, int shift_y);
//! Check convexity/concavity
bool if_concave( vector<Real>& points );
bool if_concave( vector<Real>& points, int start );
//! Find the distance to the closest local maximum
Real find_dist_to_max(bool forward, vector<Real>& points, int start);
//! assigning of elements
void assign_value(vector<vector<Real> >& surf, int i, int j, Real value);
void assign_value(vector<Real>& vec, int i, Real value);
void assign_value(vector<int>& vec, int i, Real value);
//! Interpolates locally along a profile, return increment to go to the next interpolation point
int interpolate(bool forward, bool horizontal, vector<vector<Real> >& interpolated_surface, int ix, int iy,
vector<Real>& original_points, INTER_FUNCTION_TYPE type, vector<int>& deja_interpolated, vector<Real>& slope, Real radius=0.,
//o tmp
Real val=0., int steps=1);
//x tmp
protected:
INTERPOLATION_TYPE itype;
int num_inter_points;
Real tolerance;
};
#endif

Event Timeline