40 #ifndef __EST_TVector_H__ 
   41 #define __EST_TVector_H__ 
   46 #include "EST_rw_status.h" 
   48 #include "instantiate/EST_TVectorI.h" 
   58 extern const int EST_CURRENT;
 
   59 extern const int EST_ALL;
 
   62 #ifndef TVECTOR_BOUNDS_CHECKING 
   63 #    define TVECTOR_BOUNDS_CHECKING 0 
   66 #if TVECTOR_BOUNDS_CHECKING 
   67 #define A_CHECK a_check 
   69 #define A_CHECK a_no_check 
   77 #if defined(__GNUC__) && 0 
   78 #    define fast_a_v_gcc(C) \ 
   80           (((char (*) [sizeof(T)*p_column_step])p_memory) + (C))\ 
   82 #    define fast_a_v_x(C) (fast_a_v_gcc(C)) 
   84 #    define fast_a_v_x(C) (fast_a_v(C)) 
  161   unsigned int p_column_step;
 
  167   INLINE 
unsigned int vcell_pos(
unsigned int c,
 
  168                     unsigned int cs)
 const 
  169     {
return cs==1?c:c*cs;}
 
  171   INLINE 
unsigned int vcell_pos(
unsigned int c)
 const 
  177   INLINE 
unsigned int vcell_pos_1(
unsigned int c)
 const 
  183   INLINE 
const T &
fast_a_v(
int c)
 const { 
return p_memory[vcell_pos(c)]; }
 
  185   INLINE T &fast_a_v(
int c) { 
return p_memory[vcell_pos(c)]; }
 
  187   INLINE 
const T &fast_a_1(
int c)
 const { 
return p_memory[vcell_pos_1(c)]; }
 
  188   INLINE T &fast_a_1(
int c) { 
return p_memory[vcell_pos_1(c)]; }
 
  191   void set_values(
const T *data, 
int step, 
int start_c, 
int num_c);
 
  192   void get_values(T *data, 
int step, 
int start_c, 
int num_c) 
const;
 
  200   void just_resize(
int new_cols, T** old_vals);
 
  217           T *memory, 
int offset=0, 
int free_when_destroyed=0);
 
  237   void resize(
int n, 
int set=1); 
 
  241   const T * 
memory()
 const { 
return p_memory; }
 
  242   T * memory(){ 
return p_memory; }
 
  252   INLINE 
int length()
 const {
return num_columns();}
 
  254   INLINE 
int n()
 const {
return num_columns();}
 
  257   INLINE 
const T &
a_no_check(
int n)
 const { 
return fast_a_v_x(n); }
 
  268   const T &a_check(
int n) 
const;
 
  272   const T &a(
int n)
 const { 
return A_CHECK(n); }
 
  273   T &a(
int n) { 
return A_CHECK(n); }
 
  276   const T &operator () (
int n)
 const {
return A_CHECK(n);}
 
  283   T &operator [] (
int n) { 
return A_CHECK(n); }
 
  287   void set_memory(T *buffer, 
int offset, 
int columns,
 
  288           int free_when_destroyed=0);
 
  294   void fill(
const T &v);
 
  303     { 
return ! ((*this) == v); }
 
  307   void copy_section(T* dest, 
int offset=0, 
int num=-1) 
const;
 
  308   void set_section(
const T* src, 
int offset=0, 
int num=-1);
 
  313     friend ostream& operator << (ostream &st, const EST_TVector<T> &m)
 
  316         for (i = 0; i < m.n(); ++i) 
 
  317             st << m(i) << 
" "; st << endl; 
 
  324   void integrity() 
const;