We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

supplying range data

Thread ID:

Created:

Updated:

Platform:

Replies:

21949 Nov 29,2004 06:25 PM Dec 1,2004 02:10 PM Windows Forms 6
loading
Tags: Calculate
Greg
Asked On November 29, 2004 06:25 PM

Using QuickCalc, this does not work: str = "CHITEST({58,35;11,25;10,23},{45.35,47.65;17.56,18.44;16.09,16.91})"; res = Convert.ToDouble(qc.ParseAndCompute(str)); whereas the same string above (with prepended equal sign) works in Excel, as this is identical data to their example (I just used direct entry as opposed to cell ranges). 1) Please provide the ability to pass a literal array (in this case, a matrix). 2) How might I easily and efficiently (i.e. I don''t want to have to create a spreadsheet) work around this limitation? Thanks, Greg

Administrator [Syncfusion]
Replied On November 30, 2004 08:46 AM

Cuurently, Essential Calculate does not support Matrix functions or notation. So, using braces in an argument list is not supported. We will add code to notify you of this limitation if you try to use such notation.

Administrator [Syncfusion]
Replied On November 30, 2004 10:25 AM

Thanks for responding, Clay. So, how do I get this function and example parameters working (as simply as possible)? It seems that QuickCalc is not capable of doing it.? Might you have an example of a simple way of calculating with arrays?

Administrator [Syncfusion]
Replied On November 30, 2004 11:34 AM

I do not have a sample for this. You would have to register a custom function that ''understands'' a string argument containing braces, and then either do the calculation yourself, or transform the brace arguments into arguments that some library function can understand. I will see if I can write up such a sample, but it will likely be tomorrow before I can get to it.

Administrator [Syncfusion]
Replied On November 30, 2004 11:48 AM

I''m not asking how to get the brace parsing done - that''ll be a job for the next version of Calculate, I presume. I want to know how to calculate with a range of data. I tried making a CalcSheet, but don''t know how to make the calculate happen. Ex: CalcSheet cs = new CalcSheet(8,2); cs[1,1] = 58; cs[1,2] = 35; cs[2,1] = 11; cs[2,2] = 25; cs[3,1] = 10; cs[3,2] = 23; cs[6,1] = 45.35; cs[6,2] = 47.65; cs[7,1] = 17.56; cs[7,2] = 18.44; cs[8,1] = 16.09; cs[8,2] = 16.91; // cs[4,1] = "=ChiTest(A1:B3,A6:B8)"; // res = Convert.ToDouble(cs[4,1]); res = Convert.ToDouble(cs.Engine.ComputeChitest("A1:B3,A6:B8"));

Administrator [Syncfusion]
Replied On November 30, 2004 06:14 PM

You need to add the CalcSheet to a CalcWorkBook and allow Calculations. CalcSheet cs = new CalcSheet(8,2); CalcWorkbook wb = new CalcWorkbook(new CalcSheet[]{cs}, new Hashtable()); cs.CalculationsSuspended = false; cs[1,1] = 58; cs[1,2] = 35; cs[2,1] = 11; cs[2,2] = 25; cs[3,1] = 10; cs[3,2] = 23; cs[6,1] = 45.35; cs[6,2] = 47.65; cs[7,1] = 17.56; cs[7,2] = 18.44; cs[8,1] = 16.09; cs[8,2] = 16.91; cs[4,1] = "=ChiTest(A1:B3,A6:B8)"; this.label1.Text = cs[4,1].ToString(); One other comment is that ChiTest is terribly slow in the code you have. It will about 10-20 seconds to return a value. It is by far the slowest calculation (probably 20-40 times slower than the next slowest formula). We will tweak this calculation for the release.

Administrator [Syncfusion]
Replied On December 1, 2004 02:10 PM

Thanks Clay, that single workbook line was the missing piece. I''ll now be able to use this style whenever dealing with a range of data. Hopefully the range syntax at the top of this post will be given serious consideration. (and some day this forum will accept single apostrophes!)

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;