请问reverse在此作用域未声明怎么解决?
g++ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I/home/deepblue/Downloads/ramp -I. -I/usr/local/include/gsl -Wno-deprecated -c ./ InOut.cpp
In file included from InOut.cpp:26:0:
InOut.hpp: 在成员函数‘void InOut::reverseMass()’中:
InOut.hpp:134:48: 错误: ‘reverse’在此作用域中尚未声明
InOut.cpp: 在成员函数‘void InOut::plotHistogramCandidate(std::vector<scanAnalysis>)’中:
InOut.cpp:981:59: 错误: ‘sort’在此作用域中尚未声明
InOut.cpp:982:62: 错误: ‘reverse’在此作用域中尚未声明
make: *** [InOut.o] 错误 1
以下是InOut.hpp文件:
#if !defined(INOUT_HPP)
#define INOUT_HPP
#include <fstream> // file output
#include <vector>
#include <math.h> // fabs
#include <iomanip> // setw
#include <iostream>
#include "libraResults.hpp"
#include "gsl/gsl_histogram.h"
using namespace std;
class InOut
{
public:
typedef pair<float,float> ff;
typedef vector< ff > vff;
typedef vector<float> vf;
typedef vector<vf> vvf;
typedef vector<double> vd;
InOut();
~InOut();
int getConditionsFromStdIn();
int getConditionsFromFile( char* conditionFileName );
int openOutFile( char* inFileName );
int closeOutput();
void printSumoXML( vector<scanAnalysis> vScan );
string escape( char* text );
// Getter and setter
int getRequestedMsLevel()
{
return m_requestedMsLevel;
}
int getPrecursorMassType()
{
return m_precursorMassType;
}
int getFragmentationMassType()
{
return m_fragmentationMassType;
}
bool getUseIsotopicCorrection()
{
return m_useIsotopicCorrection;
}
inline char getFragmentType()
{
return m_fragmentType;
}
int getCentroidingPref()
{
return m_centroidingPref;
}
int getCentroidingIteration()
{
return m_centroidingIteration;
}
int getIsToNormalize()
{
return m_isToNormalize;
}
int getNormalPosition()
{
return m_normalPosition;
}
float getTolerance()
{
return m_tolerance;
}
inline double getDigestionTolerance()
{
return m_digestionTolerance;
}
char getModifiedResidue()
{
return m_modifiedResidue;
}
bool getNotTerminal()
{
return m_notTerminal;
}
inline vd getMass()
{
return m_mass;
}
inline void reverseMass()
{
// We keep the 0 (the last element) at the end
reverse( m_mass.begin() , m_mass.end() - 1 );
}
inline vd* getTargetMass( )
{
return &m_targetMass;
}
inline double getPrecursorModificationMass()
{
return m_precursorModificationMass;
}
vvf getMassIsotopes()
{
return m_massIsotopes;
}
void setTargetMass( vd targetMass )
{
m_targetMass = targetMass;
}
void setMzXmlFile( char* mzXmlFile )
{
strcpy( m_mzXmlFile , mzXmlFile );
}
inline int getDigestionStep()
{
return m_digestionStep;
}
inline vector< pair< char , char > > getDigestC()
{
return m_digestC;
}
inline vector< pair< char , char > > getDigestN()
{
return m_digestN;
}
inline pair< char , int > getDigestUnconstrained()
{
return m_digestUnconstrained;
}
inline vector< pair< char , int > > getMissCleaveC()
{
return m_missCleaveC;
}
inline vector< pair< pair< char , char > , int > > getGetMissCleaveC()
{
return m_getMissCleaveC;
}
inline vector< pair< char , double > > getStaticModifications()
{
return m_staticModifications;
}
inline vector< pair< char , double > > getVariableModifications()
{
return m_variableModifications;
}
inline int getStartCharge()
{
return m_startCharge;
}
inline int getEndCharge()
{
return m_endCharge;
}
inline vector< double > getLoss()
{
return m_loss;
}
inline bool getNonInteractive()
{
return m_nonInteractive;
}
private:
char m_mzXmlFile[1000];
int m_nrReagents; // The number of quantitative reagents used
vd m_mass; // The target m/z values as read from the condition
// file
vd m_targetMass; // The adjusted target m/z values. This might be
// different from m_mass if m_mass contains
// offsets and not real target masses (e.g. SUMO)
double m_precursorModificationMass; // This is the mass of the modification.
// It could be different than the sum of the
// masses of its fragments if m_precursorMassType
// and m_fragmentationMassType are different!!
// This is the mass of the modification after it
// has been attached to the target peptide
// (e.g. in the case of ULMs it will be the mass
// of the most C-terminal tryptic peptide minus
// the mass of the C-terminal OH group).
vvf m_massIsotopes; // Isotopic contributions
mutable vector< double > m_loss;
mutable vector< pair< char , double > > m_staticModifications;
mutable vector< pair< char , double > > m_variableModifications;
mutable vector< pair< char , char > > m_digestC;
mutable vector< pair< char , char > > m_digestN;
mutable vector< pair< char , int > > m_missCleaveC;
mutable vector< pair< pair< char , char > , int > > m_getMissCleaveC;
pair< char , int > m_digestUnconstrained;
/*
Isotopic contributions are stored in the following type of matrix.
The actual contributions (n, m, p) represent a % of the intensity
of the at the corresponding m/z.
isotopic contribution isotopic contribution isotopic contribution
from mass 1 from mass 2 from mass 3
mass1 n m p
mass2 ... ... ...
mass3 ... ... ...
*/
bool m_useIsotopicCorrection;
char m_fragmentType; // t: SUMO like
// h: SS like
char m_modifiedResidue; // The residue to which the modification is
// attached
bool m_notTerminal; // If true -> m_modifiedResidue cannot be found
// at the C terminus of a peptide
float m_tolerance; // the mass tolerance around the m/z for each
// isotope
double m_digestionTolerance; // The mass tolerance when looking for a target
int m_centroidingPref; // 1. math average 2.Weighted
int m_centroidingIteration; // number of times the centroiding process
// is repeated
bool m_isToNormalize;
int m_normalPosition;
int m_requestedMsLevel; // The MS level we want to look into
int m_precursorMassType; // What type of masses to use for the precursor
// ion. Options are:
// 1 = average
// 2 = monoisotopic
// 3 = average with N15 labeled AA
int m_fragmentationMassType; // Wath type of masses to use in
// fragmentation spectra.
// See m_precursorMassType for options.
// The reason these two parameters are
// defined separately is to account for
// hybrid instruments.
int m_outputPrefs; // Use scanNum (1) or RT (2)
int m_digestionStep;
int m_startCharge , m_endCharge;
bool m_nonInteractive;
// Fills the current row of the m_massIsotopes matrix with zeros
// starting from the position given by isoMassPos to the end.
void zeroFill( int n );
void plotHistogram( vector<scanAnalysis> vScan );
void plotHistogramCandidate( vector<scanAnalysis> vScan );
void plotModCand( vector<scanAnalysis> vScan );
};
#endif