Ejemplo n.º 1
0
int main()
{
	int Error = 0;
	Error += test_vec();
	Error += test_mat();
	return Error;
}
Ejemplo n.º 2
0
int main(int argc, char **argv)
{
    test_str();
    test_vec();
    test_matrix();
    test_stats(); 
    test_list();
}
Ejemplo n.º 3
0
int
main(int argc, char **argv)
{
        test_basic();
        test_many_chars();
        test_uint();
        test_char_array();
        test_double();
        test_vec();
        test_vec_array();
        return 0;
}
Ejemplo n.º 4
0
int main (int argc, char* argv[])
{
    const int N = 10 * 4;

    float* input, *output, *input_sc, *output_sc;
   
    if(posix_memalign((void **) &input, 64, N * sizeof(float)) != 0)
    {
        exit(1);
    }
    if(posix_memalign((void **) &output, 64, N * sizeof(float)) != 0)
    {
        exit(1);
    }
    if(posix_memalign((void **) &input_sc, 64, N * sizeof(float)) != 0)
    {
        exit(1);
    }
    if(posix_memalign((void **) &output_sc, 64, N * sizeof(float)) != 0)
    {
        exit(1);
    }
 
    int i;
    for (i=0; i<N; i++)
    {
        input[i] = (i*0.9f)/(i+1);
        input_sc[i] = (i*0.9f)/(i+1);
    }

    test_vec(input, output);
    test_sc(input_sc, output_sc);


    for (i=0; i<N; i++)
    {
        if(input_sc[i] != input[i])
        {
            printf("ERROR: %f != %f\n", input_sc[i], input[i]);
            exit(1);
        }
        if(output_sc[i] != output[i])
        {
            printf("ERROR: %f != %f\n", output_sc[i], output[i]);
            exit(1);
        }
    }
    printf("SUCCESS\n");

    return 0;
}
Ejemplo n.º 5
0
static void
sink_thread()
{
    ring::video::SHMSink sink("bob");;
    if (!sink.start())
        return;
    std::vector<unsigned char> test_vec(test_data, test_data + sizeof(test_data) / sizeof(test_data[0]));

    while (!done) {
        sink.render(test_vec);
        std::this_thread::sleep_for(std::chrono::milliseconds(1));
    }
    sink.stop();
    std::cerr << std::endl;
    std::cerr << "Exitting sink thread" << std::endl;
}
Ejemplo n.º 6
0
static void
sink_thread()
{
    sfl_video::SHMSink sink("bob");;
    if (!sink.start())
        return;
    std::vector<unsigned char> test_vec(test_data, test_data + sizeof(test_data) / sizeof(test_data[0]));

    while (!done) {
        sink.render(test_vec);
        usleep(1000);
    }
    sink.stop();
    std::cerr << std::endl;
    std::cerr << "Exitting sink thread" << std::endl;
}
int main(int argc, char **argv) {
  MPI_Init(&argc, &argv);

  QUESO::EnvOptionsValues options;
  options.m_numSubEnvironments = 1;
  options.m_subDisplayFileName = "outputData/testIntersectionSubsetContains";
  options.m_subDisplayAllowAll = 0;
  options.m_subDisplayAllowedSet.insert(0);
  options.m_seed = 1.0;
  options.m_checkingLevel = 1;
  options.m_displayVerbosity = 55;

  QUESO::FullEnvironment *env = new QUESO::FullEnvironment(MPI_COMM_WORLD, "",
            "", &options);

  std::vector<std::string> names(1);
  names[0] = "my_name";

  // Create a vector space
  QUESO::VectorSpace<QUESO::GslVector, QUESO::GslMatrix> vec_space(*env,
      "vec_prefix", 1, &names);

  // Create two vector sets
  QUESO::GslVector min1(vec_space.zeroVector());
  min1[0] = 0.0;
  QUESO::GslVector max1(vec_space.zeroVector());
  max1[0] = 1.0;
  QUESO::BoxSubset<QUESO::GslVector, QUESO::GslMatrix> set1("set1", vec_space,
      min1, max1);

  // Now for the second one
  QUESO::GslVector min2(vec_space.zeroVector());
  min2[0] = 0.5;
  QUESO::GslVector max2(vec_space.zeroVector());
  max2[0] = 1.5;
  QUESO::BoxSubset<QUESO::GslVector, QUESO::GslMatrix> set2("set1", vec_space,
      min2, max2);

  // Create their intersection
  QUESO::IntersectionSubset<QUESO::GslVector, QUESO::GslMatrix> intersection(
      "intersection", vec_space, 1.0, set1, set2);

  // Test the containment
  bool does_contain;
  QUESO::GslVector test_vec(vec_space.zeroVector());

  // Should be true
  test_vec[0] = 0.75;
  does_contain = intersection.contains(test_vec);
  if (!does_contain) {
    std::cerr << "First IntersectionSubset contains test failed" << std::endl;
    return 1;
  }

  // Should be false
  test_vec[0] = 2.0;
  does_contain = intersection.contains(test_vec);
  if (does_contain) {
    std::cerr << "Second contains test failed" << std::endl;
    return 1;
  }

  // Print out some info
  intersection.print(std::cout);

  MPI_Finalize();

  return 0;
}