473,406 Members | 2,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

calling n methods

Hi,
i need to work out a solution to this:
i have a class that is a time series of (double) numbers and i want to do
the following calculation
for
int x;
i need to perform a calculation which will, starting with the last item
added to the time series perform calculations moving backwards through the
timeseries x items back and return these calculations in a new series of data
comprising these x items
Oct 3 '07 #1
4 1057
That all depends on the structure of your "time series" class.

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"b1uceree" <b1******@discussions.microsoft.comwrote in message
news:BD**********************************@microsof t.com...
Hi,
i need to work out a solution to this:
i have a class that is a time series of (double) numbers and i want to do
the following calculation
for
int x;
i need to perform a calculation which will, starting with the last item
added to the time series perform calculations moving backwards through the
timeseries x items back and return these calculations in a new series of
data
comprising these x items

Oct 3 '07 #2
its a standard net 2.0 container returning a timeseries with dateTime and
value for each element in the array. You can access data in the container by
index (starting from 0. ie

doubleSeries series = new doubleSeries();

// Get second element
double secondValue = series[1];

//Getting the second to last value
for (int i = 1; i < series.Count; i++) {
double value = series[i];
}

// Get the last value
double lastValue = series.Last;

// Get the first value
double firstValue = series.First;
"Kevin Spencer" wrote:
That all depends on the structure of your "time series" class.

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"b1uceree" <b1******@discussions.microsoft.comwrote in message
news:BD**********************************@microsof t.com...
Hi,
i need to work out a solution to this:
i have a class that is a time series of (double) numbers and i want to do
the following calculation
for
int x;
i need to perform a calculation which will, starting with the last item
added to the time series perform calculations moving backwards through the
timeseries x items back and return these calculations in a new series of
data
comprising these x items


Oct 3 '07 #3
On Oct 3, 8:26 am, b1uceree <b1uce...@discussions.microsoft.com>
wrote:
its a standard net 2.0 container returning a timeseries with dateTime and
value for each element in the array. You can access data in the container by
index (starting from 0. ie

doubleSeries series = new doubleSeries();

// Get second element
double secondValue = series[1];

//Getting the second to last value
for (int i = 1; i < series.Count; i++) {
double value = series[i];

}

// Get the last value
double lastValue = series.Last;

// Get the first value
double firstValue = series.First;

"Kevin Spencer" wrote:
That all depends on the structure of your "time series" class.
--
HTH,
Kevin Spencer
Microsoft MVP
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
"b1uceree" <b1uce...@discussions.microsoft.comwrote in message
news:BD**********************************@microsof t.com...
Hi,
i need to work out a solution to this:
i have a class that is a time series of (double) numbers and i want to do
the following calculation
for
int x;
i need to perform a calculation which will, starting with the last item
added to the time series perform calculations moving backwards through the
timeseries x items back and return these calculations in a new series of
data
comprising these x items
You can use a for loop backwards:

int x = 5;
for (int i = series.Count - 1; i >= (series.Count - x); i--) {
//perform calculation with series[i]
}

Chris

Oct 3 '07 #4
Hi,

What can't you manage to do ?
for int index=list.count-1;i>0;i--
{
[...]
}
where 'list' could be a List<double>

b1uceree wrote :
Hi,
i need to work out a solution to this:
i have a class that is a time series of (double) numbers and i want to do
the following calculation
for
int x;
i need to perform a calculation which will, starting with the last item
added to the time series perform calculations moving backwards through the
timeseries x items back and return these calculations in a new series of data
comprising these x items
Oct 4 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Matthew Bell | last post by:
Hi, I've got a question about whether there are any issues with directly calling attributes and/or methods of a threaded class instance. I wonder if someone could give me some advice on this. ...
14
by: Axel Straschil | last post by:
Hello! Im working with new (object) classes and normaly call init of ther motherclass with callin super(...), workes fine. No, I've got a case with multiple inherance and want to ask if this...
1
by: Stephen Kellett | last post by:
Hello everyone, I'm trying to do something in C calling Python and its failing. I'd be grateful if you could take a look and hopefully you have an answer. What I'm trying to do is determine...
3
by: Cindy Liu | last post by:
Hi Everyone, I created C# COM+ component. It has two overloaded methods - the method names are same and their signatures are different, one takes two parameters and another takes four. I coded...
5
by: Dave | last post by:
does calling a regular function cost any cpu time? In other words, is it faster to write the code of two functions into main(), or is it the exact same thing as calling two functions. I know its...
1
by: Lakshmi | last post by:
Hi All, I am having performance issues with the .NET client calling the Java Webservice running on axis. Have detailed the problem below. Please help. I wrote a webservice in Java. Lets name...
6
by: Rob Cowie | last post by:
Hi all, Is there a simple way to call every method of an object from its __init__()? For example, given the following class, what would I replace the comment line in __init__() with to result...
6
by: Anthony Smith | last post by:
I can call a class using "->", but it complains about the :: I see on the net where :: is used. Is there a good explanation on when to use one over the other or the differences? $help = new...
6
by: Ole Nielsby | last post by:
VC has a __cdecl specifier which allows functions and methods to be called with varying parameter count. (I understand this is the default for functions in general but in VC, instances use...
1
by: svatauli1983 | last post by:
Hi all, can someone write me if is normal to have business layer of static methods. Example: from page.aspx.cs calling static method in other assembly (static methods doesnt use state variables)....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.