예제 #1
0
파일: ger.hpp 프로젝트: TRIQS/triqs
  typename std::enable_if<is_blas_lapack_type<typename VTX::value_type>::value && have_same_value_type<VTX, VTY, MT>::value>::type
  ger(typename VTX::value_type alpha, VTX const &X, VTY const &Y, MT &A) {
    static_assert(is_amv_value_or_view_class<MT>::value, "ger : A must be a matrix or a matrix_view");
    if ((first_dim(A) != Y.size()) || (second_dim(A) != X.size()))
      TRIQS_RUNTIME_ERROR << "Dimension mismatch in ger : A : " << get_shape(A()) << " while X : " << get_shape(X()) << " and Y : " << get_shape(Y());
    const_qcache<VTX> Cx(X); // mettre la condition a la main
    const_qcache<VTY> Cy(Y); // mettre la condition a la main
    reflexive_qcache<MT> Ca(A);
    if (Ca().memory_layout_is_c()) // tA += alpha y tx
      f77::ger(get_n_rows(Ca()), get_n_cols(Ca()), alpha, Cy().data_start(), Cy().stride(), Cx().data_start(), Cx().stride(), Ca().data_start(),
               get_ld(Ca()));
    else
      f77::ger(get_n_rows(Ca()), get_n_cols(Ca()), alpha, Cx().data_start(), Cx().stride(), Cy().data_start(), Cy().stride(), Ca().data_start(),
               get_ld(Ca()));

    /* std::cerr << " Meme labout  C"<< Ca().memory_layout_is_c()  << "  "<<A.memory_layout_is_c()<<std::endl ;
   std::cerr<< " has_contiguous_data(A) : "<< has_contiguous_data(A) << std::endl;
   std::cerr<< Ca()<< std::endl;
   std::cerr<< Ca()(0,0) <<  "  "<< Ca()(1,0) <<  "  "<< Ca()(0,1) <<  "  "<< Ca()(1,1) <<  "  "<< std::endl;
   std::cerr<< Ca().data_start()[0]<< "  "<< Ca().data_start()[1]<< "  "<< Ca().data_start()[2]<< "  " << Ca().data_start()[3]<< "  "<<std::endl;

   std::cerr<< A<< std::endl;
   std::cerr<< A(0,0) <<  "  "<< A(1,0) <<  "  "<< A(0,1) <<  "  "<< A(1,1) <<  "  "<< std::endl;
   std::cerr<< A.data_start()[0]<< "  "<< A.data_start()[1]<< "  "<< A.data_start()[2]<< "  " << A.data_start()[3]<< "  "<<std::endl;
*/
  }
예제 #2
0
int main(int argc, char *argv[])
{
    long double radius, lat1, long1, lat2, long2;

    if (argc != 6) {
        puts("distance radius lat1 long1 lat2 long2");
        puts("Latitude and longitude in degrees");
        return 0;
    }

    get_ld(argv[1], radius);
    get_ld(argv[2], lat1);
    get_ld(argv[3], long1);
    get_ld(argv[4], lat2);
    get_ld(argv[5], long2);

    printf("%.*Lg\n", LDBL_DIG, lddist(radius, deg2rad(lat1), deg2rad(long1), deg2rad(lat2), deg2rad(long2)));

    return 0;
}
예제 #3
0
파일: run-ld.c 프로젝트: 0day-ci/gcc
int main (void)
{
  int val;

  val = get_ld ();
  if (val != 1 + 2)
    abort ();

  val = *get_ldp ();
  if (val != 1)
    abort ();

  return 0;
}
예제 #4
0
 void
 make_ld_command (rld::process::arg_container& args)
 {
   /*
    * Use the absolute path to LD if provided.
    */
   if (is_ld_set ())
   {
     args.push_back (get_ld ());
   }
   else
   {
     std::string cmd = ld_name;
     if (!exec_prefix.empty ())
       cmd = exec_prefix + "-rtems" + rld::rtems::version () + '-' + cmd;
     args.push_back (cmd);
   }
 }
예제 #5
0
int
main ()
{
  int *p;

  p = get_gd ();
  set_gd (3);
  if (*p != 3 || !test_gd (3))
    abort ();

  p = get_ld ();
  set_ld (4);
  if (*p != 4 || !test_ld (4))
    abort ();

  printf ("PASS\n");

  return 0;
}
예제 #6
0
static int
do_test (void)
{
  int *p;

  p = get_gd ();
  set_gd (3);
  if (*p != 3 || !test_gd (3))
    abort ();

  p = get_ld ();
  set_ld (4);
  if (*p != 4 || !test_ld (4))
    abort ();

  printf ("PASS\n");

  return 0;
}