abc-master
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include "abc_global.h"
Go to the source code of this file.
Functions | |
ABC_NAMESPACE_IMPL_START void | Abc_SortMerge (int *p1Beg, int *p1End, int *p2Beg, int *p2End, int *pOut) |
DECLARATIONS ///. More... | |
void | Abc_Sort_rec (int *pInBeg, int *pInEnd, int *pOutBeg) |
void | Abc_MergeSort (int *pInput, int nSize) |
void | Abc_MergeSortCostMerge (int *p1Beg, int *p1End, int *p2Beg, int *p2End, int *pOut) |
void | Abc_MergeSortCost_rec (int *pInBeg, int *pInEnd, int *pOutBeg) |
int * | Abc_MergeSortCost (int *pCosts, int nSize) |
int | Abc_SortNumCompare (int *pNum1, int *pNum2) |
void | Abc_SortTest () |
int | Abc_QuickSort1CompareInc (word *p1, word *p2) |
int | Abc_QuickSort1CompareDec (word *p1, word *p2) |
void | Abc_QuickSort1 (word *pData, int nSize, int fDecrease) |
static void | Abc_SelectSortInc (word *pData, int nSize) |
static void | Abc_SelectSortDec (word *pData, int nSize) |
void | Abc_QuickSort2Inc_rec (word *pData, int l, int r) |
void | Abc_QuickSort2Dec_rec (word *pData, int l, int r) |
void | Abc_QuickSort3Inc_rec (word *pData, int l, int r) |
void | Abc_QuickSort3Dec_rec (word *pData, int l, int r) |
void | Abc_QuickSort2 (word *pData, int nSize, int fDecrease) |
void | Abc_QuickSort3 (word *pData, int nSize, int fDecrease) |
void | Abc_QuickSortCostData (int *pCosts, int nSize, int fDecrease, word *pData, int *pResult) |
int * | Abc_QuickSortCost (int *pCosts, int nSize, int fDecrease) |
void | Abc_QuickSortTest () |
void Abc_MergeSort | ( | int * | pInput, |
int | nSize | ||
) |
Function*************************************************************
Synopsis [Returns the sorted array of integers.]
Description [This procedure is about 10% faster than qsort().]
SideEffects []
SeeAlso []
Definition at line 129 of file utilSort.c.
int* Abc_MergeSortCost | ( | int * | pCosts, |
int | nSize | ||
) |
Function*************************************************************
Synopsis [Sorting procedure.]
Description [Returns permutation for the non-decreasing order of costs.]
SideEffects []
SeeAlso []
Definition at line 238 of file utilSort.c.
void Abc_MergeSortCost_rec | ( | int * | pInBeg, |
int * | pInEnd, | ||
int * | pOutBeg | ||
) |
Function*************************************************************
Synopsis [Recursive sorting.]
Description []
SideEffects []
SeeAlso []
Definition at line 183 of file utilSort.c.
void Abc_MergeSortCostMerge | ( | int * | p1Beg, |
int * | p1End, | ||
int * | p2Beg, | ||
int * | p2End, | ||
int * | pOut | ||
) |
Function*************************************************************
Synopsis [Merging two lists of entries.]
Description []
SideEffects []
SeeAlso []
Definition at line 152 of file utilSort.c.
void Abc_QuickSort1 | ( | word * | pData, |
int | nSize, | ||
int | fDecrease | ||
) |
Definition at line 477 of file utilSort.c.
Definition at line 469 of file utilSort.c.
Function*************************************************************
Synopsis [QuickSort algorithm as implemented by qsort().]
Description []
SideEffects []
SeeAlso []
Definition at line 461 of file utilSort.c.
void Abc_QuickSort2 | ( | word * | pData, |
int | nSize, | ||
int | fDecrease | ||
) |
Definition at line 662 of file utilSort.c.
void Abc_QuickSort2Dec_rec | ( | word * | pData, |
int | l, | ||
int | r | ||
) |
Definition at line 564 of file utilSort.c.
void Abc_QuickSort2Inc_rec | ( | word * | pData, |
int | l, | ||
int | r | ||
) |
Definition at line 538 of file utilSort.c.
void Abc_QuickSort3 | ( | word * | pData, |
int | nSize, | ||
int | fDecrease | ||
) |
Definition at line 680 of file utilSort.c.
void Abc_QuickSort3Dec_rec | ( | word * | pData, |
int | l, | ||
int | r | ||
) |
Definition at line 626 of file utilSort.c.
void Abc_QuickSort3Inc_rec | ( | word * | pData, |
int | l, | ||
int | r | ||
) |
Definition at line 591 of file utilSort.c.
int* Abc_QuickSortCost | ( | int * | pCosts, |
int | nSize, | ||
int | fDecrease | ||
) |
Definition at line 719 of file utilSort.c.
void Abc_QuickSortCostData | ( | int * | pCosts, |
int | nSize, | ||
int | fDecrease, | ||
word * | pData, | ||
int * | pResult | ||
) |
Function*************************************************************
Synopsis [Wrapper around QuickSort to sort entries based on cost.]
Description []
SideEffects []
SeeAlso []
Definition at line 710 of file utilSort.c.
void Abc_QuickSortTest | ( | ) |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 742 of file utilSort.c.
|
inlinestatic |
Definition at line 525 of file utilSort.c.
|
inlinestatic |
Function*************************************************************
Synopsis [QuickSort algorithm based on 2/3-way partitioning.]
Description [This code is based on the online presentation "QuickSort is Optimal" by Robert Sedgewick and Jon Bentley. http://www.sorting-algorithms.com/static/QuicksortIsOptimal.pdf
The first 32-bits of the input data contain values to be compared. The last 32-bits contain the user's data. When sorting is finished, the 64-bit words are ordered in the increasing order of their value ]
SideEffects []
SeeAlso []
Definition at line 513 of file utilSort.c.
void Abc_Sort_rec | ( | int * | pInBeg, |
int * | pInEnd, | ||
int * | pOutBeg | ||
) |
Function*************************************************************
Synopsis [Recursive sorting.]
Description []
SideEffects []
SeeAlso []
Definition at line 80 of file utilSort.c.
ABC_NAMESPACE_IMPL_START void Abc_SortMerge | ( | int * | p1Beg, |
int * | p1End, | ||
int * | p2Beg, | ||
int * | p2End, | ||
int * | pOut | ||
) |
DECLARATIONS ///.
CFile****************************************************************
FileName [utilSort.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Merge sort with user-specified cost.]
Synopsis [Merge sort with user-specified cost.]
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - Feburary 13, 2011.]
Revision [
]FUNCTION DEFINITIONS /// Function*************************************************************
Synopsis [Merging two lists of entries.]
Description []
SideEffects []
SeeAlso []
Definition at line 49 of file utilSort.c.
int Abc_SortNumCompare | ( | int * | pNum1, |
int * | pNum2 | ||
) |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 382 of file utilSort.c.
void Abc_SortTest | ( | ) |
Function*************************************************************
Synopsis [Testing the sorting procedure.]
Description []
SideEffects []
SeeAlso []
Definition at line 398 of file utilSort.c.