예제 #1
0
Geostat_grid* Simulacre_input_filter::read( const std::string& filename, 
                                           std::string* errors ) {
  QFile file( filename.c_str() );
  if( !file.open( IO_ReadOnly ) ) {
    if( errors ) 
      errors->append( "can't open file: " + filename);
    return false;
  }

  QDataStream stream( &file );
  Q_UINT32 magic_nb;
  stream >> magic_nb;
  if( magic_nb != 0xB211175D ) {
    if( errors )
      errors->append( "wrong file format" );
    return 0;
  }

  char* type;
  stream >> type;
  std::string object_type( type );
  delete [] type;

  //TL modified
  if (object_type == Reduced_grid().classname())
	  return read_reduced_grid(stream, errors);
  if( object_type == Cartesian_grid().classname() ) 
    return read_cartesian_grid( stream, errors );
  if( object_type == Point_set().classname() ) 
    return read_pointset( stream, errors );

  return 0;
}
void call_test_birk() {
    typedef Cartesian<NT>    Kernel;
    typedef typename Kernel::Point    Point;
    typedef boost::mt19937    RNGType;
    typedef HPolytope<Point> Hpolytope;
    Hpolytope P;

    std::cout << "--- Testing volume of H-birk3" << std::endl;
    std::ifstream inp;
    std::vector<std::vector<NT> > Pin;
    inp.open("../R-proj/inst/extdata/birk3.ine",std::ifstream::in);
    read_pointset(inp,Pin);
    P.init(Pin);
    test_CV_volume<NT, RNGType>(P, 0.125);

    //test_CV_volume<NT>("../data/birk4.ine", 0.000970018);
    //test_CV_volume<NT>("../data/birk5.ine", 0.000000225);

    //std::cout << "--- Testing volume of H-birk6" << std::endl;
    //std::ifstream inp4;
    //std::vector<std::vector<NT> > Pin4;
    //inp4.open("../R-proj/inst/extdata/birk6.ine",std::ifstream::in);
    //read_pointset(inp4,Pin4);
    //P.init(Pin4);
    //test_CV_volume<NT, RNGType>(P, 0.0000000000009455459196, 0.5);

}
예제 #3
0
WT_Result WT_Gouraud_Point_Set::skip_operand(WT_File & file)
{
    m_read_mode = Skip;
    return read_pointset(file);
}
예제 #4
0
///////////////////////////////////////////////////////////////////////////
// Keep all the reading code in one place - read_pointset
// Materialize and Skip are simply different modes of reading
WT_Result WT_Gouraud_Point_Set::materialize(WT_File & file)
{
    m_read_mode = Materialize;
    return read_pointset(file);
}