请问reverse在此作用域未声明怎么解决?

zyl714 2014-05-07 10:45:01
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
...全文
414 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
zyl714 2014-05-08
  • 打赏
  • 举报
回复
非常感谢,问题解决了
temperlancer 2014-05-07
  • 打赏
  • 举报
回复
你试试#include <algorithm>. 因为reverse是在algorithm这个头文件里被定义的.

64,639

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