vnl_double_3x3 OuterProduct(const vnl_double_3 &A, const vnl_double_3 &B) { //vnl_double_3x3 A_mat = VectorToMatrix(A); //vnl_double_3x3 B_mat = VectorToMatrix(B); vnl_matrix<double> A_mat = VectorToMatrix(A); vnl_matrix<double> B_mat = VectorToMatrix(B); vnl_double_3x3 OP = A_mat*B_mat.transpose(); return OP; }
////Init Matrix void PermMatrixNew::InitAutoMorphMatrix(unsigned long matrixSize, unsigned long cellSize , unsigned char *matrixVector) { this->matrixSize = matrixSize; this->cellSize = cellSize; this->matrixVector = matrixVector; //this->currRows = new unsigned long[matrixSize]; //this->prevRows = new unsigned long[matrixSize]; //this->currColumns = new unsigned long[matrixSize]; //this->prevColumns = new unsigned long[matrixSize]; this->matrix = NULL; this->matrixVector = NULL; this->matrix = (unsigned char***)malloc(sizeof(char**)*matrixSize); for(int i=0;i<matrixSize;i++){ this->matrix[i] = (unsigned char**)malloc(sizeof(char**)*matrixSize); for(int j=0;j<matrixSize;j++){ this->matrix[i][j] = (unsigned char*)malloc(cellSize); } } VectorToMatrix(); }