// ------------------------------------------------------------------------ // This program is complementary material for the book: // // Frank Nielsen // // Visual Computing: Geometry, Graphics, and Vision // // ISBN: 1-58450-427-7 // // Charles River Media, Inc. // // // All programs are available at http://www.charlesriver.com/visualcomputing/ // // You may use this program for ACADEMIC and PERSONAL purposes ONLY. // // // The use of this program in a commercial product requires EXPLICITLY // written permission from the author. The author is NOT responsible or // liable for damage or loss that may be caused by the use of this program. // // Copyright (c) 2005. Frank Nielsen. All rights reserved. // ------------------------------------------------------------------------ // ------------------------------------------------------------------------ // File: multidim-indexremapping.cpp // // Description: Conversions between 1D and dD array indices of arrays. // ------------------------------------------------------------------------ #include "stdafx.h" using namespace std; // Array dimensions const int d1=12, d2=21, d3=8, d4=30; int D1,D2,D3,D4; int marray[d4][d3][d2][d1]; void Error(); void FillArray() { int i1, i2, i3, i4; for(i4=0;i4