array_of_string.cpp File Reference
#include "main.h"

Functions

 EIGEN_DECLARE_TEST (array_of_string)
 

Function Documentation

◆ EIGEN_DECLARE_TEST()

EIGEN_DECLARE_TEST ( array_of_string  )
12  {
13  typedef Array<std::string, 1, Dynamic> ArrayXs;
14  ArrayXs a1(3), a2(3), a3(3), a3ref(3);
15  a1 << "one", "two", "three";
16  a2 << "1", "2", "3";
17  a3ref << "one (1)", "two (2)", "three (3)";
18  std::stringstream s1;
19  s1 << a1;
20  VERIFY_IS_EQUAL(s1.str(), std::string(" one two three"));
21  a3 = a1 + std::string(" (") + a2 + std::string(")");
22  VERIFY((a3 == a3ref).all());
23 
24  a3 = a1;
25  a3 += std::string(" (") + a2 + std::string(")");
26  VERIFY((a3 == a3ref).all());
27 
28  a1.swap(a3);
29  VERIFY((a1 == a3ref).all());
30  VERIFY((a3 != a3ref).all());
31 }
General-purpose arrays with easy API for coefficient-wise operations.
Definition: Array.h:48
static constexpr Eigen::internal::all_t all
Definition: IndexedViewHelper.h:86
#define VERIFY(a)
Definition: main.h:362
#define VERIFY_IS_EQUAL(a, b)
Definition: main.h:367
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286

References Eigen::placeholders::all, oomph::Global_string_for_annotation::string(), VERIFY, and VERIFY_IS_EQUAL.