12.3
void InitMat()
{
unsigned int cursize = size;
int i = 0;
int j = 0;
//Row and col pointers
RowPointer = new MatElemPtr[size];
ColPointer = new MatElemPtr[size];
//Indicate whether col and row is still in the current mat
ColIn = new bool[size];
RowIn = new bool[size];
//Record #node of each row and col
NodeNumRow = new int[size];
NodeNumCol = new int[size];
RowColIn = new bool*[size];
for( i = 0; i < size; i++)
{
RowColIn[i] = new bool[size];
memset(RowColIn[i],true,size*sizeof(bool));
RowPointer[i]=NULL;
ColPointer[i]=NULL;
}
memset(ColIn,true,size*sizeof(bool));
memset(RowIn,true,size*sizeof(bool));
memset(NodeNumRow,0,size*sizeof(int));
memset(NodeNumCol,0,size*sizeof(int));
}
{
unsigned int cursize = size;
int i = 0;
int j = 0;
//Row and col pointers
RowPointer = new MatElemPtr[size];
ColPointer = new MatElemPtr[size];
//Indicate whether col and row is still in the current mat
ColIn = new bool[size];
RowIn = new bool[size];
//Record #node of each row and col
NodeNumRow = new int[size];
NodeNumCol = new int[size];
RowColIn = new bool*[size];
for( i = 0; i < size; i++)
{
RowColIn[i] = new bool[size];
memset(RowColIn[i],true,size*sizeof(bool));
RowPointer[i]=NULL;
ColPointer[i]=NULL;
}
memset(ColIn,true,size*sizeof(bool));
memset(RowIn,true,size*sizeof(bool));
memset(NodeNumRow,0,size*sizeof(int));
memset(NodeNumCol,0,size*sizeof(int));
}