當前位置: 首頁>>代碼示例>>Java>>正文


Java OperationNotSupportedException類代碼示例

本文整理匯總了Java中javax.naming.OperationNotSupportedException的典型用法代碼示例。如果您正苦於以下問題:Java OperationNotSupportedException類的具體用法?Java OperationNotSupportedException怎麽用?Java OperationNotSupportedException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


OperationNotSupportedException類屬於javax.naming包,在下文中一共展示了OperationNotSupportedException類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initialise

import javax.naming.OperationNotSupportedException; //導入依賴的package包/類
/**
 * Initialises the solver object, taking into account a list of positions of
 * A that may need to be updated when requested. This is needed by the MoM 
 * algorithm. 
 * @param A The matrix A of the linear system Ax = b
 * @param UList The list containing these positions as Tuple objects
 * @throws OperationNotSupportedException Thrown when the matrix A is not square
 */
@Override
public void initialise(BigRational[][] A, List<Tuple<Integer, Integer>> UList, Set<Integer> uncomputables) throws OperationNotSupportedException {
    t.start();
    this.A = A;
    N = A.length;
    if (A[0].length != N) {
        throw new OperationNotSupportedException("Matrix A of linear system is not square.");
    }
    this.UList = UList;
    this.uncomputables = uncomputables;
    curULevel = 0;

    cleanA = new BigRational[N][N];
    MiscFunctions.arrayCopy(A, cleanA);
    t.pause();
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:25,代碼來源:Solver.java

示例2: computeNormalisingConstant

import javax.naming.OperationNotSupportedException; //導入依賴的package包/類
@Override
   public void computeNormalisingConstant() throws InternalErrorException, OperationNotSupportedException, InconsistentLinearSystemException, BTFMatrixErrorException {
	
	current_N = new PopulationVector(0,R);		
			
	for (int _class = 1; _class <= R; _class++) {
		System.out.println("Working on class " + _class);
		System.out.println("Current Population: " + current_N);
		
		current_N.plusOne(_class);
		system.initialiseForClass(current_N, _class);
	
		solveForClass(_class);			
	}						
	
	//Store the computed normalsing constant
	BigRational G = basis.getNormalisingConstant();
	qnm.setNormalisingConstant(G);			
					
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:21,代碼來源:CoMoMSolver.java

示例3: solveForClass

import javax.naming.OperationNotSupportedException; //導入依賴的package包/類
private  void solveForClass(int _class) throws InternalErrorException, OperationNotSupportedException, InconsistentLinearSystemException, BTFMatrixErrorException {
	/*
	//If no jobs of current_class in target population, move onto next class
	if (target_N.get(current_class - 1) == 0) {
		return;
	}				
	*/
	for (int class_population = current_N.get(_class - 1); 
			class_population <= target_N.get(_class - 1); 
			class_population++ ) {
		
		
		System.out.println("Solving for population: " + current_N);
		System.out.println(class_population);
		
		system.update(class_population);
		
		system.solve();
					
		if (class_population < target_N.get(_class - 1)) {
			
			current_N.plusOne(_class);
		}
	}		
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:26,代碼來源:CoMoMSolver.java

示例4: solve

import javax.naming.OperationNotSupportedException; //導入依賴的package包/類
@Override
public void solve() throws OperationNotSupportedException, InconsistentLinearSystemException, InternalErrorException, BTFMatrixErrorException {
	
	basis.startBasisComputation();
	//System.out.println("BEFORE: ");
	//basis.print_values();
	
	//Order of solving is important:
	//B First
	b1.solve(rhs);
	b2.solve(rhs);
	c.solve(rhs);
	
	//Then A; Y then X
	y.solve(rhs);
	//System.out.println("AFTER Y: ");
	//basis.print_values();
	x.solve(rhs);		
	
	//basis.print_values();
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:22,代碼來源:BTFLinearSystem.java

示例5: solve

import javax.naming.OperationNotSupportedException; //導入依賴的package包/類
@Override
public void solve() throws OperationNotSupportedException,
		InconsistentLinearSystemException, InternalErrorException,
		BTFMatrixErrorException {
	
	basis.startBasisComputation();
	
	System.out.println("Solving System...\n");
	BigRational[] sysB  = B.multiply();
	
	BigRational[] result = solver.solve(sysB);
	
	for (int i = 0; i < basis.getSize(); i++) {
		basis.setValue(result[i], i);
	}
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:17,代碼來源:SimpleLinearSystem.java

示例6: initialiseMatricesForClass

import javax.naming.OperationNotSupportedException; //導入依賴的package包/類
@Override
public void initialiseMatricesForClass(PopulationVector current_N, int current_class)
		throws InternalErrorException, BTFMatrixErrorException, InconsistentLinearSystemException, OperationNotSupportedException {
	System.out.println("current_class: " + current_class);
	generateAB(current_N, current_class);
	
	System.out.println("Intialising A and B:");
	if (Main.verbose) { 
		System.out.println("A:");
		A.print();
		System.out.println("B:");
		B.print();
	}
	
	 Integer maxA = (int)getMaxAElement();
     Integer val = basis.getSize();
     BigInteger maxB = qnm.getMaxG().multiply(new BigInteger(maxA.toString())).multiply(new BigInteger(val.toString()));
     solver.initialise(A.getArray(), A.getUpdateList(), basis.getUncomputables(), maxA, maxB, new BigRational(qnm.getMaxG()));
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:20,代碼來源:SimpleLinearSystem.java

示例7: initialise

import javax.naming.OperationNotSupportedException; //導入依賴的package包/類
@Override
public void initialise(BigRational[][] A, List<Tuple<Integer, Integer>> UList, Set<Integer> uncomputables, int maxA, BigInteger maxb, BigRational maxG) throws OperationNotSupportedException, InternalErrorException {
    t.start();
    super.initialise(A, UList, uncomputables);
    //this.previousInvocationSwapped = false;
    this.maxA = new BigInteger((new Integer(maxA).toString()));
    //this.maxOfAColumns = maxOfAColumns;
    this.maxG = maxG;
    int bitlength = lowerLimitForMMorhac(this.maxA, maxb);
    //int bitlength = lowerLimitForMG(this.maxG.asBigDecimal().toBigIntegerExact());
    if (bitlength > M.bitLength()) {
        System.out.println("Selecting moduli. Total bitlength: " + bitlength);
        moduliSelectionTimer.start();
        moduli = new ArrayList<BigInteger>(nThreads);
        M = BigInteger.ONE;
        for (BigInteger m : moduli) {
            M = M.multiply(m);
        }

        //selectModuli(bitlength);
        // Report linear system only
        /*BigInteger m = new BigInteger("775239");
        moduli.add(m);
        M = M.multiply(moduli.get(moduli.size()-1));
        minModulo = m;
        moduli.add(new BigInteger("1942111"));
        M = M.multiply(moduli.get(moduli.size()-1));*/
        selectModuliInParallel(bitlength);
        if (M.bitLength() < bitlength || minModulo.compareTo(this.maxA) <= 0) {
            throw new InternalErrorException("Cannot select moduli");
        }
        moduliSelectionTimer.pause();
        System.out.println("Moduli selection took " + moduliSelectionTimer.getPrettyInterval() + ".\nWill now solve " + moduli.size() + " residue systems.");
    }
    taskList = new ArrayList<ModularSolverParallelTask>(moduli.size());
    for (int i = 0; i < moduli.size(); i++) {
        taskList.add(new ModularSolverParallelTask(moduli.get(i), M));
    }
    t.pause();
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:41,代碼來源:ModularSolver.java

示例8: checkWritable

import javax.naming.OperationNotSupportedException; //導入依賴的package包/類
/**
 * Throws a naming exception is Context is not writable.
 */
protected boolean checkWritable() throws NamingException {
    if (isWritable()) {
        return true;
    } else {
        if (exceptionOnFailedWrite) {
            throw new javax.naming.OperationNotSupportedException(
                    sm.getString("namingContext.readOnly"));
        }
    }
    return false;
}
 
開發者ID:sunmingshuai,項目名稱:apache-tomcat-7.0.73-with-comment,代碼行數:15,代碼來源:NamingContext.java

示例9: solve

import javax.naming.OperationNotSupportedException; //導入依賴的package包/類
private BigRational[] solve(Solver s, BigRational[] b) throws InconsistentLinearSystemException, OperationNotSupportedException, InternalErrorException {
    BigRational[] sol = s.solve(b);
    // If the first element (current normalising constant) has been corrupted
    // then there is no recovery
    if (sol[0].isUndefined()) {
        throw new InconsistentLinearSystemException("Singular system. Cannot proceed.");
    }
    return sol;
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:10,代碼來源:MoMSolver.java

示例10: RecursiveSolver

import javax.naming.OperationNotSupportedException; //導入依賴的package包/類
/**
 * Creates and initialises a RecursiveSolver object.
 *
 * @param qnm The QNModel object that we are working on
 * @throws InternalErrorException Thrown when the solver cannot be initialised
 */
public RecursiveSolver(QNModel qnm) throws InternalErrorException {
    super(qnm);
    try {
        initialise();
    } catch (OperationNotSupportedException ex) {
        Logger.getLogger(RecursiveSolver.class.getName()).log(Level.SEVERE, null, ex);
        throw new InternalErrorException("Initialisation failed.");
    }
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:16,代碼來源:RecursiveSolver.java

示例11: getMaxG

import javax.naming.OperationNotSupportedException; //導入依賴的package包/類
/**
 * Returns the maximum possible normalising constant of the queueing network.
 * @return The maximum value as a BigInteger object
 * @throws OperationNotSupportedException Thrown if the maximum normalising constant cannot be computed
 */
public BigInteger getMaxG() throws OperationNotSupportedException {
    double Dmax = MiscFunctions.max(Z);
    for (int k = 0; k < this.M; k++) {
        for (int r = 0; r < this.R; r++) {
            if (D[k][r] > Dmax) {
                Dmax = D[k][r];
            }
        }
    }
    int Ntot = N.sum();
    int nmax = (int) (Math.round(Math.ceil(Math.log10(Dmax * (Ntot + M + R)))) * Ntot);
    return BigInteger.TEN.pow(nmax + 1);
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:19,代碼來源:QNModel.java

示例12: solve

import javax.naming.OperationNotSupportedException; //導入依賴的package包/類
@Override
public void solve(BigRational[] rhs) throws BTFMatrixErrorException, OperationNotSupportedException, InconsistentLinearSystemException, InternalErrorException {
	
	//Need to solve in bottom to top order, with secondary macro blocks interleaved
	
	//First solve last, alone macro block
	macro_blocks[macro_blocks.length - 1].solve(rhs);
	
	//Now, solve secondary macro block, marco block pairs in reverse order:
	for (int i =  sec_macro_blocks.length - 1; i >= 0; i--) {
		sec_macro_blocks[i].solve(rhs);
		macro_blocks[i].solve(rhs);
	}
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:15,代碼來源:ATopLevelBlock.java

示例13: solve2

import javax.naming.OperationNotSupportedException; //導入依賴的package包/類
/**
 * Alternative solve that uses the simple linear system solver
 * @param rhs
 * @throws BTFMatrixErrorException
 * @throws OperationNotSupportedException
 * @throws InconsistentLinearSystemException
 * @throws InternalErrorException
 */
public void solve2(BigRational[] rhs) throws BTFMatrixErrorException, OperationNotSupportedException, InconsistentLinearSystemException, InternalErrorException {
	System.out.print("Solving XMicroBlock...\n\n");
	
	BigRational[] sysB = new BigRational[size.row];
	BigRational[] result = new BigRational[size.row];
	
	//copy portion of rhs to sysB
	for (int i = 0; i < size.row; i++) {
		sysB[i] = rhs[position.row + i];
	}
	
	System.out.println("SysB");
	MiscFunctions.printMatrix(sysB);
	
	//Solve...
	solver = new SimpleSolver();
	solver.initialise(array,  new LinkedList<Tuple<Integer, Integer>>()	, new HashSet<Integer>());
	
	result = solver.solve(sysB);
	
	System.out.println("result");
	MiscFunctions.printMatrix(result);
	//copy result to basis
	for (int i = 0; i < size.row; i++) {
		basis.setValue(result[i], position.row + i);
	}
	
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:37,代碼來源:XMicroBlock.java

示例14: encrypt

import javax.naming.OperationNotSupportedException; //導入依賴的package包/類
@Override
public void encrypt(final InputStream inputStream, final OutputStream outputStream) {
    throw new RuntimeException(new OperationNotSupportedException("Encrypting input stream is not supported"));
}
 
開發者ID:hsj-xiaokang,項目名稱:springboot-shiro-cas-mybatis,代碼行數:5,代碼來源:CasWebflowCipherBean.java

示例15: decrypt

import javax.naming.OperationNotSupportedException; //導入依賴的package包/類
@Override
public void decrypt(final InputStream inputStream, final OutputStream outputStream) {
    throw new RuntimeException(new OperationNotSupportedException("Decrypting input stream is not supported"));
}
 
開發者ID:hsj-xiaokang,項目名稱:springboot-shiro-cas-mybatis,代碼行數:5,代碼來源:CasWebflowCipherBean.java


注:本文中的javax.naming.OperationNotSupportedException類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。