My Project  UNKNOWN_GIT_VERSION
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 802 of file svd_si.h.

815 {

◆ ~template_2d_array() [2/2]

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

Definition at line 808 of file svd_si.h.

815 {

◆ 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 814 of file svd_si.h.

815 {
816 public:
818  {
819  m_Vec=0;
820  m_iVecSize=0;
821  };
822 
824  {
825  if(m_Vec)
826  delete[] m_Vec;
827  };
828 
830  {
831  m_iVecSize = rhs.m_iVecSize;
832  m_iLow1 = rhs.m_iLow1;
833  m_iLow2 = rhs.m_iLow2;
834  m_iHigh1 = rhs.m_iHigh1;
835  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 924 of file svd_si.h.

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

◆ 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 940 of file svd_si.h.

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

◆ 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 904 of file svd_si.h.

913  {

◆ 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 909 of file svd_si.h.

913  {

◆ 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 919 of file svd_si.h.

920  {
921  return m_Vec;
922  };

◆ 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 914 of file svd_si.h.

920  {

◆ 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 932 of file svd_si.h.

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

◆ 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 948 of file svd_si.h.

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

◆ 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 874 of file svd_si.h.

881  {

◆ 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 865 of file svd_si.h.

866  {
867  m_Vec = new T[m_iVecSize];
868  #ifndef UNSAFE_MEM_COPY
869  for(int i=0; i<m_iVecSize; i++)
870  m_Vec[i] = rhs.m_Vec[i];
871  #else
872  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 836 of file svd_si.h.

839  {
840  m_Vec = new T[m_iVecSize];
841  #ifndef UNSAFE_MEM_COPY
842  for(int i=0; i<m_iVecSize; i++)
843  m_Vec[i] = rhs.m_Vec[i];
844  #else
845  memcpy(m_Vec, rhs.m_Vec, m_iVecSize*sizeof(T));
846  #endif
847  }
848  else
849  m_Vec=0;
850  };
852  {
853  if( this==&rhs )
854  return *this;
855 
856  m_iLow1 = rhs.m_iLow1;
857  m_iLow2 = rhs.m_iLow2;
858  m_iHigh1 = rhs.m_iHigh1;
859  m_iHigh2 = rhs.m_iHigh2;
860  m_iConstOffset = rhs.m_iConstOffset;
861  m_iLinearMember = rhs.m_iLinearMember;
862  m_iVecSize = rhs.m_iVecSize;
863  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 883 of file svd_si.h.

890  {
891  #ifndef NO_AP_ASSERT
894  #endif
895  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 897 of file svd_si.h.

899  {
900  if(m_Vec)
901  delete[] m_Vec;
902  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 957 of file svd_si.h.

964 {

◆ 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 956 of file svd_si.h.

956 {

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
T
static jList * T
Definition: janet.cc:31
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
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