本文整理汇总了C++中ParameterNameValueType::GetValueInt32方法的典型用法代码示例。如果您正苦于以下问题:C++ ParameterNameValueType::GetValueInt32方法的具体用法?C++ ParameterNameValueType::GetValueInt32怎么用?C++ ParameterNameValueType::GetValueInt32使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParameterNameValueType
的用法示例。
在下文中一共展示了ParameterNameValueType::GetValueInt32方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testRead
void CHPMultiDataFileReaderTest::testRead()
{
affymetrix_calvin_data::ProbeSetMultiDataExpressionData ex;
affymetrix_calvin_data::ProbeSetMultiDataGenotypeData gn;
ParameterNameValueType param;
CHPMultiDataData data2;
CHPMultiDataFileReader reader;
reader.SetFilename("../data/CHP_MultiData_file");
reader.Read(data2);
CPPUNIT_ASSERT(data2.GetAlgName() == L"sig");
CPPUNIT_ASSERT(data2.GetAlgVersion() == L"1.0");
CPPUNIT_ASSERT(data2.GetArrayType() == L"test3");
CPPUNIT_ASSERT(data2.GetEntryCount(ExpressionMultiDataType) == 1);
CPPUNIT_ASSERT(data2.GetEntryCount(GenotypeMultiDataType) == 2);
// expression
CPPUNIT_ASSERT(data2.GetNumMetricColumns(ExpressionMultiDataType) == 0);
data2.GetExpressionEntry(ExpressionMultiDataType, 0, ex);
CPPUNIT_ASSERT_DOUBLES_EQUAL(ex.quantification, 10.0f, 0.0001f);
CPPUNIT_ASSERT(ex.name == "ex1");
// genotype
CPPUNIT_ASSERT(data2.GetNumMetricColumns(GenotypeMultiDataType) == 2);
CPPUNIT_ASSERT(data2.GetMetricColumnName(GenotypeMultiDataType, 0) == L"int");
CPPUNIT_ASSERT(data2.GetMetricColumnName(GenotypeMultiDataType, 1) == L"float");
data2.GetGenotypeEntry(GenotypeMultiDataType, 0, gn);
CPPUNIT_ASSERT(gn.call == 1);
CPPUNIT_ASSERT_DOUBLES_EQUAL(gn.confidence, 11.0f, 0.0001f);
CPPUNIT_ASSERT(gn.name == "gn1");
CPPUNIT_ASSERT(gn.metrics.size() == 2);
param = gn.metrics[0];
CPPUNIT_ASSERT(param.GetParameterType() == ParameterNameValueType::Int32Type);
CPPUNIT_ASSERT(param.GetValueInt32() == 1);
param = gn.metrics[1];
CPPUNIT_ASSERT(param.GetParameterType() == ParameterNameValueType::FloatType);
CPPUNIT_ASSERT_DOUBLES_EQUAL(param.GetValueFloat(), 2.0f, 0.00001f);
data2.GetGenotypeEntry(GenotypeMultiDataType, 1, gn);
CPPUNIT_ASSERT(gn.call == 2);
CPPUNIT_ASSERT_DOUBLES_EQUAL(gn.confidence, 22.0f, 0.0001f);
CPPUNIT_ASSERT(gn.name == "gn2");
CPPUNIT_ASSERT(gn.metrics.size() == 2);
param = gn.metrics[0];
CPPUNIT_ASSERT(param.GetParameterType() == ParameterNameValueType::Int32Type);
CPPUNIT_ASSERT(param.GetValueInt32() == 2);
param = gn.metrics[1];
CPPUNIT_ASSERT(param.GetParameterType() == ParameterNameValueType::FloatType);
CPPUNIT_ASSERT_DOUBLES_EQUAL(param.GetValueFloat(), 3.0f, 0.00001f);
}
示例2:
int32_t CHPData::GetInt32FromGenericHdr(const std::wstring& name)
{
int32_t result = 0;
ParameterNameValueType paramType;
GenericDataHeader* hdr = genericData.Header().GetGenericDataHdr();
if (hdr->FindNameValParam(name, paramType))
{
result = paramType.GetValueInt32();
}
return result;
}
示例3: SetCellMargin
void CELConversionUtilities::SetCellMargin(CelFileData &inFile, CCELFileData &outFile, int defaultValue)
{
ParameterNameValueType nvt;
if (inFile.FindAlgorithmParameter(L"CellMargin", nvt))
{
if (nvt.GetParameterType() == ParameterNameValueType::Int32Type)
{
outFile.GetHeader().SetMargin(nvt.GetValueInt32());
}
else if(nvt.GetParameterType() == ParameterNameValueType::AsciiType)
{
outFile.GetHeader().SetMargin(atoi(nvt.GetValueAscii().c_str()));
}
}
else
{
outFile.GetHeader().SetMargin(defaultValue);
}
}
示例4: GetCellMargin
int CalvinCELDataAdapter::GetCellMargin()
{
ParameterNameValueType nvt;
if (calvinCel.FindAlgorithmParameter(CELLMARGIN_PARAM_NAME, nvt))
{
switch(nvt.GetParameterType())
{
case ParameterNameValueType::Int32Type:
return nvt.GetValueInt32();
break;
case ParameterNameValueType::Int16Type:
return (int)nvt.GetValueInt16();
break;
case ParameterNameValueType::Int8Type:
return (int)nvt.GetValueInt8();
break;
case ParameterNameValueType::UInt32Type:
return (int)nvt.GetValueUInt32();
break;
case ParameterNameValueType::UInt16Type:
return (int)nvt.GetValueUInt16();
break;
case ParameterNameValueType::UInt8Type:
return (int)nvt.GetValueUInt8();
break;
case ParameterNameValueType::AsciiType:
return (int)atoi(nvt.GetValueAscii().c_str());
default:
return 0;
break;
}
}
else
{
return 0;
}
}
示例5: Read
/*
* Read the file contents into the data object.
*/
void GridControlFileReader::Read(const std::string &fileName, GridControlData& data)
{
// Clear the old data and read the file.
data.Clear();
GenericFileReader reader;
GenericData gdata;
reader.SetFilename(fileName);
reader.ReadHeader(gdata);
// Check the file identifier
if (gdata.FileIdentifier() != GRD_FILE_TYPE_IDENTIFIER)
{
affymetrix_calvin_exceptions::InvalidFileTypeException e(L"Calvin",L"Default Description, Please Update!",affymetrix_calvin_utilities::DateTime::GetCurrentDateTime().ToString(),std::string(__FILE__),(u_int16_t)__LINE__,0);
throw e;
}
// Get the header parameters.
ParameterNameValueType param;
gdata.Header().GetGenericDataHdr()->FindNameValParam(GRD_ROWS_PARAMETER_NAME, param);
data.SetRows(param.GetValueInt32());
gdata.Header().GetGenericDataHdr()->FindNameValParam(GRD_COLUMNS_PARAMETER_NAME, param);
data.SetColumns(param.GetValueInt32());
// Get the XY coordinates from the dataSets.
FeatureCoordinate coord;
u_int16_t x;
u_int16_t y;
int nRows;
DataSet *dataSet;
// First the B1 probes.
dataSet = gdata.DataSet(GRD_FILE_COORDINATE_GROUP_NAME, GRD_FILE_B1_SET_NAME);
if (dataSet->Open() == false)
{
affymetrix_calvin_exceptions::DataSetNotOpenException e(L"Calvin",L"Default Description, Please Update!",affymetrix_calvin_utilities::DateTime::GetCurrentDateTime().ToString(),std::string(__FILE__),(u_int16_t)__LINE__,0);
throw e;
}
nRows = dataSet->Rows();
data.ResizeB1(nRows);
for (int iRow=0; iRow<nRows; iRow++)
{
dataSet->GetData(iRow, 0, x);
dataSet->GetData(iRow, 1, y);
coord.x = x;
coord.y = y;
data.SetB1(iRow, coord);
}
dataSet->Close();
dataSet->Delete();
// Next the B2 probes.
dataSet = gdata.DataSet(GRD_FILE_COORDINATE_GROUP_NAME, GRD_FILE_B2_SET_NAME);
if (dataSet->Open() == false)
{
affymetrix_calvin_exceptions::DataSetNotOpenException e(L"Calvin",L"Default Description, Please Update!",affymetrix_calvin_utilities::DateTime::GetCurrentDateTime().ToString(),std::string(__FILE__),(u_int16_t)__LINE__,0);
throw e;
}
nRows = dataSet->Rows();
data.ResizeB2(nRows);
for (int iRow=0; iRow<nRows; iRow++)
{
dataSet->GetData(iRow, 0, x);
dataSet->GetData(iRow, 1, y);
coord.x = x;
coord.y = y;
data.SetB2(iRow, coord);
}
dataSet->Close();
dataSet->Delete();
// Last the NS probes.
dataSet = gdata.DataSet(GRD_FILE_COORDINATE_GROUP_NAME, GRD_FILE_NS_SET_NAME);
if (dataSet->Open() == false)
{
affymetrix_calvin_exceptions::DataSetNotOpenException e(L"Calvin",L"Default Description, Please Update!",affymetrix_calvin_utilities::DateTime::GetCurrentDateTime().ToString(),std::string(__FILE__),(u_int16_t)__LINE__,0);
throw e;
}
nRows = dataSet->Rows();
data.ResizeNS(nRows);
for (int iRow=0; iRow<nRows; iRow++)
{
dataSet->GetData(iRow, 0, x);
dataSet->GetData(iRow, 1, y);
coord.x = x;
coord.y = y;
data.SetNS(iRow, coord);
}
dataSet->Close();
dataSet->Delete();
}