exArray1.cc
RAVL, Recognition And Vision Library
SOURCE HOME PAGE CLASS LIST CONTENTS

// This file is part of RAVL, Recognition And Vision Library 
// Copyright (C) 2001, University of Surrey
// This code may be redistributed under the terms of the GNU Lesser
// General Public License (LGPL). See the lgpl.licence file for details or
// see http://www.gnu.org/copyleft/lesser.html
// file-header-ends-here
//! rcsid="$Id: exArray1.cc,v 1.5 2002/07/07 21:40:27 craftit Exp $"
//! lib=RavlCore
//! file="Ravl/Core/Container/Array/exArray1.cc"

#include "Ravl/Array1d.hh"
#include "Ravl/Array1dIter.hh"
#include "Ravl/EntryPnt.hh"
#include "Ravl/Stream.hh"

using namespace RavlN;

int Main(int argc, char* argv[])
{
  
  Array1dC<IntT> arr(-10,10);
  
  cout << "arr.Range() = " << arr.Range() << "\n";
  cout << "arr.Size()  = " << arr.Size() << "\n";
  
  arr.Fill(0); // Fill array with 0's
  
  arr[-2] = 1;
  arr[3] = 2;
  
  for(Array1dIterC<IntT> it(arr);it;it++)
    if(*it != 0)
      cout << "Array element arr[" << it.Index() << "] is non zero, " << *it << "\n";
  
  return 0;
}

RAVL_ENTRY_POINT(Main);

Documentation by CxxDoc: Tue Aug 13 09:59:56 2002