NCBI C++ ToolKit
Int_fuzz.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: Int_fuzz.hpp 33815 2007-05-04 17:18:18Z kazimird $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Author: .......
27  *
28  * File Description:
29  * .......
30  *
31  * Remark:
32  * This code was originally generated by application DATATOOL
33  * using specifications from the ASN data definition file
34  * 'general.asn'.
35  *
36  * ===========================================================================
37  */
38 
39 #ifndef OBJECTS_GENERAL_INT_FUZZ_HPP
40 #define OBJECTS_GENERAL_INT_FUZZ_HPP
41 
42 
43 // generated includes
45 
46 // generated classes
47 
49 
50 BEGIN_objects_SCOPE // namespace ncbi::objects::
51 
52 // Forward declarations
54 {
56 public:
57  // constructor
58  CInt_fuzz(void);
59  // destructor
60  ~CInt_fuzz(void);
61 
62  void GetLabel(string* label, TSeqPos pos, bool right = true) const;
63 
64  /// n1 and n2 are the targets of the fuzz
65  void AssignTranslated(const CInt_fuzz& f2, TSeqPos n1, TSeqPos n2);
66 
67  enum ECombine {
68  /// go for the largest possible range
70  /// go for the smallest range that allows each value
71  /// individually to vary freely as long as the other balances
72  /// it out to the extent possible
73  eReduce
74  };
75 
76  // Manipulators; n1 and n2 are the targets of the fuzz.
77  // Adding anything to its negation (subtracting it from itself)
78  // in eReduce mode should always yield zero.
79  void Add (const CInt_fuzz& f2, TSeqPos& n1, TSeqPos n2,
80  ECombine mode = eAmplify);
81  void Subtract(const CInt_fuzz& f2, TSeqPos& n1, TSeqPos n2,
82  ECombine mode = eReduce);
83  void Negate (TSeqPos n);
84 
85  CRef<CInt_fuzz> Negative(TSeqPos n) const;
86 
87 private:
88  // Prohibit copy constructor and assignment operator
89  CInt_fuzz(const CInt_fuzz& value);
91 
92 };
93 
94 
95 
96 /////////////////// CInt_fuzz inline methods
97 
98 // constructor
99 inline
101 {
102 }
103 
104 
105 inline
107 {
109  result->Assign(*this);
110  result->Negate(n);
111  return result;
112 }
113 
114 
115 inline
117  ECombine mode)
118 {
119  CRef<CInt_fuzz> neg(f2.Negative(n2));
120  Add(*neg, n1, n2, mode);
121 }
122 
123 
124 /////////////////// end of CInt_fuzz inline methods
125 
126 
127 END_objects_SCOPE // namespace ncbi::objects::
128 
130 
131 #endif // OBJECTS_GENERAL_INT_FUZZ_HPP
132 /* Original file checksum: lines: 90, chars: 2388, CRC32: e4127209 */
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:953
CInt_fuzz(void)
Definition: Int_fuzz.hpp:100
**** Int-fuzz ********************************************** * * uncertainties in integer values ...
Definition: Int_fuzz_.hpp:75
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:101
go for the largest possible range
Definition: Int_fuzz.hpp:69
string GetLabel(const CSeq_id &id)
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
void Negate(TSeqPos n)
Definition: Int_fuzz.cpp:319
char value[7]
Definition: config.c:428
void Add(const CInt_fuzz &f2, TSeqPos &n1, TSeqPos n2, ECombine mode=eAmplify)
Definition: Int_fuzz.cpp:143
else result
Definition: token2.c:20
yy_size_t n
void Subtract(const CInt_fuzz &f2, TSeqPos &n1, TSeqPos n2, ECombine mode=eReduce)
Definition: Int_fuzz.hpp:116
CInt_fuzz_Base & operator=(const CInt_fuzz_Base &)
#define NCBI_GENERAL_EXPORT
Definition: ncbi_export.h:519
CRef< CInt_fuzz > Negative(TSeqPos n) const
Definition: Int_fuzz.hpp:106
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:98
Data storage class.
CInt_fuzz_Base Tparent
Definition: Int_fuzz.hpp:55
Modified on Wed Jun 29 18:25:56 2016 by modify_doxy.py rev. 426318