本文整理汇总了C++中Peak1D::getPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ Peak1D::getPosition方法的具体用法?C++ Peak1D::getPosition怎么用?C++ Peak1D::getPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Peak1D
的用法示例。
在下文中一共展示了Peak1D::getPosition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getPos
START_SECTION((CoordinateType getPos() const))
TEST_REAL_SIMILAR(Peak1D().getPos(), 0.0)
END_SECTION
START_SECTION((void setIntensity(IntensityType intensity)))
Peak1D p;
p.setIntensity(17.8f);
TEST_REAL_SIMILAR(p.getIntensity(), 17.8)
END_SECTION
START_SECTION((void setPosition(PositionType const &position)))
Peak1D::PositionType pos;
pos[0] = 1.0;
Peak1D p;
p.setPosition(pos);
TEST_REAL_SIMILAR(p.getPosition()[0], 1.0)
END_SECTION
START_SECTION((PositionType& getPosition()))
Peak1D::PositionType pos;
pos[0] = 1.0;
Peak1D p;
p.getPosition() = pos;
TEST_REAL_SIMILAR(p.getPosition()[0], 1.0)
END_SECTION
START_SECTION((void setMZ(CoordinateTypemz)))
Peak1D p;
p.setMZ(5.0);
TEST_REAL_SIMILAR(p.getMZ(), 5.0)
END_SECTION
示例2:
TEST_EQUAL(peak.getAtom(), 0)
peak.setAtom(&atom);
TEST_EQUAL(peak.getAtom(), &atom)
RESULT
CHECK(Peak1D::Peak1D(const Peak1D& peak))
Peak1D peak2(peak);
TEST_REAL_EQUAL(peak2.getPosition(), 111.1)
TEST_REAL_EQUAL(peak2.getWidth(), 222.2)
TEST_REAL_EQUAL(peak2.getIntensity(), 333.3)
TEST_EQUAL(peak2.getAtom(), &atom)
RESULT
CHECK(Peak1D::void operator = (const Peak1D& peak))
Peak1D peak2 = peak;
TEST_REAL_EQUAL(peak2.getPosition(), 111.1)
TEST_REAL_EQUAL(peak2.getWidth(), 222.2)
TEST_REAL_EQUAL(peak2.getIntensity(), 333.3)
TEST_EQUAL(peak2.getAtom(), &atom)
RESULT
CHECK(Peak1D::bool operator == (const Peak1D& peak) const )
Peak1D peak2 = peak;
Peak1D peak3 = peak;
TEST_EQUAL(peak2 == peak, true)
TEST_EQUAL(peak2 == peak3, true)
peak3.setWidth(0.0);
TEST_EQUAL(peak2 == peak, true)
TEST_EQUAL(peak2 == peak3, false)
peak3.setWidth(peak2.getWidth());
TEST_EQUAL(peak2 == peak3, true)