Get the source code of HYPGEOMDIST() and use in C#

Java, C++, C#, Delphi... - Using the UNO bridges
Post Reply
Vedha
Posts: 3
Joined: Thu Oct 31, 2013 8:06 am

HYPGEOMDIST function in Calc

Post by Vedha »

How can use the Openoffice function "HYPGEOMDIST" into my asp.net web application referencing its .dll file or namespace.

Currently i am using the MS Office "Microsoft.Office.Interop.Excel.dll" for the same.

Please help me.

Thanks in Advance,
Vedha
Last edited by RoryOF on Thu Oct 31, 2013 9:55 am, edited 1 time in total.
Reason: Changed Subject, as a descriptive Subject helps get relevantreplies [RoryOF, Moderator]
Openoffice 4.0.1 and Windows 7
User avatar
MrProgrammer
Moderator
Posts: 4907
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: HYPGEOMDIST function in Calc

Post by MrProgrammer »

Hi, and welcome to the forum.
AOO Help wrote:
HYPGEOMDIST: Returns the hypergeometric distribution.
Syntax:      HYPGEOMDIST(X; NSample; Successes; NPopulation)
X:           the number of results achieved in the random sample.
NSample:     the size of the random sample.
Successes:   the number of possible results in the total population.
NPopulation: the size of the total population.
It will be far simpler to calculate the value directly than to call the Calc function from an external application. The calculation is easily done in a dozen lines in any decent programming language. I doubt if you can call the Calc function without installing large parts of the Open Office application. AOO is an integrated system; you can't install selected bits and pieces of it. Even if you install the whole suite, it will be more challenging to determine how to utilize the Calc function than it will be to do the calculation yourself.

Read about the Probability Mass Function (pmf) of the Hypergeometric distribution. In this reference N (population size) is the same as NPopulation above, K (number of success states in the population) is Successes above, n (number of draws) is NSample above, and k (number of successes) is X above. Read about binomial coefficients if you're not familiar with how to calculate them.

If this answered your question please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
Vedha
Posts: 3
Joined: Thu Oct 31, 2013 8:06 am

Get the source code of HYPGEOMDIST() and use in C#

Post by Vedha »

Hi,

i have installed the AOO 4.0 in my system.
How to get an use the source code one of the statistical function HYPGEOMDIST() from AOO and use it in asp.net code? :roll:

please provide the suggestion/idea ASAP

Thanks in advance
vedha
Openoffice 4.0.1 and Windows 7
User avatar
Hagar Delest
Moderator
Posts: 32663
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Get the source code of HYPGEOMDIST() and use in C# (URGE

Post by Hagar Delest »

For such a question about source code, you should ask the dev mailing list.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
regina
Posts: 67
Joined: Sat Apr 05, 2008 4:55 pm

Re: Get the source code of HYPGEOMDIST() and use in C#

Post by regina »

You can lookup the code in http://svn.apache.org/viewvc/openoffice/ or search with http://opengrok.adfinis-sygroup.org/
And the Wiki pages https://wiki.openoffice.org/wiki/Calc/I ... _Functions tell you, what files are all affected by Calc functions.

The function HYPERGEOMDIST() is in main/sc/source/core/tool/interpr3.cxx, the method ScInterpreter::ScHypGeomDist()
Post Reply