本文整理汇总了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();
}
示例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);
}
示例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);
}
}
}
示例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();
}
示例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);
}
}
示例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()));
}
示例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();
}
示例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;
}
示例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;
}
示例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.");
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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"));
}
示例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"));
}