Code Search for Developers
 
 
  

MultiDimArray.h from Magnus at Krugle


Show MultiDimArray.h syntax highlighted

#include "Vector.h"

template <typename T> class MultiDimArray {
public:
	MultiDimArray(const VectorOf<int>& aDimns);
	MultiDimArray(int d1, int d2, int d3);
	int linearize(const int* coords) const;
	T get(const int* coords) const;
	T& get(const int* coords);
   T get(int i, int j, int k) const;
	T& get(int i, int j, int k);
	//	MultiDimArrayCursor operator [] (int i);

	// total number of Ts for a given set of dimensions
	static int total_size(const VectorOf<int>& aDimns);
private:
	void compute_multipliers();

	VectorOf<int> dimns;
	VectorOf<int> multipliers;
	VectorOf<T> pool;
};

/*
// This class will point to a sub array of MultiDimArray
template <typename T> class MultiDimArrayCursor {
public:
	MultiDimArrayCursor(const MultiDimArrayCursor& current, int next)
private:
	MultiDimArray& array;
	VectorOf<int> coords;
	int* next_dim;
	T* sub_array;
};
*/	




See more files for this project here

Magnus

Magnus is a special purpose mathematical package for Infinite Group Theory computations

Project homepage: http://sourceforge.net/projects/magnus
Programming language(s): C,C++
License: other

  Associations.h
  BTree.h
  BlackBox.h
  Cell.h
  Chars.h
  DArray.h
  DCell.h
  DList.h
  File.h
  GCD.h
  GlobalRandom.h
  IStreamPoll.h
  Int2.h
  List.h
  LogWatcher.h
  MagnusHome.h
  MultiDimArray.h
  QuickAssociations.h
  RandomNumbers.h
  Set.h
  Stack.h
  Timer.h
  Type.h
  Vector.h
  WordParser.h
  conversions.h