shared_ptr<IfcModulusOfRotationalSubgradeReactionMeasure> IfcModulusOfRotationalSubgradeReactionMeasure::createObjectFromSTEP( const std::wstring& arg ) { // read TYPE if( arg.compare( L"$" ) == 0 ) { return shared_ptr<IfcModulusOfRotationalSubgradeReactionMeasure>(); } else if( arg.compare( L"*" ) == 0 ) { return shared_ptr<IfcModulusOfRotationalSubgradeReactionMeasure>(); } shared_ptr<IfcModulusOfRotationalSubgradeReactionMeasure> type_object( new IfcModulusOfRotationalSubgradeReactionMeasure() ); readReal( arg, type_object->m_value ); return type_object; }
shared_ptr<IfcElectricChargeMeasure> IfcElectricChargeMeasure::createObjectFromSTEP( const std::wstring& arg ) { // read TYPE if( arg.compare( L"$" ) == 0 ) { return shared_ptr<IfcElectricChargeMeasure>(); } else if( arg.compare( L"*" ) == 0 ) { return shared_ptr<IfcElectricChargeMeasure>(); } shared_ptr<IfcElectricChargeMeasure> type_object( new IfcElectricChargeMeasure() ); readReal( arg, type_object->m_value ); return type_object; }
shared_ptr<IfcSpecularRoughness> IfcSpecularRoughness::createObjectFromSTEP( const std::wstring& arg ) { // read TYPE if( arg.compare( L"$" ) == 0 ) { return shared_ptr<IfcSpecularRoughness>(); } else if( arg.compare( L"*" ) == 0 ) { return shared_ptr<IfcSpecularRoughness>(); } shared_ptr<IfcSpecularRoughness> type_object( new IfcSpecularRoughness() ); readReal( arg, type_object->m_value ); return type_object; }
PCA * ModelFile::readPCA(PCA * &p) { int i, j; p = new PCA(); int rows = 0, cols = 0; readInt(rows); readInt(cols); p->eigenvectors = Mat_<double>::zeros(rows, cols); for (i=0;i<rows;i++) for (j=0;j<cols;j++) readReal(p->eigenvectors.at<double>(i, j)); p->eigenvalues = Mat_<double>::zeros(rows, 1); for (i=0;i<rows;i++) readReal(p->eigenvalues.at<double>(i, 0)); p->mean = Mat_<double>::zeros(cols, 1); for (i=0;i<cols;i++){ readReal(p->mean.at<double>(i, 0)); } return p; }
Employee * readEmployeeRecord(FILE *fp) // we pass the file pointer in { char *name,*title; int years; double salary; name = readString(fp); //name is a string, not a token if (feof(fp)) { return 0; } // no record, return the null pointer name = name; title = readToken(fp); years = readInt(fp); salary = readReal(fp); return newEmployee(name,title,years,salary); }
int main(int argc, char const *argv[]) { double First[3]; double Second[3]; double first,second; double comp; printf("First set, First number: "); First[0] = readReal(stdin); printf("\n"); printf("First set, Second number: "); First[1] = readReal(stdin); printf("\n"); printf("First set, Third number: "); First[2] = readReal(stdin); printf("\n"); first = math(First); printf("For this set, the variance is %lf\n",first); printf("Second set, First number: "); Second[0] = readReal(stdin); printf("\n"); printf("Second set, Second number: "); Second[1] = readReal(stdin); printf("\n"); printf("Second set, Third number: "); Second[2] = readReal(stdin); printf("\n"); second = math(Second); printf("For this set, the variance is %lf\n",second); comp = compaire(first,second); if (comp ==1) { printf("The first set has a larger variance\n" ); } else if (comp == 2) { printf("The second set has a larger variance\n"); } else { printf("The sets have the same variance\n"); } return 0; }
double Parser::readRelativeReal() { readChar('+'); return readReal(); }