FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
NearestNeighborIpol.hpp
1
2//
3// $Id: NearestNeighborIpol.hpp,v 1.1 2006/07/07 14:10:53 werner Exp $
4//
5// $Log: NearestNeighborIpol.hpp,v $
6// Revision 1.1 2006/07/07 14:10:53 werner
7// Intermediate state: multidimensional interpolation with on-demand
8// fractional loading appears to work, but still problem with vectorfield
9// interpolation.
10//
11// Revision 1.4 2004/08/12 16:08:45 werner
12// Various improvements for implementing the tangential space
13//
14// Revision 1.3 2004/07/09 20:15:26 werner
15// Added local alignment capability when interpolating vector fields and
16// option to compute the interpolated derivative.
17//
18// Revision 1.2 2004/07/04 17:24:03 werner
19// Recursive multidimensional Interpolation interface implemented.
20//
21// Revision 1.1 2004/06/15 22:45:31 werner
22// Enhanced the fixed array member functions.
23// Using better name for interpolation template parameters.
24//
25// Revision 1.1 2004/06/14 22:42:00 werner
26// Moved interpolation files from light++ to VecAl and Multindex from Fiber to VecAl.
27//
29#ifndef __IPOL_CONSTANT_HPP
30#define __IPOL_CONSTANT_HPP "Created 11.06.2004 22:28:21 by bzfbenge"
31
32#include "Index.hpp"
33#include <assert.h>
34
35namespace Fiber
36{
37
44template <class T>
46{
47
48public:
49
50 template <class Storage1D, class Limiter>
51static T interpolate(const Storage1D&Data, double t, index_t size, const Limiter&L)
52 {
53 // TODO: Check for Samplings.size() < 2 !
54 assert(size > 2);
55
56 if (t<0 ) return Data[0];
57 if (t>=size ) return Data[size-1];
58
59 index_t i = index_t(t+0.5);
60
61 return Data[i];
62 }
63
64 template <class Storage1D>
65static T derivative(const Storage1D&Data, double t, index_t size)
66 {
67 return 0;
68 }
69};
70
71} /* namespace VecAl */
72
73#endif /* __IPOL_CONSTANT_HPP */
valarray< size_t > size() const
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
Nearest-Neighbor interpolation, just fast and wrong.
Definition NearestNeighborIpol.hpp:46
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2
IndexTypeConfig< sizeof(void *)>::index_t index_t
Define the index type as according to the size of a pointer, i.e.
Definition Index.hpp:22