本文整理了Java中org.ujmp.core.Matrix.getAsObject()
方法的一些代码示例,展示了Matrix.getAsObject()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Matrix.getAsObject()
方法的具体详情如下:
包路径:org.ujmp.core.Matrix
类名称:Matrix
方法名:getAsObject
暂无
代码示例来源:origin: ujmp/universal-java-matrix-package
public Object getObject(long... coordinates) {
if (coordinates[ROW] >= coordinates[COLUMN] - k) {
return getSource().getAsObject(coordinates);
} else {
return null;
}
}
代码示例来源:origin: ujmp/universal-java-matrix-package
public static Object getObject(Object o) {
if (o == null) {
return null;
}
if (o instanceof Matrix) {
Matrix m = (Matrix) o;
if (m.getValueCount() == 1) {
return m.getAsObject(0, 0);
}
}
return o;
}
代码示例来源:origin: ujmp/universal-java-matrix-package
public Object getObject(long... coordinates) {
if (coordinates[ROW] <= coordinates[COLUMN] - k) {
return getSource().getAsObject(coordinates);
} else {
return null;
}
}
代码示例来源:origin: ujmp/universal-java-matrix-package
public boolean getBoolean(long... coordinates) {
Object o1 = getSource().getAsObject(coordinates);
Object o2 = getSources()[1].getAsObject(coordinates);
return MathUtil.equals(o1, o2);
}
}
代码示例来源:origin: ujmp/universal-java-matrix-package
public boolean getBoolean(long... coordinates) {
Object o1 = getSource().getAsObject(coordinates);
Object o2 = getSources()[1].getAsObject(coordinates);
return !MathUtil.equals(o1, o2);
}
}
代码示例来源:origin: ujmp/universal-java-matrix-package
public synchronized Object getObject(long row, long column) {
Coordinates c = Coordinates.wrap(row / tileSize[ROW], column / tileSize[COLUMN]);
Matrix m = getMap().get(c);
if (m == null) {
return null;
} else {
return m.getAsObject(row % tileSize[ROW], column % tileSize[COLUMN]);
}
}
代码示例来源:origin: ujmp/universal-java-matrix-package
public Object getObject(final long... coordinates) {
runningId = ++runningId >= maxTmpCoordinates ? 0 : runningId;
return getSource().getAsObject(
Coordinates.plus(tmpCoordinates[runningId], coordinates, min));
}
代码示例来源:origin: ujmp/universal-java-matrix-package
public Object getObject(long... coordinates) {
if (!Coordinates.isGreaterOrEqual(coordinates, position)) {
return getSource().getAsObject(coordinates);
}
long[] c = Coordinates.minus(coordinates, position);
if (Coordinates.isSmallerThan(c, newContent.getSize())) {
return newContent.getAsObject(c);
} else {
return getSource().getAsObject(coordinates);
}
}
代码示例来源:origin: ujmp/universal-java-matrix-package
public Object getObject(long... coordinates) {
if (selection == null) {
List<Integer> rows = new ArrayList<Integer>();
for (int i = 0; i < count; i++) {
int s = MathUtil.nextInteger(0, (int) getSource().getRowCount());
rows.add(s);
}
selection = getSource().selectRows(Ret.LINK, rows);
}
return selection.getAsObject(coordinates);
}
代码示例来源:origin: ujmp/universal-java-matrix-package
public Object getObject(long... coordinates) {
long index = MathUtil.pos2IndexColumnMajor(newSize, coordinates);
long[] oldPos = MathUtil.index2PosColumnMajor(oldSize, index);
return getSource().getAsObject(oldPos);
}
代码示例来源:origin: ujmp/universal-java-matrix-package
public AbstractMapToSparseMatrixWrapper(Map<Coordinates, Object> map, Matrix m) {
super(m.getSize());
this.size = Coordinates.copyOf(m.getSize());
this.values = map;
for (long[] c : m.allCoordinates()) {
setObject(m.getAsObject(c), c);
}
}
代码示例来源:origin: ujmp/universal-java-matrix-package
private void createUniqueObjects() {
if (uniqueObjects == null) {
uniqueObjects = new DefaultSetMatrix<Object>();
for (long[] c : getSource().availableCoordinates()) {
uniqueObjects.add(getSource().getAsObject(c));
}
}
}
代码示例来源:origin: ujmp/universal-java-matrix-package
public SerializedSparseObjectMatrix(Matrix source) throws IOException {
this(source.getSize());
for (long[] c : source.availableCoordinates()) {
setAsObject(source.getAsObject(c), c);
}
MapMatrix<String, Object> a = source.getMetaData();
if (a != null) {
setMetaData(a.clone());
}
}
代码示例来源:origin: ujmp/universal-java-matrix-package
public DefaultDenseGenericMatrix2D(Matrix m) {
super(m.getRowCount(), m.getColumnCount());
values = new Object[(int) m.getRowCount()][(int) m.getColumnCount()];
for (long[] c : m.allCoordinates()) {
setAsObject(m.getAsObject(c), c);
}
}
代码示例来源:origin: org.ujmp/ujmp-jdbc
public JDBCSparseObjectMatrix(Matrix source) throws ClassNotFoundException, IOException, SQLException {
this(source.getSize());
for (long[] c : source.availableCoordinates()) {
setAsObject(source.getAsObject(c), c);
}
if (source.getMetaData() != null) {
setMetaData(source.getMetaData().clone());
}
}
代码示例来源:origin: ujmp/universal-java-matrix-package
public AbstractMapToTiledMatrix2DWrapper(Map<Coordinates, ObjectMatrix2D> map, Matrix source) {
this(map, source.getRowCount(), source.getColumnCount());
for (long[] c : source.availableCoordinates()) {
setObject(source.getAsObject(c), c);
}
MapMatrix<String, Object> a = source.getMetaData();
if (a != null) {
setMetaData(a.clone());
}
}
代码示例来源:origin: ujmp/universal-java-matrix-package
public JDBCSparseObjectMatrix(Matrix source) throws ClassNotFoundException, IOException, SQLException {
this(source.getSize());
for (long[] c : source.availableCoordinates()) {
setAsObject(source.getAsObject(c), c);
}
if (source.getMetaData() != null) {
setMetaData(source.getMetaData().clone());
}
}
代码示例来源:origin: ujmp/universal-java-matrix-package
public DefaultSparseGenericMatrix(Matrix m, int maximumNumberOfEntries) {
super(m.getSize());
this.maximumNumberOfEntries = maximumNumberOfEntries;
for (long[] c : m.availableCoordinates()) {
setObject(m.getAsObject(c), c);
}
if (m.getMetaData() != null) {
setMetaData(m.getMetaData().clone());
}
}
代码示例来源:origin: ujmp/universal-java-matrix-package
public static Matrix calcNew(ValueType valueType, Matrix source) {
Matrix ret = Matrix.Factory.zeros(valueType, source.getSize());
for (long[] c : source.availableCoordinates()) {
ret.setAsObject(source.getAsObject(c), c);
}
MapMatrix<String, Object> a = source.getMetaData();
if (a != null) {
ret.setMetaData(a.clone());
}
return ret;
}
代码示例来源:origin: ujmp/universal-java-matrix-package
public Eq(Matrix m1, Matrix m2) {
super(m1, m2);
if (m2.isScalar() && !Coordinates.equals(m1.getSize(), m2.getSize())) {
getSources()[1] = Matrix.Factory.fill(m2.getAsObject(0, 0), m1.getSize());
} else if (m1.isScalar() && !Coordinates.equals(m1.getSize(), m2.getSize())) {
getSources()[0] = Matrix.Factory.fill(m1.getAsObject(0, 0), m2.getSize());
}
}
内容来源于网络,如有侵权,请联系作者删除!