#include <vector/MultiArray.hpp>
#include <vector/CatmullSplineIpol.hpp>
#include <vector/CubicIpol.hpp>
#include <vector/FastCubicIpol.hpp>
#include <vector/LinearIpol.hpp>
#include <vector/NearestNeighborIpol.hpp>
#include <vector/Interpolate.hpp>
#include <time.h>
int MA2()
{
enum {
NX = 19,
NY = 10 };
D.set(0.0);
D[ MIndex(2,5) ] = 9.0;
D[ MIndex(12,7) ] = 5.0;
{for(int y=0; y<D.Size()[1]; y++)
{
for(int x=0; x<D.Size()[0]; x++)
}}
cout <<
"Indexed Value = " << value <<
endl;
cout <<
"5th slice is " << D[5] <<
endl;
if (value != D[5][2])
return 0;
cout <<
"Value at 2,5 is " << value <<
endl;
cout <<
"------------------------" <<
endl;
if (
fabs(
V2 -6.075) > 1E-10 )
return 0;
{
}
cout <<
"2D Interpolation successfully demonstrated.\n" <<
endl;
return 1;
}
{
for(index_t i=0; i<D.
count(); i++)
cout << D[i] << ' ';
}
int MA3()
{
cout <<
"Demonstration of Interpolating within a 3D array" <<
endl;
for(
double fr=0;
fr<1;
fr+=0.1)
{
<<
"\t Linear: " <<
LI.eval()
<<
"\t FCubic: " <<
LIfc.eval()
<<
"\t Cubic: " <<
LIc.eval()
<<
"\t Catmull: " <<
LIcs.eval()
}
#if 0
{
cerr <<
"-------------------------------------------------" <<
endl;
int N =1000000;
start =
clock(); {
for(
int i=0; i<N; i++)
LIn.eval();} finish =
clock();
start =
clock(); {
for(
int i=0; i<N; i++)
LI.eval();} finish =
clock();
start =
clock(); {
for(
int i=0; i<N; i++)
LIfc.eval();} finish =
clock();
start =
clock(); {
for(
int i=0; i<N; i++)
LIc.eval();} finish =
clock();
start =
clock(); {
for(
int i=0; i<N; i++)
LIcs.eval();} finish =
clock();
}
#endif
return 1;
}
void plain()
{
Dims = 10,10,10;
double *d =
new double[Dims.
size()];
double value = d[
I.linear(Dims) ];
delete d;
}
int InterpolationExample()
{
int r=0;
r = MA2();
r += MA3();
return r;
}
_Tp fabs(const std::complex< _Tp > &__z)
basic_ostream< _CharT, _Traits > & endl(basic_ostream< _CharT, _Traits > &__os)
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
index_t count() const
Return the number of steps which can be traversed through this ElementIterator.
Definition HyperslabParameters.hpp:147
void set(const T &Value)
Set all elements to the same value.
Definition vector/Iterator.hpp:724
index_t size() const noexcept
Recursive function to compute the entire number of elements.
Definition MultiIndex.hpp:650
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2