25 #include "marginalTrek++.h"
26 #include "isoSpec++.h"
27 #include "fixedEnvelopes.h"
34 void * setupIso(
int dimNumber,
35 const int* isotopeNumbers,
36 const int* atomCounts,
37 const double* isotopeMasses,
38 const double* isotopeProbabilities)
40 const double** IM =
new const double*[dimNumber];
41 const double** IP =
new const double*[dimNumber];
43 for(
int i=0; i<dimNumber; i++)
45 IM[i] = &isotopeMasses[idx];
46 IP[i] = &isotopeProbabilities[idx];
47 idx += isotopeNumbers[i];
51 Iso* iso =
new Iso(dimNumber, isotopeNumbers, atomCounts, IM, IP);
56 return reinterpret_cast<void*
>(iso);
59 void deleteIso(
void* iso)
61 delete reinterpret_cast<Iso*
>(iso);
64 double getLightestPeakMassIso(
void* iso)
66 return reinterpret_cast<Iso*
>(iso)->getLightestPeakMass();
69 double getHeaviestPeakMassIso(
void* iso)
71 return reinterpret_cast<Iso*
>(iso)->getHeaviestPeakMass();
74 double getMonoisotopicPeakMassIso(
void* iso)
76 return reinterpret_cast<Iso*
>(iso)->getMonoisotopicPeakMass();
79 double getModeLProbIso(
void* iso)
81 return reinterpret_cast<Iso*
>(iso)->getModeLProb();
84 double getModeMassIso(
void* iso)
86 return reinterpret_cast<Iso*
>(iso)->getModeMass();
89 double getTheoreticalAverageMassIso(
void* iso)
91 return reinterpret_cast<Iso*
>(iso)->getTheoreticalAverageMass();
96 #define ISOSPEC_C_FN_CODE(generatorType, dataType, method)\
97 dataType method##generatorType(void* generator){ return reinterpret_cast<generatorType*>(generator)->method(); }
99 #define ISOSPEC_C_FN_CODE_GET_CONF_SIGNATURE(generatorType)\
100 void get_conf_signature##generatorType(void* generator, int* space)\
101 { reinterpret_cast<generatorType*>(generator)->get_conf_signature(space); }
104 #define ISOSPEC_C_FN_DELETE(generatorType) void delete##generatorType(void* generator){ delete reinterpret_cast<generatorType*>(generator); }
106 #define ISOSPEC_C_FN_CODES(generatorType)\
107 ISOSPEC_C_FN_CODE(generatorType, double, mass) \
108 ISOSPEC_C_FN_CODE(generatorType, double, lprob) \
109 ISOSPEC_C_FN_CODE(generatorType, double, prob) \
110 ISOSPEC_C_FN_CODE_GET_CONF_SIGNATURE(generatorType) \
111 ISOSPEC_C_FN_CODE(generatorType, bool, advanceToNextConfiguration) \
112 ISOSPEC_C_FN_DELETE(generatorType)
117 void* setupIsoThresholdGenerator(
void* iso,
124 std::move(*
reinterpret_cast<Iso*
>(iso)),
130 return reinterpret_cast<void*
>(iso_tmp);
136 void* setupIsoLayeredGenerator(
void* iso,
142 std::move(*
reinterpret_cast<Iso*
>(iso)),
147 return reinterpret_cast<void*
>(iso_tmp);
153 void* setupIsoOrderedGenerator(
void* iso,
158 std::move(*
reinterpret_cast<Iso*
>(iso)),
162 return reinterpret_cast<void*
>(iso_tmp);
168 void* setupThresholdFixedEnvelope(
void* iso,
184 return reinterpret_cast<void*
>(tabulator);
187 void deleteThresholdFixedEnvelope(
void* t)
192 const double* massesThresholdFixedEnvelope(
void* tabulator)
197 const double* lprobsThresholdFixedEnvelope(
void* tabulator)
202 const double* probsThresholdFixedEnvelope(
void* tabulator)
207 const int* confsThresholdFixedEnvelope(
void* tabulator)
212 int confs_noThresholdFixedEnvelope(
void* tabulator)
220 void* setupTotalProbFixedEnvelope(
void* iso,
221 double target_coverage,
236 return reinterpret_cast<void*
>(tabulator);
239 void deleteTotalProbFixedEnvelope(
void* t)
244 const double* massesTotalProbFixedEnvelope(
void* tabulator)
249 const double* lprobsTotalProbFixedEnvelope(
void* tabulator)
254 const double* probsTotalProbFixedEnvelope(
void* tabulator)
259 const int* confsTotalProbFixedEnvelope(
void* tabulator)
264 int confs_noTotalProbFixedEnvelope(
void* tabulator)
269 void freeReleasedArray(
void* array)