Example #1
0
	void EpsilonVor::ReadIt(std::ifstream & fin){
		Matrix co0,oc0;
		fin.read((char *) &nnx, sizeof nnx);
		fin.read((char *) &nny, sizeof nny);
		fin.read((char *) &nnz, sizeof nnz);
		fin.read((char *) &co0, sizeof co0);
		fin.read((char *) &oc0, sizeof oc0);
		fin.read((char *) &nresid, sizeof nresid);
		Deallocate();
		is_xRefset=true;
		is_COset=true;
		setMetric(co0);
		Allocate();
		int ntoken;
		fin.read((char *) &ntoken, sizeof ntoken);
		char * css=new char [ntoken];
		fin.read(css, (sizeof css[0])*ntoken);
		string token(css);
		ResLabel.clear();

		boost::split(ResLabel,token, boost::is_any_of("\t "));

		fin.read((char *) &TotalCount, sizeof TotalCount);
		fin.read((char *) &M_avg[0], (sizeof M_avg[0])*DIM);
		fin.read((char *) &VoroVol[0], (sizeof VoroVol[0])*nresid);
		fin.read((char *) &D[0][0][0], (sizeof D[0][0][0])*DIM*DIM*nresid);
		fin.read((char *) &G[0][0][0], (sizeof G[0][0][0])*DIM*DIM*nresid);
		fin.read((char *) &M[0][0], (sizeof M[0][0])*DIM*nresid);
		fin.read((char *) &E[0][0], (sizeof E[0][0])*DIM*nresid);
	}
Example #2
0
NetDeviceFace::NetDeviceFace(Ptr<Node> node, const Ptr<NetDevice>& netDevice)
  : Face(FaceUri("netDeviceFace://"), FaceUri("netDeviceFace://"),getLevelFromNode(node),false)
  , m_node(node)
  , m_netDevice(netDevice)
{
  NS_LOG_FUNCTION(this << netDevice);

  setMetric(1); // default metric

  NS_ASSERT_MSG(m_netDevice != 0, "NetDeviceFace needs to be assigned a valid NetDevice");

  m_node->RegisterProtocolHandler(MakeCallback(&NetDeviceFace::receiveFromNetDevice, this),
                                  L3Protocol::ETHERNET_FRAME_TYPE, m_netDevice,
                                  true /*promiscuous mode*/);
}
Example #3
0
	EpsilonVor & EpsilonVor::operator=(const Epsilon & z){
		const EpsilonVor & z1=dynamic_cast<const EpsilonVor &> (z);
		Matrix co0=z1.co;
		nresid=z1.nresid;
		Deallocate();
		is_xRefset=true;
		is_COset=true;
		setMetric(co0);
		Allocate();
		ResLabel=z1.ResLabel;
		TotalCount=z1.TotalCount;
		M_avg=z1.M_avg;
		VoroVol=z1.VoroVol;
		D=z1.D;
		G=z1.G;
		M=z1.M;
		E=z1.E;
		return *this;
	}
Example #4
0
MetEngLayout::MetEngLayout(bool state, QWidget *parent) :
    QHBoxLayout(parent)
{
    // Create the Edit boxes for ft/cm and inches. We can set the width of
    // the inch edit box now, since that won't change.
    //
    ftcmEdit = new WLineEdit;
    inchEdit = new WLineEdit;
    inchEdit->setFixedWidth(INWID);

    // Connect these editboxes to their validators
    //
    ftcmEdit->setValidator(&ftcmValidator);
    inchEdit->setValidator(&inchValidator);
    inchValidator.setRange(MIN_IN, MAX_IN);

    // Create the labels for ft/cm and inches. We can put the text into the
    // inches label now, since that won't change, either.
    //
    ftcmLabel = new QLabel;
    inchLabel = new QLabel("in");

    // Initialize the state of the metenglayout object. If the object was
    // instantiated without a state argument, the default is "true", which
    // means the default measurement system is metric.
    //
    state ? setMetric() : setEnglish();

    // When adding the ftcmEdit and ftcmLabel widgets, we want them to fill
    // the available space and align left within the QHBoxLayout. The secret
    // is to set the stretch (second arg) = 1, and the alignment (third arg)
    // = QtAlignLeft.
    // See http://lists.qt.nokia.com/public/qt-interest/2011-March/031994.html
    //
    addWidget(ftcmEdit,  1, Qt::AlignLeft);
    addWidget(ftcmLabel, 1, Qt::AlignLeft);

    // Add the inch Edit box and label.
    //
    addWidget(inchEdit);
    addWidget(inchLabel);
}
NetDeviceFace::NetDeviceFace(Ptr<Node> node, const Ptr<NetDevice>& netDevice)
  : Face(FaceUri("netDeviceFace://"),
         FaceUri("netDeviceFace://"),
         false,
         // this is the mod mentioned above
         ( netDevice->GetObject<Object>
             ( TypeId::LookupByName( "ndntac::IsEdgeFlag" ) )
             ? true : false ),
         false )
  , m_node(node)
  , m_netDevice(netDevice)
{
  NS_LOG_FUNCTION(this << netDevice);

  setMetric(1); // default metric

  NS_ASSERT_MSG(m_netDevice != 0, "NetDeviceFace needs to be assigned a valid NetDevice");

  m_node->RegisterProtocolHandler(MakeCallback(&NetDeviceFace::receiveFromNetDevice, this),
                                  L3Protocol::ETHERNET_FRAME_TYPE, m_netDevice,
                                  true /*promiscuous mode*/);
}
StartNodePicker::StartNodePicker(RRTMetric* m) {
	setMetric(m);
}
/**
 * Process another cel files worth of data.
 */
