41 if (C.
norm2() > 1.E-6){
44 printf(
"{ (A[\"ij\"]+=B[\"ik\"] with square B } failed \n");
58 if (C.
norm2() > 1.E-6)
63 printf(
"{ (A[\"ij\"]+=B[\"ik\"] } passed \n");
66 printf(
"{ (A[\"ij\"]+=B[\"ik\"] with column vector B } failed \n");
76 char ** itr = std::find(begin, end, option);
77 if (itr != end && ++itr != end){
84 int main(
int argc,
char ** argv){
87 char ** input_str = argv;
89 MPI_Init(&argc, &argv);
90 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
91 MPI_Comm_size(MPI_COMM_WORLD, &np);
94 n = atoi(
getCmdOption(input_str, input_str+in_num,
"-n"));
100 World dw(argc, argv);
char * getCmdOption(char **begin, char **end, const std::string &option)
Matrix class which encapsulates a 2D tensor.
Vector class which encapsulates a 1D tensor.
int main(int argc, char **argv)
an instance of the CTF library (world) on a MPI communicator
dtype norm2()
computes the frobenius norm of the tensor (needs sqrt()!)
void fill_random(dtype rmin, dtype rmax)
fills local unique tensor elements to random values in the range [min,max] works only for dtype in {f...
int rank
rank of local processor
int reduce_bcast(int n, World &dw)