Exemplo n.º 1
0
void OrientedPoint::Init()
{
	setDoubleValue("RemainingInformation", 0.0);
	setDoubleValue("TotalInformation", 0.0);
	Color_ = Color<unsigned char> (0,0,0);
	Normal_ = vgl_vector_3d<double> (0.0, 0.0, 0.0);
	Coord_ = vgl_point_3d<double> (0.0, 0.0, 0.0);
	type_ = 0;
	//ConsistencyDistance_ = -100.0;
	Valid_ = false;
	ValidColor_ = false;
}
Exemplo n.º 2
0
void CAction::setAction(CAction P_action)
{
    if (P_action.getActionType() == CAction::E_AT_ASSIGN_FROM_SAMPLE) {
        assert(P_action.getDistribution() != NULL);
    }
    int L_i;
    setActionType   ( P_action.getActionType()   );
    setLookingPlace ( P_action.getLookingPlace() );
    setVarId        ( P_action.getVarId()        );
    setVarInId      ( P_action.getVarInId()      );
    setDoubleValue  ( P_action.getDoubleValue()  );
    setDistribution ( P_action.getDistribution() );
    setScenario     ( P_action.M_scenario        );

    setNbSubVarId   ( P_action.getNbSubVarId()   );
    for (L_i = 0; L_i < P_action.getNbSubVarId() ; L_i++ ) {
        setSubVarId (P_action.getSubVarId(L_i));
    }

    setLookingChar  ( P_action.getLookingChar()  );
    setCheckIt      ( P_action.getCheckIt()      );
    setCheckItInverse      ( P_action.getCheckItInverse()      );
    setCaseIndep    ( P_action.getCaseIndep()    );
    setOccurence    ( P_action.getOccurence()   );
    setHeadersOnly  ( P_action.getHeadersOnly()  );
    for (L_i = 0; L_i < MAX_ACTION_MESSAGE; L_i++) {
        setMessage(P_action.M_message_str[L_i], L_i);
    }
    setRegExp       ( P_action.M_regularExpression);
    setIntCmd       ( P_action.M_IntCmd          );
#ifdef PCAPPLAY
    setPcapArgs     ( P_action.M_pcapArgs        );
#endif
}
Exemplo n.º 3
0
bool ExpressionItem::setValue(void* value_str,const data_type type) {
    switch(type) {
    case t_int: {
        setIntValue(*(int *)value_str);
        break;
    }
    case t_float: {
        setFloatValue(*(float *)value_str);
        break;
    }
    case t_smallInt:
    {
        setSmallIntValue(*(short *)value_str);
        break;
    }
    case t_double: {
        setDoubleValue(*(double *)value_str);
        break;
    }
    case t_u_long: {
        setULongValue(*(unsigned long*)value_str);
        break;
    }
    case t_string: {
        setStringValue(string((char *)value_str));
        break;
    }
    case t_decimal: {
        setDecimalValue((const char *)value_str);
        break;
    }
    case t_datetime: {
        setDatetimeValue((const char *)value_str);
        break;
    }
    case t_date: {
        setDateValue((const char *)value_str);
        break;
    }
    case t_time: {
        setTimeValue((const char *)value_str);
        break;
    }
    case t_boolean: {
        setBooleanValue(*(bool *)value_str);
        break;
    }
    default: {
        cout<<"no matching operator exists!!!"<<endl;
        /*
         * In the debug phase, it's better to show the assert failure in case of unexpected input.
         * The bug can be found much more easily in such a way.
         */
        assert(false);
        break;
    }
    }
    return true;
}
Exemplo n.º 4
0
void QmitkNumberPropertySlider::DisplayNumber()
{
  if (! m_Property ) return;

  m_SelfChangeLock = true;
  switch (m_DataType)
  {
  /*
    case DT_SHORT:
      {
        short s = m_ShortProperty->GetValue();
        QSlider::setValue( s );
        break;
      }
  */
    case DT_INT:
      {
        int i = m_IntProperty->GetValue();
        QSlider::setValue( i );
        break;
      }
    case DT_FLOAT:
      {
        float f = m_FloatProperty->GetValue();
        setDoubleValue( f );
        break;
      }
    case DT_DOUBLE:
      {
        double d = m_DoubleProperty->GetValue();
        setDoubleValue( d );
        break;
      }
    default:
      break;
  }
  m_SelfChangeLock = false;
}
Exemplo n.º 5
0
void OrientedPoint::UseInformationPercent(const double Percent)
{
	assert(Percent >= 0.0);
	assert(Percent <= 1.0);
	
	double total = getDoubleValue("TotalInformation");
	double update = Percent * total;
	
	double remain = getDoubleValue("RemainingInformation");
	
	if(remain < 0.0)
		remain = 0.0;
	
	setDoubleValue("RemainingInformation", remain);
	//RemainingInformation_ -= Percent * TotalInformation_;
	
}
Exemplo n.º 6
0
void SuplaDeviceClass::channelValueChanged(int channel_number, char v, double d, char var) {

    if ( srpc != NULL
            && registered == 1 ) {

        char value[SUPLA_CHANNELVALUE_SIZE];
        memset(value, 0, SUPLA_CHANNELVALUE_SIZE);

        if ( var == 1 )
            value[0] = v;
        else if ( var == 2 )
            setDoubleValue(value, d);

        srpc_ds_async_channel_value_changed(srpc, channel_number, value);
    }

}
Exemplo n.º 7
0
Var::Var(VarType type, const string& name) :
    _type(type) {
    _name = string(name);
    switch (type) {
    case VT_DOUBLE:
        setDoubleValue(0.0);
        break;
    case VT_INT:
        setIntValue(0);
        break;
    case VT_STRING:
        setStringValue(0);
        break;
    default:
        assert(false);
    }
}
Exemplo n.º 8
0
void OrientedPoint::ResetInformation()
{
	double total = getDoubleValue("TotalInformation");
	setDoubleValue("RemainingInformation", total);
	//RemainingInformation_ = TotalInformation_;
}
Exemplo n.º 9
0
void SuplaDeviceClass::channelSetDoubleValue(int channelNum, double value) {
    setDoubleValue(Params.reg_dev.channels[channelNum].value, value);
}
Exemplo n.º 10
0
/*****************************************************
**
**   BaseInputField   ---   resetStoredValue
**
******************************************************/
void BaseInputField::resetStoredValue()
{
	setDoubleValue( value );
}
Exemplo n.º 11
0
/*****************************************************
**
**   IntegerInputField   ---   formatValue
**
******************************************************/
void IntegerInputField::formatValue()
{
	value = getDoubleValue();
	setDoubleValue( value );
}
Exemplo n.º 12
0
/*****************************************************
**
**   DoubleInputField   ---   formatValue
**
******************************************************/
void DoubleInputField::formatValue()
{
	value = getDoubleValue();
	setDoubleValue( value );
}
Exemplo n.º 13
0
mxArray * createInfoStruct(VlSvmPegasos* svm)
{
  mwSize dims[] = {1 , 1} ;

  const char* names [15] = {
    "dimension", "iterations", "maxIterations",
    "epsilon", "lambda", "biasMultiplier",
    "biasLearningRate", "energyFrequency", "elapsedTime",
    "energy", "regularizerTerm", "lossPos",
    "lossNeg", "hardLossPos", "hardLossNeg"} ;

  mxArray *output, *dimension, *iterations, *maxIterations, *epsilon, *lambda ;
  mxArray *biasMultiplier, *biasLearningRate, *energyFrequency, *elapsedTime ;

  output = mxCreateStructArray(1, dims, 15, names);

  dimension = mxCreateNumericMatrix(1, 1,mxUINT32_CLASS, mxREAL) ;
  setUintValue(dimension,svm->dimension) ;

  iterations = mxCreateNumericMatrix(1, 1,mxUINT32_CLASS, mxREAL) ;
  setUintValue(iterations,svm->iterations) ;

  maxIterations = mxCreateNumericMatrix(1, 1,mxUINT32_CLASS, mxREAL) ;
  setUintValue(maxIterations,svm->maxIterations) ;

  epsilon = mxCreateNumericMatrix(1, 1,mxDOUBLE_CLASS, mxREAL) ;
  setDoubleValue(epsilon,svm->epsilon) ;

  lambda = mxCreateNumericMatrix(1, 1,mxDOUBLE_CLASS, mxREAL) ;
  setDoubleValue(lambda,svm->lambda) ;

  biasMultiplier = mxCreateNumericMatrix(1, 1,mxDOUBLE_CLASS, mxREAL) ;
  setDoubleValue(biasMultiplier,svm->biasMultiplier) ;

  biasLearningRate = mxCreateNumericMatrix(1, 1,mxDOUBLE_CLASS, mxREAL) ;
  setDoubleValue(biasLearningRate,svm->biasLearningRate) ;

  energyFrequency = mxCreateNumericMatrix(1, 1,mxUINT32_CLASS, mxREAL) ;
  setUintValue(energyFrequency,svm->energyFrequency) ;

  elapsedTime = mxCreateNumericMatrix(1, 1,mxDOUBLE_CLASS, mxREAL) ;
  setDoubleValue(elapsedTime,svm->elapsedTime) ;


  mxSetField(output, 0, "dimension", dimension) ;
  mxSetField(output, 0, "iterations", iterations) ;
  mxSetField(output, 0, "maxIterations", maxIterations) ;
  mxSetField(output, 0, "epsilon", epsilon) ;
  mxSetField(output, 0, "lambda", lambda) ;
  mxSetField(output, 0, "biasMultiplier", biasMultiplier) ;
  mxSetField(output, 0, "biasLearningRate", biasLearningRate) ;
  mxSetField(output, 0, "energyFrequency", energyFrequency) ;
  mxSetField(output, 0, "elapsedTime", elapsedTime) ;

  if (svm->objective) {
    mxArray *energy, *regularizerTerm, *lossPos, *lossNeg, *hardLossPos, *hardLossNeg ;
    energy = mxCreateNumericMatrix(1, 1,mxDOUBLE_CLASS, mxREAL) ;
    setDoubleValue(energy,svm->objective->energy) ;

    regularizerTerm = mxCreateNumericMatrix(1, 1,mxDOUBLE_CLASS, mxREAL) ;
    setDoubleValue(regularizerTerm,svm->objective->regularizer) ;

    lossPos = mxCreateNumericMatrix(1, 1,mxDOUBLE_CLASS, mxREAL) ;
    setDoubleValue(lossPos,svm->objective->lossPos) ;

    lossNeg = mxCreateNumericMatrix(1, 1,mxDOUBLE_CLASS, mxREAL) ;
    setDoubleValue(lossNeg,svm->objective->lossNeg) ;

    hardLossPos = mxCreateNumericMatrix(1, 1,mxDOUBLE_CLASS, mxREAL) ;
    setDoubleValue(hardLossPos,svm->objective->hardLossPos) ;

    hardLossNeg = mxCreateNumericMatrix(1, 1,mxDOUBLE_CLASS, mxREAL) ;
    setDoubleValue(hardLossNeg,svm->objective->hardLossNeg) ;

    mxSetField(output, 0, "energy", energy) ;
    mxSetField(output, 0, "regularizerTerm", regularizerTerm) ;
    mxSetField(output, 0, "lossPos", lossPos) ;
    mxSetField(output, 0, "lossNeg", lossNeg) ;
    mxSetField(output, 0, "hardLossPos", hardLossPos) ;
    mxSetField(output, 0, "hardLossNeg", hardLossNeg) ;
  }

  return output ;
}
Exemplo n.º 14
0
bool FGPropertyManager::SetDouble (const string &name, double val)
{
  return setDoubleValue(name.c_str(), val);
}
Exemplo n.º 15
0
bool FGPropertyNode::SetDouble (const char *name, double val)
{
  return setDoubleValue(name, val);
}