The outage for Sunday 24th November has been cancelled.
Bioplib
Protein Structure C Library
Main Page
Related Pages
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Macros
Pages
src
NComb.c
Go to the documentation of this file.
1
/************************************************************************/
2
/**
3
4
\file NComb.c
5
6
\version V1.1
7
\date 07.07.14
8
\brief
9
10
\copyright (c) UCL / Dr. Andrew C. R. Martin 1996-2014
11
\author Dr. Andrew C. R. Martin
12
\par
13
Institute of Structural & Molecular Biology,
14
University College London,
15
Gower Street,
16
London.
17
WC1E 6BT.
18
\par
19
andrew@bioinf.org.uk
20
andrew.martin@ucl.ac.uk
21
22
**************************************************************************
23
24
This code is NOT IN THE PUBLIC DOMAIN, but it may be copied
25
according to the conditions laid out in the accompanying file
26
COPYING.DOC.
27
28
The code may be modified as required, but any modifications must be
29
documented so that the person responsible can be identified.
30
31
The code may not be sold commercially or included as part of a
32
commercial product except as described in the file COPYING.DOC.
33
34
**************************************************************************
35
36
Description:
37
============
38
39
40
**************************************************************************
41
42
Usage:
43
======
44
45
**************************************************************************
46
47
Revision History:
48
=================
49
- V1.0 10.09.96 Original
50
- V1.1 07.07.14 Use bl prefix for functions By: CTP
51
52
53
*************************************************************************/
54
/* Doxygen
55
-------
56
#GROUP Maths
57
#SUBGROUP Miscellaneous
58
#FUNCTION blNComb()
59
Calculates number of combinations of n items in r groups
60
*/
61
/************************************************************************/
62
/* Includes
63
*/
64
#include "
SysDefs.h
"
65
#include "
MathUtil.h
"
66
67
/************************************************************************/
68
/* Defines and macros
69
*/
70
71
/************************************************************************/
72
/* Globals
73
*/
74
75
/************************************************************************/
76
/* Prototypes
77
*/
78
79
80
/************************************************************************/
81
/*>ULONG blNComb(int n, int r)
82
---------------------------
83
*/
/**
84
85
Calculates number of combinations of n items in r groups
86
Returns 0 if a numeric overflow occurs.
87
88
- 09.09.96 Original By: ACRM
89
- 07.07.14 Use bl prefix for functions By: CTP
90
*/
91
ULONG
blNComb
(
int
n,
int
r)
92
{
93
ULONG
f;
94
f =
blFactorial
(r);
95
96
return
((f>0L)?(
blNPerm
(n,r)/
blFactorial
(r)):0L);
97
}
ULONG
unsigned long ULONG
Definition:
SysDefs.h:66
MathUtil.h
Prototypes, etc. for maths utility routines.
blNComb
ULONG blNComb(int n, int r)
Definition:
NComb.c:91
SysDefs.h
System-type variable type definitions.
blFactorial
ULONG blFactorial(int n)
Definition:
factorial.c:89
blNPerm
ULONG blNPerm(int n, int r)
Definition:
NPerm.c:90
Generated on Tue Oct 24 2017 10:57:11 for Bioplib by
1.8.8