Commit ca2dd6fd authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

tests copyout

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 1269
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent af0c10c5
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: arraytest.cc,v 1.6 2002-12-29 23:02:16 forbrig Exp $
* $Id: arraytest.cc,v 1.7 2003-01-03 20:44:08 forbrig Exp $
* \author Thomas Forbriger
* \date 09/06/2002
*
......@@ -17,6 +17,8 @@
* - 19/12/2002 V1.2 now works for libaff
* - 28/12/2002 V1.3 (thof)
* - new term for containers of const elements
* - 03/01/2003 V1.4 (thof)
* - now tests copyout function
*
* ============================================================================
*/
......@@ -41,13 +43,14 @@
#define AFF_ARRAYTEST_CC_VERSION \
"AFF_ARRAYTEST_CC V1.3"
#define AFF_ARRAYTEST_CC_CVSID \
"$Id: arraytest.cc,v 1.6 2002-12-29 23:02:16 forbrig Exp $"
"$Id: arraytest.cc,v 1.7 2003-01-03 20:44:08 forbrig Exp $"
#define CONT_INDEXCHECK
#include <aff/dump.h>
#include <aff/array.h>
#include <aff/shaper.h>
#include <aff/subarray.h>
using std::cout;
using std::endl;
......@@ -198,6 +201,24 @@ int main()
CODE( C(1,1)=12; );
#endif
}
section("test copyout function");
{
CODE( Array<int> A(8,8));
section("fill array");
for(int i=A.f(0); i<=A.l(0); i++)
{
for(int j=A.f(1); j<=A.l(1); j++)
{
A(i,j)=(i-A.f(0)+1)+(j-A.f(1)+1)*10;
}
}
CODE( dump_array(A); );
CODE( ConstArray<int> CA(subarray(A)(4,6)(3,5)));
CODE( dump_array(CA); );
CODE( Array<int> B=CA.copyout());
CODE( dump_array(B); );
}
}
/* ----- END OF arraytest.cc ----- */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment