My Project  debian-1:4.1.2-p1+ds-2
Public Member Functions | Private Member Functions | Private Attributes
ap::template_2d_array< T > Class Template Reference

#include <ap.h>

Public Member Functions

 template_2d_array ()
 
 ~template_2d_array ()
 
 template_2d_array (const template_2d_array &rhs)
 
const template_2d_arrayoperator= (const template_2d_array &rhs)
 
const Toperator() (int i1, int i2) const
 
Toperator() (int i1, int i2)
 
void setbounds (int iLow1, int iHigh1, int iLow2, int iHigh2)
 
void setcontent (int iLow1, int iHigh1, int iLow2, int iHigh2, const T *pContent)
 
Tgetcontent ()
 
const Tgetcontent () const
 
int getlowbound (int iBoundNum) const
 
int gethighbound (int iBoundNum) const
 
raw_vector< Tgetcolumn (int iColumn, int iRowStart, int iRowEnd)
 
raw_vector< Tgetrow (int iRow, int iColumnStart, int iColumnEnd)
 
const_raw_vector< Tgetcolumn (int iColumn, int iRowStart, int iRowEnd) const
 
const_raw_vector< Tgetrow (int iRow, int iColumnStart, int iColumnEnd) const
 
 template_2d_array ()
 
 ~template_2d_array ()
 
 template_2d_array (const template_2d_array &rhs)
 
const template_2d_arrayoperator= (const template_2d_array &rhs)
 
const Toperator() (int i1, int i2) const
 
Toperator() (int i1, int i2)
 
void setbounds (int iLow1, int iHigh1, int iLow2, int iHigh2)
 
void setcontent (int iLow1, int iHigh1, int iLow2, int iHigh2, const T *pContent)
 
Tgetcontent ()
 
const Tgetcontent () const
 
int getlowbound (int iBoundNum) const
 
int gethighbound (int iBoundNum) const
 
raw_vector< Tgetcolumn (int iColumn, int iRowStart, int iRowEnd)
 
raw_vector< Tgetrow (int iRow, int iColumnStart, int iColumnEnd)
 
const_raw_vector< Tgetcolumn (int iColumn, int iRowStart, int iRowEnd) const
 
const_raw_vector< Tgetrow (int iRow, int iColumnStart, int iColumnEnd) const
 

Private Member Functions

bool wrongRow (int i) const
 
bool wrongColumn (int j) const
 
bool wrongRow (int i) const
 
bool wrongColumn (int j) const
 

Private Attributes

Tm_Vec
 
long m_iVecSize
 
long m_iLow1
 
long m_iLow2
 
long m_iHigh1
 
long m_iHigh2
 
long m_iConstOffset
 
long m_iLinearMember
 

Detailed Description

template<class T>
class ap::template_2d_array< T >

Definition at line 790 of file ap.h.

Constructor & Destructor Documentation

◆ template_2d_array() [1/4]

template<class T>
ap::template_2d_array< T >::template_2d_array ( )
inline

Definition at line 794 of file ap.h.

807 {

◆ ~template_2d_array() [1/2]

template<class T>
ap::template_2d_array< T >::~template_2d_array ( )
inline

Definition at line 800 of file ap.h.

807 {

◆ template_2d_array() [2/4]

template<class T>
ap::template_2d_array< T >::template_2d_array ( const template_2d_array< T > &  rhs)
inline

Definition at line 806 of file ap.h.

807 {
808 public:
810  {
811  m_Vec=0;
812  m_iVecSize=0;
813  };
814 
816  {
817  if(m_Vec)
818  delete[] m_Vec;
819  };
820 
822  {
823  m_iVecSize = rhs.m_iVecSize;
824  m_iLow1 = rhs.m_iLow1;
825  m_iLow2 = rhs.m_iLow2;
826  m_iHigh1 = rhs.m_iHigh1;
827  m_iHigh2 = rhs.m_iHigh2;

◆ template_2d_array() [3/4]

template<class T>
ap::template_2d_array< T >::template_2d_array ( )
inline

Definition at line 803 of file svd_si.h.

816 {

◆ ~template_2d_array() [2/2]

template<class T>
ap::template_2d_array< T >::~template_2d_array ( )
inline

Definition at line 809 of file svd_si.h.

816 {

◆ template_2d_array() [4/4]

template<class T>
ap::template_2d_array< T >::template_2d_array ( const template_2d_array< T > &  rhs)
inline

Definition at line 815 of file svd_si.h.

816 {
817 public:
819  {
820  m_Vec=0;
821  m_iVecSize=0;
822  };
823 
825  {
826  if(m_Vec)
827  delete[] m_Vec;
828  };
829 
831  {
832  m_iVecSize = rhs.m_iVecSize;
833  m_iLow1 = rhs.m_iLow1;
834  m_iLow2 = rhs.m_iLow2;
835  m_iHigh1 = rhs.m_iHigh1;
836  m_iHigh2 = rhs.m_iHigh2;

Member Function Documentation

◆ getcolumn() [1/4]

template<class T>
raw_vector<T> ap::template_2d_array< T >::getcolumn ( int  iColumn,
int  iRowStart,
int  iRowEnd 
)
inline

Definition at line 916 of file ap.h.

917  {
918  return m_Vec;
919  };
920 
921  int getlowbound(int iBoundNum) const
922  {

◆ getcolumn() [2/4]

template<class T>
raw_vector<T> ap::template_2d_array< T >::getcolumn ( int  iColumn,
int  iRowStart,
int  iRowEnd 
)
inline

Definition at line 925 of file svd_si.h.

926  {
927  return m_Vec;
928  };
929 
930  int getlowbound(int iBoundNum) const
931  {

◆ getcolumn() [3/4]

template<class T>
const_raw_vector<T> ap::template_2d_array< T >::getcolumn ( int  iColumn,
int  iRowStart,
int  iRowEnd 
) const
inline

Definition at line 932 of file ap.h.

932  {
933  if( (iRowStart>iRowEnd) || wrongColumn(iColumn) || wrongRow(iRowStart) ||wrongRow(iRowEnd) )
934  return raw_vector<T>(0, 0, 1);
935  else
936  return raw_vector<T>(&((*this)(iRowStart, iColumn)), iRowEnd-iRowStart+1, m_iLinearMember);
937  };
938 

◆ getcolumn() [4/4]

template<class T>
const_raw_vector<T> ap::template_2d_array< T >::getcolumn ( int  iColumn,
int  iRowStart,
int  iRowEnd 
) const
inline

Definition at line 941 of file svd_si.h.

941  {
942  if( (iRowStart>iRowEnd) || wrongColumn(iColumn) || wrongRow(iRowStart) ||wrongRow(iRowEnd) )
943  return raw_vector<T>(0, 0, 1);
944  else
945  return raw_vector<T>(&((*this)(iRowStart, iColumn)), iRowEnd-iRowStart+1, m_iLinearMember);
946  };
947 

◆ getcontent() [1/4]

template<class T>
T* ap::template_2d_array< T >::getcontent ( )
inline

Definition at line 896 of file ap.h.

905  {

◆ getcontent() [2/4]

template<class T>
T* ap::template_2d_array< T >::getcontent ( )
inline

Definition at line 905 of file svd_si.h.

914  {

◆ getcontent() [3/4]

template<class T>
const T* ap::template_2d_array< T >::getcontent ( ) const
inline

Definition at line 901 of file ap.h.

905  {

◆ getcontent() [4/4]

template<class T>
const T* ap::template_2d_array< T >::getcontent ( ) const
inline

Definition at line 910 of file svd_si.h.

914  {

◆ gethighbound() [1/2]

template<class T>
int ap::template_2d_array< T >::gethighbound ( int  iBoundNum) const
inline

Definition at line 911 of file ap.h.

912  {
913  return m_Vec;
914  };

◆ gethighbound() [2/2]

template<class T>
int ap::template_2d_array< T >::gethighbound ( int  iBoundNum) const
inline

Definition at line 920 of file svd_si.h.

921  {
922  return m_Vec;
923  };

◆ getlowbound() [1/2]

template<class T>
int ap::template_2d_array< T >::getlowbound ( int  iBoundNum) const
inline

Definition at line 906 of file ap.h.

912  {

◆ getlowbound() [2/2]

template<class T>
int ap::template_2d_array< T >::getlowbound ( int  iBoundNum) const
inline

Definition at line 915 of file svd_si.h.

921  {

◆ getrow() [1/4]

template<class T>
raw_vector<T> ap::template_2d_array< T >::getrow ( int  iRow,
int  iColumnStart,
int  iColumnEnd 
)
inline

Definition at line 924 of file ap.h.

927  {
928  return iBoundNum==1 ? m_iHigh1 : m_iHigh2;
929  };
930 

◆ getrow() [2/4]

template<class T>
raw_vector<T> ap::template_2d_array< T >::getrow ( int  iRow,
int  iColumnStart,
int  iColumnEnd 
)
inline

Definition at line 933 of file svd_si.h.

936  {
937  return iBoundNum==1 ? m_iHigh1 : m_iHigh2;
938  };
939 

◆ getrow() [3/4]

template<class T>
const_raw_vector<T> ap::template_2d_array< T >::getrow ( int  iRow,
int  iColumnStart,
int  iColumnEnd 
) const
inline

Definition at line 940 of file ap.h.

940  {
941  if( (iColumnStart>iColumnEnd) || wrongRow(iRow) || wrongColumn(iColumnStart) || wrongColumn(iColumnEnd))
942  return raw_vector<T>(0, 0, 1);
943  else
944  return raw_vector<T>(&((*this)(iRow, iColumnStart)), iColumnEnd-iColumnStart+1, 1);
945  };
946 

◆ getrow() [4/4]

template<class T>
const_raw_vector<T> ap::template_2d_array< T >::getrow ( int  iRow,
int  iColumnStart,
int  iColumnEnd 
) const
inline

Definition at line 949 of file svd_si.h.

949  {
950  if( (iColumnStart>iColumnEnd) || wrongRow(iRow) || wrongColumn(iColumnStart) || wrongColumn(iColumnEnd))
951  return raw_vector<T>(0, 0, 1);
952  else
953  return raw_vector<T>(&((*this)(iRow, iColumnStart)), iColumnEnd-iColumnStart+1, 1);
954  };
955 

◆ operator()() [1/4]

template<class T>
T& ap::template_2d_array< T >::operator() ( int  i1,
int  i2 
)
inline

Definition at line 866 of file ap.h.

873  {

◆ operator()() [2/4]

template<class T>
T& ap::template_2d_array< T >::operator() ( int  i1,
int  i2 
)
inline

Definition at line 875 of file svd_si.h.

882  {

◆ operator()() [3/4]

template<class T>
const T& ap::template_2d_array< T >::operator() ( int  i1,
int  i2 
) const
inline

Definition at line 857 of file ap.h.

858  {
859  m_Vec = new T[m_iVecSize];
860  #ifndef UNSAFE_MEM_COPY
861  for(int i=0; i<m_iVecSize; i++)
862  m_Vec[i] = rhs.m_Vec[i];
863  #else
864  memcpy(m_Vec, rhs.m_Vec, m_iVecSize*sizeof(T));

◆ operator()() [4/4]

template<class T>
const T& ap::template_2d_array< T >::operator() ( int  i1,
int  i2 
) const
inline

Definition at line 866 of file svd_si.h.

867  {
868  m_Vec = new T[m_iVecSize];
869  #ifndef UNSAFE_MEM_COPY
870  for(int i=0; i<m_iVecSize; i++)
871  m_Vec[i] = rhs.m_Vec[i];
872  #else
873  memcpy(m_Vec, rhs.m_Vec, m_iVecSize*sizeof(T));

◆ operator=() [1/2]

template<class T>
const template_2d_array& ap::template_2d_array< T >::operator= ( const template_2d_array< T > &  rhs)
inline

Definition at line 828 of file ap.h.

831  {
832  m_Vec = new T[m_iVecSize];
833  #ifndef UNSAFE_MEM_COPY
834  for(int i=0; i<m_iVecSize; i++)
835  m_Vec[i] = rhs.m_Vec[i];
836  #else
837  memcpy(m_Vec, rhs.m_Vec, m_iVecSize*sizeof(T));
838  #endif
839  }
840  else
841  m_Vec=0;
842  };
844  {
845  if( this==&rhs )
846  return *this;
847 
848  m_iLow1 = rhs.m_iLow1;
849  m_iLow2 = rhs.m_iLow2;
850  m_iHigh1 = rhs.m_iHigh1;
851  m_iHigh2 = rhs.m_iHigh2;
852  m_iConstOffset = rhs.m_iConstOffset;
853  m_iLinearMember = rhs.m_iLinearMember;
854  m_iVecSize = rhs.m_iVecSize;
855  if(m_Vec)

◆ operator=() [2/2]

template<class T>
const template_2d_array& ap::template_2d_array< T >::operator= ( const template_2d_array< T > &  rhs)
inline

Definition at line 837 of file svd_si.h.

840  {
841  m_Vec = new T[m_iVecSize];
842  #ifndef UNSAFE_MEM_COPY
843  for(int i=0; i<m_iVecSize; i++)
844  m_Vec[i] = rhs.m_Vec[i];
845  #else
846  memcpy(m_Vec, rhs.m_Vec, m_iVecSize*sizeof(T));
847  #endif
848  }
849  else
850  m_Vec=0;
851  };
853  {
854  if( this==&rhs )
855  return *this;
856 
857  m_iLow1 = rhs.m_iLow1;
858  m_iLow2 = rhs.m_iLow2;
859  m_iHigh1 = rhs.m_iHigh1;
860  m_iHigh2 = rhs.m_iHigh2;
861  m_iConstOffset = rhs.m_iConstOffset;
862  m_iLinearMember = rhs.m_iLinearMember;
863  m_iVecSize = rhs.m_iVecSize;
864  if(m_Vec)

◆ setbounds() [1/2]

template<class T>
void ap::template_2d_array< T >::setbounds ( int  iLow1,
int  iHigh1,
int  iLow2,
int  iHigh2 
)
inline

Definition at line 875 of file ap.h.

882  {
883  #ifndef NO_AP_ASSERT
886  #endif
887  return m_Vec[ m_iConstOffset + i2 +i1*m_iLinearMember];

◆ setbounds() [2/2]

template<class T>
void ap::template_2d_array< T >::setbounds ( int  iLow1,
int  iHigh1,
int  iLow2,
int  iHigh2 
)
inline

Definition at line 884 of file svd_si.h.

891  {
892  #ifndef NO_AP_ASSERT
895  #endif
896  return m_Vec[ m_iConstOffset + i2 +i1*m_iLinearMember];

◆ setcontent() [1/2]

template<class T>
void ap::template_2d_array< T >::setcontent ( int  iLow1,
int  iHigh1,
int  iLow2,
int  iHigh2,
const T pContent 
)
inline

Definition at line 889 of file ap.h.

891  {
892  if(m_Vec)
893  delete[] m_Vec;
894  m_iVecSize = (iHigh1-iLow1+1)*(iHigh2-iLow2+1);

◆ setcontent() [2/2]

template<class T>
void ap::template_2d_array< T >::setcontent ( int  iLow1,
int  iHigh1,
int  iLow2,
int  iHigh2,
const T pContent 
)
inline

Definition at line 898 of file svd_si.h.

900  {
901  if(m_Vec)
902  delete[] m_Vec;
903  m_iVecSize = (iHigh1-iLow1+1)*(iHigh2-iLow2+1);

◆ wrongColumn() [1/2]

template<class T>
bool ap::template_2d_array< T >::wrongColumn ( int  j) const
inlineprivate

Definition at line 949 of file ap.h.

956 {

◆ wrongColumn() [2/2]

template<class T>
bool ap::template_2d_array< T >::wrongColumn ( int  j) const
inlineprivate

Definition at line 958 of file svd_si.h.

965 {

◆ wrongRow() [1/2]

template<class T>
bool ap::template_2d_array< T >::wrongRow ( int  i) const
inlineprivate

Definition at line 948 of file ap.h.

948 {

◆ wrongRow() [2/2]

template<class T>
bool ap::template_2d_array< T >::wrongRow ( int  i) const
inlineprivate

Definition at line 957 of file svd_si.h.

957 {

Field Documentation

◆ m_iConstOffset

template<class T>
long ap::template_2d_array< T >::m_iConstOffset
private

Definition at line 954 of file ap.h.

◆ m_iHigh1

template<class T>
long ap::template_2d_array< T >::m_iHigh1
private

Definition at line 953 of file ap.h.

◆ m_iHigh2

template<class T>
long ap::template_2d_array< T >::m_iHigh2
private

Definition at line 953 of file ap.h.

◆ m_iLinearMember

template<class T>
long ap::template_2d_array< T >::m_iLinearMember
private

Definition at line 954 of file ap.h.

◆ m_iLow1

template<class T>
long ap::template_2d_array< T >::m_iLow1
private

Definition at line 953 of file ap.h.

◆ m_iLow2

template<class T>
long ap::template_2d_array< T >::m_iLow2
private

Definition at line 953 of file ap.h.

◆ m_iVecSize

template<class T>
long ap::template_2d_array< T >::m_iVecSize
private

Definition at line 952 of file ap.h.

◆ m_Vec

template<class T>
T * ap::template_2d_array< T >::m_Vec
private

Definition at line 949 of file ap.h.


The documentation for this class was generated from the following files:
ap::template_2d_array::getlowbound
int getlowbound(int iBoundNum) const
Definition: ap.h:906
ap::template_2d_array::template_2d_array
template_2d_array()
Definition: ap.h:794
ap::template_2d_array::m_Vec
T * m_Vec
Definition: ap.h:949
ap::template_2d_array::m_iLinearMember
long m_iLinearMember
Definition: ap.h:954
ap::template_2d_array::wrongColumn
bool wrongColumn(int j) const
Definition: ap.h:949
ap::template_2d_array::m_iConstOffset
long m_iConstOffset
Definition: ap.h:954
ap::template_2d_array::m_iLow1
long m_iLow1
Definition: ap.h:953
ap::template_2d_array::m_iHigh2
long m_iHigh2
Definition: ap.h:953
i
int i
Definition: cfEzgcd.cc:125
ap::template_2d_array::wrongRow
bool wrongRow(int i) const
Definition: ap.h:948
ap::template_2d_array::m_iLow2
long m_iLow2
Definition: ap.h:953
ap::template_2d_array::m_iVecSize
long m_iVecSize
Definition: ap.h:952
T
STATIC_VAR jList * T
Definition: janet.cc:30
ap::template_2d_array::~template_2d_array
~template_2d_array()
Definition: ap.h:800
ap::ap_error::make_assertion
static void make_assertion(bool bClause)
Definition: ap.h:51
ap::template_2d_array::operator=
const template_2d_array & operator=(const template_2d_array &rhs)
Definition: ap.h:828
ap::template_2d_array::m_iHigh1
long m_iHigh1
Definition: ap.h:953