Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site











SourceForge.net Logo

DataSource

 

class DataSource

 

Some classes need sources of data for drawing, data analysis and statistics. However data series can be defined in different containers like C arrays, U++ containers or even data grids like ArrayCtrl and GridCtrl.

 

DataSource abstracts many sources of data, like:

 

Data series

They are series of data with a number of columns (parameters) and rows (every parameter set case). For example:

 

X

Y

Z

Temperature

1.1

45

-34

22

3.5

23

12

25

2.4

78

112

24

 

Explicit equation

A function y = f(x1, x2, ...) where y is the dependent variable and x1, x2 are the independent variables.

Examples are:

    

    y = 4x + 3z

    y = 3*x^2 + 2*x - 1

 

Parametric equation

(From Wikipedia) A parametric equation of a curve is a representation of it through equations expressing the coordinates of the points of the curve as functions of a variable called parameter. For example,

 

    x = cos(t)

    y = sin(t)

 

is a parametric equation for the unit circle, where t is the parameter.

 

These equations are useful to represent closed functions as circles, spirals and even epitrochoids.

 

DataSource classes can be used to interface data sources and containers and can be subclassed to be embedded in other classes like ExplicitEquation.

 

Examples of DataSource classes are CArray and VectorY .

 

 

Constructor Detail


 

DataSource()

Default constructor where the data is defined as data series by default.

 

 

Public Member List


 

virtual double y(int64 id)

Returns the first parameter of the data series id th value.

 


 

virtual double x(int64 id)

Returns the second parameter of the data series id th value.

 


 

virtual double xn(int n, int64 id)

Returns the n th parameter of the data series id th value.

 


 

virtual double y(double t)

Returns the first parameter of the parametric equation with independent value t.

 


 

virtual double x(double t)

Returns the second parameter of the parametric equation with independent value t.

 


 

virtual double xn(int n, double t)

Returns the n th parameter of the parametric equation with independent value t.

 


 

virtual double f(double x)

Returns the value of the explicit equation based on the independent value x.

 


 

virtual double f(Vector<doublexn)

Returns the value of the explicit equation based on the independent value set xn.

 


 

virtual int64 GetCount()

Returns the number of values in a data series or a parametric equation.

 


 

bool IsParam()

Returns true if the data source is a parametric equation.

 


 

bool IsExplicit()

Returns true if the data source is a explicit equation.

 

 

Last edit by koldo on 12/31/2013. Do you want to contribute?. T++