本文整理汇总了C++中TwoDArray类的典型用法代码示例。如果您正苦于以下问题:C++ TwoDArray类的具体用法?C++ TwoDArray怎么用?C++ TwoDArray使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TwoDArray类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TEST
TEST(numCols, stringTest) {
int r = 5;
int c = 10;
TwoDArray<string>* a = new TwoDArray<string>(r, c);
EXPECT_EQ(10, a->getNumCols());
delete a;
}
示例2: TEUCHOS_UNIT_TEST
TEUCHOS_UNIT_TEST(Teuchos_TwoDArray, symmetrySerialization){
TwoDArray<int> simpleArray = getSimpleTestTwoDArray();
simpleArray.setSymmetrical(true);
std::string arrayString = TwoDArray<int>::toString(simpleArray);
TwoDArray<int> readIn = TwoDArray<int>::fromString(arrayString);
TEST_ASSERT(readIn.isSymmetrical());
}
示例3: TEST
TEST(TwoDArrayTest, InsertInt) {
TwoDArray<int>* tDInt = new TwoDArray<int>(3, 3, 0);
for (int i=0; i < 3; i++) {
tDInt->insert(i, i, 3);
}
EXPECT_EQ(3, tDInt->access(1, 1));
delete tDInt;
}
示例4: TEST
TEST(TwoDArrayTest, remove) {
TwoDArray<int>* td = new TwoDArray<int>(10, 10, 42);
td->insert(5, 5, 12);
td->remove(5, 5);
EXPECT_EQ(42, td->access(5,5));
delete td;
}
示例5: TEST
TEST(TwoDArray, Print) {
TwoDArray<int>* newArray = new TwoDArray<int>(10,10,0);
newArray->insert(1,2,1);
newArray->insert(9,8,2);
newArray->insert(7,2,3);
newArray->insert(6,4,4);
newArray->insert(0,8,5);
newArray->print();
delete newArray;
}