コード例 #1
0
void SAWindow::SearchOnSortedCells(bool trial)
{
  BubbleSortWindowElement(cells, nCells);
  int nIters = nItersOnSortedCells;
  T = MAX_T;

  if (trial == true)
  {
    nIters = nCells * 3;
    //T = 50;

    for (int iter = 0; iter < nIters; iter++)
    {
      int randCellInd = GetRandomCell();
      ShiftCell(randCellInd);
      ReduceTemperature();
    }

    /*while (T >= MIN_T)
    {
    int randCellInd = GetRandomCell();
    ShiftCell(randCellInd);
    ReduceTemperature();
    }*/
  }

  else
  {
    while (T >= MIN_T)
    {
      int randCellInd = GetRandomCell();
      ShiftCell(randCellInd);
      ReduceTemperature();
    }

    for (int i = 0; i < nCells; i++)
      cells[i] = optimalCoords[i];
  }    
}
コード例 #2
0
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

#include "nsUCConstructors.h"
#include "nsUnicodeToMacFarsi.h"

//----------------------------------------------------------------------
// Global functions and data [declaration]

static const PRUint16 g_ufMappingTable[] = {
#include "macfarsi.uf"
};

static const PRInt16 g_ufShiftTable[] =  {
  0, u1ByteCharset ,
  ShiftCell(0,0,0,0,0,0,0,0)
};

NS_METHOD
nsUnicodeToMacFarsiConstructor(nsISupports *aOuter, REFNSIID aIID,
                               void **aResult) 
{
  return CreateTableEncoder((uShiftTable*) &g_ufShiftTable, 
                            (uMappingTable*) &g_ufMappingTable, 1,
                            aOuter, aIID, aResult);
}
コード例 #3
0
 *
 * ***** END LICENSE BLOCK ***** */

#include "nsUCConstructors.h"
#include "nsUnicodeToSJIS.h"

//----------------------------------------------------------------------
// Global functions and data [declaration]

static const PRUint16 g_SJISMappingTable[] = {
#include "sjis.uf"
};

static const PRInt16 g_SJISShiftTable[] =  {
  4, uMultibytesCharset,
  ShiftCell(u1ByteChar,   1, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x7F),
  ShiftCell(u1ByteChar,   1, 0xA1, 0xDF, 0x00, 0xA1, 0x00, 0xDF),
  ShiftCell(u2BytesChar,  2, 0x81, 0x9F, 0x81, 0x40, 0x9F, 0xFC),
  ShiftCell(u2BytesChar,  2, 0xE0, 0xFC, 0xE0, 0x40, 0xFC, 0xFC)
};

NS_METHOD
nsUnicodeToSJISConstructor(nsISupports *aOuter, REFNSIID aIID,
                            void **aResult)
{
  return CreateTableEncoder((uShiftTable*) &g_SJISShiftTable, 
                            (uMappingTable*) &g_SJISMappingTable,
                            2 /* max length = src * 2 */,
                            aOuter, aIID, aResult);
}
コード例 #4
0
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

#include "nsUnicodeToEUCJP.h"
#include "nsUCVJADll.h"
#include "nsUCConstructors.h"

//----------------------------------------------------------------------
// Global functions and data [declaration]

// Shift Table
static const PRInt16 g0201ShiftTable[] =  {
        2, uMultibytesCharset,
        ShiftCell(u1ByteChar,           1, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x7F),
        ShiftCell(u1BytePrefix8EChar, 2, 0x8E, 0x8E, 0x00, 0xA1, 0x00, 0xDF)
};
static const PRInt16 g0208ShiftTable[] =  {
        0, u2BytesGRCharset,
        ShiftCell(0,0,0,0,0,0,0,0)
};

static const PRInt16 g0212ShiftTable[] =  {
        0, u2BytesGRPrefix8FCharset, 
        ShiftCell(0,0,0,0,0,0,0,0)
};
#define SIZE_OF_TABLES 5
static const PRInt16 *gShiftTables[SIZE_OF_TABLES] =  {
    g0208ShiftTable,
    g0208ShiftTable,