Bioplib
Protein Structure C Library
 All Data Structures Files Functions Variables Typedefs Macros Pages
NPerm.c
Go to the documentation of this file.
1 /************************************************************************/
2 /**
3 
4  \file NPerm.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 /* Doxygen
54  -------
55  #GROUP Maths
56  #SUBGROUP Miscellaneous
57  #FUNCTION blNPerm()
58  Calculates number of permutations of n items in r groups
59 */
60 /************************************************************************/
61 /* Includes
62 */
63 #include "SysDefs.h"
64 #include "MathUtil.h"
65 
66 /************************************************************************/
67 /* Defines and macros
68 */
69 
70 /************************************************************************/
71 /* Globals
72 */
73 
74 /************************************************************************/
75 /* Prototypes
76 */
77 
78 
79 /************************************************************************/
80 /*>ULONG blNPerm(int n, int r)
81  -------------------------
82 *//**
83 
84  Calculates number of permutations of n items in r groups
85  Returns 0 if a numeric overflow occurs.
86 
87 - 09.09.96 Original By: ACRM
88 - 07.07.14 Use bl prefix for functions By: CTP
89 */
90 ULONG blNPerm(int n, int r)
91 {
92  return(blFactdiv(n,(n-r)));
93 }
94 
95 
ULONG blNPerm(int n, int r)
Definition: NPerm.c:90
unsigned long ULONG
Definition: SysDefs.h:66
Prototypes, etc. for maths utility routines.
ULONG blFactdiv(int n1, int n2)
Definition: factdiv.c:91
System-type variable type definitions.