void
MultiChannelNonOverlapCelListener::newChip(affymetrix_fusion_io::FusionCELData* cel)
{
  // remember the pointer for later.
  m_cel=cel;
  //
  m_CelNames.push_back(cel->GetFileName());

  // Get Contrast Values
  vector<double> ATcontrastValues;
  vector<double> GCcontrastValues;
  // Get LogDiff values
  vector<double> ATLogDiffValues;
  vector<double> GCLogDiffValues;

  vector<double> ATSaturationValues;
  vector<double> GCSaturationValues;

  // Vincent Bressler 11/15/2012
  //vector<float> intensities;
  //double sat_gc = 0;
  //double sat_at = 0;

  //{
	 // int n = cel->GetNumCells ();
	 // intensities.resize (n);
	 // int check = cel->GetIntensities (0,intensities); // GC is channel 0
	 // int nsat = 0;
	 // for (int i=0; i<n; i++)
	 // {
		//  if (intensities[i] >= 3800)
		//	  nsat++;
	 // }

	 // sat_gc = (double)nsat / (double)n;
  //}

  //{
	 // int n = cel->GetNumCells ();
	 // cel->GetIntensities (1,intensities); // AT is channel 1
	 // int nsat = 0;
	 // for (int i=0; i<n; i++)
	 // {
		//  if (intensities[i] >= 3800)
		//	  nsat++;
	 // }

	 // sat_at = (double)nsat / (double)n;
  //}
  
  //need to edit here to change the contrast
  GimmeContrast(m_ProbeSets,
                ATcontrastValues, GCcontrastValues,
                ATLogDiffValues,  GCLogDiffValues,
				ATSaturationValues, GCSaturationValues,
                m_K);

  Verbose::out(4, "AT nonpolymorphic probeset size is: " + ToStr(ATcontrastValues.size()));
  Verbose::out(4, "GC nonpolymorphic probeset size is: " + ToStr(GCcontrastValues.size()));

  Verbose::out(4, "calculate new log diff score");
  double atLogDiffScore, gcLogDiffScore, logDiffQC ;
  calcLogDiff(ATLogDiffValues, atLogDiffScore);
  calcLogDiff(GCLogDiffValues, gcLogDiffScore);
  logDiffQC = atLogDiffScore + gcLogDiffScore;

  CumulativeStats<double> GCstats;
  CumulativeStats<double> ATstats_full;
  CumulativeStats<double> GCstats_full;

  double nonOverlap = calcNonOverlap(ATcontrastValues, GCcontrastValues, GCstats);
  
  // difference between median / avg IQR
  //double medianDiff = calcMedianDiff(ATcontrastValues, GCcontrastValues, GCstats_full, ATstats_full);
  int chipIdx=getNextChipIdx();
  setMetric(chipIdx,m_Label+"_DQC"                 , nonOverlap);
  //setMetric(chipIdx,m_Label+"_median_diff_over_iqr", medianDiff);
  //setMetric(chipIdx,m_Label+"_AT_median"           , ATstats_full.getMedian());
  //setMetric(chipIdx,m_Label+"_GC_median"           , GCstats_full.getMedian());
  setMetric(chipIdx,m_Label+"_log_diff_qc"         , logDiffQC);
  setMetric(chipIdx,"saturation_GC"       , GCSaturationValues[0]);
  setMetric(chipIdx,"saturation_AT"       , ATSaturationValues[0]);
  setValid(true);
}
Example #8
0
 Route4::Route4(const in_addr_t addr, const std::string & mask,
                const int metric)
                : Addr4(addr, mask)
 {
     setMetric(metric);
 }
Example #9
0
 Route4::Route4(const in_addr_t addr, const uint32_t mask,
                const MaskType type, const int metric)
                : Addr4(addr, mask, type)
 {
     setMetric(metric);
 }
Example #10
0
 Route4::Route4(const std::string & addr, const uint32_t mask,
                const MaskType type, const int metric)
                : Addr4(addr, mask, type)
 {
     setMetric(metric);
 }