/*Copyright (c) 2011, Edgar Solomonik, all rights reserved.*/ /** \addtogroup examples * @{ * \defgroup sy_times_ns sy_times_ns * @{ * \brief Tests contraction of a symmetric index group with a nonsymmetric one */ #include using namespace CTF; int sy_times_ns(int n, World & dw){ int rank, i, num_pes, pass; int64_t np; double * pairs; int64_t * indices; MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &num_pes); int shapeN4[] = {NS,NS,NS,NS}; int sizeN4[] = {n,n,n,n}; //* Creates distributed tensors initialized with zeros Tensor<> B(4, sizeN4, shapeN4, dw); Matrix<> A(n, n, SY, dw); Matrix<> An(n, n, NS, dw); Matrix<> C(n, n, SY, dw, "C"); Matrix<> Cn(n, n, NS, dw, "Cn"); srand48(13*rank); A.read_local(&np, &indices, &pairs); for (i=0; i