📄 simplex.java
字号:
package org.theblueplanet.annealing;import org.apache.log4j.Logger;/** * Holds the vertices of the simplex and the function value at the vertices * * @author Charles M間nin * @since October 29, 2001 * @version 1.0 */public class Simplex { private double[] vertex; private double value; private int ndim; private Logger logger = Logger.getLogger("org.theblueplanet.annealing"); /** * Constructor for the Simplex object * * @param vertex The vertices of the simplex * @param value The function value * @param ndim The number of dimensions */ public Simplex(double[] vertex, double value, int ndim) { this.ndim = ndim; this.vertex = new double[ndim + 1]; for (int ii = 0; ii <= ndim; ii++) { this.vertex[ii] = vertex[ii]; } this.value = value; } /** * Gets the Vertex attribute of the Simplex object * * @return The Vertex value */ public double[] getVertex() { return vertex; } /** * Gets the Value attribute of the Simplex object * * @return The Value value */ public double getValue() { return value; } /** * Echoes the Simplex Object to the Appender specified * * @see org.apache.log4j.Logger * @see org.apache.log4j.Appender */ public void toScreen() { for (int ii = 1; ii <= ndim; ii++) { logger.info("vertex[" + ii + "]= " + vertex[ii]); } logger.info("function value= " + value); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -